Mercurial > projects > dil
annotate trunk/src/dil/Expressions.d @ 376:5ebe80ce84f2
- Separated common code to parseTemplateArguments_().
- Checking for null before adding targs to children member, because pTA() and pTA2() can return null.
author | aziz |
---|---|
date | Sat, 08 Sep 2007 17:24:05 +0000 |
parents | a48a987f7515 |
children | 906599374b69 |
rev | line source |
---|---|
70 | 1 /++ |
2 Author: Aziz Köksal | |
249 | 3 License: GPL3 |
70 | 4 +/ |
326 | 5 module dil.Expressions; |
327 | 6 import dil.SyntaxTree; |
7 import dil.Token; | |
8 import dil.Types; | |
9 import dil.Declarations; | |
10 import dil.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 } | |
312 | 582 |
583 class SpecialTokenExpression : Expression | |
584 { | |
585 Token* special; | |
586 this(Token* special) | |
587 { | |
588 mixin(set_kind); | |
589 this.special = special; | |
590 } | |
591 } | |
592 | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
593 /* |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
594 class IdentifierListExpression : Expression |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
595 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
596 Expression[] identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
597 this(Expression[] identList) |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
598 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
599 this.identList = identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
600 } |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
601 } |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
602 */ |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
603 class DotListExpression : Expression |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
604 { |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
605 Expression[] items; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
606 this(Expression[] items) |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
607 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
608 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
609 this.children = items; |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
610 this.items = items; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
611 } |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
612 } |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
613 |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
614 class TemplateInstanceExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
615 { |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
616 Token* ident; |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
617 TemplateArguments targs; |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
618 this(Token* ident, TemplateArguments targs) |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
619 { |
276
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); |
376 | 621 if (targs) |
622 this.children = [targs]; | |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
623 this.ident = ident; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
624 this.targs = targs; |
84
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 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
627 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
628 class ThisExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
629 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
630 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
|
631 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
632 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
|
633 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
634 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
635 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
636 class SuperExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
637 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
638 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
|
639 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
640 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
|
641 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
642 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
643 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
644 class NullExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
645 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
646 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
|
647 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
648 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
|
649 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
650 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
651 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
652 class DollarExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
653 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
654 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
|
655 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
656 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
|
657 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
658 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
659 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
660 class BoolExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
661 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
662 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
|
663 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
664 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
|
665 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
666 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
667 |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
668 class IntNumberExpression : 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 ulong number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
672 this(TOK type, ulong 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 |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
680 class RealNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
681 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
682 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
683 real number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
684 this(TOK type, real number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
685 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
686 mixin(set_kind); |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
687 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
688 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
689 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
690 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
691 |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
692 class CharLiteralExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
693 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
694 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
|
695 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
696 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
|
697 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
698 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
699 |
157
fdbd47d72614
- Renamed class StringLiteralExpression to StringLiteralsExpression.
aziz
parents:
154
diff
changeset
|
700 class StringLiteralsExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
701 { |
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 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
|
703 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
|
704 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
705 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
|
706 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
|
707 } |
309 | 708 |
709 string getString() | |
710 { | |
711 char[] buffer; | |
712 foreach (strTok; strings) | |
713 { | |
714 buffer ~= strTok.str[0..$-1]; | |
715 } | |
716 return buffer; | |
717 } | |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
718 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
719 |
85 | 720 class ArrayLiteralExpression : Expression |
721 { | |
722 Expression[] values; | |
723 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
|
724 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
725 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
726 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
|
727 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
|
728 } |
85 | 729 } |
730 | |
731 class AssocArrayLiteralExpression : Expression | |
732 { | |
733 Expression[] keys, values; | |
734 this(Expression[] keys, Expression[] values) | |
735 { | |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
736 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
|
737 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
738 foreach (i, key; keys) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
739 this.children ~= [key, values[i]]; |
85 | 740 this.keys = keys; |
741 this.values = values; | |
742 } | |
743 } | |
744 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
745 class AssertExpression : Expression |
70 | 746 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
747 Expression expr, msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
748 this(Expression expr, Expression msg) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
749 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
750 mixin(set_kind); |
299
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
751 this.children = [expr]; |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
752 if (msg) |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
753 this.children ~= msg; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
754 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
755 this.msg = msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
756 } |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
757 } |
70 | 758 |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
759 class MixinExpression : Expression |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
760 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
761 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
762 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
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 = [expr]; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
766 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
767 } |
70 | 768 } |
769 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
770 class ImportExpression : Expression |
70 | 771 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
772 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
773 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
774 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
775 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
776 this.children = [expr]; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
777 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
778 } |
70 | 779 } |
780 | |
101 | 781 class TypeofExpression : Expression |
782 { | |
783 Type type; | |
784 this(Type type) | |
785 { | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
786 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
787 this.children = [type]; |
101 | 788 this.type = type; |
789 } | |
790 } | |
791 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
792 class TypeDotIdExpression : Expression |
70 | 793 { |
94 | 794 Type type; |
243 | 795 Token* ident; |
796 this(Type type, Token* ident) | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
797 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
798 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
799 this.children = [type]; |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
800 this.type = type; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
801 this.ident = ident; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
802 } |
70 | 803 } |
804 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
805 class TypeidExpression : Expression |
70 | 806 { |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
807 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
808 this(Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
809 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
810 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
811 this.children = [type]; |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
812 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
813 } |
70 | 814 } |
815 | |
89 | 816 class IsExpression : Expression |
70 | 817 { |
100 | 818 Type type; |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
252
diff
changeset
|
819 Token* ident; |
248 | 820 Token* opTok, specTok; |
821 Type specType; | |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
252
diff
changeset
|
822 this(Type type, Token* ident, Token* opTok, Token* specTok, Type specType) |
100 | 823 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
824 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
825 this.children = [type]; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
826 if (specType) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
827 this.children ~= specType; |
100 | 828 this.type = type; |
829 this.ident = ident; | |
248 | 830 this.opTok = opTok; |
831 this.specTok = specTok; | |
100 | 832 this.specType = specType; |
833 } | |
70 | 834 } |
130 | 835 |
836 class FunctionLiteralExpression : Expression | |
837 { | |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
838 Type returnType; |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
839 Parameters parameters; |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
840 FunctionBody funcBody; |
133
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
841 |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
842 this() |
130 | 843 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
844 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
845 if (returnType) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
846 this.children ~= returnType; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
847 if (parameters) |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
848 this.children ~= parameters; |
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
849 this.children ~= funcBody; |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
850 } |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
851 |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
852 this(Type returnType, Parameters parameters, FunctionBody funcBody) |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
853 { |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
854 this.returnType = returnType; |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
855 this.parameters = parameters; |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
856 this.funcBody = funcBody; |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
857 this(); |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
858 } |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
859 |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
860 this(FunctionBody funcBody) |
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
861 { |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
862 this.funcBody = funcBody; |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
863 this(); |
130 | 864 } |
865 } | |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
866 |
269 | 867 version(D2) |
868 { | |
869 class TraitsExpression : Expression | |
870 { | |
871 Token* ident; | |
872 TemplateArguments targs; | |
873 this(typeof(ident) ident, typeof(targs) targs) | |
874 { | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
875 mixin(set_kind); |
376 | 876 if (targs) |
877 this.children = [targs]; | |
269 | 878 this.ident = ident; |
289
a99357783c6f
- Fix: assign targs to member targs of TraitsExpression.
aziz
parents:
288
diff
changeset
|
879 this.targs = targs; |
269 | 880 } |
881 } | |
882 } | |
883 | |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
884 class VoidInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
885 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
886 this() |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
887 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
888 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
|
889 } |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
890 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
891 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
892 class ArrayInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
893 { |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
894 Expression[] keys; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
895 Expression[] values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
896 this(Expression[] keys, Expression[] values) |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
897 { |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
898 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
|
899 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
900 foreach (i, key; keys) |
299
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
901 { |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
902 if (key) |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
903 this.children ~= key; |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
904 if (values[i]) |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
905 this.children ~= values[i]; |
559d5d62e0c1
- Added checks for null before adding member to Node.children.
aziz
parents:
293
diff
changeset
|
906 } |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
907 this.keys = keys; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
908 this.values = values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
909 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
910 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
911 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
912 class StructInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
913 { |
263 | 914 Token*[] idents; |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
915 Expression[] values; |
263 | 916 this(Token*[] idents, Expression[] values) |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
917 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
918 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
919 this.children = values; |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
920 this.idents = idents; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
921 this.values = values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
922 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
923 } |
287
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
924 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
925 class AsmTypeExpression : UnaryExpression |
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 this(Expression e) |
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 super(e); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
930 mixin(set_kind); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
931 } |
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 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
934 class AsmOffsetExpression : UnaryExpression |
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 this(Expression e) |
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 super(e); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
939 mixin(set_kind); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
940 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
941 } |
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 class AsmSegExpression : UnaryExpression |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
944 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
945 this(Expression 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 super(e); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
948 mixin(set_kind); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
949 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
950 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
951 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
952 class AsmPostBracketExpression : UnaryExpression |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
953 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
954 this(Expression e) |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
955 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
956 super(e); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
957 mixin(set_kind); |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
958 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
959 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
960 |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
961 class AsmBracketExpression : Expression |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
962 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
963 Expression e; |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
964 this(Expression e) |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
965 { |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
966 mixin(set_kind); |
293
418c6548ce17
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
289
diff
changeset
|
967 this.children = [e]; |
287
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
968 this.e = e; |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
969 } |
211bdd69397d
- Added classes AsmTypeExpression, AsmOffsetExpression, AsmSegExpression, AsmPostBracketExpression and AsmBracketExpression.
aziz
parents:
286
diff
changeset
|
970 } |
288
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
971 |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
972 class AsmLocalSizeExpression : Expression |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
973 { |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
974 this() |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
975 { |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
976 mixin(set_kind); |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
977 } |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
978 } |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
979 |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
980 class AsmRegisterExpression : Expression |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
981 { |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
982 Token* register; |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
983 Token* number; // ST(0) - ST(7) |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
984 this(Token* register, Token* number = null) |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
985 { |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
986 mixin(set_kind); |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
987 this.register = register; |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
988 this.number = number; |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
989 } |
833b301497f4
- Added classes AsmLocalSizeExpression and AsmRegisterExpression.
aziz
parents:
287
diff
changeset
|
990 } |