org.erights.e.elang.evm
Class ENode

java.lang.Object
  |
  +--org.erights.e.elang.evm.ParseNode
        |
        +--org.erights.e.elang.evm.ENode
All Implemented Interfaces:
Cloneable, EPrintable, MatchMaker
Direct Known Subclasses:
EExpr, EMethod, EScript, Matcher, Pattern

public abstract class ENode
extends ParseNode
implements Cloneable

Untamed: Those ParseNodes that--after expansion--define the kernel nodes evaluated by the E Virtual Machine.

Author:
Mark S. Miller

Field Summary
private  PatternMap myOptPatternMap
           
private  ScopeMap myOptScopeMap
           
private  StaticScope myOptStaticScope
           
private  ConstMap myOptSynEnv
           
 
Fields inherited from class org.erights.e.elang.evm.ParseNode
NUM_PR, PR_ASSIGN, PR_CALL, PR_COMP, PR_EEXPR, PR_LISTPATT, PR_ORDER, PR_PATTERN, PR_PRIM, PR_START
 
Constructor Summary
(package private) ENode(SourceSpan optSpan)
           
 
Method Summary
(package private)  void cleanCopy()
          Clear the source position.
protected abstract  StaticScope computeStaticScope()
          When staticScope() is first requested on a given node, it calls computeStaticScope() to do the actual computation, which is then remembered.
 ENode copy()
          Enabled: Make a copy.
 PatternMap getOptPatternMap()
          Enabled:
 ScopeMap getOptScopeMap()
          Enabled:
 PatternMap getPatternMap()
          Enabled:
 ScopeMap getScopeMap()
          Enabled:
 Astro qbuild(QuasiBuilder qbuilder)
          Enabled:
 void setPatternMap(PatternMap map)
          Enabled:
 void setScopeMap(ScopeMap map)
          Enabled:
 StaticScope staticScope()
          Enabled: Return a static scope analysis of a subtree that doesn't depend on the enclosing context.
 ConstMap synEnv()
          Enabled: Get the syntactic environment for this node.
abstract  Object welcome(ETreeVisitor visitor)
          Enabled: A node welcomes a visitor by asking the visitor to visit it in detail.
 
Methods inherited from class org.erights.e.elang.evm.ParseNode
__printOn, asText, getOptSpan, lnPrintOn, lnPrintOn, matchBind, matchBind, matchBind, matchBind, printListOn, subPrintOn, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myOptStaticScope

private transient StaticScope myOptStaticScope

myOptScopeMap

private ScopeMap myOptScopeMap

myOptPatternMap

private PatternMap myOptPatternMap

myOptSynEnv

private transient ConstMap myOptSynEnv
Constructor Detail

ENode

ENode(SourceSpan optSpan)
Method Detail

welcome

public abstract Object welcome(ETreeVisitor visitor)
Enabled: A node welcomes a visitor by asking the visitor to visit it in detail.

For example, a FooNode with parts myBar and myBaz might welcome the visitor by asking it to visitFooNode(this, myBar, myBaz). What this visit request returns it what welcome should return. The starting point for this pattern is the "Visitor" pattern from the "Design Patterns" book.


qbuild

public Astro qbuild(QuasiBuilder qbuilder)
Enabled:


staticScope

public final StaticScope staticScope()
Enabled: Return a static scope analysis of a subtree that doesn't depend on the enclosing context.


computeStaticScope

protected abstract StaticScope computeStaticScope()
When staticScope() is first requested on a given node, it calls computeStaticScope() to do the actual computation, which is then remembered.


copy

public ENode copy()
Enabled: Make a copy.


cleanCopy

void cleanCopy()
Description copied from class: ParseNode
Clear the source position.

Overrides:
cleanCopy in class ParseNode

getOptScopeMap

public final ScopeMap getOptScopeMap()
Enabled:


getScopeMap

public final ScopeMap getScopeMap()
Enabled:


setScopeMap

public final void setScopeMap(ScopeMap map)
Enabled:


getOptPatternMap

public final PatternMap getOptPatternMap()
Enabled:


getPatternMap

public final PatternMap getPatternMap()
Enabled:


setPatternMap

public final void setPatternMap(PatternMap map)
Enabled:


synEnv

public ConstMap synEnv()
Enabled: Get the syntactic environment for this node.

Returns:
A mapping from names to pairs, for each free name used in this node, where each pair is either:
  • [null, null] if the binding was not created by an E pattern (for example, if the binding comes from the universal scope), or
  • [pattern, env] where pattern is the Pattern node that bound that name, and env is the syntactic environment for that pattern.
MarkM: XXX Is the above documentation stale? I think it should now be something like:
A mapping from names to values, for each free name used in this node, where each value is either:
  • null, if the binding was not created by an E pattern (for example, if the binding comes from the universal scope), or
  • pattern, where pattern is the Pattern node that bound that name.
except that I'm not sure about the null case.


comments?