root/trunk/src/attrib.h

Revision 428, 5.3 kB (checked in by walter, 2 years ago)

remove tabs, any trailing spaces

  • Property svn:eol-style set to native
Line 
1 // Compiler implementation of the D programming language
2 // Copyright (c) 1999-2010 by Digital Mars
3 // All Rights Reserved
4 // written by Walter Bright
5 // http://www.digitalmars.com
6 // License for redistribution is by either the Artistic License
7 // in artistic.txt, or the GNU General Public License in gnu.txt.
8 // See the included readme.txt for details.
9
10 #ifndef DMD_ATTRIB_H
11 #define DMD_ATTRIB_H
12
13 #ifdef __DMC__
14 #pragma once
15 #endif /* __DMC__ */
16
17 #include "dsymbol.h"
18
19 struct Expression;
20 struct Statement;
21 struct LabelDsymbol;
22 struct Initializer;
23 struct Module;
24 struct Condition;
25 #ifdef _DH
26 struct HdrGenState;
27 #endif
28
29 /**************************************************************/
30
31 struct AttribDeclaration : Dsymbol
32 {
33     Dsymbols *decl;     // array of Dsymbol's
34
35     AttribDeclaration(Dsymbols *decl);
36     virtual Dsymbols *include(Scope *sc, ScopeDsymbol *s);
37     int addMember(Scope *sc, ScopeDsymbol *s, int memnum);
38     void setScopeNewSc(Scope *sc,
39         StorageClass newstc, enum LINK linkage, enum PROT protection, int explictProtection,
40         unsigned structalign);
41     void semanticNewSc(Scope *sc,
42         StorageClass newstc, enum LINK linkage, enum PROT protection, int explictProtection,
43         unsigned structalign);
44     void semantic(Scope *sc);
45     void semantic2(Scope *sc);
46     void semantic3(Scope *sc);
47     void inlineScan();
48     void addComment(unsigned char *comment);
49     void emitComment(Scope *sc);
50     const char *kind();
51     int oneMember(Dsymbol **ps);
52     int hasPointers();
53     void checkCtorConstInit();
54     void addLocalClass(ClassDeclarations *);
55     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
56     void toJsonBuffer(OutBuffer *buf);
57     AttribDeclaration *isAttribDeclaration() { return this; }
58
59     void toObjFile(int multiobj);                       // compile to .obj file
60     int cvMember(unsigned char *p);
61 };
62
63 struct StorageClassDeclaration: AttribDeclaration
64 {
65     StorageClass stc;
66
67     StorageClassDeclaration(StorageClass stc, Dsymbols *decl);
68     Dsymbol *syntaxCopy(Dsymbol *s);
69     void setScope(Scope *sc);
70     void semantic(Scope *sc);
71     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
72
73     static void stcToCBuffer(OutBuffer *buf, StorageClass stc);
74 };
75
76 struct LinkDeclaration : AttribDeclaration
77 {
78     enum LINK linkage;
79
80     LinkDeclaration(enum LINK p, Dsymbols *decl);
81     Dsymbol *syntaxCopy(Dsymbol *s);
82     void setScope(Scope *sc);
83     void semantic(Scope *sc);
84     void semantic3(Scope *sc);
85     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
86     char *toChars();
87 };
88
89 struct ProtDeclaration : AttribDeclaration
90 {
91     enum PROT protection;
92
93     ProtDeclaration(enum PROT p, Dsymbols *decl);
94     Dsymbol *syntaxCopy(Dsymbol *s);
95     void importAll(Scope *sc);
96     void setScope(Scope *sc);
97     void semantic(Scope *sc);
98     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
99
100     static void protectionToCBuffer(OutBuffer *buf, enum PROT protection);
101 };
102
103 struct AlignDeclaration : AttribDeclaration
104 {
105     unsigned salign;
106
107     AlignDeclaration(unsigned sa, Dsymbols *decl);
108     Dsymbol *syntaxCopy(Dsymbol *s);
109     void setScope(Scope *sc);
110     void semantic(Scope *sc);
111     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
112 };
113
114 struct AnonDeclaration : AttribDeclaration
115 {
116     int isunion;
117     int sem;                    // 1 if successful semantic()
118
119     AnonDeclaration(Loc loc, int isunion, Dsymbols *decl);
120     Dsymbol *syntaxCopy(Dsymbol *s);
121     void semantic(Scope *sc);
122     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
123     const char *kind();
124 };
125
126 struct PragmaDeclaration : AttribDeclaration
127 {
128     Expressions *args;          // array of Expression's
129
130     PragmaDeclaration(Loc loc, Identifier *ident, Expressions *args, Dsymbols *decl);
131     Dsymbol *syntaxCopy(Dsymbol *s);
132     void semantic(Scope *sc);
133     void setScope(Scope *sc);
134     int oneMember(Dsymbol **ps);
135     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
136     const char *kind();
137     void toObjFile(int multiobj);                       // compile to .obj file
138 };
139
140 struct ConditionalDeclaration : AttribDeclaration
141 {
142     Condition *condition;
143     Dsymbols *elsedecl; // array of Dsymbol's for else block
144
145     ConditionalDeclaration(Condition *condition, Dsymbols *decl, Dsymbols *elsedecl);
146     Dsymbol *syntaxCopy(Dsymbol *s);
147     int oneMember(Dsymbol **ps);
148     void emitComment(Scope *sc);
149     Dsymbols *include(Scope *sc, ScopeDsymbol *s);
150     void addComment(unsigned char *comment);
151     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
152     void toJsonBuffer(OutBuffer *buf);
153     void importAll(Scope *sc);
154     void setScope(Scope *sc);
155 };
156
157 struct StaticIfDeclaration : ConditionalDeclaration
158 {
159     ScopeDsymbol *sd;
160     int addisdone;
161
162     StaticIfDeclaration(Condition *condition, Dsymbols *decl, Dsymbols *elsedecl);
163     Dsymbol *syntaxCopy(Dsymbol *s);
164     int addMember(Scope *sc, ScopeDsymbol *s, int memnum);
165     void semantic(Scope *sc);
166     void importAll(Scope *sc);
167     void setScope(Scope *sc);
168     const char *kind();
169 };
170
171 // Mixin declarations
172
173 struct CompileDeclaration : AttribDeclaration
174 {
175     Expression *exp;
176
177     ScopeDsymbol *sd;
178     int compiled;
179
180     CompileDeclaration(Loc loc, Expression *exp);
181     Dsymbol *syntaxCopy(Dsymbol *s);
182     int addMember(Scope *sc, ScopeDsymbol *sd, int memnum);
183     void compileIt(Scope *sc);
184     void semantic(Scope *sc);
185     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
186 };
187
188 #endif /* DMD_ATTRIB_H */
Note: See TracBrowser for help on using the browser.