|
clang 22.0.0git
|
SyntaxTree objects represent subtrees of the AST. More...
#include "clang/Tooling/ASTDiff/ASTDiff.h"
Classes | |
| class | Impl |
| Represents the AST of a TranslationUnit. More... | |
Public Types | |
| using | PreorderIterator = NodeId |
Public Member Functions | |
| SyntaxTree (ASTContext &AST) | |
| Constructs a tree from a translation unit. | |
| template<class T> | |
| SyntaxTree (T *Node, ASTContext &AST) | |
| Constructs a tree from any AST node. | |
| SyntaxTree (SyntaxTree &&Other)=default | |
| ~SyntaxTree () | |
| const ASTContext & | getASTContext () const |
| StringRef | getFilename () const |
| int | getSize () const |
| NodeId | getRootId () const |
| PreorderIterator | begin () const |
| PreorderIterator | end () const |
| const Node & | getNode (NodeId Id) const |
| int | findPositionInParent (NodeId Id) const |
| std::pair< unsigned, unsigned > | getSourceRangeOffsets (const Node &N) const |
| std::string | getNodeValue (NodeId Id) const |
| Serialize the node attributes to a string representation. | |
| std::string | getNodeValue (const Node &Node) const |
Public Attributes | |
| std::unique_ptr< Impl > | TreeImpl |
SyntaxTree objects represent subtrees of the AST.
| clang::diff::SyntaxTree::SyntaxTree | ( | ASTContext & | AST | ) |
Constructs a tree from a translation unit.
Definition at line 970 of file ASTDiff.cpp.
References SyntaxTree(), and TreeImpl.
Referenced by clang::diff::SyntaxTree::Impl::Impl(), clang::diff::SyntaxTree::Impl::Impl(), clang::diff::SyntaxTree::Impl::Impl(), clang::diff::SyntaxTree::Impl::Impl(), clang::diff::SyntaxTree::Impl::Impl(), SyntaxTree(), and SyntaxTree().
|
inline |
|
default |
References clang::Other, and SyntaxTree().
|
default |
| SyntaxTree::PreorderIterator clang::diff::SyntaxTree::begin | ( | ) | const |
Definition at line 984 of file ASTDiff.cpp.
References TreeImpl.
| SyntaxTree::PreorderIterator clang::diff::SyntaxTree::end | ( | ) | const |
Definition at line 987 of file ASTDiff.cpp.
References TreeImpl.
Definition at line 989 of file ASTDiff.cpp.
References TreeImpl.
| const ASTContext & clang::diff::SyntaxTree::getASTContext | ( | ) | const |
Definition at line 976 of file ASTDiff.cpp.
References TreeImpl.
| StringRef clang::diff::SyntaxTree::getFilename | ( | ) | const |
Definition at line 978 of file ASTDiff.cpp.
References TreeImpl.
Referenced by clang::diff::SyntaxTree::Impl::findPositionInParent(), clang::diff::SyntaxTree::Impl::getNodeValue(), clang::diff::SyntaxTree::Impl::getNumberOfDescendants(), and clang::diff::SyntaxTree::Impl::isInSubtree().
| std::string clang::diff::SyntaxTree::getNodeValue | ( | const Node & | Node | ) | const |
Definition at line 1013 of file ASTDiff.cpp.
References TreeImpl.
| std::string clang::diff::SyntaxTree::getNodeValue | ( | NodeId | Id | ) | const |
Serialize the node attributes to a string representation.
This should uniquely distinguish nodes of the same kind. Note that this function just returns a representation of the node value, not considering descendants.
Definition at line 1009 of file ASTDiff.cpp.
References TreeImpl.
Referenced by clang::diff::SyntaxTree::Impl::getNodeValue().
| NodeId clang::diff::SyntaxTree::getRootId | ( | ) | const |
Definition at line 983 of file ASTDiff.cpp.
References TreeImpl.
| int clang::diff::SyntaxTree::getSize | ( | ) | const |
Definition at line 982 of file ASTDiff.cpp.
References TreeImpl.
| std::pair< unsigned, unsigned > clang::diff::SyntaxTree::getSourceRangeOffsets | ( | const Node & | N | ) | const |
Definition at line 994 of file ASTDiff.cpp.
References clang::diff::Node::ASTNode, clang::Lexer::getLocForEndOfToken(), and TreeImpl.
| std::unique_ptr<Impl> clang::diff::SyntaxTree::TreeImpl |
Definition at line 87 of file ASTDiff.h.
Referenced by begin(), end(), findPositionInParent(), getASTContext(), clang::diff::ASTDiff::getMapped(), getNode(), getNodeValue(), getNodeValue(), getRootId(), getSize(), getSourceRangeOffsets(), SyntaxTree(), and SyntaxTree().