Hello:
I have a question about the token value, the question is :
In the generated Java file, the token values are defined in this way:
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>","ENTITY_VAR_IDENT",
"RULE_ID","INTERVAL_ITEM","'ONEOF'"
};
public static final int ENTITY_VAR_IDENT=4;
public static final int RULE_ID=5;
public static final int INTERVAL_ITEM=6;
public static final int T__7=7;
if I want to identify a token , I can type this:
Grammar:
{ input.LA(1)== ENTITY_VAR_IDENT}?
Generated Code:
int LA1_0 = input.LA(1);
if ( (LA1_0==ENTITY_VAR_IDENT) )
{
alt1=1;
}
that is OK
But what if I want to check if the token is 'ONEOF'?
How could I know T__7 stands for 'ONEOF' and its value is 7?
Thanks for your help!
Best Regards,
chainone
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address