Which of the following is FALSE?
2016
Which of the following is FALSE?
- A.
The grammar S → aS | aSbS | ε is ambiguous
- B.
An unambiguous grammar has same leftmost and rightmost derivation
- C.
An ambiguous grammar can never be LR(k) for any k
- D.
Recursive descent parser is a top-down parser
Attempted by 71 students.
Show answer & explanation
Correct answer: B
Option 1 is the correct answer because it claims leftmost and rightmost derivations differ for unambiguous grammars, which is false. Unambiguous grammars guarantee a unique parse tree regardless of derivation order. Options 0, 2, and 3 correctly describe properties of ambiguity and parsing constraints.
A video solution is available for this question — log in and enroll to watch it.