Mercurial > projects > dil
annotate trunk/src/Expressions.d @ 277:38a68e534a3b
- Made classes Declaration, Expression and Statement abstract.
- Added declarations to enum NodeKind.
- Added mixin(set_kind) statement to every constructor that inherits from Declaration.
author | aziz |
---|---|
date | Mon, 06 Aug 2007 15:15:01 +0000 |
parents | d6b2f7616ca5 |
children | 0c1a2eba0c91 |
rev | line source |
---|---|
70 | 1 /++ |
2 Author: Aziz Köksal | |
249 | 3 License: GPL3 |
70 | 4 +/ |
5 module Expressions; | |
240
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
6 import SyntaxTree; |
71 | 7 import Token; |
94 | 8 import Types; |
130 | 9 import Declarations; |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
10 import Statements; |
70 | 11 |
277
38a68e534a3b
- Made classes Declaration, Expression and Statement abstract.
aziz
parents:
276
diff
changeset
|
12 abstract class Expression : Node |
70 | 13 { |
240
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
14 this() |
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
15 { |
275 | 16 super(NodeCategory.Expression); |
240
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
198
diff
changeset
|
17 } |
70 | 18 } |
19 | |
136
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
20 class EmptyExpression : Expression |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
21 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
22 this() |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
23 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
24 mixin(set_kind); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
25 } |
136
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
26 } |
96468715ea79
- Returning EmptyExpression in parsePrimaryExpression() when no token matched.
aziz
parents:
133
diff
changeset
|
27 |
70 | 28 class BinaryExpression : Expression |
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 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
34 mixin(set_kind); |
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; |
44 this(Expression condition, Expression left, Expression right) | |
45 { | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
46 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
|
47 mixin(set_kind); |
72 | 48 this.condition = condition; |
49 } | |
50 } | |
70 | 51 |
72 | 52 class CommaExpression : BinaryExpression |
53 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
54 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
|
55 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
56 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
|
57 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
|
58 } |
70 | 59 } |
60 | |
61 class OrOrExpression : BinaryExpression | |
62 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
63 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
|
64 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
65 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
|
66 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
|
67 } |
70 | 68 } |
69 | |
70 class AndAndExpression : BinaryExpression | |
71 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
72 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
|
73 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
74 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
|
75 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
|
76 } |
70 | 77 } |
78 | |
79 class OrExpression : BinaryExpression | |
80 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
81 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
|
82 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
83 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
|
84 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
|
85 } |
70 | 86 } |
87 | |
88 class XorExpression : BinaryExpression | |
89 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
90 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
|
91 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
92 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
|
93 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
|
94 } |
70 | 95 } |
96 | |
97 class AndExpression : BinaryExpression | |
98 { | |
251
67a798459532
- Added parameter Token* tok to some Expression constructors. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
99 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
|
100 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
101 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
|
102 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
|
103 } |
70 | 104 } |
105 | |
106 class CmpExpression : BinaryExpression | |
107 { | |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
108 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
|
109 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
110 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
|
111 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
|
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 | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
337 class UnaryExpression : Expression |
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 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
342 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
|
343 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
|
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); |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
458 this.dotList = dotList; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
459 } |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
460 } |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
461 |
81 | 462 class CallExpression : UnaryExpression |
463 { | |
464 Expression[] args; | |
465 this(Expression e, Expression[] args) | |
466 { | |
467 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
|
468 mixin(set_kind); |
81 | 469 this.args = args; |
470 } | |
471 } | |
472 | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
473 class NewExpression : /*Unary*/Expression |
70 | 474 { |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
475 Expression[] newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
476 Type type; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
477 Expression[] ctorArgs; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
478 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
|
479 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
480 /*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
|
481 mixin(set_kind); |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
482 this.newArgs = newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
483 this.type = type; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
484 this.ctorArgs = ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
485 } |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
486 } |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
487 |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
488 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
|
489 { |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
490 Expression[] newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
491 BaseClass[] bases; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
492 Expression[] ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
493 Declaration[] decls; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
494 this(/*Expression e, */Expression[] newArgs, BaseClass[] bases, Expression[] ctorArgs, Declaration[] decls) |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
495 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
496 /*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
|
497 mixin(set_kind); |
144
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
498 this.newArgs = newArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
499 this.bases = bases; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
500 this.ctorArgs = ctorArgs; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
501 this.decls = decls; |
cfd890b250e6
- Added bool parameter to parseBaseClasses. BaseClasses in anonymous classes don't start with a colon.
aziz
parents:
136
diff
changeset
|
502 } |
70 | 503 } |
504 | |
505 class DeleteExpression : UnaryExpression | |
506 { | |
78
f043759fb59a
- Added code to parseUnaryExpression(); not fully implemented.
aziz
parents:
77
diff
changeset
|
507 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
|
508 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
509 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
|
510 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
|
511 } |
70 | 512 } |
513 | |
514 class CastExpression : UnaryExpression | |
515 { | |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
516 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
517 this(Expression e, Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
518 { |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
519 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
|
520 mixin(set_kind); |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
521 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
522 } |
70 | 523 } |
524 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
525 class IndexExpression : UnaryExpression |
70 | 526 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
527 Expression[] args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
528 this(Expression e, Expression[] args) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
529 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
530 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
|
531 mixin(set_kind); |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
532 this.args = args; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
533 } |
70 | 534 } |
535 | |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
536 class SliceExpression : UnaryExpression |
70 | 537 { |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
538 Expression left, right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
539 this(Expression e, Expression left, Expression right) |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
540 { |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
541 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
|
542 mixin(set_kind); |
83
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
543 this.left = left; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
544 this.right = right; |
9e6d66f647c9
- Fix: IsExpression was created instead of IdentityExpression.
aziz
parents:
81
diff
changeset
|
545 } |
70 | 546 } |
547 | |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
548 /* |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
549 class PrimaryExpression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
550 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
551 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
552 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
553 */ |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
554 |
89 | 555 class IdentifierExpression : Expression |
556 { | |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
557 Token* identifier; |
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
558 this(Token* identifier) |
89 | 559 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
560 mixin(set_kind); |
89 | 561 this.identifier = identifier; |
562 } | |
563 } | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
564 /* |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
565 class IdentifierListExpression : Expression |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
566 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
567 Expression[] identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
568 this(Expression[] identList) |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
569 { |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
570 this.identList = identList; |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
571 } |
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
572 } |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
573 */ |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
574 class DotListExpression : Expression |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
575 { |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
576 Expression[] items; |
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
577 this(Expression[] items) |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
578 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
579 mixin(set_kind); |
160
c21192e8be2b
- Parsing PostDotListExpression in parsePostExpression().
aziz
parents:
157
diff
changeset
|
580 this.items = items; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
581 } |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
582 } |
152
fe2e36eb4b45
- Added method parseIdentifierListExpression() and class IdentifierListExpression.
aziz
parents:
150
diff
changeset
|
583 |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
584 class TemplateInstanceExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
585 { |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
586 Token* ident; |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
587 TemplateArguments targs; |
252
788398655d24
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
251
diff
changeset
|
588 this(Token* ident, TemplateArguments targs) |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
589 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
590 mixin(set_kind); |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
591 this.ident = ident; |
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
144
diff
changeset
|
592 this.targs = targs; |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
593 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
594 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
595 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
596 class ThisExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
597 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
598 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
|
599 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
600 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
|
601 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
602 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
603 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
604 class SuperExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
605 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
606 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
|
607 { |
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); |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
609 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
610 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
611 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
612 class NullExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
613 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
614 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
|
615 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
616 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
|
617 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
618 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
619 |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
620 class DollarExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
621 { |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
622 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
|
623 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
624 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
|
625 } |
84
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 BoolExpression : Expression |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
629 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
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 |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
636 class IntNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
637 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
638 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
639 ulong number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
640 this(TOK type, ulong number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
641 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
642 mixin(set_kind); |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
643 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
644 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
645 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
646 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
647 |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
648 class RealNumberExpression : Expression |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
649 { |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
650 TOK type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
651 real number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
652 this(TOK type, real number) |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
653 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
654 mixin(set_kind); |
97
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
655 this.number = number; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
656 this.type = type; |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
657 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
658 } |
1a83e5070a84
- Added code for parsing IntNumber- and RealNumberExpressions.
aziz
parents:
94
diff
changeset
|
659 |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
660 class CharLiteralExpression : 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 |
157
fdbd47d72614
- Renamed class StringLiteralExpression to StringLiteralsExpression.
aziz
parents:
154
diff
changeset
|
668 class StringLiteralsExpression : Expression |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
669 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
670 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
|
671 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
|
672 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
673 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
|
674 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
|
675 } |
84
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
676 } |
ac8d961d10d1
- Added code for parsing This-,Super-,Null-,Bool-,Dollar-,CharLiteral- and StringLiteralExpression.
aziz
parents:
83
diff
changeset
|
677 |
85 | 678 class ArrayLiteralExpression : Expression |
679 { | |
680 Expression[] values; | |
681 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
|
682 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
683 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
|
684 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
|
685 } |
85 | 686 } |
687 | |
688 class AssocArrayLiteralExpression : Expression | |
689 { | |
690 Expression[] keys, values; | |
691 this(Expression[] keys, Expression[] values) | |
692 { | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
693 mixin(set_kind); |
85 | 694 this.keys = keys; |
695 this.values = values; | |
696 } | |
697 } | |
698 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
699 class AssertExpression : Expression |
70 | 700 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
701 Expression expr, msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
702 this(Expression expr, Expression msg) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
703 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
704 mixin(set_kind); |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
705 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
706 this.msg = msg; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
707 } |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
708 } |
70 | 709 |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
710 class MixinExpression : Expression |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
711 { |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
712 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
713 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
714 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
715 mixin(set_kind); |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
716 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
717 } |
70 | 718 } |
719 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
720 class ImportExpression : Expression |
70 | 721 { |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
722 Expression expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
723 this(Expression expr) |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
724 { |
276
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); |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
726 this.expr = expr; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
727 } |
70 | 728 } |
729 | |
101 | 730 class TypeofExpression : Expression |
731 { | |
732 Type type; | |
733 this(Type type) | |
734 { | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
735 mixin(set_kind); |
101 | 736 this.type = type; |
737 } | |
738 } | |
739 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
740 class TypeDotIdExpression : Expression |
70 | 741 { |
94 | 742 Type type; |
243 | 743 Token* ident; |
744 this(Type type, Token* ident) | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
745 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
746 mixin(set_kind); |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
747 this.type = type; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
748 this.ident = ident; |
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
749 } |
70 | 750 } |
751 | |
86
0459c902a370
- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents:
85
diff
changeset
|
752 class TypeidExpression : Expression |
70 | 753 { |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
754 Type type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
755 this(Type type) |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
756 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
757 mixin(set_kind); |
99
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
758 this.type = type; |
6b8c248f5911
- Added member type to classes CastExpression and TypeidExpression.
aziz
parents:
97
diff
changeset
|
759 } |
70 | 760 } |
761 | |
89 | 762 class IsExpression : Expression |
70 | 763 { |
100 | 764 Type type; |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
252
diff
changeset
|
765 Token* ident; |
248 | 766 Token* opTok, specTok; |
767 Type specType; | |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
252
diff
changeset
|
768 this(Type type, Token* ident, Token* opTok, Token* specTok, Type specType) |
100 | 769 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
770 mixin(set_kind); |
100 | 771 this.type = type; |
772 this.ident = ident; | |
248 | 773 this.opTok = opTok; |
774 this.specTok = specTok; | |
100 | 775 this.specType = specType; |
776 } | |
70 | 777 } |
130 | 778 |
779 class FunctionLiteralExpression : Expression | |
780 { | |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
781 FunctionType funcType; |
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
782 FunctionBody funcBody; |
133
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
783 TOK funcTok; |
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
784 |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
785 this(FunctionType funcType, FunctionBody funcBody, TOK funcTok = TOK.Invalid) |
130 | 786 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
787 mixin(set_kind); |
193
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
788 this.funcType = funcType; |
2a2975b6d539
- Using parseFunctionBody() when parsing FunctionLiteralExpression.
aziz
parents:
160
diff
changeset
|
789 this.funcBody = funcBody; |
133
3924b1ee1302
- Added code for parsing function and delegate literal expressions.
aziz
parents:
130
diff
changeset
|
790 this.funcTok = funcTok; |
130 | 791 } |
792 } | |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
793 |
269 | 794 version(D2) |
795 { | |
796 class TraitsExpression : Expression | |
797 { | |
798 Token* ident; | |
799 TemplateArguments targs; | |
800 this(typeof(ident) ident, typeof(targs) targs) | |
801 { | |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
802 mixin(set_kind); |
269 | 803 this.ident = ident; |
804 } | |
805 } | |
806 } | |
807 | |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
808 class VoidInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
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 this() |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
811 { |
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
812 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
|
813 } |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
814 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
815 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
816 class ArrayInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
817 { |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
818 Expression[] keys; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
819 Expression[] values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
820 this(Expression[] keys, Expression[] values) |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
821 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
822 mixin(set_kind); |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
823 this.keys = keys; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
824 this.values = values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
825 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
826 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
827 |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
828 class StructInitializer : Expression |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
829 { |
263 | 830 Token*[] idents; |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
831 Expression[] values; |
263 | 832 this(Token*[] idents, Expression[] values) |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
833 { |
276
d6b2f7616ca5
- Added enum NodeKind to classify different nodes in the AST. Correspondingly added member 'kind' to class Node.
aziz
parents:
275
diff
changeset
|
834 mixin(set_kind); |
198
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
835 this.idents = idents; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
836 this.values = values; |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
837 } |
88c1777a9e51
- Implemented parseInitializer() and parseNonVoidInitializer().
aziz
parents:
193
diff
changeset
|
838 } |