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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment