jif.types
Class VarLabel_c

java.lang.Object
  |
  +--polyglot.ext.jl.types.TypeObject_c
        |
        +--jif.types.Label_c
              |
              +--jif.types.VarLabel_c
All Implemented Interfaces:
java.lang.Cloneable, polyglot.util.Copy, Label, Param, java.io.Serializable, polyglot.types.TypeObject, VarLabel

public class VarLabel_c
extends Label_c
implements VarLabel

An implementation of the VarLabel interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class polyglot.ext.jl.types.TypeObject_c
position, ts
 
Constructor Summary
protected VarLabel_c()
           
  VarLabel_c(JifTypeSystem ts, polyglot.util.Position pos, UID uid)
           
 
Method Summary
 Label bound(VarMap ub, java.util.Set visited)
          Gets the upper bound of this label.
 java.lang.String componentString()
           
 boolean equalsImpl(polyglot.types.TypeObject o)
           
 int hashCode()
           
 boolean isCanonical()
          By default labels are canonical.
 boolean isComparable()
          Is this label comparable to other labels?
 boolean isCovariant()
          Is this label covariant?
 boolean isRuntimeRepresentable()
           
 Label labelOf()
          Gets labelOf this label.
 boolean leq_(Label jc, LabelEnv env)
          Implementation of leq, should only be called by JifTypeSystem
 Label meet_(Label L, PrincipalHierarchy ph)
          Implementation of the meet operation, should only be called by JifTypeSystem
 Label subst(UID uid, Label L)
          Substitutes any occurences of for L.
 void translate(polyglot.types.Resolver c, polyglot.util.CodeWriter w)
           
 UID uid()
           
 VarLabel uid(UID uid)
           
 java.util.Collection variables()
          The collection of variables contained by this label (or any of its components).
 
Methods inherited from class jif.types.Label_c
components, description, description, fold, hasVariables, isBottom, isEnumerable, isInvariant, isMeetable, isSingleton, isTop, join, join, leq_, meet, meet, minus, simplify, singletonComponent, subst, toJava, toString
 
Methods inherited from class polyglot.ext.jl.types.TypeObject_c
copy, equals, position, typeSystem
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jif.types.Label
components, description, description, fold, hasVariables, isBottom, isEnumerable, isInvariant, isMeetable, isSingleton, isTop, join, join, leq_, meet, meet, minus, simplify, singletonComponent, subst, toJava
 
Methods inherited from interface polyglot.types.TypeObject
position, typeSystem
 
Methods inherited from interface polyglot.util.Copy
copy
 

Constructor Detail

VarLabel_c

protected VarLabel_c()

VarLabel_c

public VarLabel_c(JifTypeSystem ts,
                  polyglot.util.Position pos,
                  UID uid)
Method Detail

isComparable

public boolean isComparable()
Description copied from interface: Label
Is this label comparable to other labels?

For example, an UnknownLabel is not comparable to others, neither is a VarLabel. Most other labels are.

Specified by:
isComparable in interface Label

isCanonical

public boolean isCanonical()
Description copied from class: Label_c
By default labels are canonical.

Specified by:
isCanonical in interface Param
Overrides:
isCanonical in class Label_c

isRuntimeRepresentable

public boolean isRuntimeRepresentable()
Specified by:
isRuntimeRepresentable in interface Param
Specified by:
isRuntimeRepresentable in class Label_c

uid

public VarLabel uid(UID uid)
Specified by:
uid in interface VarLabel

uid

public UID uid()
Specified by:
uid in interface VarLabel

componentString

public java.lang.String componentString()
Specified by:
componentString in interface Label
Specified by:
componentString in class Label_c

variables

public java.util.Collection variables()
Description copied from interface: Label
The collection of variables contained by this label (or any of its components).

Specified by:
variables in interface Label
Specified by:
variables in class Label_c

bound

public Label bound(VarMap ub,
                   java.util.Set visited)
Description copied from interface: Label
Gets the upper bound of this label.

Specified by:
bound in interface Label
Overrides:
bound in class Label_c
Parameters:
ub - the upper bound map for variable labels
visited - the set of UIDs visited. if the upper bound is <dynamic uid...>,
  • if uid is contained in visited, will be returned;
  • otherwise, uid is added into visited.

equalsImpl

public boolean equalsImpl(polyglot.types.TypeObject o)
Specified by:
equalsImpl in interface polyglot.types.TypeObject
Overrides:
equalsImpl in class polyglot.ext.jl.types.TypeObject_c

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

labelOf

public Label labelOf()
Description copied from interface: Label
Gets labelOf this label. Refer to Andrew's thesis, Figure 5.4

Specified by:
labelOf in interface Label
Specified by:
labelOf in class Label_c

subst

public Label subst(UID uid,
                   Label L)
Description copied from interface: Label
Substitutes any occurences of for L. Refer to Andrew's thesis, Figure 5.5

Specified by:
subst in interface Label
Overrides:
subst in class Label_c

isCovariant

public boolean isCovariant()
Description copied from interface: Label
Is this label covariant?

Specified by:
isCovariant in interface Label
Specified by:
isCovariant in class Label_c

meet_

public Label meet_(Label L,
                   PrincipalHierarchy ph)
Description copied from interface: Label
Implementation of the meet operation, should only be called by JifTypeSystem

Specified by:
meet_ in interface Label
Specified by:
meet_ in class Label_c
Parameters:
L - label to meet with.
ph - the principal hierarchy in which to perform the meet. This param may be null, in which case perform all meets possible that are indpependent of the principal hierarchy.

leq_

public boolean leq_(Label jc,
                    LabelEnv env)
Description copied from interface: Label
Implementation of leq, should only be called by JifTypeSystem

Specified by:
leq_ in interface Label
Specified by:
leq_ in class Label_c
Parameters:
jc - the label to determine if this label is leq to.

translate

public void translate(polyglot.types.Resolver c,
                      polyglot.util.CodeWriter w)
Specified by:
translate in interface Label
Specified by:
translate in class Label_c