Improve construction of out Parser class.

This commit is contained in:
eelke 2022-04-03 12:30:23 +02:00
parent fbbe832a05
commit a0ba9b894f
2 changed files with 6 additions and 1 deletions

View file

@ -3,7 +3,11 @@
Parser::Parser(const std::string &input_string)
: InputStream(std::make_unique<antlr4::ANTLRInputStream>(input_string))
: Parser(std::make_unique<antlr4::ANTLRInputStream>(input_string))
{}
Parser::Parser(std::unique_ptr<antlr4::CharStream> stream)
: InputStream(std::move(stream))
, CaseFilter(InputStream.get(), true)
, Lexer(&CaseFilter)
, TokenStream(&Lexer)

View file

@ -9,6 +9,7 @@ class Parser
{
public:
Parser(const std::string &input_string);
Parser(std::unique_ptr<antlr4::CharStream> stream);
std::unique_ptr<sqlast::StatementList> Parse();