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
- A.
Right Recursive Grammar
- B.
Left Recursive Grammar
- C.
Ambiguous Grammar
- 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.