Home › GATE CS › PYQs › Compiler Design › Lexical Analysis & Parsing

Lexical Analysis & Parsing — GATE CS Previous Year Questions

Practise GATE CS previous year questions on Lexical Analysis & Parsing in Compiler Design. Filter by year, marks and question type.

Public question previews

  • Which of the following statements is/are true? (2026 · 1 mark · MSQ)
  • A lexical analyzer uses the following token definitions • letter → [A - Z a - z] • digit → [0 - 9] • id → letter (letter | digit)* • number → digit+ • ws → (blank | tab | newline)+ For the string given below, x1 23mm 78 y 7z zz5 14A 8H AaYcD the number of tokens (excluding ws) that will be produced by the lexical analyzer is __________. (answer in integer) (2026 · 1 mark · NAT)
  • Consider the canonical LR(0) parsing of the grammar below using terminals {a, b, c} and non-terminals {A, B, C, S} with S as the start symbol. S → ACB A → aA | ε C → cC | ε B → bB | b Which one of the following options gives the number of shift-reduce conflicts that will occur in the LR(0) ACTION table? (2026 · 2 marks · MCQ)
  • Which ONE of the following statements is FALSE regarding the symbol table? (2025 · 1 mark · MCQ)
  • Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler? (2025 · 2 marks · MSQ)