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
|
|
@ -19,7 +19,9 @@ enum class BasicTokenType {
|
|||
Comma,
|
||||
Cast,
|
||||
WhiteSpace,
|
||||
NewLine
|
||||
NewLine,
|
||||
|
||||
LastLexerToken
|
||||
};
|
||||
|
||||
enum class LexerState {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue