Posted By:
bruno_nogent
Posted On:
Monday, January 12, 2009 09:18 AM
I 'm testing antlr and there is a problem
exp : 'n' | '0' | '1';
generate code as
exp : 'n'..'1';
I don't understand. I want to model 'n' or '1' or '0'
Generated code :
// Grammar.g:158:7: ( 'n' | '0' | '1' )
// Grammar.g:
{
if ( (input.LA(1)>=20 && input.LA(1)
<=22) ) {
input.consume();
state.errorRecovery=false;
}
Thanks