Compiler Design
Lexical Analysis & Parsing
GATE 2017
Medium
Which of the following statements about parser is/are CORRECT?
I. Canonical LR is more powerful than SLR. II. SLR is more powerful than LALR. III. SLR is more powerful than Canonical LR.
- I only
- BII only
- CIII only
- DII and III only
Explanation
The standard containment of grammar classes is SLR(1) ⊆ LALR(1) ⊆ LR(1) (Canonical LR) — each step to the right recognizes a strictly larger (or equal) class of grammars. So Canonical LR is more powerful than SLR (I is true), while SLR is never more powerful than LALR or Canonical LR (II and III are both false).
Source: GATE CS 2017 (Session 2) (2017)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.