Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Sample code for acessing the ast

When you obtain AST from the CDT parsers (via ITranslationUnit or
ILanguage)
you cannot modify this AST. Any set... operation will throw an exception
on
you.

To make AST based modifications you can use ASTRewrite. The refactorings

implemented in CDT can serve as examples on how to use the facility.

Markus. 

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Wolfgang Kaifler
> Sent: Thursday, March 18, 2010 10:27 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] Sample code for acessing the ast
> Importance: Low
> 
> Hallo,
> 
> i want do do a little bit code analysis in c++. Therefore i 
> use the eclipse cdt parser which works fine for me :-) I 
> wrote a few visitor patterns, so i am able to find some nodes 
> on the AST.
> Now i want to to delete or insert new Nodes.
> This ist not for a PlugIn, I only want to transform the AST.
> Is there any sample Code to do this? Or is there any site to 
> start with?
> 
> Thanks
> Wolfgang
> 
> 
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top