#include <module.hpp>
Public Member Functions | |
Module (VM *vm) | |
~Module () | |
bool | loadSource (const char *filename) |
Loads the module from a script file. | |
bool | loadBytecode (const char *filename) |
Loads the module from a file holding the parsed bytecode. | |
bool | saveBytecode (const char *filename) |
Saves the parsed bytecode to a file. | |
void | displayBytecode (void) |
Sends a listing of the bytecode to stdout. |
A module consists of one script file, multiple modules are connected wihtin the VM, functions can be called across different modules.
ps::Module::Module | ( | VM * | vm | ) |
ps::Module::~Module | ( | ) |
bool ps::Module::loadSource | ( | const char * | filename | ) |
Loads the module from a script file.
Do not use this function directly, use VM::loadModule() instead.
bool ps::Module::loadBytecode | ( | const char * | filename | ) |
Loads the module from a file holding the parsed bytecode.
Do not use this function directly, use VM::loadBytecode() instead.
bool ps::Module::saveBytecode | ( | const char * | filename | ) |
Saves the parsed bytecode to a file.
Bytecode can be loaded much faster than source files which need to be parsed first, however, there can be some caveats when the environment while parsing the source differs from the environment used to compile the bytecode.
void ps::Module::displayBytecode | ( | void | ) |
Sends a listing of the bytecode to stdout.