4 Element *allocElementSet(Set * s) {
5 ElementSet * tmp=(ElementSet *)ourmalloc(sizeof(ElementSet));
6 GETELEMENTTYPE(tmp)= ELEMSET;
8 allocInlineDefVectorASTNode(GETELEMENTPARENTS(tmp));
9 initElementEncoding(&tmp->encoding, (Element *) tmp);
13 Element* allocElementFunction(Function * function, Element ** array, uint numArrays, Boolean * overflowstatus){
14 ElementFunction* tmp = (ElementFunction*) ourmalloc(sizeof(ElementFunction));
15 GETELEMENTTYPE(tmp)= ELEMFUNCRETURN;
16 tmp->function=function;
17 tmp->overflowstatus = overflowstatus;
18 allocInlineArrayInitElement(&tmp->inputs, array, numArrays);
19 allocInlineDefVectorASTNode(GETELEMENTPARENTS(tmp));
20 for(uint i=0;i<numArrays;i++)
21 pushVectorASTNode(GETELEMENTPARENTS(array[i]), (ASTNode *) tmp);
22 initElementEncoding(&tmp->domainencoding, (Element *) tmp);
23 initFunctionEncoding(&tmp->functionencoding, (Element *) tmp);
27 void deleteElement(Element *This) {
28 switch(GETELEMENTTYPE(This)) {
29 case ELEMFUNCRETURN: {
30 ElementFunction *ef = (ElementFunction *) This;
31 deleteInlineArrayElement(&ef->inputs);
32 deleteElementEncoding(&ef->domainencoding);
33 deleteFunctionEncoding(&ef->functionencoding);
37 ElementSet *es = (ElementSet *) This;
38 deleteElementEncoding(&es->encoding);
44 deleteVectorArrayASTNode(GETELEMENTPARENTS(This));