[antlr-interest] Token Mismatch

Brisard, Fred D Fred.Brisard at ca.com
Thu Jul 24 10:33:46 PDT 2008


I'm sure this is a novice question but I can't seem to find an answer
that I feel comfortable with.

It seems like any literal specified in the parser rules becomes an
implied token.

Using the basic example T.g -

grammar T;
/** Match things like "call foo;" */
r : 'call' ID ';' {System.out.println("invoke "+$ID.text);} ;
ID: 'a'..'z'+ ;
WS: (' '|'\n'|'\r')+ {$channel=HIDDEN;} ;

I get a MismatchedTokenException I run this in the ANTLRWorks debugger
for the input

call call;

I would like the second call to be identified as a token of type ID.

Any help is appreciated

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080724/a5871231/attachment.html 


More information about the antlr-interest mailing list