diff options
author | tomsmeding <hallo@tomsmeding.nl> | 2015-09-10 15:51:19 +0200 |
---|---|---|
committer | tomsmeding <hallo@tomsmeding.nl> | 2015-09-10 15:51:19 +0200 |
commit | 38921ae6d41c8e50676aa8b01eaf701939d64573 (patch) | |
tree | 35367b78f9b3266caae57d50b92f5551e1040145 /runtime.h | |
parent | 22b84da031e21041a15584a8982c4c4c7b7f68ff (diff) | |
parent | 74151599d4107055c6d8ecef05ad9cbd6b2045bb (diff) |
Merge branch 'master' into tetris
merge array stuff into tetris
Diffstat (limited to 'runtime.h')
-rw-r--r-- | runtime.h | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -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<Stackitem> arrval; Stackitem(void); - Stackitem(int _i); - Stackitem(const string &_s); + + Stackitem(int _i); //int init + Stackitem(const string&); //string init + Stackitem(const vector<Stackitem>&); //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<string> tokenise(istream &stream); void run(vector<string> T); |