Mercurial > projects > dil
annotate trunk/src/Expressions.d @ 193:2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
author | aziz |
---|---|
date | Sun, 15 Jul 2007 18:19:01 +0000 |
parents | c21192e8be2b |
children | 88c1777a9e51 |
rev | line source |
---|---|
70 | 1 /++ |
2 Author: Aziz Köksal | |
3 License: GPL2 | |
4 +/ | |
5 module Expressions; | |
71 | 6 import Token; |
94 | 7 import Types; |
130 | 8 import Declarations; |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
9 import Statements; |
70 | 10 |
11 class Expression | |
12 { | |
13 | |
14 } | |
15 | |
136
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
16 class EmptyExpression : Expression |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
17 { |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
18 |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
19 } |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
20 |
70 | 21 class BinaryExpression : Expression |
22 { | |
71 | 23 Expression left, right; |
24 TOK tok; | |
25 this(Expression left, Expression right, TOK tok) | |
26 { | |
27 this.left = left; | |
28 this.right = right; | |
29 this.tok = tok; | |
30 } | |
70 | 31 } |
32 | |
72 | 33 class CondExpression : BinaryExpression |
70 | 34 { |
72 | 35 Expression condition; |
36 this(Expression condition, Expression left, Expression right) | |
37 { | |
38 this.condition = condition; | |
39 super(left, right, TOK.Comma); | |
40 } | |
41 } | |
70 | 42 |
72 | 43 class CommaExpression : BinaryExpression |
44 { | |
45 this(Expression left, Expression right) | |
46 { super(left, right, TOK.Comma); } | |
70 | 47 } |
48 | |
49 class OrOrExpression : BinaryExpression | |
50 { | |
71 | 51 this(Expression left, Expression right) |
52 { super(left, right, TOK.OrLogical); } | |
70 | 53 } |
54 | |
55 class AndAndExpression : BinaryExpression | |
56 { | |
71 | 57 this(Expression left, Expression right) |
58 { super(left, right, TOK.AndLogical); } | |
70 | 59 } |
60 | |
61 class OrExpression : BinaryExpression | |
62 { | |
71 | 63 this(Expression left, Expression right) |
64 { super(left, right, TOK.OrBinary); } | |
70 | 65 } |
66 | |
67 class XorExpression : BinaryExpression | |
68 { | |
71 | 69 this(Expression left, Expression right) |
70 { super(left, right, TOK.Xor); } | |
70 | 71 } |
72 | |
73 class AndExpression : BinaryExpression | |
74 { | |
71 | 75 this(Expression left, Expression right) |
76 { super(left, right, TOK.AndBinary); } | |
70 | 77 } |
78 | |
79 class CmpExpression : BinaryExpression | |
80 { | |
71 | 81 this(Expression left, Expression right, TOK tok) |
82 { super(left, right, tok); } | |
70 | 83 } |
84 | |
71 | 85 class EqualExpression : CmpExpression |
70 | 86 { |
71 | 87 this(Expression left, Expression right, TOK tok) |
88 { super(left, right, TOK.Equal); } | |
70 | 89 } |
90 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
91 class IdentityExpression : CmpExpression |
70 | 92 { |
71 | 93 this(Expression left, Expression right, TOK tok) |
94 { super(left, right, tok); } | |
70 | 95 } |
96 | |
71 | 97 class RelExpression : CmpExpression |
70 | 98 { |
71 | 99 this(Expression left, Expression right, TOK tok) |
100 { super(left, right, tok); } | |
70 | 101 } |
102 | |
103 class InExpression : BinaryExpression | |
104 { | |
71 | 105 this(Expression left, Expression right, TOK tok) |
106 { super(left, right, TOK.In); } | |
70 | 107 } |
108 | |
75 | 109 class LShiftExpression : BinaryExpression |
110 { | |
111 this(Expression left, Expression right) | |
112 { super(left, right, TOK.LShiftAssign); } | |
113 } | |
114 | |
115 class RShiftExpression : BinaryExpression | |
116 { | |
117 this(Expression left, Expression right) | |
118 { super(left, right, TOK.RShiftAssign); } | |
119 } | |
120 | |
121 class URShiftExpression : BinaryExpression | |
122 { | |
123 this(Expression left, Expression right) | |
124 { super(left, right, TOK.URShiftAssign); } | |
125 } | |
126 | |
76 | 127 class PlusExpression : BinaryExpression |
70 | 128 { |
76 | 129 this(Expression left, Expression right) |
130 { super(left, right, TOK.Plus); } | |
131 } | |
132 | |
133 class MinusExpression : BinaryExpression | |
134 { | |
135 this(Expression left, Expression right) | |
136 { super(left, right, TOK.Minus); } | |
70 | 137 } |
138 | |
139 class MulExpression : BinaryExpression | |
140 { | |
77 | 141 this(Expression left, Expression right) |
142 { super(left, right, TOK.Mul); } | |
143 } | |
144 | |
145 class DivExpression : BinaryExpression | |
146 { | |
147 this(Expression left, Expression right) | |
148 { super(left, right, TOK.Div); } | |
149 } | |
150 | |
151 class ModExpression : BinaryExpression | |
152 { | |
153 this(Expression left, Expression right) | |
154 { super(left, right, TOK.Mod); } | |
70 | 155 } |
156 | |
157 class CatExpression : BinaryExpression | |
158 { | |
76 | 159 this(Expression left, Expression right) |
71 | 160 { super(left, right, TOK.Catenate); } |
161 } | |
70 | 162 |
71 | 163 class AssignExpression : BinaryExpression |
164 { | |
165 this(Expression left, Expression right) | |
166 { super(left, right, TOK.Assign); } | |
167 } | |
168 class LShiftAssignExpression : BinaryExpression | |
169 { | |
170 this(Expression left, Expression right) | |
171 { super(left, right, TOK.LShiftAssign); } | |
172 } | |
173 class RShiftAssignExpression : BinaryExpression | |
174 { | |
175 this(Expression left, Expression right) | |
176 { super(left, right, TOK.RShiftAssign); } | |
177 } | |
178 class URShiftAssignExpression : BinaryExpression | |
179 { | |
180 this(Expression left, Expression right) | |
181 { super(left, right, TOK.URShiftAssign); } | |
182 } | |
183 class OrAssignExpression : BinaryExpression | |
184 { | |
185 this(Expression left, Expression right) | |
186 { super(left, right, TOK.OrAssign); } | |
187 } | |
188 class AndAssignExpression : BinaryExpression | |
189 { | |
190 this(Expression left, Expression right) | |
191 { super(left, right, TOK.AndAssign); } | |
192 } | |
193 class PlusAssignExpression : BinaryExpression | |
194 { | |
195 this(Expression left, Expression right) | |
196 { super(left, right, TOK.PlusAssign); } | |
197 } | |
198 class MinusAssignExpression : BinaryExpression | |
199 { | |
200 this(Expression left, Expression right) | |
201 { super(left, right, TOK.MinusAssign); } | |
202 } | |
203 class DivAssignExpression : BinaryExpression | |
204 { | |
205 this(Expression left, Expression right) | |
206 { super(left, right, TOK.DivAssign); } | |
207 } | |
208 class MulAssignExpression : BinaryExpression | |
209 { | |
210 this(Expression left, Expression right) | |
211 { super(left, right, TOK.MulAssign); } | |
212 } | |
213 class ModAssignExpression : BinaryExpression | |
214 { | |
215 this(Expression left, Expression right) | |
216 { super(left, right, TOK.ModAssign); } | |
217 } | |
218 class XorAssignExpression : BinaryExpression | |
219 { | |
220 this(Expression left, Expression right) | |
221 { super(left, right, TOK.XorAssign); } | |
222 } | |
223 class CatAssignExpression : BinaryExpression | |
224 { | |
225 this(Expression left, Expression right) | |
226 { super(left, right, TOK.CatAssign); } | |
70 | 227 } |
228 | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
229 class UnaryExpression : Expression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
230 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
231 Expression e; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
232 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
233 { this.e = e; } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
234 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
235 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
236 class AddressExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
237 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
238 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
239 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
240 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
241 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
242 class PreIncrExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
243 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
244 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
245 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
246 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
247 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
248 class PreDecrExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
249 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
250 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
251 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
252 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
253 |
79
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
254 class PostIncrExpression : UnaryExpression |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
255 { |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
256 this(Expression e) |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
257 { super(e); } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
258 } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
259 |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
260 class PostDecrExpression : UnaryExpression |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
261 { |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
262 this(Expression e) |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
263 { super(e); } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
264 } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
265 |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
266 class DerefExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
267 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
268 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
269 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
270 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
271 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
272 class SignExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
273 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
274 TOK sign; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
275 this(Expression e, TOK sign) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
276 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
277 super(e); |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
278 this.sign = sign; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
279 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
280 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
281 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
282 class NotExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
283 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
284 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
285 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
286 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
287 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
288 class CompExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
289 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
290 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
291 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
292 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
293 |
81 | 294 class DotIdExpression : UnaryExpression |
70 | 295 { |
108 | 296 string ident; |
297 this(Expression e, string ident) | |
298 { | |
299 super(e); | |
300 this.ident = ident; | |
301 } | |
70 | 302 } |
303 | |
153 | 304 class DotTemplateInstanceExpression : UnaryExpression |
305 { | |
306 string ident; | |
307 TemplateArguments targs; | |
308 this(Expression e, string ident, TemplateArguments targs) | |
309 { | |
310 super(e); | |
311 this.ident = ident; | |
312 this.targs = targs; | |
313 } | |
314 } | |
315 | |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
316 class PostDotListExpression : UnaryExpression |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
317 { |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
318 DotListExpression dotList; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
319 this(Expression e, DotListExpression dotList) |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
320 { |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
321 super(e); |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
322 this.dotList = dotList; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
323 } |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
324 } |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
325 |
81 | 326 class CallExpression : UnaryExpression |
327 { | |
328 Expression[] args; | |
329 this(Expression e, Expression[] args) | |
330 { | |
331 super(e); | |
332 this.args = args; | |
333 } | |
334 } | |
335 | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
336 class NewExpression : /*Unary*/Expression |
70 | 337 { |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
338 Expression[] newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
339 Type type; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
340 Expression[] ctorArgs; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
341 this(/*Expression e, */Expression[] newArgs, Type type, Expression[] ctorArgs) |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
342 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
343 /*super(e);*/ |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
344 this.newArgs = newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
345 this.type = type; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
346 this.ctorArgs = ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
347 } |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
348 } |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
349 |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
350 class NewAnonClassExpression : /*Unary*/Expression |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
351 { |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
352 Expression[] newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
353 BaseClass[] bases; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
354 Expression[] ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
355 Declaration[] decls; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
356 this(/*Expression e, */Expression[] newArgs, BaseClass[] bases, Expression[] ctorArgs, Declaration[] decls) |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
357 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
358 /*super(e);*/ |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
359 this.newArgs = newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
360 this.bases = bases; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
361 this.ctorArgs = ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
362 this.decls = decls; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
363 } |
70 | 364 } |
365 | |
366 class DeleteExpression : UnaryExpression | |
367 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
368 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
369 { super(e); } |
70 | 370 } |
371 | |
372 class CastExpression : UnaryExpression | |
373 { | |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
374 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
375 this(Expression e, Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
376 { |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
377 super(e); |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
378 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
379 } |
70 | 380 } |
381 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
382 class IndexExpression : UnaryExpression |
70 | 383 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
384 Expression[] args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
385 this(Expression e, Expression[] args) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
386 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
387 super(e); |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
388 this.args = args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
389 } |
70 | 390 } |
391 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
392 class SliceExpression : UnaryExpression |
70 | 393 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
394 Expression left, right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
395 this(Expression e, Expression left, Expression right) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
396 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
397 super(e); |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
398 this.left = left; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
399 this.right = right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
400 } |
70 | 401 } |
402 | |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
403 /* |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
404 class PrimaryExpression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
405 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
406 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
407 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
408 */ |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
409 |
89 | 410 class IdentifierExpression : Expression |
411 { | |
412 string identifier; | |
413 this(string identifier) | |
414 { | |
415 this.identifier = identifier; | |
416 } | |
417 } | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
418 /* |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
419 class IdentifierListExpression : Expression |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
420 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
421 Expression[] identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
422 this(Expression[] identList) |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
423 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
424 this.identList = identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
425 } |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
426 } |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
427 */ |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
428 class DotListExpression : Expression |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
429 { |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
430 Expression[] items; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
431 this(Expression[] items) |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
432 { |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
433 this.items = items; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
434 } |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
435 } |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
436 |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
437 class TemplateInstanceExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
438 { |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
439 string ident; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
440 TemplateArguments targs; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
441 this(string ident, TemplateArguments targs) |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
442 { |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
443 this.ident = ident; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
444 this.targs = targs; |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
445 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
446 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
447 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
448 class ThisExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
449 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
450 this() |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
451 {} |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
452 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
453 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
454 class SuperExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
455 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
456 this() |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
457 {} |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
458 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
459 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
460 class NullExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
461 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
462 this() |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
463 {} |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
464 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
465 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
466 class DollarExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
467 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
468 this() |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
469 {} |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
470 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
471 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
472 class BoolExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
473 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
474 bool value; |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
475 this(bool value) |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
476 { this.value = value; } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
477 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
478 |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
479 class IntNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
480 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
481 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
482 ulong number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
483 this(TOK type, ulong number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
484 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
485 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
486 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
487 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
488 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
489 |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
490 class RealNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
491 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
492 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
493 real number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
494 this(TOK type, real number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
495 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
496 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
497 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
498 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
499 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
500 |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
501 class CharLiteralExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
502 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
503 TOK tok; |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
504 this(TOK tok) |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
505 { this.tok = tok; } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
506 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
507 |
157
fdbd47d72614
- Renamed class StringLiteralExpression to StringLiteralsExpression.
aziz
parents:
154
diff
changeset
|
508 class StringLiteralsExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
509 { |
157
fdbd47d72614
- Renamed class StringLiteralExpression to StringLiteralsExpression.
aziz
parents:
154
diff
changeset
|
510 Token*[] strLiterals; |
fdbd47d72614
- Renamed class StringLiteralExpression to StringLiteralsExpression.
aziz
parents:
154
diff
changeset
|
511 this(Token*[] strLiterals) |
fdbd47d72614
- Renamed class StringLiteralExpression to StringLiteralsExpression.
aziz
parents:
154
diff
changeset
|
512 { this.strLiterals = strLiterals; } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
513 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
514 |
85 | 515 class ArrayLiteralExpression : Expression |
516 { | |
517 Expression[] values; | |
518 this(Expression[] values) | |
519 { this.values = values; } | |
520 } | |
521 | |
522 class AssocArrayLiteralExpression : Expression | |
523 { | |
524 Expression[] keys, values; | |
525 this(Expression[] keys, Expression[] values) | |
526 { | |
527 this.keys = keys; | |
528 this.values = values; | |
529 } | |
530 } | |
531 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
532 class AssertExpression : Expression |
70 | 533 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
534 Expression expr, msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
535 this(Expression expr, Expression msg) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
536 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
537 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
538 this.msg = msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
539 } |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
540 } |
70 | 541 |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
542 class MixinExpression : Expression |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
543 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
544 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
545 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
546 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
547 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
548 } |
70 | 549 } |
550 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
551 class ImportExpression : Expression |
70 | 552 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
553 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
554 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
555 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
556 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
557 } |
70 | 558 } |
559 | |
101 | 560 class TypeofExpression : Expression |
561 { | |
562 Type type; | |
563 this(Type type) | |
564 { | |
565 this.type = type; | |
566 } | |
567 } | |
568 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
569 class TypeDotIdExpression : Expression |
70 | 570 { |
94 | 571 Type type; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
572 string ident; |
94 | 573 this(Type type, string ident) |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
574 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
575 this.type = type; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
576 this.ident = ident; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
577 } |
70 | 578 } |
579 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
580 class TypeidExpression : Expression |
70 | 581 { |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
582 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
583 this(Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
584 { |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
585 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
586 } |
70 | 587 } |
588 | |
89 | 589 class IsExpression : Expression |
70 | 590 { |
100 | 591 Type type; |
592 string ident; | |
593 SpecializationType specType; | |
594 this(Type type, string ident, SpecializationType specType) | |
595 { | |
596 this.type = type; | |
597 this.ident = ident; | |
598 this.specType = specType; | |
599 } | |
70 | 600 } |
130 | 601 |
602 class FunctionLiteralExpression : Expression | |
603 { | |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
604 FunctionType funcType; |
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
605 FunctionBody funcBody; |
133
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
606 TOK funcTok; |
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
607 |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
608 this(FunctionType funcType, FunctionBody funcBody, TOK funcTok = TOK.Invalid) |
130 | 609 { |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
610 this.funcType = funcType; |
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
611 this.funcBody = funcBody; |
133
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
612 this.funcTok = funcTok; |
130 | 613 } |
614 } |