public class SoutExecInstr extends java.lang.Object implements Instruction
Modifier and Type | Field and Description |
---|---|
protected @NotNull Instruction |
instruction
The instruction to output its results.
|
protected @Nullable Tree |
tree
The tree from where this instruction was declared.
|
Constructor and Description |
---|
SoutExecInstr(@NotNull Instruction instruction)
Construct a new instruction that executes the given
instruction and outputs
its results to the system console. |
SoutExecInstr(@NotNull Tree tree,
@NotNull Instruction instruction)
Construct a new instruction that executes the given
instruction and outputs
its results to the system console. |
Modifier and Type | Method and Description |
---|---|
void |
exec(@NotNull Environment environment,
@NotNull Memory memory)
Execute this instruction with the given
environment and memory . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, create, getTree
@NotNull protected final @NotNull Instruction instruction
@Nullable protected final @Nullable Tree tree
public SoutExecInstr(@NotNull @NotNull Instruction instruction)
instruction
and outputs
its results to the system console.instruction
- the instruction to be executed.java.lang.NullPointerException
- if the given instruction
is null.public SoutExecInstr(@NotNull @NotNull Tree tree, @NotNull @NotNull Instruction instruction)
instruction
and outputs
its results to the system console.tree
- the tree of the constructed instruction.instruction
- the instruction to be executed.java.lang.NullPointerException
- if the given tree
or instruction
is
null.public void exec(@NotNull @NotNull Environment environment, @NotNull @NotNull Memory memory)
Instruction
environment
and memory
.exec
in interface Instruction
environment
- the environment this instruction is executed in.memory
- the memory holding the variables for this instruction to depend
on.