コード例 #1
0
 public override Field Convert(GroupValue fieldDef, ITemplateRegistry templateRegistry, ConversionContext context)
 {
     var name = new QName(fieldDef.GetString("Name"), fieldDef.GetString("Ns"));
     bool optional = fieldDef.GetBool("Optional");
     GroupValue exponentDef = fieldDef.GetGroup("Exponent");
     GroupValue exponentOperatorDef = exponentDef.GetGroup("Operator").GetGroup(0);
     Operator exponentOperator = GetOperator(exponentOperatorDef.Group);
     ScalarValue exponentDefaultValue = ScalarValue.Undefined;
     if (exponentDef.IsDefined("InitialValue"))
         exponentDefaultValue = new IntegerValue(exponentDef.GetInt("InitialValue"));
     GroupValue mantissaDef = fieldDef.GetGroup("Mantissa");
     GroupValue mantissaOperatorDef = mantissaDef.GetGroup("Operator").GetGroup(0);
     Operator mantissaOperator = GetOperator(mantissaOperatorDef.Group);
     ScalarValue mantissaDefaultValue = ScalarValue.Undefined;
     if (mantissaDef.IsDefined("InitialValue"))
         mantissaDefaultValue = new LongValue(mantissaDef.GetInt("InitialValue"));
     ComposedScalar composedDecimal = Util.ComposedDecimal(name, exponentOperator, exponentDefaultValue,
                                                           mantissaOperator, mantissaDefaultValue, optional);
     IFieldValue retAuxId;
     if (fieldDef.TryGetValue("AuxId", out retAuxId) && retAuxId!=null)
     {
         composedDecimal.Id = retAuxId.ToString();
     }
     return composedDecimal;
 }
コード例 #2
0
        public void TestLessThan()
        {
            // Arrange
            var nine = new IntegerValue(9);
            var three = new IntegerValue(3);

            // Act & Assert
            Assert.IsFalse(((BooleanValue)nine.IsLessThan(three)).Val);
            Assert.IsTrue(((BooleanValue)three.IsLessThan(nine)).Val);
        }
コード例 #3
0
        public void TestDividedBy()
        {
            // Arrange
            var nine = new IntegerValue(9);
            var three = new IntegerValue(3);

            // Act & Assert
            Assert.AreEqual<int>(3, ((IntegerValue)nine.DividedBy(three)).Val);
            Assert.AreEqual<int>(0, ((IntegerValue)three.DividedBy(nine)).Val);
        }
コード例 #4
0
        public void TestIsEqualTo()
        {
            // Arrange
            var sevenA = new IntegerValue(7);
            var sevenB = new IntegerValue(7);
            var five = new IntegerValue(5);

            // Act & Assert
            Assert.IsTrue(((BooleanValue)sevenA.IsEqualTo(sevenB)).Val);
            Assert.IsFalse(((BooleanValue)sevenA.IsEqualTo(five)).Val);
        }
コード例 #5
0
        public void DirectLosslessConversionsTest()
        {
            IntegerValue int1 = new IntegerValue(35);

            RationalValue rat1 = ValueConverter<RationalValue>.ConvertFrom(int1);
            Assert.AreEqual(35, rat1.NumeratorValue, "01");
            Assert.AreEqual(1, rat1.DenominatorValue, "02");

            RealValue real1 = ValueConverter<RealValue>.ConvertFrom(rat1);
            Assert.AreEqual(35d, real1.Value, 0.0001d, "03");
        }
コード例 #6
0
        public void TestLessThanOrEqualTo()
        {
            // Arrange
            var nineA = new IntegerValue(9);
            var nineB = new IntegerValue(9);
            var three = new IntegerValue(3);

            // Act & Assert
            Assert.IsTrue(((BooleanValue)nineA.IsLessThanOrEqualTo(nineB)).Val);
            Assert.IsTrue(((BooleanValue)three.IsLessThanOrEqualTo(nineA)).Val);
            Assert.IsFalse(((BooleanValue)nineA.IsLessThanOrEqualTo(three)).Val);
        }
コード例 #7
0
        public void TestMinus()
        {
            // Arrange
            var seven = new IntegerValue(7);
            var five = new IntegerValue(5);
            var minFour = new IntegerValue(-4);

            // Act & Assert
            Assert.AreEqual<int>(2, ((IntegerValue)seven.Minus(five)).Val);
            Assert.AreEqual<int>(-2, ((IntegerValue)five.Minus(seven)).Val);
            Assert.AreEqual<int>(11, ((IntegerValue)seven.Minus(minFour)).Val);
            Assert.AreEqual<int>(0, ((IntegerValue)minFour.Minus(minFour)).Val);
        }
コード例 #8
0
        public void TestMultipliedBy()
        {
            // Arrange
            var seven = new IntegerValue(7);
            var five = new IntegerValue(5);
            var minFour = new IntegerValue(-4);

            // Act & Assert
            Assert.AreEqual<int>(35, ((IntegerValue)seven.MultipliedBy(five)).Val);
            Assert.AreEqual<int>(35, ((IntegerValue)five.MultipliedBy(seven)).Val);
            Assert.AreEqual<int>(16, ((IntegerValue)minFour.MultipliedBy(minFour)).Val);
            Assert.AreEqual<int>(-20, ((IntegerValue)minFour.MultipliedBy(five)).Val);
        }
コード例 #9
0
 public override Field Convert(GroupValue fieldDef, TemplateRegistry templateRegistry, ConversionContext context)
 {
     var name = new QName(fieldDef.GetString("Name"), fieldDef.GetString("Ns"));
     bool optional = fieldDef.GetBool("Optional");
     var exponentDef = fieldDef.GetGroup("Exponent");
     var exponentOperatorDef = exponentDef.GetGroup("Operator").GetGroup(0);
     var exponentOperator = GetOperator(exponentOperatorDef.GetGroup());
     var exponentDefaultValue = ScalarValue.UNDEFINED;
     if (exponentDef.IsDefined("InitialValue"))
         exponentDefaultValue = new IntegerValue(exponentDef.GetInt("InitialValue"));
     var mantissaDef = fieldDef.GetGroup("Mantissa");
     var mantissaOperatorDef = mantissaDef.GetGroup("Operator").GetGroup(0);
     var mantissaOperator = GetOperator(mantissaOperatorDef.GetGroup());
     var mantissaDefaultValue = ScalarValue.UNDEFINED;
     if (mantissaDef.IsDefined("InitialValue"))
         mantissaDefaultValue = new LongValue(mantissaDef.GetInt("InitialValue"));
     return Util.ComposedDecimal(name, exponentOperator, exponentDefaultValue, mantissaOperator, mantissaDefaultValue, optional);
 }
コード例 #10
0
        public static ITheorem[] BuildTheorems(Context context)
        {
            ITheorem[] theorems = new ITheorem[1];

            theorems[0] = new Analysis.DerivativeTransformation(context.Library.LookupEntity(_entityId),
                                                                delegate(Port port, SignalSet manipulatedInputs, Signal variable, bool hasManipulatedInputs)
            {
                Builder b         = context.Builder;
                Signal two        = IntegerValue.ConstantTwo(context);
                SignalSet outputs = new SignalSet();
                for (int i = 0; i < manipulatedInputs.Count; i++)
                {
                    outputs.Add(b.MultiplySimplified(two, port.InputSignals[i], manipulatedInputs[i]));
                }
                return(outputs);
            });

            return(theorems);
        }
コード例 #11
0
        public void Ctor_ValueParameters_ValuesAreSet()
        {
            var stringValue = new StringValue("SomeValue");
            var intValue    = new IntegerValue(12345);

            var methodResult = new XmlRpcMethodResult(stringValue, intValue);

            Assert.False(methodResult.IsFaulted);
            Assert.Null(methodResult.FaultString);
            Assert.Equal(0, methodResult.FaultCode);

            Assert.Equal(2, methodResult.Values.Count());

            Assert.Same(stringValue, methodResult.Values.First());
            Assert.Same(intValue, methodResult.Values.Last());

            Assert.Equal("SomeValue", methodResult.Values.First().GetValue <string>());
            Assert.Equal(12345, methodResult.Values.Last().GetValue <int>());
        }
コード例 #12
0
        public static Signal Denominator(Signal signal)
        {
            if (signal.IsDrivenByPortEntity("Divide", "Std") && signal.DrivenByPort.InputSignalCount > 1)
            {
                if (signal.DrivenByPort.InputSignals.Count == 2)
                {
                    return(signal.DrivenByPort.InputSignals[1]);
                }

                List <Signal>     factors = new List <Signal>();
                ReadOnlySignalSet inputs  = signal.DrivenByPort.InputSignals;
                for (int i = 1; i < inputs.Count; i++) //all but first element
                {
                    factors.Add(inputs[i]);
                }
                return(signal.Context.Builder.MultiplySimplified(factors));
            }
            return(IntegerValue.ConstantOne(signal.Context));
        }
コード例 #13
0
        /// <summary>
        /// Returns the coefficient factor in the monomial <see cref="signal"/>
        /// </summary>
        /// <returns>
        /// Constant UndefinedSymbol if <see cref="signal"/> is not a single-variable monomial.
        /// Otherwise the coefficient factor of the term.
        /// </returns>
        /// </returns>
        /// <remarks><see cref="signal"/> is assumed to be automatic simplified.</remarks>
        public static Signal MonomialCoefficient(Signal signal, Signal variable, out ValueStructure degree)
        {
            if (signal == null)
            {
                throw new ArgumentNullException("signal");
            }

            if (IsConstantAdditiveIdentity(signal))
            {
                degree = NegativeInfinitySymbol.Instance;
                return(signal);
            }
            if (IsAlwaysRational(signal))
            {
                degree = IntegerValue.Zero;
                return(signal);
            }
            Signal coeff = IntegerValue.ConstantOne(signal.Context);

            if (signal.IsDrivenByPortEntity("Multiply", "Std") && signal.DrivenByPort.InputSignalCount == 2 && IsAlwaysRational(signal.DrivenByPort.InputSignals[0]))
            {
                coeff  = signal.DrivenByPort.InputSignals[0];
                signal = signal.DrivenByPort.InputSignals[1];
            }
            if (signal.Equals(variable))
            {
                degree = IntegerValue.One;
                return(coeff);
            }
            if (signal.IsDrivenByPortEntity("Power", "Std"))
            {
                Signal b = signal.DrivenByPort.InputSignals[0];
                Signal e = signal.DrivenByPort.InputSignals[1];
                if (b.Equals(variable) && Std.IsAlwaysPositiveInteger(e))
                {
                    degree = e.Value;
                    return(coeff);
                }
            }
            degree = UndefinedSymbol.Instance;
            return(UndefinedSymbol.Constant(signal.Context));
        }
コード例 #14
0
ファイル: GVar.cs プロジェクト: cvkumar/out-of-body
        /**
         * <summary>Returns the variable's value.</summary>
         * <returns>The value, as a formatted string.</returns>
         */
        public string GetValue(int languageNumber = 0)
        {
            if (!canTranslate)
            {
                languageNumber = 0;
            }

            switch (type)
            {
            case VariableType.Integer:
                return(IntegerValue.ToString());

            case VariableType.PopUp:
                return(GetPopUpForIndex(val, languageNumber));

            case VariableType.Float:
                return(FloatValue.ToString());

            case VariableType.Boolean:
                return(BooleanValue.ToString());

            case VariableType.Vector3:
                return("(" + Vector3Value.x.ToString() + ", " + Vector3Value.y.ToString() + ", " + Vector3Value.z.ToString() + ")");

            case VariableType.String:
                if (languageNumber > 0)
                {
                    if (runtimeTranslations == null)
                    {
                        CreateRuntimeTranslations();
                    }
                    if (runtimeTranslations != null && runtimeTranslations.Length >= languageNumber)
                    {
                        return(runtimeTranslations[languageNumber - 1]);
                    }
                }
                return(textVal);

            default:
                return(string.Empty);
            }
        }
コード例 #15
0
        /// <inheritdoc />
        public override void VisitIntegerValue(IntegerValue 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.CreateInt(-value.Value);
                }
                else
                {
                    // If the number has the lowest value (the most important bit is 1, others are 0
                    // in binary), arithmetic negation of it is zero. PHP behaves differently.
                    // It converts the number to the same positive value, but that cause overflow.
                    // Then integer value is converted to appropriate float value
                    result = OutSet.CreateDouble(-TypeConversion.ToFloat(value.Value));
                }
                break;

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

            case Operations.Int32Cast:
                result = value;
                break;

            case Operations.FloatCast:
            case Operations.DoubleCast:
                result = OutSet.CreateDouble(value.Value);
                break;

            default:
                base.VisitIntegerValue(value);
                break;
            }
        }
コード例 #16
0
ファイル: Polynomial.cs プロジェクト: hnjm/mathnet-yttrium
        public static Signal PolynomialLeadingCoefficient(Signal signal, Signal variable)
        {
            if (signal == null)
            {
                throw new ArgumentNullException("signal");
            }

            IValueStructure degree = PolynomialDegree(signal, variable);
            IntegerValue    iv     = degree as IntegerValue;

            if (iv != null)
            {
                return(PolynomialCoefficient(signal, variable, (int)iv.Value));
            }
            if (degree is NegativeInfinitySymbol)
            {
                return(IntegerValue.ConstantZero);
            }
            return(UndefinedSymbol.Constant);
        }
コード例 #17
0
 public Signal ManipulateSignal(Signal original, Signal replacement, bool isReplaced)
 {
     if (!isReplaced)
     {
         if (_variable.Equals(original))
         {
             return(IntegerValue.ConstantOne(_variable.Context));
         }
         if (original.IsSourceSignal)
         {
             return(IntegerValue.ConstantZero(_variable.Context));
         }
         if (original.Hold)
         {
             Port p = original.Context.Library.LookupEntity(new MathIdentifier("Derive", "Std")).InstantiatePort(original.Context, original, _variable);
             return(p.OutputSignals[0]);
         }
     }
     return(replacement);
 }
コード例 #18
0
        /// <inheritdoc />
        public override void VisitIntegerValue(IntegerValue value)
        {
            switch (operation)
            {
            case Operations.Identical:
            case Operations.NotIdentical:
                result = OutSet.AnyBooleanValue;
                break;

            default:
                result = ArithmeticOperation.LeftAbstractArithmetic(flow, operation, value.Value);
                if (result != null)
                {
                    break;
                }

                base.VisitIntegerValue(value);
                break;
            }
        }
コード例 #19
0
        public void PolynomialDivisionTest()
        {
            Signal x = Binder.CreateSignal();

            x.Label = "x";

            Signal c0  = IntegerValue.ConstantZero;
            Signal c1  = IntegerValue.ConstantOne;
            Signal c3  = IntegerValue.Constant(3);
            Signal c3n = IntegerValue.Constant(-3);
            Signal c5  = IntegerValue.Constant(5);

            Signal a = Polynomial.ConstructPolynomial(x, c5, c1, c1, c3);
            Signal b = Polynomial.ConstructPolynomial(x, c1, c3n, c5);

            Assert.AreEqual("5+x+x^2+3*x^3", Service <IFormatter> .Instance.Format(a, FormattingOptions.Compact), "X01");
            Assert.AreEqual("1+-3*x+5*x^2", Service <IFormatter> .Instance.Format(b, FormattingOptions.Compact), "X02");

            Assert.AreEqual(c5.Value, Polynomial.PolynomialCoefficient(a, x, 0).Value, "A01");
            Assert.AreEqual(c1.Value, Polynomial.PolynomialCoefficient(a, x, 1).Value, "A02");
            Assert.AreEqual(c1.Value, Polynomial.PolynomialCoefficient(a, x, 2).Value, "A03");
            Assert.AreEqual(c3.Value, Polynomial.PolynomialCoefficient(a, x, 3).Value, "A04");
            Assert.AreEqual(c1.Value, Polynomial.PolynomialCoefficient(b, x, 0).Value, "A05");
            Assert.AreEqual(c3n.Value, Polynomial.PolynomialCoefficient(b, x, 1).Value, "A06");
            Assert.AreEqual(c5.Value, Polynomial.PolynomialCoefficient(b, x, 2).Value, "A07");

            Signal remainder;
            Signal quotient = Polynomial.PolynomialDivision(a, b, x, out remainder);

            Signal[] quotientCoeff = Polynomial.PolynomialCoefficients(quotient, x);
            Assert.AreEqual(2, quotientCoeff.Length, "B01");
            Assert.AreEqual(new RationalValue(14, 25), quotientCoeff[0].Value, "B02");
            Assert.AreEqual(new RationalValue(3, 5), quotientCoeff[1].Value, "B03");
            Assert.AreEqual("14/25+(3/5)*x", Service <IFormatter> .Instance.Format(quotient, FormattingOptions.Compact), "B04");

            Signal[] remainderCoeff = Polynomial.PolynomialCoefficients(remainder, x);
            Assert.AreEqual(2, remainderCoeff.Length, "C01");
            Assert.AreEqual(new RationalValue(111, 25), remainderCoeff[0].Value, "C02");
            Assert.AreEqual(new RationalValue(52, 25), remainderCoeff[1].Value, "C03");
            Assert.AreEqual("111/25+(52/25)*x", Service <IFormatter> .Instance.Format(remainder, FormattingOptions.Compact), "C04");
        }
コード例 #20
0
ファイル: Polynomial.cs プロジェクト: hnjm/mathnet-yttrium
        public static Signal ConstructPolynomial(Signal variable, params Signal[] coefficients)
        {
            Signal[] summands = new Signal[coefficients.Length];
            for (int i = 0; i < summands.Length; i++)
            {
                Signal coeff = coefficients[i];
                if (Std.IsConstantAdditiveIdentity(coeff))
                {
                    summands[i] = coeff;
                    continue;
                }

                if (i == 0)
                {
                    summands[0] = coeff;
                }
                else if (i == 1)
                {
                    if (Std.IsConstantMultiplicativeIdentity(coeff))
                    {
                        summands[1] = variable;
                    }
                    else
                    {
                        summands[1] = StdBuilder.Multiply(coeff, variable);
                    }
                }
                else
                {
                    if (Std.IsConstantMultiplicativeIdentity(coeff))
                    {
                        summands[i] = StdBuilder.Power(variable, IntegerValue.Constant(i));
                    }
                    else
                    {
                        summands[i] = StdBuilder.Multiply(coeff, StdBuilder.Power(variable, IntegerValue.Constant(i)));
                    }
                }
            }
            return(Std.Add(summands));
        }
コード例 #21
0
        /// <inheritdoc />
        public override void VisitIntegerValue(IntegerValue value)
        {
            switch (operation)
            {
            case Operations.Mod:
                // When dividend is true and divisor != +-1, result is 1, otherwise 0
                result = ModuloOperation.Modulo(flow,
                                                TypeConversion.ToInteger(leftOperand.Value), value.Value);
                break;

            default:
                var rightBoolean = TypeConversion.ToBoolean(value.Value);
                result = Comparison.Compare(OutSet, operation, leftOperand.Value, rightBoolean);
                if (result != null)
                {
                    break;
                }

                var leftInteger = TypeConversion.ToInteger(leftOperand.Value);
                result = ArithmeticOperation.Arithmetic(flow, operation, leftInteger, value.Value);
                if (result != null)
                {
                    break;
                }

                result = LogicalOperation.Logical(OutSet, operation, leftOperand.Value, rightBoolean);
                if (result != null)
                {
                    break;
                }

                result = BitwiseOperation.Bitwise(OutSet, operation, leftInteger, value.Value);
                if (result != null)
                {
                    break;
                }

                base.VisitIntegerValue(value);
                break;
            }
        }
コード例 #22
0
        /// <inheritdoc />
        public override void VisitIntegerValue(IntegerValue value)
        {
            switch (operation)
            {
            case Operations.Mod:
                // Ommitted warning message that object cannot be converted to integer
                result = ModuloOperation.AbstractModulo(flow, value.Value);
                break;

            default:
                result = LogicalOperation.AbstractLogical(OutSet, operation,
                                                          TypeConversion.ToBoolean(value.Value));
                if (result != null)
                {
                    break;
                }

                base.VisitIntegerValue(value);
                break;
            }
        }
コード例 #23
0
 public Message Decode(System.IO.Stream in_Renamed, int templateId, BitVectorReader presenceMapReader, Context context)
 {
     try
     {
         if (context.TraceEnabled)
         {
             context.DecodeTrace.GroupStart(this);
         }
         FieldValue[] fieldValues = DecodeFieldValues(in_Renamed, this, presenceMapReader, context);
         fieldValues[0] = new IntegerValue(templateId);
         var message = new Message(this, fieldValues);
         if (context.TraceEnabled)
         {
             context.DecodeTrace.GroupEnd();
         }
         return(message);
     }
     catch (FastException e)
     {
         throw new FastException("An error occurred while decoding " + this, e.Code, e);
     }
 }
コード例 #24
0
        private void SigmaN(Command cmd, int requiredArgCount, int skipCount)
        {
            this.RequireArgs(requiredArgCount);
            var   values = cmd.UseTopValues(requiredArgCount).Skip(skipCount).ToList();
            Value result;
            int   count = values.Count;

            if (count >= 1)
            {
                result = values[0];
                for (int i = 1; i < count; i++)
                {
                    result = Value.Add(result, values[i], this.Calc);
                }
            }
            else
            {
                result = new IntegerValue(0);
            }

            cmd.Commit(result);
        }
コード例 #25
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (feedAttributeId_ != null)
            {
                hash ^= FeedAttributeId.GetHashCode();
            }
            if (integerValue_ != null)
            {
                hash ^= IntegerValue.GetHashCode();
            }
            if (booleanValue_ != null)
            {
                hash ^= BooleanValue.GetHashCode();
            }
            if (stringValue_ != null)
            {
                hash ^= StringValue.GetHashCode();
            }
            if (doubleValue_ != null)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleValue);
            }
            if (priceValue_ != null)
            {
                hash ^= PriceValue.GetHashCode();
            }
            hash ^= integerValues_.GetHashCode();
            hash ^= booleanValues_.GetHashCode();
            hash ^= stringValues_.GetHashCode();
            hash ^= doubleValues_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #26
0
        public static BoogieLiteralExpression make(LiteralExpr boogieLiteral)
        {
            Value value = null;

            if (boogieLiteral.isBigNum)
            {
                value = IntegerValue.make(new BigInteger(boogieLiteral.asBigNum.ToByteArray()));
            }
            else if (boogieLiteral.IsTrue)
            {
                value = BooleanValue.makeBooleanValue(true);
            }
            else if (boogieLiteral.IsFalse)
            {
                value = BooleanValue.makeBooleanValue(false);
            }
            else
            {
                throw new NotImplementedException();
            }
            //TODO:BitVector literals
            return(new BoogieLiteralExpression(boogieLiteral, value));
        }
コード例 #27
0
        public void TestGeneration()
        {
            var k1 = new StringValue("1");
            var k2 = new StringValue("2");

            var v1 = new IntegerValue(1);
            var v2 = new IntegerValue(2);

            var allvals = new Tuple <IExpression, IExpression>[] {
                new Tuple <IExpression, IExpression>(k1, v1),
                new Tuple <IExpression, IExpression>(k2, v2),
            };

            var dv = new DictionaryValue(allvals);
            var c  = new RootContext();
            var o  = dv.Evaluate(c);

            Assert.IsInstanceOfType(o, typeof(IDictionary <object, object>), "Dict type");
            var od = o as IDictionary <object, object>;

            Assert.AreEqual(1, od["1"], "value of 1");
            Assert.AreEqual(2, od["2"], "value of 2");
        }
コード例 #28
0
        public override RuntimeValue Execute(ExecutionContext context)
        {
            var symbol = context.CurrentScope.GetSymbol(identifier, identifier.Name);
            var value  = symbol.Value.AsInteger(identifier);

            switch (op)
            {
            case UpdateOperator.Increment:
                value++;
                break;

            case UpdateOperator.Decrement:
                value--;
                break;

            default:
                throw new NotImplementedException($"Update operator {op} not implemented");
            }
            var newValue = IntegerValue.Create(value);

            symbol.Update(Node, newValue);
            return(newValue);
        }
コード例 #29
0
 public override void SetListValues(string text)
 {
     _valueList.Clear( );
     foreach (Match match in Regex.Matches(text, CornerValue.stringRegex, RegexOptions.IgnoreCase))
     {
         if (Data.Degrees == true)
         {
             if (!CornerValue.IsCheck(match.Value))
             {
                 continue;
             }
             Value valueObject = new CornerValue(match.Value);
             int   value       = Convert.ToInt32(valueObject.Data);
             if (value < 0)
             {
                 valueObject.Data = 0;
             }
             if (value > 360)
             {
                 valueObject.Data = 360;
             }
             else
             {
                 valueObject.Data = value;
             }
             _valueList.Add(valueObject);
         }
         else
         {
             if (!IntegerValue.IsCheck(match.Value))
             {
                 continue;
             }
             _valueList.Add(new IntegerValue(match.Value));
         }
     }
 }
コード例 #30
0
        public override string ToString()
        {
            switch (ValueType)
            {
            case "Boolean":
                return(BooleanValue.ToString());

            case "DateTime":
                return(DateTimeValue.ToString());

            case "Decimal":
                return(DecimalValue.ToString());

            case "Integer":
                return(IntegerValue.ToString());

            case "LongText":
                return(LongTextValue);

            case "ShortText":
                return(ShortTextValue);
            }
            return(base.ToString());
        }
コード例 #31
0
        public void OpenXmlSimpleTypeConverterTest()
        {
            // 1. Base64BinaryValue
            Base64BinaryValue base64 = new Base64BinaryValue();
            base64 = "AA3322";
            Assert.True("AA3322" == base64);
            Assert.Equal("AA3322", base64.Value);
            base64 = Base64BinaryValue.FromString("1234");
            Assert.Equal("1234", base64.ToString());
            Assert.Equal("1234", Base64BinaryValue.ToString(base64));

            // 2. BooleanValue
            BooleanValue booleanValue = new BooleanValue();
            booleanValue = true;
            Assert.True(booleanValue);
            Assert.True(booleanValue.Value);
            booleanValue = BooleanValue.FromBoolean(false);
            Assert.False(booleanValue);
            Assert.Equal(false, BooleanValue.ToBoolean(booleanValue));

            // 3. ByteValue
            ByteValue byteValue = new ByteValue();
            Byte bt = 1;
            byteValue = bt;
            Assert.True(bt == byteValue);
            Assert.Equal(bt, byteValue.Value);
            bt = 2;
            byteValue = ByteValue.FromByte(bt);
            Assert.Equal(bt, ByteValue.ToByte(byteValue));

            // 4. DateTimeValue
            DateTimeValue dtValue = new DateTimeValue();
            DateTime dt = DateTime.Now;
            dtValue = dt;
            Assert.True(dt == dtValue);
            dt = DateTime.Now.AddDays(1);
            dtValue = DateTimeValue.FromDateTime(dt);
            Assert.Equal(dt, dtValue.Value);
            Assert.Equal(dt, DateTimeValue.ToDateTime(dt));

            // 5. DecimalValue
            DecimalValue decimalValue = new DecimalValue();
            decimal dcm = 10;
            decimalValue = dcm;
            Assert.True(dcm == decimalValue);
            decimalValue = DecimalValue.FromDecimal(20);
            Assert.Equal(20, decimalValue.Value);
            Assert.Equal(20, DecimalValue.ToDecimal(decimalValue));

            // 6. DoubleValue
            DoubleValue doubleValue = new DoubleValue();
            double dbl = 1.1;
            doubleValue = dbl;
            Assert.True(dbl == doubleValue);
            doubleValue = DoubleValue.FromDouble(2.2);
            Assert.Equal(2.2, doubleValue.Value);
            Assert.Equal(2.2, DoubleValue.ToDouble(doubleValue));

            // 7. HexBinaryValue
            HexBinaryValue hexBinaryValue = new HexBinaryValue();
            string hex = "0X99CCFF";
            hexBinaryValue = hex;
            Assert.True(hex == hexBinaryValue);
            hex = "111111";
            hexBinaryValue = HexBinaryValue.FromString(hex);
            Assert.Equal(hex, hexBinaryValue.Value);
            Assert.Equal(hex, HexBinaryValue.ToString(hexBinaryValue));

            // 8. Int16
            Int16Value int16Value = new Int16Value();
            Int16 int16 = 16;
            int16Value = int16;
            Assert.True(int16 == int16Value);
            int16 = 17;
            int16Value = Int16Value.FromInt16(int16);
            Assert.Equal(int16, int16Value.Value);
            Assert.Equal(int16, Int16Value.ToInt16(int16Value));

            // 9. Int32
            Int32Value int32Value = new Int32Value();
            Int32 int32 = 32;
            int32Value = int32;
            Assert.True(int32 == int32Value);
            int32 = 33;
            int32Value = Int32Value.FromInt32(int32);
            Assert.Equal(int32, int32Value.Value);
            Assert.Equal(int32, Int32Value.ToInt32(int32Value));

            // 10. Int64
            Int64Value int64Value = new Int64Value();
            Int64 int64 = 64;
            int64Value = int64;
            Assert.True(int64 == int64Value);
            int64 = 17;
            int64Value = Int64Value.FromInt64(int64);
            Assert.Equal(int64, int64Value.Value);
            Assert.Equal(int64, Int64Value.ToInt64(int64Value));

            // 11. IntegerValue
            IntegerValue integerValue = new IntegerValue();
            int integer = 64;
            integerValue = integer;
            Assert.True(integer == integerValue);
            integer = 17;
            integerValue = IntegerValue.FromInt64(integer);
            Assert.Equal(integer, integerValue.Value);
            Assert.Equal(integer, IntegerValue.ToInt64(integerValue));

            // 12. OnOffValue
            OnOffValue onOffValue = new OnOffValue();
            onOffValue = true;
            Assert.True(onOffValue);
            onOffValue = OnOffValue.FromBoolean(false);
            Assert.Equal(false, onOffValue.Value);
            Assert.Equal(false, OnOffValue.ToBoolean(onOffValue));

            // 13. SByteValue
            SByteValue sbyteValue = new SByteValue();
            SByte sbt = SByte.MaxValue;
            sbyteValue = sbt;
            Assert.True(sbt == sbyteValue);
            sbt = SByte.MinValue;
            sbyteValue = SByteValue.FromSByte(sbt);
            Assert.Equal(sbt, sbyteValue.Value);
            Assert.Equal(sbt, SByteValue.ToSByte(sbt));

            // 14. SingleValue
            SingleValue singleValue = new SingleValue();
            Single single = Single.MaxValue;
            singleValue = single;
            Assert.True(single == singleValue);
            single = Single.NaN;
            singleValue = SingleValue.FromSingle(single);
            Assert.Equal(single, singleValue.Value);
            Assert.Equal(single, SingleValue.ToSingle(singleValue));

            // 15. StringValue
            StringValue stringValue = new StringValue();
            String str = "Ethan";
            stringValue = str;
            Assert.True(str == stringValue);
            str = "Yin";
            stringValue = StringValue.FromString(str);
            Assert.Equal(str, stringValue.Value);
            Assert.Equal(str, stringValue.ToString());
            Assert.Equal(str, StringValue.ToString(stringValue));

            // 16. TrueFalseBlankValue
            TrueFalseBlankValue tfbValue = new TrueFalseBlankValue();
            tfbValue = true;
            Assert.True(tfbValue);
            tfbValue = TrueFalseBlankValue.FromBoolean(false);
            Assert.Equal(false, tfbValue.Value);
            Assert.Equal(false, TrueFalseBlankValue.ToBoolean(tfbValue));

            // 17. TrueFalseValue
            TrueFalseValue tfValue = new TrueFalseValue();
            tfValue = true;
            Assert.True(tfValue);
            tfValue = TrueFalseValue.FromBoolean(false);
            Assert.Equal(false, tfValue.Value);
            Assert.Equal(false, TrueFalseValue.ToBoolean(tfValue));

            // 18. UInt16Value
            UInt16Value uint16Value = new UInt16Value();
            UInt16 uint16 = UInt16.MaxValue;
            uint16Value = uint16;
            Assert.True(uint16 == uint16Value);
            uint16 = UInt16.MinValue;
            uint16Value = UInt16Value.FromUInt16(uint16);
            Assert.Equal(uint16, uint16Value.Value);
            Assert.Equal(uint16, UInt16Value.ToUInt16(uint16Value));

            // 19. UInt32Value
            UInt32Value uint32Value = new UInt32Value();
            UInt32 uint32 = UInt32.MaxValue;
            uint32Value = uint32;
            Assert.True(uint32 == uint32Value);
            uint32 = UInt32.MinValue;
            uint32Value = UInt32Value.FromUInt32(uint32);
            Assert.Equal(uint32, uint32Value.Value);
            Assert.Equal(uint32, UInt32Value.ToUInt32(uint32Value));

            // 20. UInt64Value
            UInt64Value uint64Value = new UInt64Value();
            UInt64 uint64 = UInt64.MaxValue;
            uint64Value = uint64;
            Assert.True(uint64 == uint64Value);
            uint64 = UInt64.MinValue;
            uint64Value = UInt64Value.FromUInt64(uint64);
            Assert.Equal(uint64, uint64Value.Value);
            Assert.Equal(uint64, UInt64Value.ToUInt64(uint64Value));
        }
コード例 #32
0
		public static void BindIntegerValue( XmlNode node, IntegerValue model, string defaultColumnName, bool isNullable, Mappings mappings )
		{
			BindSimpleValue( node, model, isNullable, defaultColumnName, mappings );

			if( model.ColumnCollection.Count > 1 )
			{
				log.Error( "This shouldn't happen, check BindIntegerValue" );
			}
			foreach( Column col in model.ColumnCollection )
			{
				col.Type = NHibernateUtil.Int32;
				col.TypeIndex = 0;
				break;
			}
		}
コード例 #33
0
		/// <remarks>
		/// Called for Lists, arrays, primitive arrays
		/// </remarks>>
		public static void BindListSecondPass( XmlNode node, List model, IDictionary classes, Mappings mappings )
		{
			BindCollectionSecondPass( node, model, classes, mappings );

			XmlNode subnode = node.SelectSingleNode( nsIndex, nsmgr );
			IntegerValue iv = new IntegerValue( model.CollectionTable );
			BindIntegerValue( subnode, iv, IndexedCollection.DefaultIndexColumnName, model.IsOneToMany, mappings );
			model.Index = iv;
		}
コード例 #34
0
  /** the generated parser.
      Maintains a state and a value stack, currently with fixed maximum size.
      @param yyLex scanner.
      @return result of the last reduction, if any.
      @throws yyException on irrecoverable parse error.
    */
  public Object yyparse (yyParser.yyInput yyLex)
				{
    if (yyMax <= 0) yyMax = 256;			// initial size
    int yyState = 0;                                   // state stack ptr
    int [] yyStates = new int[yyMax];	                // state stack 
    Object yyVal = null;                               // value stack ptr
    Object [] yyVals = new Object[yyMax];	        // value stack
    int yyToken = -1;					// current input
    int yyErrorFlag = 0;				// #tks to shift

    int yyTop = 0;
    goto skip;
    yyLoop:
    yyTop++;
    skip:
    for (;; ++ yyTop) {
      if (yyTop >= yyStates.Length) {			// dynamically increase
        int[] i = new int[yyStates.Length+yyMax];
        yyStates.CopyTo (i, 0);
        yyStates = i;
        Object[] o = new Object[yyVals.Length+yyMax];
        yyVals.CopyTo (o, 0);
        yyVals = o;
      }
      yyStates[yyTop] = yyState;
      yyVals[yyTop] = yyVal;
//t      if (debug != null) debug.push(yyState, yyVal);

      yyDiscarded: for (;;) {	// discarding a token does not change stack
        int yyN;
        if ((yyN = yyDefRed[yyState]) == 0) {	// else [default] reduce (yyN)
          if (yyToken < 0) {
            yyToken = yyLex.advance() ? yyLex.token() : 0;
//t            if (debug != null)
//t              debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
          }
          if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
              && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
//t            if (debug != null)
//t              debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
            yyState = yyTable[yyN];		// shift to yyN
            yyVal = yyLex.value();
            yyToken = -1;
            if (yyErrorFlag > 0) -- yyErrorFlag;
            goto yyLoop;
          }
          if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
              && yyN < yyTable.Length && yyCheck[yyN] == yyToken)
            yyN = yyTable[yyN];			// reduce (yyN)
          else
            switch (yyErrorFlag) {
  
            case 0:
              yyerror("syntax error", yyExpecting(yyState));
//t              if (debug != null) debug.error("syntax error");
              goto case 1;
            case 1: case 2:
              yyErrorFlag = 3;
              do {
                if ((yyN = yySindex[yyStates[yyTop]]) != 0
                    && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
                    && yyCheck[yyN] == Token.yyErrorCode) {
//t                  if (debug != null)
//t                    debug.shift(yyStates[yyTop], yyTable[yyN], 3);
                  yyState = yyTable[yyN];
                  yyVal = yyLex.value();
                  goto yyLoop;
                }
//t                if (debug != null) debug.pop(yyStates[yyTop]);
              } while (-- yyTop >= 0);
//t              if (debug != null) debug.reject();
              throw new yyParser.yyException("irrecoverable syntax error");
  
            case 3:
              if (yyToken == 0) {
//t                if (debug != null) debug.reject();
                throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
              }
//t              if (debug != null)
//t                debug.discard(yyState, yyToken, yyname(yyToken),
//t  							yyLex.value());
              yyToken = -1;
              goto yyDiscarded;		// leave stack alone
            }
        }
        int yyV = yyTop + 1-yyLen[yyN];
//t        if (debug != null)
//t          debug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]);
        yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
        switch (yyN) {
case 1:
#line 345 "SQL92-min.y"
  {            
            notation.ConfirmTag(Tag.Stmt, Descriptor.Root, yyVals[0+yyTop]);
            yyVal = notation.ResolveTag(Tag.Stmt);
            if (yyVals[-1+yyTop] != null)
                notation.Confirm((Symbol)yyVal, Descriptor.OptimizerHint, yyVals[-1+yyTop]);
      }
  break;
case 2:
#line 352 "SQL92-min.y"
  {      
            notation.ConfirmTag(Tag.Stmt, Descriptor.Root, yyVals[-1+yyTop]);
			notation.ConfirmTag(Tag.Stmt, Descriptor.Order, yyVals[0+yyTop]);						
			yyVal = notation.ResolveTag(Tag.Stmt);
            if (yyVals[-2+yyTop] != null)
                notation.Confirm((Symbol)yyVal, Descriptor.OptimizerHint, yyVals[-2+yyTop]);			
      }
  break;
case 3:
#line 363 "SQL92-min.y"
  {
         yyVal = yyVals[0+yyTop];
      }
  break;
case 4:
#line 371 "SQL92-min.y"
  {
         Symbol sym = new Symbol(Tag.Predicate);
         yyVal = notation.Confirm(sym, Descriptor.Between, yyVals[-5+yyTop], yyVals[-2+yyTop], yyVals[0+yyTop]);
         if (yyVals[-4+yyTop] != null)
           notation.Confirm(sym, Descriptor.Inverse);
      }
  break;
case 5:
#line 381 "SQL92-min.y"
  {
        yyVal = null;
      }
  break;
case 10:
#line 398 "SQL92-min.y"
  {
          yyVal = notation.Confirm(new Symbol(Tag.Expr), 
            Descriptor.NullIf, yyVals[-3+yyTop], yyVals[-1+yyTop]);
      }
  break;
case 11:
#line 406 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.Expr),
            Descriptor.Coalesce, yyVals[-1+yyTop]);
      }
  break;
case 12:
#line 414 "SQL92-min.y"
  {
		yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 13:
#line 418 "SQL92-min.y"
  {
		yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
	  }
  break;
case 22:
#line 449 "SQL92-min.y"
  {
         Symbol sym = new Symbol(Tag.CExpr);
         if (yyVals[-1+yyTop] == null)
			yyVal = notation.Confirm(sym, Descriptor.Substring, yyVals[-4+yyTop], yyVals[-2+yyTop]);
		 else
			yyVal = notation.Confirm(sym, Descriptor.Substring, yyVals[-4+yyTop], yyVals[-2+yyTop], yyVals[-1+yyTop]);
      }
  break;
case 23:
#line 460 "SQL92-min.y"
  {
         yyVal = null;
      }
  break;
case 24:
#line 464 "SQL92-min.y"
  {
         yyVal = yyVals[0+yyTop];
      }
  break;
case 26:
#line 472 "SQL92-min.y"
  {
           yyVal = notation.Confirm(new Symbol(Tag.CExpr), Descriptor.Concat, yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 31:
#line 486 "SQL92-min.y"
  {
		yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 32:
#line 490 "SQL92-min.y"
  {
		yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
	  }
  break;
case 39:
#line 507 "SQL92-min.y"
  {
          yyVal = notation.Confirm(new Symbol(Tag.Predicate), Descriptor.Pred, yyVals[-2+yyTop], yyVals[-1+yyTop], yyVals[0+yyTop]);
      }
  break;
case 44:
#line 527 "SQL92-min.y"
  {
		yyVal = yyVals[-1+yyTop];
    }
  break;
case 45:
#line 534 "SQL92-min.y"
  {
		yyVal = yyVals[0+yyTop];
	}
  break;
case 46:
#line 541 "SQL92-min.y"
  {
		yyVal = yyVals[0+yyTop];
	}
  break;
case 47:
#line 548 "SQL92-min.y"
  {
		yyVal = yyVals[0+yyTop];
		if (yyVals[-2+yyTop] != null)
			notation.ConfirmTag(Tag.Join, Descriptor.JoinType, new TokenWrapper(yyVals[-2+yyTop]));
    }
  break;
case 50:
#line 562 "SQL92-min.y"
  {
          yyVal = yyVals[-1+yyTop];          
          notation.Confirm((Symbol)yyVal, Descriptor.Alias, yyVals[0+yyTop]);          
      }
  break;
case 52:
#line 571 "SQL92-min.y"
  {
          yyVal = yyVals[0+yyTop];
          notation.Confirm((Symbol)yyVal,  Descriptor.Dynatable);
      }
  break;
case 57:
#line 592 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CaseExpr), Descriptor.ElseBranch, yyVals[0+yyTop]);
      }
  break;
case 59:
#line 603 "SQL92-min.y"
  {
      yyVal = notation.Confirm(new Symbol(Tag.Predicate), Descriptor.Exists, yyVals[0+yyTop]);
    }
  break;
case 61:
#line 618 "SQL92-min.y"
  {
         if (yyVals[-1+yyTop].Equals("-"))
			yyVal = notation.Confirm(new Symbol(Tag.Expr), Descriptor.UnaryMinus, yyVals[0+yyTop]);
		 else
			yyVal = 2;
       }
  break;
case 62:
#line 629 "SQL92-min.y"
  {
         Symbol sym = new Symbol(Tag.CExpr);
         switch((int)yyVals[-3+yyTop])
         {
			case Token.UPPER:
				yyVal = notation.Confirm(sym, Descriptor.StringUpper, yyVals[-1+yyTop]);
				break;
			case Token.LOWER:
				yyVal = notation.Confirm(sym, Descriptor.StringLower, yyVals[-1+yyTop]);
				break;
         }
      }
  break;
case 65:
#line 651 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CExpr), 
			Descriptor.StringConvert,  yyVals[-3+yyTop], yyVals[-1+yyTop]);
      }
  break;
case 67:
#line 663 "SQL92-min.y"
  {
		notation.ConfirmTag(Tag.SQuery, Descriptor.From, yyVals[0+yyTop]);
      }
  break;
case 68:
#line 670 "SQL92-min.y"
  {
        yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 69:
#line 674 "SQL92-min.y"
  {
		yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
	  }
  break;
case 70:
#line 682 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.AggExpr), Descriptor.Aggregate, new TokenWrapper(yyVals[-3+yyTop]), yyVals[-1+yyTop]);
      }
  break;
case 71:
#line 687 "SQL92-min.y"
  {
         Symbol sym = new Symbol(Tag.AggExpr);
         yyVal = notation.Confirm(sym, Descriptor.Aggregate, new TokenWrapper(yyVals[-4+yyTop]), yyVals[-1+yyTop]);
         if ((int)yyVals[-2+yyTop] == Token.DISTINCT)
            notation.Confirm(sym, Descriptor.Distinct);
      }
  break;
case 72:
#line 697 "SQL92-min.y"
  {
         yyVal = new Parameter(yyVals[0+yyTop].ToString()); 
      }
  break;
case 76:
#line 710 "SQL92-min.y"
  {
        yyVal = yyVals[0+yyTop];
		notation.ConfirmTag(Tag.SQuery, Descriptor.GroupingColumnRef, yyVals[0+yyTop]);
      }
  break;
case 77:
#line 718 "SQL92-min.y"
  {
		yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 78:
#line 722 "SQL92-min.y"
  {
		yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 80:
#line 731 "SQL92-min.y"
  {
		notation.ConfirmTag(Tag.SQuery, Descriptor.GroupBy, yyVals[0+yyTop]);
      }
  break;
case 82:
#line 739 "SQL92-min.y"
  {
		notation.ConfirmTag(Tag.SQuery, Descriptor.Having, yyVals[0+yyTop]);
      }
  break;
case 86:
#line 756 "SQL92-min.y"
  {         
         Symbol sym = new Symbol(Tag.Predicate);
		 yyVal = notation.Confirm(sym, Descriptor.InSet, yyVals[-3+yyTop], yyVals[0+yyTop]);            
		 if (yyVals[-2+yyTop] != null)
		   notation.Confirm(sym, Descriptor.Inverse);
      }
  break;
case 88:
#line 767 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.ValueList), Descriptor.ValueList, yyVals[-1+yyTop]);
      }
  break;
case 89:
#line 774 "SQL92-min.y"
  {
         yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 90:
#line 778 "SQL92-min.y"
  {
         yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 91:
#line 785 "SQL92-min.y"
  {
		notation.ConfirmTag(Tag.Join, Descriptor.CrossJoin, yyVals[-1+yyTop], yyVals[0+yyTop]);
		yyVal = notation.ResolveTag(Tag.Join);
      }
  break;
case 92:
#line 790 "SQL92-min.y"
  {
		notation.ConfirmTag(Tag.Join, Descriptor.UnionJoin, yyVals[-1+yyTop], yyVals[0+yyTop]);
		yyVal = notation.ResolveTag(Tag.Join);      
      }
  break;
case 93:
#line 795 "SQL92-min.y"
  {
		notation.ConfirmTag(Tag.Join, Descriptor.NaturalJoin, yyVals[-1+yyTop], yyVals[0+yyTop]);
		yyVal = notation.ResolveTag(Tag.Join);      
      }
  break;
case 94:
#line 800 "SQL92-min.y"
  {
		notation.ConfirmTag(Tag.Join, Descriptor.QualifiedJoin, yyVals[-1+yyTop], yyVals[0+yyTop]);
		yyVal = notation.ResolveTag(Tag.Join);      
      }
  break;
case 95:
#line 805 "SQL92-min.y"
  {
		yyVal = notation.Confirm(new Symbol(Tag.Join), Descriptor.Branch, yyVals[-1+yyTop]);
      }
  break;
case 97:
#line 816 "SQL92-min.y"
  {
		yyVal = yyVals[0+yyTop];
      }
  break;
case 104:
#line 835 "SQL92-min.y"
  {
		  notation.ConfirmTag(Tag.Join, Descriptor.Outer);
	  }
  break;
case 105:
#line 842 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.Predicate), 
			Descriptor.Like, yyVals[-2+yyTop], yyVals[0+yyTop]);           
      }
  break;
case 106:
#line 847 "SQL92-min.y"
  {               
         Symbol sym = new Symbol(Tag.Predicate);
         yyVal = notation.Confirm(sym, Descriptor.Like, yyVals[-2+yyTop], yyVals[0+yyTop]);           
		 notation.Confirm(sym, Descriptor.Inverse);
      }
  break;
case 107:
#line 853 "SQL92-min.y"
  {
         Symbol sym = new Symbol(Tag.Predicate);
         yyVal = notation.Confirm(sym, Descriptor.Like, yyVals[-4+yyTop], yyVals[-2+yyTop]);           
		 notation.Confirm(sym, Descriptor.Escape, yyVals[0+yyTop]);
      }
  break;
case 108:
#line 859 "SQL92-min.y"
  {
         Symbol sym = new Symbol(Tag.Predicate);
         yyVal = notation.Confirm(sym, Descriptor.Like, yyVals[-4+yyTop], yyVals[-2+yyTop]);           
         notation.Confirm(sym, Descriptor.Inverse);
		 notation.Confirm(sym, Descriptor.Escape, yyVals[0+yyTop]);
      }
  break;
case 109:
#line 871 "SQL92-min.y"
  {
          Symbol sym = new Symbol(Tag.Predicate);          
          yyVal = notation.Confirm(sym, Descriptor.Match, yyVals[-4+yyTop], yyVals[0+yyTop]);
		  if (yyVals[-2+yyTop] != null)
			notation.Confirm(sym, Descriptor.Unique);          
		  if (yyVals[-1+yyTop] != null)
			notation.Confirm(sym, Descriptor.MatchType, new TokenWrapper(yyVals[-1+yyTop]));
      }
  break;
case 110:
#line 883 "SQL92-min.y"
  {
        yyVal = null;
      }
  break;
case 112:
#line 891 "SQL92-min.y"
  {
        yyVal = null;
      }
  break;
case 116:
#line 904 "SQL92-min.y"
  {
		yyVal = notation.Confirm(new Symbol(Tag.Join), Descriptor.Using, yyVals[-1+yyTop]);
      }
  break;
case 117:
#line 911 "SQL92-min.y"
  {
		yyVal = notation.Confirm(new Symbol(Tag.Join), Descriptor.Constraint, new TokenWrapper(yyVals[-1+yyTop]));
      }
  break;
case 118:
#line 915 "SQL92-min.y"
  {
        yyVal = notation.Confirm(new Symbol(Tag.Join), Descriptor.Constraint, new TokenWrapper(yyVals[-1+yyTop]));
      }
  break;
case 119:
#line 919 "SQL92-min.y"
  {
        yyVal = notation.Confirm(new Symbol(Tag.Join), Descriptor.Constraint, yyVals[0+yyTop]);
      }
  break;
case 121:
#line 927 "SQL92-min.y"
  {         
         Symbol sym = new Symbol(Tag.QueryExp);     
         switch((int)yyVals[-3+yyTop])
         {
            case Token.UNION:
               notation.Confirm(sym, Descriptor.Union, yyVals[-4+yyTop], yyVals[0+yyTop]);
               break;
            case Token.EXCEPT:
               notation.Confirm(sym, Descriptor.Except, yyVals[-4+yyTop], yyVals[0+yyTop]);
               break;
         }
         if (yyVals[-2+yyTop] != null)
           notation.Confirm(sym, Descriptor.Distinct);
         yyVal = sym;
      }
  break;
case 124:
#line 951 "SQL92-min.y"
  {
        yyVal = null;
      }
  break;
case 126:
#line 959 "SQL92-min.y"
  {
		yyVal = null;
      }
  break;
case 129:
#line 968 "SQL92-min.y"
  {
         Symbol sym = new Symbol(Tag.QueryTerm);
         notation.Confirm(sym, Descriptor.Intersect, yyVals[-4+yyTop], yyVals[0+yyTop]); 
         if (yyVals[-2+yyTop] != null)
           notation.Confirm(sym, Descriptor.Distinct);
         yyVal = sym;
      }
  break;
case 130:
#line 980 "SQL92-min.y"
  {
        Symbol sym = new Symbol(Tag.Predicate);
        yyVal = notation.Confirm(sym, Descriptor.IsNull, yyVals[-3+yyTop]);
        if (yyVals[-1+yyTop] != null)
          notation.Confirm(sym, Descriptor.Inverse);
      }
  break;
case 136:
#line 1001 "SQL92-min.y"
  {
		  Symbol sym = new Symbol(Tag.Expr);
          if (yyVals[-1+yyTop].Equals("+"))
			yyVal = notation.Confirm(sym, Descriptor.Add, yyVals[-2+yyTop], yyVals[0+yyTop]);
		  else
		    yyVal = notation.Confirm(sym, Descriptor.Sub, yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 141:
#line 1022 "SQL92-min.y"
  {
			yyVal  = yyVals[0+yyTop];
	  }
  break;
case 145:
#line 1036 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.Predicate), Descriptor.Overlaps, yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 149:
#line 1053 "SQL92-min.y"
  {
           yyVal = notation.Confirm(new Symbol(Tag.Expr), Descriptor.PosString, yyVals[-1+yyTop], yyVals[-3+yyTop]);
       }
  break;
case 160:
#line 1073 "SQL92-min.y"
  {
		yyVal = yyVals[-1+yyTop];
		if (yyVals[-3+yyTop] != null)
			notation.ConfirmTag(Tag.Join, Descriptor.JoinType, new TokenWrapper(yyVals[-3+yyTop]));		
		notation.ConfirmTag(Tag.Join, Descriptor.JoinSpec, yyVals[0+yyTop]);		
	  }
  break;
case 161:
#line 1083 "SQL92-min.y"
  {
		yyVal = null;
	  }
  break;
case 163:
#line 1092 "SQL92-min.y"
  {
		  yyVal = notation.Confirm(new Symbol(Tag.Predicate), 
		    Descriptor.QuantifiedPred, yyVals[-3+yyTop], yyVals[-2+yyTop], new TokenWrapper(yyVals[-1+yyTop]), yyVals[0+yyTop]);	  
      }
  break;
case 167:
#line 1107 "SQL92-min.y"
  {
           if ((int)yyVals[-2+yyTop] == Token.DISTINCT)
              notation.ConfirmTag(Tag.SQuery, Descriptor.Distinct);      
           if (yyVals[-3+yyTop] != null)
              notation.ConfirmTag(Tag.SQuery, Descriptor.Top, yyVals[-3+yyTop]);      
           yyVal = notation.ResolveTag(Tag.SQuery);           
           notation.LeaveContext();
      }
  break;
case 168:
#line 1119 "SQL92-min.y"
  {
         yyVal = null;
      }
  break;
case 169:
#line 1123 "SQL92-min.y"
  {
         yyVal = yyVals[-1+yyTop]; 
      }
  break;
case 174:
#line 1141 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.RowValue), 
            Descriptor.RowValue, Lisp.Append(Lisp.Cons(yyVals[-3+yyTop]), yyVals[-1+yyTop]));
      }
  break;
case 176:
#line 1151 "SQL92-min.y"
  { 
		yyVal = new TokenWrapper(yyVals[0+yyTop]);
	  }
  break;
case 177:
#line 1155 "SQL92-min.y"
  {
        yyVal = new TokenWrapper(yyVals[0+yyTop]);
      }
  break;
case 178:
#line 1162 "SQL92-min.y"
  {
        yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 179:
#line 1166 "SQL92-min.y"
  {
        yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 180:
#line 1175 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CaseExpr), Descriptor.Case, yyVals[-1+yyTop]);         
      }
  break;
case 181:
#line 1182 "SQL92-min.y"
  {
         object clause_list = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[-1+yyTop]));
         yyVal = notation.Confirm(new Symbol(Tag.CaseExpr), Descriptor.Case, clause_list);         
      }
  break;
case 182:
#line 1190 "SQL92-min.y"
  {
         yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 183:
#line 1194 "SQL92-min.y"
  {
         yyVal = Lisp.Append(yyVals[-1+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 184:
#line 1201 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CaseExpr), Descriptor.CaseBranch, yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 187:
#line 1213 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.BooleanExpr), Descriptor.LogicalOR, yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 190:
#line 1225 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.BooleanExpr), Descriptor.LogicalAND, yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 193:
#line 1237 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.BooleanExpr), Descriptor.Inverse, yyVals[0+yyTop]);
      }
  break;
case 195:
#line 1245 "SQL92-min.y"
  {
         Symbol sym = new Symbol(Tag.BooleanExpr);
         yyVal = notation.Confirm(sym, Descriptor.BooleanTest, new TokenWrapper(yyVals[0+yyTop]), yyVals[-3+yyTop]);
		 if (yyVals[-1+yyTop] != null)
		   notation.Confirm(sym, Descriptor.Inverse);                  
      }
  break;
case 197:
#line 1256 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.BooleanExpr),
           Descriptor.Branch, yyVals[-1+yyTop]);
      }
  break;
case 201:
#line 1270 "SQL92-min.y"
  {
          notation.ConfirmTag(Tag.SQuery, Descriptor.Select, null); 
      }
  break;
case 202:
#line 1274 "SQL92-min.y"
  {
          notation.ConfirmTag(Tag.SQuery, Descriptor.Select, yyVals[0+yyTop]); 
      }
  break;
case 203:
#line 1281 "SQL92-min.y"
  {
          yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 204:
#line 1285 "SQL92-min.y"
  {
         yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 205:
#line 1292 "SQL92-min.y"
  {		
		 yyVal = notation.Confirm(new Symbol(Tag.TableFields), Descriptor.TableFields, yyVals[-1+yyTop]);   
      }
  break;
case 207:
#line 1300 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.AggExpr), Descriptor.AggCount);
      }
  break;
case 215:
#line 1317 "SQL92-min.y"
  {
           notation.EnterContext();
           yyVal = Token.ALL;
        }
  break;
case 216:
#line 1322 "SQL92-min.y"
  {
           notation.EnterContext();
           yyVal = yyVals[0+yyTop];
        }
  break;
case 221:
#line 1342 "SQL92-min.y"
  {
          yyVal = notation.Confirm(new Symbol(Tag.CaseExpr), Descriptor.Case, yyVals[-2+yyTop], yyVals[-1+yyTop]);              
      }
  break;
case 222:
#line 1349 "SQL92-min.y"
  {
         object clause_list = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[-1+yyTop]));
         yyVal = notation.Confirm(new Symbol(Tag.CaseExpr), Descriptor.Case, yyVals[-3+yyTop], clause_list);
      }
  break;
case 223:
#line 1357 "SQL92-min.y"
  {
         yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 224:
#line 1361 "SQL92-min.y"
  {
         yyVal = Lisp.Append(yyVals[-1+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 227:
#line 1374 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CaseExpr), Descriptor.CaseBranch, yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 229:
#line 1382 "SQL92-min.y"
  {
			yyVal = new IntegerValue(yyVals[0+yyTop]);
      }
  break;
case 230:
#line 1390 "SQL92-min.y"
  {
        yyVal = yyVals[-1+yyTop]; 
        if ((int)yyVals[0+yyTop] == Token.DESC) 
			notation.Confirm((Symbol)yyVals[-1+yyTop], Descriptor.Desc);
      }
  break;
case 231:
#line 1399 "SQL92-min.y"
  {
        yyVal = Token.ASC;
      }
  break;
case 233:
#line 1407 "SQL92-min.y"
  {
			yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 234:
#line 1411 "SQL92-min.y"
  {
            yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 238:
#line 1430 "SQL92-min.y"
  {
         yyVal = yyVals[-1+yyTop];
         if (yyVals[-2+yyTop] != null)
           notation.Confirm((Symbol)yyVals[-1+yyTop], Descriptor.OptimizerHint, yyVals[-2+yyTop]);
      }
  break;
case 239:
#line 1436 "SQL92-min.y"
  {
         yyVal = yyVals[-2+yyTop];
         notation.Confirm((Symbol)yyVals[-2+yyTop], Descriptor.Order, yyVals[-1+yyTop]);  
         if (yyVals[-3+yyTop] != null)
           notation.Confirm((Symbol)yyVals[-2+yyTop], Descriptor.OptimizerHint, yyVals[-3+yyTop]);         
      }
  break;
case 245:
#line 1460 "SQL92-min.y"
  {
		yyVal = yyVals[-1+yyTop];
		notation.Confirm((Symbol)yyVal, Descriptor.Alias, yyVals[0+yyTop]);
    }
  break;
case 249:
#line 1474 "SQL92-min.y"
  {
        yyVal = notation.Confirm(new Symbol(Tag.Dynatable), Descriptor.Dynatable, yyVals[0+yyTop]);
    }
  break;
case 250:
#line 1478 "SQL92-min.y"
  {
        yyVal = notation.Confirm(new Symbol(Tag.Dynatable), Descriptor.Dynatable, yyVals[0+yyTop]);
    }
  break;
case 251:
#line 1482 "SQL92-min.y"
  {
        yyVal = notation.Confirm(new Symbol(Tag.Dynatable), Descriptor.Dynatable, yyVals[-2+yyTop]);
    }
  break;
case 252:
#line 1486 "SQL92-min.y"
  {
		yyVal = notation.Confirm(new Symbol(Tag.Dynatable), Descriptor.Dynatable, yyVals[0+yyTop]);
    }
  break;
case 253:
#line 1493 "SQL92-min.y"
  {
		yyVal = new Qname(yyVals[0+yyTop]);
    }
  break;
case 254:
#line 1498 "SQL92-min.y"
  {
		yyVal = new Qname(yyVals[-3+yyTop]);
		notation.Confirm((Symbol)yyVal, Descriptor.DerivedColumns, yyVals[-1+yyTop]);
    }
  break;
case 255:
#line 1506 "SQL92-min.y"
  {
       yyVal = notation.Confirm(new Symbol(Tag.TableConstructor), 
          Descriptor.TableValue, yyVals[0+yyTop]);
    }
  break;
case 256:
#line 1514 "SQL92-min.y"
  {
      yyVal = Lisp.Cons(yyVals[0+yyTop]);
    }
  break;
case 257:
#line 1518 "SQL92-min.y"
  {
      yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
    }
  break;
case 259:
#line 1526 "SQL92-min.y"
  {
        yyVal = notation.Confirm(new Symbol(Tag.Expr), Descriptor.Mul, yyVals[-2+yyTop], yyVals[0+yyTop]);
    }
  break;
case 260:
#line 1530 "SQL92-min.y"
  {
        yyVal = notation.Confirm(new Symbol(Tag.Expr), Descriptor.Div, yyVals[-2+yyTop], yyVals[0+yyTop]);
    }
  break;
case 261:
#line 1537 "SQL92-min.y"
  { 
        yyVal = yyVals[-1+yyTop];
      }
  break;
case 262:
#line 1544 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CExpr), Descriptor.StringTrim, 
			new TokenWrapper(Token.BOTH), new Literal(" "), yyVals[0+yyTop]);
      }
  break;
case 263:
#line 1549 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CExpr), Descriptor.StringTrim, 
            new TokenWrapper(Token.BOTH), new Literal(" "), yyVals[0+yyTop]);
      }
  break;
case 264:
#line 1554 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CExpr), Descriptor.StringTrim, 
            new TokenWrapper(Token.BOTH), yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 265:
#line 1559 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CExpr), Descriptor.StringTrim, 
			new TokenWrapper(yyVals[-2+yyTop]), new Literal(" "), yyVals[0+yyTop]);
      }
  break;
case 266:
#line 1564 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.CExpr), Descriptor.StringTrim, 
			new TokenWrapper(yyVals[-3+yyTop]), yyVals[-2+yyTop], yyVals[0+yyTop]);
      }
  break;
case 272:
#line 1586 "SQL92-min.y"
  {
        yyVal = notation.Confirm(new Symbol(Tag.Predicate), Descriptor.Unique, yyVals[0+yyTop]);
      }
  break;
case 284:
#line 1610 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.Expr), Descriptor.Branch, yyVals[-1+yyTop]);
      }
  break;
case 285:
#line 1617 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.Funcall), Descriptor.Funcall, new Qname(yyVals[-2+yyTop]), null);
      }
  break;
case 286:
#line 1621 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.Funcall), Descriptor.Funcall, new Qname(yyVals[-3+yyTop]), yyVals[-1+yyTop]);
      }
  break;
case 289:
#line 1633 "SQL92-min.y"
  {
        notation.ConfirmTag(Tag.SQuery, Descriptor.Where, yyVals[0+yyTop]);
    }
  break;
case 290:
#line 1640 "SQL92-min.y"
  {
       yyVal = null;
    }
  break;
case 292:
#line 1648 "SQL92-min.y"
  {
       yyVal = Lisp.Cons(yyVals[0+yyTop]);
    }
  break;
case 293:
#line 1652 "SQL92-min.y"
  {
       yyVal = Lisp.Append(yyVals[-1+yyTop], Lisp.Cons(yyVals[0+yyTop])); 
    }
  break;
case 294:
#line 1659 "SQL92-min.y"
  {
	   yyVal = new Qname(yyVals[0+yyTop]);
    }
  break;
case 295:
#line 1666 "SQL92-min.y"
  {
       yyVal = yyVals[0+yyTop];
       notation.ConfirmTag(Tag.SQuery, Descriptor.TableName, yyVals[0+yyTop]);
    }
  break;
case 296:
#line 1671 "SQL92-min.y"
  {      
       notation.ConfirmTag(Tag.SQuery, Descriptor.TableName, yyVals[0+yyTop]);
    }
  break;
case 297:
#line 1678 "SQL92-min.y"
  {
       yyVal = yyVals[0+yyTop];
       notation.Confirm((Symbol)yyVal, Descriptor.Prefix, new Literal(yyVals[-2+yyTop]));       
    }
  break;
case 299:
#line 1687 "SQL92-min.y"
  {
       yyVal = yyVals[-2+yyTop];
       ((Qname)yyVals[-2+yyTop]).Append((String)yyVals[0+yyTop]);
    }
  break;
case 300:
#line 1695 "SQL92-min.y"
  {
       yyVal = yyVals[0+yyTop];
       notation.Confirm((Symbol)yyVals[0+yyTop], Descriptor.ColumnRef);
    }
  break;
case 302:
#line 1704 "SQL92-min.y"
  {
       yyVal = notation.Confirm(new Symbol(Tag.Dref), Descriptor.Dref, yyVals[-2+yyTop], new Literal((String)yyVals[0+yyTop]));
    }
  break;
case 303:
#line 1708 "SQL92-min.y"
  {       
       Notation.Record[] recs = notation.Select((Symbol)yyVals[0+yyTop], Descriptor.Funcall, 2);       
       if (recs.Length > 0)
       {
          yyVal = notation.Confirm(new Symbol(Tag.Funcall), Descriptor.Funcall, 
             recs[0].Arg0, Lisp.Append(Lisp.Cons(yyVals[-2+yyTop]), recs[0].args[1]));
          notation.Remove(recs);
       }
       else
          throw new InvalidOperationException();
    }
  break;
case 304:
#line 1720 "SQL92-min.y"
  {
       yyVal = notation.Confirm(new Symbol(Tag.Dref), Descriptor.At, yyVals[-3+yyTop], yyVals[-1+yyTop]);
    }
  break;
case 305:
#line 1724 "SQL92-min.y"
  {
       yyVal = notation.Confirm(new Symbol(Tag.Dref), Descriptor.Wref, yyVals[-2+yyTop], new Literal((String)yyVals[0+yyTop]));    
    }
  break;
case 306:
#line 1731 "SQL92-min.y"
  {
      yyVal = new Qname(yyVals[0+yyTop]);
    }
  break;
case 307:
#line 1738 "SQL92-min.y"
  {
      yyVal = new IntegerValue(yyVals[0+yyTop]);
    }
  break;
case 308:
#line 1742 "SQL92-min.y"
  {
      yyVal = new DecimalValue(yyVals[0+yyTop]);
    }
  break;
case 309:
#line 1746 "SQL92-min.y"
  {
      yyVal = new DoubleValue(yyVals[0+yyTop]);
    }
  break;
case 310:
#line 1750 "SQL92-min.y"
  {
      yyVal = new Literal(yyVals[0+yyTop]);
    }
  break;
case 320:
#line 1770 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLQuery, yyVals[-2+yyTop], null, yyVals[-1+yyTop]);     
      }
  break;
case 321:
#line 1774 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLQuery, yyVals[-4+yyTop], yyVals[-2+yyTop], yyVals[-1+yyTop]);     
      }
  break;
case 322:
#line 1778 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLQuery, yyVals[-6+yyTop], yyVals[-2+yyTop], yyVals[-1+yyTop]);     
      }
  break;
case 323:
#line 1785 "SQL92-min.y"
  {
         yyVal = null;
      }
  break;
case 324:
#line 1789 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.RETURNING_CONTENT);
      }
  break;
case 325:
#line 1793 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.RETURNING_SEQUENCE);
      }
  break;
case 326:
#line 1800 "SQL92-min.y"
  {
         yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 327:
#line 1804 "SQL92-min.y"
  {
         yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 328:
#line 1811 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.AggExpr), Descriptor.Aggregate, 
            new TokenWrapper(Token.XMLAGG), yyVals[-1+yyTop]);
      }
  break;
case 329:
#line 1816 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.AggExpr), Descriptor.Aggregate, 
            new TokenWrapper(Token.XMLAGG), yyVals[-2+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.Order, yyVals[-1+yyTop]);
      }
  break;
case 330:
#line 1825 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), 
            Descriptor.XMLConcat, yyVals[-1+yyTop]); 
      }
  break;
case 331:
#line 1833 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLForestAll);               
      }
  break;
case 332:
#line 1837 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), 
            Descriptor.XMLForest, yyVals[-1+yyTop]);         
      }
  break;
case 333:
#line 1842 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), 
            Descriptor.XMLForest, yyVals[-1+yyTop]);  
         notation.Confirm((Symbol)yyVal, Descriptor.XMLNamespaces, yyVals[-3+yyTop]);
      }
  break;
case 334:
#line 1851 "SQL92-min.y"
  {
          String spec = yyVals[-3+yyTop].ToString().ToUpperInvariant();
          if (spec.Equals("DOCUMENT") || spec.Equals("CONTENT"))        
			 yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLParse, new Literal(spec), yyVals[-2+yyTop], yyVals[-1+yyTop]);
	      else
	      {
	         yyerror(String.Format(Properties.Resources.SyntaxError, 
	            String.Format("XMLPARSE({0}...", spec)));
	         throw new yyParser.yyException("Syntax error");
	      }      
      }
  break;
case 335:
#line 1866 "SQL92-min.y"
  {
          String spec = (String)yyVals[-2+yyTop];  
          if (! spec.Equals("NAME", StringComparison.InvariantCultureIgnoreCase))
          {
	         yyerror(String.Format(Properties.Resources.SyntaxError, 
	            String.Format("XMLPI({0}...", spec)));          
             throw new yyParser.yyException("Syntax error");	      
          }
          yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLPI, yyVals[-1+yyTop], null);
      }
  break;
case 336:
#line 1877 "SQL92-min.y"
  {
          String spec = (String)yyVals[-4+yyTop];  
          if (! spec.Equals("NAME", StringComparison.InvariantCultureIgnoreCase))
          {
	         yyerror(String.Format(Properties.Resources.SyntaxError, 
	            String.Format("XMLPI({0}...", spec)));                    
             throw new yyParser.yyException("Syntax error");	            
          }
          yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLPI, yyVals[-3+yyTop], yyVals[-1+yyTop]);      
      }
  break;
case 337:
#line 1891 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLComment, yyVals[-1+yyTop]);
      }
  break;
case 338:
#line 1898 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLCDATA, yyVals[-1+yyTop]);
      }
  break;
case 339:
#line 1905 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLRoot, yyVals[-1+yyTop], null, null);
      }
  break;
case 340:
#line 1909 "SQL92-min.y"
  {
         String tok = (String)yyVals[-2+yyTop];
         if (! tok.Equals("VERSION", StringComparison.InvariantCultureIgnoreCase))
         {
	         yyerror(String.Format(Properties.Resources.SyntaxError, 
	            String.Format("XMLRoot(... {0} ...", tok)));                             
              throw new yyParser.yyException("Syntax error");	                     
         }
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLRoot, yyVals[-4+yyTop], new Literal(yyVals[-1+yyTop]), null);
      }
  break;
case 341:
#line 1920 "SQL92-min.y"
  {
         String tok = (String)yyVals[-5+yyTop];
         if (! tok.Equals("VERSION", StringComparison.InvariantCultureIgnoreCase))
         {
	         yyerror(String.Format(Properties.Resources.SyntaxError, 
	            String.Format("XMLRoot(... {0} ...", tok)));                             
              throw new yyParser.yyException("Syntax error");	                     
         }
         tok = (String)yyVals[-2+yyTop];
         if (! tok.Equals("STANDALONE", StringComparison.InvariantCultureIgnoreCase))
         {
	         yyerror(String.Format(Properties.Resources.SyntaxError, 
	            String.Format("XMLRoot(... {0} ...", tok)));                             
              throw new yyParser.yyException("Syntax error");	                     
         }
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLRoot, yyVals[-7+yyTop], new Literal(yyVals[-4+yyTop]), yyVals[-1+yyTop]);
      }
  break;
case 343:
#line 1942 "SQL92-min.y"
  {
         yyVal = null;
      }
  break;
case 344:
#line 1949 "SQL92-min.y"
  {
         String tok = (String)yyVals[0+yyTop];
         if (tok.Equals("NO", StringComparison.InvariantCultureIgnoreCase) ||
             tok.Equals("YES", StringComparison.InvariantCultureIgnoreCase)) 
			yyVal = new Qname(tok.ToUpperInvariant());
         else
            throw new yyParser.yyException(String.Format(Properties.Resources.SyntaxError, 
               "STANDALONE value must be YES|NO|NO VALUE"));			
      }
  break;
case 345:
#line 1959 "SQL92-min.y"
  {
         yyVal = null;
      }
  break;
case 346:
#line 1966 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLElement, yyVals[-1+yyTop], null);
      }
  break;
case 347:
#line 1970 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLElement, yyVals[-3+yyTop], null);
         notation.Confirm((Symbol)yyVal, Descriptor.XMLNamespaces, yyVals[-1+yyTop]);
      }
  break;
case 348:
#line 1975 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLElement, yyVals[-3+yyTop], null);
         notation.Confirm((Symbol)yyVal, Descriptor.XMLAttributes, yyVals[-1+yyTop]);
      }
  break;
case 349:
#line 1981 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLElement, yyVals[-5+yyTop], null);
         notation.Confirm((Symbol)yyVal, Descriptor.XMLNamespaces, yyVals[-3+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.XMLAttributes, yyVals[-1+yyTop]);
      }
  break;
case 350:
#line 1987 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLElement, yyVals[-3+yyTop], yyVals[-1+yyTop]);         
      }
  break;
case 351:
#line 1991 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLElement, yyVals[-5+yyTop], yyVals[-1+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.XMLNamespaces, yyVals[-3+yyTop]);
      }
  break;
case 352:
#line 1996 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLElement, yyVals[-5+yyTop], yyVals[-1+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.XMLAttributes, yyVals[-3+yyTop]);
      }
  break;
case 353:
#line 2002 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), Descriptor.XMLElement, yyVals[-7+yyTop], yyVals[-1+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.XMLNamespaces, yyVals[-5+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.XMLAttributes, yyVals[-3+yyTop]);      
      }
  break;
case 354:
#line 2011 "SQL92-min.y"
  {
         yyVal = yyVals[-1+yyTop];
      }
  break;
case 355:
#line 2018 "SQL92-min.y"
  {
         yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 356:
#line 2022 "SQL92-min.y"
  {
         yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 359:
#line 2034 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), 
            Descriptor.DeclNamespace, new Literal(yyVals[-2+yyTop]), yyVals[0+yyTop]);  
      }
  break;
case 360:
#line 2042 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.SQLX), 
            Descriptor.DeclNamespace, new Literal(yyVals[0+yyTop]), null);        
      }
  break;
case 361:
#line 2047 "SQL92-min.y"
  {
         yyVal = null;
      }
  break;
case 362:
#line 2054 "SQL92-min.y"
  {
         yyVal = null;
      }
  break;
case 363:
#line 2058 "SQL92-min.y"
  {
         yyVal = yyVals[-1+yyTop];
      }
  break;
case 364:
#line 2065 "SQL92-min.y"
  {
          yyVal = Lisp.Cons(yyVals[0+yyTop]);
      }
  break;
case 365:
#line 2069 "SQL92-min.y"
  {
          yyVal = Lisp.Append(yyVals[-2+yyTop], Lisp.Cons(yyVals[0+yyTop]));
      }
  break;
case 367:
#line 2077 "SQL92-min.y"
  {
         yyVal = yyVals[-1+yyTop];
         notation.Confirm((Symbol)yyVal, Descriptor.ContentOption, yyVals[0+yyTop]);
      }
  break;
case 368:
#line 2082 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.TableFields), Descriptor.TableFields, yyVals[-1+yyTop]);   
      }
  break;
case 369:
#line 2086 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.TableFields), Descriptor.TableFields, yyVals[-2+yyTop]);   
         notation.Confirm((Symbol)yyVal, Descriptor.ContentOption, yyVals[0+yyTop]);
      }
  break;
case 371:
#line 2095 "SQL92-min.y"
  {
         yyVal = yyVals[-1+yyTop];
         notation.Confirm((Symbol)yyVal, Descriptor.Alias, yyVals[0+yyTop]);
      }
  break;
case 372:
#line 2103 "SQL92-min.y"
  { 
         yyVal = null;
      }
  break;
case 374:
#line 2111 "SQL92-min.y"
  {
          yyVal = new TokenWrapper(Token.PRESERVE_WHITESPACE);
      }
  break;
case 375:
#line 2115 "SQL92-min.y"
  {
          yyVal = new TokenWrapper(Token.STRIP_WHITESPACE);
      }
  break;
case 376:
#line 2122 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.OPTION_NULL);
      }
  break;
case 377:
#line 2126 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.OPTION_EMPTY);
      }
  break;
case 378:
#line 2130 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.OPTION_ABSENT);
      }
  break;
case 379:
#line 2134 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.OPTION_NIL);
      }
  break;
case 380:
#line 2138 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.NO_CONTENT);
      }
  break;
case 383:
#line 2150 "SQL92-min.y"
  {
         yyVal = notation.Confirm(new Symbol(Tag.Expr), 
            Descriptor.Cast, yyVals[-3+yyTop], yyVals[-1+yyTop]);                 
      }
  break;
case 384:
#line 2158 "SQL92-min.y"
  {
         yyVal = null;
      }
  break;
case 388:
#line 2168 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(yyVals[0+yyTop]);
      }
  break;
case 390:
#line 2176 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(yyVals[0+yyTop]);
      }
  break;
case 391:
#line 2180 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(yyVals[-3+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.Typelen, yyVals[-1+yyTop]);
      }
  break;
case 399:
#line 2198 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(yyVals[0+yyTop]);
      }
  break;
case 405:
#line 2213 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(yyVals[0+yyTop]);
      }
  break;
case 406:
#line 2217 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(yyVals[-3+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.Typeprec, yyVals[-1+yyTop]);         
      }
  break;
case 407:
#line 2222 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(yyVals[-5+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.Typeprec, yyVals[-3+yyTop]);
         notation.Confirm((Symbol)yyVal, Descriptor.Typescale, yyVals[-1+yyTop]);         
      }
  break;
case 411:
#line 2237 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.FLOAT);
      }
  break;
case 412:
#line 2241 "SQL92-min.y"
  {
         yyVal = new TokenWrapper(Token.FLOAT);
         notation.Confirm((Symbol)yyVal, Descriptor.Typeprec, yyVals[-1+yyTop]);         
      }
  break;
case 413:
#line 2249 "SQL92-min.y"
  {
         yyVal = new Qname(yyVals[0+yyTop]);
      }
  break;
#line default
        }
        yyTop -= yyLen[yyN];
        yyState = yyStates[yyTop];
        int yyM = yyLhs[yyN];
        if (yyState == 0 && yyM == 0) {
//t          if (debug != null) debug.shift(0, yyFinal);
          yyState = yyFinal;
          if (yyToken < 0) {
            yyToken = yyLex.advance() ? yyLex.token() : 0;
//t            if (debug != null)
//t               debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
          }
          if (yyToken == 0) {
//t            if (debug != null) debug.accept(yyVal);
            return yyVal;
          }
          goto yyLoop;
        }
        if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0)
            && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState))
          yyState = yyTable[yyN];
        else
          yyState = yyDgoto[yyM];
//t        if (debug != null) debug.shift(yyStates[yyTop], yyState);
	 goto yyLoop;
      }
    }
  }
コード例 #35
0
ファイル: Undefined.cs プロジェクト: javachengwc/many-ql
 internal override Value DividedByInt(IntegerValue value)
 {
     return new Undefined();
 }
コード例 #36
0
ファイル: Variables.cs プロジェクト: kia92798/tinyasn1
 public SCCIntegerValue(IntegerValue o, ITree antlr)
     : base(o, antlr)
 {
 }
コード例 #37
0
ファイル: Undefined.cs プロジェクト: javachengwc/many-ql
 internal override Value MultipliedByInt(IntegerValue value)
 {
     return new Undefined();
 }
コード例 #38
0
ファイル: Value.cs プロジェクト: javachengwc/many-ql
 internal virtual Value MinusInt(IntegerValue value)
 {
     throw new InvalidOperationException(CreateMessage(Operation.Substract, value, this));
 }
コード例 #39
0
        /**
         * Parses the sublist of tokens.  In most cases this will equate to
         * the full list
         *
         * @param len the length of the subexpression to parse
         * @exception FormulaException
         */
        private void parseSubExpression(int len)
        {
            int tokenVal = 0;
            Token t = null;

            // Indicates that we are parsing the incredibly complicated and
            // hacky if construct that MS saw fit to include, the gits
            Stack<ParseItem> ifStack = new Stack<ParseItem>();

            // The end position of the sub-expression
            int endpos = pos + len;

            while (pos < endpos)
                {
                tokenVal = tokenData[pos];
                pos++;

                t = Token.getToken(tokenVal);

                if (t == Token.UNKNOWN)
                    {
                    throw new FormulaException
                      (FormulaException.UNRECOGNIZED_TOKEN,tokenVal);
                    }

                Assert.verify(t != Token.UNKNOWN);

                // Operands
                if (t == Token.REF)
                    {
                    CellReference cr = new CellReference(relativeTo);
                    pos += cr.read(tokenData,pos);
                    tokenStack.Push(cr);
                    }
                else if (t == Token.REFERR)
                    {
                    CellReferenceError cr = new CellReferenceError();
                    pos += cr.read(tokenData,pos);
                    tokenStack.Push(cr);
                    }
                else if (t == Token.ERR)
                    {
                    ErrorConstant ec = new ErrorConstant();
                    pos += ec.read(tokenData,pos);
                    tokenStack.Push(ec);
                    }
                else if (t == Token.REFV)
                    {
                    SharedFormulaCellReference cr =
                      new SharedFormulaCellReference(relativeTo);
                    pos += cr.read(tokenData,pos);
                    tokenStack.Push(cr);
                    }
                else if (t == Token.REF3D)
                    {
                    CellReference3d cr = new CellReference3d(relativeTo,workbook);
                    pos += cr.read(tokenData,pos);
                    tokenStack.Push(cr);
                    }
                else if (t == Token.AREA)
                    {
                    Area a = new Area();
                    pos += a.read(tokenData,pos);
                    tokenStack.Push(a);
                    }
                else if (t == Token.AREAV)
                    {
                    SharedFormulaArea a = new SharedFormulaArea(relativeTo);
                    pos += a.read(tokenData,pos);
                    tokenStack.Push(a);
                    }
                else if (t == Token.AREA3D)
                    {
                    Area3d a = new Area3d(workbook);
                    pos += a.read(tokenData,pos);
                    tokenStack.Push(a);
                    }
                else if (t == Token.NAME)
                    {
                    Name n = new Name();
                    pos += n.read(tokenData,pos);
                    n.setParseContext(parseContext);
                    tokenStack.Push(n);
                    }
                else if (t == Token.NAMED_RANGE)
                    {
                    NameRange nr = new NameRange(nameTable);
                    pos += nr.read(tokenData,pos);
                    nr.setParseContext(parseContext);
                    tokenStack.Push(nr);
                    }
                else if (t == Token.INTEGER)
                    {
                    IntegerValue i = new IntegerValue();
                    pos += i.read(tokenData,pos);
                    tokenStack.Push(i);
                    }
                else if (t == Token.DOUBLE)
                    {
                    DoubleValue d = new DoubleValue();
                    pos += d.read(tokenData,pos);
                    tokenStack.Push(d);
                    }
                else if (t == Token.BOOL)
                    {
                    BooleanValue bv = new BooleanValue();
                    pos += bv.read(tokenData,pos);
                    tokenStack.Push(bv);
                    }
                else if (t == Token.STRING)
                    {
                    StringValue sv = new StringValue(settings);
                    pos += sv.read(tokenData,pos);
                    tokenStack.Push(sv);
                    }
                else if (t == Token.MISSING_ARG)
                    {
                    MissingArg ma = new MissingArg();
                    pos += ma.read(tokenData,pos);
                    tokenStack.Push(ma);
                    }

                  // Unary Operators
                else if (t == Token.UNARY_PLUS)
                    {
                    UnaryPlus up = new UnaryPlus();
                    pos += up.read(tokenData,pos);
                    addOperator(up);
                    }
                else if (t == Token.UNARY_MINUS)
                    {
                    UnaryMinus um = new UnaryMinus();
                    pos += um.read(tokenData,pos);
                    addOperator(um);
                    }
                else if (t == Token.PERCENT)
                    {
                    Percent p = new Percent();
                    pos += p.read(tokenData,pos);
                    addOperator(p);
                    }

                  // Binary Operators
                else if (t == Token.SUBTRACT)
                    {
                    Subtract s = new Subtract();
                    pos += s.read(tokenData,pos);
                    addOperator(s);
                    }
                else if (t == Token.ADD)
                    {
                    Add s = new Add();
                    pos += s.read(tokenData,pos);
                    addOperator(s);
                    }
                else if (t == Token.MULTIPLY)
                    {
                    Multiply s = new Multiply();
                    pos += s.read(tokenData,pos);
                    addOperator(s);
                    }
                else if (t == Token.DIVIDE)
                    {
                    Divide s = new Divide();
                    pos += s.read(tokenData,pos);
                    addOperator(s);
                    }
                else if (t == Token.CONCAT)
                    {
                    Concatenate c = new Concatenate();
                    pos += c.read(tokenData,pos);
                    addOperator(c);
                    }
                else if (t == Token.POWER)
                    {
                    Power p = new Power();
                    pos += p.read(tokenData,pos);
                    addOperator(p);
                    }
                else if (t == Token.LESS_THAN)
                    {
                    LessThan lt = new LessThan();
                    pos += lt.read(tokenData,pos);
                    addOperator(lt);
                    }
                else if (t == Token.LESS_EQUAL)
                    {
                    LessEqual lte = new LessEqual();
                    pos += lte.read(tokenData,pos);
                    addOperator(lte);
                    }
                else if (t == Token.GREATER_THAN)
                    {
                    GreaterThan gt = new GreaterThan();
                    pos += gt.read(tokenData,pos);
                    addOperator(gt);
                    }
                else if (t == Token.GREATER_EQUAL)
                    {
                    GreaterEqual gte = new GreaterEqual();
                    pos += gte.read(tokenData,pos);
                    addOperator(gte);
                    }
                else if (t == Token.NOT_EQUAL)
                    {
                    NotEqual ne = new NotEqual();
                    pos += ne.read(tokenData,pos);
                    addOperator(ne);
                    }
                else if (t == Token.EQUAL)
                    {
                    Equal e = new Equal();
                    pos += e.read(tokenData,pos);
                    addOperator(e);
                    }
                else if (t == Token.PARENTHESIS)
                    {
                    Parenthesis p = new Parenthesis();
                    pos += p.read(tokenData,pos);
                    addOperator(p);
                    }

                  // Functions
                else if (t == Token.ATTRIBUTE)
                    {
                    Attribute a = new Attribute(settings);
                    pos += a.read(tokenData,pos);

                    if (a.isSum())
                        addOperator(a);
                    else if (a.isIf())
                        {
                        // Add it to a special stack for ifs
                        ifStack.Push(a);
                        }
                    }
                else if (t == Token.FUNCTION)
                    {
                    BuiltInFunction bif = new BuiltInFunction(settings);
                    pos += bif.read(tokenData,pos);

                    addOperator(bif);
                    }
                else if (t == Token.FUNCTIONVARARG)
                    {
                    VariableArgFunction vaf = new VariableArgFunction(settings);
                    pos += vaf.read(tokenData,pos);

                    if (vaf.getFunction() != Function.ATTRIBUTE)
                        addOperator(vaf);
                    else
                        {
                        // This is part of an IF function.  Get the operands, but then
                        // add it to the top of the if stack
                        vaf.getOperands(tokenStack);

                        Attribute ifattr = null;
                        if (ifStack.Count == 0)
                            ifattr = new Attribute(settings);
                        else
                            ifattr = (Attribute)ifStack.Pop();

                        ifattr.setIfConditions(vaf);
                        tokenStack.Push(ifattr);
                        }
                    }

                    // Other things
                else if (t == Token.MEM_FUNC)
                    {
                    MemFunc memFunc = new MemFunc();
                    handleMemoryFunction(memFunc);
                    }
                else if (t == Token.MEM_AREA)
                    {
                    MemArea memArea = new MemArea();
                    handleMemoryFunction(memArea);
                    }
                }
        }
コード例 #40
0
ファイル: RubyEncoder.cs プロジェクト: TerabyteX/main
        private static void WriteBer(Stream/*!*/ stream, IntegerValue value)
        {
            if (value.IsFixnum) {
                if (value.Fixnum < 0) {
                    throw RubyExceptions.CreateArgumentError("pack(w): value out of range");
                }
                int f = value.Fixnum;
                bool write = false;
                for (int shift = 28; shift > 0; shift -= 7) {
                    int b = (f >> shift) & 0x7f;
                    if (b != 0 || write) {
                        stream.WriteByte((byte)(b | (1 << 7)));
                        write = true;
                    }
                }
                stream.WriteByte((byte)(f & 0x7f));
            } else {
                BigInteger bignum = value.Bignum;
                if (bignum.Sign < 0) {
                    throw RubyExceptions.CreateArgumentError("pack(w): value out of range");
                }

                // not very efficient but good enough:
                uint[] words = bignum.GetWords();
                int i = words.Length;
                uint carry = 0;
                bool write = false;
                int shift = (Ceil(32 * i, 7) - 7) % 32;
                uint w = words[--i];
                while (true) {
                    if (shift == 0 && i == 0) {
                        stream.WriteByte((byte)(w & 0x7f));
                        break;
                    } else {
                        uint b = carry | (w >> shift) & 0x7f;
                        carry = 0;

                        write |= (b != 0);
                        if (write) {
                            stream.WriteByte((byte)(b | (1 << 7)));
                        }

                        if (shift < 7) {
                            carry = (w & (uint)((1 << shift) - 1)) << (7 - shift);
                            w = words[--i];
                        }
                    }

                    // (shift -= 7) mod 32:
                    shift = (shift + 32 - 7) % 32;
                }
            }
        }
コード例 #41
0
ファイル: Undefined.cs プロジェクト: javachengwc/many-ql
 internal override Value PlusInt(IntegerValue value)
 {
     return new Undefined();
 }
コード例 #42
0
ファイル: Variable.cs プロジェクト: laurentprudhon/TypeCobol
 public IntegerVariable(IntegerValue value)
     : base(StorageDataType.Integer, null)
 {
     Value = value;
 }
コード例 #43
0
        internal static OpenXmlSimpleType[] CreatePossibleMembers(UnionValueRestriction unionValueRestriction)
        {
            OpenXmlSimpleType[] simpleValues = new OpenXmlSimpleType[unionValueRestriction.UnionTypes.Length];

            switch (unionValueRestriction.UnionId)
            {
                // ST_AnimationDgmBuildType
                case 25:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Drawing.AnimationBuildValues>();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.Drawing.AnimationDiagramOnlyBuildValues>();
                    break;

                // ST_AnimationChartBuildType
                case 27:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Drawing.AnimationBuildValues>();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.Drawing.AnimationChartOnlyBuildValues>();
                    break;

                // ST_AdjCoordinate
                case 45:
                    simpleValues[0] = new Int64Value();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_AdjAngle
                case 46:
                    simpleValues[0] = new Int32Value();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_LayoutShapeType
                case 145:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Drawing.ShapeTypeValues>();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.OutputShapeValues>();
                    break;

                // ST_ParameterVal
                case 183:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.HorizontalAlignmentValues>();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.VerticalAlignmentValues>();
                    simpleValues[2] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.ChildDirectionValues>();
                    simpleValues[3] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.ChildAlignmentValues>();
                    simpleValues[4] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.SecondaryChildAlignmentValues>();
                    simpleValues[5] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.LinearDirectionValues>();
                    simpleValues[6] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.SecondaryLinearDirectionValues>();
                    simpleValues[7] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.StartingElementValues>();
                    simpleValues[8] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.BendPointValues>();
                    simpleValues[9] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.ConnectorRoutingValues>();
                    simpleValues[10] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.ArrowheadStyleValues>();
                    simpleValues[11] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.ConnectorDimensionValues>();
                    simpleValues[12] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.RotationPathValues>();
                    simpleValues[13] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.CenterShapeMappingValues>();
                    simpleValues[14] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.NodeHorizontalAlignmentValues>();
                    simpleValues[15] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.NodeVerticalAlignmentValues>();
                    simpleValues[16] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.FallbackDimensionValues>();
                    simpleValues[17] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.TextDirectionValues>();
                    simpleValues[18] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.PyramidAccentPositionValues>();
                    simpleValues[19] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.PyramidAccentTextMarginValues>();
                    simpleValues[20] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.TextBlockDirectionValues>();
                    simpleValues[21] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.TextAnchorHorizontalValues>();
                    simpleValues[22] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.TextAnchorVerticalValues>();
                    simpleValues[23] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.TextAlignmentValues>();
                    simpleValues[24] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.AutoTextRotationValues>();
                    simpleValues[25] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.GrowDirectionValues>();
                    simpleValues[26] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.FlowDirectionValues>();
                    simpleValues[27] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.ContinueDirectionValues>();
                    simpleValues[28] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.BreakpointValues>();
                    simpleValues[29] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.OffsetValues>();
                    simpleValues[30] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.HierarchyAlignmentValues>();
                    simpleValues[31] = new Int32Value();
                    simpleValues[32] = new DoubleValue();
                    simpleValues[33] = new BooleanValue();
                    simpleValues[34] = new StringValue();
                    simpleValues[35] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.ConnectorPointValues>();
                    break;

                // ST_ModelId
                case 184:
                    simpleValues[0] = new Int32Value();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_FunctionValue
                case 207:
                    simpleValues[0] = new Int32Value();
                    simpleValues[1] = new BooleanValue();
                    simpleValues[2] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.DirectionValues>();
                    simpleValues[3] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.HierarchyBranchStyleValues>();
                    simpleValues[4] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.AnimateOneByOneValues>();
                    simpleValues[5] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.AnimationLevelStringValues>();
                    simpleValues[6] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.ResizeHandlesStringValues>();
                    break;

                // ST_FunctionArgument
                case 209:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Drawing.Diagrams.VariableValues>();
                    break;

                // ST_NonZeroDecimalNumber
                case 368:
                    simpleValues[0] = new Int32Value();
                    simpleValues[1] = new Int32Value();
                    break;

                // ST_MarkupId
                case 375:
                    simpleValues[0] = new Int32Value();
                    simpleValues[1] = new Int32Value();
                    break;

                // ST_HexColor
                case 404:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Wordprocessing.AutomaticColorValues>();
                    simpleValues[1] = new HexBinaryValue();
                    break;

                // ST_DecimalNumberOrPercent
                case 507:
                    simpleValues[0] = new StringValue();
                    simpleValues[1] = new Int32Value();
                    break;

                // ST_SignedHpsMeasure_O14
                case 525:
                    simpleValues[0] = new IntegerValue();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_HpsMeasure_O14
                case 528:
                    simpleValues[0] = new UInt32Value();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_SignedTwipsMeasure_O14
                case 531:
                    simpleValues[0] = new IntegerValue();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_TwipsMeasure_O14
                case 534:
                    simpleValues[0] = new UInt32Value();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_TransitionEightDirectionType
                case 544:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Presentation.TransitionSlideDirectionValues>();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.Presentation.TransitionCornerDirectionValues>();
                    break;

                // ST_TLTimeAnimateValueTime
                case 561:
                    simpleValues[0] = new Int32Value();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.Presentation.IndefiniteTimeDeclarationValues>();
                    break;

                // ST_TLTime_O12
                case 603:
                    simpleValues[0] = new UInt32Value();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.Presentation.IndefiniteTimeDeclarationValues>();
                    break;

                // ST_TLTime_O14
                case 604:
                    simpleValues[0] = new StringValue();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.Presentation.IndefiniteTimeDeclarationValues>();
                    break;

                // ST_PublishDate
                case 689:
                    simpleValues[0] = new DateTimeValue();
                    simpleValues[1] = new DateTimeValue();
                    simpleValues[2] = new StringValue();
                    break;

                // ST_ChannelDataPoint
                case 697:
                    simpleValues[0] = new DecimalValue();
                    simpleValues[1] = new BooleanValue();
                    break;

                // ST_ChannelPropertyName
                case 701:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardChannelPropertyNameValues>();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_BrushPropertyName
                case 704:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardBrushPropertyNameValues>();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_ChannelName
                case 707:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardChannelNameValues>();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_Units
                case 719:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardLengthUnitsValues>();
                    simpleValues[1] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardPerLengthUnitsValues>();
                    simpleValues[2] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardTimeUnitsValues>();
                    simpleValues[3] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardPerTimeUnitsValues>();
                    simpleValues[4] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardMassForceUnitsValues>();
                    simpleValues[5] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardPerMassForceUnitsValues>();
                    simpleValues[6] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardAngleUnitsValues>();
                    simpleValues[7] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardPerAngleUnitsValues>();
                    simpleValues[8] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardOtherUnitsValues>();
                    simpleValues[9] = new EnumValue<DocumentFormat.OpenXml.InkML.StandardPerOtherUnitsValues>();
                    simpleValues[10] = new StringValue();
                    break;

                // ST_BrushPropertyValue
                case 732:
                    simpleValues[0] = new DecimalValue();
                    simpleValues[1] = new BooleanValue();
                    simpleValues[2] = new EnumValue<DocumentFormat.OpenXml.InkML.PenTipShapeValues>();
                    simpleValues[3] = new EnumValue<DocumentFormat.OpenXml.InkML.RasterOperationValues>();
                    simpleValues[4] = new StringValue();
                    break;

                // ST_Ref
                case 746:
                    simpleValues[0] = new StringValue();
                    simpleValues[1] = new UInt32Value();
                    break;

                // ST_CtxNodeType
                case 747:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Office2010.Ink.KnownContextNodeTypeValues>();
                    simpleValues[1] = new StringValue();
                    break;

                // ST_SemanticType
                case 750:
                    simpleValues[0] = new EnumValue<DocumentFormat.OpenXml.Office2010.Ink.KnownSemanticTypeValues>();
                    simpleValues[1] = new UInt32Value();
                    break;

                // ST_PointsOrInt
                case 753:
                    simpleValues[0] = new ListValue<StringValue>();
                    simpleValues[1] = new Int32Value();
                    break;

                default:
                    Debug.Assert(false);
                    break;
            }

            Debug.Assert(simpleValues.Length > 0);

            return simpleValues;
        }
コード例 #44
0
ファイル: Value.cs プロジェクト: javachengwc/many-ql
 internal virtual Value PlusInt(IntegerValue value)
 {
     throw new InvalidOperationException(CreateMessage(Operation.Add, value, this));
 }
コード例 #45
0
ファイル: Value.cs プロジェクト: javachengwc/many-ql
 internal virtual Value IsLessThanInt(IntegerValue value)
 {
     throw new InvalidOperationException(CreateMessage(Operation.LessThan, value, this));
 }
コード例 #46
0
ファイル: Value.cs プロジェクト: javachengwc/many-ql
 internal virtual Value IsNotEqualToInt(IntegerValue value)
 {
     throw new InvalidOperationException(CreateMessage(Operation.NotEqualTo, value, this));
 }
コード例 #47
0
        public void Bug520719()
        {
            // the following test should pass without Assert() in debug version.
            
            var int8 = new SByteValue();
            int8.InnerText = "+10";
            Assert.Equal(10, int8.Value);
            Assert.Equal("+10", int8.InnerText);

            var int16 = new Int16Value();
            int16.InnerText = "+10";
            Assert.Equal(10, int16.Value);
            Assert.Equal("+10", int16.InnerText);

            var int32 = new Int32Value();
            int32.InnerText = "+10";
            Assert.Equal(10, int32.Value);
            Assert.Equal("+10", int32.InnerText);

            var int64 = new Int64Value();
            int64.InnerText = "+10";
            Assert.Equal(10, int64.Value);
            Assert.Equal("+10", int64.InnerText);

            var integer = new IntegerValue();
            integer.InnerText = "+10";
            Assert.Equal(10, integer.Value);
            Assert.Equal("+10", integer.InnerText);

            var dec = new DecimalValue();
            dec.InnerText = "+10";
            Assert.Equal(10, dec.Value);
            Assert.Equal("+10", dec.InnerText);

            var single = new SingleValue();
            single.InnerText = "+10";
            Assert.Equal(10, single.Value);
            Assert.Equal("+10", single.InnerText);

            var dble = new DoubleValue();
            dble.InnerText = "+10";
            Assert.Equal(10, dble.Value);
            Assert.Equal("+10", dble.InnerText);
        }
コード例 #48
0
ファイル: Value.cs プロジェクト: javachengwc/many-ql
 internal virtual Value MultipliedByInt(IntegerValue value)
 {
     throw new InvalidOperationException(CreateMessage(Operation.Multiply, value, this));
 }
コード例 #49
0
 /// <summary>Exit() every Node that is not the top-level item for a data of a given level.</summary>
 /// <param name="levelnumber">
 /// Level number of the next data definition that will be Enter()ed.
 /// If null, a value of 1 is assumed.
 /// </param>
 private void SetCurrentNodeToTopLevelItem(IntegerValue levelnumber)
 {
     long level = levelnumber != null? levelnumber.Value : 1;
     Node parent = GetTopLevelItem(level);
     if (parent != null) {
         // Exit() previous sibling and all of its last children
         while (parent != CurrentNode) Exit();
     } else {
         ExitLastLevel1Definition();
     }
 }
コード例 #50
0
ファイル: Value.cs プロジェクト: javachengwc/many-ql
 internal virtual Value DividedByInt(IntegerValue value)
 {
     throw new InvalidOperationException(CreateMessage(Operation.Divide, value, this));
 }
コード例 #51
0
ファイル: CBackend.cs プロジェクト: kia92798/tinyasn1
 public override IntegerValue CreateIntegerValue(IntegerValue o, Antlr.Runtime.Tree.ITree antlr)
 {
     return new SCCIntegerValue(o, antlr);
 }