|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfmrisc.Semantics.TypeChecking
type checking routines
Constructor Summary | |
TypeChecking()
|
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 TypedIdentifier |
canonicalTypedIdentifier(TypedIdentifier tid)
returns canonical version of typed identifier (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 are replaced by their base types; the corresponding constraints are returned as a formula which a corresponding expression exp has to fulfill |
static boolean |
hasType(Expression exp,
Type etype,
Type type,
boolean tcc)
returns true iff expr of type etype matches type. |
static boolean |
isBoolean(Type type)
checks if type equals BOOLEAN |
static java.lang.Integer |
parseInt(java.lang.String digits)
get number from digit representation |
static void |
setMatchFunType(boolean match)
signals whether subtype matching is enabled for function types |
static Type |
subType(Type type0,
Type type1)
return greatest subtype of type0 and type1 (null, if none exists) does not generate tccs. |
static Type |
typeCheck(Expression value)
type check value |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TypeChecking()
Method Detail |
public static void setMatchFunType(boolean match)
match
- is true iff subtype matching is to be enabledpublic static boolean isBoolean(Type type)
type
-
public static Type canonical(Type type)
type
- the type
public static TypedIdentifier canonicalTypedIdentifier(TypedIdentifier tid)
tid
- the typed identifier
public static java.lang.Integer parseInt(java.lang.String digits)
digits
- the representation of the number as a decimal digit sequence
public static Type typeCheck(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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |