1,491 views
1 votes
1 votes

How will we treat the given two parse trees..?  Are they same i.e one is has been derived using lmd n other using rmd or they both will be treated as two diffent parse trees concluding it as ambiguous.. Only with reference to the string 'b'  otherwise i know its ambiguous... 

1 Answer

Best answer
0 votes
0 votes

In this particular grammar and string LMD and RMD both are giving the same Parse Tree, but in all cases this will not true.

A grammar is Ambiguous if there is :

1. more than one RMD  or

2. more than one LMD or

3. more than one Parse Tree for a given string

string = b gives two different parse tree. So, It is ambiguous.

selected by

Related questions

0 votes
0 votes
0 answers
1
2 votes
2 votes
2 answers
4
Shashank Chandekar asked Nov 3, 2016
4,257 views
Consider the following context-free grammarS → SS + | SS*| a for the string aa + a*. Is the grammar ambiguous ?