edu.rice.cs.drjava.model.repl
Class DynamicJavaAdapter.InterpreterExtension

java.lang.Object
  |
  +--koala.dynamicjava.interpreter.TreeInterpreter
        |
        +--edu.rice.cs.drjava.model.repl.DynamicJavaAdapter.InterpreterExtension
All Implemented Interfaces:
Interpreter
Enclosing class:
DynamicJavaAdapter

public static class DynamicJavaAdapter.InterpreterExtension
extends TreeInterpreter

An extension of DynamicJava's interpreter that makes sure classes are not loaded by the system class loader (when possible) so that future interpreters will be able to reload the classes. This extension also ensures that classes on "extra.classpath" will be loaded if referenced by user defined classes. (Without this, classes on "extra.classpath" can only be referred to directly, and cannot be extended, etc.)

We also override the evaluation visitor to allow the interpreter to be interrupted and to return NO_RESULT if there was no result.


Inner classes inherited from class koala.dynamicjava.interpreter.TreeInterpreter
TreeInterpreter.ConstructorParametersDescriptor, TreeInterpreter.MethodDescriptor
 
Fields inherited from class koala.dynamicjava.interpreter.TreeInterpreter
accessible, checkVisitorContext, classLoader, constructorParameters, evalVisitorContext, libraryFinder, localConstructorParameters, localMethods, methods, nameVisitorContext, nClass, parserFactory
 
Constructor Summary
DynamicJavaAdapter.InterpreterExtension()
          Constructor.
 
Method Summary
 Object interpret(Reader r, String fname)
          Extends the interpret method to deal with possible interrupted exceptions.
 
Methods inherited from class koala.dynamicjava.interpreter.TreeInterpreter
, addClassPath, addClassURL, addLibraryPath, addLibrarySuffix, buildStatementList, defineClass, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, finalize, getAccessible, getClassLoader, getClassNames, getExceptionClass, getLibraryFinder, getParserFactory, getVariable, getVariableClass, getVariableNames, interpret, interpret, interpret, interpretArguments, interpretArguments, interpretMethod, invokeMethod, loadClass, registerConstructorArguments, registerMethod, setAccessible, setVariable
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

DynamicJavaAdapter.InterpreterExtension

public DynamicJavaAdapter.InterpreterExtension()
Constructor.
Method Detail

interpret

public Object interpret(Reader r,
                        String fname)
                 throws InterpreterException
Extends the interpret method to deal with possible interrupted exceptions. Unfortunately we have to copy all of this method to override it.
Overrides:
interpret in class TreeInterpreter
Parameters:
is - the reader from which the statements are read
fname - the name of the parsed stream
Returns:
the result of the evaluation of the last statement