14 Qs · since 2011 · 17 marks · 0.7 marks/paperStandard yield
In GATE CS, this foundational topic tests grammar analysis, parsing techniques, and compiler phase interactions through both theoretical properties and computational mechanics. Que… Guide
int main() {
Integer x;
return 0;
}
Which one of the following phases in a seven-phase C compiler will throw an error?Topic guide
In GATE CS, this foundational topic tests grammar analysis, parsing techniques, and compiler phase interactions through both theoretical properties and computational mechanics. Questions frequently evaluate FIRST/FOLLOW set computation, LL(1) parsing table construction, LR parser capabilities, and bottom-up reduction steps. In addition, conceptual items regularly test front-end compiler phase responsibilities, phase inputs/outputs, and error detection stages.
FIRST and FOLLOW Set Computation
common · mixed · 1 marks · 2025, 2021, 2019, 2017
Given a context-free grammar with null derivations (), compute the FIRST or FOLLOW set of specific non-terminals, often formatted as an option selection, table cell filler, or indexed integer in NAT.
Compiler Phase Responsibilities and Pipeline Mapping
common · MCQ · 1 marks · 2021, 2018, 2017, 2016
Match compiler phases (Lexical, Syntax, Semantic, Intermediate Code, Runtime) to their corresponding inputs, representations, functions, or detect which phase reports a specific program error.
Parser Power Hierarchy and Theoretical Properties
common · mixed · 1 marks · 2025, 2017, 2015
Evaluate statements regarding bottom-up parsers (viable prefixes on stack, LR parser power hierarchy: ) or standard FIRST/FOLLOW construction rules.
Parse Tree Construction from Precedence and Associativity
occasional · MCQ · 2 marks · 2011
Construct an expression parse tree given user-defined operator precedence levels and associativity rules (left vs. right).
Parsing Steps and Table Construction
occasional · mixed · 2 marks · 2021, 2020
Determine the exact sequence/count of shift-reduce reduction steps to derive a target string, or fill in specific entries of an LL(1) parsing table.
Phase-to-Algorithm Matching
common · MCQ · 1 marks · 2015
A two-column match setup pairing compiler phases or runtime tasks (e.g., Lexical Analysis, Parsing, Register Allocation, Expression Evaluation) with corresponding theoretical models or algorithmic methods (e.g., DFA minimization, Production tree, Graph coloring, Post-order traversal).
Parser Derivation Identification
common · MCQ · 1 marks · 2019
Direct recall or conceptual classification of the scanning direction and underlying derivation order used by standard parsing algorithms (e.g., LL vs. LR).
FOLLOW Set Computation Rule 1
Used whenever finding symbols immediately following a non-terminal in a production RHS.
FOLLOW Set Computation Rule 2
Used when a non-terminal appears at the end of a production or is followed by nullable symbols.
LL(1) Table Placement for Epsilon Production
Used to place into LL(1) parsing table cells under terminals present in .
Parser Expressive Power Hierarchy
Used to evaluate the relative grammar-recognition power and capability of bottom-up parsers.
Shift from simple phase matching MCQs towards algorithmic table verification (LL(1) table completion) and numerical derivation counts (NAT).
2021, 2020, 2019
Introduction of MSQ format in 2025 to test foundational definitions of FIRST and FOLLOW sets rather than pure computation.
2025
Testing cross-cutting compiler theory in single-mark matching MCQs that span both front-end (lexical/syntax) and back-end (code generation/optimization).
2015
Direct, 1-mark theoretical recall questions are used to verify fundamental bottom-up parsing definitions without requiring construction of parsing tables.
2019
Easy questions (1 mark) focus on direct definitions (FIRST/FOLLOW properties, viable prefix concepts), single-step FOLLOW calculations, or phase matching. Medium questions (1-2 marks) involve multi-nonterminal FIRST/FOLLOW dependencies, LL(1) table population with nullable non-terminals, or counting reductions requiring tracing the complete rightmost derivation.