31 lines
595 B
Text
31 lines
595 B
Text
|
|
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
|