#ifndef grino_MODULE_HPP #define grino_MODULE_HPP #include "commons.hpp" #include "Program.hpp" #include "SymTable.hpp" #include "VM.hpp" #include "Loader.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(); void load_native(); std::shared_ptr sym_table() const { return m_sym_table; } std::shared_ptr loader() const { return m_loader; } std::shared_ptr find(std::string const& name); std::shared_ptr from_heap(size_t addr); private: std::filesystem::path m_path; std::string m_name; Logger m_logger; std::shared_ptr m_program; std::shared_ptr m_sym_table; std::shared_ptr m_vm; Addr m_addr; std::shared_ptr m_compiler; std::shared_ptr m_loader; }; } #endif