diff options
Diffstat (limited to 'evaluate.h')
-rw-r--r-- | evaluate.h | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -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); } |