Which of the following statements about CLR(1) and LALR(1) parsers is correct?

Which of the following statements about CLR(1) and LALR(1) parsers is correct?

  1. A.

    If a grammar is CLR(1) but not LALR(1), then the LALR(1) parsing table must contain a reduce-reduce conflict.

  2. B.

    If a grammar is CLR(1) but not LALR(1), then the LALR(1) parser must contain a shift-reduce conflict.

  3. C.

    If a grammar has no conflicts under CLR(1), then it cannot have any conflicts under LALR(1).

  4. D.

    None of these

Attempted by 74 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…