comparison dmd/TypeExp.d @ 0:10317f0c89a5

Initial commit
author korDen
date Sat, 24 Oct 2009 08:42:06 +0400
parents
children 5c9b78899f5d
comparison
equal deleted inserted replaced
-1:000000000000 0:10317f0c89a5
1 module dmd.TypeExp;
2
3 import dmd.Expression;
4 import dmd.backend.elem;
5 import dmd.Type;
6 import dmd.OutBuffer;
7 import dmd.Loc;
8 import dmd.Scope;
9 import dmd.IRState;
10 import dmd.HdrGenState;
11 import dmd.TOK;
12
13 class TypeExp : Expression
14 {
15 this(Loc loc, Type type)
16 {
17 super(loc, TOK.TOKtype, TypeExp.sizeof);
18 //printf("TypeExp::TypeExp(%s)\n", type->toChars());
19 this.type = type;
20 }
21
22 version (DumbClone) {
23 } else {
24 Type clone()
25 {
26 assert(false);
27 }
28 }
29 Expression syntaxCopy()
30 {
31 //printf("TypeExp.syntaxCopy()\n");
32 return new TypeExp(loc, type.syntaxCopy());
33 }
34
35 Expression semantic(Scope sc)
36 {
37 //printf("TypeExp::semantic(%s)\n", type->toChars());
38 type = type.semantic(loc, sc);
39 return this;
40 }
41
42 void rvalue()
43 {
44 assert(false);
45 }
46
47 void toCBuffer(OutBuffer buf, HdrGenState* hgs)
48 {
49 assert(false);
50 }
51
52 Expression optimize(int result)
53 {
54 return this;
55 }
56
57 elem* toElem(IRState* irs)
58 {
59 assert(false);
60 }
61 }
62