[antlr-interest] Delimited identifiers and suffix functions

Martin Probst mail at martin-probst.com
Mon Dec 12 11:28:29 PST 2005


Depending on the rest of your grammar you might be able to lex the DOT
together with the preceding element. E.g. "ident0." becomes IDENT_W_DOT
instead of IDENT DOT, and your rule would be
(IDENT_W_DOT)* ( IDENT | LAG OPEN_PAREN ... )*

Martin

Am Montag, den 12.12.2005, 12:22 -0500 schrieb John.Ericson at thomson.com:
> I am having a problem with parser nondeterminism between alt 1 and the
> exit branch of the following rule (simplified)...
> 
> member : identifier (DOT identifier)* 
>            (DOT LASTCHILD 
>          | DOT LAG OPEN_PAREN index CLOSE_PAREN)* 
>        ;
> 
> I want to successfully parse the following types of members...
> 
> ident0.ident1.ident2.identN 
> ident0.ident1.ident2.identN.lastchild 
> ident0.ident1.ident2.identN.lastchild.lag(1)
> 
> 
> Any ideas?
> 
>         John Ericson 
>         Sr. Programmer/Analyst 
>         Thomson Medstat
>         



More information about the antlr-interest mailing list