edu.mit.ai.psg.jeva
Class JNEConditionalExpression
java.lang.Object
|
+--edu.mit.ai.psg.jeva.SimpleNode
|
+--edu.mit.ai.psg.jeva.JevaNode
|
+--edu.mit.ai.psg.jeva.ExpressionNode
|
+--edu.mit.ai.psg.jeva.JNEConditionalExpression
- public class JNEConditionalExpression
- extends ExpressionNode
Jeva parse Node for ? : Expressions.
[Java Lang Spec 1.0 sec 15.24 Conditional Operator ? :]
| Methods inherited from class edu.mit.ai.psg.jeva.JevaNode |
checkInsertionPoint,
find2ndTokenBeforeEndBody,
findChildIndex,
findPrecedingToken,
findTokenBeforeChild,
findTokenBeforeChild,
findTokenBeforeEnd,
getBeginToken,
getEndToken,
insertChildTokens,
insertNewChildAfter,
insertNewChildAt,
insertNewChildBefore,
jnGetChild,
jnGetParent,
notVerified,
print,
print,
printSpecialTokens,
printToken,
printToString,
printToString,
removeChild,
removeChildTokens,
replaceChild,
replaceChild,
setBeginToken,
setEndToken,
shouldNotHappen,
shouldNotHappen,
shouldNotHappen,
updateEndTokens,
updateEndTokensPriorChild,
updateEndTokensPriorNode,
updateEndTokensPriorNode |
jjtAccept
public Object jjtAccept(IJevaVisitor visitor,
Object data)
- Description copied from interface: IJevaNode
- Accept a visitor. For visitor design pattern: jjtAccept must simply
return visitor.visit(this, data);
which dispatches on the type of this to appropriate method of visitor
- Overrides:
- jjtAccept in class JevaNode
getTestExpression
public IExpressionNode getTestExpression()
getThenExpression
public IExpressionNode getThenExpression()
getElseExpression
public IExpressionNode getElseExpression()
computeType
public IClass 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.- Returns:
- the IClass of the static type.
- 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.jeva.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.jeva.IEnv),
EvalMethods.eval(IExpressionNode, IEnv)