Class VariableEntry

java.lang.Object
  extended bySymbolTableEntry
      extended byVariableEntry

public class VariableEntry
extends SymbolTableEntry

VariableEntry extends SymbolTableEntry by adding data fields to support variables and parameters. It has a boolean field indicating if this is a reference-type symbol. Reference-type symbols are definable in programming languages with explicitly declared pointer types and/or call-by-reference parameters.

VariableEntry also has an integer memory location field. This can be either an absolute address, or a relative offset, e.g., in a stack frame.


Field Summary
 boolean isRef
          True if this is a reference variable or parameter.
 int memoryLocation
          Memory location
 
Fields inherited from class SymbolTableEntry
name, type
 
Constructor Summary
VariableEntry()
          Construct this with null data fields.
VariableEntry(java.lang.String name, TreeNode type, boolean isRef, int memoryLocation)
          Construct this with the given data field values.
 
Method Summary
 java.lang.String toString(int level)
          Return the string rep of this, which consists of the return value of super.toString, plus the values of this.isRef and this.memoryLocation.
 
Methods inherited from class SymbolTableEntry
doToString, indentString, toString, toStringDeep, toStringDeep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isRef

public boolean isRef
True if this is a reference variable or parameter.


memoryLocation

public int memoryLocation
Memory location

Constructor Detail

VariableEntry

public VariableEntry()
Construct this with null data fields.


VariableEntry

public VariableEntry(java.lang.String name,
                     TreeNode type,
                     boolean isRef,
                     int memoryLocation)
Construct this with the given data field values.

Method Detail

toString

public java.lang.String toString(int level)
Return the string rep of this, which consists of the return value of super.toString, plus the values of this.isRef and this.memoryLocation.

Overrides:
toString in class SymbolTableEntry