public class Variable extends Location implements java.util.Enumeration
Modifier and Type | Field and Description |
---|---|
int |
offset
The local variable slot number used by this variable.
|
Constructor and Description |
---|
Variable() |
Variable(java.lang.String name) |
Variable(java.lang.String name,
Type type) |
Modifier and Type | Method and Description |
---|---|
void |
allocateLocal(CodeAttr code)
Allocate slots for a local variable (or parameter).
|
boolean |
dead() |
void |
freeLocal(CodeAttr code) |
Scope |
getScope() |
boolean |
hasMoreElements() |
boolean |
isAssigned()
Returns true iff assigned to a local variable slot.
|
boolean |
isParameter() |
boolean |
isSimple()
Returns true for a "simple" variable.
|
java.lang.Object |
nextElement() |
Variable |
nextVar() |
boolean |
reserveLocal(int varIndex,
CodeAttr code)
Assign a local variable to a given local variable slot.
|
void |
setParameter(boolean parameter) |
void |
setSimple(boolean simple) |
java.lang.String |
toString() |
getName, getSignature, getType, setName, setName, setSignature, setType
public int offset
public Variable()
public Variable(java.lang.String name)
public Variable(java.lang.String name, Type type)
public final Variable nextVar()
public final boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration
public java.lang.Object nextElement()
nextElement
in interface java.util.Enumeration
public final boolean isAssigned()
public Scope getScope()
public final boolean dead()
public final boolean isSimple()
public final void setSimple(boolean simple)
public final boolean isParameter()
public final void setParameter(boolean parameter)
public boolean reserveLocal(int varIndex, CodeAttr code)
varIndex
- the index of the local variables.public void allocateLocal(CodeAttr code)
public void freeLocal(CodeAttr code)
public java.lang.String toString()
toString
in class java.lang.Object