edu.mit.ai.psg.jevaES
Class JNEConditionalExpression

java.lang.Object
  |
  +--edu.mit.ai.psg.jevaES.SimpleNode
        |
        +--edu.mit.ai.psg.jevaES.JevaNode
              |
              +--edu.mit.ai.psg.jevaES.ExpressionNode
                    |
                    +--edu.mit.ai.psg.jevaES.JNEConditionalExpression

public class JNEConditionalExpression
extends ExpressionNode

Jeva parse Node for ? : Expressions. [Java Lang Spec 1.0 sec 15.24 Conditional Operator ? :]


Fields inherited from class edu.mit.ai.psg.jevaES.SimpleNode
children, id, parent
 
Method Summary
 boolean computeIsConstant(IEnv env)
          constant if test is constant and corresponding branch is constant, or if branches are equal constants.
 Class computeType(IEnv env)
          [Java Lang Spec 1.0 sec 15.24 Conditional Operator ? :] 3 children: testExpr, thenExpr, elseExpr
 Object eval(IEnv env)
          Evaluate this expression (nodes should not call this method directly).
 IExpressionNode getElseExpression()
           
 IExpressionNode getTestExpression()
           
 IExpressionNode getThenExpression()
           
 
Methods inherited from class edu.mit.ai.psg.jevaES.ExpressionNode
getType, getValue, isConstant
 
Methods inherited from class edu.mit.ai.psg.jevaES.JevaNode
getBeginToken, getEndToken, notVerified, print, print, printToken, printToString, printToString, setBeginToken, setEndToken, shouldNotHappen, shouldNotHappen, shouldNotHappen
 
Methods inherited from class edu.mit.ai.psg.jevaES.SimpleNode
dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getTestExpression

public IExpressionNode getTestExpression()

getThenExpression

public IExpressionNode getThenExpression()

getElseExpression

public IExpressionNode getElseExpression()

computeType

public Class computeType(IEnv env)
                  throws VerifyingException
[Java Lang Spec 1.0 sec 15.24 Conditional Operator ? :] 3 children: testExpr, thenExpr, elseExpr
Overrides:
computeType in class ExpressionNode
Tags copied from class: ExpressionNode
Parameters:
env - environment of name bindings, etc.
Throws:
VerifyingException - if expression is illegal
See Also:
EvalMethods.getType(IExpressionNode, IEnv)

computeIsConstant

public boolean computeIsConstant(IEnv env)
                          throws VerifyingException
constant if test is constant and corresponding branch is constant, or if branches are equal constants.
Overrides:
computeIsConstant in class ExpressionNode
Tags copied from class: ExpressionNode
Parameters:
env - environment of name bindings, etc.
Throws:
VerifyingException - if expression is illegal.
See Also:
ExpressionNode.isConstant(edu.mit.ai.psg.jevaES.IEnv), EvalMethods.isConstant(IExpressionNode, IEnv)

eval

public Object eval(IEnv env)
            throws ThrowException
Description copied from class: ExpressionNode
Evaluate this expression (nodes should not call this method directly). Called by the getValue method.
Overrides:
eval in class ExpressionNode
Tags copied from class: ExpressionNode
Parameters:
env - environment of name bindings, etc.
Throws:
ThrowException - if abruptly completed with an exception
See Also:
ExpressionNode.getValue(edu.mit.ai.psg.jevaES.IEnv), EvalMethods.eval(IExpressionNode, IEnv)

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu