102
|
1 /++
|
|
2 Author: Aziz Köksal
|
|
3 License: GPL2
|
|
4 +/
|
|
5 module Statements;
|
162
|
6 import Expressions;
|
|
7 import Types;
|
169
|
8 import Token;
|
102
|
9
|
|
10 class Statement
|
|
11 {
|
|
12
|
|
13 }
|
161
|
14
|
|
15 class Statements : Statement
|
|
16 {
|
|
17 Statement[] ss;
|
|
18 void opCatAssign(Statement s)
|
|
19 {
|
|
20 this.ss ~= s;
|
|
21 }
|
|
22 }
|
|
23
|
162
|
24 class ScopeStatement : Statement
|
|
25 {
|
|
26 Statement s;
|
|
27 this(Statement s)
|
|
28 {
|
|
29 this.s = s;
|
|
30 }
|
|
31 }
|
|
32
|
161
|
33 class LabeledStatement : Statement
|
|
34 {
|
|
35 string label;
|
|
36 Statement s;
|
|
37 this(string label, Statement s)
|
|
38 {
|
|
39 this.label = label;
|
|
40 this.s = s;
|
|
41 }
|
|
42 }
|
|
43
|
|
44 class ExpressionStatement : Statement
|
|
45 {
|
|
46
|
|
47 }
|
|
48
|
|
49 class DeclarationStatement : Statement
|
|
50 {
|
|
51
|
|
52 }
|
|
53
|
|
54 class IfStatement : Statement
|
|
55 {
|
162
|
56 Type type;
|
|
57 string ident;
|
|
58 Expression condition;
|
|
59 Statement ifBody;
|
|
60 Statement elseBody;
|
|
61 this(Type type, string ident, Expression condition, Statement ifBody, Statement elseBody)
|
|
62 {
|
|
63 this.type = type;
|
|
64 this.ident = ident;
|
|
65 this.condition = condition;
|
|
66 this.ifBody = ifBody;
|
|
67 this.elseBody = elseBody;
|
|
68 }
|
161
|
69 }
|
|
70
|
|
71 class ConditionalStatement : Statement
|
|
72 {
|
|
73
|
|
74 }
|
|
75
|
|
76 class WhileStatement : Statement
|
|
77 {
|
164
|
78 Expression condition;
|
|
79 Statement whileBody;
|
|
80 this(Expression condition, Statement whileBody)
|
|
81 {
|
|
82 this.condition = condition;
|
|
83 this.whileBody = whileBody;
|
|
84 }
|
161
|
85 }
|
|
86
|
165
|
87 class DoWhileStatement : Statement
|
161
|
88 {
|
165
|
89 Expression condition;
|
|
90 Statement doBody;
|
|
91 this(Expression condition, Statement doBody)
|
|
92 {
|
|
93 this.condition = condition;
|
|
94 this.doBody = doBody;
|
|
95 }
|
161
|
96 }
|
|
97
|
|
98 class ForStatement : Statement
|
|
99 {
|
166
|
100 Statement init;
|
|
101 Expression condition, increment;
|
|
102 Statement forBody;
|
169
|
103
|
166
|
104 this(Statement init, Expression condition, Expression increment, Statement forBody)
|
|
105 {
|
|
106 this.init = init;
|
|
107 this.condition = condition;
|
|
108 this.increment = increment;
|
|
109 this.forBody = forBody;
|
|
110 }
|
161
|
111 }
|
|
112
|
|
113 class ForeachStatement : Statement
|
|
114 {
|
169
|
115 TOK tok;
|
|
116 Parameters params;
|
|
117 Expression aggregate;
|
|
118 Statement forBody;
|
161
|
119
|
169
|
120 this(TOK tok, Parameters params, Expression aggregate, Statement forBody)
|
|
121 {
|
|
122 this.tok = tok;
|
|
123 this.params = params;
|
|
124 this.aggregate = aggregate;
|
|
125 this.forBody = forBody;
|
|
126 }
|
161
|
127 }
|
|
128
|
|
129 class SwitchStatement : Statement
|
|
130 {
|
170
|
131 Expression condition;
|
|
132 Statement switchBody;
|
161
|
133
|
170
|
134 this(Expression condition, Statement switchBody)
|
|
135 {
|
|
136 this.condition = condition;
|
|
137 this.switchBody = switchBody;
|
|
138 }
|
161
|
139 }
|
|
140
|
|
141 class CaseStatement : Statement
|
|
142 {
|
171
|
143 Expression[] values;
|
|
144 Statement caseBody;
|
161
|
145
|
171
|
146 this(Expression[] values, Statement caseBody)
|
|
147 {
|
|
148 this.values = values;
|
|
149 this.caseBody = caseBody;
|
|
150 }
|
161
|
151 }
|
|
152
|
|
153 class DefaultStatement : Statement
|
|
154 {
|
|
155
|
|
156 }
|
|
157
|
|
158 class ContinueStatement : Statement
|
|
159 {
|
|
160
|
|
161 }
|
|
162
|
|
163 class BreakStatement : Statement
|
|
164 {
|
|
165
|
|
166 }
|
|
167
|
|
168 class ReturnStatement : Statement
|
|
169 {
|
|
170
|
|
171 }
|
|
172
|
|
173 class GotoStatement : Statement
|
|
174 {
|
|
175
|
|
176 }
|
|
177
|
|
178 class WithStatement : Statement
|
|
179 {
|
|
180
|
|
181 }
|
|
182
|
|
183 class SynchronizedStatement : Statement
|
|
184 {
|
|
185
|
|
186 }
|
|
187
|
|
188 class TryStatement : Statement
|
|
189 {
|
|
190
|
|
191 }
|
|
192
|
|
193 class ScopeGuardStatement : Statement
|
|
194 {
|
|
195
|
|
196 }
|
|
197
|
|
198 class ThrowStatement : Statement
|
|
199 {
|
|
200
|
|
201 }
|
|
202
|
|
203 class VolatileStatement : Statement
|
|
204 {
|
|
205
|
|
206 }
|
|
207
|
|
208 class AsmStatement : Statement
|
|
209 {
|
|
210
|
|
211 }
|
|
212
|
|
213 class PragmaStatement : Statement
|
|
214 {
|
|
215
|
|
216 }
|
|
217
|
|
218 class MixinStatement : Statement
|
|
219 {
|
|
220
|
|
221 }
|