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
:
if x === 1 then if y === z then z = 2 else z = 3 else z = 4
Which one of the following propositions best characterizes the above statement?
L
with a
unique parse tree.L
.L
.Try to build the whole parse tree(s) for this statement with pencil and paper.
Review the definition of an ambiguous grammar.