|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fmrisc.Semantics.Checking
public final class Checking
type checking routines
Constructor Summary | |
---|---|
Checking()
|
Method Summary | |
---|---|
static Type |
canonical(Type type)
Returns canonical version of type (equality of two types implies the equality of the canonical version of the types). |
static Type |
canonicalTcc(Type type)
Returns canonical version of type (equality of two types implies the equality of the canonical version of the types). |
static TypeExpression |
clearSubtypes(Type type,
Expression exp)
return version of type where subtypes and subranges (including NAT) are replaced by their base types; the corresponding constraints are returned as a formula which a corresponding expression exp has to fulfill |
static Type |
getBooleanType()
Get canonical type BOOLEAN |
static Type |
getIntType()
Get canonical type INT |
static Type |
getNatType()
Get canonical type NAT |
static java.util.Collection |
getReferencedSymbols()
get collection of referenced symbols |
static boolean |
hasType(Expression exp,
Type etype,
Type type,
boolean tcc)
returns true iff expr of type etype matches type. |
static void |
init()
Initialize checking state |
static boolean |
isBoolean(Type type)
checks if type equals BOOLEAN |
static boolean |
isInt(Type type)
checks if type equals INT |
static boolean |
isNat(Type type)
checks if type equals NAT |
static java.lang.Integer |
parseInt(java.lang.String digits)
get number from digit representation |
static Type |
process(Expression value)
type check value |
static void |
resetReferencedSymbols()
reset collection of referenced symbols |
static void |
setStrongerTypes(boolean stronger)
signals whether stronger type discipline is to be preserved |
static void |
setWeakerTypes(boolean weaker)
signals whether weaker type discipline is to be preserved |
static void |
simplifyNames(TypedIdentifier[] vars,
Environment env,
Expression exp)
Simplify names of local variables to their base names if no name capture can occur. |
static Type |
subType(Type type0,
Type type1)
return greatest subtype of type0 and type1 (null, if none exists) does not generate tccs. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Checking()
Method Detail |
---|
public static void init()
public static void setStrongerTypes(boolean stronger)
stronger
- is true iff stronger type discipline is to be preservedpublic static void setWeakerTypes(boolean weaker)
weaker
- is true iff weaker type discipline is to be preservedpublic static Type getBooleanType()
public static Type getIntType()
public static Type getNatType()
public static boolean isBoolean(Type type)
type
-
public static boolean isInt(Type type)
type
-
public static boolean isNat(Type type)
type
-
public static java.util.Collection getReferencedSymbols()
public static void resetReferencedSymbols()
public static Type canonical(Type type)
type
- the type
public static Type canonicalTcc(Type type)
type
- the type
public static java.lang.Integer parseInt(java.lang.String digits)
digits
- the representation of the number as a decimal digit sequence
public static Type process(Expression value)
value
- the value to be type checked
public static boolean hasType(Expression exp, Type etype, Type type, boolean tcc)
exp
- the expression (may be null if tcc is false)etype
- its typetype
- the type which expr:etype is expected to matchtcc
- true iff a tcc may be generated
public static Type subType(Type type0, Type type1)
type0
- a typetype1
- a type
public static TypeExpression clearSubtypes(Type type, Expression exp)
type
- the type to be clearedexp
- an expression of this type
public static void simplifyNames(TypedIdentifier[] vars, Environment env, Expression exp)
vars
- local variablesenv
- the environment in which the local variables are introduced.exp
- the expression within which the variables are referenced.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |