Start of new ANTLR4 based parser.
Very simple tests pass.
This commit is contained in:
parent
03b4194193
commit
fbbe832a05
44 changed files with 860 additions and 8 deletions
27
pglablib/sqlparser/Parser.h
Normal file
27
pglablib/sqlparser/Parser.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include ".generated/PgsqlLexer.h"
|
||||
#include ".generated/PgsqlParser.h"
|
||||
#include "CaseChangingCharStream.h"
|
||||
#include "ErrorListener.h"
|
||||
|
||||
class Parser
|
||||
{
|
||||
public:
|
||||
Parser(const std::string &input_string);
|
||||
|
||||
std::unique_ptr<sqlast::StatementList> Parse();
|
||||
|
||||
int errorCount() const
|
||||
{
|
||||
return Errors.errorCount();
|
||||
}
|
||||
private:
|
||||
std::unique_ptr<antlr4::CharStream> InputStream;
|
||||
CaseChangingCharStream CaseFilter;
|
||||
PgsqlLexer Lexer;
|
||||
antlr4::CommonTokenStream TokenStream;
|
||||
PgsqlParser AParser;
|
||||
ErrorListener Errors;
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue