clang  10.0.0svn
Public Member Functions | Friends | List of all members
clang::syntax::Node Class Reference

A node in a syntax tree. More...

#include "clang/Tooling/Syntax/Tree.h"

Inheritance diagram for clang::syntax::Node:
Inheritance graph
[legend]

Public Member Functions

 Node (NodeKind Kind)
 Newly created nodes are detached from a tree, parent and sibling links are set when the node is added as a child to another one. More...
 
NodeKind kind () const
 
NodeRole role () const
 
const Treeparent () const
 
Treeparent ()
 
const NodenextSibling () const
 
NodenextSibling ()
 
std::string dump (const Arena &A) const
 Dumps the structure of a subtree. For debugging and testing purposes. More...
 
std::string dumpTokens (const Arena &A) const
 Dumps the tokens forming this subtree. More...
 

Friends

class Tree
 

Detailed Description

A node in a syntax tree.

Each node is either a Leaf (representing tokens) or a Tree (representing language constructrs).

Definition at line 73 of file Tree.h.

Constructor & Destructor Documentation

◆ Node()

syntax::Node::Node ( NodeKind  Kind)

Newly created nodes are detached from a tree, parent and sibling links are set when the node is added as a child to another one.

Definition at line 41 of file Tree.cpp.

References Parent.

Member Function Documentation

◆ dump()

std::string syntax::Node::dump ( const Arena A) const

Dumps the structure of a subtree. For debugging and testing purposes.

Definition at line 124 of file Tree.cpp.

◆ dumpTokens()

std::string syntax::Node::dumpTokens ( const Arena A) const

Dumps the tokens forming this subtree.

Definition at line 131 of file Tree.cpp.

References clang::syntax::Arena::sourceManager().

Referenced by clang::syntax::Tree::classof().

◆ kind()

NodeKind clang::syntax::Node::kind ( ) const
inline

◆ nextSibling() [1/2]

const Node* clang::syntax::Node::nextSibling ( ) const
inline

Definition at line 85 of file Tree.h.

◆ nextSibling() [2/2]

Node* clang::syntax::Node::nextSibling ( )
inline

Definition at line 86 of file Tree.h.

References dump().

◆ parent() [1/2]

const Tree* clang::syntax::Node::parent ( ) const
inline

Definition at line 82 of file Tree.h.

References Parent.

◆ parent() [2/2]

Tree* clang::syntax::Node::parent ( )
inline

Definition at line 83 of file Tree.h.

References Parent.

◆ role()

NodeRole clang::syntax::Node::role ( ) const
inline

Definition at line 80 of file Tree.h.

Referenced by clang::syntax::Tree::classof().

Friends And Related Function Documentation

◆ Tree

friend class Tree
friend

Definition at line 95 of file Tree.h.


The documentation for this class was generated from the following files: