Bug Fix
[satune.git] / src / AST / function.h
index da5087b579e06373e3e25c193f2f37d79c5f77d2..fcb5068ad7703b296130450f6cebad838edacae5 100644 (file)
@@ -2,7 +2,39 @@
 #define FUNCTION_H
 #include "classlist.h"
 #include "mymemory.h"
+#include "ops.h"
+#include "astops.h"
+#include "structs.h"
 
-struct Function {
+class Function {
+public:
+       Function(FunctionType _type) : type(_type) {}
+       FunctionType type;
+       virtual ~Function() {}
+       virtual Function *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;}
+       CMEMALLOC;
 };
+
+class FunctionOperator : public Function {
+public:
+       ArithOp op;
+       Array<Set *> domains;
+       Set *range;
+       OverFlowBehavior overflowbehavior;
+       FunctionOperator(ArithOp op, Set **domain, uint numDomain, Set *range, OverFlowBehavior overflowbehavior);
+       uint64_t applyFunctionOperator(uint numVals, uint64_t *values);
+       bool isInRangeFunction(uint64_t val);
+       Function *clone(CSolver *solver, CloneMap *map);
+       CMEMALLOC;
+};
+
+class FunctionTable : public Function {
+public:
+       Table *table;
+       UndefinedBehavior undefBehavior;
+       FunctionTable (Table *table, UndefinedBehavior behavior);
+       Function *clone(CSolver *solver, CloneMap *map);
+       CMEMALLOC;
+};
+
 #endif