You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as the actual input symbols which could be matched by such a rule, it's easy to see the following rule would match exactly the same thing:
expr2
: 'x'+
;
The problem lies in how to build the parse tree. If the input is x x, the only possible parse tree from the expr rule is:
(expr x x)
However, if the input is x x x, either of the following two trees is possible, and without an operator in place to specify an associativity there's no clear choice:
(expr (expr x x) x)
(expr x (expr x x))
Depending on the intended associativity and desired tree structure, the rule expr would need to be written in one of the following forms.
then the following exception is thrown:
The text was updated successfully, but these errors were encountered: