org.erights.e.elang.visitors
Class BindFramesVisitor

java.lang.Object
  |
  +--org.erights.e.elang.visitors.KernelECopyVisitor
        |
        +--org.erights.e.elang.visitors.BindFramesVisitor
All Implemented Interfaces:
ETreeVisitor
Direct Known Subclasses:
BindNestedFramesVisitor, BindOuterFramesVisitor

public abstract class BindFramesVisitor
extends KernelECopyVisitor

Untamed:

Author:
E. Dean Tribble

Field Summary
(package private)  ScopeMap myBindings
           
(package private)  int[] myMaxLocalsCell
           
 
Fields inherited from class org.erights.e.elang.visitors.KernelECopyVisitor
 
Constructor Summary
(package private) BindFramesVisitor(ScopeMap bindings, int[] localsCell)
           
 
Method Summary
static BindFramesVisitor make(Scope scope)
          Enabled:
 int maxLocals()
          Enabled:
private  BindFramesVisitor nestLocals()
           
private  KernelECopyVisitor nestObject(ScopeMap newBindings)
          Return a BindFramesVisitor for inside a method: it will start assigning locals from 0 again, and access locals bound outside itself from frame fields instead.
(package private) abstract  NounExpr newFinal(String varName)
           
(package private) abstract  NounExpr newVar(String varName)
           
 ScopeMap scopeMap()
          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: If the escape is a def and is never used, eliminate the escape.
 Object visitFinalPattern(ENode optOriginal, String varName, EExpr valueGuardExpr)
          Enabled:
 Object visitHideExpr(ENode optOriginal, EExpr body)
          Enabled: Eliminate the HideExpr, while preserving its scope boundary.
 Object visitIfExpr(ENode optOriginal, EExpr test, EExpr then, EExpr els)
          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 visitVarPattern(ENode optOriginal, String varName, EExpr slotGuardExpr)
          Enabled:
 ENode xformNode(ENode eNode)
          Enabled:
 
Methods inherited from class org.erights.e.elang.visitors.KernelECopyVisitor
nest, optSpan, run, visitAssignExpr, visitCallExpr, visitCatchExpr, visitCdrPattern, visitDefineExpr, visitEScript, visitFinallyExpr, visitIgnorePattern, visitListPattern, visitLiteralExpr, visitQuasiLiteralExpr, visitQuasiLiteralPatt, visitQuasiPatternExpr, visitQuasiPatternPatt, visitScopeExpr, visitSendExpr, visitSeqExpr, visitSlotExpr, visitSuchThatPattern, xformEExpr, xformEExprs, xformEScript, xformMatcher, xformMethod, xformPattern, xformPatterns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myBindings

ScopeMap myBindings

myMaxLocalsCell

final int[] myMaxLocalsCell
Constructor Detail

BindFramesVisitor

BindFramesVisitor(ScopeMap bindings,
                  int[] localsCell)
Method Detail

make

public static BindFramesVisitor make(Scope scope)
Enabled:


scopeMap

public ScopeMap scopeMap()
Enabled:


xformNode

public ENode xformNode(ENode eNode)
Enabled:

Overrides:
xformNode in class KernelECopyVisitor

nestLocals

private BindFramesVisitor nestLocals()

nestObject

private KernelECopyVisitor nestObject(ScopeMap newBindings)
Return a BindFramesVisitor for inside a method: it will start assigning locals from 0 again, and access locals bound outside itself from frame fields instead.


maxLocals

public int maxLocals()
Enabled:


visitNounExpr

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

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

visitFinalPattern

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

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

visitVarPattern

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

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

newFinal

abstract NounExpr newFinal(String varName)

newVar

abstract NounExpr newVar(String varName)

visitObjectExpr

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

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

visitMatchBindExpr

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

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

visitHideExpr

public Object visitHideExpr(ENode optOriginal,
                            EExpr body)
Enabled: Eliminate the HideExpr, while preserving its scope boundary.

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

visitEMethod

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

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

visitMatcher

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

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

visitEscapeExpr

public Object visitEscapeExpr(ENode optOriginal,
                              Pattern hatch,
                              EExpr body)
Enabled: If the escape is a def and is never used, eliminate the escape.

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

visitIfExpr

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

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


comments?