Which of the following statement is true?

2020

Which of the following statement is true?

Answer: D. Canonical LR parser is more powerful than LALR parserThe capability of LR parsers to handle languages follows a strict hierarchy. A Canonical LR (CLR) parser is the most powerful bottom-up parser because it…

  1. A.

    The parsers canonical LR and LALR have the same power

  2. B.

    LALR parser is more important than canonical LR parser

  3. C.

    SLR parser is more powerful than LALR parser

  4. D.

    Canonical LR parser is more powerful than LALR parser

Attempted by 306 students.

Show answer & explanation

Correct answer: D

The capability of LR parsers to handle languages follows a strict hierarchy. A Canonical LR (CLR) parser is the most powerful bottom-up parser because it maintains distinct lookaheads for every state. LALR reduces the states by merging those with identical core items, which can introduce reduce-reduce conflicts, making CLR strictly more powerful than LALR.

Correct Answer: Canonical LR parser is more powerful than LALR parser (Option D).

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…