Ejemplo n.º 1
0
 public void Div(Operand result, Operand left, Operand right)
 {
     Primitive type = (Primitive)Math.Max((int)left.PType, (int)right.PType);
       if (!right.AsBoolean)
     result.Set(Primitive.Error, false, right.IsConst);
       else
     result.Set(type, left.AsSigned / right.AsSigned, left.IsConst && right.IsConst);
 }
Ejemplo n.º 2
0
 private static void orLogic(Operand result, Operand left, Operand right)
 {
     if (left.PType == Primitive.Error)
     result.Set(Primitive.Error, false, left.IsConst);
       else if (left.AsBoolean)
     result.Set(Primitive.Boolean, true, left.IsConst);
       else if (right.PType == Primitive.Error)
     result.Set(Primitive.Error, false, left.IsConst && right.IsConst);
       else
     result.Set(Primitive.Boolean, right.AsBoolean, left.IsConst && right.IsConst);
 }
Ejemplo n.º 3
0
 private static void isError(Operand result, Operand left, Operand right)
 {
     result.Set(Primitive.Error, false, left.IsConst && right.IsConst);
 }
Ejemplo n.º 4
0
 public void Sub(Operand result, Operand left, Operand right)
 {
     Primitive type = (Primitive)Math.Max((int)left.PType, (int)right.PType);
       result.Set(type, left.AsSigned - right.AsSigned, left.IsConst && right.IsConst);
 }
Ejemplo n.º 5
0
 public void NotEquals(Operand result, Operand left, Operand right)
 {
     result.Set(Primitive.Boolean, left.AsSigned != right.AsSigned, left.IsConst && right.IsConst);
 }
Ejemplo n.º 6
0
 public void Not(Operand result, Operand left, Operand right)
 {
     result.Set(Primitive.Boolean, !right.AsBoolean, right.IsConst);
 }
Ejemplo n.º 7
0
 public void MoreEq(Operand result, Operand left, Operand right)
 {
     result.Set(Primitive.Boolean, left.AsSigned >= right.AsSigned, left.IsConst && right.IsConst);
 }
Ejemplo n.º 8
0
 public void Sub(Operand result, Operand left, Operand right)
 {
     result.Set(Primitive.Error, false, left.IsConst && right.IsConst);
 }
Ejemplo n.º 9
0
 public void Equals(Operand result, Operand left, Operand right)
 {
     result.Set(Primitive.Boolean, left.AsBoolean == right.AsBoolean, left.IsConst && right.IsConst);
 }
Ejemplo n.º 10
0
 public void Add(Operand result, Operand left, Operand right)
 {
     // TODO IsConst -> likely to be const type so const.
       result.Set(Primitive.Error, false, left.IsConst && right.IsConst);
 }
Ejemplo n.º 11
0
 public void LessEq(Operand result, Operand left, Operand right)
 {
     result.Set(Primitive.Boolean, left.AsUnsigned <= right.AsUnsigned, left.IsConst && right.IsConst);
 }
Ejemplo n.º 12
0
 public void Mul(Operand result, Operand left, Operand right)
 {
     Primitive type = (Primitive)Math.Max((int)left.PType, (int)right.PType);
       result.Set(type, left.AsDecimal * right.AsDecimal, left.IsConst && right.IsConst);
 }
Ejemplo n.º 13
0
 public void More(Operand result, Operand left, Operand right)
 {
     result.Set(Primitive.Boolean, left.AsDecimal > right.AsDecimal, left.IsConst && right.IsConst);
 }