Which of the following is the most powerful type of LR parser?
2025
Which of the following is the most powerful type of LR parser?
- A.
Canonical LR(1)
- B.
SLR(1)
- C.
LR(0)
- D.
LALR(1)
Attempted by 2 students.
Show answer & explanation
Correct answer: A
Canonical LR(1) is the most powerful type of LR parser. It maintains the full, distinct lookahead information for every state, allowing it to parse the widest range of deterministic context-free grammars. While other parsers like LALR(1) and SLR(1) merge states together to save memory, Canonical LR(1) keeps them separate, preventing shift-reduce or reduce-reduce conflicts that simpler parsers cannot resolve.