Interpreter prototype alpha
c++ interpreter for make believe language
 
Loading...
Searching...
No Matches
forNode.h
Go to the documentation of this file.
1
8#ifndef FORNODE_H
9#define FORNODE_H
10#include "../tokenNode.h"
11
15class forNode : public tokenNode{
16public:
21 forNode();
22
28 std::string __represent__();
29
33 std::string conditionaltype = "";
34
38 std::string datatype = "";
39
43 std::shared_ptr<tokenNode> condition = nullptr;
44
48 std::shared_ptr<tokenNode> declaration = nullptr;
49
53 std::shared_ptr<tokenNode> init_declaration = nullptr;
54
58 bool decl_Var_Exists = false;
59
63 std::shared_ptr<tokenNode> iteration = nullptr;
64
68 std::vector<expressionData> statementsvect;
69};
70
71#endif
std::shared_ptr< tokenNode > init_declaration
preserves the state of initial declaration to reset for loop
Definition forNode.h:53
std::shared_ptr< tokenNode > condition
condition of this forNode
Definition forNode.h:43
std::shared_ptr< tokenNode > iteration
value to change the existing variable by
Definition forNode.h:63
std::shared_ptr< tokenNode > declaration
for creating or uses an existing variable as a start point
Definition forNode.h:48
std::string datatype
data type whether word or number types
Definition forNode.h:38
std::string __represent__()
(virtual) returns a string representing the current state of this forNode and it's syntax tree struct...
Definition forNode.cpp:5
bool decl_Var_Exists
used to keep track of whether or not an initial declaration variable already existed beforehand
Definition forNode.h:58
std::string conditionaltype
conditional type whether word or number types
Definition forNode.h:33
forNode()
constructor
Definition forNode.cpp:3
std::vector< expressionData > statementsvect
the statements vector this if node code block to execute if the condition is deemed true
Definition forNode.h:68
creates a node in the syntax tree of type forNode
Definition forNode.h:15
node used for creating abstract syntax tree
Definition tokenNode.h:15