class SyntaxTree::Impl

Declaration

class SyntaxTree::Impl { /* full declaration omitted */ };

Description

Represents the AST of a TranslationUnit.

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:112

Member Variables

public clang::diff::SyntaxTree* Parent
public clang::ASTContext& AST
public clang::PrintingPolicy TypePP
public std::vector<Node> Nodes
Nodes in preorder.
public std::vector<NodeId> Leaves
public std::vector<int> PostorderIds
public std::vector<NodeId> NodesBfs

Method Overview

  • public Impl(clang::diff::SyntaxTree * Parent, clang::Decl * N, clang::ASTContext & AST)
  • public template <class T> Impl(clang::diff::SyntaxTree * Parent, std::enable_if_t<std::is_base_of<Decl, T>::value, T> * Node, clang::ASTContext & AST)
  • public template <class T> Impl(clang::diff::SyntaxTree * Parent, std::enable_if_t<std::is_base_of<Stmt, T>::value, T> * Node, clang::ASTContext & AST)
  • public Impl(clang::diff::SyntaxTree * Parent, clang::ASTContext & AST)
  • public Impl(clang::diff::SyntaxTree * Parent, clang::Stmt * N, clang::ASTContext & AST)
  • public void addNode(clang::diff::Node & N)
  • public clang::diff::SyntaxTree::PreorderIterator begin() const
  • public clang::diff::SyntaxTree::PreorderIterator end() const
  • public int findPositionInParent(clang::diff::NodeId Id, bool Shifted = false) const
  • public std::string getDeclValue(const clang::Decl * D) const
  • public clang::diff::Node & getMutableNode(clang::diff::NodeId Id)
  • public const clang::diff::Node & getNode(clang::diff::NodeId Id) const
  • public std::string getNodeValue(clang::diff::NodeId Id) const
  • public std::string getNodeValue(const clang::diff::Node & Node) const
  • public int getNumberOfDescendants(clang::diff::NodeId Id) const
  • public std::string getRelativeName(const clang::NamedDecl * ND, const clang::DeclContext * Context) const
  • public std::string getRelativeName(const clang::NamedDecl * ND) const
  • public clang::diff::NodeId getRootId() const
  • public int getSize() const
  • public std::string getStmtValue(const clang::Stmt * S) const
  • private void initTree()
  • public bool isInSubtree(clang::diff::NodeId Id, clang::diff::NodeId SubtreeRoot) const
  • public bool isValidNodeId(clang::diff::NodeId Id) const
  • private void setLeftMostDescendants()

Methods

Impl(clang::diff::SyntaxTree* Parent,
     clang::Decl* N,
     clang::ASTContext& AST)

Description

Constructs a tree from an AST node.

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:116

Parameters

clang::diff::SyntaxTree* Parent
clang::Decl* N
clang::ASTContext& AST

template <class T>
Impl(clang::diff::SyntaxTree* Parent,
     std::enable_if_t<
         std::is_base_of<Decl, T>::value,
         T>* Node,
     clang::ASTContext& AST)

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:124

Templates

T

Parameters

clang::diff::SyntaxTree* Parent
std::enable_if_t<std::is_base_of<Decl, T>::value, T>* Node
clang::ASTContext& AST

template <class T>
Impl(clang::diff::SyntaxTree* Parent,
     std::enable_if_t<
         std::is_base_of<Stmt, T>::value,
         T>* Node,
     clang::ASTContext& AST)

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:119

Templates

T

Parameters

clang::diff::SyntaxTree* Parent
std::enable_if_t<std::is_base_of<Stmt, T>::value, T>* Node
clang::ASTContext& AST

Impl(clang::diff::SyntaxTree* Parent,
     clang::ASTContext& AST)

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:114

Parameters

clang::diff::SyntaxTree* Parent
clang::ASTContext& AST

Impl(clang::diff::SyntaxTree* Parent,
     clang::Stmt* N,
     clang::ASTContext& AST)

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:117

Parameters

clang::diff::SyntaxTree* Parent
clang::Stmt* N
clang::ASTContext& AST

void addNode(clang::diff::Node& N)

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:147

Parameters

clang::diff::Node& N

clang::diff::SyntaxTree::PreorderIterator begin()
    const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:141

clang::diff::SyntaxTree::PreorderIterator end()
    const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:142

int findPositionInParent(
    clang::diff::NodeId Id,
    bool Shifted = false) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:150

Parameters

clang::diff::NodeId Id
bool Shifted = false

std::string getDeclValue(
    const clang::Decl* D) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:158

Parameters

const clang::Decl* D

clang::diff::Node& getMutableNode(
    clang::diff::NodeId Id)

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:145

Parameters

clang::diff::NodeId Id

const clang::diff::Node& getNode(
    clang::diff::NodeId Id) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:144

Parameters

clang::diff::NodeId Id

std::string getNodeValue(
    clang::diff::NodeId Id) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:156

Parameters

clang::diff::NodeId Id

std::string getNodeValue(
    const clang::diff::Node& Node) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:157

Parameters

const clang::diff::Node& Node

int getNumberOfDescendants(
    clang::diff::NodeId Id) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:148

Parameters

clang::diff::NodeId Id

std::string getRelativeName(
    const clang::NamedDecl* ND,
    const clang::DeclContext* Context) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:152

Parameters

const clang::NamedDecl* ND
const clang::DeclContext* Context

std::string getRelativeName(
    const clang::NamedDecl* ND) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:154

Parameters

const clang::NamedDecl* ND

clang::diff::NodeId getRootId() const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:140

int getSize() const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:139

std::string getStmtValue(
    const clang::Stmt* S) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:159

Parameters

const clang::Stmt* S

void initTree()

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:162

bool isInSubtree(
    clang::diff::NodeId Id,
    clang::diff::NodeId SubtreeRoot) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:149

Parameters

clang::diff::NodeId Id
clang::diff::NodeId SubtreeRoot

bool isValidNodeId(clang::diff::NodeId Id) const

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:146

Parameters

clang::diff::NodeId Id

void setLeftMostDescendants()

Declared at: clang/lib/Tooling/ASTDiff/ASTDiff.cpp:163