[cfe-dev] libTooling Questions

Manuel Klimek klimek at google.com
Sun Aug 12 13:18:05 PDT 2012


On Sun, Aug 12, 2012 at 5:54 PM, Jens Weller <JensWeller at gmx.de> wrote:
> Hi Clang-devs,
>
> just started to play around with libTooling, a few (C++ related) Questions...
>
> As far as I understand, I can access the AST with LibTooling, retrieving f.e. all Function Names and beeing able to make changes to the ast.
> This works over the Visitor and FrontendAction classes.
>
> So, I understand how to implement tools which do transformations or rename things in the code, or generate statistics.
>
> What I have yet not found, is kind of a Document Model for C++ files, which I'm actually looking for:
> I'd like to be able to display the whole ast (or more precise, namespaces, classes, members of them), so I would need to have access to the ast nodes, instead of visiting selected ones.

The AST visitor gives you that access. I'm not exactly sure what
you're looking for.

>
> Where to look for this, is libAst the right place?
> http://clang.llvm.org/docs/InternalsManual.html#libast

With high probability this is not what you're looking for ...

> As far as I understand, in LibTooling ASTContext provides information about the current location in the ast to the visitor.
>
> So, where to start, if you need an document like interface for a C++ File in clang?

Again, I'm not sure what you're asking. Can you tell me more about
what you're trying to do in the end?

Cheers,
/Manuel

>
> kind regards,
>
> Jens Weller
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list