8#ifndef HPP_ALIB_EXPRESSIONS_DETAIL_VIRTUAL_MACHINE
9#define HPP_ALIB_EXPRESSIONS_DETAIL_VIRTUAL_MACHINE
186 const Box& resultType,
187 const String& functionOrOp,
bool isOperator,
194 ,
qtyArgs (uint16_t(qtyFunctionArgs) )
198 + static_cast<
uinteger>(idxOriginal ) )
222 | static_cast<
uinteger>(idxOriginal ) )
Command(integer idxOriginal, integer idxNormalized, JumpType jumpType)
constexpr ListingTypes TerminalType() const
OpCodes
The opcode type of VM commands.
@ Subroutine
Invokes another program.
@ Constant
Pushes a constant to the stack.
@ Function
Invokes a C++ callback function.
@ JumpIfFalse
Jumps if top of the stack indicates false.
DbgInformation DbgInfo
Operation code of this command. Available only with debug-builds.
bool IsIdentifier() const
void SetEndOfConditionalFlag()
Marks the command as the end of a conditional term.
Command(CallbackDecl callback, bool isIdentifier, int qtyFunctionArgs, const Box &resultType, const String &functionOrOp, bool isOperator, integer idxOriginal, integer idxNormalized)
Bits
Some meanings and masks of field bits.
@ FlagEOC
Flags a command to be the last of a conditional.
@ TYPE_MASK
The mask for the ListingTypes.
@ CMD_MASK
Used to mask the command out of an opcode.
Command(const Box &value, bool isOptimization, integer idxOriginal, integer idxNormalized)
int16_t bits
Operation code of this command.
OperationParam Parameter
The parameter of the operation.
constexpr OpCodes OpCode() const
JumpType
Denotes the two different jump types (used only as parameter, not stored.)
@ Unconditional
Denotes Jump.
@ Conditional
Denotes JumpIfFalse.
uinteger ExpressionPositions
ListingTypes
Denotes the type of parsing de-compilation information attached to the command.
@ UnaryOp
Command results from an unary operator.
@ NestedExpression
Command results from a nested expression.
@ BinaryOp
Command results from a binary operator.
@ LiteralConstant
Command results from a literal constant.
@ Identifier
Command results from a function call with no parenthesis given.
@ AutoCast
Command results from an automatically inserted cast.
@ OptimizationConstant
Command results from a constant resulting from an optimization.
@ FunctionCall
Command results from a function call.
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
Box(*)(Scope &scope, ArgIterator argsBegin, ArgIterator argsEnd) CallbackDecl
lang::uinteger uinteger
Type alias in namespace alib.
expressions::CompilerPlugin CompilerPlugin
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
static ALIB_API void run(Program &program, Scope &scope)
integer PC
Type definition for a program counter.
static ALIB_API alib::Box Run(Program &program, Scope &scope)
static ALIB_API AString DbgList(Program &program)
static ALIB_API AST * Decompile(Program &program, MonoAllocator &allocator)
A union of different parameter types for the commands.
OperationParam(CallbackDecl callback)
OperationParam(Program *program)
Program * NestedProgram
The nested virtual machine program to invoke.
OperationParam()
Default constructor leaving this instance uninitialized.
PC Distance
A distance to jump.
OperationParam(integer distance)
CallbackDecl Callback
A C++ callback function to invoke.