public final class Executor
extends java.lang.Object
Executor
class is to execute (simulate) instruction calls
(concrete calls). It executes instruction by instruction, perform control transfers by labels
(if needed) and prints information about important events to the simulator log (currently,
the console).Modifier and Type | Class and Description |
---|---|
static interface |
Executor.Listener
The
Executor.Listener interface is to be implemented by classes that monitor
execution of instruction calls. |
static class |
Executor.Status
The
Executor.Status class describes the execution status. |
Constructor and Description |
---|
Executor(EngineContext context) |
Executor(EngineContext context,
boolean isPresimulation)
Constructs an Executor object.
|
Modifier and Type | Method and Description |
---|---|
Executor.Status |
execute(Code code,
long startAddress)
Executes code starting from the specified address until (1) a break point is reached
and no executable code follows after this point or (2) an attempt to jump to an undefined
label is made.
|
void |
setListener(Executor.Listener listener) |
public Executor(EngineContext context, boolean isPresimulation)
context
- Generation engine context.java.lang.IllegalArgumentException
- if the argument is null
.public Executor(EngineContext context)
public void setListener(Executor.Listener listener)
public Executor.Status execute(Code code, long startAddress)
code
- Code to be executed.startAddress
- Start address.GenerationAbortedException
- (1) if an endless loop is detected; (2) if execution jumped
to an address that holds no executable instructions and no handling is provided for
this situation; (3) if an error related to interaction with the model occurs.