pgLab/pglablib/sqlparser/Parser.h
eelke 0da32b916c Lexer improvements:
- Convert unquoted idents to lowercase.
- Recognize quoted idents.
- Allow all unicode whitespace characters
- Added UnexpectedSymbol token for unexpected input (otherwise it is just ignored)
- Handle mixed case keywords in the lexer file instead of filtering the stream
2022-04-03 20:09:58 +02:00

26 lines
548 B
C++

#pragma once
#include ".generated/PgsqlLexer.h"
#include ".generated/PgsqlParser.h"
#include "ErrorListener.h"
class Parser
{
public:
Parser(const std::string &input_string);
Parser(std::unique_ptr<antlr4::CharStream> stream);
std::unique_ptr<sqlast::StatementList> Parse();
int errorCount() const
{
return Errors.errorCount();
}
private:
std::unique_ptr<antlr4::CharStream> InputStream;
PgsqlLexer Lexer;
antlr4::CommonTokenStream TokenStream;
PgsqlParser AParser;
ErrorListener Errors;
};