org.erights.e.elang.evm
Class AssignExpr

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

public class AssignExpr
extends EExpr

Safe: BNF: varName ":=" eExpr

Changes the binding for 'varName' in the current environment to be the value of 'eExpr'. 'varName' must already be bound. Equivalent to


      (&varName) setValue(eExpr); eExpr

 

except that eExpr is only evaluated once. Therefore, the value returned is the value of eExpr, rather than the value stored in the slot (since setValue may do arbitrary coercions).

Author:
Mark S. Miller

Field Summary
private  AtomicExpr myNoun
           
private  EExpr myRValue
           
 
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
AssignExpr(SourceSpan optSpan, AtomicExpr noun, EExpr rValue)
          Enabled:
 
Method Summary
protected  StaticScope computeStaticScope()
          When staticScope() is first requested on a given node, it calls computeStaticScope() to do the actual computation, which is then remembered.
 boolean matchBind(ConstList args, Object specimen, FlexList bindings)
          Enabled:
 NounExpr noun()
          Enabled:
 Astro qbuild(QuasiBuilder qbuilder)
          Enabled:
 EExpr rValue()
          Enabled:
protected  Object subEval(EvalContext ctx, boolean forValue)
          The recursive part that does the work
 void subPrintOn(TextWriter out, int priority)
          Enabled:
 Object welcome(ETreeVisitor visitor)
          Enabled:
 
Methods inherited from class org.erights.e.elang.evm.EExpr
__printOn, appendAllTo, appendTo, eval, eval, evalBool, printAsBlockOn, substitute, transform
 
Methods inherited from class org.erights.e.elang.evm.ENode
cleanCopy, copy, getOptPatternMap, getOptScopeMap, getPatternMap, getScopeMap, setPatternMap, setScopeMap, staticScope, synEnv
 
Methods inherited from class org.erights.e.elang.evm.ParseNode
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

myNoun

private final AtomicExpr myNoun

myRValue

private final EExpr myRValue
Constructor Detail

AssignExpr

public AssignExpr(SourceSpan optSpan,
                  AtomicExpr noun,
                  EExpr rValue)
Enabled:

Method Detail

welcome

public Object welcome(ETreeVisitor visitor)
Enabled:

Specified by:
welcome in class ENode

qbuild

public Astro qbuild(QuasiBuilder qbuilder)
Enabled:

Overrides:
qbuild in class ENode

computeStaticScope

protected StaticScope computeStaticScope()
Description copied from class: ENode
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

subEval

protected Object subEval(EvalContext ctx,
                         boolean forValue)
Description copied from class: EExpr
The recursive part that does the work

Specified by:
subEval in class EExpr

matchBind

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

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

noun

public NounExpr noun()
Enabled:


rValue

public EExpr rValue()
Enabled:


subPrintOn

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

Specified by:
subPrintOn in class ParseNode
IOException


comments?