[cfe-dev] Source-to-source manipulations with Clang

Andrey Tarasevich tarasevich.andrey at googlemail.com
Fri Jan 28 04:20:29 PST 2011


Thank you for the answer. I'll take a look at it.

2011/1/27 Douglas Gregor <dgregor at apple.com>

>
> On Jan 27, 2011, at 4:52 AM, Andrey Tarasevich wrote:
>
> > Hello!
> >
> > Recently I started using Clang for the C-code parsing, but I have some
> problems with find information on how to do Source-to-source
> transformations.
> >
> > At the moment I can generate Abstract Syntax Tree and tree traversal
> trough the API, i.e. rewriting the ASTConsumer and DeclVisitor classes, but
> I don't know how to do the transformations of the AST and write it back to
> the source code. Could you please give me some feedback on how to do such
> manipulations? I didn't find anything useful in google, so I decided to
> write to mailing list.
>
> Check out RewriteObjC.cpp, which uses the (textual) Rewriter class to
> perform AST transformations.
>
>        - Doug
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110128/60c77328/attachment.html>


More information about the cfe-dev mailing list