GATE | GATE CS 1997 | Question 55

Consider the grammar

S→ bSe
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.



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 to report any issue with the above content.