Equivalent Grammars


Equivalent grammars define the same language:

  • G A Ax | y

  • G’ A yB B yB |

  • L(G) = L(G’)

One grammar may be easier to parse than the other.

Note however that they have very different parse trees, and if the parse tree reflects the semantic structure for the language then the semantic information is lost.

Parse tree for yxx: parse-tree-leftmost-rightmost

See Also