The If-Else and If-Endif pseudo instructions. More...
#include <programmable_signals.h>
Public Member Functions | |
PseudoInstruction (SignalProgram *prog, SignalIf *block, SignalOpcode op) | |
Normal constructor. | |
PseudoInstruction (SignalProgram *prog, SignalOpcode op) | |
Constructs an empty instruction of type op . | |
virtual void | Remove () |
Removes the pseudo instruction. | |
virtual void | Evaluate (SignalVM &vm) |
Evaluate the pseudo instruction. | |
virtual void | SetNext (SignalInstruction *next_insn) |
Data Fields | |
SignalIf * | block |
The block to which this instruction belongs. |
The If-Else and If-Endif pseudo instructions.
The Else instruction follows the Then block, and the Endif instruction follows the Else block.
These serve two purposes:
Definition at line 304 of file programmable_signals.h.
SignalIf::PseudoInstruction::PseudoInstruction | ( | SignalProgram * | prog, | |
SignalIf * | block, | |||
SignalOpcode | op | |||
) |
Normal constructor.
The pseudo instruction will be constructed as belonging to block
.
Definition at line 241 of file programmable_signals.cpp.
References SignalIf::if_true, PSO_IF_ELSE, and PSO_IF_ENDIF.
SignalIf::PseudoInstruction::PseudoInstruction | ( | SignalProgram * | prog, | |
SignalOpcode | op | |||
) |
Constructs an empty instruction of type op
.
This should only be used by the saveload code during deserialization. The instruction must have its block field set correctly before the program is run.
Definition at line 237 of file programmable_signals.cpp.
void SignalIf::PseudoInstruction::Evaluate | ( | SignalVM & | vm | ) | [virtual] |
Evaluate the pseudo instruction.
This involves vectoring execution to the instruction after the if.
Implements SignalInstruction.
Definition at line 263 of file programmable_signals.cpp.
References SignalIf::after, block, DEBUG, SignalVM::instruction, and PSO_IF_ELSE.
void SignalIf::PseudoInstruction::Remove | ( | ) | [virtual] |
Removes the pseudo instruction.
Unless you are also removing the If it belongs to, this is nonsense and dangerous.
Implements SignalInstruction.
Definition at line 252 of file programmable_signals.cpp.
References block, SignalIf::if_false, SignalIf::if_true, PSO_IF_ELSE, and PSO_IF_ENDIF.
The block to which this instruction belongs.
Definition at line 332 of file programmable_signals.h.
Referenced by Evaluate(), and Remove().