Consider the context-free grammar. S -> SS+ | SS* | a

i)Show how the string aa+a* can be generated by this grammar.
ii)Construct a parse tree for this string

The given Grammar is unambiguous.

For Unambiguous grammar, LMD and RMD represents the same parse tree. Hence the grammar is unambiguous.

Elimination of Left recursion

Leave a Reply

Your email address will not be published. Required fields are marked *