Ambiguous Grammars and its example

What do you mean by the term Ambiguous Grammars? Describe it by using an example.

E

Expert

Verified

A Grammar which produces more than one Parse Tree for the similar sentences or the Production rules in a grammar is stated to be ambiguous.

Example: Consider a simple mathematical expression

E->E*E

This can encompass two Parse tree according to the assocciativity of the operator '*'

 E E
 / \ / \
 * E E *

/ \ / \
 E E E E

   Related Questions in Computer Engineering

©TutorsGlobe All rights reserved 2022-2023.