clang: clang::diff::SyntaxTree Class Reference (original) (raw)
SyntaxTree objects represent subtrees of the AST. More...
#include "[clang/Tooling/ASTDiff/ASTDiff.h](ASTDiff%5F8h%5Fsource.html)"
Classes | |
---|---|
class | Impl |
Represents the AST of a TranslationUnit. More... | |
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 |
SyntaxTree objects represent subtrees of the AST.
They can be constructed from any Decl or Stmt.
Definition at line 54 of file ASTDiff.h.
◆ PreorderIterator
clang::diff::SyntaxTree::SyntaxTree | ( | ASTContext & | AST | ) |
---|
Constructs a tree from a translation unit.
Definition at line 969 of file ASTDiff.cpp.
◆ SyntaxTree() [2/3]
template<class T >
clang::diff::SyntaxTree::SyntaxTree ( T * Node, ASTContext & AST ) | inline |
---|
Constructs a tree from any AST node.
Definition at line 60 of file ASTDiff.h.
◆ SyntaxTree() [3/3]
clang::diff::SyntaxTree::SyntaxTree ( SyntaxTree && Other) | default |
---|
◆ ~SyntaxTree()
clang::diff::SyntaxTree::~SyntaxTree ( ) | default |
---|
◆ begin()
◆ end()
◆ findPositionInParent()
int clang::diff::SyntaxTree::findPositionInParent | ( | NodeId | Id | ) | const |
---|
◆ getASTContext()
const ASTContext & clang::diff::SyntaxTree::getASTContext | ( | ) | const |
---|
◆ getFilename()
StringRef clang::diff::SyntaxTree::getFilename | ( | ) | const |
---|
◆ getNode()
const Node & clang::diff::SyntaxTree::getNode | ( | NodeId | Id | ) | const |
---|
◆ getNodeValue() [1/2]
std::string clang::diff::SyntaxTree::getNodeValue | ( | const Node & | Node | ) | const |
---|
◆ getNodeValue() [2/2]
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().
◆ getRootId()
NodeId clang::diff::SyntaxTree::getRootId | ( | ) | const |
---|
◆ getSize()
int clang::diff::SyntaxTree::getSize | ( | ) | const |
---|
◆ getSourceRangeOffsets()
std::pair< unsigned, unsigned > clang::diff::SyntaxTree::getSourceRangeOffsets | ( | const Node & | N | ) | const |
---|
◆ TreeImpl
std::unique_ptr<Impl> clang::diff::SyntaxTree::TreeImpl
The documentation for this class was generated from the following files:
- include/clang/Tooling/ASTDiff/ASTDiff.h
- lib/Tooling/ASTDiff/ASTDiff.cpp