@cubejs-backend/schema-compiler 1.3.65 → 1.3.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/adapter/BaseQuery.js +2 -2
- package/dist/src/adapter/BaseQuery.js.map +1 -1
- package/dist/src/adapter/PreAggregations.js +1 -1
- package/dist/src/adapter/PreAggregations.js.map +1 -1
- package/dist/src/parser/GenericSqlLexer.d.ts +10 -6
- package/dist/src/parser/GenericSqlLexer.d.ts.map +1 -1
- package/dist/src/parser/GenericSqlLexer.js +92 -66
- package/dist/src/parser/GenericSqlLexer.js.map +1 -1
- package/dist/src/parser/GenericSqlListener.d.ts +11 -0
- package/dist/src/parser/GenericSqlListener.d.ts.map +1 -1
- package/dist/src/parser/GenericSqlListener.js +10 -1
- package/dist/src/parser/GenericSqlListener.js.map +1 -1
- package/dist/src/parser/GenericSqlParser.d.ts +33 -15
- package/dist/src/parser/GenericSqlParser.d.ts.map +1 -1
- package/dist/src/parser/GenericSqlParser.js +340 -213
- package/dist/src/parser/GenericSqlParser.js.map +1 -1
- package/dist/src/parser/GenericSqlVisitor.d.ts +7 -0
- package/dist/src/parser/GenericSqlVisitor.d.ts.map +1 -1
- package/dist/src/parser/GenericSqlVisitor.js +6 -1
- package/dist/src/parser/GenericSqlVisitor.js.map +1 -1
- package/dist/src/parser/SqlParser.d.ts.map +1 -1
- package/dist/src/parser/SqlParser.js +29 -4
- package/dist/src/parser/SqlParser.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Generated from src/parser/GenericSql.g4 by ANTLR 4.13.2
|
|
3
3
|
// noinspection ES6UnusedImports,JSUnusedGlobalSymbols,JSUnusedLocalSymbols
|
|
4
|
-
// @ts-nocheck
|
|
5
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.IdentifierContext = exports.IdPathContext = exports.UnaryOperatorContext = exports.BinaryOperatorContext = exports.NumericContext = exports.ExpContext = exports.BoolExpContext = exports.AliasFieldContext = exports.FieldContext = exports.SelectFieldsContext = exports.FromTablesContext = exports.QueryContext = exports.StatementContext = void 0;
|
|
5
|
+
exports.IdentifierContext = exports.IdPathContext = exports.UnaryOperatorContext = exports.BinaryOperatorContext = exports.NumericContext = exports.ExpContext = exports.BoolExpContext = exports.AliasFieldContext = exports.SelectFieldContext = exports.FieldContext = exports.SelectFieldsContext = exports.FromTablesContext = exports.QueryContext = exports.StatementContext = void 0;
|
|
7
6
|
const antlr4_1 = require("antlr4");
|
|
8
7
|
class GenericSqlParser extends antlr4_1.Parser {
|
|
9
8
|
static T__0 = 1;
|
|
@@ -27,26 +26,31 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
27
26
|
static IS = 19;
|
|
28
27
|
static NULL = 20;
|
|
29
28
|
static CAST = 21;
|
|
30
|
-
static
|
|
31
|
-
static
|
|
32
|
-
static
|
|
33
|
-
static
|
|
34
|
-
static
|
|
35
|
-
static
|
|
29
|
+
static REGEXP = 22;
|
|
30
|
+
static INDEXED_PARAM = 23;
|
|
31
|
+
static PARAM_PLACEHOLDER = 24;
|
|
32
|
+
static ID = 25;
|
|
33
|
+
static DIGIT = 26;
|
|
34
|
+
static QUOTED_ID = 27;
|
|
35
|
+
static STRING = 28;
|
|
36
|
+
static WHITESPACE = 29;
|
|
37
|
+
static COMMENT = 30;
|
|
38
|
+
static MULTILINE_COMMENT = 31;
|
|
36
39
|
static EOF = antlr4_1.Token.EOF;
|
|
37
40
|
static RULE_statement = 0;
|
|
38
41
|
static RULE_query = 1;
|
|
39
42
|
static RULE_fromTables = 2;
|
|
40
43
|
static RULE_selectFields = 3;
|
|
41
44
|
static RULE_field = 4;
|
|
42
|
-
static
|
|
43
|
-
static
|
|
44
|
-
static
|
|
45
|
-
static
|
|
46
|
-
static
|
|
47
|
-
static
|
|
48
|
-
static
|
|
49
|
-
static
|
|
45
|
+
static RULE_selectField = 5;
|
|
46
|
+
static RULE_aliasField = 6;
|
|
47
|
+
static RULE_boolExp = 7;
|
|
48
|
+
static RULE_exp = 8;
|
|
49
|
+
static RULE_numeric = 9;
|
|
50
|
+
static RULE_binaryOperator = 10;
|
|
51
|
+
static RULE_unaryOperator = 11;
|
|
52
|
+
static RULE_idPath = 12;
|
|
53
|
+
static RULE_identifier = 13;
|
|
50
54
|
static literalNames = [null, "'('",
|
|
51
55
|
"')'", "','",
|
|
52
56
|
"'.'", "'SELECT'",
|
|
@@ -57,7 +61,9 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
57
61
|
"'<='", "'>'",
|
|
58
62
|
"'>='", "'='",
|
|
59
63
|
null, "'IS'",
|
|
60
|
-
"'NULL'", "'CAST'"
|
|
64
|
+
"'NULL'", "'CAST'",
|
|
65
|
+
"'REGEXP'",
|
|
66
|
+
null, "'?'"];
|
|
61
67
|
static symbolicNames = [null, null,
|
|
62
68
|
null, null,
|
|
63
69
|
null, "SELECT",
|
|
@@ -69,15 +75,19 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
69
75
|
"GT", "GTE",
|
|
70
76
|
"EQUALS", "NOT_EQUALS",
|
|
71
77
|
"IS", "NULL",
|
|
72
|
-
"CAST", "
|
|
78
|
+
"CAST", "REGEXP",
|
|
79
|
+
"INDEXED_PARAM",
|
|
80
|
+
"PARAM_PLACEHOLDER",
|
|
73
81
|
"ID", "DIGIT",
|
|
74
82
|
"QUOTED_ID",
|
|
75
|
-
"STRING", "WHITESPACE"
|
|
83
|
+
"STRING", "WHITESPACE",
|
|
84
|
+
"COMMENT",
|
|
85
|
+
"MULTILINE_COMMENT"];
|
|
76
86
|
// tslint:disable:no-trailing-whitespace
|
|
77
87
|
static ruleNames = [
|
|
78
|
-
"statement", "query", "fromTables", "selectFields", "field", "
|
|
79
|
-
"boolExp", "exp", "numeric", "binaryOperator", "unaryOperator",
|
|
80
|
-
"identifier",
|
|
88
|
+
"statement", "query", "fromTables", "selectFields", "field", "selectField",
|
|
89
|
+
"aliasField", "boolExp", "exp", "numeric", "binaryOperator", "unaryOperator",
|
|
90
|
+
"idPath", "identifier",
|
|
81
91
|
];
|
|
82
92
|
get grammarFileName() { return "GenericSql.g4"; }
|
|
83
93
|
get literalNames() { return GenericSqlParser.literalNames; }
|
|
@@ -96,28 +106,28 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
96
106
|
let localctx = new StatementContext(this, this._ctx, this.state);
|
|
97
107
|
this.enterRule(localctx, 0, GenericSqlParser.RULE_statement);
|
|
98
108
|
try {
|
|
99
|
-
this.state =
|
|
109
|
+
this.state = 36;
|
|
100
110
|
this._errHandler.sync(this);
|
|
101
111
|
switch (this._input.LA(1)) {
|
|
102
112
|
case 5:
|
|
103
113
|
this.enterOuterAlt(localctx, 1);
|
|
104
114
|
{
|
|
105
|
-
this.state =
|
|
115
|
+
this.state = 28;
|
|
106
116
|
this.query();
|
|
107
|
-
this.state =
|
|
117
|
+
this.state = 29;
|
|
108
118
|
this.match(GenericSqlParser.EOF);
|
|
109
119
|
}
|
|
110
120
|
break;
|
|
111
121
|
case 1:
|
|
112
122
|
this.enterOuterAlt(localctx, 2);
|
|
113
123
|
{
|
|
114
|
-
this.state =
|
|
124
|
+
this.state = 31;
|
|
115
125
|
this.match(GenericSqlParser.T__0);
|
|
116
|
-
this.state =
|
|
126
|
+
this.state = 32;
|
|
117
127
|
this.query();
|
|
118
|
-
this.state =
|
|
128
|
+
this.state = 33;
|
|
119
129
|
this.match(GenericSqlParser.T__1);
|
|
120
|
-
this.state =
|
|
130
|
+
this.state = 34;
|
|
121
131
|
this.match(GenericSqlParser.EOF);
|
|
122
132
|
}
|
|
123
133
|
break;
|
|
@@ -148,22 +158,22 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
148
158
|
try {
|
|
149
159
|
this.enterOuterAlt(localctx, 1);
|
|
150
160
|
{
|
|
151
|
-
this.state =
|
|
161
|
+
this.state = 38;
|
|
152
162
|
this.match(GenericSqlParser.SELECT);
|
|
153
|
-
this.state =
|
|
163
|
+
this.state = 39;
|
|
154
164
|
this.selectFields();
|
|
155
|
-
this.state =
|
|
165
|
+
this.state = 40;
|
|
156
166
|
this.match(GenericSqlParser.FROM);
|
|
157
|
-
this.state =
|
|
167
|
+
this.state = 41;
|
|
158
168
|
localctx._from_ = this.fromTables();
|
|
159
|
-
this.state =
|
|
169
|
+
this.state = 44;
|
|
160
170
|
this._errHandler.sync(this);
|
|
161
171
|
_la = this._input.LA(1);
|
|
162
172
|
if (_la === 8) {
|
|
163
173
|
{
|
|
164
|
-
this.state =
|
|
174
|
+
this.state = 42;
|
|
165
175
|
this.match(GenericSqlParser.WHERE);
|
|
166
|
-
this.state =
|
|
176
|
+
this.state = 43;
|
|
167
177
|
localctx._where = this.boolExp(0);
|
|
168
178
|
}
|
|
169
179
|
}
|
|
@@ -191,7 +201,7 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
191
201
|
try {
|
|
192
202
|
this.enterOuterAlt(localctx, 1);
|
|
193
203
|
{
|
|
194
|
-
this.state =
|
|
204
|
+
this.state = 46;
|
|
195
205
|
this.aliasField();
|
|
196
206
|
}
|
|
197
207
|
}
|
|
@@ -219,21 +229,21 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
219
229
|
this.enterOuterAlt(localctx, 1);
|
|
220
230
|
{
|
|
221
231
|
{
|
|
222
|
-
this.state =
|
|
232
|
+
this.state = 48;
|
|
223
233
|
this.field();
|
|
224
|
-
this.state =
|
|
234
|
+
this.state = 53;
|
|
225
235
|
this._errHandler.sync(this);
|
|
226
236
|
_la = this._input.LA(1);
|
|
227
237
|
while (_la === 3) {
|
|
228
238
|
{
|
|
229
239
|
{
|
|
230
|
-
this.state =
|
|
240
|
+
this.state = 49;
|
|
231
241
|
this.match(GenericSqlParser.T__2);
|
|
232
|
-
this.state =
|
|
242
|
+
this.state = 50;
|
|
233
243
|
this.field();
|
|
234
244
|
}
|
|
235
245
|
}
|
|
236
|
-
this.state =
|
|
246
|
+
this.state = 55;
|
|
237
247
|
this._errHandler.sync(this);
|
|
238
248
|
_la = this._input.LA(1);
|
|
239
249
|
}
|
|
@@ -260,21 +270,29 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
260
270
|
let localctx = new FieldContext(this, this._ctx, this.state);
|
|
261
271
|
this.enterRule(localctx, 8, GenericSqlParser.RULE_field);
|
|
262
272
|
try {
|
|
263
|
-
this.state =
|
|
273
|
+
this.state = 58;
|
|
264
274
|
this._errHandler.sync(this);
|
|
265
275
|
switch (this._input.LA(1)) {
|
|
276
|
+
case 1:
|
|
277
|
+
case 4:
|
|
278
|
+
case 21:
|
|
279
|
+
case 22:
|
|
266
280
|
case 23:
|
|
281
|
+
case 24:
|
|
267
282
|
case 25:
|
|
283
|
+
case 26:
|
|
284
|
+
case 27:
|
|
285
|
+
case 28:
|
|
268
286
|
this.enterOuterAlt(localctx, 1);
|
|
269
287
|
{
|
|
270
|
-
this.state =
|
|
271
|
-
this.
|
|
288
|
+
this.state = 56;
|
|
289
|
+
this.selectField();
|
|
272
290
|
}
|
|
273
291
|
break;
|
|
274
292
|
case 6:
|
|
275
293
|
this.enterOuterAlt(localctx, 2);
|
|
276
294
|
{
|
|
277
|
-
this.state =
|
|
295
|
+
this.state = 57;
|
|
278
296
|
this.match(GenericSqlParser.ASTERISK);
|
|
279
297
|
}
|
|
280
298
|
break;
|
|
@@ -298,30 +316,75 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
298
316
|
return localctx;
|
|
299
317
|
}
|
|
300
318
|
// @RuleVersion(0)
|
|
319
|
+
selectField() {
|
|
320
|
+
let localctx = new SelectFieldContext(this, this._ctx, this.state);
|
|
321
|
+
this.enterRule(localctx, 10, GenericSqlParser.RULE_selectField);
|
|
322
|
+
let _la;
|
|
323
|
+
try {
|
|
324
|
+
this.enterOuterAlt(localctx, 1);
|
|
325
|
+
{
|
|
326
|
+
this.state = 60;
|
|
327
|
+
this.exp(0);
|
|
328
|
+
this.state = 65;
|
|
329
|
+
this._errHandler.sync(this);
|
|
330
|
+
_la = this._input.LA(1);
|
|
331
|
+
if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 167776256) !== 0)) {
|
|
332
|
+
{
|
|
333
|
+
this.state = 62;
|
|
334
|
+
this._errHandler.sync(this);
|
|
335
|
+
_la = this._input.LA(1);
|
|
336
|
+
if (_la === 12) {
|
|
337
|
+
{
|
|
338
|
+
this.state = 61;
|
|
339
|
+
this.match(GenericSqlParser.AS);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
this.state = 64;
|
|
343
|
+
this.identifier();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
catch (re) {
|
|
349
|
+
if (re instanceof antlr4_1.RecognitionException) {
|
|
350
|
+
localctx.exception = re;
|
|
351
|
+
this._errHandler.reportError(this, re);
|
|
352
|
+
this._errHandler.recover(this, re);
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
throw re;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
finally {
|
|
359
|
+
this.exitRule();
|
|
360
|
+
}
|
|
361
|
+
return localctx;
|
|
362
|
+
}
|
|
363
|
+
// @RuleVersion(0)
|
|
301
364
|
aliasField() {
|
|
302
365
|
let localctx = new AliasFieldContext(this, this._ctx, this.state);
|
|
303
|
-
this.enterRule(localctx,
|
|
366
|
+
this.enterRule(localctx, 12, GenericSqlParser.RULE_aliasField);
|
|
304
367
|
let _la;
|
|
305
368
|
try {
|
|
306
369
|
this.enterOuterAlt(localctx, 1);
|
|
307
370
|
{
|
|
308
|
-
this.state =
|
|
371
|
+
this.state = 67;
|
|
309
372
|
this.idPath();
|
|
310
|
-
this.state =
|
|
373
|
+
this.state = 72;
|
|
311
374
|
this._errHandler.sync(this);
|
|
312
375
|
_la = this._input.LA(1);
|
|
313
|
-
if ((((_la) & ~0x1F) === 0 && ((1 << _la) &
|
|
376
|
+
if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 167776256) !== 0)) {
|
|
314
377
|
{
|
|
315
|
-
this.state =
|
|
378
|
+
this.state = 69;
|
|
316
379
|
this._errHandler.sync(this);
|
|
317
380
|
_la = this._input.LA(1);
|
|
318
381
|
if (_la === 12) {
|
|
319
382
|
{
|
|
320
|
-
this.state =
|
|
383
|
+
this.state = 68;
|
|
321
384
|
this.match(GenericSqlParser.AS);
|
|
322
385
|
}
|
|
323
386
|
}
|
|
324
|
-
this.state =
|
|
387
|
+
this.state = 71;
|
|
325
388
|
this.identifier();
|
|
326
389
|
}
|
|
327
390
|
}
|
|
@@ -351,13 +414,13 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
351
414
|
let _parentState = this.state;
|
|
352
415
|
let localctx = new BoolExpContext(this, this._ctx, _parentState);
|
|
353
416
|
let _prevctx = localctx;
|
|
354
|
-
let _startState =
|
|
355
|
-
this.enterRecursionRule(localctx,
|
|
417
|
+
let _startState = 14;
|
|
418
|
+
this.enterRecursionRule(localctx, 14, GenericSqlParser.RULE_boolExp, _p);
|
|
356
419
|
try {
|
|
357
420
|
let _alt;
|
|
358
421
|
this.enterOuterAlt(localctx, 1);
|
|
359
422
|
{
|
|
360
|
-
this.state =
|
|
423
|
+
this.state = 78;
|
|
361
424
|
this._errHandler.sync(this);
|
|
362
425
|
switch (this._input.LA(1)) {
|
|
363
426
|
case 1:
|
|
@@ -368,16 +431,18 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
368
431
|
case 24:
|
|
369
432
|
case 25:
|
|
370
433
|
case 26:
|
|
434
|
+
case 27:
|
|
435
|
+
case 28:
|
|
371
436
|
{
|
|
372
|
-
this.state =
|
|
437
|
+
this.state = 75;
|
|
373
438
|
this.exp(0);
|
|
374
439
|
}
|
|
375
440
|
break;
|
|
376
441
|
case 11:
|
|
377
442
|
{
|
|
378
|
-
this.state =
|
|
443
|
+
this.state = 76;
|
|
379
444
|
this.match(GenericSqlParser.NOT);
|
|
380
|
-
this.state =
|
|
445
|
+
this.state = 77;
|
|
381
446
|
this.boolExp(1);
|
|
382
447
|
}
|
|
383
448
|
break;
|
|
@@ -385,9 +450,9 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
385
450
|
throw new antlr4_1.NoViableAltException(this);
|
|
386
451
|
}
|
|
387
452
|
this._ctx.stop = this._input.LT(-1);
|
|
388
|
-
this.state =
|
|
453
|
+
this.state = 88;
|
|
389
454
|
this._errHandler.sync(this);
|
|
390
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
455
|
+
_alt = this._interp.adaptivePredict(this._input, 10, this._ctx);
|
|
391
456
|
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
|
|
392
457
|
if (_alt === 1) {
|
|
393
458
|
if (this._parseListeners != null) {
|
|
@@ -395,20 +460,20 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
395
460
|
}
|
|
396
461
|
_prevctx = localctx;
|
|
397
462
|
{
|
|
398
|
-
this.state =
|
|
463
|
+
this.state = 86;
|
|
399
464
|
this._errHandler.sync(this);
|
|
400
|
-
switch (this._interp.adaptivePredict(this._input,
|
|
465
|
+
switch (this._interp.adaptivePredict(this._input, 9, this._ctx)) {
|
|
401
466
|
case 1:
|
|
402
467
|
{
|
|
403
468
|
localctx = new BoolExpContext(this, _parentctx, _parentState);
|
|
404
469
|
this.pushNewRecursionContext(localctx, _startState, GenericSqlParser.RULE_boolExp);
|
|
405
|
-
this.state =
|
|
470
|
+
this.state = 80;
|
|
406
471
|
if (!(this.precpred(this._ctx, 3))) {
|
|
407
472
|
throw this.createFailedPredicateException("this.precpred(this._ctx, 3)");
|
|
408
473
|
}
|
|
409
|
-
this.state =
|
|
474
|
+
this.state = 81;
|
|
410
475
|
this.match(GenericSqlParser.AND);
|
|
411
|
-
this.state =
|
|
476
|
+
this.state = 82;
|
|
412
477
|
this.boolExp(4);
|
|
413
478
|
}
|
|
414
479
|
break;
|
|
@@ -416,22 +481,22 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
416
481
|
{
|
|
417
482
|
localctx = new BoolExpContext(this, _parentctx, _parentState);
|
|
418
483
|
this.pushNewRecursionContext(localctx, _startState, GenericSqlParser.RULE_boolExp);
|
|
419
|
-
this.state =
|
|
484
|
+
this.state = 83;
|
|
420
485
|
if (!(this.precpred(this._ctx, 2))) {
|
|
421
486
|
throw this.createFailedPredicateException("this.precpred(this._ctx, 2)");
|
|
422
487
|
}
|
|
423
|
-
this.state =
|
|
488
|
+
this.state = 84;
|
|
424
489
|
this.match(GenericSqlParser.OR);
|
|
425
|
-
this.state =
|
|
490
|
+
this.state = 85;
|
|
426
491
|
this.boolExp(3);
|
|
427
492
|
}
|
|
428
493
|
break;
|
|
429
494
|
}
|
|
430
495
|
}
|
|
431
496
|
}
|
|
432
|
-
this.state =
|
|
497
|
+
this.state = 90;
|
|
433
498
|
this._errHandler.sync(this);
|
|
434
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
499
|
+
_alt = this._interp.adaptivePredict(this._input, 10, this._ctx);
|
|
435
500
|
}
|
|
436
501
|
}
|
|
437
502
|
}
|
|
@@ -459,107 +524,121 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
459
524
|
let _parentState = this.state;
|
|
460
525
|
let localctx = new ExpContext(this, this._ctx, _parentState);
|
|
461
526
|
let _prevctx = localctx;
|
|
462
|
-
let _startState =
|
|
463
|
-
this.enterRecursionRule(localctx,
|
|
527
|
+
let _startState = 16;
|
|
528
|
+
this.enterRecursionRule(localctx, 16, GenericSqlParser.RULE_exp, _p);
|
|
464
529
|
let _la;
|
|
465
530
|
try {
|
|
466
531
|
let _alt;
|
|
467
532
|
this.enterOuterAlt(localctx, 1);
|
|
468
533
|
{
|
|
469
|
-
this.state =
|
|
534
|
+
this.state = 123;
|
|
470
535
|
this._errHandler.sync(this);
|
|
471
|
-
switch (this._interp.adaptivePredict(this._input,
|
|
536
|
+
switch (this._interp.adaptivePredict(this._input, 12, this._ctx)) {
|
|
472
537
|
case 1:
|
|
473
538
|
{
|
|
474
|
-
this.state =
|
|
539
|
+
this.state = 92;
|
|
475
540
|
this.idPath();
|
|
476
541
|
}
|
|
477
542
|
break;
|
|
478
543
|
case 2:
|
|
479
544
|
{
|
|
480
|
-
this.state =
|
|
545
|
+
this.state = 93;
|
|
481
546
|
this.identifier();
|
|
482
|
-
this.state =
|
|
547
|
+
this.state = 94;
|
|
483
548
|
this.match(GenericSqlParser.T__0);
|
|
484
549
|
{
|
|
485
|
-
this.state =
|
|
550
|
+
this.state = 95;
|
|
486
551
|
this.exp(0);
|
|
487
|
-
this.state =
|
|
552
|
+
this.state = 100;
|
|
488
553
|
this._errHandler.sync(this);
|
|
489
554
|
_la = this._input.LA(1);
|
|
490
555
|
while (_la === 3) {
|
|
491
556
|
{
|
|
492
557
|
{
|
|
493
|
-
this.state =
|
|
558
|
+
this.state = 96;
|
|
494
559
|
this.match(GenericSqlParser.T__2);
|
|
495
|
-
this.state =
|
|
560
|
+
this.state = 97;
|
|
496
561
|
this.exp(0);
|
|
497
562
|
}
|
|
498
563
|
}
|
|
499
|
-
this.state =
|
|
564
|
+
this.state = 102;
|
|
500
565
|
this._errHandler.sync(this);
|
|
501
566
|
_la = this._input.LA(1);
|
|
502
567
|
}
|
|
503
568
|
}
|
|
504
|
-
this.state =
|
|
569
|
+
this.state = 103;
|
|
505
570
|
this.match(GenericSqlParser.T__1);
|
|
506
571
|
}
|
|
507
572
|
break;
|
|
508
573
|
case 3:
|
|
509
574
|
{
|
|
510
|
-
this.state =
|
|
575
|
+
this.state = 105;
|
|
511
576
|
this.match(GenericSqlParser.CAST);
|
|
512
|
-
this.state =
|
|
577
|
+
this.state = 106;
|
|
513
578
|
this.match(GenericSqlParser.T__0);
|
|
514
|
-
this.state =
|
|
579
|
+
this.state = 107;
|
|
515
580
|
this.exp(0);
|
|
516
|
-
this.state =
|
|
581
|
+
this.state = 108;
|
|
517
582
|
this.match(GenericSqlParser.AS);
|
|
518
|
-
this.state =
|
|
583
|
+
this.state = 109;
|
|
519
584
|
this.identifier();
|
|
520
|
-
this.state =
|
|
585
|
+
this.state = 110;
|
|
521
586
|
this.match(GenericSqlParser.T__1);
|
|
522
587
|
}
|
|
523
588
|
break;
|
|
524
589
|
case 4:
|
|
525
590
|
{
|
|
526
|
-
this.state =
|
|
591
|
+
this.state = 112;
|
|
592
|
+
this.match(GenericSqlParser.REGEXP);
|
|
593
|
+
this.state = 113;
|
|
527
594
|
this.match(GenericSqlParser.STRING);
|
|
528
595
|
}
|
|
529
596
|
break;
|
|
530
597
|
case 5:
|
|
531
598
|
{
|
|
532
|
-
this.state =
|
|
533
|
-
this.
|
|
599
|
+
this.state = 114;
|
|
600
|
+
this.match(GenericSqlParser.STRING);
|
|
534
601
|
}
|
|
535
602
|
break;
|
|
536
603
|
case 6:
|
|
537
604
|
{
|
|
538
|
-
this.state =
|
|
539
|
-
this.
|
|
605
|
+
this.state = 115;
|
|
606
|
+
this.numeric();
|
|
540
607
|
}
|
|
541
608
|
break;
|
|
542
609
|
case 7:
|
|
543
610
|
{
|
|
544
|
-
this.state =
|
|
545
|
-
this.
|
|
611
|
+
this.state = 116;
|
|
612
|
+
this.identifier();
|
|
546
613
|
}
|
|
547
614
|
break;
|
|
548
615
|
case 8:
|
|
549
616
|
{
|
|
550
|
-
this.state =
|
|
617
|
+
this.state = 117;
|
|
618
|
+
this.match(GenericSqlParser.INDEXED_PARAM);
|
|
619
|
+
}
|
|
620
|
+
break;
|
|
621
|
+
case 9:
|
|
622
|
+
{
|
|
623
|
+
this.state = 118;
|
|
624
|
+
this.match(GenericSqlParser.PARAM_PLACEHOLDER);
|
|
625
|
+
}
|
|
626
|
+
break;
|
|
627
|
+
case 10:
|
|
628
|
+
{
|
|
629
|
+
this.state = 119;
|
|
551
630
|
this.match(GenericSqlParser.T__0);
|
|
552
|
-
this.state =
|
|
631
|
+
this.state = 120;
|
|
553
632
|
this.exp(0);
|
|
554
|
-
this.state =
|
|
633
|
+
this.state = 121;
|
|
555
634
|
this.match(GenericSqlParser.T__1);
|
|
556
635
|
}
|
|
557
636
|
break;
|
|
558
637
|
}
|
|
559
638
|
this._ctx.stop = this._input.LT(-1);
|
|
560
|
-
this.state =
|
|
639
|
+
this.state = 133;
|
|
561
640
|
this._errHandler.sync(this);
|
|
562
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
641
|
+
_alt = this._interp.adaptivePredict(this._input, 14, this._ctx);
|
|
563
642
|
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
|
|
564
643
|
if (_alt === 1) {
|
|
565
644
|
if (this._parseListeners != null) {
|
|
@@ -567,41 +646,41 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
567
646
|
}
|
|
568
647
|
_prevctx = localctx;
|
|
569
648
|
{
|
|
570
|
-
this.state =
|
|
649
|
+
this.state = 131;
|
|
571
650
|
this._errHandler.sync(this);
|
|
572
|
-
switch (this._interp.adaptivePredict(this._input,
|
|
651
|
+
switch (this._interp.adaptivePredict(this._input, 13, this._ctx)) {
|
|
573
652
|
case 1:
|
|
574
653
|
{
|
|
575
654
|
localctx = new ExpContext(this, _parentctx, _parentState);
|
|
576
655
|
this.pushNewRecursionContext(localctx, _startState, GenericSqlParser.RULE_exp);
|
|
577
|
-
this.state =
|
|
578
|
-
if (!(this.precpred(this._ctx,
|
|
579
|
-
throw this.createFailedPredicateException("this.precpred(this._ctx,
|
|
656
|
+
this.state = 125;
|
|
657
|
+
if (!(this.precpred(this._ctx, 12))) {
|
|
658
|
+
throw this.createFailedPredicateException("this.precpred(this._ctx, 12)");
|
|
580
659
|
}
|
|
581
|
-
this.state =
|
|
660
|
+
this.state = 126;
|
|
582
661
|
this.binaryOperator();
|
|
583
|
-
this.state =
|
|
584
|
-
this.exp(
|
|
662
|
+
this.state = 127;
|
|
663
|
+
this.exp(13);
|
|
585
664
|
}
|
|
586
665
|
break;
|
|
587
666
|
case 2:
|
|
588
667
|
{
|
|
589
668
|
localctx = new ExpContext(this, _parentctx, _parentState);
|
|
590
669
|
this.pushNewRecursionContext(localctx, _startState, GenericSqlParser.RULE_exp);
|
|
591
|
-
this.state =
|
|
592
|
-
if (!(this.precpred(this._ctx,
|
|
593
|
-
throw this.createFailedPredicateException("this.precpred(this._ctx,
|
|
670
|
+
this.state = 129;
|
|
671
|
+
if (!(this.precpred(this._ctx, 11))) {
|
|
672
|
+
throw this.createFailedPredicateException("this.precpred(this._ctx, 11)");
|
|
594
673
|
}
|
|
595
|
-
this.state =
|
|
674
|
+
this.state = 130;
|
|
596
675
|
this.unaryOperator();
|
|
597
676
|
}
|
|
598
677
|
break;
|
|
599
678
|
}
|
|
600
679
|
}
|
|
601
680
|
}
|
|
602
|
-
this.state =
|
|
681
|
+
this.state = 135;
|
|
603
682
|
this._errHandler.sync(this);
|
|
604
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
683
|
+
_alt = this._interp.adaptivePredict(this._input, 14, this._ctx);
|
|
605
684
|
}
|
|
606
685
|
}
|
|
607
686
|
}
|
|
@@ -623,16 +702,16 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
623
702
|
// @RuleVersion(0)
|
|
624
703
|
numeric() {
|
|
625
704
|
let localctx = new NumericContext(this, this._ctx, this.state);
|
|
626
|
-
this.enterRule(localctx,
|
|
705
|
+
this.enterRule(localctx, 18, GenericSqlParser.RULE_numeric);
|
|
627
706
|
try {
|
|
628
707
|
let _alt;
|
|
629
|
-
this.state =
|
|
708
|
+
this.state = 155;
|
|
630
709
|
this._errHandler.sync(this);
|
|
631
710
|
switch (this._input.LA(1)) {
|
|
632
|
-
case
|
|
711
|
+
case 26:
|
|
633
712
|
this.enterOuterAlt(localctx, 1);
|
|
634
713
|
{
|
|
635
|
-
this.state =
|
|
714
|
+
this.state = 137;
|
|
636
715
|
this._errHandler.sync(this);
|
|
637
716
|
_alt = 1;
|
|
638
717
|
do {
|
|
@@ -640,7 +719,7 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
640
719
|
case 1:
|
|
641
720
|
{
|
|
642
721
|
{
|
|
643
|
-
this.state =
|
|
722
|
+
this.state = 136;
|
|
644
723
|
this.match(GenericSqlParser.DIGIT);
|
|
645
724
|
}
|
|
646
725
|
}
|
|
@@ -648,18 +727,18 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
648
727
|
default:
|
|
649
728
|
throw new antlr4_1.NoViableAltException(this);
|
|
650
729
|
}
|
|
651
|
-
this.state =
|
|
730
|
+
this.state = 139;
|
|
652
731
|
this._errHandler.sync(this);
|
|
653
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
732
|
+
_alt = this._interp.adaptivePredict(this._input, 15, this._ctx);
|
|
654
733
|
} while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER);
|
|
655
|
-
this.state =
|
|
734
|
+
this.state = 147;
|
|
656
735
|
this._errHandler.sync(this);
|
|
657
|
-
switch (this._interp.adaptivePredict(this._input,
|
|
736
|
+
switch (this._interp.adaptivePredict(this._input, 17, this._ctx)) {
|
|
658
737
|
case 1:
|
|
659
738
|
{
|
|
660
|
-
this.state =
|
|
739
|
+
this.state = 141;
|
|
661
740
|
this.match(GenericSqlParser.T__3);
|
|
662
|
-
this.state =
|
|
741
|
+
this.state = 143;
|
|
663
742
|
this._errHandler.sync(this);
|
|
664
743
|
_alt = 1;
|
|
665
744
|
do {
|
|
@@ -667,7 +746,7 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
667
746
|
case 1:
|
|
668
747
|
{
|
|
669
748
|
{
|
|
670
|
-
this.state =
|
|
749
|
+
this.state = 142;
|
|
671
750
|
this.match(GenericSqlParser.DIGIT);
|
|
672
751
|
}
|
|
673
752
|
}
|
|
@@ -675,9 +754,9 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
675
754
|
default:
|
|
676
755
|
throw new antlr4_1.NoViableAltException(this);
|
|
677
756
|
}
|
|
678
|
-
this.state =
|
|
757
|
+
this.state = 145;
|
|
679
758
|
this._errHandler.sync(this);
|
|
680
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
759
|
+
_alt = this._interp.adaptivePredict(this._input, 16, this._ctx);
|
|
681
760
|
} while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER);
|
|
682
761
|
}
|
|
683
762
|
break;
|
|
@@ -687,9 +766,9 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
687
766
|
case 4:
|
|
688
767
|
this.enterOuterAlt(localctx, 2);
|
|
689
768
|
{
|
|
690
|
-
this.state =
|
|
769
|
+
this.state = 149;
|
|
691
770
|
this.match(GenericSqlParser.T__3);
|
|
692
|
-
this.state =
|
|
771
|
+
this.state = 151;
|
|
693
772
|
this._errHandler.sync(this);
|
|
694
773
|
_alt = 1;
|
|
695
774
|
do {
|
|
@@ -697,7 +776,7 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
697
776
|
case 1:
|
|
698
777
|
{
|
|
699
778
|
{
|
|
700
|
-
this.state =
|
|
779
|
+
this.state = 150;
|
|
701
780
|
this.match(GenericSqlParser.DIGIT);
|
|
702
781
|
}
|
|
703
782
|
}
|
|
@@ -705,9 +784,9 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
705
784
|
default:
|
|
706
785
|
throw new antlr4_1.NoViableAltException(this);
|
|
707
786
|
}
|
|
708
|
-
this.state =
|
|
787
|
+
this.state = 153;
|
|
709
788
|
this._errHandler.sync(this);
|
|
710
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
789
|
+
_alt = this._interp.adaptivePredict(this._input, 18, this._ctx);
|
|
711
790
|
} while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER);
|
|
712
791
|
}
|
|
713
792
|
break;
|
|
@@ -733,12 +812,12 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
733
812
|
// @RuleVersion(0)
|
|
734
813
|
binaryOperator() {
|
|
735
814
|
let localctx = new BinaryOperatorContext(this, this._ctx, this.state);
|
|
736
|
-
this.enterRule(localctx,
|
|
815
|
+
this.enterRule(localctx, 20, GenericSqlParser.RULE_binaryOperator);
|
|
737
816
|
let _la;
|
|
738
817
|
try {
|
|
739
818
|
this.enterOuterAlt(localctx, 1);
|
|
740
819
|
{
|
|
741
|
-
this.state =
|
|
820
|
+
this.state = 157;
|
|
742
821
|
_la = this._input.LA(1);
|
|
743
822
|
if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & 516096) !== 0))) {
|
|
744
823
|
this._errHandler.recoverInline(this);
|
|
@@ -767,28 +846,28 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
767
846
|
// @RuleVersion(0)
|
|
768
847
|
unaryOperator() {
|
|
769
848
|
let localctx = new UnaryOperatorContext(this, this._ctx, this.state);
|
|
770
|
-
this.enterRule(localctx,
|
|
849
|
+
this.enterRule(localctx, 22, GenericSqlParser.RULE_unaryOperator);
|
|
771
850
|
try {
|
|
772
|
-
this.state =
|
|
851
|
+
this.state = 164;
|
|
773
852
|
this._errHandler.sync(this);
|
|
774
|
-
switch (this._interp.adaptivePredict(this._input,
|
|
853
|
+
switch (this._interp.adaptivePredict(this._input, 20, this._ctx)) {
|
|
775
854
|
case 1:
|
|
776
855
|
this.enterOuterAlt(localctx, 1);
|
|
777
856
|
{
|
|
778
|
-
this.state =
|
|
857
|
+
this.state = 159;
|
|
779
858
|
this.match(GenericSqlParser.IS);
|
|
780
|
-
this.state =
|
|
859
|
+
this.state = 160;
|
|
781
860
|
this.match(GenericSqlParser.NULL);
|
|
782
861
|
}
|
|
783
862
|
break;
|
|
784
863
|
case 2:
|
|
785
864
|
this.enterOuterAlt(localctx, 2);
|
|
786
865
|
{
|
|
787
|
-
this.state =
|
|
866
|
+
this.state = 161;
|
|
788
867
|
this.match(GenericSqlParser.IS);
|
|
789
|
-
this.state =
|
|
868
|
+
this.state = 162;
|
|
790
869
|
this.match(GenericSqlParser.NOT);
|
|
791
|
-
this.state =
|
|
870
|
+
this.state = 163;
|
|
792
871
|
this.match(GenericSqlParser.NULL);
|
|
793
872
|
}
|
|
794
873
|
break;
|
|
@@ -812,30 +891,30 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
812
891
|
// @RuleVersion(0)
|
|
813
892
|
idPath() {
|
|
814
893
|
let localctx = new IdPathContext(this, this._ctx, this.state);
|
|
815
|
-
this.enterRule(localctx,
|
|
894
|
+
this.enterRule(localctx, 24, GenericSqlParser.RULE_idPath);
|
|
816
895
|
try {
|
|
817
896
|
let _alt;
|
|
818
897
|
this.enterOuterAlt(localctx, 1);
|
|
819
898
|
{
|
|
820
|
-
this.state =
|
|
899
|
+
this.state = 166;
|
|
821
900
|
this.identifier();
|
|
822
|
-
this.state =
|
|
901
|
+
this.state = 171;
|
|
823
902
|
this._errHandler.sync(this);
|
|
824
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
903
|
+
_alt = this._interp.adaptivePredict(this._input, 21, this._ctx);
|
|
825
904
|
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
|
|
826
905
|
if (_alt === 1) {
|
|
827
906
|
{
|
|
828
907
|
{
|
|
829
|
-
this.state =
|
|
908
|
+
this.state = 167;
|
|
830
909
|
this.match(GenericSqlParser.T__3);
|
|
831
|
-
this.state =
|
|
910
|
+
this.state = 168;
|
|
832
911
|
this.identifier();
|
|
833
912
|
}
|
|
834
913
|
}
|
|
835
914
|
}
|
|
836
|
-
this.state =
|
|
915
|
+
this.state = 173;
|
|
837
916
|
this._errHandler.sync(this);
|
|
838
|
-
_alt = this._interp.adaptivePredict(this._input,
|
|
917
|
+
_alt = this._interp.adaptivePredict(this._input, 21, this._ctx);
|
|
839
918
|
}
|
|
840
919
|
}
|
|
841
920
|
}
|
|
@@ -857,14 +936,14 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
857
936
|
// @RuleVersion(0)
|
|
858
937
|
identifier() {
|
|
859
938
|
let localctx = new IdentifierContext(this, this._ctx, this.state);
|
|
860
|
-
this.enterRule(localctx,
|
|
939
|
+
this.enterRule(localctx, 26, GenericSqlParser.RULE_identifier);
|
|
861
940
|
let _la;
|
|
862
941
|
try {
|
|
863
942
|
this.enterOuterAlt(localctx, 1);
|
|
864
943
|
{
|
|
865
|
-
this.state =
|
|
944
|
+
this.state = 174;
|
|
866
945
|
_la = this._input.LA(1);
|
|
867
|
-
if (!(_la ===
|
|
946
|
+
if (!(_la === 25 || _la === 27)) {
|
|
868
947
|
this._errHandler.recoverInline(this);
|
|
869
948
|
}
|
|
870
949
|
else {
|
|
@@ -890,9 +969,9 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
890
969
|
}
|
|
891
970
|
sempred(localctx, ruleIndex, predIndex) {
|
|
892
971
|
switch (ruleIndex) {
|
|
893
|
-
case 6:
|
|
894
|
-
return this.boolExp_sempred(localctx, predIndex);
|
|
895
972
|
case 7:
|
|
973
|
+
return this.boolExp_sempred(localctx, predIndex);
|
|
974
|
+
case 8:
|
|
896
975
|
return this.exp_sempred(localctx, predIndex);
|
|
897
976
|
}
|
|
898
977
|
return true;
|
|
@@ -909,64 +988,68 @@ class GenericSqlParser extends antlr4_1.Parser {
|
|
|
909
988
|
exp_sempred(localctx, predIndex) {
|
|
910
989
|
switch (predIndex) {
|
|
911
990
|
case 2:
|
|
912
|
-
return this.precpred(this._ctx,
|
|
991
|
+
return this.precpred(this._ctx, 12);
|
|
913
992
|
case 3:
|
|
914
|
-
return this.precpred(this._ctx,
|
|
993
|
+
return this.precpred(this._ctx, 11);
|
|
915
994
|
}
|
|
916
995
|
return true;
|
|
917
996
|
}
|
|
918
|
-
static _serializedATN = [4, 1,
|
|
997
|
+
static _serializedATN = [4, 1, 31, 177, 2, 0, 7, 0, 2,
|
|
919
998
|
1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
|
|
920
|
-
10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12,
|
|
921
|
-
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
|
|
922
|
-
12, 3,
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
8,
|
|
928
|
-
|
|
929
|
-
1,
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
1, 0, 0, 0,
|
|
934
|
-
1, 0, 0, 0,
|
|
935
|
-
0,
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
0,
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
0, 0, 0,
|
|
955
|
-
|
|
956
|
-
120, 3,
|
|
957
|
-
0, 0, 0,
|
|
958
|
-
|
|
959
|
-
0, 0,
|
|
960
|
-
|
|
961
|
-
0,
|
|
962
|
-
|
|
963
|
-
0,
|
|
964
|
-
|
|
965
|
-
0, 0,
|
|
966
|
-
|
|
967
|
-
0, 0, 0,
|
|
968
|
-
|
|
969
|
-
|
|
999
|
+
10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3,
|
|
1000
|
+
0, 37, 8, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 45, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 5, 3, 52,
|
|
1001
|
+
8, 3, 10, 3, 12, 3, 55, 9, 3, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 3, 5, 63, 8, 5, 1, 5, 3, 5, 66, 8,
|
|
1002
|
+
5, 1, 6, 1, 6, 3, 6, 70, 8, 6, 1, 6, 3, 6, 73, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 79, 8, 7, 1, 7, 1, 7,
|
|
1003
|
+
1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 87, 8, 7, 10, 7, 12, 7, 90, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8,
|
|
1004
|
+
5, 8, 99, 8, 8, 10, 8, 12, 8, 102, 9, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1,
|
|
1005
|
+
8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 124, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1,
|
|
1006
|
+
8, 5, 8, 132, 8, 8, 10, 8, 12, 8, 135, 9, 8, 1, 9, 4, 9, 138, 8, 9, 11, 9, 12, 9, 139, 1, 9, 1, 9, 4,
|
|
1007
|
+
9, 144, 8, 9, 11, 9, 12, 9, 145, 3, 9, 148, 8, 9, 1, 9, 1, 9, 4, 9, 152, 8, 9, 11, 9, 12, 9, 153, 3,
|
|
1008
|
+
9, 156, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 165, 8, 11, 1, 12, 1, 12, 1,
|
|
1009
|
+
12, 5, 12, 170, 8, 12, 10, 12, 12, 12, 173, 9, 12, 1, 13, 1, 13, 1, 13, 0, 2, 14, 16, 14, 0, 2, 4,
|
|
1010
|
+
6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 2, 1, 0, 13, 18, 2, 0, 25, 25, 27, 27, 192, 0, 36, 1,
|
|
1011
|
+
0, 0, 0, 2, 38, 1, 0, 0, 0, 4, 46, 1, 0, 0, 0, 6, 48, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0,
|
|
1012
|
+
12, 67, 1, 0, 0, 0, 14, 78, 1, 0, 0, 0, 16, 123, 1, 0, 0, 0, 18, 155, 1, 0, 0, 0, 20, 157, 1, 0, 0,
|
|
1013
|
+
0, 22, 164, 1, 0, 0, 0, 24, 166, 1, 0, 0, 0, 26, 174, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 30, 5, 0,
|
|
1014
|
+
0, 1, 30, 37, 1, 0, 0, 0, 31, 32, 5, 1, 0, 0, 32, 33, 3, 2, 1, 0, 33, 34, 5, 2, 0, 0, 34, 35, 5, 0, 0,
|
|
1015
|
+
1, 35, 37, 1, 0, 0, 0, 36, 28, 1, 0, 0, 0, 36, 31, 1, 0, 0, 0, 37, 1, 1, 0, 0, 0, 38, 39, 5, 5, 0, 0,
|
|
1016
|
+
39, 40, 3, 6, 3, 0, 40, 41, 5, 7, 0, 0, 41, 44, 3, 4, 2, 0, 42, 43, 5, 8, 0, 0, 43, 45, 3, 14, 7, 0,
|
|
1017
|
+
44, 42, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 3, 1, 0, 0, 0, 46, 47, 3, 12, 6, 0, 47, 5, 1, 0, 0, 0, 48,
|
|
1018
|
+
53, 3, 8, 4, 0, 49, 50, 5, 3, 0, 0, 50, 52, 3, 8, 4, 0, 51, 49, 1, 0, 0, 0, 52, 55, 1, 0, 0, 0, 53, 51,
|
|
1019
|
+
1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 7, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 56, 59, 3, 10, 5, 0, 57, 59, 5,
|
|
1020
|
+
6, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 65, 3, 16, 8, 0, 61, 63, 5, 12,
|
|
1021
|
+
0, 0, 62, 61, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 66, 3, 26, 13, 0, 65, 62, 1, 0,
|
|
1022
|
+
0, 0, 65, 66, 1, 0, 0, 0, 66, 11, 1, 0, 0, 0, 67, 72, 3, 24, 12, 0, 68, 70, 5, 12, 0, 0, 69, 68, 1,
|
|
1023
|
+
0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 73, 3, 26, 13, 0, 72, 69, 1, 0, 0, 0, 72, 73, 1,
|
|
1024
|
+
0, 0, 0, 73, 13, 1, 0, 0, 0, 74, 75, 6, 7, -1, 0, 75, 79, 3, 16, 8, 0, 76, 77, 5, 11, 0, 0, 77, 79,
|
|
1025
|
+
3, 14, 7, 1, 78, 74, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 79, 88, 1, 0, 0, 0, 80, 81, 10, 3, 0, 0, 81, 82,
|
|
1026
|
+
5, 9, 0, 0, 82, 87, 3, 14, 7, 4, 83, 84, 10, 2, 0, 0, 84, 85, 5, 10, 0, 0, 85, 87, 3, 14, 7, 3, 86,
|
|
1027
|
+
80, 1, 0, 0, 0, 86, 83, 1, 0, 0, 0, 87, 90, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 15,
|
|
1028
|
+
1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 91, 92, 6, 8, -1, 0, 92, 124, 3, 24, 12, 0, 93, 94, 3, 26, 13, 0, 94,
|
|
1029
|
+
95, 5, 1, 0, 0, 95, 100, 3, 16, 8, 0, 96, 97, 5, 3, 0, 0, 97, 99, 3, 16, 8, 0, 98, 96, 1, 0, 0, 0, 99,
|
|
1030
|
+
102, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 101, 103, 1, 0, 0, 0, 102, 100, 1, 0,
|
|
1031
|
+
0, 0, 103, 104, 5, 2, 0, 0, 104, 124, 1, 0, 0, 0, 105, 106, 5, 21, 0, 0, 106, 107, 5, 1, 0, 0, 107,
|
|
1032
|
+
108, 3, 16, 8, 0, 108, 109, 5, 12, 0, 0, 109, 110, 3, 26, 13, 0, 110, 111, 5, 2, 0, 0, 111, 124,
|
|
1033
|
+
1, 0, 0, 0, 112, 113, 5, 22, 0, 0, 113, 124, 5, 28, 0, 0, 114, 124, 5, 28, 0, 0, 115, 124, 3, 18,
|
|
1034
|
+
9, 0, 116, 124, 3, 26, 13, 0, 117, 124, 5, 23, 0, 0, 118, 124, 5, 24, 0, 0, 119, 120, 5, 1, 0, 0,
|
|
1035
|
+
120, 121, 3, 16, 8, 0, 121, 122, 5, 2, 0, 0, 122, 124, 1, 0, 0, 0, 123, 91, 1, 0, 0, 0, 123, 93,
|
|
1036
|
+
1, 0, 0, 0, 123, 105, 1, 0, 0, 0, 123, 112, 1, 0, 0, 0, 123, 114, 1, 0, 0, 0, 123, 115, 1, 0, 0, 0,
|
|
1037
|
+
123, 116, 1, 0, 0, 0, 123, 117, 1, 0, 0, 0, 123, 118, 1, 0, 0, 0, 123, 119, 1, 0, 0, 0, 124, 133,
|
|
1038
|
+
1, 0, 0, 0, 125, 126, 10, 12, 0, 0, 126, 127, 3, 20, 10, 0, 127, 128, 3, 16, 8, 13, 128, 132, 1,
|
|
1039
|
+
0, 0, 0, 129, 130, 10, 11, 0, 0, 130, 132, 3, 22, 11, 0, 131, 125, 1, 0, 0, 0, 131, 129, 1, 0, 0,
|
|
1040
|
+
0, 132, 135, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 17, 1, 0, 0, 0, 135, 133,
|
|
1041
|
+
1, 0, 0, 0, 136, 138, 5, 26, 0, 0, 137, 136, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 137, 1, 0, 0,
|
|
1042
|
+
0, 139, 140, 1, 0, 0, 0, 140, 147, 1, 0, 0, 0, 141, 143, 5, 4, 0, 0, 142, 144, 5, 26, 0, 0, 143,
|
|
1043
|
+
142, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 148, 1, 0,
|
|
1044
|
+
0, 0, 147, 141, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 156, 1, 0, 0, 0, 149, 151, 5, 4, 0, 0, 150,
|
|
1045
|
+
152, 5, 26, 0, 0, 151, 150, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 153, 154, 1,
|
|
1046
|
+
0, 0, 0, 154, 156, 1, 0, 0, 0, 155, 137, 1, 0, 0, 0, 155, 149, 1, 0, 0, 0, 156, 19, 1, 0, 0, 0, 157,
|
|
1047
|
+
158, 7, 0, 0, 0, 158, 21, 1, 0, 0, 0, 159, 160, 5, 19, 0, 0, 160, 165, 5, 20, 0, 0, 161, 162, 5,
|
|
1048
|
+
19, 0, 0, 162, 163, 5, 11, 0, 0, 163, 165, 5, 20, 0, 0, 164, 159, 1, 0, 0, 0, 164, 161, 1, 0, 0,
|
|
1049
|
+
0, 165, 23, 1, 0, 0, 0, 166, 171, 3, 26, 13, 0, 167, 168, 5, 4, 0, 0, 168, 170, 3, 26, 13, 0, 169,
|
|
1050
|
+
167, 1, 0, 0, 0, 170, 173, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 25, 1, 0,
|
|
1051
|
+
0, 0, 173, 171, 1, 0, 0, 0, 174, 175, 7, 1, 0, 0, 175, 27, 1, 0, 0, 0, 22, 36, 44, 53, 58, 62, 65,
|
|
1052
|
+
69, 72, 78, 86, 88, 100, 123, 131, 133, 139, 145, 147, 153, 155, 164, 171];
|
|
970
1053
|
static __ATN;
|
|
971
1054
|
static get _ATN() {
|
|
972
1055
|
if (!GenericSqlParser.__ATN) {
|
|
@@ -1133,8 +1216,8 @@ class FieldContext extends antlr4_1.ParserRuleContext {
|
|
|
1133
1216
|
super(parent, invokingState);
|
|
1134
1217
|
this.parser = parser;
|
|
1135
1218
|
}
|
|
1136
|
-
|
|
1137
|
-
return this.getTypedRuleContext(
|
|
1219
|
+
selectField() {
|
|
1220
|
+
return this.getTypedRuleContext(SelectFieldContext, 0);
|
|
1138
1221
|
}
|
|
1139
1222
|
ASTERISK() {
|
|
1140
1223
|
return this.getToken(GenericSqlParser.ASTERISK, 0);
|
|
@@ -1163,6 +1246,44 @@ class FieldContext extends antlr4_1.ParserRuleContext {
|
|
|
1163
1246
|
}
|
|
1164
1247
|
}
|
|
1165
1248
|
exports.FieldContext = FieldContext;
|
|
1249
|
+
class SelectFieldContext extends antlr4_1.ParserRuleContext {
|
|
1250
|
+
constructor(parser, parent, invokingState) {
|
|
1251
|
+
super(parent, invokingState);
|
|
1252
|
+
this.parser = parser;
|
|
1253
|
+
}
|
|
1254
|
+
exp() {
|
|
1255
|
+
return this.getTypedRuleContext(ExpContext, 0);
|
|
1256
|
+
}
|
|
1257
|
+
identifier() {
|
|
1258
|
+
return this.getTypedRuleContext(IdentifierContext, 0);
|
|
1259
|
+
}
|
|
1260
|
+
AS() {
|
|
1261
|
+
return this.getToken(GenericSqlParser.AS, 0);
|
|
1262
|
+
}
|
|
1263
|
+
get ruleIndex() {
|
|
1264
|
+
return GenericSqlParser.RULE_selectField;
|
|
1265
|
+
}
|
|
1266
|
+
enterRule(listener) {
|
|
1267
|
+
if (listener.enterSelectField) {
|
|
1268
|
+
listener.enterSelectField(this);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
exitRule(listener) {
|
|
1272
|
+
if (listener.exitSelectField) {
|
|
1273
|
+
listener.exitSelectField(this);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
// @Override
|
|
1277
|
+
accept(visitor) {
|
|
1278
|
+
if (visitor.visitSelectField) {
|
|
1279
|
+
return visitor.visitSelectField(this);
|
|
1280
|
+
}
|
|
1281
|
+
else {
|
|
1282
|
+
return visitor.visitChildren(this);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
exports.SelectFieldContext = SelectFieldContext;
|
|
1166
1287
|
class AliasFieldContext extends antlr4_1.ParserRuleContext {
|
|
1167
1288
|
constructor(parser, parent, invokingState) {
|
|
1168
1289
|
super(parent, invokingState);
|
|
@@ -1271,6 +1392,9 @@ class ExpContext extends antlr4_1.ParserRuleContext {
|
|
|
1271
1392
|
AS() {
|
|
1272
1393
|
return this.getToken(GenericSqlParser.AS, 0);
|
|
1273
1394
|
}
|
|
1395
|
+
REGEXP() {
|
|
1396
|
+
return this.getToken(GenericSqlParser.REGEXP, 0);
|
|
1397
|
+
}
|
|
1274
1398
|
STRING() {
|
|
1275
1399
|
return this.getToken(GenericSqlParser.STRING, 0);
|
|
1276
1400
|
}
|
|
@@ -1280,6 +1404,9 @@ class ExpContext extends antlr4_1.ParserRuleContext {
|
|
|
1280
1404
|
INDEXED_PARAM() {
|
|
1281
1405
|
return this.getToken(GenericSqlParser.INDEXED_PARAM, 0);
|
|
1282
1406
|
}
|
|
1407
|
+
PARAM_PLACEHOLDER() {
|
|
1408
|
+
return this.getToken(GenericSqlParser.PARAM_PLACEHOLDER, 0);
|
|
1409
|
+
}
|
|
1283
1410
|
binaryOperator() {
|
|
1284
1411
|
return this.getTypedRuleContext(BinaryOperatorContext, 0);
|
|
1285
1412
|
}
|