Nearly CC
An educational compiler skeleton
Public Types | Public Member Functions | List of all members
Node Class Reference
Inheritance diagram for Node:
Inheritance graph
[legend]
Collaboration diagram for Node:
Collaboration graph
[legend]

Public Types

typedef std::vector< Node * >::const_iterator const_iterator
 

Public Member Functions

 Node (int tag)
 
 Node (int tag, std::initializer_list< Node * > kids)
 
 Node (int tag, const std::vector< Node * > &kids)
 
 Node (int tag, const std::string &str)
 
int get_tag () const
 
void set_tag (int tag)
 
std::string get_str () const
 
void set_str (const std::string &str)
 
void append_kid (Node *kid)
 
void prepend_kid (Node *kid)
 
unsigned get_num_kids () const
 
Nodeget_kid (unsigned index) const
 
Nodeget_last_kid () const
 
void shift_kid ()
 
void set_kid (unsigned index, Node *kid)
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void set_loc (const Location &loc)
 
const Locationget_loc () const
 
template<typename Fn >
void preorder (Fn fn)
 
template<typename Fn >
void each_child (Fn fn) const
 
void set_operand (const Operand &op)
 Set the Node's Operand. More...
 
bool has_operand () const
 Check whether this Node has a valid Operand. More...
 
const Operand get_operand () const
 Get this Node's Operand. More...
 

Member Function Documentation

◆ get_operand()

const Operand HasOperand::get_operand ( ) const
inlineinherited

Get this Node's Operand.

Returns
this Node's Operand

◆ has_operand()

bool HasOperand::has_operand ( ) const
inlineinherited

Check whether this Node has a valid Operand.

Returns
true if the Node has a valid Operand, false otherwise

◆ set_operand()

void HasOperand::set_operand ( const Operand op)
inlineinherited

Set the Node's Operand.

Parameters
opthe Operand to set

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