4. Explanation
• The first six phases are called formal phases of
compiler. While the last two are informal phases of
compiler.
• The last two symbol table manager and Error Handler
are not the formal phases of compiler but these help
in the activities of the formal phases.
• The first three phases form the bulk of the analysis
portion and 4, 5, 6 are the synthesis portion of
compiler.
5. Symbol Table Manager
• It is a data structure which contains a record for each
keyword, reserved word, and identifier in the source
program, with fields for various attributes of the
identifier.
• It serves as a dictionary for the compiler.
• Here the identifier can be:
• Variable name
• Function name
6. Symbol Table Manager
• In case of a variable name the attributes are:
• Type of variable
• Scope of variable
• Storage classes
• Size
• Life time
• In case of function name the attributes are:
• Name
• Method of passing arguments
• Order of arguments
• Return type
7. Symbol Table Manager
• Different phases of compiler enters information into symbol table e.g.
• lexical analyzer enters identifier names into the symbol table.
• Semantic analyzer enters type information into the symbol table
• e.t.c
• Different phases use information from symbol table e.g.
• Semantic analyzer frequently uses symbol table information