[antlr-interest] ANTLR3 STs and rewrite=true

Terence Parr parrt at cs.usfca.edu
Tue Mar 27 15:48:15 PDT 2007


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