CSS Prepare

optional · CSS study notes

Phases of a Compiler

  1. Lexical Analysis — groups characters into tokens
  2. Syntax Analysis — checks token sequence against grammar, builds a parse/syntax tree
  3. Semantic Analysis — checks meaning/type-correctness, builds/uses a symbol table
  4. Intermediate Code Generation — produces a machine-independent intermediate representation
  5. Code Optimization — improves the intermediate code's efficiency
  6. Code Generation — produces final target/machine code

MCQ Trap

  • This six-phase order (Lexical → Syntax → Semantic → Intermediate Code → Optimization → Code Generation) is one of the most reliably tested sequences in this topic.