gnu.bytecode

Class Scope

public class Scope extends Object

Constructor Summary
Scope()
Scope(Label start, Label end)
Method Summary
VariableaddVariable(CodeAttr code, Type type, String name)
voidaddVariable(Variable var)
voidaddVariable(CodeAttr code, Variable var)
voidaddVariableAfter(Variable prev, Variable var)
VarEnumeratorallVars()
VariablefirstVar()
VariablegetVariable(int index)
Return a variable the scope, by numerical index.
voidlinkChild(Scope parent)
Link this scope as the next child of its parent scope.
Variablelookup(String name)
Search by name for a Variable in this Scope (only).
voidsetStartPC(CodeAttr code)

Constructor Detail

Scope

public Scope()

Scope

public Scope(Label start, Label end)

Method Detail

addVariable

public Variable addVariable(CodeAttr code, Type type, String name)

addVariable

public void addVariable(Variable var)

addVariable

public void addVariable(CodeAttr code, Variable var)

addVariableAfter

public void addVariableAfter(Variable prev, Variable var)

allVars

public VarEnumerator allVars()

firstVar

public final Variable firstVar()

getVariable

public Variable getVariable(int index)
Return a variable the scope, by numerical index.

Parameters: index the number of the variable

linkChild

public void linkChild(Scope parent)
Link this scope as the next child of its parent scope.

lookup

public Variable lookup(String name)
Search by name for a Variable in this Scope (only).

Parameters: name name to search for

Returns: the Variable, or null if not found (in this scope).

setStartPC

public void setStartPC(CodeAttr code)