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:

  1. First, without any Symbol Table activity, just to check if it did scan and detect required Lexical atoms.
  2. 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.
  3. 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:

  1. 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.