GATE / CS ARCHIVE

GATE CSE 1992 / QUESTION 2(xiv)

SLR versus LALR table entries

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

GATE 1992, Q2(xiv) MSQ
Report issue

Parsing & Syntax Analysis

Question 2(xiv), GATE 1992: For one CFG, compare SLR(1) and LALR(1) tables: goto parts may differ; shifts identical; reductions may differ; errors may differ.
Question 2(xiv), GATE 1992: For one CFG, compare SLR(1) and LALR(1) tables: goto parts may differ; shifts identical; reductions may differ; errors may differ.
Tap to enlarge
Select all that apply
Answer & solution

Answer: B, C, D under aligned LR(0)-core state numbering (no official key was published)

Both constructions use the same LR(0) cores for transitions, so terminal shifts and nonterminal gotos coincide when corresponding states are identified. SLR places a completed A production on every token in FOLLOW(A). LALR instead uses the lookaheads propagated to that completed item, often a smaller set. Thus a cell that is a reduction or conflict in SLR may be an error or a different action set in LALR. Therefore shifts are identical but reduction/error entries may differ. Renaming state numbers does not count as a structural goto difference; conflict-resolution policies are separate from raw table construction.

Original paper, page 3