
5.4 Basic Compilation Techniques 229
5.4.1 Statement Translation
In this section, we consider the basic job of translating the high-level language
program with little or no optimization. Let’s first consider how to translate an expres-
sion. A large amount of the code in a typical application consists of arithmetic and
logical expressions. Understanding how to compile a single expression,as described
in Example 5.2,is a good first step in understanding the entire compilation process.
Example 5.2
Compiling an arithmetic expression
In the following arithmetic expression,
a*b + 5*(c – d)
the variable is written in terms of program variables. In some machines ...