Exemple #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);
         }
     }
 }
Exemple #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);
        }
Exemple #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;
            }
        }
Exemple #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");
 }
Exemple #5
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     Result = snapshot.CreateDouble(value.Value);
 }
Exemple #6
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     containsLong = true;
     minLong      = Math.Min(minLong, value.Value);
     maxLong      = Math.Max(maxLong, value.Value);
 }
Exemple #7
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     result = value.Value.ToString();
 }
Exemple #8
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     numberFound();
 }
Exemple #9
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     result         = TypeConversion.ToString(OutSet, value);
     abstractResult = null;
 }
Exemple #10
0
 /// <inheritdoc />
 public override void VisitLongintValue(LongintValue value)
 {
     Max = Math.Max(Max, value.Value);
 }