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

PrepareGlobalValues() private method

Create IteratorDescriptor for each global value. This pre-visit is necessary because a global early in the list may reference a global later in the list and therefore expect its IteratorDescriptor to already be initialized.
private PrepareGlobalValues ( QilList globalIterators ) : void
globalIterators System.Xml.Xsl.Qil.QilList
return void
        private void PrepareGlobalValues(QilList globalIterators) {
            MethodInfo methGlobal;
            IteratorDescriptor iterInfo;

            foreach (QilIterator iter in globalIterators) {
                Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter);

                // Get metadata for method which computes this global's value
                methGlobal = XmlILAnnotation.Write(iter).FunctionBinding;
                Debug.Assert(methGlobal != null, "Metadata for global value should have already been computed");

                // Create an IteratorDescriptor for this global value
                iterInfo = new IteratorDescriptor(this.helper);

                // Iterator items will be stored in a global location
                iterInfo.Storage = StorageDescriptor.Global(methGlobal, GetItemStorageType(iter), !iter.XmlType.IsSingleton);

                // Associate IteratorDescriptor with parameter
                XmlILAnnotation.Write(iter).CachedIteratorDescriptor = iterInfo;
            }
        }
XmlILVisitor