3.3 Compiler Writing Tools

Till now we have seen a few versions of hand-coded Scanners. Their designs were more or less ad hoc in the sense that a bit of common-sense and some amount of cut and try were used to implement them. As mentioned previously in Chapter 2, the operations of a Scanner can be specified in terms of a regular grammar, and systematic transformations of this grammar can give us a Scanner. The compiler writing tools such as lex and yacc use this idea to reduce the effort and time involved in implementing a compiler to considerable extent.

Before 1975 writing a compiler was a very time-consuming process. Most of the time it involved “boot-strapping” a compiler – programming in assembly language, write a hand-coded compiler for ...

Get Compilers: Principles and Practice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.