• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# QilNodeType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中QilNodeType的典型用法代码示例。如果您正苦于以下问题:C# QilNodeType类的具体用法?C# QilNodeType怎么用?C# QilNodeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



QilNodeType类属于命名空间,在下文中一共展示了QilNodeType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: QilFunction

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a node
        /// </summary>
        public QilFunction(QilNodeType nodeType, QilNode arguments, QilNode definition, QilNode sideEffects, XmlQueryType resultType)
            : base(nodeType) {
            this.arguments = arguments;
            this.definition = definition;
            this.sideEffects = sideEffects;
            this.xmlType = resultType;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:14,代码来源:QilFunction.cs


示例2: QilName

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        public QilName(QilNodeType nodeType, string local, string uri, string prefix) : base(nodeType, null)
        {
            LocalName = local;
            NamespaceUri = uri;
            Prefix = prefix;
            Value = this;
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:14,代码来源:QilName.cs


示例3: QilExpression

        /// <summary>
        /// Construct QIL from a rooted graph of QilNodes with a specific factory.
        /// </summary>
        public QilExpression(QilNodeType nodeType, QilNode root, QilFactory factory) : base(nodeType) {
            this.factory = factory;
            this.isDebug = factory.False();

            XmlWriterSettings settings = new XmlWriterSettings();
            settings.ConformanceLevel = ConformanceLevel.Auto;
            this.defWSet = factory.LiteralObject(settings);

            this.wsRules = factory.LiteralObject(new List<WhitespaceRule>());
            this.funList = factory.FunctionList();
            this.gloVars = factory.GlobalVariableList();
            this.gloParams = factory.GlobalParameterList();
            this.rootNod = root;
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:17,代码来源:qilexpression.cs


示例4: QilExpression

        /// <summary>
        /// Construct QIL from a rooted graph of QilNodes with a specific factory.
        /// </summary>
        public QilExpression(QilNodeType nodeType, QilNode root, QilFactory factory) : base(nodeType)
        {
            _factory = factory;
            _isDebug = factory.False();

            XmlWriterSettings settings = new XmlWriterSettings();
            settings.ConformanceLevel = ConformanceLevel.Auto;
            _defWSet = factory.LiteralObject(settings);

            _wsRules = factory.LiteralObject(new List<WhitespaceRule>());
            _gloVars = factory.GlobalVariableList();
            _gloParams = factory.GlobalParameterList();
            _earlBnd = factory.LiteralObject(new List<EarlyBoundInfo>());
            _funList = factory.FunctionList();
            _rootNod = root;
        }
开发者ID:Corillian,项目名称:corefx,代码行数:19,代码来源:QilExpression.cs


示例5: IsStepPattern

 /// <summary>
 /// Return true if "patt" matches the Step pattern and the StepType argument is equal to "stepType".
 /// </summary>
 private bool IsStepPattern(OptimizerPatterns patt, QilNodeType stepType) {
     return patt.MatchesPattern(OptimizerPatternName.Step) && ((QilNode) patt.GetArgument(OptimizerPatternArgument.StepNode)).NodeType == stepType;
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:6,代码来源:xmliloptimizervisitor.cs


示例6: QilInvokeEarlyBound

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        /// <param name="method">QilLiteral containing the Clr MethodInfo for the early bound function</param>
        public QilInvokeEarlyBound(QilNodeType nodeType, QilNode name, QilNode method, QilNode arguments, XmlQueryType resultType)
            : base(nodeType, name, method, arguments) {
            this.xmlType = resultType;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:QilInvokeEarlyBound.cs


示例7: QilDataSource

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        public QilDataSource(QilNodeType nodeType, QilNode name, QilNode baseUri) : base(nodeType, name, baseUri) {
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:9,代码来源:qildatasource.cs


示例8: InvokeRelationalOperator

        public QilNode InvokeRelationalOperator(QilNodeType op, QilNode left, QilNode right) {
            Debug.Assert(op == QilNodeType.Lt || op == QilNodeType.Le || op == QilNodeType.Gt || op == QilNodeType.Ge);
            double opCode;
            left  = TypeAssert(left,  T.ItemS);
            right = TypeAssert(right, T.ItemS);

            switch (op) {
            case QilNodeType.Lt:    opCode = (double)XsltLibrary.ComparisonOperator.Lt; break;
            case QilNodeType.Le:    opCode = (double)XsltLibrary.ComparisonOperator.Le; break;
            case QilNodeType.Gt:    opCode = (double)XsltLibrary.ComparisonOperator.Gt; break;
            default:                opCode = (double)XsltLibrary.ComparisonOperator.Ge; break;
            }
            return XsltInvokeEarlyBound(QName("RelationalOperator"),
                XsltMethods.RelationalOperator, T.BooleanX, new QilNode[] { Double(opCode), left, right }
            );
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:16,代码来源:xpathqilfactory.cs


示例9: QilReference

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a reference
        /// </summary>
        public QilReference(QilNodeType nodeType) : base(nodeType) {
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:QilReference.cs


示例10: QilList

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new (empty) QilList
        /// </summary>
        public QilList(QilNodeType nodeType) : base(nodeType) {
            this.members = new QilNode[4];
            this.xmlType = null;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:11,代码来源:QilList.cs


示例11: CheckClassAndNodeType

 private void CheckClassAndNodeType(QilNode node, Type clrTypeClass, QilNodeType nodeType) {
     CheckClass(node, clrTypeClass);
     Check(node.NodeType == nodeType, node, "Node must have QilNodeType." + nodeType);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:QilTypeChecker.cs


示例12: QilInvokeLateBound

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        public QilInvokeLateBound(QilNodeType nodeType, QilNode name, QilNode arguments) : base(nodeType, name, arguments) {
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:9,代码来源:QilInvokeLateBound.cs


示例13: QilInvoke

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        public QilInvoke(QilNodeType nodeType, QilNode function, QilNode arguments) : base(nodeType, function, arguments) {
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:QilInvoke.cs


示例14: FoldArithmetic

        /// <summary>
        /// Compute the arithmetic operation "opType" over two literal operands and return the result as a QilLiteral.
        /// Arithmetic operations are always checked; in the case of an overflow or divide by zero exception, return
        /// the unfolded result.
        /// </summary>
        private QilNode FoldArithmetic(QilNodeType opType, QilLiteral left, QilLiteral right) {
            Debug.Assert(left.NodeType == right.NodeType);

            // Catch any overflow or divide by zero exceptions
            try {
                checked {
                    switch (left.NodeType) {
                        case QilNodeType.LiteralInt32: {
                            int intLeft = left;
                            int intRight = right;

                            switch (opType) {
                                case QilNodeType.Add: return f.LiteralInt32(intLeft + intRight);
                                case QilNodeType.Subtract: return f.LiteralInt32(intLeft - intRight);
                                case QilNodeType.Multiply: return f.LiteralInt32(intLeft * intRight);
                                case QilNodeType.Divide: return f.LiteralInt32(intLeft / intRight);
                                case QilNodeType.Modulo: return f.LiteralInt32(intLeft % intRight);
                            }
                            break;
                        }

                        case QilNodeType.LiteralInt64: {
                            long lngLeft = left;
                            long lngRight = right;

                            switch (opType) {
                                case QilNodeType.Add: return f.LiteralInt64(lngLeft + lngRight);
                                case QilNodeType.Subtract: return f.LiteralInt64(lngLeft - lngRight);
                                case QilNodeType.Multiply: return f.LiteralInt64(lngLeft * lngRight);
                                case QilNodeType.Divide: return f.LiteralInt64(lngLeft / lngRight);
                                case QilNodeType.Modulo: return f.LiteralInt64(lngLeft % lngRight);
                            }
                            break;
                        }

                        case QilNodeType.LiteralDecimal: {
                            decimal lngLeft = left;
                            decimal lngRight = right;

                            switch (opType) {
                                case QilNodeType.Add: return f.LiteralDecimal(lngLeft + lngRight);
                                case QilNodeType.Subtract: return f.LiteralDecimal(lngLeft - lngRight);
                                case QilNodeType.Multiply: return f.LiteralDecimal(lngLeft * lngRight);
                                case QilNodeType.Divide: return f.LiteralDecimal(lngLeft / lngRight);
                                case QilNodeType.Modulo: return f.LiteralDecimal(lngLeft % lngRight);
                            }
                            break;
                        }

                        case QilNodeType.LiteralDouble: {
                            double lngLeft = left;
                            double lngRight = right;

                            switch (opType) {
                                case QilNodeType.Add: return f.LiteralDouble(lngLeft + lngRight);
                                case QilNodeType.Subtract: return f.LiteralDouble(lngLeft - lngRight);
                                case QilNodeType.Multiply: return f.LiteralDouble(lngLeft * lngRight);
                                case QilNodeType.Divide: return f.LiteralDouble(lngLeft / lngRight);
                                case QilNodeType.Modulo: return f.LiteralDouble(lngLeft % lngRight);
                            }
                            break;
                        }
                    }
                }
            }
            catch (OverflowException) {
            }
            catch (DivideByZeroException) {
            }

            // An error occurred, so don't fold operationo
            switch (opType) {
                case QilNodeType.Add: return f.Add(left, right);
                case QilNodeType.Subtract: return f.Subtract(left, right);
                case QilNodeType.Multiply: return f.Multiply(left, right);
                case QilNodeType.Divide: return f.Divide(left, right);
                case QilNodeType.Modulo: return f.Modulo(left, right);
            }

            Debug.Assert(false, "Cannot fold this arithmetic operation: " + opType);
            return null;
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:87,代码来源:xmliloptimizervisitor.cs


示例15: CanFoldArithmetic

 /// <summary>
 /// Return true if arithmetic operation "opType" can be computed over two literal operands without causing
 /// an overflow or divide by zero exception.
 /// </summary>
 private bool CanFoldArithmetic(QilNodeType opType, QilLiteral left, QilLiteral right) {
     return (FoldArithmetic(opType, left, right) is QilLiteral);
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:7,代码来源:xmliloptimizervisitor.cs


示例16: FoldComparison

        /// <summary>
        /// Compute the arithmetic operation "opType" over two literal operands and return the result as a QilLiteral.
        /// In the case of an overflow or divide by zero exception, return the unfolded result.
        /// </summary>
        private QilNode FoldComparison(QilNodeType opType, QilNode left, QilNode right) {
            object litLeft, litRight;
            int cmp;
            Debug.Assert(left.XmlType == right.XmlType, "Comparison is not defined between " + left.XmlType + " and " + right.XmlType);

            // Extract objects that represent each literal value
            litLeft = ExtractLiteralValue(left);
            litRight = ExtractLiteralValue(right);

            if (left.NodeType == QilNodeType.LiteralDouble) {
                // Equals and CompareTo do not handle NaN correctly
                if (Double.IsNaN((double) litLeft) || Double.IsNaN((double) litRight))
                    return (opType == QilNodeType.Ne) ? f.True() : f.False();
            }

            if (opType == QilNodeType.Eq)
                return litLeft.Equals(litRight) ? f.True() : f.False();

            if (opType == QilNodeType.Ne)
                return litLeft.Equals(litRight) ? f.False() : f.True();

            if (left.NodeType == QilNodeType.LiteralString) {
                // CompareTo does not use Ordinal comparison
                cmp = string.CompareOrdinal((string) litLeft, (string) litRight);
            }
            else {
                cmp = ((IComparable) litLeft).CompareTo(litRight);
            }

            switch (opType) {
                case QilNodeType.Gt: return cmp > 0 ? f.True() : f.False();
                case QilNodeType.Ge: return cmp >= 0 ? f.True() : f.False();
                case QilNodeType.Lt: return cmp < 0 ? f.True() : f.False();
                case QilNodeType.Le: return cmp <= 0 ? f.True() : f.False();
            }

            Debug.Assert(false, "Cannot fold this comparison operation: " + opType);
            return null;
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:43,代码来源:xmliloptimizervisitor.cs


示例17: QilTernary

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        public QilTernary(QilNodeType nodeType, QilNode left, QilNode center, QilNode right) : base(nodeType) {
            this.left = left;
            this.center = center;
            this.right = right;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:12,代码来源:QilTernary.cs


示例18: QilUnary

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        public QilUnary(QilNodeType nodeType, QilNode child) : base(nodeType) {
            this.child = child;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:10,代码来源:QilUnary.cs


示例19: QilStrConcat

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        public QilStrConcat(QilNodeType nodeType, QilNode delimiter, QilNode values) : base(nodeType, delimiter, values) {
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:QilStrConcat.cs


示例20: QilBinary

        //-----------------------------------------------
        // Constructor
        //-----------------------------------------------

        /// <summary>
        /// Construct a new node
        /// </summary>
        public QilBinary(QilNodeType nodeType, QilNode left, QilNode right) : base(nodeType) {
            this.left = left;
            this.right = right;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:QilBinary.cs



注:本文中的QilNodeType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Quad类代码示例发布时间:2022-05-24
下一篇:
C# QilNode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap