Gang,

I am totally newbie to ANTLR and forgive me if this is a FAQ (I have
been search a lot for an answer).

In principle, I want to do;

Syntax being
 a.b.c.d -> e.f.g.h

translated to

 e.getF().getG.setH( a.getB().getC().getD() );

I have no problems with any of it, except the "setH()" part. In my AST, I have

^(MEMBER_DECLARATION member_reference
{
// removed for clarity
}
)

member_reference returns [StringTemplate member]
    : member
    {
    // a lot of stuff
    };

but if I change the AST rule to

member_reference returns [StringTemplate member]
    : (member
    {
    // a lot of stuff
    })*;

member_reference returns [StringTemplate member]
    : (member
    {
        // a lot of stuff
    })*
    member
    {
        // special last element handling
    }
    ;

I get an error;
" member is a non-unique reference"


How is one supposed to make such distinction??


Cheers
Niclas

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/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