Mercurial > projects > dil
annotate trunk/src/dil/ast/NodesEnum.d @ 680:6b3e397229c5
Renamed Statements, Declarations and EnumMember.
Statements -> CompoundStatement.
Declarations -> CompoundDeclaration.
EnumMember -> EnumMemberDeclaration.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Fri, 18 Jan 2008 23:59:41 +0100 |
parents | 64fec49651cf |
children | 95a3c28c0f64 |
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 { |
670
d8c32113afde
Added command 'translate'.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
668
diff
changeset
|
9 Undefined, |
635 | 10 Declaration, |
11 Statement, | |
12 Expression, | |
13 Type, | |
14 Other | |
15 } | |
16 | |
17 /// Array of class names that inherit from Node. | |
18 static const char[][] classNames = [ | |
19 // Declarations: | |
680
6b3e397229c5
Renamed Statements, Declarations and EnumMember.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
673
diff
changeset
|
20 "CompoundDeclaration", |
635 | 21 "EmptyDeclaration", |
22 "IllegalDeclaration", | |
23 "ModuleDeclaration", | |
24 "ImportDeclaration", | |
25 "AliasDeclaration", | |
26 "TypedefDeclaration", | |
27 "EnumDeclaration", | |
680
6b3e397229c5
Renamed Statements, Declarations and EnumMember.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
673
diff
changeset
|
28 "EnumMemberDeclaration", |
635 | 29 "ClassDeclaration", |
30 "InterfaceDeclaration", | |
31 "StructDeclaration", | |
32 "UnionDeclaration", | |
33 "ConstructorDeclaration", | |
34 "StaticConstructorDeclaration", | |
35 "DestructorDeclaration", | |
36 "StaticDestructorDeclaration", | |
37 "FunctionDeclaration", | |
673
64fec49651cf
Renamed VariableDeclaration to VariablesDeclaration.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
671
diff
changeset
|
38 "VariablesDeclaration", |
635 | 39 "InvariantDeclaration", |
40 "UnittestDeclaration", | |
41 "DebugDeclaration", | |
42 "VersionDeclaration", | |
43 "StaticIfDeclaration", | |
44 "StaticAssertDeclaration", | |
45 "TemplateDeclaration", | |
46 "NewDeclaration", | |
47 "DeleteDeclaration", | |
48 "ProtectionDeclaration", | |
49 "StorageClassDeclaration", | |
50 "LinkageDeclaration", | |
51 "AlignDeclaration", | |
52 "PragmaDeclaration", | |
53 "MixinDeclaration", | |
54 | |
55 // Statements: | |
680
6b3e397229c5
Renamed Statements, Declarations and EnumMember.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
673
diff
changeset
|
56 "CompoundStatement", |
635 | 57 "IllegalStatement", |
58 "EmptyStatement", | |
658
a35e6debfb4c
FunctionBody inherits from Statement now.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
656
diff
changeset
|
59 "FunctionBody", |
635 | 60 "ScopeStatement", |
61 "LabeledStatement", | |
62 "ExpressionStatement", | |
63 "DeclarationStatement", | |
64 "IfStatement", | |
65 "WhileStatement", | |
66 "DoWhileStatement", | |
67 "ForStatement", | |
68 "ForeachStatement", | |
69 "ForeachRangeStatement", // D2.0 | |
70 "SwitchStatement", | |
71 "CaseStatement", | |
72 "DefaultStatement", | |
73 "ContinueStatement", | |
74 "BreakStatement", | |
75 "ReturnStatement", | |
76 "GotoStatement", | |
77 "WithStatement", | |
78 "SynchronizedStatement", | |
79 "TryStatement", | |
80 "CatchBody", | |
81 "FinallyBody", | |
82 "ScopeGuardStatement", | |
83 "ThrowStatement", | |
84 "VolatileStatement", | |
85 "AsmStatement", | |
86 "AsmInstruction", | |
87 "AsmAlignStatement", | |
88 "IllegalAsmInstruction", | |
89 "PragmaStatement", | |
90 "MixinStatement", | |
91 "StaticIfStatement", | |
92 "StaticAssertStatement", | |
93 "DebugStatement", | |
94 "VersionStatement", | |
95 | |
96 // Expressions: | |
659
304331ca2f95
Renamed EmptyExpression to IllegalExpression.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
658
diff
changeset
|
97 "IllegalExpression", |
635 | 98 "CondExpression", |
99 "CommaExpression", | |
100 "OrOrExpression", | |
101 "AndAndExpression", | |
102 "OrExpression", | |
103 "XorExpression", | |
104 "AndExpression", | |
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 "AddressExpression", | |
132 "PreIncrExpression", | |
133 "PreDecrExpression", | |
134 "PostIncrExpression", | |
135 "PostDecrExpression", | |
136 "DerefExpression", | |
137 "SignExpression", | |
138 "NotExpression", | |
139 "CompExpression", | |
140 "CallExpression", | |
141 "NewExpression", | |
142 "NewAnonClassExpression", | |
143 "DeleteExpression", | |
144 "CastExpression", | |
145 "IndexExpression", | |
146 "SliceExpression", | |
147 "ModuleScopeExpression", | |
148 "IdentifierExpression", | |
149 "SpecialTokenExpression", | |
150 "DotExpression", | |
151 "TemplateInstanceExpression", | |
152 "ThisExpression", | |
153 "SuperExpression", | |
154 "NullExpression", | |
155 "DollarExpression", | |
156 "BoolExpression", | |
157 "IntExpression", | |
158 "RealExpression", | |
159 "ComplexExpression", | |
160 "CharExpression", | |
161 "StringExpression", | |
162 "ArrayLiteralExpression", | |
163 "AArrayLiteralExpression", | |
164 "AssertExpression", | |
165 "MixinExpression", | |
166 "ImportExpression", | |
167 "TypeofExpression", | |
168 "TypeDotIdExpression", | |
169 "TypeidExpression", | |
170 "IsExpression", | |
646
68953760d569
Added class ParenExpression.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
640
diff
changeset
|
171 "ParenExpression", |
635 | 172 "FunctionLiteralExpression", |
173 "TraitsExpression", // D2.0 | |
174 "VoidInitializer", | |
175 "ArrayInitializer", | |
176 "StructInitializer", | |
177 "AsmTypeExpression", | |
178 "AsmOffsetExpression", | |
179 "AsmSegExpression", | |
180 "AsmPostBracketExpression", | |
181 "AsmBracketExpression", | |
182 "AsmLocalSizeExpression", | |
183 "AsmRegisterExpression", | |
184 | |
185 // Types: | |
671
f1325a4506de
Removed enum TID from dil.ast.Types.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
670
diff
changeset
|
186 "IllegalType", |
635 | 187 "IntegralType", |
188 "QualifiedType", | |
189 "ModuleScopeType", | |
190 "IdentifierType", | |
191 "TypeofType", | |
192 "TemplateInstanceType", | |
193 "PointerType", | |
194 "ArrayType", | |
195 "FunctionType", | |
196 "DelegateType", | |
197 "CFuncPointerType", | |
668
a1f8d8f2db38
Renamed some identifiers.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
664
diff
changeset
|
198 "BaseClassType", |
635 | 199 "ConstType", // D2.0 |
200 "InvariantType", // D2.0 | |
201 | |
202 // Other: | |
203 "Parameter", | |
204 "Parameters", | |
205 "TemplateAliasParameter", | |
206 "TemplateTypeParameter", | |
207 "TemplateThisParameter", // D2.0 | |
208 "TemplateValueParameter", | |
209 "TemplateTupleParameter", | |
210 "TemplateParameters", | |
211 "TemplateArguments", | |
212 ]; | |
213 | |
214 char[] generateNodeKindMembers() | |
215 { | |
216 char[] text; | |
217 foreach (className; classNames) | |
218 text ~= className ~ ","; | |
219 return text; | |
220 } | |
221 // pragma(msg, generateNodeKindMembers()); | |
222 | |
223 // enum NodeKind; | |
224 mixin( | |
640
05645f5613c1
Added an error message.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
635
diff
changeset
|
225 "enum NodeKind : ushort" |
635 | 226 "{" |
227 ~ generateNodeKindMembers ~ | |
228 "}" | |
229 ); |