[cfe-dev] AST nodes with examples showing what they are?
Manuel Klimek
klimek at google.com
Thu Aug 6 00:30:57 PDT 2015
I think the solution to that is better documentation. Every node in the AST
should ideally have a comment that explains what kinds of syntactic
constructs it represents, with examples (some have them already).
Unfortunately that's a huge project.
On Thu, Aug 6, 2015 at 9:17 AM Nikola Smiljanic <popizdeh at gmail.com> wrote:
> What exactly do you mean by "trigger it"?
>
> Looking at the inheritance diagram should give you a good idea about what
> each node represents. NamedDecl is a base class for all declarations that
> have a name. So for example:
>
> int x; // variable declaration VarDecl that's also a NamedDecl
> foo: // label LabelDecl that's also a NamedDecl
> namespace bar {} // you get the idea
>
> On Thu, Aug 6, 2015 at 3:33 PM, Hayden Livingston <halivingston at gmail.com>
> wrote:
>
>> The Clang AST is great, but it's a bit tedious to look at at a node
>> and then try to find a suitable piece of C++ code to trigger it.
>>
>> Does anyone know of an easier way to play with the AST? For example
>> documentation or such that says NamedDecl -> and here is how to create
>> a NamedDecl in C++?
>>
>> And then I'm also sometimes lost on what can appear inside a Node,
>> i.e. a Decl node can have VarDecl and that can have a
>> CXXConstructExpr, etc.
>>
>> Even if some of you have tips to share, that'd be great.
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150806/f2f07092/attachment.html>
More information about the cfe-dev
mailing list