summaryrefslogtreecommitdiff
path: root/runtime.h
diff options
context:
space:
mode:
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);