diff options
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); |