JevaES: Java Evaluator --- Expressions & Statements

prerelease version of 1999.10.11
Copyright (c) 1997, 1998, 1999 Massachusetts Institute of Technology.
This software is provided "as is" without express or implied warranty.
Contains parser generated by Sun's JavaCC/JJTree from a modified version of the example Java grammar.

JevaES

JevaES accepts Java 1.2 source code expressions and statements (but not class declarations) and evaluates (interprets) them. JevaES uses the reflective capabilities included in Java 1.2 (java.lang.reflect) so it can be useful for exploring with and/or debugging an existing compiled system (without halting threads in a debugger).

JevaESCLI is a command line interface (e.g., it can optionally be used within a Gnu Emacs M-! or M-x shell as shown at right). By default it reads from System.in, which cannot be used by multiple threads simultaneously (including debugger threads in jdb). JevaESCLI in Gnu Emacs
JevaESGUI is a graphical (windowed) user interface to JevaES. It creates a window for each invocation so it is possible to interact with multiple threads concurrently. It also highlights syntax errors. Editing is via mouse cut and paste. JevaESGUI can also be used as an applet; try the examples on its applet page. JevaESGUI
The results of expressions can be examined using Jexa, the Java Examiner. In turn, objects found through navigation can be used to set the value of Jexa.mousedObject, so that they are accessible for use in method calls. (See applet page.)

Used as Applet: JevaESGUI can be used as an applet on a page. If there are other applets on the page, it can be used to interact with those applets. (See applet page.)

Called from programs: JevaESGUI can be used to experiment with your own programs. Its read-eval-print-loop (REPL) can be invoked from programs which provide values of variables to inspect or manipulate. A JevaESGUI REPL can return values (or throw exceptions) back to programs, so it can be used in a program stub which asks the user to type in code to compute the result.

See the jevaESUI package javadoc for more details.

Jeva (experimental)

Jeva extends JevaES to implement classes with interpreted methods, constructors, and initializers. It implements an evalhook which can be used to record a trace of what a program is doing. Traveler provides means to use the evalhook to create and browse a multithreaded trace. Jeva has additional requirements which currently prevent it from being used in applets. See the jeva package javadoc for details. It currently also does not allow classes to be redefined, so it is not yet appropriate for heavy interactive use.

Jeva/JevaES Release Notes

+ 1999-10-11: JevaES/Jeva docs: added example DemoEvalWithEnv.java demonstrating that parsing expressions takes an order of magnitude longer than evaluating, and illustrating how programs can evaluate the same expression many times without reparsing by using an environment to bind identifiers to different values. JevaES/Jeva: made error messages more consistent. Jeva: fixed inheritance of interface fields; fixed array parameter type in call to super method; fixed initialization when running from a class name (e.g., Jeva.runClass, Jeva.main) an interpreted class with interfaces; fixed initialization bug in an interpreted class which is also needed as its own method parameter type; to diagnose common installation bug, CompileUnit now issues a one-time warning to when javac class is not found in classpath and it has to fall back on slower out-of-process calls.

1999-07-05: Jeva: Fixed infinite loop bug reading java files that crept into the 1999-06-09 release.

1999-06-09: Jeva: Jeva's eval hook has been extended to be called after a construct's subexpressions have been evaluated, just before the construct is 'applied', for recording call traces; this required making the parse tree less flat for operators. CompileUnit.setTempRoot(..) can now be used to enable compiled proxy classes to be reused between sessions. Added Jeva.runClass(..). Shortened names of option bits in Jeva and JevaGUI. Bound localOut and localErr to the local output pane PrintWriters; bound localResults to access the results in JevaCLI, JevaESCLI, JevaGUI, and JevaESGUI. Fixed bugs in interpreted constructors with parameters of interpreted type, explicit constructor calls, method synchronization. JevaES and Jeva: Fixed bugs in ...== null, casting, || and &&, accessibility of members of non-public classes; import by name now correctly overrides import on demand. Localization: JevaESUI and JevaUI may be localized; button and prompt strings are properties that may be overridden according to language of default locale for international use (however, JevaES error messages are not localizeable in this version).

1999-02-28 : Package statements can be used to change the current package for access to package protected fields and methods. Java1.2 reflection permits access to non-public fields and methods (may require ReflectPermission). Jeva adds interpreted classes, evalhook to JevaES.

1998-12-02: compatible with Java 1.1.

Related Systems:

This page describes research done at the Artificial Intelligence Laboratory of the Massachusetts Institute of Technology. Support for this research was provided in part by the Advanced Research Projects Agency of the Department of Defense under contracts MDA972-95-1-0018 (North East Regional Consortium Grant) and N66001-95-C-8611 (Computer Aided Education and Training Initiative), and the MIT Department of Electrical Engineering and Computer Science. Support for this research has also been received from IBM, which has generously donated Thinkpad pen computers, and from Microsoft, which has generously donated software.