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 18 of file virtualmachine.inl.
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_DLL AString | DbgList (Program &program) |
| static ALIB_DLL AST * | Decompile (Program &program, MonoAllocator &allocator) |
| static ALIB_DLL alib::Box | Run (Program &program, Scope &scope) |
| static ALIB_DLL void | run (Program &program, Scope &scope) |
Additional Inherited Members | |
Protected Static Method Index: inherited from alib::expressions::detail::VirtualMachineBase | |
| static Scope * | getExpressionCTScope (ExpressionVal &ev) |
Type definition for a program counter.
Definition at line 21 of file virtualmachine.inl.
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 533 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 362 of file virtualmachine.cpp.
Static method that runs an expression program.
| program | The program to run. |
| scope | The scope to use. |
Definition at line 58 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.