Implement CPython strategy
[satune.git] / src / AST / boolean.h
index 5e8c5a5e6f9a225af80543f9d1fc4b2f1411cd14..065ba4ac2590696b7a107e1214019aff795c5c91 100644 (file)
@@ -2,7 +2,46 @@
 #define BOOLEAN_H
 #include "classlist.h"
 #include "mymemory.h"
+#include "ops.h"
 
-struct  Boolean {
+/** 
+               This is a little sketchy, but apparently legit.
+               https://www.python.org/dev/peps/pep-3123/ */
+
+struct Boolean {
+       BooleanType btype;
+};
+
+struct BooleanOrder {
+       Boolean base;
+       Order* order;
+       uint64_t first;
+       uint64_t second;
+};
+
+struct BooleanVar {
+       Boolean base;
+       VarType vtype;
+};
+
+struct BooleanLogic {
+       Boolean base;
+       LogicOp op;
+       Boolean * left;
+       Boolean * right;
 };
+
+struct BooleanComp {
+       Boolean base;
+       CompOp op;
+       Boolean * left;
+       Boolean * right;
+};
+
+
+
+Boolean * allocBoolean(VarType t);
+Boolean * allocBooleanOrder(Order * order, uint64_t first, uint64_t second);
+void deleteBoolean(Boolean * this);
+
 #endif