Which one of the following kinds of derivation is used by LR parsers?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2019 · Q3
Time
Select one answerSingle correct
Solution
Official answer: D) Rightmost in reverse
Lexical Analysis, Parsing and SDTLR parser stands for:
L: Left-to-right scanning of the input string
R: Constructing a Rightmost derivation in reverse (bottom-up parsing)
In shift-reduce (LR) parsing, the parser reduces handles back to non-terminals, effectively tracing out the rightmost derivation in reverse order.
Hence, the correct option is (D).
Try the question first, then check your work.
Examiner trap
Recall the full form and standard bottom-up nature of LR parsers.
This Lexical Analysis, Parsing and SDT previous year question is Q3 of the GATE CSE 2019 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 GATE CSE 2019 has 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.