0
|
1 module dmd.ProtDeclaration;
|
|
2
|
|
3 import dmd.AttribDeclaration;
|
|
4 import dmd.PROT;
|
|
5 import dmd.OutBuffer;
|
|
6 import dmd.HdrGenState;
|
|
7 import dmd.Scope;
|
|
8 import dmd.Dsymbol;
|
|
9 import dmd.Array;
|
|
10
|
|
11 class ProtDeclaration : AttribDeclaration
|
|
12 {
|
|
13 PROT protection;
|
|
14
|
|
15 this(PROT p, Array decl)
|
|
16 {
|
|
17 super(decl);
|
|
18
|
|
19 protection = p;
|
|
20 //printf("decl = %p\n", decl);
|
|
21 }
|
|
22
|
|
23 Dsymbol syntaxCopy(Dsymbol s)
|
|
24 {
|
49
|
25 ProtDeclaration pd;
|
|
26
|
|
27 assert(!s);
|
|
28 pd = new ProtDeclaration(protection, Dsymbol.arraySyntaxCopy(decl));
|
|
29 return pd;
|
0
|
30 }
|
|
31
|
|
32 void setScope(Scope sc)
|
|
33 {
|
|
34 if (decl)
|
|
35 {
|
|
36 setScopeNewSc(sc, sc.stc, sc.linkage, protection, 1, sc.structalign);
|
|
37 }
|
|
38 }
|
|
39
|
|
40 void semantic(Scope sc)
|
|
41 {
|
|
42 if (decl)
|
|
43 {
|
|
44 semanticNewSc(sc, sc.stc, sc.linkage, protection, 1, sc.structalign);
|
|
45 }
|
|
46 }
|
|
47
|
|
48 void toCBuffer(OutBuffer buf, HdrGenState* hgs)
|
|
49 {
|
|
50 assert(false);
|
|
51 }
|
|
52
|
|
53 static void protectionToCBuffer(OutBuffer buf, PROT protection)
|
|
54 {
|
|
55 assert(false);
|
|
56 }
|
|
57 } |