fmrisc.Semantics
Class ValueSymbol

java.lang.Object
  extended by fmrisc.Semantics.SymbolBase
      extended by fmrisc.Semantics.ValueSymbol
All Implemented Interfaces:
Symbol

public final class ValueSymbol
extends SymbolBase

Symbols in ValueTable.


Constructor Summary
ValueSymbol(ValueDeclIdentifier ident)
          Construct value symbol from ident (type and value are both null).
 
Method Summary
 TypeExpression getClearType()
          Get clear type.
 int getDepth()
          Return environment depth of symbol.
 Type getType()
          Return type of symbol.
 Expression getValue()
          Return value of symbol
 ValueDeclIdentifier getValueDeclIdentifier()
          Return identifier of symbol.
 int getVarNumber()
          Return variable number of symbol.
 void instantiate(ValueSymbol symbol)
          Instantiate symbol with copy of denoted symbol.
 void setClearType(TypeExpression clearType)
          Set clear type to typexp.
 void setDepth(int depth)
          Set environment depth of symbol.
 void setType(Type type)
          Set type of symbol.
 void setValue(Expression value)
          Set value of symbol.
 void setVarNumber(int varNumber)
          Set variable number of symbol.
 
Methods inherited from class fmrisc.Semantics.SymbolBase
getIdentifier
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueSymbol

public ValueSymbol(ValueDeclIdentifier ident)
Construct value symbol from ident (type and value are both null).

Parameters:
ident - the identifier of the symbol.
Method Detail

getValueDeclIdentifier

public ValueDeclIdentifier getValueDeclIdentifier()
Return identifier of symbol.

Returns:
the symbol identifier

getType

public Type getType()
Return type of symbol.

Returns:
the symbol type

getValue

public Expression getValue()
Return value of symbol

Returns:
the symbol value (may be null)

getDepth

public int getDepth()
Return environment depth of symbol.

Returns:
the environment depth

getVarNumber

public int getVarNumber()
Return variable number of symbol.

Returns:
the variable number (only if depth > 0)

setType

public void setType(Type type)
Set type of symbol.

Parameters:
type - the symbol type

setValue

public void setValue(Expression value)
Set value of symbol.

Parameters:
value - the symbol value

setDepth

public void setDepth(int depth)
Set environment depth of symbol.

Parameters:
depth - the symbol environment depth

setVarNumber

public void setVarNumber(int varNumber)
Set variable number of symbol.

Parameters:
varNumber - variable number of symbol

setClearType

public void setClearType(TypeExpression clearType)
Set clear type to typexp.

Parameters:
clearType - the type/expression pair representing the cleared type

getClearType

public TypeExpression getClearType()
Get clear type.

Returns:
the type/expression pair representing the cleared type

instantiate

public void instantiate(ValueSymbol symbol)
Instantiate symbol with copy of denoted symbol. The identifier is *not* copied from the denoted symbol also the cleartype is not yet instantiated.

Parameters:
symbol - the symbol from which the instantiation is derived