This class 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 37 of file virtualmachine.hpp.
#include <virtualmachine.hpp>
Inner Type Index: | |
| class | Command |
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 41 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 520 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 354 of file virtualmachine.cpp.
Static method that runs an expression program.
| program | The program to run. |
| scope | The scope to use. |
Definition at line 57 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 79 of file virtualmachine.cpp.