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 {
|
|
131
|
|
132 }
|
|
133
|
|
134 class CaseStatement : Statement
|
|
135 {
|
|
136
|
|
137 }
|
|
138
|
|
139 class DefaultStatement : Statement
|
|
140 {
|
|
141
|
|
142 }
|
|
143
|
|
144 class ContinueStatement : Statement
|
|
145 {
|
|
146
|
|
147 }
|
|
148
|
|
149 class BreakStatement : Statement
|
|
150 {
|
|
151
|
|
152 }
|
|
153
|
|
154 class ReturnStatement : Statement
|
|
155 {
|
|
156
|
|
157 }
|
|
158
|
|
159 class GotoStatement : Statement
|
|
160 {
|
|
161
|
|
162 }
|
|
163
|
|
164 class WithStatement : Statement
|
|
165 {
|
|
166
|
|
167 }
|
|
168
|
|
169 class SynchronizedStatement : Statement
|
|
170 {
|
|
171
|
|
172 }
|
|
173
|
|
174 class TryStatement : Statement
|
|
175 {
|
|
176
|
|
177 }
|
|
178
|
|
179 class ScopeGuardStatement : Statement
|
|
180 {
|
|
181
|
|
182 }
|
|
183
|
|
184 class ThrowStatement : Statement
|
|
185 {
|
|
186
|
|
187 }
|
|
188
|
|
189 class VolatileStatement : Statement
|
|
190 {
|
|
191
|
|
192 }
|
|
193
|
|
194 class AsmStatement : Statement
|
|
195 {
|
|
196
|
|
197 }
|
|
198
|
|
199 class PragmaStatement : Statement
|
|
200 {
|
|
201
|
|
202 }
|
|
203
|
|
204 class MixinStatement : Statement
|
|
205 {
|
|
206
|
|
207 }
|