9.1 Our Concerns in Code Generation
While designing a code generator, we are concerned about the following areas which form a framework in which the code generator will have to perform.
9.1.1 Input Intermediate Representation (IR)
The main inputs to the code generator are the IR from the semantic phase and contents of the Symbol Table. By the time the code generator accesses it, the Symbol Table has stored the type information for each variable and expression, worked out by the type-checking portion of the semantic phase.
There are several possible IRs, which we have already discussed in Chapter 5. The most useful are Reverse Polish Notation (RPN), 4-tuple (three-address) code (we call it a code-matrix) and Abstract Syntax Tree (AST).