edu.mit.ai.psg.jevaUI
Class JevaCLI

java.lang.Object
  |
  +--edu.mit.ai.psg.jevaUI.JevaCLI

public class JevaCLI
extends Object

JevaCLI is a command line (stream) interface for the Jeva Java evalator of expressions & statements. JevaCLI can be used as

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

Field Summary
static String continuePromptFormat
           
static String promptFormat
          Format for the prompt; takes number as single (0th) argument.
 
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[] throwClasses, IEnv env)
          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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

promptFormat

public static String promptFormat
Format for the prompt; takes number as single (0th) argument.
See Also:
MessageFormat

continuePromptFormat

public static String continuePromptFormat
Method Detail

main

public static void main(String[] arguments)
Application Startup: Loops accepting top level statements and expressions from System.in .

replTop

public 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.

replTop

public static void replTop(int options)

repl

public static Object repl()
                   throws Throwable
Read-Eval-Print-Loop: starts a loop which reads Java expressions and statements from System.in , including return statements to return a value.
Throws:
Throwable - --- throws anything user throws.

repl

public static Object repl(int options,
                          String initialMessage,
                          Reader inReader,
                          PrintWriter outWriter,
                          Class returnClass,
                          Class[] throwClasses,
                          IEnv env)
                   throws Throwable
Read-Eval-Print-Loop: starts a loop which reads Java expressions and statements from inStream, including return statements to return a value.
Parameters:
options - Option flag bits or'ed together; 0 is default. Applets: require isSuppressingSystemOutAndErrRedirectionBit and Jeva.isSuppressingPackageNameChecksBit due to security sandbox,
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 or throws (like a top level loop).
throwClasses - 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. If returnClass is not null, then throws are actually thrown; otherwise they are caught and displayed.
env - initial environment created with Jeva.makeDefaultEnv, Jeva.extendEnv(), or Jeva.parseEval..Statement If null, defaults to Jeva.makeDefaultEnv() .
Throws:
Throwable - --- throws anything user throws compatibile with throwClasses

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-bugs@ai.mit.edu