int cannot be dereferenced
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dominik_Halfkann
Posted On:   Saturday, May 14, 2011 09:47 AM

When I want to debug/compile my grammar, I allways get the error message: [14:03] D:[...]ANTLR ParseroutputSGLParser.java:2532: int cannot be dereferenced [14:03] 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'+ ;    More>>

When I want to debug/compile my grammar, I allways get the error message:

			
[14:03] D:[...]ANTLR ParseroutputSGLParser.java:2532: int cannot be dereferenced
[14:03] 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'+
;

   <<Less
About | Sitemap | Contact