Mercurial > projects > dil
annotate trunk/src/dil/Types.d @ 495:b60450804b6e
Attributes are evaluated during the parsing phase now.
Renamed parseDeclarationDefinitionsBlock to parseDeclarationDefinitionsBody.
Renamed parseDeclaration to parseVariableOrFunction.
Removed class Linkage, renamed parseLinkage to parseLinkageType and modified
it so that it returns a value from enum LinkageType.
Fix in parseStorageAttribute(): class invariants are recognized now.
Modified parseAlignAttribute() so that returns an uint - the alignment size.
Removed classes AttributeStatement and ExternStatement. Using Declarations
instead in parseAttributeStatement().
Added LinkageType to module Enums. Added StorageClassDeclaration and renamed
ExternDeclaration to LinkageDeclaration.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 08 Dec 2007 22:20:34 +0100 |
parents | 9c208925a3d4 |
children | 3bb94ba21490 |
rev | line source |
---|---|
94 | 1 /++ |
2 Author: Aziz Köksal | |
249 | 3 License: GPL3 |
94 | 4 +/ |
326 | 5 module dil.Types; |
327 | 6 import dil.SyntaxTree; |
7 import dil.Token; | |
8 import dil.Expressions; | |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
9 import dil.Enums; |
94 | 10 |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
11 class Parameter : Node |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
12 { |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
13 StorageClass stc; |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
14 Token* stcTok; |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
15 Type type; |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
16 Token* ident; |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
17 Expression assignExpr; |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
18 |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
19 this(Token* stcTok, Type type, Token* ident, Expression assignExpr) |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
20 { |
275 | 21 super(NodeCategory.Other); |
281 | 22 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
23 // type can be null when param in foreach statement |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
24 addOptChild(type); |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
25 addOptChild(assignExpr); |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
26 |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
27 StorageClass stc; |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
28 if (stcTok !is null) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
29 { |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
30 // NB: In D 2.0 StorageClass.In means final/scope/const |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
31 switch (stcTok.type) |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
32 { |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
33 // TODO: D 2.0 invariant/const/final/scope |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
34 case TOK.In: stc = StorageClass.In; break; |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
35 case TOK.Out: stc = StorageClass.Out; break; |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
36 case TOK.Inout: |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
37 case TOK.Ref: stc = StorageClass.Ref; break; |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
38 case TOK.Lazy: stc = StorageClass.Lazy; break; |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
39 case TOK.Ellipses: |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
40 stc = StorageClass.Variadic; |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
41 default: |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
42 } |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
43 } |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
44 |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
45 this.stc = stc; |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
46 this.stcTok = stcTok; |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
47 this.type = type; |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
48 this.ident = ident; |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
49 this.assignExpr = assignExpr; |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
50 } |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
51 |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
52 bool isVariadic() |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
53 { |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
54 return !!(stc & StorageClass.Variadic); |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
55 } |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
56 |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
57 bool isOnlyVariadic() |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
58 { |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
59 return stc == StorageClass.Variadic; |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
60 } |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
61 } |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
62 |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
63 class Parameters : Node |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
64 { |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
65 this() |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
66 { |
275 | 67 super(NodeCategory.Other); |
281 | 68 mixin(set_kind); |
242
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
69 } |
7ec7ad8df9da
- Changed type of member tok in class BinaryExpression to Token*.
aziz
parents:
240
diff
changeset
|
70 |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
71 bool hasVariadic() |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
72 { |
295
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
73 if (children.length != 0) |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
74 return items[$-1].isVariadic(); |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
75 return false; |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
76 } |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
77 |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
78 void opCatAssign(Parameter param) |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
79 { addChild(param); } |
295
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
80 |
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
81 Parameter[] items() |
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
82 { return cast(Parameter[])children; } |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
83 |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
84 size_t length() |
295
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
85 { return children.length; } |
117
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
86 } |
79857de26e86
- Moved class Parameter to module Types. Added struct Parameters.
aziz
parents:
106
diff
changeset
|
87 |
281 | 88 class BaseClass : Node |
158
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
89 { |
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
90 Protection prot; |
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
91 Type type; |
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
92 this(Protection prot, Type type) |
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
93 { |
281 | 94 super(NodeCategory.Other); |
95 mixin(set_kind); | |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
96 addChild(type); |
158
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
97 this.prot = prot; |
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
98 this.type = type; |
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
99 } |
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
100 } |
759f437313f9
- Moved enum Protection and class BaseClass to module Types.
aziz
parents:
154
diff
changeset
|
101 |
340
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
102 abstract class TemplateParameter : Node |
137 | 103 { |
340
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
104 this() |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
105 { |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
106 super(NodeCategory.Other); |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
107 } |
137 | 108 } |
109 | |
340
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
110 class TemplateAliasParameter : TemplateParameter |
137 | 111 { |
253
4279b638c63e
- Changed some string types to Token*. Adapted parser accordingly.
aziz
parents:
249
diff
changeset
|
112 Token* ident; |
137 | 113 Type specType, defType; |
340
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
114 this(Token* ident, Type specType, Type defType) |
137 | 115 { |
281 | 116 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
117 addOptChild(specType); |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
118 addOptChild(defType); |
340
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
119 this.ident = ident; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
120 this.specType = specType; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
121 this.defType = defType; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
122 } |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
123 } |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
124 |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
125 class TemplateTypeParameter : TemplateParameter |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
126 { |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
127 Token* ident; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
128 Type specType, defType; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
129 this(Token* ident, Type specType, Type defType) |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
130 { |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
131 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
132 addOptChild(specType); |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
133 addOptChild(defType); |
340
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
134 this.ident = ident; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
135 this.specType = specType; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
136 this.defType = defType; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
137 } |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
138 } |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
139 |
492
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
140 version(D2) |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
141 { |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
142 class TemplateThisParameter : TemplateParameter |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
143 { |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
144 Token* ident; |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
145 Type specType, defType; |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
146 this(Token* ident, Type specType, Type defType) |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
147 { |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
148 mixin(set_kind); |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
149 addOptChild(specType); |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
150 addOptChild(defType); |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
151 this.ident = ident; |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
152 this.specType = specType; |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
153 this.defType = defType; |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
154 } |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
155 } |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
156 } |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
157 |
340
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
158 class TemplateValueParameter : TemplateParameter |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
159 { |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
160 Type valueType; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
161 Token* ident; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
162 Expression specValue, defValue; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
163 this(Type valueType, Token* ident, Expression specValue, Expression defValue) |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
164 { |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
165 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
166 addChild(valueType); |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
167 addOptChild(specValue); |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
168 addOptChild(defValue); |
137 | 169 this.valueType = valueType; |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
137
diff
changeset
|
170 this.ident = ident; |
137 | 171 this.specValue = specValue; |
172 this.defValue = defValue; | |
173 } | |
174 } | |
175 | |
340
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
176 class TemplateTupleParameter : TemplateParameter |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
177 { |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
178 Token* ident; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
179 this(Token* ident) |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
180 { |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
181 mixin(set_kind); |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
182 this.ident = ident; |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
183 } |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
184 } |
1accb3013bd2
- Changed class TemplateParameter to an abstract class.
aziz
parents:
327
diff
changeset
|
185 |
258 | 186 class TemplateParameters : Node |
187 { | |
188 this() | |
189 { | |
275 | 190 super(NodeCategory.Other); |
281 | 191 mixin(set_kind); |
258 | 192 } |
193 | |
194 void opCatAssign(TemplateParameter parameter) | |
195 { | |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
196 addChild(parameter); |
295
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
197 } |
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
198 |
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
199 TemplateParameter[] items() |
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
200 { |
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
201 return cast(TemplateParameter[])children; |
258 | 202 } |
203 } | |
204 | |
254
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
205 class TemplateArguments : Node |
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
206 { |
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
207 this() |
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
208 { |
275 | 209 super(NodeCategory.Other); |
281 | 210 mixin(set_kind); |
254
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
211 } |
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
212 |
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
213 void opCatAssign(Node argument) |
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
214 { |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
215 addChild(argument); |
254
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
216 } |
eb6e3f1fbfee
- Removed typedef and created a proper TemplateArguments class.
aziz
parents:
253
diff
changeset
|
217 } |
150
753bc07bf3a0
- Forgot to pass ident to constructor of TemplateArgument.
aziz
parents:
137
diff
changeset
|
218 |
135 | 219 enum TID |
220 { | |
221 Void = TOK.Void, | |
222 Char = TOK.Char, | |
223 Wchar = TOK.Wchar, | |
224 Dchar = TOK.Dchar, | |
225 Bool = TOK.Bool, | |
226 Byte = TOK.Byte, | |
227 Ubyte = TOK.Ubyte, | |
228 Short = TOK.Short, | |
229 Ushort = TOK.Ushort, | |
230 Int = TOK.Int, | |
231 Uint = TOK.Uint, | |
232 Long = TOK.Long, | |
233 Ulong = TOK.Ulong, | |
234 Float = TOK.Float, | |
235 Double = TOK.Double, | |
236 Real = TOK.Real, | |
237 Ifloat = TOK.Ifloat, | |
238 Idouble = TOK.Idouble, | |
239 Ireal = TOK.Ireal, | |
240 Cfloat = TOK.Cfloat, | |
241 Cdouble = TOK.Cdouble, | |
242 Creal = TOK.Creal, | |
243 | |
244 Undefined, | |
245 Function, | |
246 Delegate, | |
247 Pointer, | |
409
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
248 CFuncPointer, |
135 | 249 Array, |
488
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
250 Dot, |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
251 DotList, |
135 | 252 Identifier, |
253 Typeof, | |
153 | 254 TemplateInstance, |
269 | 255 Const, // D2 |
256 Invariant, // D2 | |
135 | 257 } |
258 | |
280 | 259 abstract class Type : Node |
94 | 260 { |
135 | 261 TID tid; |
95 | 262 Type next; |
263 | |
135 | 264 this(TID tid) |
240
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
196
diff
changeset
|
265 { |
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
196
diff
changeset
|
266 this(tid, null); |
deab661906ae
- Classes Declaration, Expression, Statement and Type inherit from Node now.
aziz
parents:
196
diff
changeset
|
267 } |
135 | 268 |
269 this(TID tid, Type next) | |
94 | 270 { |
275 | 271 super(NodeCategory.Type); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
272 addOptChild(next); |
135 | 273 this.tid = tid; |
95 | 274 this.next = next; |
94 | 275 } |
276 } | |
277 | |
280 | 278 class IntegralType : Type |
279 { | |
280 this(TOK tok) | |
281 { | |
282 super(cast(TID)tok); | |
281 | 283 mixin(set_kind); |
280 | 284 } |
285 } | |
286 | |
134
a31aa0d6dd5e
- Added class UndefinedType. Returning it in parseBasicType() when no token matched the basic type list.
aziz
parents:
130
diff
changeset
|
287 class UndefinedType : Type |
a31aa0d6dd5e
- Added class UndefinedType. Returning it in parseBasicType() when no token matched the basic type list.
aziz
parents:
130
diff
changeset
|
288 { |
a31aa0d6dd5e
- Added class UndefinedType. Returning it in parseBasicType() when no token matched the basic type list.
aziz
parents:
130
diff
changeset
|
289 this() |
a31aa0d6dd5e
- Added class UndefinedType. Returning it in parseBasicType() when no token matched the basic type list.
aziz
parents:
130
diff
changeset
|
290 { |
279 | 291 super(TID.Undefined); |
281 | 292 mixin(set_kind); |
134
a31aa0d6dd5e
- Added class UndefinedType. Returning it in parseBasicType() when no token matched the basic type list.
aziz
parents:
130
diff
changeset
|
293 } |
a31aa0d6dd5e
- Added class UndefinedType. Returning it in parseBasicType() when no token matched the basic type list.
aziz
parents:
130
diff
changeset
|
294 } |
a31aa0d6dd5e
- Added class UndefinedType. Returning it in parseBasicType() when no token matched the basic type list.
aziz
parents:
130
diff
changeset
|
295 |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
296 class DotListType : Type |
153 | 297 { |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
298 Type[] dotList; |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
299 this(Type[] dotList) |
153 | 300 { |
279 | 301 super(TID.DotList); |
281 | 302 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
303 addChildren(dotList); |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
304 this.dotList = dotList; |
153 | 305 } |
306 } | |
307 | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
308 class IdentifierType : Type |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
309 { |
264 | 310 Token* ident; |
311 this(Token* ident) | |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
312 { |
279 | 313 super(TID.Identifier); |
281 | 314 mixin(set_kind); |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
315 this.ident = ident; |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
316 } |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
317 } |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
318 |
488
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
319 class DotType : Type |
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
320 { |
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
321 this() |
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
322 { |
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
323 super(TID.Dot); |
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
324 mixin(set_kind); |
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
325 } |
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
326 } |
cfb3805768b6
Added DotExpression and DotType.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
409
diff
changeset
|
327 |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
328 class TypeofType : Type |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
329 { |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
330 Expression e; |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
331 this(Expression e) |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
332 { |
492
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
333 this(); |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
334 addChild(e); |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
335 this.e = e; |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
336 } |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
337 |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
338 this() |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
339 { |
279 | 340 super(TID.Typeof); |
281 | 341 mixin(set_kind); |
492
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
342 } |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
343 |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
344 bool isTypeofReturn() |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
345 { |
9c208925a3d4
Added module ImportParser and new stuff from DMD2.008.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
489
diff
changeset
|
346 return e is null; |
154
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
347 } |
0e7cefb15e43
- Renamed IdentifierListExpression to DotListExpression, and parseIdentifierListExpression() to parseDotListExpression().
aziz
parents:
153
diff
changeset
|
348 } |
95 | 349 |
153 | 350 class TemplateInstanceType : Type |
351 { | |
264 | 352 Token* ident; |
153 | 353 TemplateArguments targs; |
264 | 354 this(Token* ident, TemplateArguments targs) |
153 | 355 { |
279 | 356 super(TID.TemplateInstance); |
281 | 357 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
358 addOptChild(targs); |
153 | 359 this.ident = ident; |
360 this.targs = targs; | |
361 } | |
362 } | |
363 | |
95 | 364 class PointerType : Type |
365 { | |
366 this(Type t) | |
367 { | |
135 | 368 super(TID.Pointer, t); |
281 | 369 mixin(set_kind); |
95 | 370 } |
371 } | |
372 | |
373 class ArrayType : Type | |
374 { | |
106 | 375 Expression e, e2; |
376 Type assocType; | |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
377 |
106 | 378 this(Type t) |
95 | 379 { |
135 | 380 super(TID.Array, t); |
281 | 381 mixin(set_kind); |
106 | 382 } |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
383 |
106 | 384 this(Type t, Expression e, Expression e2) |
385 { | |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
386 addChild(e); |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
387 addOptChild(e2); |
95 | 388 this.e = e; |
106 | 389 this.e2 = e2; |
295
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
390 this(t); |
106 | 391 } |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
392 |
106 | 393 this(Type t, Type assocType) |
394 { | |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
395 addChild(assocType); |
295
75b47c71a34c
- Assigning to Node.children in several constructors that inherit from Node.
aziz
parents:
291
diff
changeset
|
396 this.assocType = assocType; |
106 | 397 this(t); |
95 | 398 } |
399 } | |
100 | 400 |
130 | 401 class FunctionType : Type |
402 { | |
403 Type returnType; | |
404 Parameters parameters; | |
291
c0e857931ff6
- Changed FunctionType and DelegateType. Both receive return type and parameters.
aziz
parents:
281
diff
changeset
|
405 this(Type returnType, Parameters parameters) |
130 | 406 { |
279 | 407 super(TID.Function); |
281 | 408 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
409 addChild(returnType); |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
410 addChild(parameters); |
130 | 411 this.returnType = returnType; |
412 this.parameters = parameters; | |
413 } | |
414 } | |
135 | 415 |
416 class DelegateType : Type | |
417 { | |
291
c0e857931ff6
- Changed FunctionType and DelegateType. Both receive return type and parameters.
aziz
parents:
281
diff
changeset
|
418 Type returnType; |
c0e857931ff6
- Changed FunctionType and DelegateType. Both receive return type and parameters.
aziz
parents:
281
diff
changeset
|
419 Parameters parameters; |
c0e857931ff6
- Changed FunctionType and DelegateType. Both receive return type and parameters.
aziz
parents:
281
diff
changeset
|
420 this(Type returnType, Parameters parameters) |
135 | 421 { |
291
c0e857931ff6
- Changed FunctionType and DelegateType. Both receive return type and parameters.
aziz
parents:
281
diff
changeset
|
422 super(TID.Delegate); |
281 | 423 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
424 addChild(returnType); |
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
425 addChild(parameters); |
291
c0e857931ff6
- Changed FunctionType and DelegateType. Both receive return type and parameters.
aziz
parents:
281
diff
changeset
|
426 this.returnType = returnType; |
c0e857931ff6
- Changed FunctionType and DelegateType. Both receive return type and parameters.
aziz
parents:
281
diff
changeset
|
427 this.parameters = parameters; |
135 | 428 } |
429 } | |
269 | 430 |
409
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
431 class CFuncPointerType : Type |
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
432 { |
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
433 Parameters params; |
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
434 this(Type type, Parameters params) |
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
435 { |
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
436 super(TID.CFuncPointer, type); |
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
437 mixin(set_kind); |
489
a7291d3ee9d7
Refactored classes that inherit from Node.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
488
diff
changeset
|
438 addOptChild(params); |
409
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
439 } |
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
440 } |
38fccd2640eb
Added code for parsing C function pointer declarations.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
376
diff
changeset
|
441 |
269 | 442 version(D2) |
443 { | |
444 class ConstType : Type | |
445 { | |
446 this(Type t) | |
447 { | |
448 // If t is null: cast(const) | |
449 super(TID.Const, t); | |
281 | 450 mixin(set_kind); |
269 | 451 } |
452 } | |
453 | |
454 class InvariantType : Type | |
455 { | |
456 this(Type t) | |
457 { | |
458 // If t is null: cast(invariant) | |
459 super(TID.Invariant, t); | |
281 | 460 mixin(set_kind); |
269 | 461 } |
462 } | |
463 } // version(D2) |