System.Xml.Xsl.IlGen.XmlILVisitor.CreateContainerIterator C# (CSharp) Method

CreateContainerIterator() private method

Generate boiler-plate code to create an Xml iterator that controls a nested iterator.
Iterator iter; iter.Create(filter [, orSelf]); ...nested iterator... navInput = nestedNested; goto LabelCall; LabelNext: navInput = null; LabelCall: switch (iter.MoveNext(navInput)) { case IteratorState.NoMoreNodes: goto LabelNextCtxt; case IteratorState.NextInputNode: goto LabelNextNested; }
private CreateContainerIterator ( QilUnary ndDod, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, XmlNodeKindFlags kinds, QilName ndName, TriState orSelf ) : void
ndDod System.Xml.Xsl.Qil.QilUnary
iterName string
iterType System.Type
methCreate System.Reflection.MethodInfo
methNext System.Reflection.MethodInfo
kinds XmlNodeKindFlags
ndName System.Xml.Xsl.Qil.QilName
orSelf TriState
return void
        private void CreateContainerIterator(QilUnary ndDod, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext,
                                                   XmlNodeKindFlags kinds, QilName ndName, TriState orSelf) {
            // Iterator iter;
            LocalBuilder locIter = this.helper.DeclareLocal(iterName, iterType);
            Label lblOnEndNested;
            QilLoop ndLoop = (QilLoop) ndDod.Child;
            Debug.Assert(ndDod.NodeType == QilNodeType.DocOrderDistinct && ndLoop != null);

            // iter.Create(filter [, orSelf]);
            this.helper.Emit(OpCodes.Ldloca, locIter);
            LoadSelectFilter(kinds, ndName);
            if (orSelf != TriState.Unknown)
                this.helper.LoadBoolean(orSelf == TriState.True);
            this.helper.Call(methCreate);

            // Generate nested iterator (branch to lblOnEndNested when iteration is complete)
            lblOnEndNested = this.helper.DefineLabel();
            StartNestedIterator(ndLoop, lblOnEndNested);
            StartBinding(ndLoop.Variable);
            EndBinding(ndLoop.Variable);
            EndNestedIterator(ndLoop.Variable);
            this.iterCurr.Storage = this.iterNested.Storage;

            GenerateContainerIterator(ndDod, locIter, lblOnEndNested, methNext, typeof(XPathNavigator));
        }
XmlILVisitor