27 lines
494 B
C++
27 lines
494 B
C++
|
#include "Factory.hpp"
|
||
|
|
||
|
namespace jk
|
||
|
{
|
||
|
/*explicit*/ Factory::Factory(Logger& logger, std::filesystem::path path)
|
||
|
: m_logger { logger }
|
||
|
, m_path { path }
|
||
|
{
|
||
|
}
|
||
|
|
||
|
/*virtual*/ Factory::~Factory()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
std::shared_ptr<Lexer> Factory::make_lexer()
|
||
|
{
|
||
|
Loc loc {m_path, 1, 0};
|
||
|
return std::make_shared<Lexer>(m_logger, loc);
|
||
|
}
|
||
|
|
||
|
std::shared_ptr<Parser> Factory::make_parser()
|
||
|
{
|
||
|
auto lexer = make_lexer();
|
||
|
return std::make_shared<Parser>(m_logger, lexer);
|
||
|
}
|
||
|
}
|