12.9 Testing
Testing of the complete compiler was a long process. The following general steps were taken in the order shown:
The Scanner: yylex() within the yacc input file miniC.y was separately tested in three steps:
- First, without any Symbol Table activity, just to check if it did scan and detect required Lexical atoms.
- The Symbol Table routines were tested separately for creation insertion and access to the Symbol Table. This was simplified to some extent because we used well-tested Tree-base Tree-ADT functions.
- The Symbol Table access statements in the Scanner were activated and Scanner plus Symbol Table were tested together.
Parser: The Parser generated by yacc from the attributed grammar was tested in the following steps:
- The grammar ...
Get Compilers: Principles and Practice now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.