Commit after resolving conflicts
[satune.git] / src / AST / element.c
index df29cfecc00e69d3a22ba7a4038e2b478a5e14f3..3746d250f10e748119f485fd14ecc082de9940d2 100644 (file)
@@ -1,12 +1,23 @@
 #include "element.h"
-
+#include "structs.h"
+//FIXME: ELEMENTSET?
 Element *allocElement(Set * s) {
        Element * tmp=(Element *)ourmalloc(sizeof(Element));
+       GETELEMENTTYPE(tmp)= ELEMSET;
        tmp->set=s;
        tmp->encoding=NULL;
        return tmp;
 }
 
+Element* allocElementFunction(Function * function, Element ** array, uint numArrays, Boolean * overflowstatus){
+    ElementFunction* ef = (ElementFunction*) ourmalloc(sizeof(ElementFunction));
+    GETELEMENTTYPE(ef)= ELEMFUNCRETURN;
+    ef->function=function;
+    ef->overflowstatus = overflowstatus;
+    ef->Elements = allocVectorArrayElement(numArrays, array);
+    return &ef->base;
+}
+
 void deleteElement(Element *This) {
        ourfree(This);
 }