orc.ast.simple.type
Class FreeTypeVariable
java.lang.Object
orc.ast.simple.type.Type
orc.ast.simple.type.FreeTypeVariable
- All Implemented Interfaces:
- java.lang.Comparable<FreeTypeVariable>
public class FreeTypeVariable
- extends Type
- implements java.lang.Comparable<FreeTypeVariable>
A free type variable.
- Author:
- dkitchin
Field Summary |
java.lang.String |
name
|
Fields inherited from class orc.ast.simple.type.Type |
BOT, TOP |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
name
public java.lang.String name
FreeTypeVariable
public FreeTypeVariable(java.lang.String name)
compareTo
public int compareTo(FreeTypeVariable f)
- Specified by:
compareTo
in interface java.lang.Comparable<FreeTypeVariable>
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 typeX
- The free type variable whose occurrences will be replaced
- Returns:
- A new copy of the type with the substitution performed
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object