Consider the following grammar G1 again:
E ::= E + T | E - T | T
T ::= T * F | T / F | F
F ::= num | id
Consider now the following grammar G2
E ::= T + E | T – E | T
T ::= F * T | F / T | F
F ::= num | id
Consider now the following grammar G3:
E ::= E + E | E – E | E * E | E / E | num | id
Is this grammar equivalent to our original grammar G1?
Well, it recognizes the same language, but it constructs the wrong parse trees.
Showing posts with label same language. Show all posts
Showing posts with label same language. Show all posts
Thursday, July 5, 2007
Subscribe to:
Posts (Atom)