edu.mit.ai.psg.jevaES
Interface IExpressionNode

All Known Subinterfaces:
IExpressionStoreNode
All Known Implementing Classes:
ExpressionNode

public interface IExpressionNode
extends IJevaNode

Interface to nodes for Java expressions. Don't call this interface's methods directly, but instead use EvalMethods to capture errors.

See Also:
EvalMethods, ExpressionNode

Method Summary
 Class getType(IEnv env)
          Verifies the type correctness of the expression and returns the static type of the expression (nodes should not call this interface directly, but should call EvalMethods.getType).
 Object getValue(IEnv env)
          Get the value of this node (nodes should not call this interface directly, but should call EvalMethods.eval).
 boolean isConstant(IEnv env)
          Predicate testing whether this is a constant expression (nodes should not call this interface directly, but should call EvalMethods.getType).
 
Methods inherited from interface edu.mit.ai.psg.jevaES.IJevaNode
getBeginToken, getEndToken, print, print, printToString, printToString, setBeginToken, setEndToken
 
Methods inherited from interface edu.mit.ai.psg.jevaES.Node
jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
 

Method Detail

getType

public Class getType(IEnv env)
              throws VerifyingException
Verifies the type correctness of the expression and returns the static type of the expression (nodes should not call this interface directly, but should call EvalMethods.getType). Value may be cached.
Parameters:
env - environment of name bindings, etc.
Throws:
VerifyingException - if expression is illegal
See Also:
EvalMethods.getType(IExpressionNode, IEnv)

isConstant

public boolean isConstant(IEnv env)
                   throws VerifyingException
Predicate testing whether this is a constant expression (nodes should not call this interface directly, but should call EvalMethods.getType). Value may be cached. This predicate is sometimes required for determining type (see [JavaLangSpec sec 15.27, 5.2, 15.24, 14.9])
Parameters:
env - environment of name bindings, etc.
Throws:
VerifyingException - if expression is illegal
See Also:
EvalMethods.isConstant(IExpressionNode, IEnv)

getValue

public Object getValue(IEnv env)
                throws ThrowException
Get the value of this node (nodes should not call this interface directly, but should call EvalMethods.eval). Value may be cached if it is constant.
Parameters:
env - environment of name bindings, etc.
Throws:
ThrowException - if completes abruptly with an exception
See Also:
EvalMethods.eval(IExpressionNode, IEnv)

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu