[antlr-interest] parsing the string "text"

Terence Parr parrt at cs.usfca.edu
Wed Sep 20 11:17:52 PDT 2006


Most likely you have a token mismatch issue.  Rebuild all grammars  
and make sure you do it in the correct order if you have import vocab  
stuff.
ter
On Sep 20, 2006, at 8:11 AM, Mach Ray wrote:

> Hello,
>
> I have a rather simple looking problem related to the
> following lexer rule.
>
> NAME_STR: (CAP_LT|SML_LT)
> (CAP_LT|SML_LT|DIGIT|'_'|'-'|':'|'/')+
>         ;
> protected
> DIGIT: '0'..'9';
>
> protected
> CAP_LT: 'A'..'Z';
>
> protected
> SML_LT: 'a'..'z';
>
> Whenever the string "text" appears in the input file,
> the parser throws the error
>
> : expecting NAME_STR, found ´text´
>
> Can somebody please point out the problem here?
>
> Thanks
> Awais
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com



More information about the antlr-interest mailing list