<html>
<head></head>
<body>
<p>Thank you very much David.</p>
<p>Which interface would you recommend me to use for my purpose? I don't understand really well what are the difference among them (LibClang, Plugins, LibTooling or Clang Tools) and i would need to know the best option for me. What I want is to create a tool reusing Clang only to analyze C++ programs. If you need more information to give me an answer, please tell me what you would need to know.</p>
<p>Thanks,</p>
<p>Pedro D.</p>
<div><em>El dia 07 ene 2013 17:29, David Blaikie <dblaikie@gmail.com> escribió:</em></div><blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>On Mon, Jan 7, 2013 at 2:44 AM, Pedro Delgado Perez<br/>
<pedro.delgadoperez@mail.uca.es> wrote:</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>Hello,<br/>
I've just known Clang looking for a soution to the task i need to perform.<br/>
Well, what I need is to parser a C++ program in order to get some<br/>
information about the code and, after that, to change the code regarding<br/>
that information collected.For instance, I would need to know if a certain<br/>
program contains some arithmetic operators., obtaining a record with the<br/>
line where the operator is located and which operator is. I've been reading<br/>
about Clang and now I know you can go through the AST, but i'm not totally<br/>
sure if it's what I'm looking for because apart from the example I've<br/>
commented above, I would need a lot of kinds of information:- What are the<br/>
global and the local variables.- If there is an overriden member when a<br/>
class inherits from another.- If a method of a class is overloaded.-...I<br/>
need that information because I have to change the original program once I<br/>
have the record with the information. For instance, if in the code there is<br/>
a reference to an overriden member, I have to turn that reference into the<br/>
hidden member.</p>
<br/>
<br/>
<p>The other question I have is: is it worth the effort and the time to learn<br/>
how to use clang? I need an opinion to know how easy or tough is to learn<br/>
how to use it.</p>
<p>I hope you could lend me a hand. Thanks in advance.</p>
</blockquote><p>It depends a little on what alternatives you're considering. Clang<br/>
isn't necessarily going to be easy to get started with, especially<br/>
making source modifications, avoiding conflicts, etc, but it's<br/>
probably the easiest thing available to do this job well.</p>
<p>The tooling infrastructure ( <a href="http://clang.llvm.org/docs/Tooling.html" target="_blank">http://clang.llvm.org/docs/Tooling.html</a> )<br/>
and AST Matchers ( <a href="http://clang.llvm.org/docs/LibASTMatchers.html" target="_blank">http://clang.llvm.org/docs/LibASTMatchers.html</a> )<br/>
are designed to make this sort of task as easy & painless as possible.</p>
<p>- David</p>
</blockquote>
</body>
</html>