Interpreter prototype alpha
c++ interpreter for make believe language
 
Loading...
Searching...
No Matches
OperatorNode.h
Go to the documentation of this file.
1
8#ifndef OPERATORNODE_H
9#define OPERATORNODE_H
10#include "../tokenNode.h"
11
15class OperatorNode : public tokenNode{
16public:
20 std::shared_ptr<tokenNode> left = nullptr;
21
25 std::shared_ptr<tokenNode> right = nullptr;
26
30 std::shared_ptr<tokenNode> unaryopdata = nullptr;
31
35 std::string op_token = "";
36
40 bool isUnaryOperator = false;
41
45 std::string unary_op_token = "";
46
52
58 std::string __represent__();
59};
60
61#endif
std::shared_ptr< tokenNode > left
left node in syntax tree
Definition OperatorNode.h:20
std::shared_ptr< tokenNode > unaryopdata
pointer to unary operator eg: -5
Definition OperatorNode.h:30
std::string op_token
operator symbol/token
Definition OperatorNode.h:35
OperatorNode()
constructor
Definition OperatorNode.cpp:3
std::string __represent__()
(virtual) returns a string representing the current state of this whilenode and it's syntax tree stru...
Definition OperatorNode.cpp:5
std::string unary_op_token
unary operator symbol/token
Definition OperatorNode.h:45
std::shared_ptr< tokenNode > right
right node in syntax tree
Definition OperatorNode.h:25
bool isUnaryOperator
use to verify if this node has a unary operator eg -5 or not like 5
Definition OperatorNode.h:40
creates a node in the syntax tree of type operator
Definition OperatorNode.h:15
node used for creating abstract syntax tree
Definition tokenNode.h:15