2021-05-21 15:12:32 +00:00
|
|
|
lexer grammar QueryLexer;
|
|
|
|
|
2023-05-24 09:50:13 +00:00
|
|
|
NOT_OP : 'NOT';
|
2021-05-21 15:12:32 +00:00
|
|
|
AND_OP : 'AND';
|
|
|
|
OR_OP : 'OR';
|
2024-06-24 11:45:59 +00:00
|
|
|
SIMPLE_OP : 'EQ' | 'NE' | 'GE' | 'GT' | 'LT' | 'LE' | 'LIKE' ;
|
2021-05-21 15:12:32 +00:00
|
|
|
|
2023-06-05 10:38:15 +00:00
|
|
|
UNIQUE : 'UNIQUE';
|
2021-05-21 15:12:32 +00:00
|
|
|
REP : 'REP';
|
2024-02-22 19:29:25 +00:00
|
|
|
EC : 'EC';
|
2021-05-21 15:12:32 +00:00
|
|
|
IN : 'IN';
|
|
|
|
AS : 'AS';
|
|
|
|
CBF : 'CBF';
|
|
|
|
SELECT : 'SELECT';
|
|
|
|
FROM : 'FROM';
|
|
|
|
FILTER : 'FILTER';
|
|
|
|
WILDCARD : '*';
|
2024-02-22 19:29:25 +00:00
|
|
|
DOT : '.';
|
2021-05-21 15:12:32 +00:00
|
|
|
|
|
|
|
CLAUSE_SAME : 'SAME';
|
|
|
|
CLAUSE_DISTINCT : 'DISTINCT';
|
|
|
|
|
|
|
|
L_PAREN : '(';
|
|
|
|
R_PAREN : ')';
|
|
|
|
AT : '@';
|
|
|
|
|
|
|
|
IDENT : Nondigit (Digit | Nondigit)* ;
|
|
|
|
fragment Digit : [0-9] ;
|
|
|
|
fragment Nondigit : [a-zA-Z_] ;
|
|
|
|
|
|
|
|
NUMBER1 : [1-9] Digit* ;
|
|
|
|
ZERO : '0' ;
|
|
|
|
|
|
|
|
// Taken from antlr4 json grammar with minor corrections.
|
|
|
|
// https://github.com/antlr/grammars-v4/blob/master/json/JSON.g4
|
|
|
|
STRING : '"' (ESC | SAFECODEPOINTDOUBLE)* '"'
|
|
|
|
| '\'' (ESC | SAFECODEPOINTSINGLE)* '\'' ;
|
|
|
|
|
|
|
|
fragment ESC : '\\' (['"\\/bfnrt] | UNICODE) ;
|
|
|
|
fragment UNICODE : 'u' HEX HEX HEX HEX ;
|
|
|
|
fragment HEX : [0-9a-fA-F] ;
|
|
|
|
fragment SAFECODEPOINTSINGLE : ~ ['\\\u0000-\u001F] ;
|
|
|
|
fragment SAFECODEPOINTDOUBLE : ~ ["\\\u0000-\u001F] ;
|
|
|
|
|
|
|
|
WS : [ \t\n\r] + -> skip ;
|