public interface Env extends Serializable
Block is evaluated.
In the Harvard architecture terms,
Block is instruction and Env is data.
This interface is not to be implemented outside this library.
See cps-model.md
| Modifier and Type | Method and Description |
|---|---|
void |
buildStackTraceElements(List<StackTraceElement> stack,
int depth)
Builds the current call stack information for
Throwable.getStackTrace(). |
Object |
closureOwner()
Closure instance or 'this' object that surrounds the currently executing code.
|
void |
declareVariable(Class type,
String name)
Defines a local variable in the current environment.
|
Continuation |
getBreakAddress(String label)
If we see a break statement, where should we go?
|
Continuation |
getContinueAddress(String label)
If we see a continue statement, where should we go?
|
Continuation |
getExceptionHandler(Class<? extends Throwable> type)
Finds the exception handler that catches a
Throwable instance of this type. |
Invoker |
getInvoker()
Invoker is typically scoped at the whole execution. |
Object |
getLocalVariable(String name)
Obtains the current value of a local variable in the current environment.
|
Class |
getLocalVariableType(String name) |
Continuation |
getReturnAddress()
Where should the return statement return to?
|
void |
setLocalVariable(String name,
Object value)
Sets the local variable to a new value.
|
void declareVariable(@Nonnull Class type, @Nonnull String name)
type - Type of the local variable. Object when unknown/implicit (e.g. "def x")name - Name of the local variable.VariableDeclBlockObject getLocalVariable(@Nonnull String name)
name - Name of the local variable.LocalVariableBlockvoid setLocalVariable(@Nonnull String name, Object value)
name - Name of the local variable.value - New valueLocalVariableBlock@CheckForNull Class getLocalVariableType(@Nonnull String name)
Object closureOwner()
If a new closure instantiation is encountered, this is the object that becomes the owner of that closure.
Dynamic property access inside closures are also resolved against this instance.
Continuation getReturnAddress()
Continuation getBreakAddress(String label)
label - Specifies the loop to break from. null for nearest loop.Continuation getContinueAddress(String label)
label - Specifies the loop to repeat. null for nearest loop.Continuation getExceptionHandler(Class<? extends Throwable> type)
Throwable instance of this type.void buildStackTraceElements(List<StackTraceElement> stack, int depth)
Throwable.getStackTrace().depth - Maximum depth of stack trace to obtain.Copyright © 2011–2019. All rights reserved.