11 log(std::format(
"VM::{}({:T})\n", __func__, value));
21 log(std::format(
"VM::{}({})\n", __func__, index));
33 log(std::format(
"VM::{}({}, {:T})\n", __func__, index, value));
38 throw std::runtime_error(
"Invalid variable index");
48 log(std::format(
"VM::{}({}) -> <invalid index>\n", __func__, index));
51 throw std::runtime_error(
"Invalid variable index");
54 log(std::format(
"VM::{}({}) -> {:T}\n", __func__, index,
variables[index]));
63 log(std::format(
"VM::{}()\n", __func__));
std::vector< Value > variables
Variable storage indexed by variable index.
Value getVariable(size_t index)
Get a variable from the VM.
size_t getVariableCount()
Get the number of variables in the VM.
void log(const Value &msg)
Log a Value to stdout.
size_t addVariable(const Value &value)
Add a variable to the VM.
void flush()
Flush stdout.
void setVariable(size_t index, const Value &value)
Set a variable in the VM.
void freeVariable(size_t index)
Free a variable in the VM.
A value in the Phasor VM.
The Phasor Programming Language and Runtime.