Example #1
0
        /// <summary>
        /// Create and initialize XmlILConstructInfo annotation for the specified node.
        /// </summary>
        public static XmlILConstructInfo Write(QilNode nd)
        {
            XmlILAnnotation    ann        = XmlILAnnotation.Write(nd);
            XmlILConstructInfo constrInfo = ann.ConstructInfo;

            if (constrInfo == null || constrInfo._isReadOnly)
            {
                constrInfo        = new XmlILConstructInfo(nd.NodeType);
                ann.ConstructInfo = constrInfo;
            }

            return(constrInfo);
        }
Example #2
0
        /// <summary>
        /// Create and initialize OptimizerPatterns annotation for the specified node.
        /// </summary>
        public static OptimizerPatterns Write(QilNode nd)
        {
            XmlILAnnotation   ann     = XmlILAnnotation.Write(nd);
            OptimizerPatterns optPatt = ann.Patterns;

            if (optPatt == null || optPatt._isReadOnly)
            {
                optPatt      = new OptimizerPatterns();
                ann.Patterns = optPatt;

                if (!nd.XmlType.MaybeMany)
                {
                    optPatt.AddPattern(OptimizerPatternName.IsDocOrderDistinct);
                    optPatt.AddPattern(OptimizerPatternName.SameDepth);
                }
                else if (nd.XmlType.IsDod)
                {
                    optPatt.AddPattern(OptimizerPatternName.IsDocOrderDistinct);
                }
            }

            return(optPatt);
        }