|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elang.visitors.KernelECopyVisitor | +--org.erights.e.elang.visitors.AlphaRenameVisitor
Untamed: Like RenameVisitor, but does an 'alpha-renaming'.
An alpha renaming gives each distinct variable a unique name. Since we are not in control of top-level names, we rename exactly variables defined in nested scope boxes. We use a HilbertHotel to generate new names and to transform old ones. In order to deal with the varName problem in the varName way, we will transform top-level names according to the varName rename(). Since AlphaRenameVisitor needs to treat the expression top level specially, that's represented by a null 'myOptRenamings'. Assuming that top-level names should avoid being of a form that rename might relocate (ie, the form of name generated by newTemp()), then, by turning *all* non top-level names into this form, these won't conflict with such well formed top-level names. This is a bit of a kludge. Perhaps we should treat relocated top level names as an error?
Field Summary | |
private HilbertHotel |
myHilbert
|
private FlexMap |
myOptRenamings
|
Fields inherited from class org.erights.e.elang.visitors.KernelECopyVisitor |
|
Constructor Summary | |
AlphaRenameVisitor()
Enabled: |
|
AlphaRenameVisitor(ETreeVisitor decorator)
Enabled: |
Method Summary | |
private FlexMap |
fork()
|
private FlexMap |
innerRenames()
|
Object |
visitCatchExpr(CatchExpr optOriginal,
EExpr attempt,
Pattern patt,
EExpr catcher)
Enabled: |
Object |
visitEMethod(ENode optOriginal,
String docComment,
String verb,
Pattern[] patterns,
EExpr returnGuard,
EExpr body)
Enabled: |
Object |
visitEscapeExpr(ENode optOriginal,
Pattern hatch,
EExpr body)
Enabled: |
Object |
visitFinallyExpr(FinallyExpr optOriginal,
EExpr attempt,
EExpr unwinder)
Enabled: |
Object |
visitFinalPattern(ENode optOriginal,
String varName,
EExpr valueGuardExpr)
Enabled: |
Object |
visitHideExpr(ENode optOriginal,
EExpr body)
Enabled: |
Object |
visitIfExpr(IfExpr optOriginal,
EExpr test,
EExpr then,
EExpr els)
Enabled: |
Object |
visitMatcher(ENode optOriginal,
Pattern patt,
EExpr body)
Enabled: |
Object |
visitNounExpr(ENode optOriginal,
String varName)
Enabled: |
Object |
visitVarPattern(ENode optOriginal,
String varName,
EExpr slotGuardExpr)
Enabled: |
Methods inherited from class org.erights.e.elang.visitors.KernelECopyVisitor |
nest, optSpan, run, visitAssignExpr, visitCallExpr, visitCatchExpr, visitCdrPattern, visitDefineExpr, visitEScript, visitFinallyExpr, visitIfExpr, visitIgnorePattern, visitListPattern, visitLiteralExpr, visitMatchBindExpr, visitObjectExpr, visitQuasiLiteralExpr, visitQuasiLiteralPatt, visitQuasiPatternExpr, visitQuasiPatternPatt, visitScopeExpr, visitSendExpr, visitSeqExpr, visitSlotExpr, visitSuchThatPattern, xformEExpr, xformEExprs, xformEScript, xformMatcher, xformMethod, xformNode, xformPattern, xformPatterns |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private FlexMap myOptRenamings
private final HilbertHotel myHilbert
Constructor Detail |
public AlphaRenameVisitor(ETreeVisitor decorator)
public AlphaRenameVisitor()
Method Detail |
private FlexMap fork()
private FlexMap innerRenames()
public Object visitNounExpr(ENode optOriginal, String varName)
visitNounExpr
in interface ETreeVisitor
visitNounExpr
in class KernelECopyVisitor
public Object visitFinalPattern(ENode optOriginal, String varName, EExpr valueGuardExpr)
visitFinalPattern
in interface ETreeVisitor
visitFinalPattern
in class KernelECopyVisitor
public Object visitVarPattern(ENode optOriginal, String varName, EExpr slotGuardExpr)
visitVarPattern
in interface ETreeVisitor
visitVarPattern
in class KernelECopyVisitor
public Object visitEscapeExpr(ENode optOriginal, Pattern hatch, EExpr body)
visitEscapeExpr
in interface ETreeVisitor
visitEscapeExpr
in class KernelECopyVisitor
public Object visitHideExpr(ENode optOriginal, EExpr body)
visitHideExpr
in interface ETreeVisitor
visitHideExpr
in class KernelECopyVisitor
public Object visitIfExpr(IfExpr optOriginal, EExpr test, EExpr then, EExpr els)
public Object visitCatchExpr(CatchExpr optOriginal, EExpr attempt, Pattern patt, EExpr catcher)
public Object visitFinallyExpr(FinallyExpr optOriginal, EExpr attempt, EExpr unwinder)
public Object visitEMethod(ENode optOriginal, String docComment, String verb, Pattern[] patterns, EExpr returnGuard, EExpr body)
visitEMethod
in interface ETreeVisitor
visitEMethod
in class KernelECopyVisitor
public Object visitMatcher(ENode optOriginal, Pattern patt, EExpr body)
visitMatcher
in interface ETreeVisitor
visitMatcher
in class KernelECopyVisitor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |