Interpreter prototype alpha
c++ interpreter for make believe language
 
Loading...
Searching...
No Matches
ifNode.h
Go to the documentation of this file.
1
8#ifndef IFNODE_H
9#define IFNODE_H
10#include "../tokenNode.h"
11
15class ifNode : public tokenNode{
16public:
21 ifNode();
22
28 std::string __represent__();
29
35 void appendNew__If__ElseIf__Else__statement(const std::shared_ptr<ifNode>& token);
36
40 std::string conditionaltype = "";
41
45 std::string datatype;
46
50 std::shared_ptr<tokenNode> condition = nullptr;
51
55 std::shared_ptr<tokenNode> next__If__ElseIf__Else = nullptr;
56
60 std::vector<expressionData> statementsvect;
61};
62
63#endif
std::string datatype
data type whether word or number types
Definition ifNode.h:45
std::shared_ptr< tokenNode > condition
condition of this ifNode (only for if and elseif, excluding else)
Definition ifNode.h:50
std::vector< expressionData > statementsvect
the statements vector this if node code block to execute if the condition is deemed true
Definition ifNode.h:60
std::shared_ptr< tokenNode > next__If__ElseIf__Else
pointer to next elseif or else statement (doesn't apply to else statemments)
Definition ifNode.h:55
std::string conditionaltype
conditional type whether word or number types
Definition ifNode.h:40
void appendNew__If__ElseIf__Else__statement(const std::shared_ptr< ifNode > &token)
appends an ifnode to the end of this ifnodes linked list of ifnodes
Definition ifNode.cpp:5
ifNode()
constructor
Definition ifNode.cpp:3
std::string __represent__()
(virtual) returns a string representing the current state of this ifNode and it's syntax tree structu...
Definition ifNode.cpp:17
creates a node in the syntax tree of type ifNode
Definition ifNode.h:15
node used for creating abstract syntax tree
Definition tokenNode.h:15
creates an object with the mapping of a token that was assigned to it from the 'tokens' class
Definition tokens.h:200