[antlr-interest] Re: strange bug (v 2.7.2)

Lloyd Dupont lloyd at galador.net
Wed Jul 2 05:03:14 PDT 2003


from memory in some sample code I found they have a rule like that

token {
    NOT_EQ; LessT; LE;
}

NOT_EQ: '<'
    ( LA(2) '=' { _ttype = LessT} | ....to be continued ..)

I can't remember better, sorry, I haven't write any ANTLR code since a
while.
Anyway it seems silly to me, this should suffice, isn't it ?
options { k= 2; }
NOT_EQ = "<>" | "!=" ;
LessT = "<=";

or something that simple....
why should I have to check it myself .....

ok, let you know .......

anyway all my stuff has to wait until friday (vacation tomorrow)...
CU
Lloyd

----- Original Message ----- 
From: "Lubos Vnuk" <lubos.vnuk at rts.at>
To: <antlr-interest at yahoogroups.com>
Sent: Wednesday, July 02, 2003 8:21 PM
Subject: [antlr-interest] Re: strange bug (v 2.7.2)


> I think it might be the linear approximation of the lookahead.
>
> ANTLR thinks anything starting with '<' or '!' or '^', and being
> followed by '>' or '=' is the token NOT_EQ.
>
> Merging LE and NOT_EQ could help.
>
> Lubos.
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


 

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




More information about the antlr-interest mailing list