Mercurial > projects > ddmd
annotate dmd/SymbolDeclaration.d @ 192:eb38fdcb3e62 default tip
updated to compile with dmd2.062
author | korDen |
---|---|
date | Sat, 02 Mar 2013 01:25:52 -0800 |
parents | b0d41ff5e0df |
children |
rev | line source |
---|---|
0 | 1 module dmd.SymbolDeclaration; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.Declaration; |
5 import dmd.StructDeclaration; | |
6 import dmd.Loc; | |
7 import dmd.TOK; | |
8 import dmd.STC; | |
9 import dmd.Identifier; | |
10 | |
11 import dmd.backend.Symbol; | |
12 | |
13 import core.stdc.string; | |
14 import std.stdio; | |
15 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
16 import dmd.DDMDExtensions; |
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
17 |
0 | 18 // This is a shell around a back end symbol |
19 | |
20 class SymbolDeclaration : Declaration | |
21 { | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
22 mixin insertMemberExtension!(typeof(this)); |
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
23 |
0 | 24 Symbol* sym; |
25 StructDeclaration dsym; | |
26 | |
27 this(Loc loc, Symbol* s, StructDeclaration dsym) | |
28 { | |
178 | 29 register(); |
0 | 30 int len = strlen(s.Sident.ptr); |
31 string name = s.Sident.ptr[0..len].idup; | |
32 | |
33 super(new Identifier(name, TOK.TOKidentifier)); | |
34 | |
35 this.loc = loc; | |
36 sym = s; | |
37 this.dsym = dsym; | |
38 storage_class |= STCconst; | |
39 } | |
40 | |
72 | 41 override Symbol* toSymbol() |
0 | 42 { |
43 return sym; | |
44 } | |
45 | |
46 // Eliminate need for dynamic_cast | |
72 | 47 override SymbolDeclaration isSymbolDeclaration() { return this; } |
48 } |