#include "elementencoding.h"
#include "boolean.h"
-#define GETELEMENTTYPE(o) (o->type)
-#define GETELEMENTPARENTS(o) (&((Element *)o)->parents)
class Element : public ASTNode {
- public:
+public:
Element(ASTNodeType type);
- ~Element();
- VectorASTNode parents;
+ 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();
+public:
+ 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:
+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();
+public:
+ ElementFunction(Function *function, Element **array, uint numArrays, BooleanEdge overflowstatus);
Function *function;
- ArrayElement inputs;
- Boolean *overflowstatus;
+ Array<Element *> inputs;
+ BooleanEdge overflowstatus;
FunctionEncoding functionencoding;
- MEMALLOC;
+ Element *clone(CSolver *solver, CloneMap *map);
+ CMEMALLOC;
};
Set *getElementSet(Element *This);