comparison dmd/template.h @ 336:aaade6ded589 trunk

[svn r357] Merged DMD 1.033
author lindquist
date Sat, 12 Jul 2008 19:38:31 +0200
parents 571959608194
children cecfee2d01a8
comparison
equal deleted inserted replaced
335:17b844102023 336:aaade6ded589
24 struct OutBuffer; 24 struct OutBuffer;
25 struct Identifier; 25 struct Identifier;
26 struct TemplateInstance; 26 struct TemplateInstance;
27 struct TemplateParameter; 27 struct TemplateParameter;
28 struct TemplateTypeParameter; 28 struct TemplateTypeParameter;
29 struct TemplateThisParameter;
29 struct TemplateValueParameter; 30 struct TemplateValueParameter;
30 struct TemplateAliasParameter; 31 struct TemplateAliasParameter;
31 struct TemplateTupleParameter; 32 struct TemplateTupleParameter;
32 struct Type; 33 struct Type;
33 struct TypeTypeof; 34 struct TypeTypeof;
50 { 51 {
51 TemplateParameters *parameters; // array of TemplateParameter's 52 TemplateParameters *parameters; // array of TemplateParameter's
52 53
53 TemplateParameters *origParameters; // originals for Ddoc 54 TemplateParameters *origParameters; // originals for Ddoc
54 55
55 Array instances; // array of TemplateInstance's 56 Array instances; // array of TemplateInstance's
56 57
57 TemplateDeclaration *overnext; // next overloaded TemplateDeclaration 58 TemplateDeclaration *overnext; // next overloaded TemplateDeclaration
58 TemplateDeclaration *overroot; // first in overnext list 59 TemplateDeclaration *overroot; // first in overnext list
59 60
60 Scope *scope; 61 Scope *scope;
63 TemplateDeclaration(Loc loc, Identifier *id, TemplateParameters *parameters, Array *decldefs); 64 TemplateDeclaration(Loc loc, Identifier *id, TemplateParameters *parameters, Array *decldefs);
64 Dsymbol *syntaxCopy(Dsymbol *); 65 Dsymbol *syntaxCopy(Dsymbol *);
65 void semantic(Scope *sc); 66 void semantic(Scope *sc);
66 int overloadInsert(Dsymbol *s); 67 int overloadInsert(Dsymbol *s);
67 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 68 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
68 char *kind(); 69 const char *kind();
69 char *toChars(); 70 char *toChars();
70 71
71 void emitComment(Scope *sc); 72 void emitComment(Scope *sc);
72 // void toDocBuffer(OutBuffer *buf); 73 // void toDocBuffer(OutBuffer *buf);
73 74
150 int overloadMatch(TemplateParameter *); 151 int overloadMatch(TemplateParameter *);
151 MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam); 152 MATCH matchArg(Scope *sc, Objects *tiargs, int i, TemplateParameters *parameters, Objects *dedtypes, Declaration **psparam);
152 void *dummyArg(); 153 void *dummyArg();
153 }; 154 };
154 155
156 #if DMDV2
157 struct TemplateThisParameter : TemplateTypeParameter
158 {
159 /* Syntax:
160 * this ident : specType = defaultType
161 */
162 Type *specType; // type parameter: if !=NULL, this is the type specialization
163 Type *defaultType;
164
165 TemplateThisParameter(Loc loc, Identifier *ident, Type *specType, Type *defaultType);
166
167 TemplateThisParameter *isTemplateThisParameter();
168 TemplateParameter *syntaxCopy();
169 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
170 };
171 #endif
172
155 struct TemplateValueParameter : TemplateParameter 173 struct TemplateValueParameter : TemplateParameter
156 { 174 {
157 /* Syntax: 175 /* Syntax:
158 * valType ident : specValue = defaultValue 176 * valType ident : specValue = defaultValue
159 */ 177 */
249 ScopeDsymbol *argsym; // argument symbol table 267 ScopeDsymbol *argsym; // argument symbol table
250 AliasDeclaration *aliasdecl; // !=NULL if instance is an alias for its 268 AliasDeclaration *aliasdecl; // !=NULL if instance is an alias for its
251 // sole member 269 // sole member
252 WithScopeSymbol *withsym; // if a member of a with statement 270 WithScopeSymbol *withsym; // if a member of a with statement
253 int semanticdone; // has semantic() been done? 271 int semanticdone; // has semantic() been done?
272 int semantictiargsdone; // has semanticTiargs() been done?
254 int nest; // for recursion detection 273 int nest; // for recursion detection
255 int havetempdecl; // 1 if used second constructor 274 int havetempdecl; // 1 if used second constructor
256 Dsymbol *isnested; // if referencing local symbols, this is the context 275 Dsymbol *isnested; // if referencing local symbols, this is the context
257 int errors; // 1 if compiled with errors 276 int errors; // 1 if compiled with errors
258 #ifdef IN_GCC 277 #ifdef IN_GCC
270 void semantic2(Scope *sc); 289 void semantic2(Scope *sc);
271 void semantic3(Scope *sc); 290 void semantic3(Scope *sc);
272 void inlineScan(); 291 void inlineScan();
273 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 292 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
274 Dsymbol *toAlias(); // resolve real symbol 293 Dsymbol *toAlias(); // resolve real symbol
275 char *kind(); 294 const char *kind();
276 int oneMember(Dsymbol **ps); 295 int oneMember(Dsymbol **ps);
277 char *toChars(); 296 char *toChars();
278 char *mangle(); 297 char *mangle();
279 298
280 void toObjFile(); // compile to .obj file 299 void toObjFile(int multiobj); // compile to .obj file
281 300
282 // Internal 301 // Internal
283 static void semanticTiargs(Loc loc, Scope *sc, Objects *tiargs); 302 static void semanticTiargs(Loc loc, Scope *sc, Objects *tiargs);
284 void semanticTiargs(Scope *sc); 303 void semanticTiargs(Scope *sc);
285 TemplateDeclaration *findTemplateDeclaration(Scope *sc); 304 TemplateDeclaration *findTemplateDeclaration(Scope *sc);
303 Dsymbol *syntaxCopy(Dsymbol *s); 322 Dsymbol *syntaxCopy(Dsymbol *s);
304 void semantic(Scope *sc); 323 void semantic(Scope *sc);
305 void semantic2(Scope *sc); 324 void semantic2(Scope *sc);
306 void semantic3(Scope *sc); 325 void semantic3(Scope *sc);
307 void inlineScan(); 326 void inlineScan();
308 char *kind(); 327 const char *kind();
309 int oneMember(Dsymbol **ps); 328 int oneMember(Dsymbol **ps);
310 int hasPointers(); 329 int hasPointers();
311 char *toChars(); 330 char *toChars();
312 char *mangle(); 331 char *mangle();
313 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 332 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
314 333
315 void toObjFile(); // compile to .obj file 334 void toObjFile(int multiobj); // compile to .obj file
316 335
317 TemplateMixin *isTemplateMixin() { return this; } 336 TemplateMixin *isTemplateMixin() { return this; }
318 }; 337 };
319 338
320 Expression *isExpression(Object *o); 339 Expression *isExpression(Object *o);