All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.mit.ai.psg.jevaES.JevaES

java.lang.Object
   |
   +----edu.mit.ai.psg.jevaES.JevaES

public class JevaES
extends Object
JevaES is the top level class for the JevaES Java Expression & Statement evaluator. JevaES = Java EVAluator: Expressions & Statements

See edu.mit.ai.psg.jevaESUI.JevaESUI for user interface

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

Variable Index

 o checkPackageNames
Option: check spelling of package names against directory names; turn off if security prevents access to classPath

Method Index

 o extendEnv(boolean, Class, String, Object, IEnv)
Extend an env with a new local named value (may specify if final).
 o extendEnv(Class, String, Object, IEnv)
Extend an env with a new local named value (that is not final).
 o getCopyright()
 o getNoWarranty()
 o getVersion()
 o makeDefaultEnv()
Return a new default environment.
 o parseEvalStreamExpression(InputStream)
Parse and evaluate a single top-level java expression from stream.
 o parseEvalStreamExpression(InputStream, IEnv)
Parse and evaluate a single top-level java expression from stream in environment env.
 o parseEvalStreamStatement(InputStream)
Parse and evaluate a single top-level java statement from stream.
 o parseEvalStreamStatement(InputStream, IEnv)
Parse and evaluate a single top-level java statement from stream.
 o parseEvalStringExpression(String)
Parse and evaluate a single top-level java expression from string s.
 o parseEvalStringExpression(String, IEnv)
Parse and evaluate a single top-level java expression from string s in environment env.
 o parseEvalStringStatement(String)
Parse and evaluate one top-level (no free local vars) Java statement from string s.
 o parseEvalStringStatement(String, IEnv)
Parse and evaluate one top-level (no free local vars) Java statement from string s.
 o parseStreamExpression(InputStream)
Parse one top-level (no free local vars) Java expression from stream.
 o parseStreamStatement(InputStream)
Parse one top-level (no free local vars) Java statement from stream.
 o parseStringExpression(String)
Parse one top-level (no free local vars) Java expression in string s.
 o parseStringStatement(String)
Parse one top-level (no free local vars) Java statement in string s.

Variables

 o checkPackageNames
 public static boolean checkPackageNames
Option: check spelling of package names against directory names; turn off if security prevents access to classPath

Methods

 o getCopyright
 public static String getCopyright()
 o getNoWarranty
 public static String getNoWarranty()
 o getVersion
 public static String getVersion()
 o makeDefaultEnv
 public static IEnv makeDefaultEnv()
Return a new default environment. (Applets may need to first set checkPackageNames to false to prevent security exceptions.)

 o extendEnv
 public static IEnv extendEnv(Class type,
                              String name,
                              Object value,
                              IEnv nextEnv)
Extend an env with a new local named value (that is not final). For example, might be used from compiled code to give access to values at a breakpoint that calls JevaES.

Throws: IllegalArgumentException
if type, name, or nextEnv is null, or if value cannot be assigned to variable of given type.
 o extendEnv
 public static IEnv extendEnv(boolean isFinal,
                              Class type,
                              String name,
                              Object value,
                              IEnv nextEnv)
Extend an env with a new local named value (may specify if final).

 o parseEvalStringExpression
 public static Object parseEvalStringExpression(String s) throws ParseException, EvalException
Parse and evaluate a single top-level java expression from string s.

Returns:
the result of evaluating the expression
Throws: ParseException
wasn't able to parse expression
Throws: EvalException
wasn't able to evaluate the parsed expression.
 o parseEvalStreamExpression
 public static Object parseEvalStreamExpression(InputStream stream) throws ParseException, EvalException
Parse and evaluate a single top-level java expression from stream.

Returns:
the result of evaluating the expression
Throws: ParseException
wasn't able to parse expression
Throws: EvalException
wasn't able to evaluate the parsed expression.
 o parseEvalStringExpression
 public static Object parseEvalStringExpression(String s,
                                                IEnv env) throws ParseException, EvalException
Parse and evaluate a single top-level java expression from string s in environment env.

Returns:
the result of evaluating the expression
Throws: ParseException
wasn't able to parse expression
Throws: EvalException
wasn't able to evaluate the parsed expression.
 o parseEvalStreamExpression
 public static Object parseEvalStreamExpression(InputStream stream,
                                                IEnv env) throws ParseException, EvalException
Parse and evaluate a single top-level java expression from stream in environment env.

Returns:
the result of evaluating the expression
Throws: ParseException
wasn't able to parse expression
Throws: EvalException
wasn't able to evaluate the parsed expression.
 o parseEvalStringStatement
 public static IEnv parseEvalStringStatement(String s) throws ParseException, EvalException
Parse and evaluate one top-level (no free local vars) Java statement from string s. With empty environment.

Returns:
IEnv, environment with extensions by statement (e.g., local decl)
Throws: ParseException
wasn't able to parse statement.
Throws: EvalException
wasn't able to evaluate the parsed statement.
 o parseEvalStreamStatement
 public static IEnv parseEvalStreamStatement(InputStream stream) throws ParseException, EvalException
Parse and evaluate a single top-level java statement from stream. With empty environment.

Returns:
IEnv, environment with extensions by statement (e.g., local decl)
Throws: ParseException
wasn't able to parse expression
Throws: EvalException
wasn't able to evaluate the parsed expression.
 o parseEvalStringStatement
 public static IEnv parseEvalStringStatement(String s,
                                             IEnv env) throws ParseException, EvalException
Parse and evaluate one top-level (no free local vars) Java statement from string s. With empty environment.

Returns:
IEnv, environment with extensions by statement (e.g., local decl)
Throws: ParseException
wasn't able to parse statement.
Throws: EvalException
wasn't able to evaluate the parsed statement.
 o parseEvalStreamStatement
 public static IEnv parseEvalStreamStatement(InputStream stream,
                                             IEnv env) throws ParseException, EvalException
Parse and evaluate a single top-level java statement from stream. With empty environment.

Returns:
IEnv, environment with extensions by statement (e.g., local decl)
Throws: ParseException
wasn't able to parse expression
Throws: EvalException
wasn't able to evaluate the parsed expression.
 o parseStreamExpression
 public static ExpressionNode parseStreamExpression(InputStream stream) throws ParseException
Parse one top-level (no free local vars) Java expression from stream.

Returns:
the root node of the expression's parse tree.
Throws: ParseException
wasn't able to parse expression
 o parseStringExpression
 public static ExpressionNode parseStringExpression(String s) throws ParseException
Parse one top-level (no free local vars) Java expression in string s.

Returns:
the root node of the expression's parse tree.
Throws: ParseException
wasn't able to parse expression
 o parseStreamStatement
 public static StatementNode parseStreamStatement(InputStream stream) throws ParseException
Parse one top-level (no free local vars) Java statement from stream.

Returns:
the root node of the statement's parse tree.
Throws: ParseException
wasn't able to parse statement.
 o parseStringStatement
 public static StatementNode parseStringStatement(String s) throws ParseException
Parse one top-level (no free local vars) Java statement in string s.

Returns:
the root node of the statement's parse tree.
Throws: ParseException
wasn't able to parse statement.

All Packages  Class Hierarchy  This Package  Previous  Next  Index