- 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
26 lines
548 B
C++
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;
|
|
};
|
|
|