Mercurial > projects > ddmd
diff dmd/TypeExp.d @ 0:10317f0c89a5
Initial commit
author | korDen |
---|---|
date | Sat, 24 Oct 2009 08:42:06 +0400 |
parents | |
children | 5c9b78899f5d |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dmd/TypeExp.d Sat Oct 24 08:42:06 2009 +0400 @@ -0,0 +1,62 @@ +module dmd.TypeExp; + +import dmd.Expression; +import dmd.backend.elem; +import dmd.Type; +import dmd.OutBuffer; +import dmd.Loc; +import dmd.Scope; +import dmd.IRState; +import dmd.HdrGenState; +import dmd.TOK; + +class TypeExp : Expression +{ + this(Loc loc, Type type) + { + super(loc, TOK.TOKtype, TypeExp.sizeof); + //printf("TypeExp::TypeExp(%s)\n", type->toChars()); + this.type = type; + } + +version (DumbClone) { +} else { + Type clone() + { + assert(false); + } +} + Expression syntaxCopy() + { + //printf("TypeExp.syntaxCopy()\n"); + return new TypeExp(loc, type.syntaxCopy()); + } + + Expression semantic(Scope sc) + { + //printf("TypeExp::semantic(%s)\n", type->toChars()); + type = type.semantic(loc, sc); + return this; + } + + void rvalue() + { + assert(false); + } + + void toCBuffer(OutBuffer buf, HdrGenState* hgs) + { + assert(false); + } + + Expression optimize(int result) + { + return this; + } + + elem* toElem(IRState* irs) + { + assert(false); + } +} +