orc.ast.simple.type
Class Datatype

java.lang.Object
  extended by orc.ast.simple.type.Type
      extended by orc.ast.simple.type.Datatype

public class Datatype
extends Type

A syntactic type encompassing all of the information associated with a datatype.

Author:
dkitchin

Field Summary
 java.util.List<TypeVariable> formals
           
 java.util.List<java.util.List<Type>> members
           
 TypeVariable typename
           
 
Fields inherited from class orc.ast.simple.type.Type
BOT, TOP
 
Constructor Summary
Datatype(TypeVariable typename, java.util.List<java.util.List<Type>> members, java.util.List<TypeVariable> formals)
           
 
Method Summary
 Type convert(Env<TypeVariable> env)
          Convert this syntactic type into an actual type, given an appropriate type context
 Type subst(Type T, FreeTypeVariable X)
          Performs the substitution [T/X], replacing occurrences of the free type variable X with the type T (which could be any type, including another variable).
 
Methods inherited from class orc.ast.simple.type.Type
convertAll, subMap, substAll, substMaybe, subvar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typename

public TypeVariable typename

members

public java.util.List<java.util.List<Type>> members

formals

public java.util.List<TypeVariable> formals
Constructor Detail

Datatype

public Datatype(TypeVariable typename,
                java.util.List<java.util.List<Type>> members,
                java.util.List<TypeVariable> formals)
Method Detail

convert

public Type convert(Env<TypeVariable> env)
             throws TypeException
Description copied from class: Type
Convert this syntactic type into an actual type, given an appropriate type context

Specified by:
convert in class Type
Parameters:
env - The type environment, used in content addressable mode to find the appropriate deBruijn index of a type variable.
Returns:
A new node.
Throws:
TypeException

subst

public Type subst(Type T,
                  FreeTypeVariable X)
Description copied from class: Type
Performs the substitution [T/X], replacing occurrences of the free type variable X with the type T (which could be any type, including another variable).

Specified by:
subst in class Type
Parameters:
T - The replacing type
X - The free type variable whose occurrences will be replaced
Returns:
A new copy of the type with the substitution performed