Mercurial > projects > dil
annotate trunk/src/Expressions.d @ 108:469188935d56
- Added ident member to DotIdExpression.
author | aziz |
---|---|
date | Sun, 08 Jul 2007 15:42:03 +0000 |
parents | 6f3c5473c5e5 |
children | 0467f01ed524 |
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; |
70 | 8 |
9 class Expression | |
10 { | |
11 | |
12 } | |
13 | |
14 class BinaryExpression : Expression | |
15 { | |
71 | 16 Expression left, right; |
17 TOK tok; | |
18 this(Expression left, Expression right, TOK tok) | |
19 { | |
20 this.left = left; | |
21 this.right = right; | |
22 this.tok = tok; | |
23 } | |
70 | 24 } |
25 | |
72 | 26 class CondExpression : BinaryExpression |
70 | 27 { |
72 | 28 Expression condition; |
29 this(Expression condition, Expression left, Expression right) | |
30 { | |
31 this.condition = condition; | |
32 super(left, right, TOK.Comma); | |
33 } | |
34 } | |
70 | 35 |
72 | 36 class CommaExpression : BinaryExpression |
37 { | |
38 this(Expression left, Expression right) | |
39 { super(left, right, TOK.Comma); } | |
70 | 40 } |
41 | |
42 class OrOrExpression : BinaryExpression | |
43 { | |
71 | 44 this(Expression left, Expression right) |
45 { super(left, right, TOK.OrLogical); } | |
70 | 46 } |
47 | |
48 class AndAndExpression : BinaryExpression | |
49 { | |
71 | 50 this(Expression left, Expression right) |
51 { super(left, right, TOK.AndLogical); } | |
70 | 52 } |
53 | |
54 class OrExpression : BinaryExpression | |
55 { | |
71 | 56 this(Expression left, Expression right) |
57 { super(left, right, TOK.OrBinary); } | |
70 | 58 } |
59 | |
60 class XorExpression : BinaryExpression | |
61 { | |
71 | 62 this(Expression left, Expression right) |
63 { super(left, right, TOK.Xor); } | |
70 | 64 } |
65 | |
66 class AndExpression : BinaryExpression | |
67 { | |
71 | 68 this(Expression left, Expression right) |
69 { super(left, right, TOK.AndBinary); } | |
70 | 70 } |
71 | |
72 class CmpExpression : BinaryExpression | |
73 { | |
71 | 74 this(Expression left, Expression right, TOK tok) |
75 { super(left, right, tok); } | |
70 | 76 } |
77 | |
71 | 78 class EqualExpression : CmpExpression |
70 | 79 { |
71 | 80 this(Expression left, Expression right, TOK tok) |
81 { super(left, right, TOK.Equal); } | |
70 | 82 } |
83 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
84 class IdentityExpression : CmpExpression |
70 | 85 { |
71 | 86 this(Expression left, Expression right, TOK tok) |
87 { super(left, right, tok); } | |
70 | 88 } |
89 | |
71 | 90 class RelExpression : CmpExpression |
70 | 91 { |
71 | 92 this(Expression left, Expression right, TOK tok) |
93 { super(left, right, tok); } | |
70 | 94 } |
95 | |
96 class InExpression : BinaryExpression | |
97 { | |
71 | 98 this(Expression left, Expression right, TOK tok) |
99 { super(left, right, TOK.In); } | |
70 | 100 } |
101 | |
75 | 102 class LShiftExpression : BinaryExpression |
103 { | |
104 this(Expression left, Expression right) | |
105 { super(left, right, TOK.LShiftAssign); } | |
106 } | |
107 | |
108 class RShiftExpression : BinaryExpression | |
109 { | |
110 this(Expression left, Expression right) | |
111 { super(left, right, TOK.RShiftAssign); } | |
112 } | |
113 | |
114 class URShiftExpression : BinaryExpression | |
115 { | |
116 this(Expression left, Expression right) | |
117 { super(left, right, TOK.URShiftAssign); } | |
118 } | |
119 | |
76 | 120 class PlusExpression : BinaryExpression |
70 | 121 { |
76 | 122 this(Expression left, Expression right) |
123 { super(left, right, TOK.Plus); } | |
124 } | |
125 | |
126 class MinusExpression : BinaryExpression | |
127 { | |
128 this(Expression left, Expression right) | |
129 { super(left, right, TOK.Minus); } | |
70 | 130 } |
131 | |
132 class MulExpression : BinaryExpression | |
133 { | |
77 | 134 this(Expression left, Expression right) |
135 { super(left, right, TOK.Mul); } | |
136 } | |
137 | |
138 class DivExpression : BinaryExpression | |
139 { | |
140 this(Expression left, Expression right) | |
141 { super(left, right, TOK.Div); } | |
142 } | |
143 | |
144 class ModExpression : BinaryExpression | |
145 { | |
146 this(Expression left, Expression right) | |
147 { super(left, right, TOK.Mod); } | |
70 | 148 } |
149 | |
150 class CatExpression : BinaryExpression | |
151 { | |
76 | 152 this(Expression left, Expression right) |
71 | 153 { super(left, right, TOK.Catenate); } |
154 } | |
70 | 155 |
71 | 156 class AssignExpression : BinaryExpression |
157 { | |
158 this(Expression left, Expression right) | |
159 { super(left, right, TOK.Assign); } | |
160 } | |
161 class LShiftAssignExpression : BinaryExpression | |
162 { | |
163 this(Expression left, Expression right) | |
164 { super(left, right, TOK.LShiftAssign); } | |
165 } | |
166 class RShiftAssignExpression : BinaryExpression | |
167 { | |
168 this(Expression left, Expression right) | |
169 { super(left, right, TOK.RShiftAssign); } | |
170 } | |
171 class URShiftAssignExpression : BinaryExpression | |
172 { | |
173 this(Expression left, Expression right) | |
174 { super(left, right, TOK.URShiftAssign); } | |
175 } | |
176 class OrAssignExpression : BinaryExpression | |
177 { | |
178 this(Expression left, Expression right) | |
179 { super(left, right, TOK.OrAssign); } | |
180 } | |
181 class AndAssignExpression : BinaryExpression | |
182 { | |
183 this(Expression left, Expression right) | |
184 { super(left, right, TOK.AndAssign); } | |
185 } | |
186 class PlusAssignExpression : BinaryExpression | |
187 { | |
188 this(Expression left, Expression right) | |
189 { super(left, right, TOK.PlusAssign); } | |
190 } | |
191 class MinusAssignExpression : BinaryExpression | |
192 { | |
193 this(Expression left, Expression right) | |
194 { super(left, right, TOK.MinusAssign); } | |
195 } | |
196 class DivAssignExpression : BinaryExpression | |
197 { | |
198 this(Expression left, Expression right) | |
199 { super(left, right, TOK.DivAssign); } | |
200 } | |
201 class MulAssignExpression : BinaryExpression | |
202 { | |
203 this(Expression left, Expression right) | |
204 { super(left, right, TOK.MulAssign); } | |
205 } | |
206 class ModAssignExpression : BinaryExpression | |
207 { | |
208 this(Expression left, Expression right) | |
209 { super(left, right, TOK.ModAssign); } | |
210 } | |
211 class XorAssignExpression : BinaryExpression | |
212 { | |
213 this(Expression left, Expression right) | |
214 { super(left, right, TOK.XorAssign); } | |
215 } | |
216 class CatAssignExpression : BinaryExpression | |
217 { | |
218 this(Expression left, Expression right) | |
219 { super(left, right, TOK.CatAssign); } | |
70 | 220 } |
221 | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
222 class UnaryExpression : Expression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
223 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
224 Expression e; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
225 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
226 { this.e = e; } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
227 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
228 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
229 class AddressExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
232 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
233 } |
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 class PreIncrExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
236 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
237 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
238 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
239 } |
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 class PreDecrExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
242 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
243 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
244 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
245 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
246 |
79
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
247 class PostIncrExpression : UnaryExpression |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
248 { |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
249 this(Expression e) |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
250 { super(e); } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
251 } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
252 |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
253 class PostDecrExpression : UnaryExpression |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
254 { |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
255 this(Expression e) |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
256 { super(e); } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
257 } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
258 |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
259 class DerefExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
260 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
261 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
262 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
263 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
264 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
265 class SignExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
266 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
267 TOK sign; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
268 this(Expression e, TOK sign) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
269 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
270 super(e); |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
271 this.sign = sign; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
272 } |
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 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
275 class NotExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
278 { super(e); } |
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 class CompExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
282 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
283 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
284 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
285 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
286 |
81 | 287 class DotExpression : UnaryExpression |
70 | 288 { |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
289 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
290 { super(e); } |
70 | 291 } |
292 | |
81 | 293 class DotIdExpression : UnaryExpression |
70 | 294 { |
108 | 295 string ident; |
296 this(Expression e, string ident) | |
297 { | |
298 super(e); | |
299 this.ident = ident; | |
300 } | |
70 | 301 } |
302 | |
81 | 303 class CallExpression : UnaryExpression |
304 { | |
305 Expression[] args; | |
306 this(Expression e, Expression[] args) | |
307 { | |
308 super(e); | |
309 this.args = args; | |
310 } | |
311 } | |
312 | |
70 | 313 class NewExpression : UnaryExpression |
314 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
315 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
316 { super(e); } |
70 | 317 } |
318 | |
319 class DeleteExpression : UnaryExpression | |
320 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
321 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
322 { super(e); } |
70 | 323 } |
324 | |
325 class CastExpression : UnaryExpression | |
326 { | |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
327 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
328 this(Expression e, Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
329 { |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
330 super(e); |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
331 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
332 } |
70 | 333 } |
334 | |
335 class AnonClassExpression : UnaryExpression | |
336 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
337 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
338 { super(e); } |
70 | 339 } |
340 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
341 class IndexExpression : UnaryExpression |
70 | 342 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
343 Expression[] args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
344 this(Expression e, Expression[] args) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
345 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
346 super(e); |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
347 this.args = args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
348 } |
70 | 349 } |
350 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
351 class SliceExpression : UnaryExpression |
70 | 352 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
353 Expression left, right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
354 this(Expression e, Expression left, Expression right) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
355 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
356 super(e); |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
357 this.left = left; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
358 this.right = right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
359 } |
70 | 360 } |
361 | |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
362 /* |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
363 class PrimaryExpression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
364 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
365 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
366 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
367 */ |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
368 |
89 | 369 class IdentifierExpression : Expression |
370 { | |
371 string identifier; | |
372 this(string identifier) | |
373 { | |
374 this.identifier = identifier; | |
375 } | |
376 } | |
377 | |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
378 class GlobalIdExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
379 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
380 string identifier; |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
381 this(string identifier) |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
382 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
383 this.identifier = identifier; |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
384 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
385 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
386 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
387 class ThisExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
388 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
389 this() |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
390 {} |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
391 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
392 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
393 class SuperExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
394 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
395 this() |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
396 {} |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
397 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
398 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
399 class NullExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
400 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
401 this() |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
402 {} |
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 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
405 class DollarExpression : Expression |
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 this() |
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 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
410 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
411 class BoolExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
412 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
413 bool value; |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
414 this(bool value) |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
415 { this.value = value; } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
416 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
417 |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
418 class IntNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
419 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
420 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
421 ulong number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
422 this(TOK type, ulong number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
423 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
424 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
425 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
426 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
427 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
428 |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
429 class RealNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
430 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
431 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
432 real number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
433 this(TOK type, real number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
434 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
435 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
436 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
437 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
438 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
439 |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
440 class CharLiteralExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
441 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
442 TOK tok; |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
443 this(TOK tok) |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
444 { this.tok = tok; } |
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 class StringLiteralExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
448 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
449 string str; |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
450 this(string str) |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
451 { this.str = str; } |
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 |
85 | 454 class ArrayLiteralExpression : Expression |
455 { | |
456 Expression[] values; | |
457 this(Expression[] values) | |
458 { this.values = values; } | |
459 } | |
460 | |
461 class AssocArrayLiteralExpression : Expression | |
462 { | |
463 Expression[] keys, values; | |
464 this(Expression[] keys, Expression[] values) | |
465 { | |
466 this.keys = keys; | |
467 this.values = values; | |
468 } | |
469 } | |
470 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
471 class AssertExpression : Expression |
70 | 472 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
473 Expression expr, msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
474 this(Expression expr, Expression msg) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
475 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
476 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
477 this.msg = msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
478 } |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
479 } |
70 | 480 |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
481 class MixinExpression : Expression |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
482 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
483 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
484 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
485 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
486 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
487 } |
70 | 488 } |
489 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
490 class ImportExpression : Expression |
70 | 491 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
492 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
493 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
494 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
495 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
496 } |
70 | 497 } |
498 | |
101 | 499 class TypeofExpression : Expression |
500 { | |
501 Type type; | |
502 this(Type type) | |
503 { | |
504 this.type = type; | |
505 } | |
506 } | |
507 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
508 class TypeDotIdExpression : Expression |
70 | 509 { |
94 | 510 Type type; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
511 string ident; |
94 | 512 this(Type type, string ident) |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
513 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
514 this.type = type; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
515 this.ident = ident; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
516 } |
70 | 517 } |
518 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
519 class TypeidExpression : Expression |
70 | 520 { |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
521 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
522 this(Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
523 { |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
524 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
525 } |
70 | 526 } |
527 | |
89 | 528 class IsExpression : Expression |
70 | 529 { |
100 | 530 Type type; |
531 string ident; | |
532 SpecializationType specType; | |
533 this(Type type, string ident, SpecializationType specType) | |
534 { | |
535 this.type = type; | |
536 this.ident = ident; | |
537 this.specType = specType; | |
538 } | |
70 | 539 } |