Editing C Files Programatically [message #494688] |
Mon, 02 November 2009 08:25 |
Jacks Messages: 1 Registered: November 2009 |
Junior Member |
|
|
Dear All,
Task definition :
I have to rename a method name. customizedAddMethod to renamedAddMethod.
I/p :
void customizedAddMethod(){
// do something
}
o/p
void renamedAddMethod(){
// do something
}
This was the sample piece of code written for it:
ASTRewrite create = ASTRewrite.create(ast);
IASTNode replacementNode = create.createLiteralNode("renamedAddMethod");
rewrite.replace(methodNameNode, replacementNode, null);
translationUnit.save(null, true);
The execution went fine, but nothing seemed to reflect in the file.
I am unable to track the flow why its not getting reflected.
Could someone help me out in this.
Thanks & Regards,
Jagadeesh. P
[Updated on: Mon, 02 November 2009 08:54] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04162 seconds