72
|
1 module dmd.DotTypeExp;
|
|
2
|
114
|
3 import dmd.common;
|
72
|
4 import dmd.Expression;
|
|
5 import dmd.backend.elem;
|
|
6 import dmd.UnaExp;
|
|
7 import dmd.OutBuffer;
|
|
8 import dmd.Loc;
|
|
9 import dmd.Scope;
|
|
10 import dmd.IRState;
|
|
11 import dmd.HdrGenState;
|
|
12 import dmd.Dsymbol;
|
0
|
13 import dmd.TOK;
|
|
14 import dmd.PREC;
|
72
|
15 import dmd.expression.Util;
|
|
16
|
0
|
17 class DotTypeExp : UnaExp
|
|
18 {
|
|
19 Dsymbol sym;
|
|
20
|
|
21 this(Loc loc, Expression e, Dsymbol s)
|
72
|
22 {
|
0
|
23 super(loc, TOK.TOKdottype, DotTypeExp.sizeof, e);
|
|
24 this.sym = s;
|
|
25 this.type = s.getType();
|
|
26 }
|
|
27
|
72
|
28 override Expression semantic(Scope sc)
|
0
|
29 {
|
|
30 version (LOGSEMANTIC) {
|
|
31 printf("DotTypeExp.semantic('%s')\n", toChars());
|
|
32 }
|
|
33 UnaExp.semantic(sc);
|
|
34 return this;
|
|
35 }
|
|
36
|
72
|
37 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
|
0
|
38 {
|
|
39 expToCBuffer(buf, hgs, e1, PREC.PREC_primary);
|
|
40 buf.writeByte('.');
|
|
41 buf.writestring(sym.toChars());
|
|
42 }
|
|
43
|
72
|
44 override elem* toElem(IRState* irs)
|
0
|
45 {
|
|
46 assert(false);
|
|
47 }
|
|
48 }
|
|
49
|