clang 20.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 969 of file ASTDiff.cpp.
|
inline |
|
default |
|
default |
SyntaxTree::PreorderIterator clang::diff::SyntaxTree::begin | ( | ) | const |
Definition at line 983 of file ASTDiff.cpp.
References TreeImpl.
SyntaxTree::PreorderIterator clang::diff::SyntaxTree::end | ( | ) | const |
Definition at line 986 of file ASTDiff.cpp.
References TreeImpl.
Definition at line 988 of file ASTDiff.cpp.
const ASTContext & clang::diff::SyntaxTree::getASTContext | ( | ) | const |
Definition at line 975 of file ASTDiff.cpp.
References TreeImpl.
StringRef clang::diff::SyntaxTree::getFilename | ( | ) | const |
Definition at line 977 of file ASTDiff.cpp.
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 1012 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 1008 of file ASTDiff.cpp.
Referenced by clang::diff::SyntaxTree::Impl::getNodeValue().
NodeId clang::diff::SyntaxTree::getRootId | ( | ) | const |
Definition at line 982 of file ASTDiff.cpp.
References TreeImpl.
int clang::diff::SyntaxTree::getSize | ( | ) | const |
Definition at line 981 of file ASTDiff.cpp.
References TreeImpl.
std::pair< unsigned, unsigned > clang::diff::SyntaxTree::getSourceRangeOffsets | ( | const Node & | N | ) | const |
Definition at line 993 of file ASTDiff.cpp.
References clang::diff::Node::ASTNode, Begin, clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getFileOffset(), clang::Lexer::getLocForEndOfToken(), Range, 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(), getRootId(), getSize(), and getSourceRangeOffsets().