Академический Документы
Профессиональный Документы
Культура Документы
Assemblers
Phases Phases
• Between phases source
– Represent the source to reflect the analysis done.
– Abstract Syntax Tree Syntactic analysis Error report
• AST – representst the source phrase structure. AST
– Subtrees for commands, expressions, declarations…….. Contextual analysis Error report
– Leaf nodes are the identifiers, literals and operators of
Decorated AST
the source code.
Code Generation
Object program
Example of Compilation
• standard procedures (print)
– may receive default declaration before translation
• tree contains pointers to symbol table entries using
identifiers
– therefore, neither object description nor translation need
search the tree - just use the pointer
• Simple translation then creates the target code
• loader will relocate addresses as required and code
is runable