
364 Compilers – Principles and Practice
Note that though our Tree-base library does contain BST delete function, it is not used in the miniC
compiler and hence not shown here.
12.6 Scanner
The Scanner yylex() is included in the yacc source file miniC.y. We did not use lex or flex
to generate the Scanner. The Scanner is comparatively straightforward, but the handling of integer and
float constants possibly requires some explanation. An integer may be a prefix in a float value, which
makes the scanning somewhat tricky.
The Keywords, Built-in function names and proper variables all are detected as IDentifiers by
the Scanner, using the regular expression ...