Esempio n. 1
0
 /// <summary>
 ///     Basic constructor
 /// </summary>
 /// <param name="pattern"> The pattern to look for </param>
 /// <param name="processDelegate"> The callback to invoke when such a pattern is identified </param>
 internal PatternMatchRule(Node pattern, ProcessNodeDelegate processDelegate)
     : base(pattern.Op.OpType, processDelegate)
 {
     Debug.Assert(pattern != null, "null pattern");
     Debug.Assert(pattern.Op != null, "null pattern Op");
     m_pattern = pattern;
 }
Esempio n. 2
0
 // <summary>
 // Basic constructor
 // </summary>
 // <param name="pattern"> The pattern to look for </param>
 // <param name="processDelegate"> The callback to invoke when such a pattern is identified </param>
 internal PatternMatchRule(Node pattern, ProcessNodeDelegate processDelegate)
     : base(pattern.Op.OpType, processDelegate)
 {
     DebugCheck.NotNull(pattern);
     DebugCheck.NotNull(pattern.Op);
     m_pattern = pattern;
 }
Esempio n. 3
0
 /// <summary>
 /// Basic constructor
 /// </summary>
 /// <param name="pattern">The pattern to look for</param>
 /// <param name="processDelegate">The callback to invoke when such a pattern is identified</param>
 internal PatternMatchRule(Node pattern, ProcessNodeDelegate processDelegate)
     : base(pattern.Op.OpType, processDelegate)
 {
     Debug.Assert(pattern != null, "null pattern");
     Debug.Assert(pattern.Op != null, "null pattern Op");
     m_pattern = pattern;
 }
 /// <summary>
 ///     Basic constructor
 /// </summary>
 /// <param name="pattern"> The pattern to look for </param>
 /// <param name="processDelegate"> The callback to invoke when such a pattern is identified </param>
 internal PatternMatchRule(Node pattern, ProcessNodeDelegate processDelegate)
     : base(pattern.Op.OpType, processDelegate)
 {
     DebugCheck.NotNull(pattern);
     DebugCheck.NotNull(pattern.Op);
     m_pattern = pattern;
 }
Esempio n. 5
0
        /// <summary>
        ///     Basic constructor
        /// </summary>
        /// <param name="opType"> The OpType we're interested in processing </param>
        /// <param name="nodeProcessDelegate"> The callback to invoke </param>
        protected Rule(OpType opType, ProcessNodeDelegate nodeProcessDelegate)
        {
            DebugCheck.NotNull(nodeProcessDelegate);
            Debug.Assert(opType != OpType.NotValid, "bad OpType");
            Debug.Assert(opType != OpType.Leaf, "bad OpType - Leaf");

            m_opType       = opType;
            m_nodeDelegate = nodeProcessDelegate;
        }
Esempio n. 6
0
        /// <summary>
        /// Basic constructor
        /// </summary>
        /// <param name="opType">The OpType we're interested in processing</param>
        /// <param name="nodeProcessDelegate">The callback to invoke</param>
        protected Rule(OpType opType, ProcessNodeDelegate nodeProcessDelegate)
        {
            Debug.Assert(nodeProcessDelegate != null, "null process delegate");
            Debug.Assert(opType != OpType.NotValid, "bad OpType");
            Debug.Assert(opType != OpType.Leaf, "bad OpType - Leaf");

            m_opType = opType;
            m_nodeDelegate = nodeProcessDelegate;
        }
Esempio n. 7
0
 public void WalkInOrder(
     ProcessNodeDelegate processFunction,
     object data
     )
 {
     if (root != null)
     {
         _WalkInOrder(root, processFunction, data);
     }
 }
Esempio n. 8
0
 public void Walk(
     ProcessNodeDelegate processFunction,
     object data
     )
 {
     for (var i = 0; i < Count; i++)
     {
         processFunction(heap[i], data);
     }
 }
Esempio n. 9
0
 void _WalkInOrder(
     BinarySearchTreeNode <T> node,
     ProcessNodeDelegate processFunction,
     object data
     )
 {
     if (node.left != null)
     {
         _WalkInOrder(node.left, processFunction, data);
     }
     processFunction((object)node, data);
     if (node.right != null)
     {
         _WalkInOrder(node.right, processFunction, data);
     }
 }
Esempio n. 10
0
 // <summary>
 // Basic constructor.
 // </summary>
 // <param name="opType"> The OpType we're interested in </param>
 // <param name="processDelegate"> The callback to invoke when we see such an Op </param>
 internal SimpleRule(OpType opType, ProcessNodeDelegate processDelegate)
     : base(opType, processDelegate)
 {
 }
Esempio n. 11
0
 /// <summary>
 /// Basic constructor.
 /// </summary>
 /// <param name="opType">The OpType we're interested in</param>
 /// <param name="processDelegate">The callback to invoke when we see such an Op</param>
 internal SimpleRule(OpType opType, ProcessNodeDelegate processDelegate)
     : base(opType, processDelegate)
 {
 }