fakir/src/Module.hpp

37 lines
786 B
C++
Raw Normal View History

#ifndef fk_MODULE_HPP
#define fk_MODULE_HPP
#include "commons.hpp"
#include "Lexer.hpp"
#include "Parser.hpp"
#include "Compiler.hpp"
#include "VM.hpp"
namespace fk
{
FK_ERROR(module_error);
class Module
{
public:
explicit Module(std::filesystem::path source_path);
virtual ~Module();
void build();
private:
std::filesystem::path m_source_path;
std::string m_source;
Loc m_loc {m_source_path};
std::shared_ptr<Lexer> m_lexer = std::make_shared<Lexer>(m_loc);
std::shared_ptr<Parser> m_parser = std::make_shared<Parser>(*m_lexer);
std::shared_ptr<Compiler> m_compiler = std::make_shared<Compiler>();
std::shared_ptr<Node> m_ast;
std::shared_ptr<VM> m_vm = std::make_shared<VM>();
std::string load_sources();
};
}
#endif