Among simple LR (SLR) , canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most powerful , in that order?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2015 Set 3 · Q16
Time
Select one answerSingle correct
Solution
Official answer: C) SLR, canonical LR
ParsingAmong bottom-up LR parsers:
Simple LR (SLR) uses LR(0) items and resolves conflicts using the FOLLOW sets of non-terminals. It has the smallest parsing table and is the easiest to construct and implement among the three.
Canonical LR (CLR or LR(1)) uses LR(1) items (items with lookahead components), making it the most powerful parser among them as it parses the largest class of deterministic context-free grammars.
LALR merges states of CLR that have identical cores, balancing table size and parsing power.
Hence, the method that is very easy to implement is SLR, and the most powerful method is canonical LR [Page 6].
Try the question first, then check your work.
Examiner trap
Recall the hierarchy of LR parsers: in terms of parsing power.
This Parsing previous year question is Q16 of the GATE CSE 2015 Set 3 paper. Find more GATE CSE PYQs on Parsing 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 Parsing 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.
Parsing has 23 GATE CSE PYQs across 16 papers from 2012 to 2026. 5 of them are 1-mark MCQs like this one, and GATE CSE 2015 Set 3 has 2.
How GATE tests ParsingIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.