TorqueScript  0.2
Public Member Functions | Public Attributes | List of all members
TorqueScript::Instructions::Instruction Class Referenceabstract

Base instruction class. All instructions in the interpreter should dervive from this class and implement all virtual members. More...

#include <instructions.hpp>

Inheritance diagram for TorqueScript::Instructions::Instruction:
Inheritance graph
[legend]

Public Member Functions

virtual AddressOffsetType execute (std::shared_ptr< ExecutionState > state)=0
 Main execution method of the instruction. This serves as our switching statement that determines how opcodes will behave. More...
 
virtual std::string disassemble ()=0
 Helper routine to produce a disassembly for this instruction.
 

Public Attributes

std::string mComment
 Compiler generated comment, used for generating easier to follow disassembly.
 

Detailed Description

Base instruction class. All instructions in the interpreter should dervive from this class and implement all virtual members.

Member Function Documentation

◆ execute()

virtual AddressOffsetType TorqueScript::Instructions::Instruction::execute ( std::shared_ptr< ExecutionState state)
pure virtual

Main execution method of the instruction. This serves as our switching statement that determines how opcodes will behave.

Parameters
stateThe current execution state to act upon.

Implemented in TorqueScript::Instructions::PopObjectInstantiationInstruction, TorqueScript::Instructions::PushObjectFieldInstruction, TorqueScript::Instructions::PushObjectInstantiationInstruction, TorqueScript::Instructions::CallBoundFunctionInstruction, TorqueScript::Instructions::AccessArrayInstruction, TorqueScript::Instructions::BreakInstruction, TorqueScript::Instructions::PopLoopInstruction, TorqueScript::Instructions::PushLoopInstruction, TorqueScript::Instructions::ReturnInstruction, TorqueScript::Instructions::SubReferenceInstruction, TorqueScript::Instructions::FunctionDeclarationInstruction, TorqueScript::Instructions::NOPInstruction, TorqueScript::Instructions::JumpFalseInstruction, TorqueScript::Instructions::JumpTrueInstruction, TorqueScript::Instructions::JumpInstruction, TorqueScript::Instructions::PopInstruction, TorqueScript::Instructions::DivideInstruction, TorqueScript::Instructions::MultiplyInstruction, TorqueScript::Instructions::BitwiseAndInstruction, TorqueScript::Instructions::EqualsInstruction, TorqueScript::Instructions::LessThanInstruction, TorqueScript::Instructions::AddInstruction, TorqueScript::Instructions::CallFunctionInstruction, TorqueScript::Instructions::NotInstruction, TorqueScript::Instructions::NegateInstruction, TorqueScript::Instructions::ConcatInstruction, TorqueScript::Instructions::AssignmentInstruction, TorqueScript::Instructions::AddAssignmentInstruction, TorqueScript::Instructions::PushGlobalReferenceInstruction, TorqueScript::Instructions::PushLocalReferenceInstruction, TorqueScript::Instructions::PushStringInstruction, TorqueScript::Instructions::PushIntegerInstruction, and TorqueScript::Instructions::PushFloatInstruction.


The documentation for this class was generated from the following file: