
114 Compilers – Principles and Practice
One such non-ideal CC is YACC. It is a “front-end” CC, i.e. it provides automatic generation of the
initial phases of a full compiler, the Parser. A companion program, LEX, can be used to generate the
lexical analyzer or the Scanner. The later phases, viz., semantic analysis, code-generation, storage
allocation, symbol-table handling and optimization, etc., are to be added “manually” to make a
complete and full compiler.
On GNU/Linux systems, an improved version, called bison, is available, which is upward
compatible with YACC. A companion lexical analyzer generator named flex is also available.
For further ...