Oh awesome antlr apostles:

  I've been stuggling with a parser rule and 
am hoping you might be able to help me.

  I'm have a bit of data I'm trying to parse that
looks something like this:

  username: the rain in spain stays....

Running this through antlrworks I am hitting my 'chatrule'
every time but it will start chopping up the
player's message into other tokens that I have defined.

My question: why wouldn't the ALPHA token always be
chosen over the other tokens?

For example say I have a token of:
  LAMB  : 'rack';

and my player's chat message comes across as:
  joeblow: the rain in spain


my abbr. grammar:
--------------------------------------------------------

chatrule  : player COLON_SPACE ~NEWLINE+;

player  : (INT | ALPHA | WS)+ ;

fragment LOWER_LETTER   : 'a'..'z' ;
fragment UPPER_LETTER   : 'A'..'Z' ;
ALPHA : (LOWER_LETTER | UPPER_LETTER)+ ;

COMMA_SP  : ',' ' ' ;
COLON_SP  : ': ';

fragment DIGIT  : ('0'..'9')+ ;
INT : DIGIT COMMA_SP?;
COMMA_INT
NEWLINE : '\r'? '\n' ;

--------------------------------------------------------

thanks,
Ian

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to