Implement CPython strategy
[satune.git] / src / AST / boolean.h
index f1d2127498d65fef3117f2c7d5e7a215c74e5b1e..065ba4ac2590696b7a107e1214019aff795c5c91 100644 (file)
@@ -3,16 +3,45 @@
 #include "classlist.h"
 #include "mymemory.h"
 #include "ops.h"
-struct  Boolean {
-    VarType vtype;
-    enum BooleanType btype;
-    Order* order;
-    uint64_t first;
-    uint64_t second;
+
+/** 
+               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;
 };
 
-Boolean* allocBoolean(VarType t);
-Boolean* allocBooleanOrder(Order* order,uint64_t first, uint64_t second);
+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