Mercurial > projects > ddmd
annotate dmd/AndAssignExp.d @ 117:fe941d774f4a
+ ctfe of assign operations
author | Trass3r |
---|---|
date | Thu, 02 Sep 2010 02:50:19 +0200 |
parents | e28b18c23469 |
children | 9e39c7de8438 |
rev | line source |
---|---|
0 | 1 module dmd.AndAssignExp; |
2 | |
114 | 3 import dmd.common; |
117 | 4 import dmd.expression.And; |
0 | 5 import dmd.BinExp; |
6 import dmd.Loc; | |
7 import dmd.Expression; | |
8 import dmd.Scope; | |
9 import dmd.InterState; | |
10 import dmd.OutBuffer; | |
11 import dmd.ArrayTypes; | |
12 import dmd.Identifier; | |
13 import dmd.IRState; | |
14 import dmd.TOK; | |
15 import dmd.Id; | |
16 | |
17 import dmd.backend.elem; | |
18 import dmd.backend.OPER; | |
19 | |
20 class AndAssignExp : BinExp | |
21 { | |
22 this(Loc loc, Expression e1, Expression e2) | |
23 { | |
24 super(loc, TOK.TOKandass, AndAssignExp.sizeof, e1, e2); | |
25 } | |
26 | |
72 | 27 override Expression semantic(Scope sc) |
0 | 28 { |
29 return commonSemanticAssignIntegral(sc); | |
30 } | |
31 | |
72 | 32 override Expression interpret(InterState istate) |
0 | 33 { |
117 | 34 return interpretAssignCommon(istate, &And); |
0 | 35 } |
36 | |
72 | 37 override void buildArrayIdent(OutBuffer buf, Expressions arguments) |
0 | 38 { |
12
832f71e6f96c
*Exp and *AssignExp arrayOp implementation added (might be a bit incomplete)
korDen
parents:
0
diff
changeset
|
39 AssignExp_buildArrayIdent(buf, arguments, "And"); |
0 | 40 } |
41 | |
72 | 42 override Expression buildArrayLoop(Arguments fparams) |
0 | 43 { |
44 assert(false); | |
45 } | |
46 | |
72 | 47 override Identifier opId() /* For operator overloading */ |
0 | 48 { |
49 return Id.andass; | |
50 } | |
51 | |
72 | 52 override elem* toElem(IRState* irs) |
0 | 53 { |
54 return toElemBin(irs, OPER.OPandass); | |
55 } | |
72 | 56 } |