Mercurial > projects > dil
comparison trunk/src/dil/SyntaxTree.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 | 433d51c18524 |
comparison
equal
deleted
inserted
replaced
494:9a7ca8c56e59 | 495:b60450804b6e |
---|---|
45 TemplateDeclaration, | 45 TemplateDeclaration, |
46 NewDeclaration, | 46 NewDeclaration, |
47 DeleteDeclaration, | 47 DeleteDeclaration, |
48 AttributeDeclaration, | 48 AttributeDeclaration, |
49 ProtectionDeclaration, | 49 ProtectionDeclaration, |
50 ExternDeclaration, | 50 StorageClassDeclaration, |
51 LinkageDeclaration, | |
51 AlignDeclaration, | 52 AlignDeclaration, |
52 PragmaDeclaration, | 53 PragmaDeclaration, |
53 MixinDeclaration, | 54 MixinDeclaration, |
54 | 55 |
55 // Statements: | 56 // Statements: |
90 MixinStatement, | 91 MixinStatement, |
91 StaticIfStatement, | 92 StaticIfStatement, |
92 StaticAssertStatement, | 93 StaticAssertStatement, |
93 DebugStatement, | 94 DebugStatement, |
94 VersionStatement, | 95 VersionStatement, |
95 AttributeStatement, | |
96 ExternStatement, | |
97 | 96 |
98 // Expressions: | 97 // Expressions: |
99 EmptyExpression, | 98 EmptyExpression, |
100 BinaryExpression, | 99 BinaryExpression, |
101 CondExpression, | 100 CondExpression, |
213 TemplateThisParameter, // D2.0 | 212 TemplateThisParameter, // D2.0 |
214 TemplateValueParameter, | 213 TemplateValueParameter, |
215 TemplateTupleParameter, | 214 TemplateTupleParameter, |
216 TemplateParameters, | 215 TemplateParameters, |
217 TemplateArguments, | 216 TemplateArguments, |
218 Linkage, | |
219 EnumMember, | 217 EnumMember, |
220 } | 218 } |
221 | 219 |
222 /// This string is mixed into the constructor of a class that inherits from Node. | 220 /// This string is mixed into the constructor of a class that inherits from Node. |
223 const string set_kind = `this.kind = mixin("NodeKind." ~ typeof(this).stringof);`; | 221 const string set_kind = `this.kind = mixin("NodeKind." ~ typeof(this).stringof);`; |
226 { | 224 { |
227 assert(n !is null); | 225 assert(n !is null); |
228 if (n.kind == mixin("NodeKind." ~ typeof(Class).stringof)) | 226 if (n.kind == mixin("NodeKind." ~ typeof(Class).stringof)) |
229 return cast(Class)cast(void*)n; | 227 return cast(Class)cast(void*)n; |
230 return null; | 228 return null; |
229 } | |
230 | |
231 Class CastTo(Class)(Node n) | |
232 { | |
233 assert(n !is null && n.kind == mixin("NodeKind." ~ typeof(Class).stringof)); | |
234 return cast(Class)cast(void*)n; | |
231 } | 235 } |
232 | 236 |
233 class Node | 237 class Node |
234 { | 238 { |
235 NodeCategory category; | 239 NodeCategory category; |