[cfe-dev] unknown type name 'ObjCClassDecl'
Eli Friedman
eli.friedman at gmail.com
Wed Jun 19 10:44:03 PDT 2013
On Wed, Jun 19, 2013 at 1:32 AM, lostknight <thanhtuan at aces.snu.ac.kr>wrote:
> Hi, thank for replying. I got it now.
>
> May I have another question? Where do I get documentation about the AST
> structure of produced from clang? The reason why I ask this because I don't
> find the information in "clang internal" section in the homepage of clang
> is
> enough to fully understand about the AST structure. For example, when using
> the clang::RecursiveASTVisitor to traverse the tree, I don't know which
> function (VisitSomething) I have to rewrite to print out the node's
> information.
>
Try http://clang.llvm.org/doxygen/ . Also, looking at small examples using
the -ast-dump flag can be helpful.
>
> My ultimate goal is to construct a source-to-source transformation. I need
> to start from parsing a source code and regenerate the code but to do that
> I
> need to understand the AST first. Any suggestions on how I should start
> would be great.
>
I haven't really done much of that sort of thing; hopefully someone else
will chime in.
There are some examples of using clang's rewriter infrastructure in
clang/lib/Rewrite/Frontend/ in the source tree, if that's what you're
looking for. See also http://clang.llvm.org/docs/Tooling.html and
http://clang.llvm.org/docs/ExternalClangExamples.html .
-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130619/e10ef27a/attachment.html>
More information about the cfe-dev
mailing list