Class SymbolTableEntry

java.lang.Object
  extended bySymbolTableEntry
Direct Known Subclasses:
BlockEntry, FunctionEntry, VariableEntry

public abstract class SymbolTableEntry
extends java.lang.Object

A SymbolTableEntry holds semantic information for a symbol declared in a program. The information is the string name of the symbol and its declared data type.

SymbolTableEntry is an abstract class, with extensions for variable data entries and functional entries. These are defined, respectively, in the VariableEntry and FunctionEntry classes.


Field Summary
 java.lang.String name
          This symbol's name
 TreeNode type
          Data type, represented as a parse tree.
 
Constructor Summary
SymbolTableEntry()
          Construct this with null data fields.
SymbolTableEntry(java.lang.String name, TreeNode type)
          Construct this with the given data field values.
 
Method Summary
protected  java.lang.String doToString(int level, java.lang.String type)
          Common work doer for other toStrings.
protected  java.lang.String indentString(int level)
          Convenience method for creating an indent string.
 java.lang.String toString()
          Return toString(0).
 java.lang.String toString(int level)
          Return the string representation of this' two fields, with other fields added by this' extensions.
 java.lang.String toStringDeep()
          Return toStringDeep(0).
 java.lang.String toStringDeep(int level)
          Version of toString that dumps out the full type structure, not just its root ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
This symbol's name


type

public TreeNode type
Data type, represented as a parse tree.

Constructor Detail

SymbolTableEntry

public SymbolTableEntry()
Construct this with null data fields.


SymbolTableEntry

public SymbolTableEntry(java.lang.String name,
                        TreeNode type)
Construct this with the given data field values.

Method Detail

toString

public java.lang.String toString()
Return toString(0).


toStringDeep

public java.lang.String toStringDeep()
Return toStringDeep(0).


toString

public java.lang.String toString(int level)
Return the string representation of this' two fields, with other fields added by this' extensions. The fields are output on a single line, indented level * 2 blanks. Only the shallowest type string is output, namely just its root tree ID. The toStringDeep method outputs the full type field.


toStringDeep

public java.lang.String toStringDeep(int level)
Version of toString that dumps out the full type structure, not just its root ID.


doToString

protected java.lang.String doToString(int level,
                                      java.lang.String type)
Common work doer for other toStrings.


indentString

protected java.lang.String indentString(int level)
Convenience method for creating an indent string.