I want to set root for AST in this grammar:
boolexp : relexp op=(AND | OR)^ boolexp
| relexp
;
but get this error:
'^' came as a complete surprise to me
What is the cause?
I want to set root for AST in this grammar:
boolexp : relexp op=(AND | OR)^ boolexp
| relexp
;
but get this error:
'^' came as a complete surprise to me
What is the cause?
If this is ANTLR 4, the AST operators have been removed in favor of automatic parse tree construction.
If this is ANTLR 3, you may need to move your labels inside the parentheses, like the following.
boolexp : relexp (op=AND | op=OR)^ boolexp
| relexp
;