Compiler Desgin
Compiler Desgin
1.LEXICAL ANALYSIS
2. SYNTAX ANALYSIS
3. SEMANTIC ANALYSIS ( ERROR MODELING)
4. INSENDIATE CODE GENERATION
5. CODE OPTIMIZATION
6. FIND CODE GENERATION
1. LEXICAL ANALYSIS – The first phase where the source code is broken down into
token such as keywords ,operator and identifiers. It read the source code characters
by character rand groups them into taken based on predefined PATTERNS ,
SPECIFIED by the LANGUAGE GRAMMAR.
2. SYNTAX ANALYSIS – This phase checks if the source code follows the correct syntex
rules building a parge tree.
3. SEMANTIC ANALYSIS – It ensures the programs logic makes sense, checking for
errors like type missmatch or undeclare variables.
4. INSENDIATE ANALYSIS – In this phase the compiler converts the source code into one
intermediate , machine independent representation and translation.
5. CODE OPTIMIZATION – this phase improves the intermediate code to make it run
more efficientily redusing resource using or increasing speed.
6. FINAL CODE OPTIMIZATION - The final phase where the optimization code is
translated into target machine code or assembly language that can we executed on
the computer.
(SYMBOL TABLE)- Symbol table tracks all the variables functions and identifiers in a
programmings . It stores informations such as NAME , TYPE ,SCOPE AND MEMORY
LOCATION of each identifier . It act as a bridge between the analysis and synthes phase of
compiler.