clang  12.0.0git
BuildTree.h
Go to the documentation of this file.
1 //===- BuildTree.h - build syntax trees -----------------------*- C++ -*-=====//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 // Functions to construct a syntax tree from an AST.
9 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_TOOLING_SYNTAX_TREE_H
11 #define LLVM_CLANG_TOOLING_SYNTAX_TREE_H
12 
13 #include "clang/AST/Decl.h"
14 #include "clang/Basic/TokenKinds.h"
17 
18 namespace clang {
19 namespace syntax {
20 
21 /// Build a syntax tree for the main file.
23  const clang::TranslationUnitDecl &TU);
24 
25 // Create syntax trees from subtrees not backed by the source code.
26 
30 
31 } // namespace syntax
32 } // namespace clang
33 #endif
syntax::TranslationUnit * buildSyntaxTree(Arena &A, const clang::TranslationUnitDecl &TU)
Build a syntax tree for the main file.
Definition: BuildTree.cpp:1348
A root node for a translation unit. Parent is always null.
Definition: Nodes.h:178
A memory arena for syntax trees.
Definition: Tree.h:39
The no-op statement, i.e. ';'.
Definition: Nodes.h:491
clang::syntax::Leaf * createPunctuation(clang::syntax::Arena &A, clang::tok::TokenKind K)
Definition: Synthesis.cpp:24
clang::syntax::EmptyStatement * createEmptyStatement(clang::syntax::Arena &A)
Definition: Synthesis.cpp:38
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
Definition: TokenKinds.h:25
Dataflow Directional Tag Classes.
A leaf node points to a single token inside the expanded token stream.
Definition: Tree.h:140
Defines the clang::TokenKind enum and support functions.
The top declaration context.
Definition: Decl.h:82