org.erights.e.elang.visitors
Class KernelECopyVisitor

java.lang.Object
  |
  +--org.erights.e.elang.visitors.KernelECopyVisitor
All Implemented Interfaces:
ETreeVisitor
Direct Known Subclasses:
AlphaRenameVisitor, BindFramesVisitor, CopyVisitor, DefBehaviorVisitor, SubstVisitor

public class KernelECopyVisitor
extends Object
implements ETreeVisitor

Safe:

Author:
Mark S. Miller

Field Summary
private  ETreeVisitor myDecorator
           
 
Constructor Summary
KernelECopyVisitor()
          Enabled: Defaults to auto-decoration
KernelECopyVisitor(ETreeVisitor decorator)
          Enabled:
 
Method Summary
(package private)  KernelECopyVisitor nest()
          Return a version of the receiver for a nested scope.
(package private) static SourceSpan optSpan(ENode optNode)
           
 Object run(Object optENode)
          Enabled: For use from E.
 Object visitAssignExpr(ENode optOriginal, AtomicExpr noun, EExpr rValue)
          Enabled:
 Object visitCallExpr(ENode optOriginal, EExpr recip, String verb, EExpr[] args)
          Enabled:
 Object visitCatchExpr(ENode optOriginal, EExpr attempt, Pattern patt, EExpr catcher)
          Enabled:
 Object visitCdrPattern(ENode optOriginal, ListPattern start, Pattern rest)
          Enabled:
 Object visitDefineExpr(ENode optOriginal, Pattern patt, EExpr rValue)
          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 visitEScript(ENode optOriginal, EMethodNode[] optMethods, Matcher optMatcher)
          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 visitIgnorePattern(ENode optOriginal)
          Enabled:
 Object visitListPattern(ENode optOriginal, Pattern[] subs)
          Enabled:
 Object visitLiteralExpr(ENode optOriginal, Object value)
          Enabled:
 Object visitMatchBindExpr(ENode optOriginal, EExpr specimen, Pattern patt)
          Enabled:
 Object visitMatcher(ENode optOriginal, Pattern patt, EExpr body)
          Enabled:
 Object visitNounExpr(ENode optOriginal, String varName)
          Enabled:
 Object visitObjectExpr(ENode optOriginal, String docComment, String optFQN, EExpr[] auditors, EScript eScript)
          Enabled:
 Object visitQuasiLiteralExpr(ENode optOriginal, int index)
          Enabled:
 Object visitQuasiLiteralPatt(ENode optOriginal, int index)
          Enabled:
 Object visitQuasiPatternExpr(ENode optOriginal, int index)
          Enabled:
 Object visitQuasiPatternPatt(ENode optOriginal, int index)
          Enabled:
 Object visitScopeExpr(ENode optOriginal)
          Enabled:
 Object visitSendExpr(ENode optOriginal, EExpr recip, String verb, EExpr[] args)
          Enabled:
 Object visitSeqExpr(ENode optOriginal, EExpr[] subs)
          Enabled:
 Object visitSlotExpr(ENode optOriginal, AtomicExpr noun)
          Enabled:
 Object visitSuchThatPattern(ENode optOriginal, Pattern patt, EExpr test)
          Enabled:
 Object visitVarPattern(ENode optOriginal, String varName, EExpr slotGuardExpr)
          Enabled:
 EExpr xformEExpr(EExpr optEExpr)
          Enabled:
 EExpr[] xformEExprs(EExpr[] eExprs)
          Enabled:
 EScript xformEScript(EScript eScript)
          Enabled:
 Matcher xformMatcher(Matcher optMatcher)
          Enabled:
 EMethod xformMethod(EMethod optMeth)
          Enabled:
 ENode xformNode(ENode eNode)
          Enabled:
 Pattern xformPattern(Pattern optPatt)
          Enabled:
 Pattern[] xformPatterns(Pattern[] patts)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myDecorator

private final ETreeVisitor myDecorator
Constructor Detail

KernelECopyVisitor

public KernelECopyVisitor(ETreeVisitor decorator)
Enabled:


KernelECopyVisitor

public KernelECopyVisitor()
Enabled: Defaults to auto-decoration

Method Detail

optSpan

static SourceSpan optSpan(ENode optNode)

nest

KernelECopyVisitor nest()
Return a version of the receiver for a nested scope. The default is that there is no difference. NOTE: this needs to generate a new visitor by talking to the decorator.


run

public Object run(Object optENode)
Enabled: For use from E. Java/ELib users should use the more strongly typed xform* methods.

Parameters:
optENode - must be either null, an ENode, or an array of ENodes.

xformNode

public ENode xformNode(ENode eNode)
Enabled:


xformEExpr

public EExpr xformEExpr(EExpr optEExpr)
Enabled:


xformEExprs

public EExpr[] xformEExprs(EExpr[] eExprs)
Enabled:


visitAssignExpr

public Object visitAssignExpr(ENode optOriginal,
                              AtomicExpr noun,
                              EExpr rValue)
Enabled:

Specified by:
visitAssignExpr in interface ETreeVisitor
See Also:
The Kernel-E Assignment Expression

visitCallExpr

public Object visitCallExpr(ENode optOriginal,
                            EExpr recip,
                            String verb,
                            EExpr[] args)
Enabled:

Specified by:
visitCallExpr in interface ETreeVisitor
See Also:
The Kernel-E Call Expression

visitDefineExpr

public Object visitDefineExpr(ENode optOriginal,
                              Pattern patt,
                              EExpr rValue)
Enabled:

Specified by:
visitDefineExpr in interface ETreeVisitor
See Also:
The Kernel-E Define Expression

visitEscapeExpr

public Object visitEscapeExpr(ENode optOriginal,
                              Pattern hatch,
                              EExpr body)
Enabled:

Specified by:
visitEscapeExpr in interface ETreeVisitor
See Also:
The Kernel-E Escape Expression

visitHideExpr

public Object visitHideExpr(ENode optOriginal,
                            EExpr body)
Enabled:

Specified by:
visitHideExpr in interface ETreeVisitor
See Also:
The Kernel-E Hide Expression

visitIfExpr

public Object visitIfExpr(ENode optOriginal,
                          EExpr test,
                          EExpr then,
                          EExpr els)
Enabled:

Specified by:
visitIfExpr in interface ETreeVisitor
See Also:
The Kernel-E If Expression

visitLiteralExpr

public Object visitLiteralExpr(ENode optOriginal,
                               Object value)
Enabled:

Specified by:
visitLiteralExpr in interface ETreeVisitor
See Also:
The Kernel-E Literal Expression

visitMatchBindExpr

public Object visitMatchBindExpr(ENode optOriginal,
                                 EExpr specimen,
                                 Pattern patt)
Enabled:

Specified by:
visitMatchBindExpr in interface ETreeVisitor
See Also:
The Kernel-E Match-Bind Expression

visitNounExpr

public Object visitNounExpr(ENode optOriginal,
                            String varName)
Enabled:

Specified by:
visitNounExpr in interface ETreeVisitor
See Also:
The Kernel-E Noun Expression

visitObjectExpr

public Object visitObjectExpr(ENode optOriginal,
                              String docComment,
                              String optFQN,
                              EExpr[] auditors,
                              EScript eScript)
Enabled:

Specified by:
visitObjectExpr in interface ETreeVisitor
See Also:
The Kernel-E Object Expression

visitScopeExpr

public Object visitScopeExpr(ENode optOriginal)
Enabled:

Specified by:
visitScopeExpr in interface ETreeVisitor

visitSendExpr

public Object visitSendExpr(ENode optOriginal,
                            EExpr recip,
                            String verb,
                            EExpr[] args)
Enabled:

Specified by:
visitSendExpr in interface ETreeVisitor
See Also:
The Kernel-E Send Expression

visitSeqExpr

public Object visitSeqExpr(ENode optOriginal,
                           EExpr[] subs)
Enabled:

Specified by:
visitSeqExpr in interface ETreeVisitor
See Also:
The Kernel-E Sequence Expression

visitSlotExpr

public Object visitSlotExpr(ENode optOriginal,
                            AtomicExpr noun)
Enabled:

Specified by:
visitSlotExpr in interface ETreeVisitor

visitCatchExpr

public Object visitCatchExpr(ENode optOriginal,
                             EExpr attempt,
                             Pattern patt,
                             EExpr catcher)
Enabled:

Specified by:
visitCatchExpr in interface ETreeVisitor
See Also:
The Kernel-E Try-Catch Expression

visitFinallyExpr

public Object visitFinallyExpr(ENode optOriginal,
                               EExpr attempt,
                               EExpr unwinder)
Enabled:

Specified by:
visitFinallyExpr in interface ETreeVisitor
See Also:
The Kernel-E Try-Finally Expression

xformPattern

public Pattern xformPattern(Pattern optPatt)
Enabled:


xformPatterns

public Pattern[] xformPatterns(Pattern[] patts)
Enabled:


visitFinalPattern

public Object visitFinalPattern(ENode optOriginal,
                                String varName,
                                EExpr valueGuardExpr)
Enabled:

Specified by:
visitFinalPattern in interface ETreeVisitor
See Also:
The Kernel-E Final Pattern

visitVarPattern

public Object visitVarPattern(ENode optOriginal,
                              String varName,
                              EExpr slotGuardExpr)
Enabled:

Specified by:
visitVarPattern in interface ETreeVisitor
See Also:
The Kernel-E Var Pattern

visitListPattern

public Object visitListPattern(ENode optOriginal,
                               Pattern[] subs)
Enabled:

Specified by:
visitListPattern in interface ETreeVisitor
See Also:
The Kernel-E Tuple Pattern

visitCdrPattern

public Object visitCdrPattern(ENode optOriginal,
                              ListPattern start,
                              Pattern rest)
Enabled:

Specified by:
visitCdrPattern in interface ETreeVisitor
See Also:
The Kernel-E Tuple Pattern

visitIgnorePattern

public Object visitIgnorePattern(ENode optOriginal)
Enabled:

Specified by:
visitIgnorePattern in interface ETreeVisitor
See Also:
The Kernel-E Ignore Pattern

visitSuchThatPattern

public Object visitSuchThatPattern(ENode optOriginal,
                                   Pattern patt,
                                   EExpr test)
Enabled:

Specified by:
visitSuchThatPattern in interface ETreeVisitor
See Also:
The Kernel-E Such-That Pattern

xformEScript

public EScript xformEScript(EScript eScript)
Enabled:


xformMethod

public EMethod xformMethod(EMethod optMeth)
Enabled:


xformMatcher

public Matcher xformMatcher(Matcher optMatcher)
Enabled:


visitEScript

public Object visitEScript(ENode optOriginal,
                           EMethodNode[] optMethods,
                           Matcher optMatcher)
Enabled:

Specified by:
visitEScript in interface ETreeVisitor
See Also:
The Kernel-E Script Node

visitEMethod

public Object visitEMethod(ENode optOriginal,
                           String docComment,
                           String verb,
                           Pattern[] patterns,
                           EExpr returnGuard,
                           EExpr body)
Enabled:

Specified by:
visitEMethod in interface ETreeVisitor
See Also:
The Kernel-E Method Node

visitMatcher

public Object visitMatcher(ENode optOriginal,
                           Pattern patt,
                           EExpr body)
Enabled:

Specified by:
visitMatcher in interface ETreeVisitor
See Also:
The Kernel-E Matcher Node

visitQuasiLiteralExpr

public Object visitQuasiLiteralExpr(ENode optOriginal,
                                    int index)
Enabled:

Specified by:
visitQuasiLiteralExpr in interface ETreeVisitor

visitQuasiPatternExpr

public Object visitQuasiPatternExpr(ENode optOriginal,
                                    int index)
Enabled:

Specified by:
visitQuasiPatternExpr in interface ETreeVisitor

visitQuasiLiteralPatt

public Object visitQuasiLiteralPatt(ENode optOriginal,
                                    int index)
Enabled:

Specified by:
visitQuasiLiteralPatt in interface ETreeVisitor

visitQuasiPatternPatt

public Object visitQuasiPatternPatt(ENode optOriginal,
                                    int index)
Enabled:

Specified by:
visitQuasiPatternPatt in interface ETreeVisitor


comments?