Start of new ANTLR4 based parser.

Very simple tests pass.
This commit is contained in:
eelke 2022-04-03 12:27:35 +02:00
parent 03b4194193
commit fbbe832a05
44 changed files with 860 additions and 8 deletions

View file

@ -26,7 +26,24 @@ Keyword isKeyword(const QString &symbol)
return Keyword::NotAKeyword;
}
/*
Put tokens on a stack
Every time something is put on the stack see if it matches a rule
The stack needs to contain both tokens from the lexical analyzer as tokens for reductions done by the parser.
Matching rules, as we need to match against the top of the stack we should match the rules end to start.
Meaning if we have on the stack A B C then we need to consider rules ending with a C
*/
class StackItem {
public:
int Token;
};
SqlParser::SqlParser(SqlLexer &lexer)
: lexer(lexer)