[antlr-interest] Can I get rid of these warnings?

Sinan sinan.karasu at boeing.com
Wed May 29 11:49:21 PDT 2002


Kjell Nilsson wrote:
> 
> I have a grammar that generates some sort of a calulator. There are some
> functions in the calculator that i have java functions to resolve.
> 
> The function sum(foo, ../bar) is resolved like this
> line 273-275
> | #(SUM s1:expr s2:expr) {r = calculateSum(s1.getText(),s2.getText());}
> | KEYIDSTRING {r = lookupKeyString(expr_AST_in.getText());}
> | RELATIVEKEYIDSTRING {r = lookupRelativeKeyString(expr_AST_in.getText());}
> 
> but here I get this warning
> 
> ParserGenerator/AntCalc.g:273: warning:Rule 'expr' returns a value
> ParserGenerator/AntCalc.g:273: warning:Rule 'expr' returns a value
> 


No easy way...

It is harmless, but you can just assign it to a dummy variable, and let
it go out of scope. It's
creation is what takes time, not the assignment anyway, so you are not
losing anything.

Sinan

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list