From 7ac5ae3331c68f07ba62dc69b5621a99e5f8277a Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 9 Feb 2001 18:49:44 +0000 Subject: [PATCH] Removed Interpret.java --- src/FESI/Interpreter/Interpret.java | 1530 --------------------------- 1 file changed, 1530 deletions(-) delete mode 100644 src/FESI/Interpreter/Interpret.java diff --git a/src/FESI/Interpreter/Interpret.java b/src/FESI/Interpreter/Interpret.java deleted file mode 100644 index 3aa6584e..00000000 --- a/src/FESI/Interpreter/Interpret.java +++ /dev/null @@ -1,1530 +0,0 @@ -// Interpret.java -// FESI Copyright (c) Jean-Marc Lugrin, 1999 -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. - -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -package FESI.Interpreter; - -import FESI.Parser.*; -import FESI.AST.*; -import FESI.Extensions.Extension; -import FESI.Extensions.BasicIOInterface; -// no GUI needed for Hop -// import FESI.gui.*; -import FESI.Data.*; -import FESI.Exceptions.*; - -import java.io.*; -import java.util.Enumeration; -import java.util.Vector; -import java.util.StringTokenizer; -import java.util.Properties; - -/** - * A general purpose interpreter for basic command line and GUI interfaces. - * Load common extensions and provide various useful if limited commands - * to evaluate and test scripts. - *

This class can be subclassed, however the interface for subclassing can - * evolve over time. It may be preferable to write interpreters from scratchs - * using this one as an example. - */ -public class Interpret { // removed implements InterpreterCommands - - // Most of the data is protected to allow subclassing the - // interpreter. They should NOT be used from other classses - // of this package (at least in FESI), as FESI can be - // build for other interpreter environments. - protected static final InputStream originalIn = System.in; - protected static final PrintStream originalOut = System.out; - protected static final PrintStream originalErr = System.err; - - protected InputStream inputStream = System.in; - protected PrintStream printStream = System.out; - protected PrintStream errorStream = System.err; - - private boolean versionPrinted = false; - protected boolean interactive = false; - protected boolean windowOnly = false; // Use MessageBox for alert, and GUI if interactive - protected boolean isAWT = true; // If false, use Swing (if windowOnly) - protected boolean anyError = false; // Any error in a test file - protected boolean anyMainTest = false; // any file processed by -T - private static String eol = System.getProperty("line.separator", "\n"); - protected ESObject document = null; - protected Evaluator evaluator = new Evaluator(); - - protected DataInputStream lineReader = null; - protected GuiFactory guiFactory = null; - protected Console console = null; - - // For interactive evaluation - protected for subclass use ONLY - protected ESValue lastResult = null; // Means last command did not evaluate anything - protected long timeOfEval= 0; // Valid only if lastResult is not null - protected long startTime = 0; - protected ESValue theValue = ESUndefined.theUndefined; - protected String[] esArgs = new String[0]; // Arguments after -A - - /** - * Create and initialize the interpreter - */ - public Interpret() { - super(); - setupCommands(); - } - - /** - * Overridable error exit (can be changed by subclass) - * IMPLEMENTATION SHOULD NOT RETURN - */ - protected void errorExit() { - System.exit(1); - } - - /** - * Exit with a status of 0 if no error was detected and 1 otherwise - */ - public void exit() { - System.exit(anyError ? 1 : 0); - } - - /** - * Forget any last result of a previous evaluation. - */ - void clearLastResult() { - lastResult = null; - } - - - /** - * Do any standard extension initialization. Can be overriden for - * specific implementation. - */ - protected void loadCommonExtensions() { - try { - evaluator.addMandatoryExtension("FESI.Extensions.JavaAccess"); - } catch (EcmaScriptException e) { - errorStream.println("Cannot initialize JavaAccess - exiting: " + eol + e); - e.printStackTrace(); - errorExit(); - } - - try { - evaluator.addMandatoryExtension("FESI.Extensions.Database"); - } catch (EcmaScriptException e) { - errorStream.println("Cannot initialize Database - exiting: " + eol + e); - e.printStackTrace(); - errorExit(); - } - - // Note that we use OptinalRegExp, so it is not a problem of the ORO - // stuff is notpresent. - try { - evaluator.addMandatoryExtension("FESI.Extensions.OptionalRegExp"); - } catch (EcmaScriptException e) { - errorStream.println("Cannot initialize OptionalRegExp - exiting: " + eol + e); - e.printStackTrace(); - errorExit(); - } - - } - - /** - * Reset the system (including at initialization) - */ - protected void reset() throws EcmaScriptException { - - if (windowOnly) { - if (console != null) { - // A reset from an existing console - if (isAWT) { - // reset stream while out of console. - System.setIn(originalIn); - System.setOut(originalOut); - System.setErr(originalErr); - inputStream = originalIn; - printStream = originalOut; - errorStream = originalErr; - // The AWT window tends to be badly behaved, we can - // reset it as well - console.dispose(); - console = null; - } else { - // assume Swing - console.clear(); - } - } - } - - // Reset the main evaluator, forgetting all globals - evaluator.reset(); - - if (windowOnly && isAWT) { - BasicIOInterface basicIOw = null; - try { - basicIOw = (BasicIOInterface) evaluator.addMandatoryExtension("FESI.Extensions.BasicIOw"); - } catch (EcmaScriptException e) { - errorStream.println("Cannot initialize BasicIOw - exiting: " + eol + e); - e.printStackTrace(); - errorExit(); - } - document = basicIOw.getDocument(); - } else if (windowOnly && !isAWT) { - BasicIOInterface basicIOs = null; - try { - basicIOs = (BasicIOInterface) evaluator.addMandatoryExtension("FESI.Extensions.BasicIOs"); - } catch (EcmaScriptException e) { - errorStream.println("Cannot initialize BasicIOs - exiting: " + eol + e); - e.printStackTrace(); - errorExit(); - } - document = basicIOs.getDocument(); - } else { - BasicIOInterface basicIO = null; - try { - basicIO = (BasicIOInterface) evaluator.addMandatoryExtension("FESI.Extensions.BasicIO"); - } catch (EcmaScriptException e) { - errorStream.println("Cannot initialize BasicIO - exiting: " + eol + e); - e.printStackTrace(); - errorExit(); - } - document = basicIO.getDocument(); - } - - loadCommonExtensions(); - - if (windowOnly && interactive) { - if (console == null) { - try { - if (isAWT) { - guiFactory = (GuiFactory) Class.forName("FESI.awtgui.AwtGuiFactory").newInstance(); - } else { - guiFactory = (GuiFactory) Class.forName("FESI.swinggui.SwingGuiFactory").newInstance(); - } - } catch (ClassNotFoundException ex) { - errorStream.println("Cannot load GUI - exiting: " + eol + ex); - ex.printStackTrace(); - errorExit(); - } catch (IllegalAccessException ex) { - errorStream.println("Cannot load GUI - exiting: " + eol + ex); - ex.printStackTrace(); - errorExit(); - } catch (InstantiationException ex) { - errorStream.println("Cannot load GUI - exiting: " + eol + ex); - ex.printStackTrace(); - errorExit(); - } - } - console = guiFactory.makeConsole(this, getTitle() ,25,80); - - inputStream = console.getConsoleIn(); - printStream = console.getConsoleOut(); - errorStream = console.getConsoleOut(); - // lineReader = console.getConsoleIn(); - lineReader = new DataInputStream(inputStream); - System.setIn(inputStream); - System.setOut(printStream); - System.setErr(errorStream); - } else if (interactive) { - // BufferedReader lineReader = new BufferedReader(new InputStreamReader(System.in)); - lineReader = new DataInputStream(inputStream); - } - - // Wait until IO has been redirected - try { - evaluator.addMandatoryExtension("FESI.Extensions.FileIO"); - } catch (EcmaScriptException e) { - errorStream.println("Cannot initialize FileIO - exiting: " + eol + e); - e.printStackTrace(); - errorExit(); - } - - if (interactive) { - printVersion(); - } - } - - /** - * Print standard version text - */ - protected void printVersion() { - printStream.println(Evaluator.getWelcomeText()); - versionPrinted = true; - } - - /** - * Display standard about text (for GUI) - */ - public void displayAboutText() { - printAbout(); - } - - /** - * Define the title of the window (to help implementing subclasses) - */ - protected String getTitle() { - return "FESI - EcmaScript interpreter"; - } - - /** - * Print standard ABOUT text - */ - protected void printAbout() { - printVersion(); - printStream.println(); - printStream.println("Provided 'as is', use at your own risk, no support available."); - printStream.println("Can be freely used and redistributed as long as this notice is included."); - printStream.println("Feedback may be sent to 'jmlugrin@worldcom.ch', but I may not"); - printStream.println("be able (or willing) to answer all mails."); - } - - /** - * Print a message waiting for a confirmation from the user - */ - protected void finalMessage(String str) { - if (windowOnly && guiFactory != null) { - MessageBox mb = guiFactory.displayMessageBox("FESI Error", str); - mb.waitOK(); - - } else { - - errorStream.println(str); - } - } - - /** - * Print a short usage guide - */ - protected void usage() { - errorStream.println("usage: fesi [-waivD] [-e ext] [-T file] [-h file] [-f file] [-m module] [-o outfile] file -A ..."); - errorStream.println(" -w Use message box for alert and AWT GUI if interactive"); - errorStream.println(" -s As -w, but use Swing instead of AWT"); - errorStream.println(" -i Start interactive read-eval-print loop"); - errorStream.println(" -v display version even if not interactive"); - errorStream.println(" -e ext Load the extension class ext"); - errorStream.println(" -T file Process an estest file, exit 1 if any failure"); - - errorStream.println(" -h file Expand the script in an html file"); - errorStream.println(" -D turnon all debug flags"); - errorStream.println(" -f file Load and execute the specified file"); - errorStream.println(" -m module Load and execute the specified module from FESI.path"); - errorStream.println(" -o file Redirect standard output to that file"); - errorStream.println(" file Load file in editor or interpret it"); - errorStream.println(" -- Standard input to load (loaded last if not present)"); - errorStream.println(" -A... Remaining arguments are for EcmaScript args[]"); - errorStream.println(" By default silently interprets stdin"); - errorStream.println(); - } - - /** - * Process arguments and interpret what is required - * MADE PUBLIC TO EASE USAGE ON THIS CLASS BY USER APPLICATIONS - * This is not called by any other routine in FESI. - * @param args the argument String array - */ - public void doWork(String args[]) { - boolean someFileLoaded = false; - - // first pass to handle -i, -w, -s options - // Selecting the interactive mode and GUI - OUTONE: - for (int i=0; i=args.length) { - if (! windowOnly) usage(); - finalMessage("-e requires a file parameter"); - if (interactive) errorExit(); - return; - } - i++; // Skip file name - continue OUTTWO; - - } else if (c=='T') { - if (j=args.length) { - if (! windowOnly) usage(); - finalMessage("-T requires a file parameter"); - if (interactive) errorExit(); - return; - } - i++; // Skip file name - continue OUTTWO; - - } else if (c=='f') { - if (j=args.length) { - if (! windowOnly) usage(); - finalMessage("-f requires a file parameter"); - if (interactive) errorExit(); - return; - } - i++; // Skip file name - continue OUTTWO; - - } else if (c=='m') { - if (j=args.length) { - if (! windowOnly) usage(); - finalMessage("-m requires a file parameter"); - if (interactive) errorExit(); - return; - } - i++; // Skip file name - continue OUTTWO; - - } else if (c=='h') { - if (j=args.length) { - if (! windowOnly) usage(); - finalMessage("-h requires a file parameter"); - if (interactive) errorExit(); - return; - } - i++; // Skip file name - continue OUTTWO; - - } else if (c=='A') { - if (j", null),false); - } catch (EcmaScriptException e) { - finalMessage(e.getMessage() + eol + - "[[Error loading file '" + fileName + "']]"); - if (interactive) errorExit(); - return; - } - } - - // Else a file name to edit - } else { - - if (interactive && console.supportsEditing()) { - console.createEditor(fileName); - } else { - doLoad(fileName); // If not interactive just load the file - } - - } - - } // for OUTTHREE - - if (interactive) { - - printStream.println("Interactive read eval print loop - type @help for a list of commands"); - - try { - printStream.print("> "); printStream.flush(); - // USE DEPRECATED ROUTINE AS DEFAULT IO STREAMS USE DEPRECATED STREAMS - String line = lineReader.readLine(); - - while(line!= null) { - - if (line.startsWith("@")) { - StringTokenizer st = new StringTokenizer(line); - String command = null; - String parameter = null; - command=st.nextToken().toLowerCase().trim(); - if (st.hasMoreTokens()) { - parameter = st.nextToken().trim(); - } - // printStream.println("command '" + command +"'"); - - if (Command.executeCommand(this, printStream, command, parameter)) break; - - } else if (!line.equals("")){ // Real evaluation - - while (true) { - lastResult = null; - try { - startTime = System.currentTimeMillis(); - theValue = evaluator.evaluate(line); - timeOfEval = System.currentTimeMillis() - startTime; - lastResult = theValue; - if (theValue != null) printStream.println("@@ Result: " + theValue.toString()); - } catch (EcmaScriptException e) { - if (e.isIncomplete()) { - printStream.print("More> "); printStream.flush(); - // USE DEPRECATED ROUTINE AS DEFAULT IO STREAMS USE DEPRECATED STREAMS - String moreLine = lineReader.readLine(); - if (moreLine != null) { - if (moreLine.startsWith("@end")) { - printStream.println("[[Error: " + e.getMessage() + "]]"); - break; // Terminate with current error - } else if (moreLine.startsWith("@")) { - printStream.println("[[Only command @end allowed when reading script end]]"); - printStream.println("[[Command and script ignored]]"); - break; - } - line = line + eol + moreLine; - // printStream.println(); - continue; - } - } - printStream.println("[[Error: " + e.getMessage() + "]]"); - // e.printStackTrace(); - } catch (Exception e) { - printStream.println("[[**Uncatched error: " + e + "]]"); - e.printStackTrace(); - } - break; - } - } - printStream.print("> "); printStream.flush(); - // USE DEPRECATED ROUTINE AS DEFAULT IO STREAMS USE DEPRECATED STREAMS - line = lineReader.readLine(); - } - } catch (IOException e) { - errorStream.println("[[IO error reading line: " + e + "]]"); - errorExit(); - } - - } else { // if !interactive - if (!someFileLoaded) { // No file on command line, load standard input in batch - try { - evaluator.evaluate(new BufferedReader(new InputStreamReader(System.in)), - null, new FileEvaluationSource("", null),false); - someFileLoaded = true; - } catch (EcmaScriptException e) { - finalMessage(e.getMessage() + - eol + "[[Error interpreting standard input]]"); - if (interactive) errorExit(); - return; - } - } - } - // Normal exit - force exit in case other thread where started (awt) - if (interactive || anyMainTest) exit(); - } - - /** - * Display the current user directoy - */ - protected void doPwd() { - String ud = System.getProperty("user.dir", ""); - printStream.println("[[User directory: " + ud + "]]"); - } - - /** - * Display the current load path - */ - protected void doPath() { - String pathSource = "FESI.path"; - String path = System.getProperty(pathSource, null); - pathSource = "java.class.path"; - if (path == null) path = System.getProperty("java.class.path",null); - if (path == null) { - pathSource = "DEFAULT"; - path = "."; - } - printStream.println("[[Load path (" + pathSource + "): " + path + "]]"); - } - - /** - * Do the command load, loading from a module (via a path) - * @param moduleName module to load - */ - protected void doLoad(String moduleName) { - if (moduleName==null || moduleName.equals("")) { - printStream.println("[[Module name missing for @load.]]"); - return; - } - try { - try { - document.putHiddenProperty("URL", - new ESString("module://" + moduleName)); - } catch (EcmaScriptException ignore) { - } - printStream.println("@@ Loading module '" + moduleName + "' . . ."); - startTime = System.currentTimeMillis(); - - theValue = evaluator.evaluateLoadModule(moduleName); // EVALUATION - - timeOfEval = System.currentTimeMillis() - startTime; - lastResult = theValue; - if (theValue != null) printStream.println("@@ Resulting in: " + theValue); - } catch (EcmaScriptException e) { - printStream.println("[[Error loading the module '" + moduleName + "']]"); - printStream.println("[[Error: " + e.getMessage() + "]]"); - } catch (Exception e) { - printStream.println("[[**Uncatched error: " + e + "]]"); - e.printStackTrace(); - } finally { - try { - document.putHiddenProperty("URL", - new ESString("module://")); - } catch (EcmaScriptException ignore) { - } - } - } - - /** - * Load a file from a specified directory and file name. - * Called by the GUI to load a file found by the file chooser. - * @param directoryName The name of the directory - * @param fileName the name of the file - */ - public void loadFile(String directoryName, String fileName) { - File directory = new File(directoryName); - File file = new File(directory, fileName); - if (file.exists()) { - try { - try { - document.putHiddenProperty("URL", - new ESString("file://" + file.getCanonicalPath())); - } catch (EcmaScriptException ignore) { - } catch (IOException ignore) { - } - printStream.println("@@ Loading file '" + file.getPath() + "' . . ."); - - theValue = evaluator.evaluateLoadFile(file); // EVALUATION - if (interactive && theValue != null) { - printStream.println("@@ Resulting in: " + theValue); - } - - } catch (EcmaScriptException e) { - errorStream.println(e.getMessage() + - eol + "[[Error loading file' " + file.getPath() + "']]"); - return; - } finally { - try { - document.putHiddenProperty("URL", - new ESString("file://")); - } catch (EcmaScriptException ignore) { - } - } - } else { - errorStream.println("[[File " + file.getPath() + " not found]]"); - } - - } - - - /** - * Execute a string - return the line number of any error or 0 - * Called by the GUI to load a buffer content. - * @param text The text to execute - * @param source The identification of the source - * @return the line number of any error if possible or 0 - */ - public int executeString(String text, String source) { - try { - try { - document.putHiddenProperty("URL", - new ESString("source://" + source)); - } catch (EcmaScriptException ignore) { - } - printStream.println("@@ Executing '" + source + "' . . ."); - - theValue = evaluator.evaluate(text, source); // EVALUATION - if (interactive && theValue != null) { - printStream.println("@@ Resulting in: " + theValue); - } - - } catch (EcmaScriptException e) { - errorStream.println(e.getMessage() + - eol + "[[Error executing '" + source + "']]"); - return e.getLineNumber(); - } finally { - try { - document.putHiddenProperty("URL", - new ESString("file://")); - } catch (EcmaScriptException ignore) { - } - } - return 0; - } - - /** - * Load a file given as a parameter - * @param fileName the name of the file - */ - protected void doLoadFile(String fileName) { - // Maybe we have an absolute file name given by the interactive shell - File file = new File(fileName); - if (!file.exists()) { - file = new File(fileName + ".es"); - } - if (!file.exists()) { - file = new File(fileName + ".esw"); - } - if (!file.exists()) { - file = new File(fileName + ".js"); - } - if (file.exists()) { - try { - try { - document.putHiddenProperty("URL", - new ESString("file://" + file.getCanonicalPath())); - } catch (EcmaScriptException ignore) { - } catch (IOException ignore) { - } - if (interactive) - printStream.println("@@ Loading file '" + file.getPath() + "' . . ."); - - theValue = evaluator.evaluateLoadFile(file); // EVALUATION - if (interactive && theValue != null) { - printStream.println("@@ Resulting in: " + theValue); - } - - } catch (EcmaScriptException e) { - finalMessage(e.getMessage() + - eol + "[[Error loading file' " + file.getPath() + "']]"); - if (!interactive) errorExit(); - return; - } finally { - try { - document.putHiddenProperty("URL", - new ESString("file://")); - } catch (EcmaScriptException ignore) { - } - } - } else { - - finalMessage("File " + file.getPath() + " not found"); - if (interactive) errorExit(); - } - } - - /** - * Expand an html source file containing ")!=-1) { - inScript = false; - evaluator.evaluate(script.toString()); - } else if (inScript) { - script.append(src+eol); - } else if (srclc.indexOf(" in an .html file") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.clearLastResult(); - interpreter.doExpand(parameter); - return false; - } - }; - new Command("extensions", "Display the list of loaded extensions") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.listExtensions(); - return false; - } - }; - new Command("help", "Display the list of commands") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.printHelp(); - return false; - } - }; - new Command("list", "List the enumerated properties of the object") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.listProperties(parameter); - return false; - } - }; - new Command("listAll", "List all properties of the object") { - boolean doCommand(Interpret interpreter, String parameter) { - - interpreter.listAllProperties(parameter); - return false; - } - }; - new Command("load", "Load a .js, .es or .esw file") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.clearLastResult(); - interpreter.doLoad(parameter); - return false; - } - }; - new Command("memory", "Give information on available memory") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.listMemory(); - return false; - } - }; - new Command("path", "Display the current load path") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.doPath(); - return false; - } - }; - new Command("pwd", "Display the current user directory") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.doPwd(); - return false; - } - }; - new Command("reset", "Restore the interpreter to the initial state") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.clearLastResult(); - interpreter.resetEvaluator(); - return false; - } - }; - new Command("test", "Execute a test file (.estest)") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.clearLastResult(); - interpreter.doTest(parameter); - return false; - } - }; - new Command("version", "Display the version of the interpreter") { - boolean doCommand(Interpret interpreter, String parameter) { - interpreter.printVersion(); - return false; - } - }; - } - - /** - * Main interpreter - * @param args String parameter array - */ - public static void main(String args[]) { - Interpret i = new Interpret(); - i.doWork(args); - } - -} - -/** - * Common code for all commands - */ -abstract class Command { - - /** - * Keep track of all commands - */ - static private Vector allCommands = new Vector(); - - protected String name; - protected String lowerCaseName; // For case insensitive search - protected String help; - - /** - * Print the help text of a command - */ - static void printHelp(PrintStream printStream) { - for (Enumeration e = allCommands.elements() ; e.hasMoreElements() ;) { - Command cmd = (Command) e.nextElement(); - printStream.println(" @"+cmd.name+ " - " + cmd.help); - } - } - - /** - * Execute a command - * @param interpreter The interpreter context - * @param printStream The output stream to use - * @param command the command name (as typed) - * @param parameter the command parameter string - */ - static boolean executeCommand(Interpret interpreter, - PrintStream printStream, - String command, - String parameter) { - Vector foundCmds = new Vector(); - String lcCommand = command.toLowerCase(); - for (Enumeration e = allCommands.elements() ; e.hasMoreElements() ;) { - Command cmd = (Command) e.nextElement(); - if (cmd.lowerCaseName.equals(command)) { - // Exact same name, execute - return cmd.doCommand(interpreter, parameter); - } else if (cmd.lowerCaseName.startsWith(command)) { - // Prefix, add to list of candidates - foundCmds.addElement(cmd); - } - } - if (foundCmds.size()==0) { - printStream.println("@@ Command '" + command + "' not recognized"); - interpreter.printHelp(); - } else if (foundCmds.size()==1) { - Command cmd = (Command) foundCmds.elementAt(0); - return cmd.doCommand(interpreter, parameter); - } else { - printStream.println("@@ Command More than one command starting with '" + - command + "'"); - for (Enumeration e = foundCmds.elements() ; e.hasMoreElements() ;) { - Command cmd = (Command) e.nextElement(); - printStream.println(" @"+cmd.name+ " - " + cmd.help); - } - } - return false; - } - - /** - * Define a new command by name with a specified help string - */ - Command(String name, String help) { - this.name = name; - this.lowerCaseName = "@" + name.toLowerCase(); - this.help = help; - allCommands.addElement(this); - } - - /** - * Execute a command with the specified parameter - * @param interpreter the interpreter context - * @param parameter The string parameter - * @return true if the interpreter must exit - */ - abstract boolean doCommand(Interpret interpreter, String parameter); -}