I am using the ^ and ! operators to set the root node and to not not be included in the AST, respectively. However, it is not making a difference in the tree that is generated by ANTLRWorks. So I am not sure if my grammar is incorrect or if ANTLRWorks just isn't creating a correct tree.
Here is an snippet of my grammar
expr
: '('! logExpr ')'!;
These parenthesis should not be included in the AST.
addExpr
: multExpr ( (PLUS|MINUS)^ multExpr )*;
The PLUS or MINUS should be the root node in the AST.
However neither of these things are happening the way I expect them to. It makes no difference when I remove them or put them back. ANTLRWorks 1.4.3 ANTLR 3.4