7 #include "functionencoding.h"
8 #include "elementencoding.h"
11 #define GETELEMENTTYPE(o) (o->type)
12 #define GETELEMENTPARENTS(o) (&((Element *)o)->parents)
13 class Element : public ASTNode {
15 Element(ASTNodeType type);
17 Vector<ASTNode *> parents;
18 ElementEncoding encoding;
19 virtual Element *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;};
23 class ElementConst : public Element {
25 ElementConst(uint64_t value, VarType type, Set *_set);
28 Element *clone(CSolver *solver, CloneMap *map);
32 class ElementSet : public Element {
36 Element *clone(CSolver *solver, CloneMap *map);
40 class ElementFunction : public Element {
42 ElementFunction(Function *function, Element **array, uint numArrays, Boolean *overflowstatus);
44 Array<Element *> inputs;
45 Boolean *overflowstatus;
46 FunctionEncoding functionencoding;
47 Element *clone(CSolver *solver, CloneMap *map);
51 Set *getElementSet(Element *This);
53 static inline ElementEncoding *getElementEncoding(Element *e) {
57 static inline FunctionEncoding *getElementFunctionEncoding(ElementFunction *func) {
58 return &func->functionencoding;