Notes / GATE / Compiler Design

CH 01

Phases and parsing

Compiler Design · GATE

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.
Done with this chapter? Now put it to use.Today's GATE question →