Mercurial > projects > dil
annotate trunk/src/Expressions.d @ 251:67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
author | aziz |
---|---|
date | Wed, 01 Aug 2007 16:08:02 +0000 |
parents | 32d354584b28 |
children | 788398655d24 |
rev | line source |
---|---|
70 | 1 /++ |
2 Author: Aziz Köksal | |
249 | 3 License: GPL3 |
70 | 4 +/ |
5 module Expressions; | |
240
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
6 import SyntaxTree; |
71 | 7 import Token; |
94 | 8 import Types; |
130 | 9 import Declarations; |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
10 import Statements; |
70 | 11 |
240
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
12 class Expression : Node |
70 | 13 { |
240
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
14 this() |
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
15 { |
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
16 super(NodeType.Expression); |
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
17 } |
70 | 18 } |
19 | |
136
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
20 class EmptyExpression : Expression |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
21 { |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
22 |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
23 } |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
24 |
70 | 25 class BinaryExpression : Expression |
26 { | |
71 | 27 Expression left, right; |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
28 Token* tok; |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
29 this(Expression left, Expression right, Token* tok) |
71 | 30 { |
31 this.left = left; | |
32 this.right = right; | |
33 this.tok = tok; | |
34 } | |
70 | 35 } |
36 | |
72 | 37 class CondExpression : BinaryExpression |
70 | 38 { |
72 | 39 Expression condition; |
40 this(Expression condition, Expression left, Expression right) | |
41 { | |
42 this.condition = condition; | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
43 super(left, right, null); |
72 | 44 } |
45 } | |
70 | 46 |
72 | 47 class CommaExpression : BinaryExpression |
48 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
49 this(Expression left, Expression right, Token* tok) |
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
50 { super(left, right, tok); } |
70 | 51 } |
52 | |
53 class OrOrExpression : BinaryExpression | |
54 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
55 this(Expression left, Expression right, Token* tok) |
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
56 { super(left, right, tok); } |
70 | 57 } |
58 | |
59 class AndAndExpression : BinaryExpression | |
60 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
61 this(Expression left, Expression right, Token* tok) |
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
62 { super(left, right, tok); } |
70 | 63 } |
64 | |
65 class OrExpression : BinaryExpression | |
66 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
67 this(Expression left, Expression right, Token* tok) |
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
68 { super(left, right, tok); } |
70 | 69 } |
70 | |
71 class XorExpression : BinaryExpression | |
72 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
73 this(Expression left, Expression right, Token* tok) |
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
74 { super(left, right, tok); } |
70 | 75 } |
76 | |
77 class AndExpression : BinaryExpression | |
78 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
79 this(Expression left, Expression right, Token* tok) |
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
80 { super(left, right, tok); } |
70 | 81 } |
82 | |
83 class CmpExpression : BinaryExpression | |
84 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
85 this(Expression left, Expression right, Token* tok) |
71 | 86 { super(left, right, tok); } |
70 | 87 } |
88 | |
71 | 89 class EqualExpression : CmpExpression |
70 | 90 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
91 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
92 { super(left, right, tok); } |
70 | 93 } |
94 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
95 class IdentityExpression : CmpExpression |
70 | 96 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
97 this(Expression left, Expression right, Token* tok) |
71 | 98 { super(left, right, tok); } |
70 | 99 } |
100 | |
71 | 101 class RelExpression : CmpExpression |
70 | 102 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
103 this(Expression left, Expression right, Token* tok) |
71 | 104 { super(left, right, tok); } |
70 | 105 } |
106 | |
107 class InExpression : BinaryExpression | |
108 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
109 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
110 { super(left, right, tok); } |
70 | 111 } |
112 | |
75 | 113 class LShiftExpression : BinaryExpression |
114 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
115 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
116 { super(left, right, tok); } |
75 | 117 } |
118 | |
119 class RShiftExpression : BinaryExpression | |
120 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
121 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
122 { super(left, right, tok); } |
75 | 123 } |
124 | |
125 class URShiftExpression : BinaryExpression | |
126 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
127 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
128 { super(left, right, tok); } |
75 | 129 } |
130 | |
76 | 131 class PlusExpression : BinaryExpression |
70 | 132 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
133 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
134 { super(left, right, tok); } |
76 | 135 } |
136 | |
137 class MinusExpression : BinaryExpression | |
138 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
139 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
140 { super(left, right, tok); } |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
141 } |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
142 |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
143 class CatExpression : BinaryExpression |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
144 { |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
145 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
146 { super(left, right, tok); } |
70 | 147 } |
148 | |
149 class MulExpression : BinaryExpression | |
150 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
151 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
152 { super(left, right, tok); } |
77 | 153 } |
154 | |
155 class DivExpression : BinaryExpression | |
156 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
157 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
158 { super(left, right, tok); } |
77 | 159 } |
160 | |
161 class ModExpression : BinaryExpression | |
162 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
163 this(Expression left, Expression right, Token* tok) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
164 { super(left, right, tok); } |
71 | 165 } |
70 | 166 |
71 | 167 class AssignExpression : BinaryExpression |
168 { | |
169 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
170 { super(left, right, null); } |
71 | 171 } |
172 class LShiftAssignExpression : BinaryExpression | |
173 { | |
174 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
175 { super(left, right, null); } |
71 | 176 } |
177 class RShiftAssignExpression : BinaryExpression | |
178 { | |
179 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
180 { super(left, right, null); } |
71 | 181 } |
182 class URShiftAssignExpression : BinaryExpression | |
183 { | |
184 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
185 { super(left, right, null); } |
71 | 186 } |
187 class OrAssignExpression : BinaryExpression | |
188 { | |
189 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
190 { super(left, right, null); } |
71 | 191 } |
192 class AndAssignExpression : BinaryExpression | |
193 { | |
194 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
195 { super(left, right, null); } |
71 | 196 } |
197 class PlusAssignExpression : BinaryExpression | |
198 { | |
199 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
200 { super(left, right, null); } |
71 | 201 } |
202 class MinusAssignExpression : BinaryExpression | |
203 { | |
204 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
205 { super(left, right, null); } |
71 | 206 } |
207 class DivAssignExpression : BinaryExpression | |
208 { | |
209 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
210 { super(left, right, null); } |
71 | 211 } |
212 class MulAssignExpression : BinaryExpression | |
213 { | |
214 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
215 { super(left, right, null); } |
71 | 216 } |
217 class ModAssignExpression : BinaryExpression | |
218 { | |
219 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
220 { super(left, right, null); } |
71 | 221 } |
222 class XorAssignExpression : BinaryExpression | |
223 { | |
224 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
225 { super(left, right, null); } |
71 | 226 } |
227 class CatAssignExpression : BinaryExpression | |
228 { | |
229 this(Expression left, Expression right) | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
230 { super(left, right, null); } |
70 | 231 } |
232 | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
233 class UnaryExpression : Expression |
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 Expression e; |
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 { this.e = 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 AddressExpression : 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 PreIncrExpression : 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 PreDecrExpression : 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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
255 { super(e); } |
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 |
79
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
258 class PostIncrExpression : UnaryExpression |
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 this(Expression e) |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
261 { super(e); } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
262 } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
263 |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
264 class PostDecrExpression : UnaryExpression |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
265 { |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
266 this(Expression e) |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
267 { super(e); } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
268 } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
269 |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
270 class DerefExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
273 { super(e); } |
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 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
276 class SignExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
277 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
278 this(Expression e) |
78
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 super(e); |
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 } |
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 class NotExpression : UnaryExpression |
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 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
287 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
288 } |
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 class CompExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
291 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
292 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
293 { super(e); } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
294 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
295 |
81 | 296 class DotIdExpression : UnaryExpression |
70 | 297 { |
108 | 298 string ident; |
299 this(Expression e, string ident) | |
300 { | |
301 super(e); | |
302 this.ident = ident; | |
303 } | |
70 | 304 } |
305 | |
153 | 306 class DotTemplateInstanceExpression : UnaryExpression |
307 { | |
308 string ident; | |
309 TemplateArguments targs; | |
310 this(Expression e, string ident, TemplateArguments targs) | |
311 { | |
312 super(e); | |
313 this.ident = ident; | |
314 this.targs = targs; | |
315 } | |
316 } | |
317 | |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
318 class PostDotListExpression : UnaryExpression |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
319 { |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
320 DotListExpression dotList; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
321 this(Expression e, DotListExpression dotList) |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
322 { |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
323 super(e); |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
324 this.dotList = dotList; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
325 } |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
326 } |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
327 |
81 | 328 class CallExpression : UnaryExpression |
329 { | |
330 Expression[] args; | |
331 this(Expression e, Expression[] args) | |
332 { | |
333 super(e); | |
334 this.args = args; | |
335 } | |
336 } | |
337 | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
338 class NewExpression : /*Unary*/Expression |
70 | 339 { |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
340 Expression[] newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
341 Type type; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
342 Expression[] ctorArgs; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
343 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
|
344 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
345 /*super(e);*/ |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
346 this.newArgs = newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
347 this.type = type; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
348 this.ctorArgs = ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
349 } |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
350 } |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
351 |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
352 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
|
353 { |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
354 Expression[] newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
355 BaseClass[] bases; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
356 Expression[] ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
357 Declaration[] decls; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
358 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
|
359 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
360 /*super(e);*/ |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
361 this.newArgs = newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
362 this.bases = bases; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
363 this.ctorArgs = ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
364 this.decls = decls; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
365 } |
70 | 366 } |
367 | |
368 class DeleteExpression : UnaryExpression | |
369 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
370 this(Expression e) |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
371 { super(e); } |
70 | 372 } |
373 | |
374 class CastExpression : UnaryExpression | |
375 { | |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
376 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
377 this(Expression e, Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
378 { |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
379 super(e); |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
380 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
381 } |
70 | 382 } |
383 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
384 class IndexExpression : UnaryExpression |
70 | 385 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
386 Expression[] args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
387 this(Expression e, Expression[] args) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
388 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
389 super(e); |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
390 this.args = args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
391 } |
70 | 392 } |
393 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
394 class SliceExpression : UnaryExpression |
70 | 395 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
396 Expression left, right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
397 this(Expression e, Expression left, Expression right) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
398 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
399 super(e); |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
400 this.left = left; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
401 this.right = right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
402 } |
70 | 403 } |
404 | |
84
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 class PrimaryExpression |
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 } |
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 |
89 | 412 class IdentifierExpression : Expression |
413 { | |
414 string identifier; | |
415 this(string identifier) | |
416 { | |
417 this.identifier = identifier; | |
418 } | |
419 } | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
420 /* |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
421 class IdentifierListExpression : Expression |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
422 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
423 Expression[] identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
424 this(Expression[] 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 this.identList = identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
427 } |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
428 } |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
429 */ |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
430 class DotListExpression : Expression |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
431 { |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
432 Expression[] items; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
433 this(Expression[] items) |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
434 { |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
435 this.items = items; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
436 } |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
437 } |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
438 |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
439 class TemplateInstanceExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
440 { |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
441 string ident; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
442 TemplateArguments targs; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
443 this(string ident, TemplateArguments targs) |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
444 { |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
445 this.ident = ident; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
446 this.targs = targs; |
84
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 } |
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 class ThisExpression : Expression |
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 this() |
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 } |
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 class SuperExpression : Expression |
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 this() |
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 } |
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 class NullExpression : Expression |
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 this() |
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 } |
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 class DollarExpression : Expression |
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 this() |
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 } |
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 class BoolExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
475 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
476 this() |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
477 {} |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
478 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
479 |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
480 class IntNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
481 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
482 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
483 ulong number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
484 this(TOK type, ulong number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
485 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
486 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
487 this.type = type; |
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 |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
491 class RealNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
492 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
493 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
494 real number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
495 this(TOK type, real number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
496 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
497 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
498 this.type = type; |
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 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
501 |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
502 class CharLiteralExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
503 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
504 this() |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
505 {} |
84
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; |
243 | 572 Token* ident; |
573 this(Type type, Token* 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; | |
248 | 593 Token* opTok, specTok; |
594 Type specType; | |
595 this(Type type, string ident, Token* opTok, Token* specTok, Type specType) | |
100 | 596 { |
597 this.type = type; | |
598 this.ident = ident; | |
248 | 599 this.opTok = opTok; |
600 this.specTok = specTok; | |
100 | 601 this.specType = specType; |
602 } | |
70 | 603 } |
130 | 604 |
605 class FunctionLiteralExpression : Expression | |
606 { | |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
607 FunctionType funcType; |
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
608 FunctionBody funcBody; |
133
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
609 TOK funcTok; |
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
610 |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
611 this(FunctionType funcType, FunctionBody funcBody, TOK funcTok = TOK.Invalid) |
130 | 612 { |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
613 this.funcType = funcType; |
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
614 this.funcBody = funcBody; |
133
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
615 this.funcTok = funcTok; |
130 | 616 } |
617 } | |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
618 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
619 class VoidInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
620 { |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
621 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
622 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
623 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
624 class ArrayInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
625 { |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
626 Expression[] keys; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
627 Expression[] values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
628 this(Expression[] keys, Expression[] values) |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
629 { |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
630 this.keys = keys; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
631 this.values = values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
632 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
633 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
634 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
635 class StructInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
636 { |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
637 string[] idents; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
638 Expression[] values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
639 this(string[] idents, Expression[] values) |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
640 { |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
641 this.idents = idents; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
642 this.values = values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
643 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
644 } |