gnu.bytecode
Class Scope

java.lang.Object
  extended by gnu.bytecode.Scope

public class Scope
extends java.lang.Object


Constructor Summary
Scope()
           
Scope(Label start, Label end)
           
 
Method Summary
 Variable addVariable(CodeAttr code, Type type, java.lang.String name)
           
 void addVariable(CodeAttr code, Variable var)
           
 void addVariable(Variable var)
           
 void addVariableAfter(Variable prev, Variable var)
           
 VarEnumerator allVars()
           
 Variable firstVar()
           
 Variable getVariable(int index)
          Return a variable the scope, by numerical index.
 void linkChild(Scope parent)
          Link this scope as the next child of its parent scope.
 Variable lookup(java.lang.String name)
          Search by name for a Variable in this Scope (only).
 void setStartPC(CodeAttr code)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scope

public Scope()

Scope

public Scope(Label start,
             Label end)
Method Detail

firstVar

public final Variable firstVar()

allVars

public VarEnumerator allVars()

linkChild

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


addVariable

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

addVariable

public void addVariable(Variable var)

addVariableAfter

public void addVariableAfter(Variable prev,
                             Variable var)

addVariable

public void addVariable(CodeAttr code,
                        Variable var)

getVariable

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

Parameters:
index - the number of the variable

setStartPC

public void setStartPC(CodeAttr code)

lookup

public Variable lookup(java.lang.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).