12#ifndef ARK_VM_STATE_HPP
13#define ARK_VM_STATE_HPP
18#include <unordered_map>
39 State(uint16_t options =
DefaultFeatures,
const std::vector<std::string>& libpath = {})
noexcept;
48 bool feed(
const std::string& bytecode_filename);
66 bool doFile(
const std::string& filename);
75 bool doString(
const std::string& code);
83 void loadFunction(
const std::string& name,
Value::ProcType function)
noexcept;
90 void setArgs(
const std::vector<std::string>& args)
noexcept;
97 void setDebug(
unsigned level)
noexcept;
104 void setLibDirs(
const std::vector<std::string>& libenv)
noexcept;
110 void reset()
noexcept;
131 bool compile(
const std::string& file,
const std::string& output);
135 throw std::runtime_error(
"StateError: " + message);
A bytecode disassembler for ArkScript.
ArkScript compiler is in charge of transforming the AST into bytecode.
Ark state to handle the dirty job of loading and compiling ArkScript code.
std::vector< Value > m_constants
void throwStateError(const std::string &message)
std::unordered_map< std::string, Value > m_binded
std::vector< std::string > m_symbols
std::vector< bytecode_t > m_pages
std::vector< std::string > m_libenv
The ArkScript virtual machine, executing ArkScript bytecode.
Value(*)(std::vector< Value > &, VM *) ProcType
constexpr uint16_t DefaultFeatures
std::vector< uint8_t > bytecode_t