Kiwi Script
KiwiScript Interpreter
 All Data Structures Files Functions Variables Typedefs Enumerations Macros
KSFunction.h
Go to the documentation of this file.
1 
8 #ifndef KSFUNCTION_H
9 #define KSFUNCTION_H
10 
11 #include <KiwiEngine/KiwiEngine.h>
12 #include "KSForwarders.h"
13 
17 struct KSFunction {
19  struct KEFunction superClass ;
21  struct CNObjectList parameterList ;
23  struct CNObjectList returnTypeList ;
26 };
27 
33 struct KSFunction *
34 KSAllocateFunction(struct CNResource * resource) ;
35 
40 static inline void
41 KSRetainFunction(struct KSFunction * dst)
42 {
43  KERetainFunction(&(dst->superClass)) ;
44 }
45 
50 static inline void
51 KSReleaseFunction(struct KSFunction * dst)
52 {
53  KEReleaseFunction(&(dst->superClass)) ;
54 }
55 
61 static inline struct CNResource *
62 KSResourceOfFunction(struct KSFunction * src)
63 {
64  return KEResourceOfFunction(&(src->superClass)) ;
65 }
66 
72 static inline void
73 KSSetFunctionParameters(struct KSFunction * dst, struct CNObjectList * params)
74 {
75  CNDestroyObjectList(&(dst->parameterList)) ;
76  dst->parameterList = CNCopyObjectList(params) ;
77 }
78 
84 static inline void
85 KSSetFunctionReturnTypes(struct KSFunction * dst, struct CNObjectList * params)
86 {
87  CNDestroyObjectList(&(dst->returnTypeList)) ;
88  dst->returnTypeList = CNCopyObjectList(params) ;
89 }
90 
96 void
97 KSSetFunctionBody(struct KSFunction * dst, struct KSCompoundStatement * stmt) ;
98 
99 #endif /* KSFUNCTION_H */
100 
struct KSCompoundStatement * bodyStatement
Definition: KSFunction.h:25
struct CNObjectList parameterList
Definition: KSFunction.h:21
struct KEFunction superClass
Definition: KSFunction.h:19
struct KSFunction * KSAllocateFunction(struct CNResource *resource)
Alloxate Function object.
void KSSetFunctionBody(struct KSFunction *dst, struct KSCompoundStatement *stmt)
Set body statement to function.
struct CNObjectList returnTypeList
Definition: KSFunction.h:23
Definition: KSFunction.h:17
Definition: KSCompoundStatement.h:18
Forward declarations for the KiwiScript.