[antlr-interest] Return types on lexer rules do not seem to work.
Alex Shneyderman
a.shneyderman at gmail.com
Wed Jul 18 10:13:50 PDT 2007
I have a lexer rule like this:
fragment
DUMMY
returns [int tt=0;]
: 'a'..'z';
....
When I run antlr on the grammar the corresponding rule that is
generated is like this:
// $ANTLR start DUMMY
public final void mDUMMY() throws RecognitionException {
int tt = 0;;
try {
// Disambiguation.g:31:5: ( 'a' .. 'z' )
// Disambiguation.g:31:5: 'a' .. 'z'
{
matchRange('a','z'); if (failed) return tt;
}
}
finally {
}
}
// $ANTLR end DUMMY
Obviously, this has a syntax error.
I run it with 3.0 final, so you guys might have fixed it ... ?
--
Thanks,
Alex.
More information about the antlr-interest
mailing list