Mercurial > projects > ddmd
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 |
rev | line source |
---|---|
0 | 1 module dmd.TemplateParameter; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.Loc; |
5 import dmd.Identifier; | |
6 import dmd.Declaration; | |
7 import dmd.TemplateTypeParameter; | |
8 import dmd.TemplateValueParameter; | |
9 import dmd.TemplateAliasParameter; | |
10 import dmd.TemplateThisParameter; | |
11 import dmd.TemplateTupleParameter; | |
12 import dmd.Scope; | |
13 import dmd.OutBuffer; | |
14 import dmd.HdrGenState; | |
15 import dmd.MATCH; | |
16 import dmd.ArrayTypes; | |
121
347de076ad34
TemplateParameters -> Vector
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
17 import dmd.Array; |
0 | 18 |
178 | 19 import dmd.TObject; |
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 | 23 class TemplateParameter : TObject |
0 | 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 | 27 /* For type-parameter: |
28 * template Foo(ident) // specType is set to NULL | |
29 * template Foo(ident : specType) | |
30 * For value-parameter: | |
31 * template Foo(valType ident) // specValue is set to NULL | |
32 * template Foo(valType ident : specValue) | |
33 * For alias-parameter: | |
34 * template Foo(alias ident) | |
35 * For this-parameter: | |
36 * template Foo(this ident) | |
37 */ | |
38 | |
39 Loc loc; | |
40 Identifier ident; | |
41 | |
42 Declaration sparam; | |
43 | |
44 this(Loc loc, Identifier ident) | |
45 { | |
178 | 46 register(); |
0 | 47 this.loc = loc; |
48 this.ident = ident; | |
49 } | |
50 | |
51 TemplateTypeParameter isTemplateTypeParameter() | |
52 { | |
56 | 53 return null; |
0 | 54 } |
55 | |
56 TemplateValueParameter isTemplateValueParameter() | |
57 { | |
56 | 58 return null; |
0 | 59 } |
60 | |
61 TemplateAliasParameter isTemplateAliasParameter() | |
62 { | |
56 | 63 return null; |
0 | 64 } |
65 | |
66 version (DMDV2) { | |
67 TemplateThisParameter isTemplateThisParameter() | |
68 { | |
56 | 69 return null; |
0 | 70 } |
71 } | |
72 TemplateTupleParameter isTemplateTupleParameter() | |
73 { | |
74 return null; | |
75 } | |
76 | |
77 abstract TemplateParameter syntaxCopy(); | |
78 abstract void declareParameter(Scope sc); | |
79 abstract void semantic(Scope); | |
80 abstract void print(Object oarg, Object oded); | |
81 abstract void toCBuffer(OutBuffer buf, HdrGenState* hgs); | |
82 abstract Object specialization(); | |
83 abstract Object defaultArg(Loc loc, Scope sc); | |
84 | |
85 /* If TemplateParameter's match as far as overloading goes. | |
86 */ | |
87 abstract bool overloadMatch(TemplateParameter); | |
88 | |
89 /* Match actual argument against parameter. | |
90 */ | |
91 abstract MATCH matchArg(Scope sc, Objects tiargs, int i, TemplateParameters parameters, Objects dedtypes, Declaration* psparam, int flags = 0); | |
92 | |
93 /* Create dummy argument based on parameter. | |
94 */ | |
94
3a0b150c9841
Objects -> Vector!Object iteration 1
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
56
diff
changeset
|
95 abstract Object dummyArg(); |
0 | 96 } |