summaryrefslogtreecommitdiff
path: root/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'value.h')
-rw-r--r--value.h46
1 files changed, 41 insertions, 5 deletions
diff --git a/value.h b/value.h
index 34484a8..ba1eae1 100644
--- a/value.h
+++ b/value.h
@@ -2,20 +2,56 @@
#ifndef VALUE_H_
#define VALUE_H_
+#include <string>
+
+#include "register_address.h"
+
class evaluator;
-class reg;
class value {
+public:
+ virtual value * simplify() = 0;
+ virtual value * clone() = 0;
+ virtual std::string to_string() = 0;
-protected:
+};
+
+class tree_value : public value {
+public:
+ tree_value(evaluator *, value * lchild, value * rchild);
+ value * simplify();
+ value * clone();
+ std::string to_string();
+private:
evaluator * m_evaluator;
- value & m_lchild;
- value & m_rchild;
+ value * m_lchild;
+ value * m_rchild;
+};
+
+class float_value : public value {
+public:
+ float_value();
+ value * simplify();
+ value * clone();
+ std::string to_string();
+
+ void set_value(float value);
+
+ bool m_has_value;
+ float m_value;
};
class const_value : public value {
+public:
+ const_value(
+ register_address reg,
+ float_value * value);
+ value * simplify();
+ value * clone();
+ std::string to_string();
private:
- reg * const_reg;
+ register_address m_reg_address;
+ float_value * m_value;
};
#endif //VALUE_H_