23 Qs · since 2012 · 38 marks · 1.5 marks/paperMedium yield
GATE heavily tests the Parsing stage of compiler design across both Top-Down (LL(1), recursive descent) and Bottom-Up (LR(0), SLR(1), LALR(1), CLR(1)) paradigms. Key evaluation are… Guide
Topic guide
GATE heavily tests the Parsing stage of compiler design across both Top-Down (LL(1), recursive descent) and Bottom-Up (LR(0), SLR(1), LALR(1), CLR(1)) paradigms. Key evaluation areas include computing FIRST and FOLLOW sets to populate parsing tables, detecting conflicts (Shift-Reduce, Reduce-Reduce), classifying grammars within the parsing power hierarchy, and executing item-set closure/goto operations. In recent years, items have shifted toward exact item counting via GOTO/CLOSURE in NAT format, reverse engineering grammar rules from FIRST/FOLLOW sets, and multi-concept MSQ verification.
Canonical LR Item and GOTO Set State Construction
common · NAT · 2 marks · 2024, 2021
Given an augmented grammar, compute the CLOSURE of an initial set and evaluate multi-step GOTO transitions to count the exact number of items in a resulting state.
Grammar Classification in the LR/LL Hierarchy
common · MCQ · 2 marks · 2025, 2022, 2015
Determine whether a given context-free grammar is LL(1), SLR(1), LALR(1), or CLR(1) by identifying specific conflicts (FIRST/FIRST, FIRST/FOLLOW, Shift-Reduce, or Reduce-Reduce) across states.
FIRST/FOLLOW Computation and LL(1) Table Population
common · MCQ · 2 marks · 2024
Compute FIRST and FOLLOW sets to fill in blank cells of an LL(1) parsing table or reconstruct missing grammar productions from given FIRST/FOLLOW constraints.
Conflict Detection in LR Item Sets
common · MCQ · 2 marks · 2026, 2014, 2013
Analyze either a single canonical item set or all states of an LR(0)/SLR(1)/LALR(1) automaton to count or identify Shift-Reduce (S-R) or Reduce-Reduce (R-R) conflicts under specific lookaheads.
Grammar Transformations: Left Recursion and Associativity
common · MCQ · 1 marks · 2017, 2016, 2014
Identify direct/indirect left recursion, convert left-recursive grammars to right-recursive forms, or derive operator precedence/associativity directly from grammar structure.
Theoretical Properties and Hierarchy of Parsers
occasional · MSQ · 1 marks · 2026, 2024, 2022, 2021
Evaluate conceptual assertions concerning deterministic CFGs, parser power comparisons (LL vs SLR vs LALR vs CLR), parsing time complexity (e.g., CYK ), and state merging rules.
FIRST and FOLLOW Set Computation
common · MCQ · 2 marks · 2012
Given a context-free grammar with nullable productions and cyclic or mutual dependencies (e.g., non-terminals deriving the start symbol), compute the exact FIRST and FOLLOW sets for specified non-terminals.
LL(1) Parsing Table Population
common · MCQ · 2 marks · 2012
Given a grammar and its FIRST/FOLLOW sets (or as a multi-part follow-up), identify specific entries in the LL(1) parsing table, testing whether candidates apply the rule for epsilon-deriving productions mapping to FOLLOW sets.
Computation of LR(0) Goto and Closure Item Sets
rare · NAT · 1 marks · 2022
Given an augmented Context-Free Grammar (CFG) and a base set of LR(0) items, compute the cardinality (total count of distinct items) of a resulting LR(0) state after applying closure and goto transitions on a specified terminal or non-terminal symbol.
Maximum Bottom-Up Reductions
Used when parsing a string of tokens with a bottom-up parser on a grammar containing no -productions and no unit-productions.
Immediate Left Recursion Elimination
Used to transform directly left-recursive productions into equivalent right-recursive productions suitable for top-down LL(1) parsing.
General Context-Free Parsing Worst-Case Time
Used to denote the worst-case time complexity of universal CFG parsers (e.g., CYK or Earley's algorithm) for a string of length .
LALR State Merge Condition
Used to determine if two LR(1) item sets can be merged to form a single LALR(1) state.
FOLLOW Set Propagation Rule
Used when determining the terminal symbols that can appear immediately to the right of a non-terminal across all sentential forms.
LL(1) Parsing Table Construction Rule
Used to place production into table cells for terminals and the end-marker \.
LR(0) Closure Function
Used recursively whenever the dot directly precedes a non-terminal symbol in any LR(0) item of the set.
LR(0) Goto Function
Used to compute the transition state on terminal or non-terminal from an item set .
Shift from basic declarative MCQs on parser power to procedural NAT questions requiring exact item counts after multiple GOTO and CLOSURE steps.
2024, 2021
Increased use of MSQ formats to simultaneously test parser definitions, non-backtracking nature of predictive parsers, left-factoring necessities, and grammar ambiguity.
2026, 2025, 2024
Introduction of inverse/constraint-satisfaction problems, such as reconstructing missing production rules from partial grammars and complete FIRST/FOLLOW sets.
2024
LL(1) parsing questions in 2012 were posed as linked 2-mark MCQs that chained FIRST/FOLLOW evaluation directly into parse table cell verification.
2012
Direct calculation of LR parsing sub-routines (e.g., goto/closure sizes) is tested as an exact-integer NAT question without requiring full DFA construction.
2022
Easy questions (1 mark) test parser definitions (Top-Down vs Bottom-Up), standard operator precedence/associativity evaluations, or immediate left recursion identification. Medium questions (2 marks) require multi-step procedural computations: building LR item graphs, computing CLOSURE and GOTO, tracking exact lookahead sets to differentiate SLR(1) from LALR(1), counting table conflicts, or completing partially filled LL(1) tables from FIRST/FOLLOW sets.