All Packages Class Hierarchy This Package Previous Next Index
Class edu.mit.ai.psg.jevaES.EvalMethods
java.lang.Object
|
+----edu.mit.ai.psg.jevaES.EvalMethods
- public class EvalMethods
- extends Object
Centralized static methods for evaluating nodes while catching exceptions.
Throws two subclasses of EvalException to wrap a variety of exceptions:
- TerminateEvalException: a "compile-time" error occured, i.e., an
error which JavaLangSpec1.0 says the compiler should catch.
(A JevaES bug may also manifest itself in this wrapper.)
- ThrowException: a valid exception generated at runtime according
to JavaLangSpec1.0, e.g., via a throw statement.
- Author:
- CarlManning, caroma@ai.mit.edu
Copyright (c) 1997 Massachusetts Institute of Technology
- See Also:
- EvalException, TerminateEvalException, ThrowException
-
defaultEnv
-
-
EvalMethods()
-
-
eval(ExpressionNode)
-
-
eval(ExpressionNode, IEnv)
-
-
eval(StatementNode)
-
-
eval(StatementNode, IEnv)
-
-
evalToStore(IStoreNode)
-
-
evalToStore(IStoreNode, IEnv)
-
-
getType(ExpressionNode)
-
-
getType(ExpressionNode, IEnv)
-
-
isConstant(ExpressionNode)
-
-
isConstant(ExpressionNode, IEnv)
-
defaultEnv
public static IEnv defaultEnv
EvalMethods
public EvalMethods()
isConstant
public static boolean isConstant(ExpressionNode node) throws EvalException
- Returns:
- true if this expression has constant value in root env.
- Throws: EvalException
- .
getType
public static Class getType(ExpressionNode node) throws EvalException
- Returns:
- the Class representing the Java type of this expression in
root env.
- Throws: EvalException
- .
eval
public static Object eval(ExpressionNode node) throws EvalException
- Returns:
- the value of this expression in root env.
- Throws: EvalException
- .
eval
public static IEnv eval(StatementNode node) throws EvalException
- Returns:
- edu.mit.ai.psg.jevaES.IEnv extended by this statement
if it is a local declaration.
- Throws: EvalException
- .
evalToStore
public static IStore evalToStore(IStoreNode node) throws EvalException
- Returns:
- edu.mit.ai.psg.jevaES.IStore to get or set the location denoted
by this expression in root env.
- Throws: EvalException
- .
isConstant
public static boolean isConstant(ExpressionNode node,
IEnv env) throws EvalException
- Returns:
- true if this expression has constant value in given env.
- Throws: EvalException
- .
getType
public static Class getType(ExpressionNode node,
IEnv env) throws EvalException
- Returns:
- Class representing Java type of this expression in given env.
- Throws: EvalException
- .
eval
public static Object eval(ExpressionNode node,
IEnv env) throws EvalException
- Returns:
- the value of this expression in given env.
- Throws: EvalException
- .
eval
public static IEnv eval(StatementNode node,
IEnv env) throws EvalException
- Returns:
- env possibly extended by this statement in given env.
- Throws: EvalException
- .
evalToStore
public static IStore evalToStore(IStoreNode node,
IEnv env) throws EvalException
- Returns:
- an IStore to get or set the location denoted by this expression.
- Throws: EvalException
- .
All Packages Class Hierarchy This Package Previous Next Index