From 6c56e7209fc82888cb7a8c85c38ff5c3479cefbb Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 5 Feb 2017 22:10:09 +0100 Subject: Add refcounting code --- evaluate.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 evaluate.h (limited to 'evaluate.h') 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 +#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 + Value* ref_create(Args... args); + + Value* ref(Value *value); + void unref(Value *value); + +} + + +void evaluateSTL(const StatementList &stl); -- cgit v1.2.3-70-g09d2