#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();
+ virtual ~Element() {}
Vector<ASTNode *> parents;
ElementEncoding encoding;
- MEMALLOC;
+ virtual Element *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;};
+
+ CMEMALLOC;
};
class ElementConst : public Element {
public:
- ElementConst(uint64_t value, VarType type);
- ~ElementConst();
+ ElementConst(uint64_t value, VarType type, Set *_set);
Set *set;
uint64_t value;
- MEMALLOC;
+ Element *clone(CSolver *solver, CloneMap *map);
+ CMEMALLOC;
};
class ElementSet : public Element {
public:
ElementSet(Set *s);
Set *set;
- MEMALLOC;
+ Element *clone(CSolver *solver, CloneMap *map);
+ CMEMALLOC;
};
class ElementFunction : public Element {
public:
- ElementFunction(Function *function, Element **array, uint numArrays, Boolean *overflowstatus);
- ~ElementFunction();
+ ElementFunction(Function *function, Element **array, uint numArrays, BooleanEdge overflowstatus);
Function *function;
Array<Element *> inputs;
- Boolean *overflowstatus;
+ BooleanEdge overflowstatus;
FunctionEncoding functionencoding;
- MEMALLOC;
+ Element *clone(CSolver *solver, CloneMap *map);
+ CMEMALLOC;
};
Set *getElementSet(Element *This);