Mercurial > projects > ddmd
diff dmd/ShlAssignExp.d @ 0:10317f0c89a5
Initial commit
author | korDen |
---|---|
date | Sat, 24 Oct 2009 08:42:06 +0400 |
parents | |
children | cab4c37afb89 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dmd/ShlAssignExp.d Sat Oct 24 08:42:06 2009 +0400 @@ -0,0 +1,61 @@ +module dmd.ShlAssignExp; + +import dmd.BinExp; +import dmd.Loc; +import dmd.Expression; +import dmd.Scope; +import dmd.InterState; +import dmd.Identifier; +import dmd.IRState; +import dmd.TOK; +import dmd.Id; +import dmd.Type; +import dmd.backend.elem; +import dmd.backend.OPER; +import dmd.expression.Util; + +class ShlAssignExp : BinExp +{ + this(Loc loc, Expression e1, Expression e2) + { + super(loc, TOK.TOKshlass, ShlAssignExp.sizeof, e1, e2); + } + + Expression semantic(Scope sc) + { + Expression e; + + //printf("ShlAssignExp.semantic()\n"); + BinExp.semantic(sc); + e2 = resolveProperties(sc, e2); + + e = op_overload(sc); + if (e) + return e; + + e1 = e1.modifiableLvalue(sc, e1); + e1.checkScalar(); + e1.checkNoBool(); + type = e1.type; + typeCombine(sc); + e1.checkIntegral(); + e2 = e2.checkIntegral(); + e2 = e2.castTo(sc, Type.tshiftcnt); + return this; + } + + Expression interpret(InterState* istate) + { + assert(false); + } + + Identifier opId() /* For operator overloading */ + { + return Id.shlass; + } + + elem* toElem(IRState* irs) + { + return toElemBin(irs,OPshlass); + } +} \ No newline at end of file