The grammar S → (S) | SS | ε is not suitable for predictive parsing because…

2018

The grammar
S → (S) | SS | ε

is not suitable for predictive parsing because the grammar is

  1. A.

    Right Recursive Grammar

  2. B.

    Left Recursive Grammar

  3. C.

    Ambiguous Grammar

  4. D.

    Operator Grammar

Attempted by 72 students.

Show answer & explanation

Correct answer: C

Predictive parsing requires unambiguous grammars. The grammar S → (S) | SS | ε is ambiguous because some strings have multiple parse trees. This ambiguity prevents deterministic parsing, making it unsuitable for predictive parsing methods.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor