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
- Two finite state machines are said to be equivalent if they :
- The finite state machine given in figure below recognizes :
- A pushdown automata behaves like a Turing machine when the number of auxiliary memory is :
- Pushdown automata can recognize language generated by_________.
- To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of productions to be used is :
- Consider the two grammars: G₁: S → SbS | a G₂: S → aB | ab, A → AAB | a, B → ABb | b Which of the following options is correct?