All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · December 2018

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

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. Ambiguous

Explanation

S → SS gives several parse trees for strings like ()()(), so the grammar is ambiguous (it is also left recursive, but ambiguity is the fundamental reason).

More Theory of Computation and Compilers questions