[antlr-interest] Fwd: Re: another nondeterminism question
Adrian Sandor
aditsu at yahoo.com
Wed Jul 23 19:23:51 PDT 2003
here are 2 solutions that work
thanks Lubos!
--- lubos.vnuk at rzb.at wrote:
>
> Hi Adrian,
>
> sorry not to reply directly to the ANTLR group but
> our proxy won't let me
> log on.
>
>
> I have 2 solutions for you:
>
> class Test extends Lexer;
> options {k = 2;}
>
> S: 'a' ('a' | {LA(2)=='b'}? "bb")*
> | "bb" ('a' | {LA(2)=='b'}? "bb")*
> | 'b' {$setType(B);}
> ;
>
>
>
> class Test extends Lexer;
> options {k = 2;}
>
> S: 'a' ('a' | {LA(2)=='b'}? "bb")*;
> S2: "bb" ('a' | {LA(2)=='b'}? "bb")* {$setType(S);};
> B: 'b';
>
>
> You may forward this to the newsgroup if it works,
> Lubos.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list