#include "element.h"
-
+#include "structs.h"
-
- Element *allocElementSet(Set * s) {
- ElementSet * tmp=(ElementSet *)ourmalloc(sizeof(ElementSet));
++//FIXME: ELEMENTSET?
+ Element *allocElement(Set * s) {
+ Element * tmp=(Element *)ourmalloc(sizeof(Element));
+ GETELEMENTTYPE(tmp)= ELEMSET;
tmp->set=s;
- return &tmp->base;
+ 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);
}
#define ELEMENT_H
#include "classlist.h"
#include "mymemory.h"
+#include "ops.h"
+#include "structs.h"
+#define GETELEMENTTYPE(o) (((Element*)o)->type)
+
++//FIXME:TALK ABOUT ELEMENT
struct Element {
- ElementType type;
++ ElementType type;
+ Set * set;
+ ElementEncoding * encoding;
};
- Element * allocElementSet(Set *s);
+struct ElementSet {
+ Element base;
+ Set * set;
+};
+
+struct ElementFunction{
+ Element base;
+ Function * function;
+ VectorElement* Elements;
+ Boolean * overflowstatus;
+};
+
+ Element * allocElement(Set *s);
+Element* allocElementFunction(Function * function, Element ** array, uint numArrays, Boolean * overflowstatus);
void deleteElement(Element *This);
#endif
struct Set;
typedef struct Set Set;
-
typedef struct Set MutableSet;
+typedef struct ElementFunction ElementFunction;
+typedef struct ElementSet ElementSet;
+
struct Element;
typedef struct Element Element;