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: [email protected] [mailto:antlr-interest-
> [email protected]] On Behalf Of The Researcher
> Sent: Tuesday, April 26, 2011 12:48 PM
> To: [email protected]
> 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

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to