jif.visit

## Class LabelSubstitutionVisitor

- java.lang.Object
- - polyglot.visit.NodeVisitor
  - - jif.visit.LabelSubstitutionVisitor

- All Implemented Interfaces:
    java.lang.Cloneable, polyglot.util.Copy<polyglot.visit.NodeVisitor>

      public class LabelSubstitutionVisitor
      extends polyglot.visit.NodeVisitor

  Visits an AST, and applies a `LabelSubstitution` to all labels that occur in the AST. The `LabelSubstitution` is not allowed to throw any `SemanticException`s.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface polyglot.util.Copy

      `polyglot.util.Copy.Util`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LabelSubstitutionVisitor(LabelSubstitution substitution, boolean skipBody)`
    `LabelSubstitutionVisitor(LabelSubstitution substitution, TypeSubstitutor typeSubst, boolean skipBody)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `polyglot.ast.Node` | `leave(polyglot.ast.Node old, polyglot.ast.Node n, polyglot.visit.NodeVisitor v)`
    `polyglot.ast.Node` | `override(polyglot.ast.Node n)`
    `protected <Actor extends ActsForParam,Granter extends ActsForParam> ActsForConstraint<Actor,Granter>` | `rewriteActsForConstraint(ActsForConstraint<Actor,Granter> afc)`
    `protected <P extends ActsForParam> P` | `rewriteActsForParam(P param)`
    `protected Assertion` | `rewriteConstraint(Assertion c)`
    `polyglot.ast.Expr` | `rewriteExpr(polyglot.ast.Expr e)`
    `protected void` | `rewriteFieldInstance(JifFieldInstance fi)` Imperatively rewrites the given field instance.
    `protected Label` | `rewriteLabel(Label L)`
    `protected Principal` | `rewritePrincipal(Principal p)`
    `protected java.util.List<Principal>` | `rewritePrincipals(java.util.List<Principal> principals)`
    `polyglot.ast.TypeNode` | `rewriteTypeNode(polyglot.ast.TypeNode tn)` Replace the args in the label of type nodes.

    - ### Methods inherited from class polyglot.visit.NodeVisitor

      `begin, copy, enter, enter, finish, finish, lang, leave, override, toString, visitEdge, visitEdgeNoOverride`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LabelSubstitutionVisitor

          public LabelSubstitutionVisitor(LabelSubstitution substitution,
                                          boolean skipBody)

      Parameters:
        `substitution` - the LabelSubstitution to use.
        `skipBody` - skip over the body of method/constructor decls?

    - #### LabelSubstitutionVisitor

          public LabelSubstitutionVisitor(LabelSubstitution substitution,
                                          TypeSubstitutor typeSubst,
                                          boolean skipBody)

  - ### Method Detail

    - #### override

          public polyglot.ast.Node override(polyglot.ast.Node n)

      Overrides:
        `override` in class `polyglot.visit.NodeVisitor`

    - #### leave

          public polyglot.ast.Node leave(polyglot.ast.Node old,
                                         polyglot.ast.Node n,
                                         polyglot.visit.NodeVisitor v)

      Overrides:
        `leave` in class `polyglot.visit.NodeVisitor`

    - #### rewriteTypeNode

          public polyglot.ast.TypeNode rewriteTypeNode(polyglot.ast.TypeNode tn)
                                                throws polyglot.types.SemanticException

      Replace the args in the label of type nodes.
      Throws:
        `polyglot.types.SemanticException`

    - #### rewriteExpr

          public polyglot.ast.Expr rewriteExpr(polyglot.ast.Expr e)
                                        throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### rewriteActsForParam

          protected <P extends ActsForParam> P rewriteActsForParam(P param)
                                                            throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### rewriteLabel

          protected 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`

    - #### rewritePrincipals

          protected java.util.List<Principal> rewritePrincipals(java.util.List<Principal> principals)
                                                         throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### rewriteFieldInstance

          protected void rewriteFieldInstance(JifFieldInstance fi)
                                       throws polyglot.types.SemanticException

      Imperatively rewrites the given field instance.
      Throws:
        `polyglot.types.SemanticException`

    - #### rewriteActsForConstraint

          protected <Actor extends ActsForParam,Granter extends ActsForParam> ActsForConstraint<Actor,Granter> rewriteActsForConstraint(ActsForConstraint<Actor,Granter> afc)
                                                                                                                                 throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`

    - #### rewriteConstraint

          protected Assertion rewriteConstraint(Assertion c)
                                         throws polyglot.types.SemanticException

      Throws:
        `polyglot.types.SemanticException`