|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.IfExpr
Safe: BNF: "if" "(" cond-expr ")" "{" then-expr "}" "else" "{" else-expr "}"
Implements the "if" expression. If the cond-expr evaluates to true, the then-expr is evaluated in a child of the scope produced by the cond-expr. Otherwise, the else-expr is evaluated in a child of the outer scope.
Field Summary | |
private EExpr |
myElse
|
private EExpr |
myTest
|
private EExpr |
myThen
|
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 | |
IfExpr(SourceSpan optSpan,
EExpr test,
EExpr then,
EExpr els)
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. |
EExpr |
els()
Enabled: |
boolean |
matchBind(ConstList args,
Object specimen,
FlexList bindings)
Enabled: |
protected Object |
subEval(EvalContext ctx,
boolean forValue)
The recursive part that does the work |
void |
subPrintOn(TextWriter out,
int priority)
Enabled: |
EExpr |
test()
Enabled: |
EExpr |
then()
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, qbuild, 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 |
private final EExpr myTest
private final EExpr myThen
private final EExpr myElse
Constructor Detail |
public IfExpr(SourceSpan optSpan, EExpr test, EExpr then, EExpr els)
Method Detail |
public Object welcome(ETreeVisitor visitor)
welcome
in class ENode
protected StaticScope computeStaticScope()
ENode
computeStaticScope
in class ENode
public EExpr els()
protected Object subEval(EvalContext ctx, boolean forValue)
EExpr
subEval
in class EExpr
public boolean matchBind(ConstList args, Object specimen, FlexList bindings)
matchBind
in interface MatchMaker
matchBind
in class ParseNode
public void subPrintOn(TextWriter out, int priority) throws IOException
subPrintOn
in class ParseNode
IOException
public EExpr test()
public EExpr then()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |