Professional Documents
Culture Documents
Phases of Compiler
Phases of Compiler
Phases of Compiler
PREPARED BY,
Ms. M.P.GEETHA
Assistant Professor
Department of Computer Science and Engineering
Error messages
• Six phases:
– Lexical Analyzer
– Syntax Analyzer
– Semantic Analyzer
– Intermediate code generation
– Code optimization
– Code Generation
Syntax Analyzer
Semantic Analyzer
Code Optimizer
Code Generator
TARGET PROGRAM
1. Identifier position.
2. Assignment symbol =
3. Identifier initial.
4. Operator +.
5. Identifier rate.
6. Multiplication sign. *
7. Number 60
temp1=inttoreal(60)
temp1=id3*60.0 temp2= id3*temp1
id1=id2+temp1 temp3=id2+temp2
id1=temp3
Parser
[Syntax Analyzer]
Code Optimizer
http://web.stanford.edu/class/cs143/handouts/introlex.pdf
http://dragonbook.stanford.edu/lecture-notes.html
http://www.nptel.ac.in/courses/106104072/3