diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-02-05 22:10:09 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-02-05 22:10:09 +0100 |
commit | 6c56e7209fc82888cb7a8c85c38ff5c3479cefbb (patch) | |
tree | f7876b3d008e4740e80a52efc7d911a5c0a7861d /evaluate.h | |
parent | c1168a00ff143f752f386550e6acd42b0599c341 (diff) |
Add refcounting code
Diffstat (limited to 'evaluate.h')
-rw-r--r-- | evaluate.h | 39 |
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); |