GATE | GATE CS 1997 | Question 55

Consider the grammar

S→ bSe
S→ PQR
P→ bPc
P→ ε
Q→ cQd
Q→ ε
R→ dRe
R→ ε

where S,P,Q,R are non-terminal symbols with S being the start symbol; b,c,d,e are terminal symbols and ‘ε’ is the empty string. This grammar generates strings of the form bi, cj, dk, em for some i, j, k, m ≥ 0.

a. What is the condition on the values of i, j, k, m ?
b. Find the smallest string that has two parse trees.


Answer:

Explanation:

Quiz of this Question
Please comment below if you find anything wrong in the above post



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.