Package jminusminus
Class LocalVariableDefn
java.lang.Object
jminusminus.LocalVariableDefn
- All Implemented Interfaces:
Defn
The definition for a local variable (including formal parameters). All local variables are allocated on the stack
at fixed offsets from the base of the stack frame and all have types. Some local variables have initializations.
-
Constructor Summary
ConstructorsConstructorDescriptionLocalVariableDefn
(Type type, int offset) Constructs a local variable definition for a local variable. -
Method Summary
-
Constructor Details
-
LocalVariableDefn
Constructs a local variable definition for a local variable.- Parameters:
type
- the variable's type.offset
- the variable's offset from the base of the current stack frame (allocated for each method invocation).
-
-
Method Details
-
type
Returns the type for this variable. -
offset
public int offset()Returns the offset of this variable on the stack frame.- Returns:
- the offset.
-
initialize
public void initialize()Initializes this local variable. -
isInitialized
public boolean isInitialized()Returns true if this local variable has been initialized, and false otherwise.- Returns:
- true if this local variable has been initialized, and false otherwise.
-