Compiler Theory: 001 - Introduction and Course Outline
Compiler Theory: 001 - Introduction and Course Outline
Front end
Back end
It is a language processor !!
Syntax Tree
Intermediate Code Generator
Intermediate Representation
Machine independent Optimisations
Intermediate Representation
Code Generator > Target Machine Code
Eg from Aho showing compiler phases
Type Checking !!
Properties
Easy to produce
Easy to translate into target machine
E.g. [load r1, add r1, load r2, mult r2, load r3, add r3] can be
reordered to [load r1, load r2, load r3, add r1, mult r2, add r3]
Some important concepts (i)
Check Appel Pg 7
Made up of simple statements and
expressions (no loops or if stmts)
Bottom up:
Binop,
Exp,
ExpList,
Stm.
An embedded compiler !!