X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satune.git;a=blobdiff_plain;f=src%2FAST%2Ffunction.h;h=50a59ec081c504b849fa1ce0349c0e6e9f35c36b;hp=82379f782d6db72c06ef53f6783237e6841323b2;hb=487b405f45bfc928a981a2b3613c08f26cf4a9e5;hpb=f157726420ac92c6b29ab7b552682629d0f3c4a4 diff --git a/src/AST/function.h b/src/AST/function.h index 82379f7..50a59ec 100644 --- a/src/AST/function.h +++ b/src/AST/function.h @@ -4,11 +4,29 @@ #include "mymemory.h" #include "ops.h" #include "structs.h" + +#define GETFUNCTIONTYPE(o) (((Function*)o)->type) + struct Function { - enum ArithOp op; - VectorSet* domains; - Set * range; - enum OverFlowBehavior overflowbehavior; - Table* table; + FunctionType type; }; + +struct FunctionOperator { + Function base; + ArithOp op; + uint numDomains; + Set ** 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