TorqueScript  0.2
Public Member Functions | List of all members
TorqueScript::Instructions::AccessArrayInstruction Class Reference

Accesses an array on a local or global variable. Technically, we just take all array indices and use them to generate a new variable name to emulate array accesses. More...

#include <instructions.hpp>

Inheritance diagram for TorqueScript::Instructions::AccessArrayInstruction:
Inheritance graph
[legend]
Collaboration diagram for TorqueScript::Instructions::AccessArrayInstruction:
Collaboration graph
[legend]

Public Member Functions

 AccessArrayInstruction (const std::string &name, const std::size_t argc, bool global)
 Constructs a new instance of AccessArrayInstruction. More...
 
virtual AddressOffsetType execute (std::shared_ptr< ExecutionState > state) override
 Main execution method of the instruction. This serves as our switching statement that determines how opcodes will behave. More...
 
virtual std::string disassemble () override
 Helper routine to produce a disassembly for this instruction.
 

Additional Inherited Members

- Public Attributes inherited from TorqueScript::Instructions::Instruction
std::string mComment
 Compiler generated comment, used for generating easier to follow disassembly.
 

Detailed Description

Accesses an array on a local or global variable. Technically, we just take all array indices and use them to generate a new variable name to emulate array accesses.

Constructor & Destructor Documentation

◆ AccessArrayInstruction()

TorqueScript::Instructions::AccessArrayInstruction::AccessArrayInstruction ( const std::string &  name,
const std::size_t  argc,
bool  global 
)
inline

Constructs a new instance of AccessArrayInstruction.

Parameters
nameThe base name of the array to access.
argcThe number of array indices to load from the stack.
globalWhether or not the array access is against a global or not.

Member Function Documentation

◆ execute()

virtual AddressOffsetType TorqueScript::Instructions::AccessArrayInstruction::execute ( std::shared_ptr< ExecutionState state)
inlineoverridevirtual

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.

Implements TorqueScript::Instructions::Instruction.


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