clang 20.0.0git
|
Represents the AST of a TranslationUnit. More...
Public Member Functions | |
Impl (SyntaxTree *Parent, ASTContext &AST) | |
Impl (SyntaxTree *Parent, Decl *N, ASTContext &AST) | |
Constructs a tree from an AST node. | |
Impl (SyntaxTree *Parent, Stmt *N, ASTContext &AST) | |
template<class T > | |
Impl (SyntaxTree *Parent, std::enable_if_t< std::is_base_of_v< Stmt, T >, T > *Node, ASTContext &AST) | |
template<class T > | |
Impl (SyntaxTree *Parent, std::enable_if_t< std::is_base_of_v< Decl, T >, T > *Node, ASTContext &AST) | |
int | getSize () const |
NodeId | getRootId () const |
PreorderIterator | begin () const |
PreorderIterator | end () const |
const Node & | getNode (NodeId Id) const |
Node & | getMutableNode (NodeId Id) |
bool | isValidNodeId (NodeId Id) const |
void | addNode (Node &N) |
int | getNumberOfDescendants (NodeId Id) const |
bool | isInSubtree (NodeId Id, NodeId SubtreeRoot) const |
int | findPositionInParent (NodeId Id, bool Shifted=false) const |
std::string | getRelativeName (const NamedDecl *ND, const DeclContext *Context) const |
std::string | getRelativeName (const NamedDecl *ND) const |
std::string | getNodeValue (NodeId Id) const |
std::string | getNodeValue (const Node &Node) const |
std::string | getDeclValue (const Decl *D) const |
std::string | getStmtValue (const Stmt *S) const |
Public Attributes | |
SyntaxTree * | Parent |
ASTContext & | AST |
PrintingPolicy | TypePP |
std::vector< Node > | Nodes |
Nodes in preorder. | |
std::vector< NodeId > | Leaves |
std::vector< int > | PostorderIds |
std::vector< NodeId > | NodesBfs |
Represents the AST of a TranslationUnit.
Definition at line 113 of file ASTDiff.cpp.
clang::diff::SyntaxTree::Impl::Impl | ( | SyntaxTree * | Parent, |
ASTContext & | AST | ||
) |
Definition at line 261 of file ASTDiff.cpp.
References clang::PrintingPolicy::AnonymousTagLocations, and TypePP.
clang::diff::SyntaxTree::Impl::Impl | ( | SyntaxTree * | Parent, |
Decl * | N, | ||
ASTContext & | AST | ||
) |
Constructs a tree from an AST node.
Definition at line 266 of file ASTDiff.cpp.
clang::diff::SyntaxTree::Impl::Impl | ( | SyntaxTree * | Parent, |
Stmt * | N, | ||
ASTContext & | AST | ||
) |
Definition at line 273 of file ASTDiff.cpp.
|
inline |
Definition at line 120 of file ASTDiff.cpp.
|
inline |
Definition at line 124 of file ASTDiff.cpp.
|
inline |
Definition at line 146 of file ASTDiff.cpp.
References Nodes.
|
inline |
Definition at line 140 of file ASTDiff.cpp.
References getRootId().
|
inline |
Definition at line 141 of file ASTDiff.cpp.
References getSize().
Definition at line 338 of file ASTDiff.cpp.
References clang::diff::Node::Children, E, clang::diff::SyntaxTree::getNode(), Id, clang::diff::Node::Parent, Parent, and clang::diff::Node::Shift.
std::string clang::diff::SyntaxTree::Impl::getDeclValue | ( | const Decl * | D | ) | const |
Definition at line 423 of file ASTDiff.cpp.
References D, clang::QualType::getAsString(), clang::Type::getCanonicalTypeInternal(), clang::Lexer::getSourceText(), Range, clang::T, and V.
Definition at line 144 of file ASTDiff.cpp.
Definition at line 143 of file ASTDiff.cpp.
std::string clang::diff::SyntaxTree::Impl::getNodeValue | ( | const Node & | Node | ) | const |
Definition at line 412 of file ASTDiff.cpp.
References clang::diff::Node::ASTNode, D, clang::DynTypedNode::get(), clang::diff::getInitializerValue(), and clang::Init.
std::string clang::diff::SyntaxTree::Impl::getNodeValue | ( | NodeId | Id | ) | const |
Definition at line 408 of file ASTDiff.cpp.
References clang::diff::SyntaxTree::getNode(), clang::diff::SyntaxTree::getNodeValue(), and Id.
Definition at line 330 of file ASTDiff.cpp.
References clang::diff::SyntaxTree::getNode(), Id, and clang::diff::Node::RightMostDescendant.
std::string clang::diff::SyntaxTree::Impl::getRelativeName | ( | const NamedDecl * | ND | ) | const |
Definition at line 379 of file ASTDiff.cpp.
References clang::Decl::getDeclContext().
std::string clang::diff::SyntaxTree::Impl::getRelativeName | ( | const NamedDecl * | ND, |
const DeclContext * | Context | ||
) | const |
Definition at line 358 of file ASTDiff.cpp.
References clang::NamedDecl::getQualifiedNameAsString().
|
inline |
Definition at line 139 of file ASTDiff.cpp.
Referenced by begin().
|
inline |
Definition at line 138 of file ASTDiff.cpp.
References Nodes.
Referenced by end(), and isValidNodeId().
std::string clang::diff::SyntaxTree::Impl::getStmtValue | ( | const Stmt * | S | ) | const |
Definition at line 446 of file ASTDiff.cpp.
References D, clang::diff::getEnclosingDeclContext(), and clang::UnaryOperator::getOpcodeStr().
Definition at line 334 of file ASTDiff.cpp.
References clang::diff::SyntaxTree::getNode(), Id, and clang::diff::Node::RightMostDescendant.
Definition at line 145 of file ASTDiff.cpp.
ASTContext& clang::diff::SyntaxTree::Impl::AST |
Definition at line 129 of file ASTDiff.cpp.
std::vector<NodeId> clang::diff::SyntaxTree::Impl::Leaves |
Definition at line 133 of file ASTDiff.cpp.
std::vector<Node> clang::diff::SyntaxTree::Impl::Nodes |
Nodes in preorder.
Definition at line 132 of file ASTDiff.cpp.
Referenced by addNode(), getMutableNode(), getNode(), and getSize().
std::vector<NodeId> clang::diff::SyntaxTree::Impl::NodesBfs |
Definition at line 136 of file ASTDiff.cpp.
SyntaxTree* clang::diff::SyntaxTree::Impl::Parent |
Definition at line 128 of file ASTDiff.cpp.
std::vector<int> clang::diff::SyntaxTree::Impl::PostorderIds |
Definition at line 135 of file ASTDiff.cpp.
PrintingPolicy clang::diff::SyntaxTree::Impl::TypePP |
Definition at line 130 of file ASTDiff.cpp.
Referenced by Impl().