tip.types
Class Type

java.lang.Object
  extended by tip.types.Type
Direct Known Subclasses:
Function, Int, Pointer, Variable

public abstract class Type
extends Object


Method Summary
static void clearMarks()
          Clears all 'marked' in all type objects.
 boolean equiv(Type other)
          Returns true if this element is in the same equivalence class as 'other', false otherwise.
 Type find()
          Returns the canonical element of the set that this element is in.
 boolean isRoot()
          Returns true if this is a root, false otherwise.
static void renameRootVariables()
          Assigns names to type variables ( a,b,c,...)
abstract  void unify(Type type)
          Unify this type and the given type
 Type union(Type other)
          Computes and returns the union of this set and the given set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clearMarks

public static void clearMarks()
Clears all 'marked' in all type objects. Must be called prior to toString for each object. This is obviously inefficient but simple.


unify

public abstract void unify(Type type)
Unify this type and the given type


union

public Type union(Type other)
Computes and returns the union of this set and the given set. The root is always this set.


find

public Type find()
Returns the canonical element of the set that this element is in.


equiv

public boolean equiv(Type other)
Returns true if this element is in the same equivalence class as 'other', false otherwise.


isRoot

public boolean isRoot()
Returns true if this is a root, false otherwise.


renameRootVariables

public static void renameRootVariables()
Assigns names to type variables ( a,b,c,...) ML style