teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Public Member Functions | Public Attributes | Friends | List of all members
teditor::parser::Node Struct Reference

#include <parse_tree.h>

Public Member Functions

 Node (const Token &t)
 
 Node (uint32_t type, const Point &start, const Point &end)
 
 ~Node ()
 
void add (Node *n)
 
void add (const Token &t)
 
void add (uint32_t type, const Point &start, const Point &end)
 
size_t size () const
 
bool isLeaf () const
 
Nodeoperator[] (size_t idx)
 
const Nodeoperator[] (size_t idx) const
 

Public Attributes

Token tok
 
std::vector< Node * > children
 

Friends

std::ostream & operator<< (std::ostream &os, const Node &n)
 

Detailed Description

A node in the parse tree

Constructor & Destructor Documentation

◆ Node() [1/2]

teditor::parser::Node::Node ( const Token t)
inline

◆ Node() [2/2]

teditor::parser::Node::Node ( uint32_t  type,
const Point start,
const Point end 
)

◆ ~Node()

teditor::parser::Node::~Node ( )
inline

Member Function Documentation

◆ add() [1/3]

void teditor::parser::Node::add ( const Token t)
inline

◆ add() [2/3]

void teditor::parser::Node::add ( Node n)
inline

◆ add() [3/3]

void teditor::parser::Node::add ( uint32_t  type,
const Point start,
const Point end 
)

◆ isLeaf()

bool teditor::parser::Node::isLeaf ( ) const
inline

◆ operator[]() [1/2]

Node& teditor::parser::Node::operator[] ( size_t  idx)
inline

◆ operator[]() [2/2]

const Node& teditor::parser::Node::operator[] ( size_t  idx) const
inline

◆ size()

size_t teditor::parser::Node::size ( ) const
inline

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Node n 
)
friend

Member Data Documentation

◆ children

std::vector<Node*> teditor::parser::Node::children

◆ tok

Token teditor::parser::Node::tok

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