4 #include "constraint.h"
8 Element::Element(ASTNodeType _type) :
13 ElementSet::ElementSet(Set *s) :
18 ElementFunction::ElementFunction(Function *_function, Element **array, uint numArrays, Boolean *_overflowstatus) :
19 Element(ELEMFUNCRETURN),
21 inputs(array, numArrays),
22 overflowstatus(_overflowstatus),
23 functionencoding(this) {
24 for (uint i = 0; i < numArrays; i++)
25 GETELEMENTPARENTS(array[i])->push(this);
28 ElementConst::ElementConst(uint64_t _value, VarType _type) : Element(ELEMCONST), value(_value) {
29 uint64_t array[]={value};
30 set = new Set(_type, array, 1);
33 Set *getElementSet(Element *This) {
34 switch (GETELEMENTTYPE(This)) {
36 return ((ElementSet *)This)->set;
38 return ((ElementConst *)This)->set;
39 case ELEMFUNCRETURN: {
40 Function *func = ((ElementFunction *)This)->function;
41 switch (GETFUNCTIONTYPE(func)) {
43 return ((FunctionTable *)func)->table->range;
45 return ((FunctionOperator *)func)->range;
57 ElementFunction::~ElementFunction() {
60 ElementConst::~ElementConst() {