7 #include "functionencoding.h"
8 #include "elementencoding.h"
11 #define GETELEMENTTYPE(o) GETASTNODETYPE(o)
12 #define GETELEMENTPARENTS(o) (&((Element*)o)->parents)
15 VectorASTNode parents;
22 ElementEncoding encoding;
28 ElementEncoding encoding;
31 struct ElementFunction {
35 Boolean * overflowstatus;
36 FunctionEncoding functionencoding;
37 ElementEncoding rangeencoding;
40 Element * allocElementConst(uint64_t value, VarType type);
41 Element * allocElementSet(Set *s);
42 Element* allocElementFunction(Function * function, Element ** array, uint numArrays, Boolean * overflowstatus);
43 void deleteElement(Element *This);
44 Set* getElementSet(Element* This);
46 static inline ElementEncoding* getElementEncoding(Element* This){
47 switch(GETELEMENTTYPE(This)){
49 return &((ElementSet*)This)->encoding;
51 return &((ElementFunction*)This)->rangeencoding;
53 return &((ElementConst*)This)->encoding;
60 static inline FunctionEncoding* getElementFunctionEncoding(ElementFunction* func){
61 return &func->functionencoding;