[antlr-interest] AntLR Bug

Terence Parr parrt at jguru.com
Mon Feb 4 23:08:52 PST 2002


On Monday, February 4, 2002, at 05:52  AM, Michael Labhard wrote:

> Terrance and Monty:
>
> 	Sorry, I didn't see Monty's reply or your new FAQ before sending 
> the last
> message.  The solution in Monty's reply and in your FAQ appear to be 
> very
> similar.  For my needs the solution does not work.  The same warning 
> occurs.
> Here is the most recent lexer file:
>
> class L extends Lexer;
> options { k=2; }
>
> NAME_TOKEN
>   : GRAPHIC_TOKEN
>   ;
>
> END_TOKEN
>     :
>     END_CHAR
>     ( options {greedy=true;} :
>      GRAPHIC_TOKEN_CHAR {setType(GRAPHIC_TOKEN);}
>     )+
>     ;
>
> protected GRAPHIC_TOKEN
>   :
>     ( (END_CHAR GRAPHIC_TOKEN_CHAR) | GRAPHIC_TOKEN_CHAR)
>     (END_CHAR | GRAPHIC_TOKEN_CHAR)*

END_CHAR can still start this rule, which is called by non-protected 
rule NAME_TOKEN.  That is still the same problem...you've not 
left-factored everything I guess.

Please include error messages when you get them too so it's easier to 
figure out what you mean.

Ter
>   ;
>
> protected GRAPHIC_TOKEN_CHAR
>   : GRAPHIC_CHAR
>   ;
>
> protected GRAPHIC_CHAR
>   : ('#'|'$'|'&'|'*'|'+'|'/'|
>     |':'|'<'|'='|'>'|'?'|'@'|'^'|'~');
>
> protected END_CHAR:
>     '.'
>     ;
>
> Thanks for your assistance.
>
> -- Michael
>
>
>
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/
>
>
--
Chief Scientist & Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list