Class IntTable

java.lang.Object
  extended byAbstractTable
      extended byIntTable

class IntTable
extends AbstractTable


Field Summary
static IdTable idtable
          Global string table of identifiers
static IntTable inttable
          Global string table of integer constants
static StringTable stringtable
          Global string table of string constants
protected  java.util.Vector tbl
          Vector of table entries
 
Constructor Summary
(package private) IntTable()
           
 
Method Summary
 AbstractSymbol addInt(int i)
          Adds the string representation of the specified integer to this string table
 AbstractSymbol addString(java.lang.String s)
          Adds the specified string to this string table
 AbstractSymbol addString(java.lang.String s, int maxchars)
          Adds prefix of the specified length to this string table
 void codeStringTable(int intclasstag, java.io.PrintStream s)
          Generates code for all int constants in the int table.
protected  AbstractSymbol getNewSymbol(java.lang.String s, int len, int index)
          Creates a new IntSymbol object.
 java.util.Enumeration getSymbols()
          Returns an enumeration of symbols in this string table
 AbstractSymbol lookup(int index)
          Looks up a symbol in this string table by its index A fatal error is signalled if the index is out of bounds.
 AbstractSymbol lookup(java.lang.String s)
          Looks up a symbol in this string table by its string representation A fatal error is signalled if the string is not in the table
 java.lang.String toString()
          Produces a printable representation of the string table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stringtable

public static StringTable stringtable
Global string table of string constants


idtable

public static IdTable idtable
Global string table of identifiers


inttable

public static IntTable inttable
Global string table of integer constants


tbl

protected java.util.Vector tbl
Vector of table entries

Constructor Detail

IntTable

IntTable()
Method Detail

getNewSymbol

protected AbstractSymbol getNewSymbol(java.lang.String s,
                                      int len,
                                      int index)
Creates a new IntSymbol object.

Specified by:
getNewSymbol in class AbstractTable
See Also:
IntSymbol

codeStringTable

public void codeStringTable(int intclasstag,
                            java.io.PrintStream s)
Generates code for all int constants in the int table.

Parameters:
intclasstag - the class tag for Int
s - the output stream

addString

public AbstractSymbol addString(java.lang.String s,
                                int maxchars)
Adds prefix of the specified length to this string table

Parameters:
s - the string to add
maxchars - the length of the prefix
Returns:
the symbol for the string s

addString

public AbstractSymbol addString(java.lang.String s)
Adds the specified string to this string table

Parameters:
s - the string to add
Returns:
the symbol for the string s

addInt

public AbstractSymbol addInt(int i)
Adds the string representation of the specified integer to this string table

Parameters:
i - the integer to add
Returns:
the symbol for the integer i

getSymbols

public java.util.Enumeration getSymbols()
Returns an enumeration of symbols in this string table

Returns:
an enumeration of symbols
See Also:
Enumeration

lookup

public AbstractSymbol lookup(int index)
Looks up a symbol in this string table by its index A fatal error is signalled if the index is out of bounds.

Parameters:
index - the index of the symbol
Returns:
a symbol corresponding to the index

lookup

public AbstractSymbol lookup(java.lang.String s)
Looks up a symbol in this string table by its string representation A fatal error is signalled if the string is not in the table

Parameters:
s - the string representation of the symbol
Returns:
a symbol corresponding to the string

toString

public java.lang.String toString()
Produces a printable representation of the string table