コード例 #1
0
        void ReplaceIntervals(Expression done)
        {
            Expression node = GetExpressionParent(done);

            if (node == null)
            {
                return;
            }

            Interval leftInterval  = TailorUtil.GetInterval(node.Left);
            Interval rightInterval = TailorUtil.GetInterval(node.Right);

            if (leftInterval != null)
            {
                if (rightInterval != null)
                {
                    ReplaceBothIntervals(node, leftInterval, rightInterval);
                }
                else
                {
                    ReplaceLeftInterval(node, leftInterval);
                }
            }
            else if (rightInterval != null)
            {
                ReplaceRightInterval(node, rightInterval);
            }
        }
コード例 #2
0
        void CoalesceIntervals(Expression done)
        {
            Expression node = GetExpressionParent(done);

            if (node == null)
            {
                return;
            }

            Interval leftInterval  = TailorUtil.GetInterval(node.Left);
            Interval rightInterval = TailorUtil.GetInterval(node.Right);

            if ((leftInterval != null) && (rightInterval != null))
            {
                ReplaceIntervalOp(node, leftInterval, rightInterval);
            }
        }