Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::lang::VM Class Reference

Virtual machine for executing Sen byte code. More...

#include <vm.h>

Classes

struct  CompileError
 Compilation failure report. More...
struct  RuntimeError
 Runtime error report. More...

Public Member Functions

 VM ()=default
 ~VM ()=default
Result< Value, RuntimeErrorinterpret (const Chunk &chunk, Environment environment={})
 Interpret a chunk of code.
QueryStatement parse (const std::string &query) const
 Parse a query string into a statement. Throws in case of error.
Result< Chunk, CompileErrorcompile (const QueryStatement &statement) const
 Compile source code into a chunk.

Detailed Description

Virtual machine for executing Sen byte code.


Class Documentation

◆ sen::lang::VM::CompileError

struct sen::lang::VM::CompileError

Compilation failure report.

Class Members
string what

◆ sen::lang::VM::RuntimeError

struct sen::lang::VM::RuntimeError

Runtime error report.

Class Members
string what

Constructor & Destructor Documentation

◆ VM()

sen::lang::VM::VM ( )
default

◆ ~VM()

sen::lang::VM::~VM ( )
default

Member Function Documentation

◆ interpret()

Result< Value, RuntimeError > sen::lang::VM::interpret ( const Chunk & chunk,
Environment environment = {} )
nodiscard

Interpret a chunk of code.

◆ parse()

QueryStatement sen::lang::VM::parse ( const std::string & query) const
nodiscard

Parse a query string into a statement. Throws in case of error.

◆ compile()

Result< Chunk, CompileError > sen::lang::VM::compile ( const QueryStatement & statement) const
nodiscard

Compile source code into a chunk.


The documentation for this class was generated from the following file: