#ifndef fk_MODULE_HPP #define fk_MODULE_HPP #include "commons.hpp" #include "Lexer.hpp" #include "Parser.hpp" #include "Compiler.hpp" #include "VM.hpp" #include "SymTable.hpp" namespace fk { FK_ERROR(module_error); class Module { public: explicit Module(std::filesystem::path source_path); virtual ~Module(); void build(); void import_std(); void import_library(std::filesystem::path lib_path); void register_function(std::string const& name, native_t native); private: std::filesystem::path m_source_path; std::string m_source; Loc m_loc {m_source_path}; std::shared_ptr m_lexer = std::make_shared(m_loc); std::shared_ptr m_parser = std::make_shared(*m_lexer); std::shared_ptr m_sym = std::make_shared(); std::shared_ptr m_compiler = std::make_shared(m_sym); std::shared_ptr m_ast; std::shared_ptr m_vm = std::make_shared(); std::string load_sources(); }; } #endif