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:

Author:
CarlManning, caroma@ai.mit.edu
Copyright (c) 1997 Massachusetts Institute of Technology
See Also:
EvalException, TerminateEvalException, ThrowException

Variable Index

 o defaultEnv

Constructor Index

 o EvalMethods()

Method Index

 o eval(ExpressionNode)
 o eval(ExpressionNode, IEnv)
 o eval(StatementNode)
 o eval(StatementNode, IEnv)
 o evalToStore(IStoreNode)
 o evalToStore(IStoreNode, IEnv)
 o getType(ExpressionNode)
 o getType(ExpressionNode, IEnv)
 o isConstant(ExpressionNode)
 o isConstant(ExpressionNode, IEnv)

Variables

 o defaultEnv
 public static IEnv defaultEnv

Constructors

 o EvalMethods
 public EvalMethods()

Methods

 o isConstant
 public static boolean isConstant(ExpressionNode node) throws EvalException
Returns:
true if this expression has constant value in root env.
Throws: EvalException
.
 o getType
 public static Class getType(ExpressionNode node) throws EvalException
Returns:
the Class representing the Java type of this expression in root env.
Throws: EvalException
.
 o eval
 public static Object eval(ExpressionNode node) throws EvalException
Returns:
the value of this expression in root env.
Throws: EvalException
.
 o 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
.
 o 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
.
 o isConstant
 public static boolean isConstant(ExpressionNode node,
                                  IEnv env) throws EvalException
Returns:
true if this expression has constant value in given env.
Throws: EvalException
.
 o getType
 public static Class getType(ExpressionNode node,
                             IEnv env) throws EvalException
Returns:
Class representing Java type of this expression in given env.
Throws: EvalException
.
 o eval
 public static Object eval(ExpressionNode node,
                           IEnv env) throws EvalException
Returns:
the value of this expression in given env.
Throws: EvalException
.
 o eval
 public static IEnv eval(StatementNode node,
                         IEnv env) throws EvalException
Returns:
env possibly extended by this statement in given env.
Throws: EvalException
.
 o 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