public class BranchExecInstr0Instr1Instr2 extends java.lang.Object implements Instruction
BRANCH( EXEC( INSTR0 ) , INSTR1 , INSTR2 )
A
then if the results
was not false
* then executes a pre-specified instruction B
otherwise
executes a pre-specified instruction C
.Modifier and Type | Field and Description |
---|---|
protected @NotNull Instruction |
instruction0
The condition instruction.
|
protected @NotNull Instruction |
instruction1
The instruction to be executed when the condition passes.
|
protected @NotNull Instruction |
instruction2
The instruction to be executed when the condition fails.
|
protected @Nullable Tree |
tree
The tree this instruction was declared at.
|
Constructor and Description |
---|
BranchExecInstr0Instr1Instr2(@NotNull Instruction instruction0,
@NotNull Instruction instruction1)
Construct a new instruction that executes the given
instruction0 and
executes the given instruction1 when the condition succeed. |
BranchExecInstr0Instr1Instr2(@NotNull Instruction instruction0,
@NotNull Instruction instruction1,
@NotNull Instruction instruction2)
Construct a new instruction that executes the given
instruction0 and
executes the given instruction1 when the condition succeed and execute the
given instruction2 when the condition fails. |
BranchExecInstr0Instr1Instr2(@NotNull Tree tree,
@NotNull Instruction instruction0,
@NotNull Instruction instruction1)
Construct a new instruction that executes the given
instruction0 and
executes the given instruction1 when the condition succeed. |
BranchExecInstr0Instr1Instr2(@NotNull Tree tree,
@NotNull Instruction instruction0,
@NotNull Instruction instruction1,
@NotNull Instruction instruction2)
Construct a new instruction that executes the given
instruction0 and
executes the given instruction1 when the condition succeed and execute the
given instruction2 when the condition fails. |
Modifier and Type | Method and Description |
---|---|
void |
exec(@NotNull Environment environment,
@NotNull Memory memory)
Execute this instruction with the given
environment and memory . |
@Nullable Tree |
getTree()
Return the tree from where this instruction was declared.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, create
@NotNull protected final @NotNull Instruction instruction0
@NotNull protected final @NotNull Instruction instruction1
@NotNull protected final @NotNull Instruction instruction2
@Nullable protected final @Nullable Tree tree
public BranchExecInstr0Instr1Instr2(@NotNull @NotNull Instruction instruction0, @NotNull @NotNull Instruction instruction1)
instruction0
and
executes the given instruction1
when the condition succeed.instruction0
- the condition instruction.instruction1
- the instruction to be executed when the condition succeed.java.lang.NullPointerException
- if the given instruction0
or instruction1
is null.public BranchExecInstr0Instr1Instr2(@NotNull @NotNull Instruction instruction0, @NotNull @NotNull Instruction instruction1, @NotNull @NotNull Instruction instruction2)
instruction0
and
executes the given instruction1
when the condition succeed and execute the
given instruction2
when the condition fails.instruction0
- the condition instruction.instruction1
- the instruction to be executed when the condition succeed.instruction2
- the instruction to be executed when the condition fails.java.lang.NullPointerException
- if the given instruction0
or instruction1
or instruction2
is null.public BranchExecInstr0Instr1Instr2(@NotNull @NotNull Tree tree, @NotNull @NotNull Instruction instruction0, @NotNull @NotNull Instruction instruction1)
instruction0
and
executes the given instruction1
when the condition succeed.tree
- the tree from where this instruction was declared.instruction0
- the condition instruction.instruction1
- the instruction to be executed when the condition succeed.java.lang.NullPointerException
- if the given instruction0
or instruction1
is null.public BranchExecInstr0Instr1Instr2(@NotNull @NotNull Tree tree, @NotNull @NotNull Instruction instruction0, @NotNull @NotNull Instruction instruction1, @NotNull @NotNull Instruction instruction2)
instruction0
and
executes the given instruction1
when the condition succeed and execute the
given instruction2
when the condition fails.tree
- the tree from where this instruction was declared.instruction0
- the condition instruction.instruction1
- the instruction to be executed when the condition succeed.instruction2
- the instruction to be executed when the condition fails.java.lang.NullPointerException
- if the given instruction0
or instruction1
or instruction2
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.@Nullable public @Nullable Tree getTree()
Instruction
getTree
in interface Instruction