orc.type
Class TypingContext
java.lang.Object
orc.type.TypingContext
public class TypingContext
- extends java.lang.Object
The context used by the typechecker. Subsumes the variable typing context
and the type binding stack, each of which is accessed using a different method.
Also internalizes kinding checks, providing separate lookupType and lookupTycon
methods on the type binding stack.
- Author:
- dkitchin
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
varContext
protected Env<Type> varContext
typeContext
protected Env<Type> typeContext
config
protected Config config
ic
protected InferenceContinuation ic
TypingContext
public TypingContext()
TypingContext
public TypingContext(Config config)
TypingContext
public TypingContext(Env<Type> varContext,
Env<Type> typeContext,
Config config)
TypingContext
public TypingContext(Env<Type> varContext,
Env<Type> typeContext,
Config config,
InferenceContinuation ic)
lookupVar
public Type lookupVar(int var)
- Find the binding for this program variable.
- Parameters:
var
-
- Returns:
- The type of var in this context
lookupType
public Type lookupType(int var)
- Find the binding for this type variable.
- Parameters:
var
-
- Returns:
- The type of var in this context
bindVar
public TypingContext bindVar(Type T)
bindType
public TypingContext bindType(Type T)
bindIC
public TypingContext bindIC(InferenceContinuation ic)
resolveSiteType
public Type resolveSiteType(java.lang.String classname)
throws TypeException
- Throws:
TypeException
resolveClassType
public Type resolveClassType(java.lang.String classname)
throws TypeException
- Throws:
TypeException
subst
public Type subst(Type T)
throws TypeException
- Throws:
TypeException
promote
public Type promote(Type t)
throws TypeException
- Throws:
TypeException
promoteAll
public java.util.List<Type> promoteAll(java.util.List<Type> ts)
throws TypeException
- Throws:
TypeException
requestInference
public Type requestInference(ArrowType arrowType)
throws TypeException
- Throws:
TypeException