aboutsummaryrefslogtreecommitdiff
path: root/src/nodes.h
diff options
context:
space:
mode:
authorAdrian Kummerländer2013-10-19 22:06:53 +0200
committerAdrian Kummerländer2013-10-19 22:06:53 +0200
commit0b3eebbf3b8644f06b2ae9d512135870938fb1c3 (patch)
treede0792d97b52328b3651acddd86293d32be54936 /src/nodes.h
parent69ce370c9ebf92caea64ef1ba28a502affdad3d5 (diff)
downloadSimpleParser-0b3eebbf3b8644f06b2ae9d512135870938fb1c3.tar
SimpleParser-0b3eebbf3b8644f06b2ae9d512135870938fb1c3.tar.gz
SimpleParser-0b3eebbf3b8644f06b2ae9d512135870938fb1c3.tar.bz2
SimpleParser-0b3eebbf3b8644f06b2ae9d512135870938fb1c3.tar.lz
SimpleParser-0b3eebbf3b8644f06b2ae9d512135870938fb1c3.tar.xz
SimpleParser-0b3eebbf3b8644f06b2ae9d512135870938fb1c3.tar.zst
SimpleParser-0b3eebbf3b8644f06b2ae9d512135870938fb1c3.zip
Merged Node factory-methods into template method
Added ConstantNode blueprint
Diffstat (limited to 'src/nodes.h')
-rw-r--r--src/nodes.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/nodes.h b/src/nodes.h
index e90669c..6783f3d 100644
--- a/src/nodes.h
+++ b/src/nodes.h
@@ -3,13 +3,14 @@
#include <string>
-#include "utils.h"
-
namespace SimpleParser {
+enum class TokenType : int8_t;
+
enum class NodeType {
OPERAND,
OPERATOR,
+ CONSTANT,
};
class Node {
@@ -50,6 +51,18 @@ class OperandNode: public Node {
double value_;
};
+class ConstantNode: public Node {
+ public:
+ explicit ConstantNode(std::string);
+
+ virtual double solve();
+ virtual NodeType getType();
+ virtual std::string print();
+
+ private:
+ std::string identifier_;
+};
+
}
#endif // PARSER_SRC_NODES_H_