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
- private void appendChildLowLevel(clang::syntax::Node * Child)
- private void appendChildLowLevel(clang::syntax::Node * Child, clang::syntax::NodeRole Role)
- public static bool classof(const clang::syntax::Node * N)
- public clang::syntax::Node * findChild(clang::syntax::NodeRole R)
- public const clang::syntax::Node * findChild(clang::syntax::NodeRole R) const
- public const clang::syntax::Leaf * findFirstLeaf() const
- public clang::syntax::Leaf * findFirstLeaf()
- public const clang::syntax::Leaf * findLastLeaf() const
- public clang::syntax::Leaf * findLastLeaf()
- public llvm::iterator_range<ChildIterator> getChildren()
- public llvm::iterator_range<ConstChildIterator> getChildren() const
- public clang::syntax::Node * getFirstChild()
- public const clang::syntax::Node * getFirstChild() const
- public const clang::syntax::Node * getLastChild() const
- public clang::syntax::Node * getLastChild()
- private void prependChildLowLevel(clang::syntax::Node * Child, clang::syntax::NodeRole Role)
- private void prependChildLowLevel(clang::syntax::Node * Child)
- private void replaceChildRangeLowLevel(clang::syntax::Node * Begin, clang::syntax::Node * End, clang::syntax::Node * New)
Inherited from Node:
- public assertInvariants
- public assertInvariantsRecursive
- public canModify
- public dump
- public dumpTokens
- public getKind
- public getNextSibling
- public getNextSibling
- public getParent
- public getParent
- public getPreviousSibling
- public getPreviousSibling
- public getRole
- public isDetached
- public isOriginal
Methods
¶void appendChildLowLevel(
clang::syntax::Node* Child)
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)
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)
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)
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
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
const clang::syntax::Leaf* findFirstLeaf() const
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:184
¶clang::syntax::Leaf* findFirstLeaf()
clang::syntax::Leaf* findFirstLeaf()
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:185
¶const clang::syntax::Leaf* findLastLeaf() const
const clang::syntax::Leaf* findLastLeaf() const
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:189
¶clang::syntax::Leaf* findLastLeaf()
clang::syntax::Leaf* findLastLeaf()
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:190
¶llvm::iterator_range<ChildIterator> getChildren()
llvm::iterator_range<ChildIterator> getChildren()
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:205
¶llvm::iterator_range<ConstChildIterator>
getChildren() const
llvm::iterator_range<ConstChildIterator>
getChildren() const
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:208
¶clang::syntax::Node* getFirstChild()
clang::syntax::Node* getFirstChild()
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:179
¶const clang::syntax::Node* getFirstChild() const
const clang::syntax::Node* getFirstChild() const
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:180
¶const clang::syntax::Node* getLastChild() const
const clang::syntax::Node* getLastChild() const
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:182
¶clang::syntax::Node* getLastChild()
clang::syntax::Node* getLastChild()
Declared at: clang/include/clang/Tooling/Syntax/Tree.h:181
¶void prependChildLowLevel(
clang::syntax::Node* Child,
clang::syntax::NodeRole Role)
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)
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)
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