jif.visit
Class LabelSubstitutionVisitor

java.lang.Object
  extended by polyglot.visit.NodeVisitor
      extended by jif.visit.LabelSubstitutionVisitor
All Implemented Interfaces:
java.lang.Cloneable, polyglot.util.Copy

public class LabelSubstitutionVisitor
extends polyglot.visit.NodeVisitor

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
LabelSubstitutionVisitor(LabelSubstitution substitution, boolean skipBody)
           
LabelSubstitutionVisitor(LabelSubstitution substitution, TypeSubstitutor typeSubst, boolean skipBody)
           
 
Method Summary
 polyglot.ast.Node leave(polyglot.ast.Node old, polyglot.ast.Node n, polyglot.visit.NodeVisitor v)
           
 polyglot.ast.Node override(polyglot.ast.Node n)
           
 polyglot.ast.Expr rewriteExpr(polyglot.ast.Expr e)
           
protected  Label rewriteLabel(Label L)
           
protected  Principal rewritePrincipal(Principal p)
           
 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, 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

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