Mercurial > projects > ldc
annotate dmd/attrib.h @ 1553:f55ca8a1598c
Value::getNameStart and Value::getNameLength were removed
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Thu, 23 Jul 2009 20:34:35 +0200 |
parents | 79758fd2f48a |
children | def7a1d494fd |
rev | line source |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | |
3 // Copyright (c) 1999-2007 by Digital Mars | |
4 // All Rights Reserved | |
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. | |
10 | |
11 #ifndef DMD_ATTRIB_H | |
12 #define DMD_ATTRIB_H | |
13 | |
14 #ifdef __DMC__ | |
15 #pragma once | |
16 #endif /* __DMC__ */ | |
17 | |
18 #include "dsymbol.h" | |
19 | |
20 struct Expression; | |
21 struct Statement; | |
22 struct LabelDsymbol; | |
23 struct Initializer; | |
24 struct Module; | |
25 struct Condition; | |
26 #ifdef _DH | |
27 struct HdrGenState; | |
28 #endif | |
29 | |
30 /**************************************************************/ | |
31 | |
32 struct AttribDeclaration : Dsymbol | |
33 { | |
34 Array *decl; // array of Dsymbol's | |
35 | |
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); | |
42 void inlineScan(); | |
43 void addComment(unsigned char *comment); | |
44 void emitComment(Scope *sc); | |
336 | 45 const char *kind(); |
1 | 46 int oneMember(Dsymbol **ps); |
47 int hasPointers(); | |
48 void checkCtorConstInit(); | |
49 void addLocalClass(ClassDeclarations *); | |
50 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
51 AttribDeclaration *isAttribDeclaration() { return this; } | |
52 | |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
53 #if IN_DMD |
797
340acf1535d0
Removed KDevelop3 project files, CMake can generate them just fine!
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
710
diff
changeset
|
54 virtual void toObjFile(int multiobj); // compile to .obj file |
19 | 55 int cvMember(unsigned char *p); |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
56 #endif |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
57 |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
58 #if IN_LLVM |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
59 virtual void codegen(Ir*); |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
60 #endif |
1 | 61 }; |
62 | |
63 struct StorageClassDeclaration: AttribDeclaration | |
64 { | |
65 unsigned stc; | |
66 | |
67 StorageClassDeclaration(unsigned stc, Array *decl); | |
68 Dsymbol *syntaxCopy(Dsymbol *s); | |
69 void semantic(Scope *sc); | |
70 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1147
diff
changeset
|
71 |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1147
diff
changeset
|
72 static void stcToCBuffer(OutBuffer *buf, int stc); |
1 | 73 }; |
74 | |
75 struct LinkDeclaration : AttribDeclaration | |
76 { | |
77 enum LINK linkage; | |
78 | |
79 LinkDeclaration(enum LINK p, Array *decl); | |
80 Dsymbol *syntaxCopy(Dsymbol *s); | |
81 void semantic(Scope *sc); | |
82 void semantic3(Scope *sc); | |
83 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
84 char *toChars(); | |
85 }; | |
86 | |
87 struct ProtDeclaration : AttribDeclaration | |
88 { | |
89 enum PROT protection; | |
90 | |
91 ProtDeclaration(enum PROT p, Array *decl); | |
92 Dsymbol *syntaxCopy(Dsymbol *s); | |
93 void semantic(Scope *sc); | |
94 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
95 }; | |
96 | |
97 struct AlignDeclaration : AttribDeclaration | |
98 { | |
99 unsigned salign; | |
100 | |
710
20a5180f2e80
Make align(n), n != 1 an error.
Christian Kamm <kamm incasoftware de>
parents:
336
diff
changeset
|
101 AlignDeclaration(Loc loc, unsigned sa, Array *decl); |
1 | 102 Dsymbol *syntaxCopy(Dsymbol *s); |
103 void semantic(Scope *sc); | |
104 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
105 }; | |
106 | |
107 struct AnonDeclaration : AttribDeclaration | |
108 { | |
109 int isunion; | |
110 Scope *scope; // !=NULL means context to use | |
111 int sem; // 1 if successful semantic() | |
112 | |
113 AnonDeclaration(Loc loc, int isunion, Array *decl); | |
114 Dsymbol *syntaxCopy(Dsymbol *s); | |
115 void semantic(Scope *sc); | |
116 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
336 | 117 const char *kind(); |
1 | 118 }; |
119 | |
120 struct PragmaDeclaration : AttribDeclaration | |
121 { | |
122 Expressions *args; // array of Expression's | |
123 | |
124 PragmaDeclaration(Loc loc, Identifier *ident, Expressions *args, Array *decl); | |
125 Dsymbol *syntaxCopy(Dsymbol *s); | |
126 void semantic(Scope *sc); | |
127 int oneMember(Dsymbol **ps); | |
128 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
336 | 129 const char *kind(); |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
130 |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
131 #if IN_DMD |
336 | 132 void toObjFile(int multiobj); // compile to .obj file |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
133 #endif |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
134 |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
135 #if IN_LLVM |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
136 void codegen(Ir*); |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
797
diff
changeset
|
137 #endif |
1 | 138 }; |
139 | |
140 struct ConditionalDeclaration : AttribDeclaration | |
141 { | |
142 Condition *condition; | |
143 Array *elsedecl; // array of Dsymbol's for else block | |
144 | |
145 ConditionalDeclaration(Condition *condition, Array *decl, Array *elsedecl); | |
146 Dsymbol *syntaxCopy(Dsymbol *s); | |
147 int oneMember(Dsymbol **ps); | |
148 void emitComment(Scope *sc); | |
149 Array *include(Scope *sc, ScopeDsymbol *s); | |
150 void addComment(unsigned char *comment); | |
151 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
152 }; | |
153 | |
154 struct StaticIfDeclaration : ConditionalDeclaration | |
155 { | |
156 ScopeDsymbol *sd; | |
157 int addisdone; | |
158 | |
159 StaticIfDeclaration(Condition *condition, Array *decl, Array *elsedecl); | |
160 Dsymbol *syntaxCopy(Dsymbol *s); | |
161 int addMember(Scope *sc, ScopeDsymbol *s, int memnum); | |
162 void semantic(Scope *sc); | |
336 | 163 const char *kind(); |
1 | 164 }; |
165 | |
166 // Mixin declarations | |
167 | |
168 struct CompileDeclaration : AttribDeclaration | |
169 { | |
170 Expression *exp; | |
171 | |
172 ScopeDsymbol *sd; | |
336 | 173 int compiled; |
1 | 174 |
175 CompileDeclaration(Loc loc, Expression *exp); | |
176 Dsymbol *syntaxCopy(Dsymbol *s); | |
177 int addMember(Scope *sc, ScopeDsymbol *sd, int memnum); | |
336 | 178 void compileIt(Scope *sc); |
1 | 179 void semantic(Scope *sc); |
180 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
181 }; | |
182 | |
183 #endif /* DMD_ATTRIB_H */ |