Mercurial > projects > dil
annotate trunk/src/dil/ast/NodesEnum.d @ 658:a35e6debfb4c
FunctionBody inherits from Statement now.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Tue, 15 Jan 2008 16:49:26 +0100 |
parents | 436e3d270585 |
children | 304331ca2f95 |
rev | line source |
---|---|
635 | 1 /++ |
2 Author: Aziz Köksal | |
3 License: GPL3 | |
4 +/ | |
5 module dil.ast.NodesEnum; | |
6 | |
640
05645f5613c1
Added an error message.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
635
diff
changeset
|
7 enum NodeCategory : ushort |
635 | 8 { |
9 Declaration, | |
10 Statement, | |
11 Expression, | |
12 Type, | |
13 Other | |
14 } | |
15 | |
16 /// Array of class names that inherit from Node. | |
17 static const char[][] classNames = [ | |
18 // Declarations: | |
19 "Declarations", | |
20 "EmptyDeclaration", | |
21 "IllegalDeclaration", | |
22 "ModuleDeclaration", | |
23 "ImportDeclaration", | |
24 "AliasDeclaration", | |
25 "TypedefDeclaration", | |
26 "EnumDeclaration", | |
656
436e3d270585
EnumMember inherits from Declaration now.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
655
diff
changeset
|
27 "EnumMember", |
635 | 28 "ClassDeclaration", |
29 "InterfaceDeclaration", | |
30 "StructDeclaration", | |
31 "UnionDeclaration", | |
32 "ConstructorDeclaration", | |
33 "StaticConstructorDeclaration", | |
34 "DestructorDeclaration", | |
35 "StaticDestructorDeclaration", | |
36 "FunctionDeclaration", | |
37 "VariableDeclaration", | |
38 "InvariantDeclaration", | |
39 "UnittestDeclaration", | |
40 "DebugDeclaration", | |
41 "VersionDeclaration", | |
42 "StaticIfDeclaration", | |
43 "StaticAssertDeclaration", | |
44 "TemplateDeclaration", | |
45 "NewDeclaration", | |
46 "DeleteDeclaration", | |
47 "ProtectionDeclaration", | |
48 "StorageClassDeclaration", | |
49 "LinkageDeclaration", | |
50 "AlignDeclaration", | |
51 "PragmaDeclaration", | |
52 "MixinDeclaration", | |
53 | |
54 // Statements: | |
55 "Statements", | |
56 "IllegalStatement", | |
57 "EmptyStatement", | |
658
a35e6debfb4c
FunctionBody inherits from Statement now.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
656
diff
changeset
|
58 "FunctionBody", |
635 | 59 "ScopeStatement", |
60 "LabeledStatement", | |
61 "ExpressionStatement", | |
62 "DeclarationStatement", | |
63 "IfStatement", | |
64 "WhileStatement", | |
65 "DoWhileStatement", | |
66 "ForStatement", | |
67 "ForeachStatement", | |
68 "ForeachRangeStatement", // D2.0 | |
69 "SwitchStatement", | |
70 "CaseStatement", | |
71 "DefaultStatement", | |
72 "ContinueStatement", | |
73 "BreakStatement", | |
74 "ReturnStatement", | |
75 "GotoStatement", | |
76 "WithStatement", | |
77 "SynchronizedStatement", | |
78 "TryStatement", | |
79 "CatchBody", | |
80 "FinallyBody", | |
81 "ScopeGuardStatement", | |
82 "ThrowStatement", | |
83 "VolatileStatement", | |
84 "AsmStatement", | |
85 "AsmInstruction", | |
86 "AsmAlignStatement", | |
87 "IllegalAsmInstruction", | |
88 "PragmaStatement", | |
89 "MixinStatement", | |
90 "StaticIfStatement", | |
91 "StaticAssertStatement", | |
92 "DebugStatement", | |
93 "VersionStatement", | |
94 | |
95 // Expressions: | |
96 "EmptyExpression", | |
97 "BinaryExpression", | |
98 "CondExpression", | |
99 "CommaExpression", | |
100 "OrOrExpression", | |
101 "AndAndExpression", | |
102 "OrExpression", | |
103 "XorExpression", | |
104 "AndExpression", | |
105 "CmpExpression", | |
106 "EqualExpression", | |
107 "IdentityExpression", | |
108 "RelExpression", | |
109 "InExpression", | |
110 "LShiftExpression", | |
111 "RShiftExpression", | |
112 "URShiftExpression", | |
113 "PlusExpression", | |
114 "MinusExpression", | |
115 "CatExpression", | |
116 "MulExpression", | |
117 "DivExpression", | |
118 "ModExpression", | |
119 "AssignExpression", | |
120 "LShiftAssignExpression", | |
121 "RShiftAssignExpression", | |
122 "URShiftAssignExpression", | |
123 "OrAssignExpression", | |
124 "AndAssignExpression", | |
125 "PlusAssignExpression", | |
126 "MinusAssignExpression", | |
127 "DivAssignExpression", | |
128 "MulAssignExpression", | |
129 "ModAssignExpression", | |
130 "XorAssignExpression", | |
131 "CatAssignExpression", | |
132 "UnaryExpression", | |
133 "AddressExpression", | |
134 "PreIncrExpression", | |
135 "PreDecrExpression", | |
136 "PostIncrExpression", | |
137 "PostDecrExpression", | |
138 "DerefExpression", | |
139 "SignExpression", | |
140 "NotExpression", | |
141 "CompExpression", | |
142 "CallExpression", | |
143 "NewExpression", | |
144 "NewAnonClassExpression", | |
145 "DeleteExpression", | |
146 "CastExpression", | |
147 "IndexExpression", | |
148 "SliceExpression", | |
149 "ModuleScopeExpression", | |
150 "IdentifierExpression", | |
151 "SpecialTokenExpression", | |
152 "DotExpression", | |
153 "TemplateInstanceExpression", | |
154 "ThisExpression", | |
155 "SuperExpression", | |
156 "NullExpression", | |
157 "DollarExpression", | |
158 "BoolExpression", | |
159 "IntExpression", | |
160 "RealExpression", | |
161 "ComplexExpression", | |
162 "CharExpression", | |
163 "StringExpression", | |
164 "ArrayLiteralExpression", | |
165 "AArrayLiteralExpression", | |
166 "AssertExpression", | |
167 "MixinExpression", | |
168 "ImportExpression", | |
169 "TypeofExpression", | |
170 "TypeDotIdExpression", | |
171 "TypeidExpression", | |
172 "IsExpression", | |
646
68953760d569
Added class ParenExpression.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
640
diff
changeset
|
173 "ParenExpression", |
635 | 174 "FunctionLiteralExpression", |
175 "TraitsExpression", // D2.0 | |
176 "VoidInitializer", | |
177 "ArrayInitializer", | |
178 "StructInitializer", | |
179 "AsmTypeExpression", | |
180 "AsmOffsetExpression", | |
181 "AsmSegExpression", | |
182 "AsmPostBracketExpression", | |
183 "AsmBracketExpression", | |
184 "AsmLocalSizeExpression", | |
185 "AsmRegisterExpression", | |
186 | |
187 // Types: | |
188 "UndefinedType", | |
189 "IntegralType", | |
190 "QualifiedType", | |
191 "ModuleScopeType", | |
192 "IdentifierType", | |
193 "TypeofType", | |
194 "TemplateInstanceType", | |
195 "PointerType", | |
196 "ArrayType", | |
197 "FunctionType", | |
198 "DelegateType", | |
199 "CFuncPointerType", | |
655
0acc43b86bf2
Moved class BaseClass to dil.ast.Types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
650
diff
changeset
|
200 "BaseClass", |
635 | 201 "ConstType", // D2.0 |
202 "InvariantType", // D2.0 | |
203 | |
204 // Other: | |
205 "Parameter", | |
206 "Parameters", | |
207 "TemplateAliasParameter", | |
208 "TemplateTypeParameter", | |
209 "TemplateThisParameter", // D2.0 | |
210 "TemplateValueParameter", | |
211 "TemplateTupleParameter", | |
212 "TemplateParameters", | |
213 "TemplateArguments", | |
214 ]; | |
215 | |
216 char[] generateNodeKindMembers() | |
217 { | |
218 char[] text; | |
219 foreach (className; classNames) | |
220 text ~= className ~ ","; | |
221 return text; | |
222 } | |
223 // pragma(msg, generateNodeKindMembers()); | |
224 | |
225 // enum NodeKind; | |
226 mixin( | |
640
05645f5613c1
Added an error message.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
635
diff
changeset
|
227 "enum NodeKind : ushort" |
635 | 228 "{" |
229 ~ generateNodeKindMembers ~ | |
230 "}" | |
231 ); |