ALib C++ Library
Library Version: 2510 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:
[legend]
Collaboration diagram for alib::expressions::detail::VirtualMachine:
[legend]

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 ASTDecompile (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 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 533 of file virtualmachine.cpp.

Here is the call graph for this function:

◆ 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 362 of file virtualmachine.cpp.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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 79 of file virtualmachine.cpp.

Here is the call graph for this function:

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