Which of the following is FALSE?

2016

Which of the following is FALSE?

  1. A.

    The grammar S → aS | aSbS | ε is ambiguous

  2. B.

    An unambiguous grammar has same leftmost and rightmost derivation

  3. C.

    An ambiguous grammar can never be LR(k) for any k

  4. 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.

Explore the full course: Mppsc Assistant Professor