org.erights.e.elang.evm
Class EMethod

java.lang.Object
  |
  +--org.erights.e.elang.evm.ParseNode
        |
        +--org.erights.e.elang.evm.ENode
              |
              +--org.erights.e.elang.evm.EMethod
All Implemented Interfaces:
Cloneable, EPrintable, MatchMaker

public class EMethod
extends ENode

Safe:


Field Summary
private  EExpr myBody
           
private  String myDocComment
           
private  int myLocalCount
           
private  Pattern[] myPatterns
           
private  EExpr myReturnGuard
           
private  String myVerb
           
 
Fields inherited from class org.erights.e.elang.evm.ENode
 
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
EMethod(SourceSpan optSpan, String docComment, String verb, Pattern[] patterns, EExpr returnGuard, EExpr body)
          Enabled: The constructor interns the verb
EMethod(SourceSpan optSpan, String docComment, String verb, Pattern[] patterns, EExpr returnGuard, EExpr body, int localCount)
          Enabled: Create the EMethod with the number of locals to allocate to a stack frame.
 
Method Summary
 EExpr body()
          Enabled:
protected  StaticScope computeStaticScope()
          When staticScope() is first requested on a given node, it calls computeStaticScope() to do the actual computation, which is then remembered.
 String docComment()
          Enabled:
 Object execute(Object self, Object[] args)
          Enabled:
 boolean matchBind(ConstList args, Object specimen, FlexList bindings)
          Enabled: Ignores docComment
 Pattern[] patterns()
          Enabled:
 EExpr returnGuard()
          Enabled:
 void subPrintOn(TextWriter out, int priority)
          Enabled:
 String verb()
          Enabled:
 Object welcome(ETreeVisitor visitor)
          Enabled:
 
Methods inherited from class org.erights.e.elang.evm.ENode
cleanCopy, copy, getOptPatternMap, getOptScopeMap, getPatternMap, getScopeMap, qbuild, setPatternMap, setScopeMap, staticScope, synEnv
 
Methods inherited from class org.erights.e.elang.evm.ParseNode
__printOn, asText, getOptSpan, lnPrintOn, lnPrintOn, matchBind, matchBind, matchBind, printListOn, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myDocComment

private final String myDocComment

myVerb

private final String myVerb

myPatterns

private final Pattern[] myPatterns

myReturnGuard

private final EExpr myReturnGuard

myBody

private final EExpr myBody

myLocalCount

private final int myLocalCount
Constructor Detail

EMethod

public EMethod(SourceSpan optSpan,
               String docComment,
               String verb,
               Pattern[] patterns,
               EExpr returnGuard,
               EExpr body)
Enabled: The constructor interns the verb


EMethod

public EMethod(SourceSpan optSpan,
               String docComment,
               String verb,
               Pattern[] patterns,
               EExpr returnGuard,
               EExpr body,
               int localCount)
Enabled: Create the EMethod with the number of locals to allocate to a stack frame. This method assumes the verb is interned.

Method Detail

welcome

public Object welcome(ETreeVisitor visitor)
Enabled:

Specified by:
welcome in class ENode

computeStaticScope

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

Specified by:
computeStaticScope in class ENode

execute

public Object execute(Object self,
                      Object[] args)
Enabled:


matchBind

public boolean matchBind(ConstList args,
                         Object specimen,
                         FlexList bindings)
Enabled: Ignores docComment

Specified by:
matchBind in interface MatchMaker
Specified by:
matchBind in class ParseNode

docComment

public String docComment()
Enabled:


verb

public String verb()
Enabled:


patterns

public Pattern[] patterns()
Enabled:


returnGuard

public EExpr returnGuard()
Enabled:


body

public EExpr body()
Enabled:


subPrintOn

public void subPrintOn(TextWriter out,
                       int priority)
                throws IOException
Enabled:

Specified by:
subPrintOn in class ParseNode
IOException


comments?