This type implements a very simple stack machine that understands just four commands (!) plus a fifth to execute sub-programs.
This class is part of module ALib Expressions. It is not too well documented as it resides in a detail
namespace and is not to be used from the outside expression API.
Definition at line 30 of file virtualmachine.hpp.
#include <virtualmachine.hpp>
Inner Type Index: | |
class | Command |
A command of the VM. More... | |
Public Type Index: | |
using | PC = integer |
Type definition for a program counter. | |
Public Static Method Index: | |
static ALIB_API AString | DbgList (Program &program) |
static ALIB_API AST * | Decompile (Program &program, MonoAllocator &allocator) |
static ALIB_API alib::Box | Run (Program &program, Scope &scope) |
static ALIB_API void | run (Program &program, Scope &scope) |
Type definition for a program counter.
Definition at line 33 of file virtualmachine.hpp.
Lists a virtual machine program.
Note: This method is available only with debug-builds of the library.
program | The program to list. |
Definition at line 516 of file virtualmachine.cpp.
|
static |
Static method that decompiles a program into an abstract syntax tree. Used to generate optimized, normalized, parsable expression strings.
program | The program to decompile. |
allocator | Allocator for AST objects (and their data). |
Definition at line 347 of file virtualmachine.cpp.
Static method that runs an expression program.
program | The program to run. |
scope | The scope to use. |
Definition at line 43 of file virtualmachine.cpp.
The implementation of Run, which itself is just initialization code.
program | The program to run. |
scope | The scope to use. |
Definition at line 64 of file virtualmachine.cpp.