[antlr-interest] Problem while compiling/debugging: int cannot be dereferenced
Dominik Halfkann
dominik.halfkann at googlemail.com
Sat May 14 05:50:17 PDT 2011
Hello everybody,
I have a problem with ANTLR and I hope it's ok that I'm asking that here. I
also posted something in the forum, but it seems to be very inactive
depending on other posts I saw there...
(from http://www.jguru.com/forums/view.jsp?EID=1639158)
When I want to debug/compile my grammar, I allways get the error message:
[14:03:38] D:\[...]\ANTLR Parser\output\SGLParser.java:2532: int
cannot be dereferenced
[14:03:38] value =
Integer.parseInt((i!=null?i.getText():null));
I don't have an explanation for that, maybe someone can help me here. Here
are the important code fragments:
grammar SGL;
options {
backtrack = true;
memoize = true;
}
[...]
mathAtom returns [int value]
: '(' e=mathExpression ')' {$value = $e.value;}
| i=Integer {$value = Integer.parseInt($i.text);}
;
[...]
Integer
: '0'..'9'+
;
Thank you in advance
Dominik
More information about the antlr-interest
mailing list