System.Xml.Xsl.IlGen.GenerateHelper.MethodEnd C# (CSharp) Method

MethodEnd() public method

Generate "ret" instruction and branch fixup jump table.
public MethodEnd ( ) : void
return void
        public void MethodEnd()
        {
            Emit(OpCodes.Ret);

#if DEBUG
            if (XmlILTrace.IsEnabled) {
                this.writerDump.WriteLine("}");
                this.writerDump.WriteLine("");
                this.writerDump.Close();
            }
#endif

            if (_isDebug)
                DebugEndScope();
        }

Usage Example

Esempio n. 1
0
        //-----------------------------------------------
        // Entry
        //-----------------------------------------------

        /// <summary>
        /// Visits the specified QilExpression graph and generates MSIL code.
        /// </summary>
        public void Visit(QilExpression qil, GenerateHelper helper, MethodInfo methRoot)
        {
            _qil = qil;
            _helper = helper;
            _iterNested = null;
            _indexId = 0;

            // Prepare each global parameter and global variable to be visited
            PrepareGlobalValues(qil.GlobalParameterList);
            PrepareGlobalValues(qil.GlobalVariableList);

            // Visit each global parameter and global variable
            VisitGlobalValues(qil.GlobalParameterList);
            VisitGlobalValues(qil.GlobalVariableList);

            // Build each function
            foreach (QilFunction ndFunc in qil.FunctionList)
            {
                // Visit each parameter and the function body
                Function(ndFunc);
            }

            // Build the root expression
            _helper.MethodBegin(methRoot, null, true);
            StartNestedIterator(qil.Root);
            Visit(qil.Root);
            Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None, "Root expression should have been pushed to the writer.");
            EndNestedIterator(qil.Root);
            _helper.MethodEnd();
        }