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

Registers a callable function to the registry in the current interpreter. More...

#include <instructions.hpp>

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

Public Member Functions

 FunctionDeclarationInstruction (const std::string package, const std::string &space, const std::string &name, const std::vector< std::string > parameterNames, const InstructionSequence &instructions)
 Constructs a new instance of FunctionDeclarationInstruction. 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

Registers a callable function to the registry in the current interpreter.

Constructor & Destructor Documentation

◆ FunctionDeclarationInstruction()

TorqueScript::Instructions::FunctionDeclarationInstruction::FunctionDeclarationInstruction ( const std::string  package,
const std::string &  space,
const std::string &  name,
const std::vector< std::string >  parameterNames,
const InstructionSequence instructions 
)
inline

Constructs a new instance of FunctionDeclarationInstruction.

Parameters
packageThe package this function is defined in.
spaceThe namespace this function is defined in.
nameThe name of this function.
parameterNamesThe names of all parameters this function is expecting.
instructionsThe instructions that make up the body of this function.

Member Function Documentation

◆ execute()

virtual AddressOffsetType TorqueScript::Instructions::FunctionDeclarationInstruction::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: