Java Reference
In-Depth Information
FIGURE 4.4 The symbol table created by the pre-analysis phase for the Factorial
program.
4.5 Analysis ofj--Programs
Once we have declared and loaded all imported types, and we have declared the types
defined by class declarations, the compiler can execute the analysis phase.
The analysis phase recursively descends throughout the AST all the way to its leaves,
Rewriting field and local variable initializations as assignments,
Declaring both formal parameters and local variables,
Allocating locations in the stack frame for the formal parameters and local variables,
Computing the types of expressions and enforcing the language type rules,
Reclassifying ambiguous names, and
Doing a limited amount of tree surgery.
 
Search WWH ::




Custom Search