Commit after resolving conflicts
[satune.git] / src / AST / element.c
1 #include "element.h"
2 #include "structs.h"
3 //FIXME: ELEMENTSET?
4 Element *allocElement(Set * s) {
5         Element * tmp=(Element *)ourmalloc(sizeof(Element));
6         GETELEMENTTYPE(tmp)= ELEMSET;
7         tmp->set=s;
8         tmp->encoding=NULL;
9         return tmp;
10 }
11
12 Element* allocElementFunction(Function * function, Element ** array, uint numArrays, Boolean * overflowstatus){
13     ElementFunction* ef = (ElementFunction*) ourmalloc(sizeof(ElementFunction));
14     GETELEMENTTYPE(ef)= ELEMFUNCRETURN;
15     ef->function=function;
16     ef->overflowstatus = overflowstatus;
17     ef->Elements = allocVectorArrayElement(numArrays, array);
18     return &ef->base;
19 }
20
21 void deleteElement(Element *This) {
22         ourfree(This);
23 }