Interpreter prototype alpha
c++ interpreter for make believe language
 
Loading...
Searching...
No Matches
VariableNode Class Reference

creates a node in the syntax tree of type variable More...

#include <VariableNode.h>

Inheritance diagram for VariableNode:
tokenNode

Public Member Functions

 VariableNode ()
 constructor
 
std::string __represent__ ()
 (virtual) returns a string representing the current state of this whilenode and it's syntax tree structure
 
- Public Member Functions inherited from tokenNode
 tokenNode ()
 constructor
 
virtual std::string __represent__ ()=0
 (virtual) returns a string representing the current state of the syntax tree
 

Static Public Member Functions

static void pushIntoVector (std::shared_ptr< VariableNode > token, const std::string &stacktype)
 pushes a new variable onto the stack depending on the stack to put it in
 
static bool alreadyExistingVariable (const std::string &toCheck, const std::string &stacktype)
 checks if the variable name in toCheck is an exisitng variable
 
static std::shared_ptr< VariableNodegetThisVariableobject (const std::string &variablename, const std::string &stacktype)
 returns a pointer to the variable with the name of the variablename in the correct stacktype whether it be the 'number' or 'word' stack
 
static bool reassignExistingVariable (std::shared_ptr< tokenNode > token, const std::string &variablename, const std::string &stacktype, const std::string &appendtype)
 reassigns new data to a variable in the stack
 

Public Attributes

std::shared_ptr< tokenNodeassignedData = nullptr
 pointer to this variables assigned data
 
std::shared_ptr< tokenNodeappendData = nullptr
 the value to add to this variable's assigned data
 
std::string appendType = "null"
 append type of append data eg, '+=', '-=', '*=' etc
 
std::string varName = ""
 the name of the variable
 
- Public Attributes inherited from tokenNode
std::string nodeType = "None"
 used for directing execution in the syntax tree
 

Static Public Attributes

static std::vector< std::shared_ptr< VariableNode > > stackNUMBERvector
 stack vector of all number variables
 
static std::vector< std::shared_ptr< VariableNode > > stackWORDvector
 stack vector of all word variables
 

Detailed Description

creates a node in the syntax tree of type variable

Author
Michael

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