|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.dynamicjava.interpreter.TreeCompiler.EvaluationAdapter
public class TreeCompiler.EvaluationAdapter
Provides an interface through which compiled classes can invoke the interpreter. Each instance corresponds to a single compiled class; within the class, each relevant piece of syntax has a key (a string) generated at compile-time, which the adapter maps to the AST. Compiled classes must only provide that key and an environment in which to perform evaluation, and the adapter calls the appropriate interpreter methods.
| Constructor Summary | |
|---|---|
TreeCompiler.EvaluationAdapter()
|
|
| Method Summary | |
|---|---|
void |
evaluateConstructorBody(String key,
RuntimeBindings bindings,
Object[] args)
Evaluate a constructor body in the given environment, extended with the constructor parameters bound to the given arguments. |
Object |
evaluateConstructorCallArg(String key,
int index,
RuntimeBindings bindings,
Object[] args)
Evaluate the argument to a this or super constructor call at the given index. |
Object |
evaluateExpression(String key,
RuntimeBindings bindings)
Evaluate an expression in the given environment. |
void |
evaluateInitializer(String key,
RuntimeBindings bindings)
Evaluate an initializer in the given environment. |
Object |
evaluateMethod(String key,
RuntimeBindings bindings,
Object[] args)
Evaluate a method body in the given environment, extended with the method parameters bound to the given arguments. |
TreeCompiler.BindingsFactory |
makeBindingsFactory(RuntimeBindings bindings)
Make a factory object for binding a value to this. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TreeCompiler.EvaluationAdapter()
| Method Detail |
|---|
public Object evaluateMethod(String key,
RuntimeBindings bindings,
Object[] args)
throws Throwable
this should be defined in
bindings.
null
if the return statement is void, or if no return statement is evaluated.
Throwable - Any exceptions (or errors) that occur during evaluation, without any wrapping.
public Object evaluateExpression(String key,
RuntimeBindings bindings)
throws Throwable
Throwable - Any exceptions (or errors) that occur during evaluation, without any wrapping.
public Object evaluateConstructorCallArg(String key,
int index,
RuntimeBindings bindings,
Object[] args)
throws Throwable
this or super constructor call at the given index.
The given environment is extended with the constructor parameters bound to the given arguments;
this should be defined in bindings.
index - 0-based index into the call's arguments; -1 for the call's outer (prefix) expression
Throwable - Any exceptions (or errors) that occur during evaluation, without any wrapping.
public void evaluateConstructorBody(String key,
RuntimeBindings bindings,
Object[] args)
throws Throwable
this should be defined in bindings.
Throwable - Any exceptions (or errors) that occur during evaluation, without any wrapping.
public void evaluateInitializer(String key,
RuntimeBindings bindings)
throws Throwable
this should be defined in bindings.
Throwable - Any exceptions (or errors) that occur during evaluation, without any wrapping.public TreeCompiler.BindingsFactory makeBindingsFactory(RuntimeBindings bindings)
this. This level of indirection is
necessary because constructors cannot pass "this" to a method until after the super constructor
has run; in the mean time, other methods of this class or constructors of its inner classes may
have been invoked, requiring some way to produce the complete bindings.
bindings - A set of bindings to extend.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||