[antlr-interest] ANTLR3 STs and rewrite=true

Kailey Joanette kaileyjo at bigbluebubble.com
Wed Mar 28 05:01:49 PDT 2007


Sorry For being a little slow, but I'm not sure how to do that...

Kailey 

Subject: Re: [antlr-interest] ANTLR3 STs and rewrite=true

Just use the text for those rule refs and pass as list of strings or  
whatever to classBlock.

Ter
On Mar 27, 2007, at 1:15 PM, Kailey Joanette wrote:

> To clear up my last post. why can I not do this:
>
>
>
> classBody
>
>                 :               '{' (c+=classBodyDeclaration)* '}' - 
> > classBlock( body={$c} )
>
>                 ;
>
>
>
> And have anything in those classBodyDeclarations come back as if  
> they were just using the default rewrite?
>
>
>
> My grammar uses:
>
> options
>
> {
>
> output=template;
>
> rewrite=true;
>
> }
>
>
>
> When I use this rule instead I end up with
>
>
>
> class Test
>
> {
>
> };
>
>
>
> Even though there it should be
>
>
>
> class Test
>
> {
>
> static int NUMBER[];
>
>  void ttt(){}
>
> }
>
>
>
> And it is in fact that if I don't have a template rewrite rule in  
> there.
>
>
>
> Kailey
>
>
>
>



More information about the antlr-interest mailing list