fmrisc.Semantics
Class ValueTable

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

public final class ValueTable
extends SymbolTable

Value table for named value lookup.


Constructor Summary
ValueTable()
           
 
Method Summary
 ValueTable cloneValueTable()
          creates a clone of the symbol table, the clone is a shallow copy (the symbols in the table are not cloned)
 ValueSymbol getSymbol(Identifier name)
          returns symbol associated to name (null, if none)
 ValueSymbol put(ValueDeclIdentifier name, Type type, Expression value, int depth)
          put named value in value 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

ValueTable

public ValueTable()
Method Detail

cloneValueTable

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


put

public ValueSymbol put(ValueDeclIdentifier name,
                       Type type,
                       Expression value,
                       int depth)
put named value in value table

Parameters:
name - the name of the value
type - the type associated to the value
value - the value itself (may be null)
depth - the current environment depth
Returns:
constructed symbol (null, if an error occured)

getSymbol

public ValueSymbol 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)