[antlr-interest] (qid) Qualified Identifiers

Jim Idle jimi at temporal-wave.com
Tue Apr 26 12:54:10 PDT 2011


Your code is copying the wrong thing. That example was about parsing:

 with X
  .y
 end with

Your code is also wrong as it should really be:

qid : ^(DOT qid qid?) // Second is only optional if supporting with x { .y
}
    | ID
    ;

Finally, it is unlikely to just be ID that qualifies, usually any
expression can do it.

Jim


> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of The Researcher
> Sent: Tuesday, April 26, 2011 12:48 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] (qid) Qualified Identifiers
>
> I am creating qualified identifiers and saw the message
> http://markmail.org/message/to72c6jlem5zcrjk
>
> parser grammar
>
>   qid : ID (DOT^ ID)* ;
>
> and tree grammar
>
> qid : ^(DOT qid)
>         | ID ;
>
> but to get the AST parse to work for my tree grammar required
>
>  qid : ^(DOT qid ID)      note ID added after quid
>         | ID ;
>
> Was the example a typo or is my code wrong?
>
> Thanks
>
> Eric
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list