Kiwi Script
KiwiScript Interpreter
 All Data Structures Files Functions Variables Typedefs Enumerations Macros
KSForStatement.h
Go to the documentation of this file.
1 
8 #ifndef KSFORSTATEMENT_H
9 #define KSFORSTATEMENT_H
10 
11 #include <KiwiEngine/KiwiEngine.h>
12 #include "KSStatement.h"
13 #include "KSForwarders.h"
14 
16 typedef enum {
17  KSForeachCollection,
18  KSForeachRange
20 
30  struct KSVariable * variable ;
32  union {
33  struct {
36  } collection ;
37  struct {
42  } range ;
43  } ;
46 } ;
47 
57 struct KSForStatement *
59  struct KSExpression * collection,
60  struct KSCompoundStatement * bodystmt,
61  struct KELineInfo * linfo,
62  struct CNResource * resource) ;
63 
74 struct KSForStatement *
76  struct KSExpression * minexp,
77  struct KSExpression * maxexp,
78  struct KSCompoundStatement * bodystmt,
79  struct KELineInfo * linfo,
80  struct CNResource * resource) ;
81 
86 static inline void
87 KSRetainForStatement(struct KSForStatement * dst)
88 {
89  KSReleaseStatement(&(dst->superClass)) ;
90 }
91 
96 static inline void
97 KSReleaseForStatement(struct KSForStatement * dst)
98 {
99  KSReleaseStatement(&(dst->superClass)) ;
100 }
101 
102 #endif /* KSFORSTATEMENT_H */
103 
struct KSVariable * variable
Definition: KSForStatement.h:30
IR for KSStatement class.
KSForStatementKind kind
Definition: KSForStatement.h:28
KSForStatementKind
Definition: KSForStatement.h:16
Definition: KSStatement.h:15
struct KSStatement superClass
Definition: KSForStatement.h:26
struct KSExpression * collectionExpression
Definition: KSForStatement.h:35
Definition: KSExpression.h:15
struct KSForStatement * KSAllocateForeachRangeStatement(struct KSVariable *var, struct KSExpression *minexp, struct KSExpression *maxexp, struct KSCompoundStatement *bodystmt, struct KELineInfo *linfo, struct CNResource *resource)
Allocate for statement.
struct KSExpression * maxRangeExpression
Definition: KSForStatement.h:41
Definition: KSForStatement.h:24
struct KSForStatement * KSAllocateForeachCollectionStatement(struct KSVariable *var, struct KSExpression *collection, struct KSCompoundStatement *bodystmt, struct KELineInfo *linfo, struct CNResource *resource)
Allocate for statement.
struct KSCompoundStatement * bodyStatement
Definition: KSForStatement.h:45
Definition: KSCompoundStatement.h:18
Forward declarations for the KiwiScript.
Definition: KSVariable.h:15
struct KSExpression * minRangeExpression
Definition: KSForStatement.h:39