src/sys/dotnet/perwapi/PERWAPI.cs
/// <summary>
/// Bind a local to the current scope.
/// </summary>
/// <param name="name">The name of the variable.</param>
/// <param name="idx">The index of the variable in the locals table.</param>
/// <param name="token">The symbol token for the given variable.</param>
/// <param name="startOffset">The starting offset for the binding.  Set to 0 to default to current scope.</param>
/// <param name="endOffset">The ending offset for the binding.  Set to 0 to default to current scope.</param>
Bind a local to the current scope.
Bind a local to the current scope .
public void BindLocal(string name, int idx, uint token, int startOffset, int endOffset) {
            if (currentScope == null)
                throw new Exception("You must have an open scope in order to bind locals.");
            LocalBinding lb = new LocalBinding();
            lb.Name = name;
            lb.Index = idx;
            lb.Token = new SymbolToken((int)token);
            lb.OffsetStart = startOffset;
            lb.OffsetEnd = endOffset;
            currentScope.Locals.Add(lb);
        }
public void BindLocal ( string name , int idx , uint token , int startOffset , int endOffset ) { if ( currentScope == null ) throw new Exception ( " " ) ; LocalBinding lb = new LocalBinding ( ) ; lb . Name = name ; lb . Index = idx ; lb . Token = new SymbolToken ( ( int ) token ) ; lb . OffsetStart = startOffset ; lb . OffsetEnd = endOffset ; currentScope . Locals . Add ( lb ) ; }
Bind a local to the current scope.
Bind a local to the current scope .
// Check to make sure a scope is open // Create the new local binding object // Add to the current scope
name
string
The name of the variable.
The name of the variable .
idx
int
The index of the variable in the locals table.
The index of the variable in the locals table .
token
uint
The symbol token for the given variable.
The symbol token for the given variable .
startOffset
int
The starting offset for the binding.
The starting offset for the binding .
endOffset
int
The ending offset for the binding.
The ending offset for the binding .