fmrisc.Semantics
Class TypeTable

java.lang.Object
  extended by fmrisc.Semantics.SymbolTable
      extended by fmrisc.Semantics.TypeTable

public final class TypeTable
extends SymbolTable

Type table for type checking.


Constructor Summary
TypeTable()
           
 
Method Summary
 TypeTable cloneTypeTable()
          creates a clone of the symbol table, the clone is a shallow copy (the symbols in the table are not cloned)
 TypeSymbol getSymbol(Identifier name)
          returns symbol associated to name (null, if none)
 Type getType(Identifier key)
          returns canonical type associated to key type equality implies pointer equality of types.
 TypeSymbol put(TypeDeclIdentifier key, Type type)
          put type in type table
 
Methods inherited from class fmrisc.Semantics.SymbolTable
cloneTable, getSymbols
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeTable

public TypeTable()
Method Detail

cloneTypeTable

public TypeTable cloneTypeTable()
creates a clone of the symbol table, the clone is a shallow copy (the symbols in the table are not cloned)


put

public TypeSymbol put(TypeDeclIdentifier key,
                      Type type)
put type in type table

Parameters:
key - the name of the type
type - the type associated to the name
Returns:
constructed symbol (null, if an error occured)

getSymbol

public TypeSymbol getSymbol(Identifier name)
returns symbol associated to name (null, if none)

Parameters:
name - the name
Returns:
the symbol associated to the name (may be null)

getType

public Type getType(Identifier key)
returns canonical type associated to key type equality implies pointer equality of types.

Parameters:
key - the name of the type
Returns:
the canonical type associated to key