Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Create ASTVisitor that can reflect change on a temporary AST

Dear all,
      How do I write a visitor that makes changes to an AST and return that AST

For example,

IASTNode nd = getTemporaryNode(content); // Assume this is a blackbox method that returns a node to be modified
nd.accept(new CustomVisitor(infoForChanges, ASTRewrite.create(nd.getTranslationUnit()));

For some reason this doesnt reflect the changes on the nd. 

This nd has nothing to do with any open file in the re factoring context. 


Regards
       Krishna

Back to the top