34 lines
682 B
C++
34 lines
682 B
C++
|
#ifndef grino_MODULE_HPP
|
||
|
#define grino_MODULE_HPP
|
||
|
|
||
|
#include "commons.hpp"
|
||
|
#include "Program.hpp"
|
||
|
#include "SymTable.hpp"
|
||
|
#include "VM.hpp"
|
||
|
|
||
|
namespace grino
|
||
|
{
|
||
|
class Module
|
||
|
{
|
||
|
public:
|
||
|
explicit Module(std::filesystem::path path, std::string const& name="");
|
||
|
virtual ~Module();
|
||
|
|
||
|
std::string name() const { return m_name; }
|
||
|
void load();
|
||
|
|
||
|
std::shared_ptr<Value> find(std::string const& name);
|
||
|
std::shared_ptr<Value> from_heap(size_t addr);
|
||
|
|
||
|
private:
|
||
|
std::filesystem::path m_path;
|
||
|
std::string m_name;
|
||
|
Logger m_logger;
|
||
|
std::shared_ptr<Program> m_program;
|
||
|
std::shared_ptr<SymTable> m_sym_table;
|
||
|
std::shared_ptr<VM> m_vm;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
#endif
|