summaryrefslogtreecommitdiff
path: root/evaluate.h
blob: 09d0c81cde65f77f48e2b07352e185b6673ac60e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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);