Kiwi Script
KiwiScript Interpreter
 All Data Structures Files Functions Variables Typedefs Enumerations Macros
KSStatement.h
Go to the documentation of this file.
1 
8 #ifndef KSSTATEMENT_H
9 #define KSSTATEMENT_H
10 
11 #include <KiwiEngine/KiwiEngine.h>
12 #include "KSForwarders.h"
13 
15 struct KSStatement {
17  struct CNObject superClass ;
19  struct KELineInfo * lineInfo ;
20 } ;
21 
23 typedef void (*KSAcceptStatementVisitorFuncRef)(const struct KSStatementVisitor * visitor, struct KSStatement * stmt, void * userinfo) ;
24 
28  struct CNObjectMethods superClass ;
31 } ;
32 
41 struct KSStatement *
42 KSAllocateStatement(size_t size, const struct KSStatementMethods * methods, struct KELineInfo * linfo, struct CNResource * resource) ;
43 
50 static inline void
51 KSDeallocateStatement(struct KSStatement * dst)
52 {
53  ((void) dst) ;
54 }
55 
60 static inline void
61 KSRetainStatement(struct KSStatement * dst)
62 {
63  CNRetainObject(&(dst->superClass)) ;
64 }
65 
70 static inline void
71 KSReleaseStatement(struct KSStatement * dst)
72 {
73  CNReleaseObject(&(dst->superClass)) ;
74 }
75 
76 static inline struct CNResource *
77 KSResourceOfStatement(struct KSStatement * stmt)
78 {
79  return CNResourceOfObject(&(stmt->superClass)) ;
80 }
81 
82 static inline const struct KSStatementMethods *
83 KSMethodsOfStatement(struct KSStatement * stmt)
84 {
85  return (const struct KSStatementMethods *) CNMethodsOfObject(&(stmt->superClass)) ;
86 }
87 
88 static inline void
89 KSAcceptStatementVisitor(struct KSStatement * stmt, const struct KSStatementVisitor * visitor, void * userinfo)
90 {
91  const struct KSStatementMethods * methods = KSMethodsOfStatement(stmt) ;
93  (*accfunc)(visitor, stmt, userinfo) ;
94 }
95 
96 #endif /* KSSTATEMENT_H */
97 
Definition: KSStatement.h:15
Definition: KSStatementVisitor.h:14
struct CNObjectMethods superClass
Definition: KSStatement.h:28
struct CNObject superClass
Definition: KSStatement.h:17
void(* KSAcceptStatementVisitorFuncRef)(const struct KSStatementVisitor *visitor, struct KSStatement *stmt, void *userinfo)
Definition: KSStatement.h:23
Definition: KSStatement.h:26
struct KELineInfo * lineInfo
Definition: KSStatement.h:19
struct KSStatement * KSAllocateStatement(size_t size, const struct KSStatementMethods *methods, struct KELineInfo *linfo, struct CNResource *resource)
Allocate statement.
KSAcceptStatementVisitorFuncRef acceptVisitorFunc
Definition: KSStatement.h:30
Forward declarations for the KiwiScript.