c04d6f2304ce2c32b5c78b916ae04486d052bb8b
[satune.git] / src / AST / function.h
1 #ifndef FUNCTION_H
2 #define FUNCTION_H
3 #include "classlist.h"
4 #include "mymemory.h"
5 #include "ops.h"
6 #include "structs.h"
7
8 #define GETFUNCTIONTYPE(o) (((Function*)o)->type)
9
10 struct Function{
11     FunctionType type;
12 };
13
14 struct FunctionOperator {
15         Function base;
16         ArithOp op;
17         uint numDomains;
18         Set ** domains;
19         Set * range;
20         OverFlowBehavior overflowbehavior;
21 };
22
23 struct FunctionTable{
24         Function base;
25         Table* table;
26 };
27
28 Function* allocFunctionOperator( ArithOp op, Set ** domain, uint numDomain, Set * range,OverFlowBehavior overflowbehavior);
29 Function* allocFunctionTable (Table* table);
30 void deleteFunction(Function* This);
31
32 #endif