
What you will learn in this chapter
A Simple Translator
2
c
Grammar of a simple high level language
c
A lexical analyzer for that language
c
A Recursive-descent Parser
c
Intermediate code
c
How to generate code for a target machine?
c
A target virtual machine
c
Need for optimization
c
Simulator for the virtual machine
Key Words
simple, Scanner, parser, RDP, intermediate code, virtual machine,
simulator, optimization
In this chapter, we discuss a very simple C-like language called simple and its compiler. Though
due to pedagogic necessity the language is kept as simple as possible, it will illustrate all the
significant issues of a compiler construction. ...