[antlr-interest] unexpected token @

Mark Volkmann r.mark.volkmann at gmail.com
Wed Dec 5 12:46:29 PST 2007


The tree grammar rule below causes the error "syntax error: antlr:
MathTree.g:42:1: unexpected token: @", but I don't understand why.
Polynomial is a Java class in the same package of the classes
generated from the grammar.
Do you see anything syntactically wrong with this?

polynomial returns [Polynomial result]
@scope {
  Polynomial currentPolynomial;
}
  :	^(POLYNOMIAL term*) {
    $result = currentPolynomial = new Polynomial();
  }
  ;

-- 
R. Mark Volkmann
Object Computing, Inc.


More information about the antlr-interest mailing list