How about something like this?

r    :    (ID EQ)+ INTLIT SEMICOLON -> ^(ASSIGN ID INTLIT)+
    ;

So, for your example, this will create two subtrees with ASSIGN as root. 
The tree generated will be ^(nil ^(ASSIGN Odd 0) ^(ASSIGN Even 0))

And then you can write string template in the tree walker and emit out 
as you need.

- Indhu

Bruce Bauman wrote:
> In the sometimes bizarre dialect of Pascal I am using (MetaWare), the 
> following is allowed:
>  
> Odd := Even := 0;
>  
> I need to split this into:
>  
> Odd := 0;
> Even := 0;
>  
> Can somebody point me in the right direction?
>  
> Thanks.
>  
> -- Bruce
>
> 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