From 0711be4f145b3d74bc90658dd71d186716e6a72c Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 9 Sep 2015 22:06:32 +0200 Subject: Add arrays to Postrun --- runtime.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'runtime.h') diff --git a/runtime.h b/runtime.h index 1a49300..1b20329 100644 --- a/runtime.h +++ b/runtime.h @@ -6,21 +6,37 @@ using namespace std; +enum Stackitemtype{ + SIT_INT, + SIT_STR, + SIT_ARR +}; + struct Stackitem{ - bool isstr; + Stackitemtype type=SIT_INT; string strval; - int intval; + int intval=0; + vector arrval; Stackitem(void); - Stackitem(int _i); - Stackitem(const string &_s); + + Stackitem(int _i); //int init + Stackitem(const string&); //string init + Stackitem(const vector&); //array init + Stackitem(const Stackitem&); Stackitem(Stackitem &&other); + Stackitem& operator=(const Stackitem&); Stackitem& operator=(Stackitem &&other); + explicit operator bool(void) const; + bool operator==(const Stackitem &other) const; + bool operator!=(const Stackitem &other) const; }; +string to_string(const Stackitem&); + vector tokenise(istream &stream); void run(vector T); -- cgit v1.2.3-70-g09d2