polyglot.visit
Class AlphaRenamer

java.lang.Object
  extended bypolyglot.visit.NodeVisitor
      extended bypolyglot.visit.AlphaRenamer

public class AlphaRenamer
extends NodeVisitor

The AlphaRenamer runs over the AST and alpha-renames any local variable declarations that it encounters.


Field Summary
protected  java.util.Set freshVars
           
protected  NodeFactory nf
           
protected  java.util.Map renamingMap
           
protected  java.util.Stack setStack
           
 
Constructor Summary
AlphaRenamer(NodeFactory nf)
          Creates a visitor for alpha-renaming locals.
 
Method Summary
 NodeVisitor enter(Node n)
           
 Node leave(Node old, Node n, NodeVisitor v)
           
 
Methods inherited from class polyglot.visit.NodeVisitor
begin, enter, finish, finish, leave, override, override, toString, visitEdge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nf

protected NodeFactory nf

setStack

protected java.util.Stack setStack

renamingMap

protected java.util.Map renamingMap

freshVars

protected java.util.Set freshVars
Constructor Detail

AlphaRenamer

public AlphaRenamer(NodeFactory nf)
Creates a visitor for alpha-renaming locals.

Parameters:
nf - The node factory to be used when generating new nodes.
Method Detail

enter

public NodeVisitor enter(Node n)
Overrides:
enter in class NodeVisitor

leave

public Node leave(Node old,
                  Node n,
                  NodeVisitor v)
Overrides:
leave in class NodeVisitor