CC_unit_1
CC_unit_1
CO Statement
Course No
CS601.1 Relate compiler phases and compiler construction tools.
time.
It requires less amount of memory space to compile the source
language.
It compile only the modified code segment if frequent
Analysis part
• Analysis part breaks the source program into constituent pieces and
imposes a grammatical structure on them which further uses this
structure to create an intermediate representation of the source program.
Structure editor
Pretty printers
Static checkers
Interpreters
Cross compiler
bootstrapping
Synthesis part
2. Syntax analysis
3. Semantic analysis
5. Code optimization
6. Code generation
Phases of compiler
Phases of compiler
Output: Token
statement.
language specification.
Phases of compiler:-Semantic Analysis
Phases of compiler:-Intermediate Code Generation
o Postfix notation
o Syntax tree
Most commonly used form is the three address code.
t1 = inttofloat (5)
t2 = id3* tl
t3 = id2 + t2
id1 = t3
Phases of compiler:-Intermediate Code Generation
o Loop unrolling.
t1 = id3* 5.0
id1 = id2 + t1
Phases of compiler:-Code Generation
Syntactical Errors
Semantical Errors
Logical errors
These errors occur due to not reachable
code-infinite loop.
Compiler construction tools
Compiler construction tools
Scanner Generator
It means get the memory portions from operating system and storing the object
data.
Relocation:
It maps the relative address to the physical address and relocating the object code.
Linker:
It combines all the executable object module to pre single executable file.
Loader: