ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::expressions::detail::VirtualMachine Struct Reference

Description:

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.

Inheritance diagram for alib::expressions::detail::VirtualMachine:
alib::expressions::detail::VirtualMachineBase

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 AString DbgList (Program &program)
static ASTDecompile (Program &program, MonoAllocator &allocator)
static alib::Box Run (Program &program, Scope &scope)
static void run (Program &program, Scope &scope)

Additional Inherited Members

Protected Static Method Index: inherited from alib::expressions::detail::VirtualMachineBase
static ScopegetExpressionCTScope (ExpressionVal &ev)

Type Definition Details:

◆ PC

Type definition for a program counter.

Definition at line 21 of file virtualmachine.inl.

Method Details:

◆ DbgList()

AString alib::expressions::detail::VirtualMachine::DbgList ( Program & program)
static

Lists a virtual machine program.

Note: This method is available only with debug-builds of the library.

Parameters
programThe program to list.
Returns
The program listing.

Definition at line 505 of file virtualmachine.cpp.

◆ Decompile()

AST * alib::expressions::detail::VirtualMachine::Decompile ( Program & program,
MonoAllocator & allocator )
static

Static method that decompiles a program into an abstract syntax tree. Used to generate optimized, normalized, parsable expression strings.

Parameters
programThe program to decompile.
allocatorAllocator for AST objects (and their data).
Returns
The abstract syntax tree as a result of de-compilation.

Definition at line 346 of file virtualmachine.cpp.

◆ Run()

Box alib::expressions::detail::VirtualMachine::Run ( Program & program,
Scope & scope )
static

Static method that runs an expression program.

Parameters
programThe program to run.
scopeThe scope to use.
Returns
The result value of the expression program.

Definition at line 58 of file virtualmachine.cpp.

◆ run()

void alib::expressions::detail::VirtualMachine::run ( Program & program,
Scope & scope )
static

The implementation of Run, which itself is just initialization code.

Parameters
programThe program to run.
scopeThe scope to use.

Definition at line 78 of file virtualmachine.cpp.


The documentation for this struct was generated from the following files: