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