annotate dmd/TemplateThisParameter.d @ 178:e3afd1303184

Many small bugs fixed Made all classes derive from TObject to detect memory leaks (functionality is disabled for now) Began work on overriding backend memory allocations (to avoid memory leaks)
author korDen
date Sun, 17 Oct 2010 07:42:00 +0400
parents 438eaa11eed4
children b0d41ff5e0df
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 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 162
diff changeset
22 register();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23 super(loc, ident, specType, defaultType);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 0
diff changeset
26 override TemplateThisParameter isTemplateThisParameter()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 {
162
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
28 return this;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 0
diff changeset
31 override TemplateParameter syntaxCopy()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 {
162
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
33 TemplateThisParameter tp = new TemplateThisParameter(loc, ident, specType, defaultType);
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
34 if (tp.specType)
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
35 tp.specType = specType.syntaxCopy();
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
36 if (defaultType)
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
37 tp.defaultType = defaultType.syntaxCopy();
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
38 return tp;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 0
diff changeset
41 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 {
162
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
43 buf.writestring("this ");
438eaa11eed4 updated build script to use dmd2.039
korDen
parents: 114
diff changeset
44 super.toCBuffer(buf, hgs);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45 }
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 0
diff changeset
46 }