edu.mit.ai.psg.jeva
Interface IExpressionNode

All Known Subinterfaces:
IExpressionStoreNode
All Known Implementing Classes:
ExpressionNode

public abstract interface IExpressionNode
extends IJevaNode

Interface to nodes for Java expressions. Nodes should not call this interface directly, but instead use EvalMethods to capture errors into an EvalErrException.

Author:
CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998 Massachusetts Institute of Technology
See Also:
EvalMethods, ExpressionNode

Method Summary
 IClass getType()
          Returns cached type of verified expression [verifying calls getType(IEnv)].
 IClass 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).
 Object getValue(IEnv env)
          Get the value of this node (nodes should not call this interface directly).
 boolean isConstant(IEnv env)
          Predicate testing whether this is a constant expression (nodes should not call this interface directly).
 
Methods inherited from interface edu.mit.ai.psg.jeva.IJevaNode
getBeginToken, getEndToken, insertNewChildAfter, insertNewChildAt, insertNewChildBefore, jjtAccept, jnGetChild, jnGetParent, print, print, printToString, printToString, removeChild, replaceChild, replaceChild, setBeginToken, setEndToken
 
Methods inherited from interface edu.mit.ai.psg.jeva.Node
jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
 

Method Detail

getType

public IClass 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). Value may be cached.
Parameters:
env - environment of name bindings, etc.
Throws:
VerifyingException - if expression is illegal
See Also:
EvalMethods.getType(IExpressionNode, IEnv)

getType

public IClass getType()
               throws IllegalStateException
Returns cached type of verified expression [verifying calls getType(IEnv)].
Throws:
IllegalStateException - if not verified.

isConstant

public boolean isConstant(IEnv env)
                   throws VerifyingException
Predicate testing whether this is a constant expression (nodes should not call this interface directly). 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). 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-bugs@ai.mit.edu