Key points
- Phases: lexical → syntax → semantic → intermediate code → optimisation → code generation.
- LL(1) grammars cannot be left-recursive or ambiguous.
- Parser power: LR(0) ⊂ SLR(1) ⊂ LALR(1) ⊂ CLR(1).
- LALR(1) has the same number of states as SLR(1)/LR(0).
- Synthesized attributes come from children; inherited from parent/siblings. S-attributed ⊂ L-attributed.