summaryrefslogtreecommitdiff
path: root/evaluate.h
diff options
context:
space:
mode:
Diffstat (limited to 'evaluate.h')
-rw-r--r--evaluate.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/evaluate.h b/evaluate.h
index 09d0c81..9c50b24 100644
--- a/evaluate.h
+++ b/evaluate.h
@@ -1,11 +1,14 @@
#pragma once
#include <string>
+#include <unordered_map>
#include "ast.h"
using namespace std;
+class ScopeVal;
+
class Value{
public:
enum class Type{
@@ -17,21 +20,26 @@ public:
Type type;
double numval;
string strval;
- Scope scope;
+ ScopeVal *scope;
Value(double numval);
Value(const string &strval);
- Value(const Scope &scope);
+ Value(ScopeVal *scope);
+};
+
+class ScopeVal{
+public:
+ unordered_map<string,Value> values;
};
namespace A {
- template <typename ...Args>
- Value* ref_create(Args... args);
+ template <typename T>
+ T* ref(T *value);
- Value* ref(Value *value);
- void unref(Value *value);
+ template <typename T>
+ void unref(T *value);
}