jif.types
Class TypeSubstitutor

java.lang.Object
  extended by jif.types.TypeSubstitutor
Direct Known Subclasses:
JifFieldDeclExt_c.InvarianceLabelSubstr, JifFormalExt.FormalVarianceLabelSubstr

public class TypeSubstitutor
extends java.lang.Object

Visits an AST, and applies a LabelSubsitution to all labels that occur in the AST. The LabelSubsitution is not allowed to throw any SemanticExceptions.


Constructor Summary
TypeSubstitutor(LabelSubstitution substitution)
           
 
Method Summary
protected  boolean recurseIntoArrayType(polyglot.types.ArrayType type)
           
protected  boolean recurseIntoLabeledType(LabeledType type)
           
protected  boolean recurseIntoSubstType(JifSubstType type)
           
 Assertion rewriteAssertion(Assertion a)
           
 Label rewriteLabel(Label L)
           
protected  Principal rewritePrincipal(Principal p)
           
 polyglot.types.Type rewriteType(polyglot.types.Type t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeSubstitutor

public TypeSubstitutor(LabelSubstitution substitution)
Parameters:
substitution - the LabelSubstitution to use.
Method Detail

rewriteType

public polyglot.types.Type rewriteType(polyglot.types.Type t)
                                throws polyglot.types.SemanticException
Throws:
polyglot.types.SemanticException

recurseIntoSubstType

protected boolean recurseIntoSubstType(JifSubstType type)

recurseIntoArrayType

protected boolean recurseIntoArrayType(polyglot.types.ArrayType type)

recurseIntoLabeledType

protected boolean recurseIntoLabeledType(LabeledType type)

rewriteLabel

public Label rewriteLabel(Label L)
                   throws polyglot.types.SemanticException
Throws:
polyglot.types.SemanticException

rewritePrincipal

protected Principal rewritePrincipal(Principal p)
                              throws polyglot.types.SemanticException
Throws:
polyglot.types.SemanticException

rewriteAssertion

public Assertion rewriteAssertion(Assertion a)
                           throws polyglot.types.SemanticException
Throws:
polyglot.types.SemanticException