C# Class kOS.Safe.Compilation.OpcodePopScope

Pops a variable namespace scope (for example, when a "}" is encountered in a block-scoping language like C++ or Java or C#.) From now on any local variables created within the previous scope are orphaned and gone forever ready to be garbage collected. It is possible to give it an argument to pop more than one nesting level of scope, to handle the case where you are breaking out of more than one nested level at once. (i.e. such as might happen with a break, return, or exit keyword).
Inheritance: Opcode
ファイルを表示 Open project: KSP-KOS/KOS

Private Properties

Property Type Description

Public Methods

Method Description
DoPopScope ( ICpu cpuObj, Int16 levels ) : void

Do the actual work of the Execute() method. This was pulled out to a separate static method so that others can call it without needing an actual popscope object. Everything OpcodePopScope.Execute() does should actually be done here, so as to ensure that external callers of this get exactly the same behaviour as a full popstack opcode.

Execute ( ICpu cpu ) : void
OpcodePopScope ( ) : System
OpcodePopScope ( int numLevels ) : System
PopulateFromMLFields ( List fields ) : void
ToString ( ) : string

Method Details

DoPopScope() public static method

Do the actual work of the Execute() method. This was pulled out to a separate static method so that others can call it without needing an actual popscope object. Everything OpcodePopScope.Execute() does should actually be done here, so as to ensure that external callers of this get exactly the same behaviour as a full popstack opcode.
public static DoPopScope ( ICpu cpuObj, Int16 levels ) : void
cpuObj ICpu the shared.cpu to operate on.
levels System.Int16 number of levels to popscope.
return void

Execute() public method

public Execute ( ICpu cpu ) : void
cpu ICpu
return void

OpcodePopScope() public method

public OpcodePopScope ( ) : System
return System

OpcodePopScope() public method

public OpcodePopScope ( int numLevels ) : System
numLevels int
return System

PopulateFromMLFields() public method

public PopulateFromMLFields ( List fields ) : void
fields List
return void

ToString() public method

public ToString ( ) : string
return string