[antlr-interest] How to modify lines of code, not only the token, using stringtemplate?

YINGAnnie yimm8369 at hotmail.com
Tue Mar 17 16:38:11 PDT 2009


 

 

Hello,

 

I want to usd stringtemplat to modify 

 

var v1:Number=10;
var v2:Number=10;

 

to

 

var v1,v2:Number=10;

 

I got the tree like this:

 

(PROPERTY_DECL (VARIABLE_STATEMENT .... (VAR_ID_DECL v1 (QUALIFIED_NAME Number)) (ASSIGNMENT_EXPRESSION (CONDITION_EXPRESSION .... (PRIMARY_EXPRESSION 10)

(PROPERTY_DECL (VARIABLE_STATEMENT .... (VAR_ID_DECL v2 (QUALIFIED_NAME Number)) (ASSIGNMENT_EXPRESSION (CONDITION_EXPRESSION .... (PRIMARY_EXPRESSION 10)

 

They are in two different tree. How to modify lines of code?

 

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/20090318/71ed0d43/attachment.html 


More information about the antlr-interest mailing list