Interpreter prototype alpha
c++ interpreter for make believe language
 
Loading...
Searching...
No Matches
NumberNode.h
Go to the documentation of this file.
1
8#ifndef NUMBERNODE_H
9#define NUMBERNODE_H
10#include "../tokenNode.h"
11
15class NumberNode : public tokenNode{
16public:
20 bool isUnaryOperator = false;
21
25 std::string unary_op_token = "";
26
30 std::shared_ptr<tokenNode> unaryopdata = nullptr;
31
35 double value = 0.0;
36
41 NumberNode();
42
48 std::string __represent__();
49};
50
51#endif
double value
holds the value(int or double) of this node
Definition NumberNode.h:35
std::string unary_op_token
symbol of the unary operator
Definition NumberNode.h:25
std::string __represent__()
(virtual) returns a string representing the current state of this NumberNode and it's syntax tree str...
Definition NumberNode.cpp:5
std::shared_ptr< tokenNode > unaryopdata
pointer to the unary operator data eg the 5 in -(5)
Definition NumberNode.h:30
NumberNode()
constructor
Definition NumberNode.cpp:3
bool isUnaryOperator
is used for testing if this node is a unary operator node eg: -5
Definition NumberNode.h:20
creates a node in the syntax tree of type NumberNode
Definition NumberNode.h:15
node used for creating abstract syntax tree
Definition tokenNode.h:15