|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fmrisc.Semantics.Environment
public final class Environment
The context that determines the meaning of identifiers.
Constructor Summary | |
---|---|
Environment()
create empty type and value environment |
Method Summary | |
---|---|
void |
addTCC(Expression formula)
Add type checking condition to environment. |
Environment |
cloneGlobal()
Create clone of global part of environment; the clone is a shallow copy (the symbols in the environment are not cloned). |
void |
enter()
enter a new scope all changes done to the environment after enter() will be undone after exit() |
void |
exit()
exit a scope all changes done after the after the last enter() are undone |
FormulaSymbol |
getFormulaSymbol(Identifier name)
returns symbol associated to name (null, if none) |
java.util.Collection |
getFormulaSymbols()
Get all formula symbols. |
java.util.Vector |
getGlobalValueSymbols()
Get global value symbols in the order in which they were entered. |
java.util.Vector |
getLocalVariables()
get local variables (all values with environment depth > 0) |
Expression[] |
getTCCs()
Get type checking conditions of current scope (not of all scopes). |
Type |
getType(Identifier name)
returns canonical type associated to key type equality implies pointer equality of types. |
TypeSymbol |
getTypeSymbol(Identifier name)
returns type symbol associated to key |
java.util.Collection |
getTypeSymbols()
Get all type symbols. |
ValueSymbol |
getValueSymbol(Identifier name)
returns symbol associated to name (null, if none) |
java.util.Collection |
getValueSymbols()
Get all value symbols. |
void |
put(ValueDeclIdentifier ident)
add the symbol associated to ident to current environment |
FormulaSymbol |
putFormula(FormulaDeclIdentifier name,
Expression formula,
boolean axiom)
put formula in environment |
FormulaSymbol |
putFormulaDeclaration(FormulaDeclaration fdecl)
put formula declaration into environment |
TypeSymbol |
putType(TypeDeclIdentifier name,
Type type)
put type in type table |
TypeSymbol |
putTypeDeclaration(TypeDeclaration tdecl)
put type declaration into environment |
ValueSymbol |
putValue(ValueDeclIdentifier name,
Type type,
Expression value)
put named value in value table |
ValueSymbol |
putValueDeclaration(ValueDeclaration vdecl)
put value declaration into environment |
boolean |
putVariables(TypedIdentifier[] vars)
put variables into environment |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Environment()
Method Detail |
---|
public Environment cloneGlobal()
public void enter()
public void exit()
public TypeSymbol putType(TypeDeclIdentifier name, Type type)
name
- the name of the typetype
- the type associated to the name
public TypeSymbol getTypeSymbol(Identifier name)
name
- the name of the type
public Type getType(Identifier name)
name
- the name of the type
public ValueSymbol putValue(ValueDeclIdentifier name, Type type, Expression value)
name
- the name of the valuetype
- the type associated to the valuevalue
- the value itself (may be null)
public ValueSymbol getValueSymbol(Identifier name)
name
- the name
public TypeSymbol putTypeDeclaration(TypeDeclaration tdecl)
tdecl
- type declaration
public ValueSymbol putValueDeclaration(ValueDeclaration vdecl)
vdecl
- value declaration
public boolean putVariables(TypedIdentifier[] vars)
vars
- the variable sequence
public java.util.Vector getLocalVariables()
public FormulaSymbol putFormula(FormulaDeclIdentifier name, Expression formula, boolean axiom)
name
- the name of the formulaformula
- the expression associated to the formulaaxiom
- true iff formula is axiom
public FormulaSymbol getFormulaSymbol(Identifier name)
name
- the name
public FormulaSymbol putFormulaDeclaration(FormulaDeclaration fdecl)
fdecl
- formula declaration
public void put(ValueDeclIdentifier ident)
ident
- identifier for an already processed value declarationpublic java.util.Collection getTypeSymbols()
public java.util.Collection getValueSymbols()
public java.util.Vector getGlobalValueSymbols()
public java.util.Collection getFormulaSymbols()
public void addTCC(Expression formula)
public Expression[] getTCCs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |