creates a node in the syntax tree of type variable More...
#include <VariableNode.h>
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 | |
![]() | |
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< VariableNode > | getThisVariableobject (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< tokenNode > | assignedData = nullptr |
pointer to this variables assigned data | |
std::shared_ptr< tokenNode > | appendData = 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 | |
![]() | |
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 | |
creates a node in the syntax tree of type variable