annotate dmd/TemplateParameter.d @ 192:eb38fdcb3e62 default tip

updated to compile with dmd2.062
author korDen
date Sat, 02 Mar 2013 01:25:52 -0800
parents b0d41ff5e0df
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.TemplateParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 94
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.Loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.Identifier;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import dmd.Declaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 import dmd.TemplateTypeParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 import dmd.TemplateValueParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 import dmd.TemplateAliasParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 import dmd.TemplateThisParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 import dmd.TemplateTupleParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 import dmd.Scope;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 import dmd.OutBuffer;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 import dmd.HdrGenState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 import dmd.MATCH;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 import dmd.ArrayTypes;
121
347de076ad34 TemplateParameters -> Vector
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 114
diff changeset
17 import dmd.Array;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18
178
e3afd1303184 Many small bugs fixed
korDen
parents: 121
diff changeset
19 import dmd.TObject;
e3afd1303184 Many small bugs fixed
korDen
parents: 121
diff changeset
20
187
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
21 import dmd.DDMDExtensions;
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
22
178
e3afd1303184 Many small bugs fixed
korDen
parents: 121
diff changeset
23 class TemplateParameter : TObject
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 {
187
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
25 mixin insertMemberExtension!(typeof(this));
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
26
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 /* For type-parameter:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 * template Foo(ident) // specType is set to NULL
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 * template Foo(ident : specType)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30 * For value-parameter:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 * template Foo(valType ident) // specValue is set to NULL
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 * template Foo(valType ident : specValue)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 * For alias-parameter:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
34 * template Foo(alias ident)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
35 * For this-parameter:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 * template Foo(this ident)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 Loc loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 Identifier ident;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 Declaration sparam;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44 this(Loc loc, Identifier ident)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 121
diff changeset
46 register();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47 this.loc = loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 this.ident = ident;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51 TemplateTypeParameter isTemplateTypeParameter()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52 {
56
51605de93870 TupleExp.optimize
korDen
parents: 0
diff changeset
53 return null;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56 TemplateValueParameter isTemplateValueParameter()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 {
56
51605de93870 TupleExp.optimize
korDen
parents: 0
diff changeset
58 return null;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
60
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
61 TemplateAliasParameter isTemplateAliasParameter()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62 {
56
51605de93870 TupleExp.optimize
korDen
parents: 0
diff changeset
63 return null;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 version (DMDV2) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
67 TemplateThisParameter isTemplateThisParameter()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68 {
56
51605de93870 TupleExp.optimize
korDen
parents: 0
diff changeset
69 return null;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72 TemplateTupleParameter isTemplateTupleParameter()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
74 return null;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
75 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
76
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
77 abstract TemplateParameter syntaxCopy();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
78 abstract void declareParameter(Scope sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
79 abstract void semantic(Scope);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
80 abstract void print(Object oarg, Object oded);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
81 abstract void toCBuffer(OutBuffer buf, HdrGenState* hgs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
82 abstract Object specialization();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
83 abstract Object defaultArg(Loc loc, Scope sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
84
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
85 /* If TemplateParameter's match as far as overloading goes.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
86 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
87 abstract bool overloadMatch(TemplateParameter);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
88
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
89 /* Match actual argument against parameter.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
90 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
91 abstract MATCH matchArg(Scope sc, Objects tiargs, int i, TemplateParameters parameters, Objects dedtypes, Declaration* psparam, int flags = 0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
92
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
93 /* Create dummy argument based on parameter.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
94 */
94
3a0b150c9841 Objects -> Vector!Object iteration 1
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents: 56
diff changeset
95 abstract Object dummyArg();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
96 }