<div dir="ltr">Hi,<br><br>I haven't used CIndex so I can't help you on that, but others of course can help.<br><br>To get started, take a look at clang/lib/Frontend/RewriteObjC.cpp. This code rewrites objc to C. There are two approaches for tsource-to-source transformation (Rewriting, AST re-build). Im the Rewriting approach the AST is traversed and the transformed code is generated as you traverse the AST, this is what is used in RewriteObjC. The other approach is to build the transformed AST from the original AST and then use the prettyprinter to generate the code. This approach is flexible and allows you to apply a chain of transformations on the AST.<br>
<br>You can copy the Clang main file and start your tool under clang/tools. Try to trace the main file to know how the ObjC rewritter is invoked.<br><br>Hope this helps,<br>Moataz<br><br><div class="gmail_quote">On Sun, Apr 4, 2010 at 2:08 PM, Mohamed Yousef <span dir="ltr"><<a href="mailto:harrrrpo@gmail.com">harrrrpo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr">Hello,<br><br>I'm working in a project involving source to source transformation of some arbitrary c code , i'm looking forward to using Clang<br>
my main problem is where to start , i can find approx. no documentation on topic<br>
<br>1) how complete is the CIndex interface , what limitations can it impose ?<br><br>2) any existing source to source applications based on clang that can be of help as a starting point ?<br><br>3) can the LLVM Kaleidoscope lessons be of help in understanding how to use clang libraries ?<br>

<br>Thanks,<br>Mohamed Yousef<br></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>