Package gnu.bytecode
Class Scope
- java.lang.Object
-
- gnu.bytecode.Scope
-
public class Scope extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VariableaddVariable(CodeAttr code, Type type, java.lang.String name)voidaddVariable(CodeAttr code, Variable var)voidaddVariable(Variable var)voidaddVariableAfter(Variable prev, Variable var)VarEnumeratorallVars()VariablefirstVar()voidfixParamNames(java.util.HashMap<java.lang.String,Variable> map)Fix duplicate names.LabelgetEndLabel()LabelgetStartLabel()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(java.lang.String name)Search by name for a Variable in this Scope (only).voidnoteStartFunction(CodeAttr code)Should be called at the start of a logical function - inlined or not.voidsetStartPC(CodeAttr code)
-
-
-
Method Detail
-
firstVar
public final Variable firstVar()
-
allVars
public VarEnumerator allVars()
-
getStartLabel
public Label getStartLabel()
-
getEndLabel
public Label getEndLabel()
-
linkChild
public void linkChild(Scope parent)
Link this scope as the next child of its parent scope.
-
addVariable
public void addVariable(Variable var)
-
getVariable
public Variable getVariable(int index)
Return a variable the scope, by numerical index.- Parameters:
index- the number of the variable
-
fixParamNames
public void fixParamNames(java.util.HashMap<java.lang.String,Variable> map)
Fix duplicate names. This is needed for Android, since otherwise dex complains.
-
setStartPC
public void setStartPC(CodeAttr code)
-
noteStartFunction
public void noteStartFunction(CodeAttr code)
Should be called at the start of a logical function - inlined or not.
-
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).
-
-