[antlr-interest] How to do java refactoring using stringtemplate

YINGAnnie yimm8369 at hotmail.com
Mon Mar 16 20:18:39 PDT 2009


 

 

Hi everyone,

 

I want to do the java refactoring, now , I finished the java.g and javatree.g.  I am not quite sure what should I do next.

 

I read Terence Parr's  Language Translation Using ANTLR and StringTemplate  http://www.codegeneration.net/tiki-read_article.php?articleId=77.

 

Cos refactioring is not like Language Translation, only a small part of the code need to be changed, like chang for loop to while loop. Therefore, my question is:

 

Do I need to change every rules in java.g like form 1 to 2,change the output=template, and write the related java.stg including all the template?

 

1.

program 

    :   (declaration)+
    ;

 

2.

program returns [StringTemplate code=template("program")]
    :   (declaration[code])+
    ;

 

In that way, my javatree.g is useless, right?

 

I am totally lost.

 

Thanks in advance.

 

 

Annie

_________________________________________________________________
MSN 表情魔法书,改变你的对话时代!
http://im.live.cn/emoticons/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090317/628a4ce7/attachment.html 


More information about the antlr-interest mailing list