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
31
pglablib/PgsqlLexer.g4
Normal file
31
pglablib/PgsqlLexer.g4
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
lexer grammar PgsqlLexer;
|
||||
|
||||
@lexer::preinclude {
|
||||
#include <memory>
|
||||
}
|
||||
|
||||
|
||||
SemiColon: ';';
|
||||
Comma: ',';
|
||||
Dot: '.';
|
||||
OpenParen: '(';
|
||||
CloseParen: ')';
|
||||
|
||||
As: 'AS';
|
||||
By: 'BY';
|
||||
From: 'FROM';
|
||||
Full: 'FULL';
|
||||
Group: 'GROUP';
|
||||
Having: 'HAVING';
|
||||
Join: 'JOIN';
|
||||
Left : 'LEFT';
|
||||
Order : 'ORDER';
|
||||
Right : 'RIGHT';
|
||||
Select: 'SELECT';
|
||||
Where: 'WHERE';
|
||||
|
||||
Ident: [A-Za-z_][A-Za-z_0-9]* ; // match lower-case identifiers
|
||||
IntegerLiteral: [1-9][0-9]*;
|
||||
StringLiteral: '\'' ('\'\'' | ~ ('\''))* '\'' { setText(getText().substr(1, getText().length()-2)); };
|
||||
|
||||
Whitespace : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
|
||||
Loading…
Add table
Add a link
Reference in a new issue