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