Which of the following statement is true?
2020
Which of the following statement is true?
- A.
The parsers canonical LR and LALR have the same power
- B.
LALR parser is more important than canonical LR parser
- C.
SLR parser is more powerful than LALR parser
- D.
Canonical LR parser is more powerful than LALR parser
Attempted by 81 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).