GATE / CS ARCHIVE

GATE CSE 1999 / QUESTION 1.17

Relative parser power

Compiler Design · Parsing & Syntax Analysis · Full GATE CSE 1999 paper

GATE 1999, Q1.17 1 mark · MCQ
Report issue

Parsing & Syntax Analysis

Question 1.17, GATE 1999: Which parser recognizes the broadest grammar class: LL(1), canonical LR, SLR, or LALR?
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Canonical LR(1) retains a full lookahead context in its states. SLR instead uses FOLLOW sets for reductions, and LALR merges states sharing LR(0) cores; both simplifications can create conflicts absent from the canonical construction. LL(1) is also a more restrictive deterministic grammar class. Consequently canonical LR is the most powerful among the choices, B. Power here concerns which grammars can be handled without conflicts, not implementation speed or table size.

Original paper, page 2