Package jminusminus

Class LocalVariableDefn

java.lang.Object
jminusminus.LocalVariableDefn
All Implemented Interfaces:
IDefn

class LocalVariableDefn extends Object implements IDefn
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 Details

    • LocalVariableDefn

      public LocalVariableDefn(Type type, int offset)
      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

      public Type type()
      Returns the type for this variable.
      Specified by:
      type in interface IDefn
      Returns:
      the type.
    • 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.