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