![]() |
Free EcmaScript Interpreter.
A JavaScript interpreter written in Java. |
The interactive interpreter |
The source files with extension "js", "es"
and "esw" are recognized. As "js" is often used by Netscape or
the Internet Explorer, this allows to bind "es" and "esw"
to FESI.
The property FESI.path list the paths where the code is looked
for load from the command line, by the load function (of BasicIO) and by
the @load command.If it is absent, the java CLASSPATH is used
instead. To obtain the same behaviour as before version 0.9-9, use "-DFESI.path=."
and use the option -f followed by a file name on the command line.
The command file FESIIS should be used to have the editing environment (a file may be dropped on the batch icon or the extension may be associated with this batch file). The properties of the batch file may be set to exit automatically at end and run (the batch file) iconified. The batch file used for the windowing environments (FESIW, FESIS, FESIIW, FESIIS) use jrew. Therefore any error message due to a bad path or missing library is not seen. You may replace jrew by jre for debugging purpose.
Examples:
The test mode (option -T) implements the special FESI command
All the code which follows the @test command, until the next @test command or end of file, is interpreted in a special test mode. In that mode, the name of the @test is printed and the code is execute. Any error causes a message to be printed and the interpretation to skip to the next @test. If no error is detected, the result of the last statement is evaluated. If it is true the test is considered successful, otherwise an error message is printed.@test nameOfTest
All batch mode options are allowed too, so it is possible to preload an environment before entering the interactive mode.
In addition the user can type the following commands:
@exit | Exit the interpreter |
@reset | Reset the interpreter to a null environment (forgetting all loaded files too) |
@version | Display version of interpreter |
@detail | Return detail of last evaluation |
@extensions | List loaded extensions (can be loaded with loadExtension(class)) |
@load | Load the module in the directories and jar/zip files of the property FESI.path or (if the property is not defined) in the classpath (possibly adding the extension ".es", ".esw' or ".js"). |
@pwd | Print current user directory |
@expand | Expand an HTML file between <script> and </script> lines, display on standard output |
@help | Display an short list of the allowed commands |
@about | Display information on FESI |
@detail | List the details of the last evaluation |
@list | List the enumerated properties of the object (default to the global properties) |
@listall | List all properties on an object (defaults to the global object) |
@describe | Describe the detail characteristcis of an object, including java reflection data. |
@memory | List the total and available memory (as reported by the Java runtime). |
@clear | Clear the console window (but not the interpreter content). Usefull when reaching the limits of the console text area control. |
@path | Display the current load path. |
If both the -i and -w options are given, an interactive window is used.
Its implementation is very limited, and this is for use in operating systems
with an even poorer native console interface only.