2 // Compiler implementation of the D programming language
3 // Copyright (c) 1999-2007 by Digital Mars
5 // written by Walter Bright
6 // http://www.digitalmars.com
7 // License for redistribution is by either the Artistic License
8 // in artistic.txt, or the GNU General Public License in gnu.txt.
9 // See the included readme.txt for details.
30 /**************************************************************/
32 struct AttribDeclaration
: Dsymbol
34 Array
*decl
; // array of Dsymbol's
36 AttribDeclaration(Array
*decl
);
37 virtual Array
*include(Scope
*sc
, ScopeDsymbol
*s
);
38 int addMember(Scope
*sc
, ScopeDsymbol
*s
, int memnum
);
39 void semantic(Scope
*sc
);
40 void semantic2(Scope
*sc
);
41 void semantic3(Scope
*sc
);
43 void addComment(unsigned char *comment
);
44 void emitComment(Scope
*sc
);
46 int oneMember(Dsymbol
**ps
);
48 void checkCtorConstInit();
49 void addLocalClass(ClassDeclarations
*);
50 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
51 AttribDeclaration
*isAttribDeclaration() { return this; }
53 void toObjFile(int multiobj
); // compile to .obj file
54 int cvMember(unsigned char *p
);
57 struct StorageClassDeclaration
: AttribDeclaration
61 StorageClassDeclaration(unsigned stc
, Array
*decl
);
62 Dsymbol
*syntaxCopy(Dsymbol
*s
);
63 void semantic(Scope
*sc
);
64 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
67 struct LinkDeclaration
: AttribDeclaration
71 LinkDeclaration(enum LINK p
, Array
*decl
);
72 Dsymbol
*syntaxCopy(Dsymbol
*s
);
73 void semantic(Scope
*sc
);
74 void semantic3(Scope
*sc
);
75 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
79 struct ProtDeclaration
: AttribDeclaration
83 ProtDeclaration(enum PROT p
, Array
*decl
);
84 Dsymbol
*syntaxCopy(Dsymbol
*s
);
85 void semantic(Scope
*sc
);
86 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
89 struct AlignDeclaration
: AttribDeclaration
93 AlignDeclaration(unsigned sa
, Array
*decl
);
94 Dsymbol
*syntaxCopy(Dsymbol
*s
);
95 void semantic(Scope
*sc
);
96 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
99 struct AnonDeclaration
: AttribDeclaration
102 Scope
*scope
; // !=NULL means context to use
103 int sem
; // 1 if successful semantic()
105 AnonDeclaration(Loc loc
, int isunion
, Array
*decl
);
106 Dsymbol
*syntaxCopy(Dsymbol
*s
);
107 void semantic(Scope
*sc
);
108 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
112 struct PragmaDeclaration
: AttribDeclaration
114 Expressions
*args
; // array of Expression's
116 PragmaDeclaration(Loc loc
, Identifier
*ident
, Expressions
*args
, Array
*decl
);
117 Dsymbol
*syntaxCopy(Dsymbol
*s
);
118 void semantic(Scope
*sc
);
119 int oneMember(Dsymbol
**ps
);
120 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
122 void toObjFile(int multiobj
); // compile to .obj file
125 struct ConditionalDeclaration
: AttribDeclaration
127 Condition
*condition
;
128 Array
*elsedecl
; // array of Dsymbol's for else block
130 ConditionalDeclaration(Condition
*condition
, Array
*decl
, Array
*elsedecl
);
131 Dsymbol
*syntaxCopy(Dsymbol
*s
);
132 int oneMember(Dsymbol
**ps
);
133 void emitComment(Scope
*sc
);
134 Array
*include(Scope
*sc
, ScopeDsymbol
*s
);
135 void addComment(unsigned char *comment
);
136 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
139 struct StaticIfDeclaration
: ConditionalDeclaration
144 StaticIfDeclaration(Condition
*condition
, Array
*decl
, Array
*elsedecl
);
145 Dsymbol
*syntaxCopy(Dsymbol
*s
);
146 int addMember(Scope
*sc
, ScopeDsymbol
*s
, int memnum
);
147 void semantic(Scope
*sc
);
151 // Mixin declarations
153 struct CompileDeclaration
: AttribDeclaration
159 CompileDeclaration(Loc loc
, Expression
*exp
);
160 Dsymbol
*syntaxCopy(Dsymbol
*s
);
161 int addMember(Scope
*sc
, ScopeDsymbol
*sd
, int memnum
);
162 void semantic(Scope
*sc
);
163 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
166 #endif /* DMD_ATTRIB_H */