annotate dmd/UnionDeclaration.d @ 187:b0d41ff5e0df

Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
author Abscissa
date Tue, 07 Jun 2011 23:37:34 -0400
parents e3afd1303184
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.UnionDeclaration;
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.StructDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.Loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import dmd.Identifier;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 import dmd.Dsymbol;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8
187
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
9 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
10
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 class UnionDeclaration : StructDeclaration
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 {
187
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
13 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
14
18
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
15 this(Loc loc, Identifier id)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 114
diff changeset
17 register();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 super(loc, id);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 }
18
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
20
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 23
diff changeset
21 override Dsymbol syntaxCopy(Dsymbol s)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 {
18
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
23 UnionDeclaration ud;
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
24
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
25 if (s)
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
26 ud = cast(UnionDeclaration)s;
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
27 else
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
28 ud = new UnionDeclaration(loc, ident);
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
29 StructDeclaration.syntaxCopy(ud);
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
30 return ud;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 23
diff changeset
33 override string kind()
18
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
34 {
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
35 return "union";
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
36 }
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
37
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 23
diff changeset
38 override UnionDeclaration isUnionDeclaration() { return this; }
18
f2413c9183d1 Implemented CompileDeclaration, UAddExp, UnionDeclaration.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
39 }