Consider the following grammar for arithmetic expressions involving +
, →, *
, /
: Is it an ambiguous grammar? Justify your answer.[2020, 17]
E → E + E | E - E | E * E | E / E
E → (E) | id
Consider the following grammar:(Here i
, t
, and e
stand for if
, then
, and else
, and C
and S
for "conditional" and "statement".)Construct a parse tree for the sentence w = i b t i b t a e a
using leftmost derivation and rightmost derivation.[2019, 17, 14]
S → iC t S e S | i C t S | a | b
Consider the following grammar: Is it an ambiguous grammar? Justify your answer.[2019]
E → E + E | E * E | (E) | id