Professional Documents
Culture Documents
Intermediate-Code
Generation
outline
• With a suitably defined intermediate
representation, a compiler for language i and
machine j can then be built by combining the front
end for language i with the back end for machine j.
• This chapter deals with intermediate representations,
static type checking, and intermediate code
generation.
outline
x+y*z
D → T id ; D | ε
T → B C | record ‘{‘ D ‘}'
B → int | float
C → ε | [num] C
6.3.4 Storage Layout for Local Names
C.typ
e
6.3.4 Storage Layout for Local Names
• Example 6.9 : The parse tree for the type int [2][3] is shown
by dotted lines in Fig. 6.16. The solid lines show how the
type and width are passed from B,down the chain of C's
through variables t and w, and then back up the chain as
synthesized attributes type and width.