Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/constraint_compiler into...
[satune.git] / src / AST / element.h
index 267f133f1beff89633bf4fffa540b2eb7ead6acf..544725624c4d4ab3ef6426fd4cc8fba070a756d0 100644 (file)
@@ -8,16 +8,16 @@
 #include "elementencoding.h"
 #include "boolean.h"
 
-#define GETELEMENTTYPE(o) (o->type)
-#define GETELEMENTPARENTS(o) (&((Element *)o)->parents)
 class Element : public ASTNode {
 public:
        Element(ASTNodeType type);
        virtual ~Element() {}
        Vector<ASTNode *> parents;
        ElementEncoding encoding;
-       virtual Element *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       virtual Element *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;};
+       virtual void updateParents() {}
+       
+       CMEMALLOC;
 };
 
 class ElementConst : public Element {
@@ -26,7 +26,7 @@ public:
        Set *set;
        uint64_t value;
        Element *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class ElementSet : public Element {
@@ -34,18 +34,19 @@ public:
        ElementSet(Set *s);
        Set *set;
        Element *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       CMEMALLOC;
 };
 
 class ElementFunction : public Element {
 public:
-       ElementFunction(Function *function, Element **array, uint numArrays, Boolean *overflowstatus);
+       ElementFunction(Function *function, Element **array, uint numArrays, BooleanEdge overflowstatus);
        Function *function;
        Array<Element *> inputs;
-       Boolean *overflowstatus;
+       BooleanEdge overflowstatus;
        FunctionEncoding functionencoding;
        Element *clone(CSolver *solver, CloneMap *map);
-       MEMALLOC;
+       void updateParents();
+       CMEMALLOC;
 };
 
 Set *getElementSet(Element *This);