class Tree

Declaration

class Tree : public Node { /* full declaration omitted */ };

Description

A node that has children and represents a syntactic language construct.

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:144

Inherits from: Node

Member Variables

private clang::syntax::Node* FirstChild = nullptr
private clang::syntax::Node* LastChild = nullptr

Method Overview

Inherited from Node:

Methods

void appendChildLowLevel(
    clang::syntax::Node* Child)

Description

Like the previous overloads, but does not set role for \p Child. EXPECTS: Child->Role != Detached

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:232

Parameters

clang::syntax::Node* Child

void appendChildLowLevel(
    clang::syntax::Node* Child,
    clang::syntax::NodeRole Role)

Description

Append \p Child to the list of children and sets the parent pointer. A very low-level operation that does not check any invariants, only used by TreeBuilder and FactoryImpl. EXPECTS: Role != Detached.

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:226

Parameters

clang::syntax::Node* Child
clang::syntax::NodeRole Role

static bool classof(const clang::syntax::Node* N)

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:177

Parameters

const clang::syntax::Node* N

clang::syntax::Node* findChild(
    clang::syntax::NodeRole R)

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:214

Parameters

clang::syntax::NodeRole R

const clang::syntax::Node* findChild(
    clang::syntax::NodeRole R) const

Description

Find the first node with a corresponding role.

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:213

Parameters

clang::syntax::NodeRole R

const clang::syntax::Leaf* findFirstLeaf() const

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:184

clang::syntax::Leaf* findFirstLeaf()

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:185

const clang::syntax::Leaf* findLastLeaf() const

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:189

clang::syntax::Leaf* findLastLeaf()

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:190

llvm::iterator_range<ChildIterator> getChildren()

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:205

llvm::iterator_range<ConstChildIterator>
getChildren() const

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:208

clang::syntax::Node* getFirstChild()

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:179

const clang::syntax::Node* getFirstChild() const

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:180

const clang::syntax::Node* getLastChild() const

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:182

clang::syntax::Node* getLastChild()

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:181

void prependChildLowLevel(
    clang::syntax::Node* Child,
    clang::syntax::NodeRole Role)

Description

Similar but prepends.

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:228

Parameters

clang::syntax::Node* Child
clang::syntax::NodeRole Role

void prependChildLowLevel(
    clang::syntax::Node* Child)

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:233

Parameters

clang::syntax::Node* Child

void replaceChildRangeLowLevel(
    clang::syntax::Node* Begin,
    clang::syntax::Node* End,
    clang::syntax::Node* New)

Description

Replace a range of children [Begin, End) with a list of new nodes starting at \p New. Only used by MutationsImpl to implement higher-level mutation operations. (!) \p New can be null to model removal of the child range. (!) \p End can be null to model one past the end. (!) \p Begin can be null to model an append.

Declared at: clang/include/clang/Tooling/Syntax/Tree.h:243

Parameters

clang::syntax::Node* Begin
clang::syntax::Node* End
clang::syntax::Node* New