[antlr-interest] leafnode value

ManimuthuLakshmi Pitchaikani antlr_lakshmi at yahoo.com
Sun Oct 10 13:20:27 PDT 2004


Hi,
 
I want to change the value of the leafnode in the result tree.
 
The code goes here:

stop_stmt!

{

String strText = "";

CommonAST ast; 

AST[] ast1 = new AST[2]; // ast1[2];

}

: #(stp:STOP procId:PROCID

{

ast1[0] = (CommonAST) procId;

System.out.println("stop procid="+ast1[0]); 

ast1[0].setText("Hello");

procId = (CommonAST) ast1[0];

System.out.println("changed procid="+procId.getText());

}

) 

{

#stop_stmt = #([STOP,"./killproc"], procId);

System.out.println("stop_stmt procId="+procId.getText());

}

;

Am getting the value of procId as "Hello" only in System output.  But in the tree, the value is not getting changed.  Why?

Thanks.

Best Regards,

Lakshmi

 

 
 
 

		
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20041010/eb74fc12/attachment.html


More information about the antlr-interest mailing list