summaryrefslogtreecommitdiff
path: root/evaluate.h
diff options
context:
space:
mode:
Diffstat (limited to 'evaluate.h')
-rw-r--r--evaluate.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/evaluate.h b/evaluate.h
new file mode 100644
index 0000000..09d0c81
--- /dev/null
+++ b/evaluate.h
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <string>
+#include "ast.h"
+
+using namespace std;
+
+
+class Value{
+public:
+ enum class Type{
+ number,
+ string,
+ scope,
+ };
+
+ Type type;
+ double numval;
+ string strval;
+ Scope scope;
+
+ Value(double numval);
+ Value(const string &strval);
+ Value(const Scope &scope);
+};
+
+
+namespace A {
+
+ template <typename ...Args>
+ Value* ref_create(Args... args);
+
+ Value* ref(Value *value);
+ void unref(Value *value);
+
+}
+
+
+void evaluateSTL(const StatementList &stl);