[antlr-interest] Understanding priorities in lexing (newbie)[Suggestion]
Lloyd Dupont
ld at galador.net
Sun Jul 15 16:49:25 PDT 2007
It doesn't look like to a reply to one of my post (at least according to the
title), but it's very relevant to my problem, thanks :-)
----- Original Message -----
From: "Terence Parr" <parrt at cs.usfca.edu>
> On Jul 13, 2007, at 10:18 AM, Susan Jolly wrote:
>> I really appreciate people who take the time to write the simplest
>> possible
>> grammar that illustrates the problem they are having rather than
>> embedding
>> huge grammars in their posts.
>
> Hi Susan! Agreed.
>
> That is a correct grammar. Note that the following is not really going
> to work:
>
> DUMMY
> options {backtrack=true;}
> : (KEYWORD {$type = KEYWORD;} | OTHER{$type = OTHER;})
> ;
>
> it will not execute the backtracking in this case as it thinks it knows
> what it's doing. :(
>
More information about the antlr-interest
mailing list