Lines Matching full:clang
2 Introduction to the Clang AST
5 This document gives a gentle introduction to the mysteries of the Clang
7 Clang, or use tools that work based on Clang's AST, like the AST
19 Clang's AST is different from ASTs produced by some other compilers in
23 Clang's AST a good fit for refactoring tools.
25 Documentation for all Clang AST nodes is available via the generated
26 `Doxygen <http://clang.llvm.org/doxygen>`_. The doxygen online
28 make a search for clang and the AST node's class name usually turn up
30 clang ParenExpr).
35 A good way to familarize yourself with the Clang AST is to actually look
36 at it on some simple example code. Clang has a builtin AST-dump mode,
49 # Clang by default is a frontend for many tools; -Xclang is used to pass
51 $ clang -Xclang -ast-dump -fsyntax-only test.cc
53 ... cutting out internal declarations of clang ...
70 declaration <http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html>`_.
72 declaration <http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html>`_
74 statement <http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html>`_,
76 statement <http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html>`_
78 statement <http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html>`_.
85 `ASTContext <http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html>`_.
87 `getTranslationUnitDecl <http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#abd909fb01ef10cfd0244832a67b1dd64>`_,
88 or to access Clang's `table of
89 identifiers <http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#a4f95adb9958e22fbe55212ae6482feb4>`_
95 Clang's AST nodes are modeled on a class hierarchy that does not have a
98 `Decl <http://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_ and
99 `Stmt <http://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_. Many
101 `Type <http://clang.llvm.org/doxygen/classclang_1_1Type.html>`_,
102 `Decl <http://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_,
103 `DeclContext <http://clang.llvm.org/doxygen/classclang_1_1DeclContext.html>`_
104 or `Stmt <http://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_, with
109 `CXXBaseSpecifier <http://clang.llvm.org/doxygen/classclang_1_1CXXBaseSpecifier.html>`_.
112 `TranslationUnitDecl <http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html>`_
116 `RecursiveASTVisitor <http://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html>`_.
118 tutorial <http://clang.llvm.org/docs/RAVFrontendAction.html>`_.
120 The two most basic nodes in the Clang AST are statements
121 (`Stmt <http://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_) and
123 (`Decl <http://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_). Note
125 (`Expr <http://clang.llvm.org/doxygen/classclang_1_1Expr.html>`_) are
126 also statements in Clang's AST.