Project ForgeSign up free
Compiler Design
Lexical Analysis & Parsing
GATE 2008
Hard

An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if

  • Athe SLR(1) parser for G has S-R conflicts
  • the LR(1) parser for G has S-R conflicts
  • Cthe LR(0) parser for G has S-R conflicts
  • Dthe LALR(1) parser for G has reduce-reduce conflicts

Explanation

This is a known theoretical result: LALR(1) is built from LR(1) by merging states sharing the same core, which can introduce new REDUCE-REDUCE conflicts, but SHIFT-REDUCE conflicts in the LALR(1) parser occur if and only if they already existed in the corresponding LR(1) parser.

Source: GATE CS 2008 (2008)

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.

Start revising free