• S
    SwaseekhGATE Preparation
General
  • Dashboard
  • Syllabus
  • Questions
  • Aptitude
  • Mock Tests
  • TCS NQT 2026
Account
  • Pricing
  • Contact
  1. GATE CS
  2. PYQs
  3. Compiler Design

Match the following: (P) Lexical analysis (i) Leftmost derivation (Q) Top-down parsing (ii) Type checking (R) Semantic analysis (iii) Regular expressions (S) Activation records (iv) Runtime administration A. P -> iii, Q -> i, R -> ii, S -> iv B. P -> ii, Q -> i, R -> iii, S -> iv C. P -> iii, Q -> ii, R -> i, S -> iv D. P -> iii, Q -> i, R -> iv, S -> ii

GATE 2016 · Compiler Design · Compilation Phases · easy

Answer: P -> iii, Q -> i, R -> ii, S -> iv => Option A.

  1. Lexical analysis uses regular expressions: Lexical analyzers are specified using regular expressions, then compiled to DFAs. P matches (iii).
  2. Top-down parsing produces leftmost derivation: By definition, top-down parsers expand the leftmost non-terminal, so they produce a leftmost derivation. Q matches (i).
  3. Semantic analysis performs type checking: Semantic analysis goes beyond syntax to check type compatibility, scope, and other semantic rules. R matches (ii).
  4. Activation records are runtime administration: Activation records are a runtime mechanism (not a compile-time phase). Managing them is runtime administration. S matches (iv).