The Meta-Environment API

org.meta_environment.rascal.eclipse.console.internal
Interface IInterpreter

All Known Implementing Classes:
RascalScriptInterpreter

public interface IInterpreter

Interpreters should implement this.

Author:
Arnold Lankamp

Method Summary
 boolean execute(java.lang.String command)
          Requests the interpreter to execute the given command.
 java.lang.String getOutput()
          Returns the output that was generated by the last executed command.
 void initialize()
          Initializes the console.
 void setConsole(IInterpreterConsole console)
          Associated the given console this this interpreter.
 void setStdErr(java.io.PrintWriter w)
          Change the stderr writer
 void setStdOut(java.io.PrintWriter w)
          Change the stdout writer
 void storeHistory(CommandHistory history)
          Gives the interpreter the command to persist the given history.
 void terminate()
          Requests the interpreter to terminate.
 

Method Detail

initialize

void initialize()
Initializes the console.


execute

boolean execute(java.lang.String command)
                throws CommandExecutionException,
                       TerminationException
Requests the interpreter to execute the given command.

Parameters:
command - The command to execute.
Returns:
True if the command was completed; false if it wasn't.
Throws:
CommandExecutionException - Thrown when an exception occurs during the processing of a command. The message contained in the exception will be printed in the console.
TerminationException - Thrown when the executed command triggers a termination request for the console.

setConsole

void setConsole(IInterpreterConsole console)
Associated the given console this this interpreter. This method is called during the initialization of the console.

Parameters:
console - The console to associate with this interpreter.

getOutput

java.lang.String getOutput()
Returns the output that was generated by the last executed command.

Returns:
The output that was generated by the last executed command.

terminate

void terminate()
Requests the interpreter to terminate. This method is called by the console; users are discouraged from calling this method, instead IInterpreterConsole#terminate() should be used.


storeHistory

void storeHistory(CommandHistory history)
Gives the interpreter the command to persist the given history.

Parameters:
history - The command history associated with the console.

setStdOut

void setStdOut(java.io.PrintWriter w)
Change the stdout writer

Parameters:
printStream -

setStdErr

void setStdErr(java.io.PrintWriter w)
Change the stderr writer

Parameters:
printStream -

The Meta-Environment API