Which statement is true?
2015
Which statement is true?
- A.
LALR parser is more powerful and costly as compare to other parsers
- B.
All CFG\'s are LP and not all grammars are uniquely defined
- C.
Every SLR grammar is unambiguous but not every unambiguous grammar is SLR
- D.
LR(K) is the most general back tracking shift reduce parsing method
Attempted by 87 students.
Show answer & explanation
Correct answer: C
The correct statement is that every SLR grammar is unambiguous, but not every unambiguous grammar is an SLR grammar. This means the class of SLR grammars is a proper subset of unambiguous grammars. LR(K) parsers are deterministic shift-reduce methods, not backtracking ones. Additionally, LALR grammars do not have greater power than LR(1) grammars.