summaryrefslogtreecommitdiff
path: root/runtime.h
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-09-10 15:51:19 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-09-10 15:51:19 +0200
commit38921ae6d41c8e50676aa8b01eaf701939d64573 (patch)
tree35367b78f9b3266caae57d50b92f5551e1040145 /runtime.h
parent22b84da031e21041a15584a8982c4c4c7b7f68ff (diff)
parent74151599d4107055c6d8ecef05ad9cbd6b2045bb (diff)
Merge branch 'master' into tetris
merge array stuff into tetris
Diffstat (limited to 'runtime.h')
-rw-r--r--runtime.h24
1 files changed, 20 insertions, 4 deletions
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<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);