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