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

StartBinding() private method

Generate code for a Let, For, or Parameter iterator. Bind iterated value to a variable.
private StartBinding ( QilIterator ndIter ) : void
ndIter System.Xml.Xsl.Qil.QilIterator
return void
        private void StartBinding(QilIterator ndIter) {
            OptimizerPatterns patt = OptimizerPatterns.Read(ndIter);
            Debug.Assert(ndIter != null);

            // DebugInfo: Sequence point just before generating code for the bound expression
            if (this.qil.IsDebug && ndIter.SourceLine != null)
                this.helper.DebugSequencePoint(ndIter.SourceLine);

            // Treat cardinality one Let iterators as if they were For iterators (no nesting necessary)
            if (ndIter.NodeType == QilNodeType.For || ndIter.XmlType.IsSingleton) {
                StartForBinding(ndIter, patt);
            }
            else {
                Debug.Assert(ndIter.NodeType == QilNodeType.Let || ndIter.NodeType == QilNodeType.Parameter);
                Debug.Assert(!patt.MatchesPattern(OptimizerPatternName.IsPositional));

                // Bind Let values (nested iterator) to variable
                StartLetBinding(ndIter);
            }

            // Attach IteratorDescriptor to the iterator
            XmlILAnnotation.Write(ndIter).CachedIteratorDescriptor = this.iterNested;
        }
XmlILVisitor