X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satune.git;a=blobdiff_plain;f=src%2FAST%2Felement.c;h=3746d250f10e748119f485fd14ecc082de9940d2;hp=df29cfecc00e69d3a22ba7a4038e2b478a5e14f3;hb=fa74d0b740b20fa40af55404c5bb99570a8b40ca;hpb=928b67a7a6598f2d57fb5391b50399e079bb9619 diff --git a/src/AST/element.c b/src/AST/element.c index df29cfe..3746d25 100644 --- a/src/AST/element.c +++ b/src/AST/element.c @@ -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); }