jif.types
Class TypeSubstitutor
java.lang.Object
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 SemanticException
s.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeSubstitutor
public TypeSubstitutor(LabelSubstitution substitution)
- Parameters:
substitution
- the LabelSubstitution to use.
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