Mercurial > projects > dil
annotate trunk/src/Expressions.d @ 78:f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
- Added class AddressExpression, PreIncrExpression, PreDecrExpression, DerefExpression, SignExpression, NotExpression and CompExpression.
author | aziz |
---|---|
date | Sun, 01 Jul 2007 21:35:01 +0000 |
parents | 7e21c4df1c02 |
children | df4e5c7ad58a |
rev | line source |
---|---|
70 | 1 /++ |
2 Author: Aziz Köksal | |
3 License: GPL2 | |
4 +/ | |
5 module Expressions; | |
71 | 6 import Token; |
70 | 7 |
8 class Expression | |
9 { | |
10 | |
11 } | |
12 | |
13 class BinaryExpression : Expression | |
14 { | |
71 | 15 Expression left, right; |
16 TOK tok; | |
17 this(Expression left, Expression right, TOK tok) | |
18 { | |
19 this.left = left; | |
20 this.right = right; | |
21 this.tok = tok; | |
22 } | |
70 | 23 } |
24 | |
72 | 25 class CondExpression : BinaryExpression |
70 | 26 { |
72 | 27 Expression condition; |
28 this(Expression condition, Expression left, Expression right) | |
29 { | |
30 this.condition = condition; | |
31 super(left, right, TOK.Comma); | |
32 } | |
33 } | |
70 | 34 |
72 | 35 class CommaExpression : BinaryExpression |
36 { | |
37 this(Expression left, Expression right) | |
38 { super(left, right, TOK.Comma); } | |
70 | 39 } |
40 | |
41 class OrOrExpression : BinaryExpression | |
42 { | |
71 | 43 this(Expression left, Expression right) |
44 { super(left, right, TOK.OrLogical); } | |
70 | 45 } |
46 | |
47 class AndAndExpression : BinaryExpression | |
48 { | |
71 | 49 this(Expression left, Expression right) |
50 { super(left, right, TOK.AndLogical); } | |
70 | 51 } |
52 | |
53 class OrExpression : BinaryExpression | |
54 { | |
71 | 55 this(Expression left, Expression right) |
56 { super(left, right, TOK.OrBinary); } | |
70 | 57 } |
58 | |
59 class XorExpression : BinaryExpression | |
60 { | |
71 | 61 this(Expression left, Expression right) |
62 { super(left, right, TOK.Xor); } | |
70 | 63 } |
64 | |
65 class AndExpression : BinaryExpression | |
66 { | |
71 | 67 this(Expression left, Expression right) |
68 { super(left, right, TOK.AndBinary); } | |
70 | 69 } |
70 | |
71 class CmpExpression : BinaryExpression | |
72 { | |
71 | 73 this(Expression left, Expression right, TOK tok) |
74 { super(left, right, tok); } | |
70 | 75 } |
76 | |
71 | 77 class EqualExpression : CmpExpression |
70 | 78 { |
71 | 79 this(Expression left, Expression right, TOK tok) |
80 { super(left, right, TOK.Equal); } | |
70 | 81 } |
82 | |
71 | 83 class IdentExpression : CmpExpression |
70 | 84 { |
71 | 85 this(Expression left, Expression right, TOK tok) |
86 { super(left, right, tok); } | |
70 | 87 } |
88 | |
71 | 89 class RelExpression : CmpExpression |
70 | 90 { |
71 | 91 this(Expression left, Expression right, TOK tok) |
92 { super(left, right, tok); } | |
70 | 93 } |
94 | |
95 class InExpression : BinaryExpression | |
96 { | |
71 | 97 this(Expression left, Expression right, TOK tok) |
98 { super(left, right, TOK.In); } | |
70 | 99 } |
100 | |
75 | 101 class LShiftExpression : BinaryExpression |
102 { | |
103 this(Expression left, Expression right) | |
104 { super(left, right, TOK.LShiftAssign); } | |
105 } | |
106 | |
107 class RShiftExpression : BinaryExpression | |
108 { | |
109 this(Expression left, Expression right) | |
110 { super(left, right, TOK.RShiftAssign); } | |
111 } | |
112 | |
113 class URShiftExpression : BinaryExpression | |
114 { | |
115 this(Expression left, Expression right) | |
116 { super(left, right, TOK.URShiftAssign); } | |
117 } | |
118 | |
76 | 119 class PlusExpression : BinaryExpression |
70 | 120 { |
76 | 121 this(Expression left, Expression right) |
122 { super(left, right, TOK.Plus); } | |
123 } | |
124 | |
125 class MinusExpression : BinaryExpression | |
126 { | |
127 this(Expression left, Expression right) | |
128 { super(left, right, TOK.Minus); } | |
70 | 129 } |
130 | |
131 class MulExpression : BinaryExpression | |
132 { | |
77 | 133 this(Expression left, Expression right) |
134 { super(left, right, TOK.Mul); } | |
135 } | |
136 | |
137 class DivExpression : BinaryExpression | |
138 { | |
139 this(Expression left, Expression right) | |
140 { super(left, right, TOK.Div); } | |
141 } | |
142 | |
143 class ModExpression : BinaryExpression | |
144 { | |
145 this(Expression left, Expression right) | |
146 { super(left, right, TOK.Mod); } | |
70 | 147 } |
148 | |
149 class CatExpression : BinaryExpression | |
150 { | |
76 | 151 this(Expression left, Expression right) |
71 | 152 { super(left, right, TOK.Catenate); } |
153 } | |
70 | 154 |
71 | 155 class AssignExpression : BinaryExpression |
156 { | |
157 this(Expression left, Expression right) | |
158 { super(left, right, TOK.Assign); } | |
159 } | |
160 class LShiftAssignExpression : BinaryExpression | |
161 { | |
162 this(Expression left, Expression right) | |
163 { super(left, right, TOK.LShiftAssign); } | |
164 } | |
165 class RShiftAssignExpression : BinaryExpression | |
166 { | |
167 this(Expression left, Expression right) | |
168 { super(left, right, TOK.RShiftAssign); } | |
169 } | |
170 class URShiftAssignExpression : BinaryExpression | |
171 { | |
172 this(Expression left, Expression right) | |
173 { super(left, right, TOK.URShiftAssign); } | |
174 } | |
175 class OrAssignExpression : BinaryExpression | |
176 { | |
177 this(Expression left, Expression right) | |
178 { super(left, right, TOK.OrAssign); } | |
179 } | |
180 class AndAssignExpression : BinaryExpression | |
181 { | |
182 this(Expression left, Expression right) | |
183 { super(left, right, TOK.AndAssign); } | |
184 } | |
185 class PlusAssignExpression : BinaryExpression | |
186 { | |
187 this(Expression left, Expression right) | |
188 { super(left, right, TOK.PlusAssign); } | |
189 } | |
190 class MinusAssignExpression : BinaryExpression | |
191 { | |
192 this(Expression left, Expression right) | |
193 { super(left, right, TOK.MinusAssign); } | |
194 } | |
195 class DivAssignExpression : BinaryExpression | |
196 { | |
197 this(Expression left, Expression right) | |
198 { super(left, right, TOK.DivAssign); } | |
199 } | |
200 class MulAssignExpression : BinaryExpression | |
201 { | |
202 this(Expression left, Expression right) | |
203 { super(left, right, TOK.MulAssign); } | |
204 } | |
205 class ModAssignExpression : BinaryExpression | |
206 { | |
207 this(Expression left, Expression right) | |
208 { super(left, right, TOK.ModAssign); } | |
209 } | |
210 class XorAssignExpression : BinaryExpression | |
211 { | |
212 this(Expression left, Expression right) | |
213 { super(left, right, TOK.XorAssign); } | |
214 } | |
215 class CatAssignExpression : BinaryExpression | |
216 { | |
217 this(Expression left, Expression right) | |
218 { super(left, right, TOK.CatAssign); } | |
70 | 219 } |
220 | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
221 class UnaryExpression : Expression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
222 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
223 Expression e; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
224 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
225 { this.e = e; } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
226 } |
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 class AddressExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
229 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
230 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
231 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
232 } |
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 class PreIncrExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
237 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
238 } |
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 class PreDecrExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
243 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
244 } |
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 class DerefExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
249 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
250 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
251 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
252 class SignExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
253 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
254 TOK sign; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
255 this(Expression e, TOK sign) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
256 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
257 super(e); |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
258 this.sign = sign; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
259 } |
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 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
262 class NotExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
265 { super(e); } |
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 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
268 class CompExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
271 { super(e); } |
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 |
70 | 274 class PostfixExpression : UnaryExpression |
275 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
276 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
277 { super(e); } |
70 | 278 } |
279 | |
280 class DotExpression : UnaryExpression | |
281 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
282 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
283 { super(e); } |
70 | 284 } |
285 | |
286 class NewExpression : UnaryExpression | |
287 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
288 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
289 { super(e); } |
70 | 290 } |
291 | |
292 class DeleteExpression : UnaryExpression | |
293 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
294 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
295 { super(e); } |
70 | 296 } |
297 | |
298 class CastExpression : UnaryExpression | |
299 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
300 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
301 { super(e); } |
70 | 302 } |
303 | |
304 class AnonClassExpression : UnaryExpression | |
305 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
306 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
307 { super(e); } |
70 | 308 } |
309 | |
310 class PrimaryExpression | |
311 { | |
312 | |
313 } | |
314 | |
315 class IndexExpression | |
316 { | |
317 | |
318 } | |
319 | |
320 class SliceExpression | |
321 { | |
322 | |
323 } | |
324 | |
325 class AssertExpression | |
326 { | |
327 | |
328 } | |
329 | |
330 class MixinExpression | |
331 { | |
332 | |
333 } | |
334 | |
335 class ImportExpression | |
336 { | |
337 | |
338 } | |
339 | |
340 class TypeIdExpression | |
341 { | |
342 | |
343 } | |
344 | |
74 | 345 class IsExpression : CmpExpression |
70 | 346 { |
74 | 347 this(Expression left, Expression right, TOK tok) |
348 { super(left, right, tok); } | |
70 | 349 } |