Ejemplo n.º 1
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     if (isIncrement)
     {
         if (value.Value < long.MaxValue)
         {
             result = OutSet.CreateLong(value.Value + 1);
         }
         else
         {
             result = OutSet.CreateDouble(TypeConversion.ToFloat(value.Value) + 1.0);
         }
     }
     else
     {
         if (value.Value > long.MinValue)
         {
             result = OutSet.CreateLong(value.Value - 1);
         }
         else
         {
             result = OutSet.CreateDouble(TypeConversion.ToFloat(value.Value) - 1.0);
         }
     }
 }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public override void VisitLongintValue(LongintValue value)
        {
            IntegerValue integerValue;

            if (TypeConversion.TryConvertToInteger(OutSet, value, out integerValue))
            {
                integerIndex = integerValue;
            }
            else
            {
                integerIndex = null;
            }

            base.VisitLongintValue(value);
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public override void VisitLongintValue(LongintValue value)
        {
            switch (operation)
            {
            case Operations.Plus:
                result = value;
                break;

            case Operations.Minus:
                // Result of arithmetic negation can overflow
                if ((value.Value == 0) || ((-value.Value) != 0))
                {
                    result = OutSet.CreateLong(-value.Value);
                }
                else
                {
                    // <seealso cref="UnaryOperationEvaluator.VisitIntegerValue" />
                    result = OutSet.CreateDouble(-(TypeConversion.ToFloat(value.Value)));
                }
                break;

            case Operations.BitNegation:
                result = OutSet.CreateLong(~value.Value);
                break;

            case Operations.Int32Cast:
                IntegerValue convertedValue;
                if (TypeConversion.TryConvertToInteger(OutSet, value, out convertedValue))
                {
                    result = convertedValue;
                }
                else
                {
                    result = OutSet.AnyIntegerValue;
                }
                break;

            case Operations.FloatCast:
            case Operations.DoubleCast:
                result = TypeConversion.ToFloat(Snapshot, value);
                break;

            default:
                base.VisitLongintValue(value);
                break;
            }
        }
Ejemplo n.º 4
0
 /// <inheritdoc />
 /// <exception cref="System.NotSupportedException">Thrown always</exception>
 public override void VisitLongintValue(LongintValue value)
 {
     throw new NotSupportedException("Long integer is not currently supported");
 }
Ejemplo n.º 5
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     Result = snapshot.CreateDouble(value.Value);
 }
Ejemplo n.º 6
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     containsLong = true;
     minLong      = Math.Min(minLong, value.Value);
     maxLong      = Math.Max(maxLong, value.Value);
 }
Ejemplo n.º 7
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     result = value.Value.ToString();
 }
Ejemplo n.º 8
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     numberFound();
 }
Ejemplo n.º 9
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     result         = TypeConversion.ToString(OutSet, value);
     abstractResult = null;
 }
Ejemplo n.º 10
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     Max = Math.Max(Max, value.Value);
 }