Consider the grammar G S → pSqS / qSpS / ε G is:
Consider the grammar G
S → pSqS / qSpS / ε
G is:
Answer: D. Ambiguous — The grammar is ambiguous as it generates two parse tree for the string “ppqqpq” S->pSqS | qSpS |
- A.
LL(1)
- B.
CLR(1)
- C.
LL(1) and CLR(1)
- D.
Ambiguous
Attempted by 101 students.
Show answer & explanation
Correct answer: D
The grammar is ambiguous as it generates two parse tree for the string “ppqqpq”
S->pSqS | qSpS |

Loading lesson…