Fix warnings, merge, and check my code in
[satune.git] / src / AST / function.h
index 459f0b55d3b3c8ee1c2195b7ef173f048d27cac0..3f2a1a9310f2dd077cce62762535455e25c09edb 100644 (file)
@@ -4,11 +4,28 @@
 #include "mymemory.h"
 #include "ops.h"
 #include "structs.h"
-struct Function {
-       ArithOp op;
-       VectorSet* domains;
-       Set * range;
-       OverFlowBehavior overflowbehavior;
-       Table* table;
+
+#define GETFUNCTIONTYPE(o) (((Function*)o)->type)
+
+struct Function{
+    FunctionType type;
 };
+
+struct FunctionOperator {
+    Function base;
+    ArithOp op;
+    VectorSet* domains;
+    Set * range;
+    OverFlowBehavior overflowbehavior;
+};
+
+struct FunctionTable{
+    Function base;
+    Table* table;
+};
+
+Function* allocFunctionOperator( ArithOp op, Set ** domain, uint numDomain, Set * range,OverFlowBehavior overflowbehavior);
+Function* allocFunctionTable (Table* table);
+void deleteFunction(Function* This);
+
 #endif