orc.type
Class TypingContext

java.lang.Object
  extended by 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

Field Summary
protected  Config config
           
protected  Env<Type> typeContext
           
protected  Env<Type> varContext
           
 
Constructor Summary
TypingContext()
           
TypingContext(Config config)
           
TypingContext(Env<Type> varContext, Env<Type> typeContext, Config config)
           
 
Method Summary
 TypingContext bindType(Type T)
           
 TypingContext bindVar(Type T)
           
 Type lookupType(int var)
          Find the binding for this type variable.
 Type lookupVar(int var)
          Find the binding for this program variable.
 Type promote(Type t)
           
 java.util.List<Type> promoteAll(java.util.List<Type> ts)
           
 Type resolveClassType(java.lang.String classname)
           
 Type resolveSiteType(java.lang.String classname)
           
 Type subst(Type T)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

varContext

protected Env<Type> varContext

typeContext

protected Env<Type> typeContext

config

protected Config config
Constructor Detail

TypingContext

public TypingContext()

TypingContext

public TypingContext(Config config)

TypingContext

public TypingContext(Env<Type> varContext,
                     Env<Type> typeContext,
                     Config config)
Method Detail

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)

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