#ifndef wg_COMPILER_HPP #define wg_COMPILER_HPP #include #include #include #include "commons.hpp" #include "Node.hpp" #include "SymTable.hpp" #include "Mod.hpp" namespace wg { WG_ERROR(compile_error); class Compiler { public: explicit Compiler(Mod& mod); virtual ~Compiler(); void gen(std::filesystem::path obj); void execute(std::shared_ptr node); void imports(std::shared_ptr node); void scan(std::shared_ptr node); llvm::Value* compile(std::shared_ptr node); private: Mod& m_mod; std::unordered_map> m_imports; std::unique_ptr> m_builder = std::make_unique>(m_mod.context()); }; } #endif