annotate dmd/TemplateThisParameter.d @ 162:438eaa11eed4

updated build script to use dmd2.039 some missing methods implemented
author korDen
date Tue, 21 Sep 2010 14:59:56 +0400
parents e28b18c23469
children e3afd1303184
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.TemplateThisParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 72
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.TemplateTypeParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.Type;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import dmd.Loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 import dmd.Identifier;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 import dmd.TemplateParameter;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 import dmd.OutBuffer;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 import dmd.HdrGenState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 class TemplateThisParameter : TemplateTypeParameter
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 /* Syntax:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 * this ident : specType = defaultType
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 Type specType; // type parameter: if !=NULL, this is the type specialization
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 Type defaultType;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 this(Loc loc, Identifier ident, Type specType, Type defaultType)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 super(loc, ident, specType, defaultType);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 0
diff changeset
25 override TemplateThisParameter isTemplateThisParameter()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26 {
162
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
27 return this;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 0
diff changeset
30 override TemplateParameter syntaxCopy()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 {
162
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
32 TemplateThisParameter tp = new TemplateThisParameter(loc, ident, specType, defaultType);
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
33 if (tp.specType)
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
34 tp.specType = specType.syntaxCopy();
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
35 if (defaultType)
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
36 tp.defaultType = defaultType.syntaxCopy();
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
37 return tp;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 0
diff changeset
40 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 {
162
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
42 buf.writestring("this ");
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
43 super.toCBuffer(buf, hgs);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44 }
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 0
diff changeset
45 }