
Chapter 1
Compilation
1.1 Compilers
A compiler is a program that translates a source program written in a high-level program-
ming language such as Java, C#, or C, into an equivalent target program in a lower, level
language such as machine code, which can be executed directly by a computer. This trans-
lation is illustrated in Figure 1.1.
FIGURE 1.1 Compilation.
By equivalent, we mean semantics preserving: the translation should have the same
behavior as the original. This process of translation is called compilation.
1.1.1 Programming Languages
A programming language is an artificial language in which a programmer (usually a person)
writes a program