示例#1
0
        //-----------------------------------------------
        // QilVisitor overrides
        //-----------------------------------------------

        /// <summary>
        /// Visit all children of "parent", replacing each child with a copy of each child.
        /// </summary>
        protected override QilNode Visit(QilNode oldNode)
        {
            QilNode?newNode = null;

            if (oldNode == null)
            {
                return(null !);
            }

            // ShallowClone any nodes which have not yet been cloned
            if (oldNode is QilReference)
            {
                // Reference nodes may have been cloned previously and put into scope
                newNode = FindClonedReference(oldNode);
            }

            newNode ??= oldNode.ShallowClone(_fac);

            return(base.Visit(newNode));
        }
示例#2
0
        //-----------------------------------------------
        // QilScopedVisitor methods
        //-----------------------------------------------

        /// <summary>
        /// Push node and its shallow clone onto the substitution list.
        /// </summary>
        protected override void BeginScope(QilNode node)
        {
            _subs.AddSubstitutionPair(node, node.ShallowClone(_fac));
        }