LOOKING FORWARD

In this chapter, we have discussed a simple language and its compiler and a virtual machine VM1 which interprets the target language. Out of necessity, the language and compiler were kept very simple and many issues of real-life programming languages and their compilers were simply ignored.

The various phases of the compiler were “hand-coded” and no attempt was made to make them efficient or elegant.

For developing compilers for real-life languages, it is usual to use compiler writing tools. There are several of them available, but we shall gradually introduce two of them – a Scanner generator lex and its derivative flex, and a parser generator yacc (yet another compiler compiler) and its enhanced version bison. Much of the tedium ...

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.