Mercurial > projects > ddmd
annotate dmd/LinkDeclaration.d @ 187:b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
author | Abscissa |
---|---|
date | Tue, 07 Jun 2011 23:37:34 -0400 |
parents | e3afd1303184 |
children |
rev | line source |
---|---|
0 | 1 module dmd.LinkDeclaration; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.AttribDeclaration; |
5 import dmd.LINK; | |
6 import dmd.OutBuffer; | |
7 import dmd.HdrGenState; | |
8 import dmd.Scope; | |
9 import dmd.Dsymbol; | |
10 import dmd.Array; | |
11 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
12 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
|
13 |
0 | 14 class LinkDeclaration : AttribDeclaration |
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 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
|
17 |
0 | 18 LINK linkage; |
19 | |
74
7e0d548de9e6
Switch Arrays of Dsymbols to the new templated Vector type
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
72
diff
changeset
|
20 this(LINK p, Dsymbols decl) |
0 | 21 { |
178 | 22 register(); |
0 | 23 super(decl); |
24 //printf("LinkDeclaration(linkage = %d, decl = %p)\n", p, decl); | |
25 linkage = p; | |
26 } | |
27 | |
72 | 28 override Dsymbol syntaxCopy(Dsymbol s) |
0 | 29 { |
30 assert(false); | |
31 } | |
32 | |
72 | 33 override void setScope(Scope sc) |
0 | 34 { |
35 //printf("LinkDeclaration::setScope(linkage = %d, decl = %p)\n", linkage, decl); | |
36 if (decl) | |
37 { | |
38 setScopeNewSc(sc, sc.stc, linkage, sc.protection, sc.explicitProtection, sc.structalign); | |
39 } | |
40 } | |
41 | |
72 | 42 override void semantic(Scope sc) |
0 | 43 { |
44 //printf("LinkDeclaration::semantic(linkage = %d, decl = %p)\n", linkage, decl); | |
45 if (decl) | |
46 { | |
47 semanticNewSc(sc, sc.stc, linkage, sc.protection, sc.explicitProtection, sc.structalign); | |
48 } | |
49 } | |
50 | |
72 | 51 override void semantic3(Scope sc) |
0 | 52 { |
53 //printf("LinkDeclaration::semantic3(linkage = %d, decl = %p)\n", linkage, decl); | |
54 if (decl) | |
55 { | |
56 LINK linkage_save = sc.linkage; | |
57 | |
58 sc.linkage = linkage; | |
77
ad4792a1cfd6
more D-ification container accessing
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
74
diff
changeset
|
59 foreach(Dsymbol s; decl) |
0 | 60 s.semantic3(sc); |
61 sc.linkage = linkage_save; | |
62 } | |
63 else | |
64 { | |
65 sc.linkage = linkage; | |
66 } | |
67 } | |
68 | |
72 | 69 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
0 | 70 { |
71 assert(false); | |
72 } | |
73 | |
72 | 74 override string toChars() |
0 | 75 { |
76 assert(false); | |
77 } | |
72 | 78 } |