newbie wants to do round-trip, source to source C parsing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie wants to do round-trip, source to source C parsing

SimonHF
Hello! I discovered clang from this thread:
http://stackoverflow.com/questions/239722/ast-from-c-code

The example link in the thread describing how to perform 'source to
source' parsing and re-writing using clang doesn't work anymore :-(
Can anybody give links and/or hints and tips on how to do this and
where to start?

Thanks, Simon
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: newbie wants to do round-trip, source to source C parsing

Douglas Gregor

On Apr 8, 2010, at 12:22 PM, Simon wrote:

> Hello! I discovered clang from this thread:
> http://stackoverflow.com/questions/239722/ast-from-c-code
>
> The example link in the thread describing how to perform 'source to
> source' parsing and re-writing using clang doesn't work anymore :-(
> Can anybody give links and/or hints and tips on how to do this and
> where to start?

Check out the Rewriter class, which helps with rewriting specific parts of the source without disturbing the rest of the source. Also, look at the Objective-C rewriter in lib/Frontend/RewriteObjc.cpp.

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev