22 #include <torquescript/function.hpp>
23 #include <torquescript/interpreter.hpp>
24 #include <torquescript/executionscope.hpp>
25 #include <torquescript/storedvalue.hpp>
26 #include <torquescript/storedvaluestack.hpp>
27 #include <torquescript/executionstate.hpp>
28 #include <torquescript/instructionsequence.hpp>
32 namespace Instructions
46 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state) = 0;
69 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
78 std::ostringstream out;
79 out <<
"PushFloat " << mParameter;
100 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
109 std::ostringstream out;
110 out <<
"PushInteger " << mParameter;
131 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
134 stack.push_back(
StoredValue(mStringID, StoredValueType::String));
140 std::ostringstream out;
141 out <<
"PushString " << mStringID;
147 std::size_t mStringID;
162 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
165 stack.push_back(
StoredValue(mStringID, StoredValueType::LocalReference));
171 std::ostringstream out;
172 out <<
"PushLocalReference " << mStringID;
178 std::size_t mStringID;
193 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
196 stack.push_back(
StoredValue(mStringID, StoredValueType::GlobalReference));
202 std::ostringstream out;
203 out <<
"PushGlobalReference " << mStringID;
209 std::size_t mStringID;
218 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
222 assert(stack.size() >= 2);
230 float resultRaw = 0.0f;
231 resultRaw = lhsStored.
toFloat(state);
232 resultRaw += rhsStored.
toFloat(state);
235 if (!lhsStored.
setValue(result, state))
237 state->mInterpreter->mConfig.mPlatform->logError(
"Attempted to perform no-op assignment!");
241 stack.push_back(result);
247 return "AddAssignment";
257 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
261 assert(stack.size() >= 2);
269 if (!lhsStored.
setValue(rhsStored, state))
271 state->mInterpreter->mConfig.mPlatform->logError(
"Attempted to perform no-op assignment!");
275 stack.push_back(rhsStored);
297 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
301 assert(stack.size() >= 2);
309 std::string lhs = lhsStored.
toString(state);
310 std::string rhs = rhsStored.
toString(state);
313 const std::size_t requestedStringID = state->mInterpreter->mStringTable.getOrAssign(lhs + mSeperator + rhs);
314 stack.push_back(
StoredValue(requestedStringID, StoredValueType::String));
320 std::ostringstream result;
321 result <<
"Concat " << mSeperator;
326 std::string mSeperator;
335 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
339 assert(stack.size() >= 1);
361 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
365 assert(stack.size() >= 1);
371 stack.push_back(
StoredValue(!storedTarget.toBoolean(state) ? 1 : 0));
393 CallFunctionInstruction(
const std::string& space,
const std::string& name,
const std::size_t argc) : mNameSpace(space), mName(name), mArgc(argc)
398 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
400 const std::string namespaceName = toLowerCase(mNameSpace);
404 if (namespaceName ==
"parent")
406 Function* currentFunction = state->mExecutionScope.getCurrentFunction();
407 if (currentFunction ==
nullptr)
409 state->mInterpreter->mConfig.mPlatform->logError(
"Attempted to call parent:: function at root!");
415 std::shared_ptr<Function> parentFunction = state->mInterpreter->getFunctionParent(currentFunction);
418 std::ostringstream stream;
420 stream <<
"Could not find parent function '" << mName <<
"' for calling! Placing 0 on the stack.";
421 state->mInterpreter->mConfig.mPlatform->logError(stream.str());
428 parentFunction->execute(
nullptr, state, mArgc);
433 std::shared_ptr<Function> functionLookup = state->mInterpreter->getFunction(mNameSpace, mName);
436 functionLookup->execute(
nullptr, state, mArgc);
440 std::ostringstream stream;
442 stream <<
"Could not find function '" << mName <<
"' for calling! Placing 0 on the stack.";
443 state->mInterpreter->mConfig.mPlatform->logError(stream.str());
452 std::ostringstream out;
454 if (mNameSpace ==
"")
456 out <<
"CallFunction " << mName <<
" argc=" << mArgc;
460 out <<
"CallFunction " << mNameSpace <<
"::" << mName <<
" argc=" << mArgc;
467 std::string mNameSpace;
482 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
486 assert(stack.size() >= 2);
494 float lhs = lhsStored.
toFloat(state);
495 float rhs = rhsStored.
toFloat(state);
497 const float result = lhs + rhs;
514 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
518 assert(stack.size() >= 2);
526 float lhs = lhsStored.
toFloat(state);
527 float rhs = rhsStored.
toFloat(state);
529 const int result = lhs < rhs ? 1 : 0;
546 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
550 assert(stack.size() >= 2);
558 float lhs = lhsStored.
toFloat(state);
559 float rhs = rhsStored.
toFloat(state);
561 const int result = lhs == rhs ? 1 : 0;
578 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
582 assert(stack.size() >= 2);
590 int lhs = lhsStored.toInteger(state);
591 int rhs = rhsStored.toInteger(state);
593 const int result = lhs & rhs;
611 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
615 assert(stack.size() >= 2);
624 float lhs = lhsStored.
toFloat(state);
625 float rhs = rhsStored.
toFloat(state);
627 const float result = lhs * rhs;
645 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
649 assert(stack.size() >= 2);
658 float lhs = lhsStored.
toFloat(state);
659 float rhs = rhsStored.
toFloat(state);
661 const float result = lhs / rhs;
678 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
682 assert(stack.size() >= 1);
709 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
716 std::ostringstream out;
717 out <<
"Jump " << mOffset;
743 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
747 assert(stack.size() >= 1);
752 if (booleanStored.toBoolean(state))
761 std::ostringstream out;
762 out <<
"JumpTrue " << mOffset;
788 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
792 assert(stack.size() >= 1);
797 if (!booleanStored.toBoolean(state))
806 std::ostringstream out;
807 out <<
"JumpFalse " << mOffset;
823 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
848 FunctionDeclarationInstruction(
const std::string package,
const std::string& space,
const std::string& name,
const std::vector<std::string> parameterNames,
const InstructionSequence& instructions) : mPackageName(package), mNameSpace(space), mName(name), mParameterNames(parameterNames), mInstructions(instructions)
853 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
856 std::shared_ptr<Function> newFunction = std::shared_ptr<Function>(
new Function(mPackageName, mNameSpace, mName, mParameterNames));
857 newFunction->addInstructions(mInstructions);
858 state->mInterpreter->addFunction(newFunction);
865 std::ostringstream out;
867 if (mNameSpace == NAMESPACE_EMPTY)
869 out <<
"FunctionDeclaration " << mName;
873 out <<
"FunctionDeclaration " << mNameSpace <<
"::" << mName;
876 if (mPackageName != PACKAGE_EMPTY)
878 out <<
"[in Package " << mPackageName <<
"] ";
884 for (
auto iterator = mParameterNames.begin(); iterator != mParameterNames.end(); ++iterator)
886 if (iterator != mParameterNames.begin())
895 out <<
")" << std::endl;
896 for (
auto&& instruction : mInstructions)
898 out <<
" " << instruction->disassemble();
899 if (instruction->mComment !=
"")
901 out <<
" // " << instruction->mComment;
909 std::string mPackageName;
910 std::string mNameSpace;
912 std::vector<std::string> mParameterNames;
919 SubReferenceInstruction(
const std::size_t value,
const std::size_t arrayIndices) : mStringID(value), mArrayIndices(arrayIndices)
924 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
928 assert(stack.size() >= 1);
930 const std::string arrayName = resolveArrayNameFromStack(stack, state, state->mInterpreter->mStringTable.getString(mStringID), mArrayIndices);
934 std::shared_ptr<ConsoleObject> referenced = targetStored.toConsoleObject(state);
938 const std::size_t stringID = state->mInterpreter->mStringTable.getOrAssign(arrayName);
940 stack.push_back(
StoredValue(referenced, mStringID));
950 std::ostringstream out;
951 out <<
"SubReference " << mStringID <<
" argc=" << mArrayIndices;
956 std::size_t mStringID;
957 std::size_t mArrayIndices;
967 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
971 assert(stack.size() >= 1);
978 returnStack.push_back(targetStored.getReferencedValueCopy(state));
984 std::ostringstream out;
1006 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
1008 const AddressType loopPosition = state->mInstructionPointer;
1009 state->mExecutionScope.pushLoop(loopPosition, mLoopSize);
1015 std::ostringstream out;
1016 out <<
"PushLoop " << mLoopSize;
1021 std::size_t mLoopSize;
1031 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
1033 state->mExecutionScope.popLoop();
1049 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
1051 if (state->mExecutionScope.isLoopStackEmpty())
1053 state->mInterpreter->mConfig.mPlatform->logWarning(
"Break outside of loop, ignoring ...");
1057 LoopDescriptor descriptor = state->mExecutionScope.currentLoopDescriptor();
1059 const AddressType loopProgress = state->mInstructionPointer - descriptor.mInstructionPointer;
1060 return descriptor.mLoopSize - loopProgress;
1082 AccessArrayInstruction(
const std::string& name,
const std::size_t argc,
bool global) : mName(name), mArgc(argc), mGlobal(global)
1087 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
1095 std::vector<std::string> variableComponents;
1096 for (
unsigned int iteration = 0; iteration < mArgc; ++iteration)
1098 variableComponents.push_back(stack.popString(state));
1101 std::ostringstream out;
1103 for (
auto iterator = variableComponents.rbegin(); iterator != variableComponents.rend(); ++iterator)
1105 if (iterator != variableComponents.rbegin())
1112 const std::size_t stringID = state->mInterpreter->mStringTable.getOrAssign(out.str());
1115 stack.push_back(
StoredValue(stringID, StoredValueType::GlobalReference));
1119 stack.push_back(
StoredValue(stringID, StoredValueType::LocalReference));
1126 std::ostringstream out;
1127 out <<
"AccessArray " << mName <<
" argc=" << mArgc <<
" global=" << mGlobal;
1153 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
1157 assert(stack.size() >= 1);
1163 std::shared_ptr<ConsoleObject> targetObject = targetStored.toConsoleObject(state);
1166 std::ostringstream output;
1167 output <<
"Cannot find object '" << targetStored.
toString(state) <<
"' to call function '" << mName <<
"'!";
1168 state->mInterpreter->mConfig.mPlatform->logWarning(output.str());
1176 assert(descriptor->mHierarchy.size() != 0);
1178 for (
const std::string& className : descriptor->mHierarchy)
1181 std::shared_ptr<Function> calledFunction = state->mInterpreter->getFunction(className, mName);
1184 calledFunction->execute(targetObject, state, mArgc);
1195 std::ostringstream out;
1196 out <<
"CallBoundFunctionInstruction " << mName <<
" argc=" << mArgc;
1208 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
1211 assert(stack.size() >= 2);
1218 state->mExecutionScope.pushObjectInstantiation(objectTypeName.
toString(state), objectName.
toString(state));
1225 return "PushObjectInstantiation";
1237 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
1245 std::vector<std::string> arrayComponents;
1246 for (
unsigned int iteration = 0; iteration < mFieldComponentCount; ++iteration)
1248 arrayComponents.push_back(stack.popString(state));
1255 std::ostringstream out;
1256 out << fieldBaseName.
toString(state);
1257 for (
auto iterator = arrayComponents.rbegin(); iterator != arrayComponents.rend(); ++iterator)
1259 if (iterator != arrayComponents.rbegin())
1272 search->second = rvalue;
1285 std::ostringstream out;
1286 out <<
"PushObjectField argc=" << mFieldComponentCount;
1291 std::size_t mFieldComponentCount;
1297 virtual AddressOffsetType
execute(std::shared_ptr<ExecutionState> state)
override
1303 if (state->mExecutionScope.isAwaitingParentInstantiation())
1306 parentDescriptor.
mChildren.push_back(descriptor);
1311 std::shared_ptr<ConsoleObject> result = state->mInterpreter->initializeConsoleObjectTree(descriptor);
1315 stack.push_back(
StoredValue((
int)state->mInterpreter->mConsoleObjectRegistry.getConsoleObjectID(result)));
1329 return "PopObjectInstantiation";
Definition: consoleobject.hpp:45
A function is callable subroutine from anywhere in the language, defined by a script....
Definition: function.hpp:40
Storage class for a sequence of instructions to be executed. Also implements the primary execution co...
Definition: instructionsequence.hpp:39
Accesses an array on a local or global variable. Technically, we just take all array indices and use ...
Definition: instructions.hpp:1074
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:1124
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:1087
AccessArrayInstruction(const std::string &name, const std::size_t argc, bool global)
Constructs a new instance of AccessArrayInstruction.
Definition: instructions.hpp:1082
Performs an addition of two values on the stack and assigns the result.
Definition: instructions.hpp:216
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:245
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:218
Adds together two values on the stack and pushes the sum.
Definition: instructions.hpp:480
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:482
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:502
Assign to lhs with whatever is on rhs.
Definition: instructions.hpp:255
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:279
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:257
Performs a bitwise AND against two values.
Definition: instructions.hpp:576
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:598
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:578
Breaks out of the current loop, ending all possible loop iterations immediately.
Definition: instructions.hpp:1047
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:1063
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:1049
Calls a function that is bound to an object identified on the stack.
Definition: instructions.hpp:1141
CallBoundFunctionInstruction(const std::string &name, const std::size_t argc)
Constructs a new instance of CallBoundFunctionInstruction.
Definition: instructions.hpp:1148
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:1153
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:1193
Calls a function registered within the current interpreter.
Definition: instructions.hpp:385
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:450
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:398
CallFunctionInstruction(const std::string &space, const std::string &name, const std::size_t argc)
Constructs a new CallFunctionInstruction instance.
Definition: instructions.hpp:393
Concatenates two values at the top of the stack and pushes back the result.
Definition: instructions.hpp:290
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:297
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:318
Performs a divide on two values at the top of the stack, pushing the result back.
Definition: instructions.hpp:643
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:645
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:666
Compares two values on the stack using an equality.
Definition: instructions.hpp:544
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:546
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:566
Registers a callable function to the registry in the current interpreter.
Definition: instructions.hpp:838
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:863
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.
Definition: instructions.hpp:848
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:853
Base instruction class. All instructions in the interpreter should dervive from this class and implem...
Definition: instructions.hpp:39
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state)=0
Main execution method of the instruction. This serves as our switching statement that determines how ...
std::string mComment
Compiler generated comment, used for generating easier to follow disassembly.
Definition: instructions.hpp:54
virtual std::string disassemble()=0
Helper routine to produce a disassembly for this instruction.
Jumps to the specified instruction offset if a condition is false. The condition checked is the value...
Definition: instructions.hpp:777
JumpFalseInstruction(const AddressType offset)
Constructs a new instance of JumpFalseInstruction.
Definition: instructions.hpp:783
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:788
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:804
Unconditionally jumps to the specified instruction offset.
Definition: instructions.hpp:698
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:714
JumpInstruction(const AddressType offset)
Constructs a new JumpInstruction instance.
Definition: instructions.hpp:704
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:709
Jumps to the specified instruction offset if a condition is true. The condition checked is the value ...
Definition: instructions.hpp:732
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:743
JumpTrueInstruction(const AddressType offset)
Constructs a new instance of JumpTrueInstruction.
Definition: instructions.hpp:738
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:759
Compares two values on the stack using a less than relation.
Definition: instructions.hpp:512
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:514
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:534
Multiplies together two values on the stack and pushes the result back to the stack.
Definition: instructions.hpp:609
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:611
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:632
Instruction that does nothing. It usually is used to pad jumps in order to provide safe jump targets ...
Definition: instructions.hpp:821
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:823
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:828
Negate a value on the stack.
Definition: instructions.hpp:333
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:349
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:335
Invert the truthfulness of a value on the stack.
Definition: instructions.hpp:359
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:361
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:375
Pops a value from the stack, discarding it.
Definition: instructions.hpp:676
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:678
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:688
Used to keep track of loops in the virtual instructions. This instruction marks the end of a loop con...
Definition: instructions.hpp:1029
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:1031
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:1037
Definition: instructions.hpp:1295
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:1327
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:1297
Push float instruction. This will push a floating point value to the system stack for later use in ex...
Definition: instructions.hpp:62
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:76
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:69
Push a reference to a named global variable. The parameter provided here should be excluding the '$' ...
Definition: instructions.hpp:186
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:193
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:200
Push integer instruction. This will push an integer value to the system stack for later use in execut...
Definition: instructions.hpp:93
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:100
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:107
Push a reference to a named local variable. The parameter provided here should be excluding the '' pr...
Definition: instructions.hpp:155
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:169
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:162
Used to keep track of loops in the virtual instructions. This instruction marks the start of a loop c...
Definition: instructions.hpp:995
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:1006
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:1013
PushLoopInstruction(const std::size_t loopSize)
Constructs a new instance of PushLoopInstruction.
Definition: instructions.hpp:1001
Definition: instructions.hpp:1230
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:1237
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:1283
Definition: instructions.hpp:1206
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:1208
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:1223
Push string instruction. This will push a string value to the system stack for later use in execution...
Definition: instructions.hpp:124
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:138
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:131
Ends execution in the current function immediately. It will take one value from the top of the stack ...
Definition: instructions.hpp:965
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:982
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:967
Definition: instructions.hpp:917
virtual AddressOffsetType execute(std::shared_ptr< ExecutionState > state) override
Main execution method of the instruction. This serves as our switching statement that determines how ...
Definition: instructions.hpp:924
virtual std::string disassemble() override
Helper routine to produce a disassembly for this instruction.
Definition: instructions.hpp:948
Storage class used to keep variable values in-memory of arbitrary data types. This is the base class ...
Definition: storedvaluestack.hpp:32
Storage class used to keep variable values in-memory of arbitrary data types. The data types supporte...
Definition: storedvalue.hpp:80
float toFloat(std::shared_ptr< ExecutionState > state)
Converts the value in question to a native floating point type.
bool setValue(StoredValue newValue, std::shared_ptr< ExecutionState > state)
Sets the value of this object. Only has an effect if this object is a reference to a local or global ...
std::string toString(std::shared_ptr< ExecutionState > state)
Converts the value in question to a native sting type.
long long int AddressType
Typedef for the signed integer type to be used when calculating addresses.
Definition: instructionsequence.hpp:28
Definition: executionscope.hpp:34
Struct describing a tree of console object initializations.
Definition: executionscope.hpp:48
std::vector< ObjectInstantiationDescriptor > mChildren
All children of this object. These will not be initialized until the parent is initialized.
Definition: executionscope.hpp:66
std::map< std::string, StoredValue > mFieldAssignments
All resolved field names mapped to the values to set.
Definition: executionscope.hpp:69