6#ifndef __INSTRUCT_HPP_X_
7#define __INSTRUCT_HPP_X_
148std::ostream &
operator<<(std::ostream &out,
const enum Inc &i);
201 extern std::vector<std::string>
keywords;
259 if (
this != &other) {
std::vector< std::string > IncType
String representations of Inc opcodes, indexed by enum value.
std::ostream & operator<<(std::ostream &out, const enum Inc &i)
Stream insertion operator for Inc opcodes.
Inc
MXVM instruction set opcodes.
@ REALLOC
Reallocate a dynamic memory block: realloc dest, elemSize, count.
Keywords
MXVM language keywords.
OperandType
Discriminates whether an operand is a compile-time constant or a variable reference.
VarType
MXVM variable type discriminator.
std::vector< std::string > keywords
String representations of Keywords enum values.
A complete MXVM instruction with opcode, operands, and optional label.
std::string toString() const
Convert this instruction to its assembly text representation.
std::vector< Operand > vop
variable-length operand list (for print, invoke, etc.)
Inc instruction
the opcode
Operand op3
up to three fixed operands
std::string label
label at this instruction address
A single instruction operand (constant value or variable reference).
std::string op
textual operand value
std::string object
owning object name for member access
std::string label
label target for jump/call operands
int op_value
numeric operand value
Runtime value storage for a variable.
uint64_t ptr_size
size of each element in allocated memory
uint64_t buffer_size
declared buffer size
bool owns
true if this value owns the allocated memory
Variable_Value & operator=(const Variable_Value &other)
Copy-assignment operator — self-check then deep copy, dispatching on type.
bool released
true if the owned memory has been freed
Variable_Value(const Variable_Value &other)
Copy constructor — deep-copies all fields, dispatching on type for the union member.
Variable_Value()
Default constructor — initialises to VAR_NULL with zeroed fields.
uint64_t ptr_count
number of elements allocated
void setExtern(std::string name, void *value)
Configure this variable as an external pointer reference.
Variable & operator=(const Variable &v)
Copy-assignment operator.
Variable()
Default constructor — VAR_NULL type with empty name and value.
Variable(const std::string &name, const VarType &vtype, const Variable_Value &value)
Construct a variable with the given name, type, and initial value.
Variable(const Variable &v)
Copy constructor.
std::string toString() const
Convert this variable to a human-readable string.