|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.mit.ai.psg.jevaESUI.JevaESCLI
JevaESCLI is a command line (stream) interface for the JevaES Java evalator of expressions & statements. JevaESCLI can be used as
main(java.lang.String[]).
repl(..)
providing an environment of current names, and the user can evaluate
Java expression and statements in that environment, including
calling other stubs, returning values, and throwing exceptions.
. localResults.get(n)Jexa may be invoked programmatically:
. import edu.mit.ai.psg.jexa.Jexa; . Jexa.examine(expression)
JevaESUI,
JevaESGUI,
edu.mit.ai.psg.jexa| Field Summary | |
static String |
continuePromptFormat
|
static String |
promptFormat
Format for the prompt; takes number as single (0th) argument. |
static Vector |
results
Vector of result values from expressions typed at the window |
| Method Summary | |
static void |
main(String[] arguments)
Application Startup: Loops accepting top level statements and expressions from System.in . |
static Object |
repl()
Read-Eval-Print-Loop: starts a loop which reads Java expressions and statements from System.in , including return statements to return a value. |
static Object |
repl(int options,
String initialMessage,
Reader inReader,
PrintWriter outWriter,
Class returnClass,
Class[] throwsClasses,
IEnv env,
String initStatements)
Read-Eval-Print-Loop: starts a loop which reads Java expressions and statements from inStream, including return statements to return a value. |
static void |
replTop()
Top read-eval-print-loop: reads Java expressions and statements from System.in, evaluates them, and prints results of expressions on System.out. |
static void |
replTop(int options,
String initStatements)
|
static void |
replTop(int options,
String initialMessage,
String initStatements)
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static Vector results
public static String promptFormat
MessageFormatpublic static String continuePromptFormat
| Method Detail |
public static void main(String[] arguments)
-noninteractive don't prompt -initStatements "statements" run statements before start (e.g., imports) -message "text" display text after herald -herald "text" display text in place of herald
public static void replTop()
public static void replTop(int options,
String initStatements)
public static void replTop(int options,
String initialMessage,
String initStatements)
public static Object repl()
throws Throwable
public static Object repl(int options,
String initialMessage,
Reader inReader,
PrintWriter outWriter,
Class returnClass,
Class[] throwsClasses,
IEnv env,
String initStatements)
throws Throwable
options - Option flag bits or'ed together; 0 is default.
JevaES options used only if env is null.initialMessage - Non-null text replaces herald; if called from a
breakpoint, a good practice is to show user contents of env.inReader - Reader from which to read Java constructs.
If null, uses new InputStreamReader(System.in).outWriter - Writer to which to write messages, results.
If null, uses new PrintWriter(System.out, true).returnClass - user may only return a value of this class
(like method return type); Object.class allows anything.
Use void.class for void result.
If null, never returns (like a top level loop).throwsClasses - user may only throw Throwables which are instances
of these classes, or instances of Error or RuntimeException
(like method throw declarations).
If null, defaults to no declarations.env - initial environment created with JevaES.makeDefaultEnv,
JevaES.extendEnv(), or JevaES.parseEval..Statement
If null, defaults to JevaES.makeDefaultEnv(options) .initStatements - initial statements to run. (Convenience feature
for extending env from command line or applet parameter, e.g.,
to specify default imports for user input.)
If null, defaults to no statements.
|
Copyright (c) 1996-1999 Massachusetts Institute of Technology Feedback: jeva-feedback@ai.mit.edu |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||