Match the following: (P) Lexical analysis (i) Leftmost derivation (Q) Top down parsing (ii) Type checking (R) Semantic analysis (iii) Regular expressions (S) Runtime environments (iv) Activation records
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2016 Set 2 · Q19
Time
Select one answerSingle correct
Solution
Official answer: B) P ↔ iii, Q ↔ i, R ↔ ii, S ↔ iv
Lexical Analysis, Parsing and SDTLet us match each compiler phase with its associated concept:
(P) Lexical analysis: Tokens are specified using Regular expressions (iii).
(Q) Top down parsing: A top-down parser constructs the parse tree from the root down to the leaves, which corresponds to finding a Leftmost derivation for an input string (i).
(R) Semantic analysis: Performs static semantic checks such as Type checking (ii).
(S) Runtime environments: Manages memory and function calls dynamically using Activation records on the call stack (iv).
Thus, the correct mapping is:
This corresponds to option (B).
Try the question first, then check your work.
Examiner trap
Consider the primary responsibility and tools/data structures used in each phase of a compiler.
This Lexical Analysis, Parsing and SDT previous year question is Q19 of the GATE CSE 2016 Set 2 paper. Find more GATE CSE PYQs on Lexical Analysis, Parsing and SDT in Compiler Design, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Lexical Analysis, Parsing and SDT PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Lexical Analysis, Parsing and SDT has 14 GATE CSE PYQs across 12 papers from 2011 to 2025. 9 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2016 Set 2.
How GATE tests Lexical Analysis, Parsing and SDTIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.