#include <virtualmachine.hpp>
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.
Public Types | |
using | PC = integer |
Type definition for a program counter. | |
Inner Classes | |
class | Command |
Public Static Methods | |
static ALIB_API AString | DbgList (Program &program) |
static ALIB_API AST * | Decompile (Program &program, MonoAllocator &allocator) |
static ALIB_API aworx::Box | Run (Program &program, Scope &scope) |
static ALIB_API void | run (Program &program, Scope &scope) |
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 517 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 351 of file virtualmachine.cpp.
Static method that runs an expression program.
program | The program to run. |
scope | The scope to use. |
Definition at line 54 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 76 of file virtualmachine.cpp.