Compiler design semester exam roadmap
Core algorithms
Days 4 to 9: parsing, translation and code generation. 5 topics, about 20 hours.
LL(1) parsing
About 3 h.
- Build an LL(1) table and parse a string with it
Visualisers: LL(1) parsing
LR and operator-precedence parsing
About 7 h.
- Build LR(0), SLR, CLR and LALR tables
- Find shift-reduce and reduce-reduce conflicts
- Parse with an operator-precedence table
Visualisers: LR parsing, Operator-precedence parsing
Syntax-directed translation
About 3 h.
- Evaluate S- and L-attributed definitions on an annotated parse tree
Visualisers: Syntax-directed translation
Intermediate code
About 3 h.
- Write three-address code, quadruples and triples for an expression
- Build the DAG of a basic block
Visualisers: Three-address code & DAG
Optimisation and register allocation
About 4 h.
- Apply common subexpression elimination, constant folding and dead-code removal
- Colour an interference graph to allocate registers
Visualisers: Code optimisation, Register allocation