[antlr-interest] [il-antlr-interest: 30654] Lexer rule precedence

Massimiliano Donini maxgbr at hotmail.it
Fri Nov 26 08:27:07 PST 2010


   Thank for quik reply, this is only a bunch of my grammar and the 
'DEAFULT' in the first rule does not exists in the original one, is only 
for demostration purposes, but if you try debugging in AntrlWorks 1.4 
this grammar with 'DEFAULT NULL' lexer catch DEFAULTLL instead of 
DEFAUTL NULL.
Max

Il 26/11/2010 16:55, Akira Akira ha scritto:
> Have you tried:
>
> start:
>     'DEFAULT' expr SEMICOLON
>     | expr SEMICOLON
>     ;
>
> Usually I avoid optionals first. Besides, parsing performance must be 
> better.
>
>
>
> 2010/11/27 Massimiliano Donini <maxgbr at hotmail.it 
> <mailto:maxgbr at hotmail.it>>
>
>      Hi, i have one problems on lexer rules and i can't understand why.
>     As attachment  there's a piece of my grammar where i got the error:
>     Debugging i can correctly match 'NULL', but i can't match 'DEFAULT
>     NULL' there something that i miss....
>     I think there is something wrong with lexer rule precedence, but
>     not sure.
>     Any help would be really appreciated
>
>     Greetings Max
>
>
>     List: http://www.antlr.org/mailman/listinfo/antlr-interest
>     Unsubscribe:
>     http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>     --
>     You received this message because you are subscribed to the Google
>     Groups "il-antlr-interest" group.
>     To post to this group, send email to
>     il-antlr-interest at googlegroups.com
>     <mailto:il-antlr-interest at googlegroups.com>.
>     To unsubscribe from this group, send email to
>     il-antlr-interest+unsubscribe at googlegroups.com
>     <mailto:il-antlr-interest%2Bunsubscribe at googlegroups.com>.
>     For more options, visit this group at
>     http://groups.google.com/group/il-antlr-interest?hl=en.
>
>
>



More information about the antlr-interest mailing list