|
|||||||||||
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.CopyVisitor | +--org.erights.e.elang.visitors.RenameVisitor
Untamed: 'renamings' contains a set of oldName => newName pairs. 'rename' returns a new expression like this one, except that wherever 'oldName' is used in this expression to refer to a definition of 'oldName' not provided by this expression, 'newName' is substituted. It is assumed that 'newName' cannot conflict with any name already in this expression, which is safe if 'newName' is a newly generated temporary name. In the resulting expression's staticScope's namesUsed, 'oldName' should not appear.
For each 'oldName' that appears in this expressions's staticScope's outNames (and therefore in the result's staticScope's outNames), that 'oldName' => 'newName' association is removed from 'renamings'. Therefore, 'renamings' is left in a valid state to apply to expressions at the same scope level, but to the right of this one.
Note to implementors: The Java Language Specification defines that argument evaluation order is left to right (as does E). Therefore, you may make several calls to 'rename' using the same 'renamings', confident that the earlier ones will modify the 'renamings' as seen by the later ones. Should these methods be translated to a language without this guarantee (like C++), this ordering will have to be recoded.
Field Summary | |
private FlexMap |
myRenamings
|
Fields inherited from class org.erights.e.elang.visitors.KernelECopyVisitor |
|
Constructor Summary | |
RenameVisitor(FlexMap renamings)
Enabled: |
Method Summary | |
Object |
visitCatchExpr(ENode 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(ENode optOriginal,
EExpr attempt,
EExpr unwinder)
Enabled: |
Object |
visitFinalPattern(ENode optOriginal,
String varName,
EExpr valueGuardExpr)
Enabled: |
Object |
visitHideExpr(ENode optOriginal,
EExpr body)
Enabled: |
Object |
visitIfExpr(ENode optOriginal,
EExpr test,
EExpr then,
EExpr els)
Enabled: |
Object |
visitMatcher(Matcher 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.CopyVisitor |
visitQuasiLiteralExpr, visitQuasiLiteralPatt, visitQuasiPatternExpr, visitQuasiPatternPatt |
Methods inherited from class org.erights.e.elang.visitors.KernelECopyVisitor |
nest, optSpan, run, visitAssignExpr, visitCallExpr, visitCdrPattern, visitDefineExpr, visitEScript, visitIgnorePattern, visitListPattern, visitLiteralExpr, visitMatchBindExpr, visitMatcher, visitObjectExpr, 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 myRenamings
Constructor Detail |
public RenameVisitor(FlexMap renamings)
Method Detail |
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(ENode optOriginal, EExpr test, EExpr then, EExpr els)
visitIfExpr
in interface ETreeVisitor
visitIfExpr
in class KernelECopyVisitor
public Object visitNounExpr(ENode optOriginal, String varName)
visitNounExpr
in interface ETreeVisitor
visitNounExpr
in class KernelECopyVisitor
public Object visitCatchExpr(ENode optOriginal, EExpr attempt, Pattern patt, EExpr catcher)
visitCatchExpr
in interface ETreeVisitor
visitCatchExpr
in class KernelECopyVisitor
public Object visitFinallyExpr(ENode optOriginal, EExpr attempt, EExpr unwinder)
visitFinallyExpr
in interface ETreeVisitor
visitFinallyExpr
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 visitEMethod(ENode optOriginal, String docComment, String verb, Pattern[] patterns, EExpr returnGuard, EExpr body)
visitEMethod
in interface ETreeVisitor
visitEMethod
in class KernelECopyVisitor
public Object visitMatcher(Matcher optOriginal, Pattern patt, EExpr body)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |