clang
6.0.0
|
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. More... | |
Impl (SyntaxTree *Parent, Stmt *N, ASTContext &AST) | |
template<class T > | |
Impl (SyntaxTree *Parent, typename std::enable_if< std::is_base_of< Stmt, T >::value, T >::type *Node, ASTContext &AST) | |
template<class T > | |
Impl (SyntaxTree *Parent, typename std::enable_if< std::is_base_of< Decl, T >::value, T >::type *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. More... | |
std::vector< NodeId > | Leaves |
std::vector< int > | PostorderIds |
std::vector< NodeId > | NodesBfs |
Represents the AST of a TranslationUnit.
Definition at line 112 of file ASTDiff.cpp.
clang::diff::SyntaxTree::Impl::Impl | ( | SyntaxTree * | Parent, |
ASTContext & | AST | ||
) |
Definition at line 262 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 267 of file ASTDiff.cpp.
clang::diff::SyntaxTree::Impl::Impl | ( | SyntaxTree * | Parent, |
Stmt * | N, | ||
ASTContext & | AST | ||
) |
Definition at line 274 of file ASTDiff.cpp.
|
inline |
Definition at line 119 of file ASTDiff.cpp.
|
inline |
Definition at line 124 of file ASTDiff.cpp.
|
inline |
Definition at line 147 of file ASTDiff.cpp.
References Id.
|
inline |
Definition at line 141 of file ASTDiff.cpp.
|
inline |
Definition at line 142 of file ASTDiff.cpp.
Definition at line 339 of file ASTDiff.cpp.
References clang::diff::Node::Children, getNode(), clang::diff::NodeId::isInvalid(), clang::diff::Node::Parent, and Parent.
std::string clang::diff::SyntaxTree::Impl::getDeclValue | ( | const Decl * | D | ) | const |
Definition at line 424 of file ASTDiff.cpp.
References AST, clang::QualType::getAsString(), clang::Type::getCanonicalTypeInternal(), clang::ASTContext::getLangOpts(), getRelativeName(), clang::ASTContext::getSourceManager(), clang::Lexer::getSourceText(), clang::T, and TypePP.
Definition at line 145 of file ASTDiff.cpp.
References Id.
Referenced by clang::diff::getSubtreeBfs().
Definition at line 144 of file ASTDiff.cpp.
References Id.
Referenced by findPositionInParent(), clang::diff::Node::getIdentifier(), clang::diff::Subtree::getNode(), getNodeValue(), getNumberOfDescendants(), clang::diff::getSubtreeBfs(), clang::diff::getSubtreePostorder(), and isInSubtree().
std::string clang::diff::SyntaxTree::Impl::getNodeValue | ( | NodeId | Id | ) | const |
Definition at line 409 of file ASTDiff.cpp.
References getNode().
Referenced by clang::diff::Subtree::getNodeValue().
std::string clang::diff::SyntaxTree::Impl::getNodeValue | ( | const Node & | Node | ) | const |
Definition at line 413 of file ASTDiff.cpp.
References clang::diff::Node::ASTNode.
int clang::diff::SyntaxTree::Impl::getNumberOfDescendants | ( | NodeId | Id | ) | const |
Definition at line 331 of file ASTDiff.cpp.
References getNode(), and clang::diff::Node::RightMostDescendant.
std::string clang::diff::SyntaxTree::Impl::getRelativeName | ( | const NamedDecl * | ND, |
const DeclContext * | Context | ||
) | const |
Definition at line 359 of file ASTDiff.cpp.
Referenced by getDeclValue(), and getRelativeName().
std::string clang::diff::SyntaxTree::Impl::getRelativeName | ( | const NamedDecl * | ND | ) | const |
Definition at line 380 of file ASTDiff.cpp.
References clang::Decl::getDeclContext(), and getRelativeName().
|
inline |
Definition at line 140 of file ASTDiff.cpp.
Referenced by clang::diff::getSubtreeBfs().
|
inline |
Definition at line 139 of file ASTDiff.cpp.
Referenced by clang::diff::Subtree::getIdInRoot(), clang::diff::Subtree::getLeftMostDescendant(), clang::diff::Subtree::getNodeValue(), and clang::diff::getSubtreeBfs().
std::string clang::diff::SyntaxTree::Impl::getStmtValue | ( | const Stmt * | S | ) | const |
Definition at line 447 of file ASTDiff.cpp.
Definition at line 335 of file ASTDiff.cpp.
References getNode(), and clang::diff::Node::RightMostDescendant.
Definition at line 146 of file ASTDiff.cpp.
ASTContext& clang::diff::SyntaxTree::Impl::AST |
Definition at line 130 of file ASTDiff.cpp.
Referenced by getDeclValue().
std::vector<NodeId> clang::diff::SyntaxTree::Impl::Leaves |
Definition at line 134 of file ASTDiff.cpp.
Referenced by clang::diff::getSubtreeBfs().
std::vector<Node> clang::diff::SyntaxTree::Impl::Nodes |
Nodes in preorder.
Definition at line 133 of file ASTDiff.cpp.
std::vector<NodeId> clang::diff::SyntaxTree::Impl::NodesBfs |
Definition at line 137 of file ASTDiff.cpp.
Referenced by clang::diff::getSubtreeBfs().
SyntaxTree* clang::diff::SyntaxTree::Impl::Parent |
Definition at line 129 of file ASTDiff.cpp.
Referenced by findPositionInParent(), and clang::diff::getSubtreeBfs().
std::vector<int> clang::diff::SyntaxTree::Impl::PostorderIds |
Definition at line 136 of file ASTDiff.cpp.
Referenced by clang::diff::Subtree::getPostorderOffset(), and clang::diff::getSubtreeBfs().
PrintingPolicy clang::diff::SyntaxTree::Impl::TypePP |
Definition at line 131 of file ASTDiff.cpp.
Referenced by getDeclValue(), and Impl().