Consider the following grammar for a language L:

<s> ::= <v> = <e>
      | <s> ; <s>
      | if <b> then <s>
      | if <b> then <s> else <s>
<v> ::= x | y | z
<e> ::= <v> | 0 | 1 | 2 | 3 | 4
<b> ::= <e> === <e>

where, like in JavaScript, = is the assignment operator and === is the equality testing operator.
Now consider the following candidate for a statement <s> in the language L:

x = 1; y = 2; if x === y then y = 3

Which one of the following propositions best characterizes the above statement?

It is parsed ambiguously in L.
  • It is parsed in L with a unique parse tree.
  • It is not a statement in L.

Try to build the whole parse tree(s) for this statement with pencil and paper.

Review the definition of an ambiguous grammar.