[antlr-interest] Problem compiling trivial Tree Pattern Matcher grammar
Jonathan Claggett
jonathan at claggett.org
Tue Apr 19 14:59:59 PDT 2011
Hello all,
Has anyone successfully used the filter=true option in a tree grammar file?
I'm running into the following pair of Java errors when I try to compile the
generated java:
topdown() in Test cannot override topdown() in
org.antlr.runtime.tree.TreeRewriter; attempting to use incompatible return
type
found : Test.topdown_return
required: java.lang.Object
bottomup() in Test cannot override bottomup() in
org.antlr.runtime.tree.TreeRewriter; attempting to use incompatible return
type
found : Test.bottomup_return
required: java.lang.Object
I'm using Antlr 3.3, my target language is Java (I guess that's obvious) and
my build tool is Maven. Finally, the full tree grammar is:
tree grammar Test;
options {
ASTLabelType=CommonTree;
output=AST;
filter=true;
}
topdown : ;
bottomup: ;
I'm getting the same errors with my real, more complex tree grammar files
too but I'm obviously doing something wrong.
Thanks for the help,
Jonathan
More information about the antlr-interest
mailing list