Mercurial > projects > dil
annotate trunk/src/Expressions.d @ 305:df237b3b5f09
- Added class Declarations.
- Changed many methods to return Declarations instead of Declaration[]. Changed members of classes accordingly.
author | aziz |
---|---|
date | Tue, 14 Aug 2007 12:18:01 +0000 |
parents | 559d5d62e0c1 |
children | b4d842b0d2c7 |
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 |
277
38a68e534a3b
- Made classes Declaration, Expression and Statement abstract.
aziz
parents:
276
diff
changeset
|
12 abstract 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 { |
275 | 16 super(NodeCategory.Expression); |
240
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 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
22 this() |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
23 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
24 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
25 } |
136
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
26 } |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
27 |
286
0c1a2eba0c91
- Made classes BinaryExpression, CmpExpression and UnaryExpression abstract. Removed mixin(set_kind) from their constructors.
aziz
parents:
277
diff
changeset
|
28 abstract class BinaryExpression : Expression |
70 | 29 { |
71 | 30 Expression left, right; |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
31 Token* tok; |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
32 this(Expression left, Expression right, Token* tok) |
71 | 33 { |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
34 this.children = [left, right]; |
71 | 35 this.left = left; |
36 this.right = right; | |
37 this.tok = tok; | |
38 } | |
70 | 39 } |
40 | |
72 | 41 class CondExpression : BinaryExpression |
70 | 42 { |
72 | 43 Expression condition; |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
44 this(Expression condition, Expression left, Expression right, Token* tok) |
72 | 45 { |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
46 super(left, right, tok); |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
47 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
48 this.children ~= [condition]; |
72 | 49 this.condition = condition; |
50 } | |
51 } | |
70 | 52 |
72 | 53 class CommaExpression : 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) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
56 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
57 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
58 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
59 } |
70 | 60 } |
61 | |
62 class OrOrExpression : BinaryExpression | |
63 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
64 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
65 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
66 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
67 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
68 } |
70 | 69 } |
70 | |
71 class AndAndExpression : 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) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
74 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
75 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
76 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
77 } |
70 | 78 } |
79 | |
80 class OrExpression : BinaryExpression | |
81 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
82 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
83 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
84 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
85 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
86 } |
70 | 87 } |
88 | |
89 class XorExpression : BinaryExpression | |
90 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
91 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
92 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
93 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
94 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
95 } |
70 | 96 } |
97 | |
98 class AndExpression : BinaryExpression | |
99 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
100 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
101 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
102 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
103 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
104 } |
70 | 105 } |
106 | |
286
0c1a2eba0c91
- Made classes BinaryExpression, CmpExpression and UnaryExpression abstract. Removed mixin(set_kind) from their constructors.
aziz
parents:
277
diff
changeset
|
107 abstract class CmpExpression : BinaryExpression |
70 | 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) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
110 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
111 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
112 } |
70 | 113 } |
114 | |
71 | 115 class EqualExpression : CmpExpression |
70 | 116 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
117 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
118 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
119 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
120 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
121 } |
70 | 122 } |
123 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
124 class IdentityExpression : CmpExpression |
70 | 125 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
126 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
127 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
128 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
129 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
130 } |
70 | 131 } |
132 | |
71 | 133 class RelExpression : CmpExpression |
70 | 134 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
135 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
136 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
137 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
138 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
139 } |
70 | 140 } |
141 | |
142 class InExpression : BinaryExpression | |
143 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
144 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
145 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
146 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
147 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
148 } |
70 | 149 } |
150 | |
75 | 151 class LShiftExpression : BinaryExpression |
152 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
153 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
154 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
155 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
156 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
157 } |
75 | 158 } |
159 | |
160 class RShiftExpression : BinaryExpression | |
161 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
162 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
163 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
164 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
165 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
166 } |
75 | 167 } |
168 | |
169 class URShiftExpression : BinaryExpression | |
170 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
171 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
172 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
173 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
174 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
175 } |
75 | 176 } |
177 | |
76 | 178 class PlusExpression : BinaryExpression |
70 | 179 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
180 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
181 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
182 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
183 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
184 } |
76 | 185 } |
186 | |
187 class MinusExpression : BinaryExpression | |
188 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
189 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
190 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
191 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
192 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
193 } |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
194 } |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
195 |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
196 class CatExpression : BinaryExpression |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
197 { |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
198 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
199 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
200 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
201 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
202 } |
70 | 203 } |
204 | |
205 class MulExpression : BinaryExpression | |
206 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
207 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
208 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
209 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
210 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
211 } |
77 | 212 } |
213 | |
214 class DivExpression : BinaryExpression | |
215 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
216 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
217 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
218 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
219 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
220 } |
77 | 221 } |
222 | |
223 class ModExpression : BinaryExpression | |
224 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
225 this(Expression left, Expression right, Token* tok) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
226 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
227 super(left, right, tok); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
228 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
229 } |
71 | 230 } |
70 | 231 |
71 | 232 class AssignExpression : BinaryExpression |
233 { | |
234 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
235 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
236 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
237 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
238 } |
71 | 239 } |
240 class LShiftAssignExpression : BinaryExpression | |
241 { | |
242 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
243 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
244 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
245 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
246 } |
71 | 247 } |
248 class RShiftAssignExpression : BinaryExpression | |
249 { | |
250 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
251 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
252 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
253 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
254 } |
71 | 255 } |
256 class URShiftAssignExpression : BinaryExpression | |
257 { | |
258 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
259 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
260 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
261 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
262 } |
71 | 263 } |
264 class OrAssignExpression : BinaryExpression | |
265 { | |
266 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
267 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
268 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
269 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
270 } |
71 | 271 } |
272 class AndAssignExpression : BinaryExpression | |
273 { | |
274 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
275 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
276 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
277 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
278 } |
71 | 279 } |
280 class PlusAssignExpression : BinaryExpression | |
281 { | |
282 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
283 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
284 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
285 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
286 } |
71 | 287 } |
288 class MinusAssignExpression : BinaryExpression | |
289 { | |
290 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
291 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
292 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
293 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
294 } |
71 | 295 } |
296 class DivAssignExpression : BinaryExpression | |
297 { | |
298 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
299 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
300 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
301 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
302 } |
71 | 303 } |
304 class MulAssignExpression : BinaryExpression | |
305 { | |
306 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
307 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
308 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
309 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
310 } |
71 | 311 } |
312 class ModAssignExpression : BinaryExpression | |
313 { | |
314 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
315 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
316 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
317 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
318 } |
71 | 319 } |
320 class XorAssignExpression : BinaryExpression | |
321 { | |
322 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
323 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
324 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
325 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
326 } |
71 | 327 } |
328 class CatAssignExpression : BinaryExpression | |
329 { | |
330 this(Expression left, Expression right) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
331 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
332 super(left, right, null); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
333 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
334 } |
70 | 335 } |
336 | |
286
0c1a2eba0c91
- Made classes BinaryExpression, CmpExpression and UnaryExpression abstract. Removed mixin(set_kind) from their constructors.
aziz
parents:
277
diff
changeset
|
337 abstract class UnaryExpression : Expression |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
338 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
339 Expression e; |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
340 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
341 { |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
342 this.children ~= e; |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
343 this.e = e; |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
344 } |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
345 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
346 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
347 class AddressExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
348 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
349 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
350 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
351 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
352 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
353 } |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
354 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
355 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
356 class PreIncrExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
357 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
358 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
359 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
360 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
361 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
362 } |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
363 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
364 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
365 class PreDecrExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
366 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
367 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
368 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
369 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
370 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
371 } |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
372 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
373 |
79
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
374 class PostIncrExpression : UnaryExpression |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
375 { |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
376 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
377 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
378 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
379 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
380 } |
79
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
381 } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
382 |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
383 class PostDecrExpression : UnaryExpression |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
384 { |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
385 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
386 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
387 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
388 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
389 } |
79
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
390 } |
df4e5c7ad58a
- Implemented most of parsePostExpression() and parsePreExpression().
aziz
parents:
78
diff
changeset
|
391 |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
392 class DerefExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
393 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
394 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
395 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
396 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
397 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
398 } |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
399 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
400 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
401 class SignExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
402 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
403 this(Expression e) |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
404 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
405 super(e); |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
406 mixin(set_kind); |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
407 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
408 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
409 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
410 class NotExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
411 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
412 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
413 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
414 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
415 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
416 } |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
417 } |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
418 |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
419 class CompExpression : UnaryExpression |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
420 { |
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
421 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
422 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
423 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
424 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
425 } |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
426 } |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
427 /+ |
81 | 428 class DotIdExpression : UnaryExpression |
70 | 429 { |
108 | 430 string ident; |
431 this(Expression e, string ident) | |
432 { | |
433 super(e); | |
434 this.ident = ident; | |
435 } | |
70 | 436 } |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
437 +/ |
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
438 /+ |
153 | 439 class DotTemplateInstanceExpression : UnaryExpression |
440 { | |
441 string ident; | |
442 TemplateArguments targs; | |
443 this(Expression e, string ident, TemplateArguments targs) | |
444 { | |
445 super(e); | |
446 this.ident = ident; | |
447 this.targs = targs; | |
448 } | |
449 } | |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
450 +/ |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
451 class PostDotListExpression : UnaryExpression |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
452 { |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
453 DotListExpression dotList; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
454 this(Expression e, DotListExpression dotList) |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
455 { |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
456 super(e); |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
457 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
458 this.children ~= [dotList]; |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
459 this.dotList = dotList; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
460 } |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
461 } |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
462 |
81 | 463 class CallExpression : UnaryExpression |
464 { | |
465 Expression[] args; | |
466 this(Expression e, Expression[] args) | |
467 { | |
468 super(e); | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
469 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
470 this.children ~= args; |
81 | 471 this.args = args; |
472 } | |
473 } | |
474 | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
475 class NewExpression : /*Unary*/Expression |
70 | 476 { |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
477 Expression[] newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
478 Type type; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
479 Expression[] ctorArgs; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
480 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
|
481 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
482 /*super(e);*/ |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
483 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
484 if (newArgs.length) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
485 this.children ~= newArgs; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
486 this.children ~= type; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
487 if (ctorArgs.length) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
488 this.children ~= ctorArgs; |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
489 this.newArgs = newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
490 this.type = type; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
491 this.ctorArgs = ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
492 } |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
493 } |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
494 |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
495 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
|
496 { |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
497 Expression[] newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
498 BaseClass[] bases; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
499 Expression[] ctorArgs; |
305 | 500 Declarations decls; |
501 this(/*Expression e, */Expression[] newArgs, BaseClass[] bases, Expression[] ctorArgs, Declarations decls) | |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
502 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
503 /*super(e);*/ |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
504 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
505 if (newArgs.length) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
506 this.children ~= newArgs; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
507 if (bases.length) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
508 this.children ~= bases; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
509 if (ctorArgs.length) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
510 this.children ~= ctorArgs; |
305 | 511 this.children ~= decls; |
512 | |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
513 this.newArgs = newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
514 this.bases = bases; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
515 this.ctorArgs = ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
516 this.decls = decls; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
517 } |
70 | 518 } |
519 | |
520 class DeleteExpression : UnaryExpression | |
521 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
522 this(Expression e) |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
523 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
524 super(e); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
525 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
526 } |
70 | 527 } |
528 | |
529 class CastExpression : UnaryExpression | |
530 { | |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
531 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
532 this(Expression e, Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
533 { |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
534 this.children = [type]; |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
535 super(e); |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
536 mixin(set_kind); |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
537 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
538 } |
70 | 539 } |
540 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
541 class IndexExpression : UnaryExpression |
70 | 542 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
543 Expression[] args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
544 this(Expression e, Expression[] args) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
545 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
546 super(e); |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
547 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
548 this.children ~= args; |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
549 this.args = args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
550 } |
70 | 551 } |
552 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
553 class SliceExpression : UnaryExpression |
70 | 554 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
555 Expression left, right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
556 this(Expression e, Expression left, Expression right) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
557 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
558 super(e); |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
559 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
560 this.children ~= [left, right]; |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
561 this.left = left; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
562 this.right = right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
563 } |
70 | 564 } |
565 | |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
566 /* |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
567 class PrimaryExpression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
568 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
569 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
570 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
571 */ |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
572 |
89 | 573 class IdentifierExpression : Expression |
574 { | |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
575 Token* identifier; |
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
576 this(Token* identifier) |
89 | 577 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
578 mixin(set_kind); |
89 | 579 this.identifier = identifier; |
580 } | |
581 } | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
582 /* |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
583 class IdentifierListExpression : Expression |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
584 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
585 Expression[] identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
586 this(Expression[] identList) |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
587 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
588 this.identList = identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
589 } |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
590 } |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
591 */ |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
592 class DotListExpression : Expression |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
593 { |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
594 Expression[] items; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
595 this(Expression[] items) |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
596 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
597 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
598 this.children = items; |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
599 this.items = items; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
600 } |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
601 } |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
602 |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
603 class TemplateInstanceExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
604 { |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
605 Token* ident; |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
606 TemplateArguments targs; |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
607 this(Token* ident, TemplateArguments targs) |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
608 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
609 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
610 this.children = [targs]; |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
611 this.ident = ident; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
612 this.targs = targs; |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
613 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
614 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
615 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
616 class ThisExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
617 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
618 this() |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
619 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
620 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
621 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
622 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
623 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
624 class SuperExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
625 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
626 this() |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
627 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
628 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
629 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
630 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
631 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
632 class NullExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
633 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
634 this() |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
635 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
636 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
637 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
638 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
639 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
640 class DollarExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
641 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
642 this() |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
643 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
644 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
645 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
646 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
647 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
648 class BoolExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
649 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
650 this() |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
651 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
652 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
653 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
654 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
655 |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
656 class IntNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
657 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
658 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
659 ulong number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
660 this(TOK type, ulong number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
661 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
662 mixin(set_kind); |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
663 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
664 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
665 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
666 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
667 |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
668 class RealNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
669 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
670 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
671 real number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
672 this(TOK type, real number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
673 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
674 mixin(set_kind); |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
675 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
676 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
677 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
678 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
679 |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
680 class CharLiteralExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
681 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
682 this() |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
683 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
684 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
685 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
686 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
687 |
157
fdbd47d72614
- Renamed class StringLiteralExpression to StringLiteralsExpression.
aziz
parents:
154
diff
changeset
|
688 class StringLiteralsExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
689 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
690 Token*[] strings; |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
691 this(Token*[] strings) |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
692 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
693 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
694 this.strings = strings; |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
695 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
696 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
697 |
85 | 698 class ArrayLiteralExpression : Expression |
699 { | |
700 Expression[] values; | |
701 this(Expression[] values) | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
702 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
703 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
704 this.children = values; |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
705 this.values = values; |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
706 } |
85 | 707 } |
708 | |
709 class AssocArrayLiteralExpression : Expression | |
710 { | |
711 Expression[] keys, values; | |
712 this(Expression[] keys, Expression[] values) | |
713 { | |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
714 assert(keys.length == values.length); |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
715 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
716 foreach (i, key; keys) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
717 this.children ~= [key, values[i]]; |
85 | 718 this.keys = keys; |
719 this.values = values; | |
720 } | |
721 } | |
722 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
723 class AssertExpression : Expression |
70 | 724 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
725 Expression expr, msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
726 this(Expression expr, Expression msg) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
727 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
728 mixin(set_kind); |
299
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
729 this.children = [expr]; |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
730 if (msg) |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
731 this.children ~= msg; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
732 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
733 this.msg = msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
734 } |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
735 } |
70 | 736 |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
737 class MixinExpression : Expression |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
738 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
739 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
740 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
741 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
742 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
743 this.children = [expr]; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
744 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
745 } |
70 | 746 } |
747 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
748 class ImportExpression : Expression |
70 | 749 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
750 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
751 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
752 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
753 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
754 this.children = [expr]; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
755 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
756 } |
70 | 757 } |
758 | |
101 | 759 class TypeofExpression : Expression |
760 { | |
761 Type type; | |
762 this(Type type) | |
763 { | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
764 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
765 this.children = [type]; |
101 | 766 this.type = type; |
767 } | |
768 } | |
769 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
770 class TypeDotIdExpression : Expression |
70 | 771 { |
94 | 772 Type type; |
243 | 773 Token* ident; |
774 this(Type type, Token* ident) | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
775 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
776 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
777 this.children = [type]; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
778 this.type = type; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
779 this.ident = ident; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
780 } |
70 | 781 } |
782 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
783 class TypeidExpression : Expression |
70 | 784 { |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
785 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
786 this(Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
787 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
788 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
789 this.children = [type]; |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
790 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
791 } |
70 | 792 } |
793 | |
89 | 794 class IsExpression : Expression |
70 | 795 { |
100 | 796 Type type; |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
252
diff
changeset
|
797 Token* ident; |
248 | 798 Token* opTok, specTok; |
799 Type specType; | |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
252
diff
changeset
|
800 this(Type type, Token* ident, Token* opTok, Token* specTok, Type specType) |
100 | 801 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
802 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
803 this.children = [type]; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
804 if (specType) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
805 this.children ~= specType; |
100 | 806 this.type = type; |
807 this.ident = ident; | |
248 | 808 this.opTok = opTok; |
809 this.specTok = specTok; | |
100 | 810 this.specType = specType; |
811 } | |
70 | 812 } |
130 | 813 |
814 class FunctionLiteralExpression : Expression | |
815 { | |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
816 Type returnType; |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
817 Parameters parameters; |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
818 FunctionBody funcBody; |
133
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
819 |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
820 this() |
130 | 821 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
822 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
823 if (returnType) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
824 this.children ~= returnType; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
825 if (parameters) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
826 this.children ~= parameters; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
827 this.children ~= funcBody; |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
828 } |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
829 |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
830 this(Type returnType, Parameters parameters, FunctionBody funcBody) |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
831 { |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
832 this.returnType = returnType; |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
833 this.parameters = parameters; |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
834 this.funcBody = funcBody; |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
835 this(); |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
836 } |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
837 |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
838 this(FunctionBody funcBody) |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
839 { |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
840 this.funcBody = funcBody; |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
841 this(); |
130 | 842 } |
843 } | |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
844 |
269 | 845 version(D2) |
846 { | |
847 class TraitsExpression : Expression | |
848 { | |
849 Token* ident; | |
850 TemplateArguments targs; | |
851 this(typeof(ident) ident, typeof(targs) targs) | |
852 { | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
853 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
854 this.children = [targs]; |
269 | 855 this.ident = ident; |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
856 this.targs = targs; |
269 | 857 } |
858 } | |
859 } | |
860 | |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
861 class VoidInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
862 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
863 this() |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
864 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
865 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
866 } |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
867 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
868 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
869 class ArrayInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
870 { |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
871 Expression[] keys; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
872 Expression[] values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
873 this(Expression[] keys, Expression[] values) |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
874 { |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
875 assert(keys.length == values.length); |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
876 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
877 foreach (i, key; keys) |
299
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
878 { |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
879 if (key) |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
880 this.children ~= key; |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
881 if (values[i]) |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
882 this.children ~= values[i]; |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
883 } |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
884 this.keys = keys; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
885 this.values = values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
886 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
887 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
888 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
889 class StructInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
890 { |
263 | 891 Token*[] idents; |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
892 Expression[] values; |
263 | 893 this(Token*[] idents, Expression[] values) |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
894 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
895 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
896 this.children = values; |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
897 this.idents = idents; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
898 this.values = values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
899 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
900 } |
287
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
901 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
902 class AsmTypeExpression : UnaryExpression |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
903 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
904 this(Expression e) |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
905 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
906 super(e); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
907 mixin(set_kind); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
908 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
909 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
910 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
911 class AsmOffsetExpression : UnaryExpression |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
912 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
913 this(Expression e) |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
914 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
915 super(e); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
916 mixin(set_kind); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
917 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
918 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
919 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
920 class AsmSegExpression : UnaryExpression |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
921 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
922 this(Expression e) |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
923 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
924 super(e); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
925 mixin(set_kind); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
926 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
927 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
928 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
929 class AsmPostBracketExpression : UnaryExpression |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
930 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
931 this(Expression e) |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
932 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
933 super(e); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
934 mixin(set_kind); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
935 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
936 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
937 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
938 class AsmBracketExpression : Expression |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
939 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
940 Expression e; |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
941 this(Expression e) |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
942 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
943 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
944 this.children = [e]; |
287
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
945 this.e = e; |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
946 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
947 } |
288
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
948 |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
949 class AsmLocalSizeExpression : Expression |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
950 { |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
951 this() |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
952 { |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
953 mixin(set_kind); |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
954 } |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
955 } |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
956 |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
957 class AsmRegisterExpression : Expression |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
958 { |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
959 Token* register; |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
960 Token* number; // ST(0) - ST(7) |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
961 this(Token* register, Token* number = null) |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
962 { |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
963 mixin(set_kind); |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
964 this.register = register; |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
965 this.number = number; |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
966 } |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
967 } |