Mercurial > projects > ddmd
comparison dmd/LinkDeclaration.d @ 0:10317f0c89a5
Initial commit
author | korDen |
---|---|
date | Sat, 24 Oct 2009 08:42:06 +0400 |
parents | |
children | 2e2a5c3f943a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:10317f0c89a5 |
---|---|
1 module dmd.LinkDeclaration; | |
2 | |
3 import dmd.AttribDeclaration; | |
4 import dmd.LINK; | |
5 import dmd.OutBuffer; | |
6 import dmd.HdrGenState; | |
7 import dmd.Scope; | |
8 import dmd.Dsymbol; | |
9 import dmd.Array; | |
10 | |
11 class LinkDeclaration : AttribDeclaration | |
12 { | |
13 LINK linkage; | |
14 | |
15 this(LINK p, Array decl) | |
16 { | |
17 super(decl); | |
18 //printf("LinkDeclaration(linkage = %d, decl = %p)\n", p, decl); | |
19 linkage = p; | |
20 } | |
21 | |
22 Dsymbol syntaxCopy(Dsymbol s) | |
23 { | |
24 assert(false); | |
25 } | |
26 | |
27 void setScope(Scope sc) | |
28 { | |
29 //printf("LinkDeclaration::setScope(linkage = %d, decl = %p)\n", linkage, decl); | |
30 if (decl) | |
31 { | |
32 setScopeNewSc(sc, sc.stc, linkage, sc.protection, sc.explicitProtection, sc.structalign); | |
33 } | |
34 } | |
35 | |
36 void semantic(Scope sc) | |
37 { | |
38 //printf("LinkDeclaration::semantic(linkage = %d, decl = %p)\n", linkage, decl); | |
39 if (decl) | |
40 { | |
41 semanticNewSc(sc, sc.stc, linkage, sc.protection, sc.explicitProtection, sc.structalign); | |
42 } | |
43 } | |
44 | |
45 void semantic3(Scope sc) | |
46 { | |
47 //printf("LinkDeclaration::semantic3(linkage = %d, decl = %p)\n", linkage, decl); | |
48 if (decl) | |
49 { | |
50 LINK linkage_save = sc.linkage; | |
51 | |
52 sc.linkage = linkage; | |
53 for (uint i = 0; i < decl.dim; i++) | |
54 { | |
55 Dsymbol s = cast(Dsymbol)decl.data[i]; | |
56 s.semantic3(sc); | |
57 } | |
58 sc.linkage = linkage_save; | |
59 } | |
60 else | |
61 { | |
62 sc.linkage = linkage; | |
63 } | |
64 } | |
65 | |
66 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | |
67 { | |
68 assert(false); | |
69 } | |
70 | |
71 string toChars() | |
72 { | |
73 assert(false); | |
74 } | |
75 } |