From 5cf614b24618f72b5bf462ed03718777d538c5eb Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Tue, 3 Jan 2023 22:35:55 +0300 Subject: [PATCH] [Step 2][ESQL] Autocomplete part (#148307) ## Summary Autocomplete support for ESQL lang. Initially target branch for that PR was [elastic:feature-esql](https://github.com/elastic/kibana/tree/feature-esql) but then we decided to merge it separately. This PR is as copy of #148006 ## Notes: Important: please do `yarn kbn clean & yarn kbn bootstrap` before testing. ## How to update syntax. `antlr` syntax was copied from `ES` and was slightly modified. In case if you need to update it please follow next steps: - modify `esql_parser.g4 `and/or `esql_lexer.g4` files - go to `kbn-monaco` package and execute `bazel clean & npm run build:antlr4ts:painless` - go to /painless_parser.ts file and revert the following change: image - do `yarn kbn bootstrap` --- packages/kbn-monaco/index.ts | 3 +- .../kbn-monaco/src/common/error_listener.ts | 5 +- .../kbn-monaco/src/esql/antlr/esql_lexer.g4 | 51 +- .../src/esql/antlr/esql_lexer.interp | 75 +- .../src/esql/antlr/esql_lexer.tokens | 120 +- .../kbn-monaco/src/esql/antlr/esql_lexer.ts | 641 ++++--- .../kbn-monaco/src/esql/antlr/esql_parser.g4 | 60 +- .../src/esql/antlr/esql_parser.interp | 53 +- .../src/esql/antlr/esql_parser.tokens | 120 +- .../kbn-monaco/src/esql/antlr/esql_parser.ts | 1507 +++++++---------- .../src/esql/antlr/esql_parser_listener.ts | 218 +-- packages/kbn-monaco/src/esql/index.ts | 2 +- packages/kbn-monaco/src/esql/language.ts | 9 +- .../kbn-monaco/src/esql/lib/antlr_facade.ts | 13 +- .../comparison_commands.ts | 88 + .../dynamic_commands.ts | 60 + .../functions_commands.ts | 87 + .../autocomplete_definitions/index.ts | 36 + .../operators_commands.ts | 89 + .../ordering_commands.ts | 54 + .../processing_commands.ts | 99 ++ .../source_commands.ts | 31 + .../autocomplete_definitions/utils.ts | 39 + .../autocomplete_listener.test.ts | 109 ++ .../lib/autocomplete/autocomplete_listener.ts | 316 ++++ .../src/esql/lib/autocomplete/dymanic_item.ts | 18 + .../src/esql/lib/autocomplete/types.ts | 32 + .../lib/monaco/esql_completion_provider.ts | 111 ++ .../src/esql/lib/monaco/esql_theme.ts | 77 +- .../kbn-monaco/src/esql/worker/esql_worker.ts | 39 +- packages/kbn-monaco/src/types.ts | 2 +- 31 files changed, 2422 insertions(+), 1742 deletions(-) create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/comparison_commands.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/dynamic_commands.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/functions_commands.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/index.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/operators_commands.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/ordering_commands.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/processing_commands.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/source_commands.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/utils.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_listener.test.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_listener.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/dymanic_item.ts create mode 100644 packages/kbn-monaco/src/esql/lib/autocomplete/types.ts create mode 100644 packages/kbn-monaco/src/esql/lib/monaco/esql_completion_provider.ts diff --git a/packages/kbn-monaco/index.ts b/packages/kbn-monaco/index.ts index 057ea84d0709..d7ff4d4abc94 100644 --- a/packages/kbn-monaco/index.ts +++ b/packages/kbn-monaco/index.ts @@ -11,7 +11,8 @@ import './src/register_globals'; export { monaco } from './src/monaco_imports'; export { XJsonLang } from './src/xjson'; export { SQLLang } from './src/sql'; -export { ESQL_LANG_ID, ESQL_THEME_ID } from './src/esql'; +export { ESQL_LANG_ID, ESQL_THEME_ID, ESQLLang } from './src/esql'; +export type { ESQLCustomAutocompleteCallbacks } from './src/esql'; export * from './src/painless'; /* eslint-disable-next-line @kbn/eslint/module_migration */ diff --git a/packages/kbn-monaco/src/common/error_listener.ts b/packages/kbn-monaco/src/common/error_listener.ts index bc7b56a01646..b072b132b26a 100644 --- a/packages/kbn-monaco/src/common/error_listener.ts +++ b/packages/kbn-monaco/src/common/error_listener.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ANTLRErrorListener, RecognitionException, Recognizer } from 'antlr4ts'; +import { ANTLRErrorListener, Recognizer } from 'antlr4ts'; import type { EditorError } from '../types'; export class ANTLREErrorListener implements ANTLRErrorListener { @@ -17,8 +17,7 @@ export class ANTLREErrorListener implements ANTLRErrorListener { offendingSymbol: any, line: number, column: number, - message: string, - e: RecognitionException | undefined + message: string ): void { let endColumn = column + 1; diff --git a/packages/kbn-monaco/src/esql/antlr/esql_lexer.g4 b/packages/kbn-monaco/src/esql/antlr/esql_lexer.g4 index dd608ac7771e..49d73416712a 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_lexer.g4 +++ b/packages/kbn-monaco/src/esql/antlr/esql_lexer.g4 @@ -29,7 +29,6 @@ WS : [ \r\n\t]+ -> channel(HIDDEN) ; - mode EXPRESSION; PIPE : '|' -> popMode; @@ -73,30 +72,30 @@ DECIMAL_LITERAL BY : 'by'; AND : 'and'; -ASC : 'asc'; ASSIGN : '='; COMMA : ','; -DESC : 'desc'; DOT : '.'; -FALSE : 'false'; -FIRST : 'first'; -LAST : 'last'; LP : '('; OPENING_BRACKET : '[' -> pushMode(DEFAULT_MODE); CLOSING_BRACKET : ']' -> popMode, popMode; // pop twice, once to clear mode of current cmd and once to exit DEFAULT_MODE NOT : 'not'; NULL : 'null'; -NULLS : 'nulls'; OR : 'or'; RP : ')'; -TRUE : 'true'; -EQ : '=='; -NEQ : '!='; -LT : '<'; -LTE : '<='; -GT : '>'; -GTE : '>='; +BOOLEAN_VALUE + : 'true' + | 'false' + ; + +COMPARISON_OPERATOR + : '==' + |'!=' + | '<' + | '<=' + | '>' + | '>=' + ; PLUS : '+'; MINUS : '-'; @@ -104,12 +103,24 @@ ASTERISK : '*'; SLASH : '/'; PERCENT : '%'; -ROUND_FUNCTION_MATH : 'round'; -AVG_FUNCTION_MATH : 'avg'; -SUM_FUNCTION_MATH : 'sum'; -MIN_FUNCTION_MATH : 'min'; -MAX_FUNCTION_MATH : 'max'; +ORDERING + : 'asc' + | 'desc' + ; + +NULLS_ORDERING: 'nulls'; +NULLS_ORDERING_DIRECTION + : 'first' + | 'last' + ; +UNARY_FUNCTION + : 'round' + | 'avg' + | 'min' + | 'max' + | 'sum' + ; UNQUOTED_IDENTIFIER : (LETTER | '_') (LETTER | DIGIT | '_')* @@ -163,5 +174,3 @@ SRC_MULTILINE_COMMENT SRC_WS : WS -> channel(HIDDEN) ; - -UNKNOWN_CMD : ~[ \r\n\t[\]/]+ -> pushMode(EXPRESSION); diff --git a/packages/kbn-monaco/src/esql/antlr/esql_lexer.interp b/packages/kbn-monaco/src/esql/antlr/esql_lexer.interp index 48aad053f07e..a7fee84591c3 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_lexer.interp +++ b/packages/kbn-monaco/src/esql/antlr/esql_lexer.interp @@ -18,39 +18,26 @@ null null 'by' 'and' -'asc' null null -'desc' '.' -'false' -'first' -'last' '(' '[' ']' 'not' 'null' -'nulls' 'or' ')' -'true' -'==' -'!=' -'<' -'<=' -'>' -'>=' +null +null '+' '-' '*' '/' '%' -'round' -'avg' -'sum' -'min' -'max' +null +'nulls' +null null null null @@ -83,39 +70,27 @@ INTEGER_LITERAL DECIMAL_LITERAL BY AND -ASC ASSIGN COMMA -DESC DOT -FALSE -FIRST -LAST LP OPENING_BRACKET CLOSING_BRACKET NOT NULL -NULLS OR RP -TRUE -EQ -NEQ -LT -LTE -GT -GTE +BOOLEAN_VALUE +COMPARISON_OPERATOR PLUS MINUS ASTERISK SLASH PERCENT -ROUND_FUNCTION_MATH -AVG_FUNCTION_MATH -SUM_FUNCTION_MATH -MIN_FUNCTION_MATH -MAX_FUNCTION_MATH +ORDERING +NULLS_ORDERING +NULLS_ORDERING_DIRECTION +UNARY_FUNCTION UNQUOTED_IDENTIFIER QUOTED_IDENTIFIER EXPR_LINE_COMMENT @@ -126,7 +101,6 @@ SRC_QUOTED_IDENTIFIER SRC_LINE_COMMENT SRC_MULTILINE_COMMENT SRC_WS -UNKNOWN_CMD rule names: EVAL @@ -152,39 +126,27 @@ INTEGER_LITERAL DECIMAL_LITERAL BY AND -ASC ASSIGN COMMA -DESC DOT -FALSE -FIRST -LAST LP OPENING_BRACKET CLOSING_BRACKET NOT NULL -NULLS OR RP -TRUE -EQ -NEQ -LT -LTE -GT -GTE +BOOLEAN_VALUE +COMPARISON_OPERATOR PLUS MINUS ASTERISK SLASH PERCENT -ROUND_FUNCTION_MATH -AVG_FUNCTION_MATH -SUM_FUNCTION_MATH -MIN_FUNCTION_MATH -MAX_FUNCTION_MATH +ORDERING +NULLS_ORDERING +NULLS_ORDERING_DIRECTION +UNARY_FUNCTION UNQUOTED_IDENTIFIER QUOTED_IDENTIFIER EXPR_LINE_COMMENT @@ -200,7 +162,6 @@ SRC_QUOTED_IDENTIFIER SRC_LINE_COMMENT SRC_MULTILINE_COMMENT SRC_WS -UNKNOWN_CMD channel names: DEFAULT_TOKEN_CHANNEL @@ -212,4 +173,4 @@ EXPRESSION SOURCE_IDENTIFIERS atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 64, 573, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 225, 10, 11, 12, 11, 14, 11, 228, 11, 11, 3, 11, 5, 11, 231, 10, 11, 3, 11, 5, 11, 234, 10, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 243, 10, 12, 12, 12, 14, 12, 246, 11, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 6, 13, 254, 10, 13, 13, 13, 14, 13, 255, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 5, 19, 275, 10, 19, 3, 19, 6, 19, 278, 10, 19, 13, 19, 14, 19, 279, 3, 20, 3, 20, 3, 20, 7, 20, 285, 10, 20, 12, 20, 14, 20, 288, 11, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 296, 10, 20, 12, 20, 14, 20, 299, 11, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 306, 10, 20, 3, 20, 5, 20, 309, 10, 20, 5, 20, 311, 10, 20, 3, 21, 6, 21, 314, 10, 21, 13, 21, 14, 21, 315, 3, 22, 6, 22, 319, 10, 22, 13, 22, 14, 22, 320, 3, 22, 3, 22, 7, 22, 325, 10, 22, 12, 22, 14, 22, 328, 11, 22, 3, 22, 3, 22, 6, 22, 332, 10, 22, 13, 22, 14, 22, 333, 3, 22, 6, 22, 337, 10, 22, 13, 22, 14, 22, 338, 3, 22, 3, 22, 7, 22, 343, 10, 22, 12, 22, 14, 22, 346, 11, 22, 5, 22, 348, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 6, 22, 354, 10, 22, 13, 22, 14, 22, 355, 3, 22, 3, 22, 5, 22, 360, 10, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 5, 58, 487, 10, 58, 3, 58, 3, 58, 3, 58, 7, 58, 492, 10, 58, 12, 58, 14, 58, 495, 11, 58, 3, 59, 3, 59, 3, 59, 3, 59, 7, 59, 501, 10, 59, 12, 59, 14, 59, 504, 11, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 67, 6, 67, 540, 10, 67, 13, 67, 14, 67, 541, 3, 68, 6, 68, 545, 10, 68, 13, 68, 14, 68, 546, 3, 68, 3, 68, 5, 68, 551, 10, 68, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 6, 73, 568, 10, 73, 13, 73, 14, 73, 569, 3, 73, 3, 73, 4, 244, 297, 2, 2, 74, 5, 2, 3, 7, 2, 4, 9, 2, 5, 11, 2, 6, 13, 2, 7, 15, 2, 8, 17, 2, 9, 19, 2, 10, 21, 2, 11, 23, 2, 12, 25, 2, 13, 27, 2, 14, 29, 2, 15, 31, 2, 2, 33, 2, 2, 35, 2, 2, 37, 2, 2, 39, 2, 2, 41, 2, 16, 43, 2, 17, 45, 2, 18, 47, 2, 19, 49, 2, 20, 51, 2, 21, 53, 2, 22, 55, 2, 23, 57, 2, 24, 59, 2, 25, 61, 2, 26, 63, 2, 27, 65, 2, 28, 67, 2, 29, 69, 2, 30, 71, 2, 31, 73, 2, 32, 75, 2, 33, 77, 2, 34, 79, 2, 35, 81, 2, 36, 83, 2, 37, 85, 2, 38, 87, 2, 39, 89, 2, 40, 91, 2, 41, 93, 2, 42, 95, 2, 43, 97, 2, 44, 99, 2, 45, 101, 2, 46, 103, 2, 47, 105, 2, 48, 107, 2, 49, 109, 2, 50, 111, 2, 51, 113, 2, 52, 115, 2, 53, 117, 2, 54, 119, 2, 55, 121, 2, 56, 123, 2, 57, 125, 2, 58, 127, 2, 2, 129, 2, 2, 131, 2, 2, 133, 2, 2, 135, 2, 59, 137, 2, 2, 139, 2, 60, 141, 2, 61, 143, 2, 62, 145, 2, 63, 147, 2, 64, 5, 2, 3, 4, 14, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 15, 15, 34, 34, 3, 2, 50, 59, 4, 2, 67, 92, 99, 124, 7, 2, 36, 36, 94, 94, 112, 112, 116, 116, 118, 118, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 3, 2, 98, 98, 12, 2, 11, 12, 15, 15, 34, 34, 46, 46, 49, 49, 63, 63, 93, 93, 95, 95, 98, 98, 126, 126, 4, 2, 44, 44, 49, 49, 8, 2, 11, 12, 15, 15, 34, 34, 49, 49, 93, 93, 95, 95, 2, 599, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 3, 29, 3, 2, 2, 2, 3, 41, 3, 2, 2, 2, 3, 43, 3, 2, 2, 2, 3, 45, 3, 2, 2, 2, 3, 47, 3, 2, 2, 2, 3, 49, 3, 2, 2, 2, 3, 51, 3, 2, 2, 2, 3, 53, 3, 2, 2, 2, 3, 55, 3, 2, 2, 2, 3, 57, 3, 2, 2, 2, 3, 59, 3, 2, 2, 2, 3, 61, 3, 2, 2, 2, 3, 63, 3, 2, 2, 2, 3, 65, 3, 2, 2, 2, 3, 67, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 3, 71, 3, 2, 2, 2, 3, 73, 3, 2, 2, 2, 3, 75, 3, 2, 2, 2, 3, 77, 3, 2, 2, 2, 3, 79, 3, 2, 2, 2, 3, 81, 3, 2, 2, 2, 3, 83, 3, 2, 2, 2, 3, 85, 3, 2, 2, 2, 3, 87, 3, 2, 2, 2, 3, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 3, 95, 3, 2, 2, 2, 3, 97, 3, 2, 2, 2, 3, 99, 3, 2, 2, 2, 3, 101, 3, 2, 2, 2, 3, 103, 3, 2, 2, 2, 3, 105, 3, 2, 2, 2, 3, 107, 3, 2, 2, 2, 3, 109, 3, 2, 2, 2, 3, 111, 3, 2, 2, 2, 3, 113, 3, 2, 2, 2, 3, 115, 3, 2, 2, 2, 3, 117, 3, 2, 2, 2, 3, 119, 3, 2, 2, 2, 3, 121, 3, 2, 2, 2, 3, 123, 3, 2, 2, 2, 3, 125, 3, 2, 2, 2, 4, 127, 3, 2, 2, 2, 4, 129, 3, 2, 2, 2, 4, 131, 3, 2, 2, 2, 4, 133, 3, 2, 2, 2, 4, 135, 3, 2, 2, 2, 4, 139, 3, 2, 2, 2, 4, 141, 3, 2, 2, 2, 4, 143, 3, 2, 2, 2, 4, 145, 3, 2, 2, 2, 4, 147, 3, 2, 2, 2, 5, 149, 3, 2, 2, 2, 7, 156, 3, 2, 2, 2, 9, 166, 3, 2, 2, 2, 11, 173, 3, 2, 2, 2, 13, 179, 3, 2, 2, 2, 15, 187, 3, 2, 2, 2, 17, 195, 3, 2, 2, 2, 19, 202, 3, 2, 2, 2, 21, 210, 3, 2, 2, 2, 23, 220, 3, 2, 2, 2, 25, 237, 3, 2, 2, 2, 27, 253, 3, 2, 2, 2, 29, 259, 3, 2, 2, 2, 31, 263, 3, 2, 2, 2, 33, 265, 3, 2, 2, 2, 35, 267, 3, 2, 2, 2, 37, 270, 3, 2, 2, 2, 39, 272, 3, 2, 2, 2, 41, 310, 3, 2, 2, 2, 43, 313, 3, 2, 2, 2, 45, 359, 3, 2, 2, 2, 47, 361, 3, 2, 2, 2, 49, 364, 3, 2, 2, 2, 51, 368, 3, 2, 2, 2, 53, 372, 3, 2, 2, 2, 55, 374, 3, 2, 2, 2, 57, 376, 3, 2, 2, 2, 59, 381, 3, 2, 2, 2, 61, 383, 3, 2, 2, 2, 63, 389, 3, 2, 2, 2, 65, 395, 3, 2, 2, 2, 67, 400, 3, 2, 2, 2, 69, 402, 3, 2, 2, 2, 71, 406, 3, 2, 2, 2, 73, 411, 3, 2, 2, 2, 75, 415, 3, 2, 2, 2, 77, 420, 3, 2, 2, 2, 79, 426, 3, 2, 2, 2, 81, 429, 3, 2, 2, 2, 83, 431, 3, 2, 2, 2, 85, 436, 3, 2, 2, 2, 87, 439, 3, 2, 2, 2, 89, 442, 3, 2, 2, 2, 91, 444, 3, 2, 2, 2, 93, 447, 3, 2, 2, 2, 95, 449, 3, 2, 2, 2, 97, 452, 3, 2, 2, 2, 99, 454, 3, 2, 2, 2, 101, 456, 3, 2, 2, 2, 103, 458, 3, 2, 2, 2, 105, 460, 3, 2, 2, 2, 107, 462, 3, 2, 2, 2, 109, 468, 3, 2, 2, 2, 111, 472, 3, 2, 2, 2, 113, 476, 3, 2, 2, 2, 115, 480, 3, 2, 2, 2, 117, 486, 3, 2, 2, 2, 119, 496, 3, 2, 2, 2, 121, 507, 3, 2, 2, 2, 123, 511, 3, 2, 2, 2, 125, 515, 3, 2, 2, 2, 127, 519, 3, 2, 2, 2, 129, 524, 3, 2, 2, 2, 131, 530, 3, 2, 2, 2, 133, 534, 3, 2, 2, 2, 135, 539, 3, 2, 2, 2, 137, 550, 3, 2, 2, 2, 139, 552, 3, 2, 2, 2, 141, 554, 3, 2, 2, 2, 143, 558, 3, 2, 2, 2, 145, 562, 3, 2, 2, 2, 147, 567, 3, 2, 2, 2, 149, 150, 7, 103, 2, 2, 150, 151, 7, 120, 2, 2, 151, 152, 7, 99, 2, 2, 152, 153, 7, 110, 2, 2, 153, 154, 3, 2, 2, 2, 154, 155, 8, 2, 2, 2, 155, 6, 3, 2, 2, 2, 156, 157, 7, 103, 2, 2, 157, 158, 7, 122, 2, 2, 158, 159, 7, 114, 2, 2, 159, 160, 7, 110, 2, 2, 160, 161, 7, 99, 2, 2, 161, 162, 7, 107, 2, 2, 162, 163, 7, 112, 2, 2, 163, 164, 3, 2, 2, 2, 164, 165, 8, 3, 2, 2, 165, 8, 3, 2, 2, 2, 166, 167, 7, 104, 2, 2, 167, 168, 7, 116, 2, 2, 168, 169, 7, 113, 2, 2, 169, 170, 7, 111, 2, 2, 170, 171, 3, 2, 2, 2, 171, 172, 8, 4, 3, 2, 172, 10, 3, 2, 2, 2, 173, 174, 7, 116, 2, 2, 174, 175, 7, 113, 2, 2, 175, 176, 7, 121, 2, 2, 176, 177, 3, 2, 2, 2, 177, 178, 8, 5, 2, 2, 178, 12, 3, 2, 2, 2, 179, 180, 7, 117, 2, 2, 180, 181, 7, 118, 2, 2, 181, 182, 7, 99, 2, 2, 182, 183, 7, 118, 2, 2, 183, 184, 7, 117, 2, 2, 184, 185, 3, 2, 2, 2, 185, 186, 8, 6, 2, 2, 186, 14, 3, 2, 2, 2, 187, 188, 7, 121, 2, 2, 188, 189, 7, 106, 2, 2, 189, 190, 7, 103, 2, 2, 190, 191, 7, 116, 2, 2, 191, 192, 7, 103, 2, 2, 192, 193, 3, 2, 2, 2, 193, 194, 8, 7, 2, 2, 194, 16, 3, 2, 2, 2, 195, 196, 7, 117, 2, 2, 196, 197, 7, 113, 2, 2, 197, 198, 7, 116, 2, 2, 198, 199, 7, 118, 2, 2, 199, 200, 3, 2, 2, 2, 200, 201, 8, 8, 2, 2, 201, 18, 3, 2, 2, 2, 202, 203, 7, 110, 2, 2, 203, 204, 7, 107, 2, 2, 204, 205, 7, 111, 2, 2, 205, 206, 7, 107, 2, 2, 206, 207, 7, 118, 2, 2, 207, 208, 3, 2, 2, 2, 208, 209, 8, 9, 2, 2, 209, 20, 3, 2, 2, 2, 210, 211, 7, 114, 2, 2, 211, 212, 7, 116, 2, 2, 212, 213, 7, 113, 2, 2, 213, 214, 7, 108, 2, 2, 214, 215, 7, 103, 2, 2, 215, 216, 7, 101, 2, 2, 216, 217, 7, 118, 2, 2, 217, 218, 3, 2, 2, 2, 218, 219, 8, 10, 3, 2, 219, 22, 3, 2, 2, 2, 220, 221, 7, 49, 2, 2, 221, 222, 7, 49, 2, 2, 222, 226, 3, 2, 2, 2, 223, 225, 10, 2, 2, 2, 224, 223, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 230, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 231, 7, 15, 2, 2, 230, 229, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 233, 3, 2, 2, 2, 232, 234, 7, 12, 2, 2, 233, 232, 3, 2, 2, 2, 233, 234, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 236, 8, 11, 4, 2, 236, 24, 3, 2, 2, 2, 237, 238, 7, 49, 2, 2, 238, 239, 7, 44, 2, 2, 239, 244, 3, 2, 2, 2, 240, 243, 5, 25, 12, 2, 241, 243, 11, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 241, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 245, 247, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 247, 248, 7, 44, 2, 2, 248, 249, 7, 49, 2, 2, 249, 250, 3, 2, 2, 2, 250, 251, 8, 12, 4, 2, 251, 26, 3, 2, 2, 2, 252, 254, 9, 3, 2, 2, 253, 252, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 253, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 258, 8, 13, 4, 2, 258, 28, 3, 2, 2, 2, 259, 260, 7, 126, 2, 2, 260, 261, 3, 2, 2, 2, 261, 262, 8, 14, 5, 2, 262, 30, 3, 2, 2, 2, 263, 264, 9, 4, 2, 2, 264, 32, 3, 2, 2, 2, 265, 266, 9, 5, 2, 2, 266, 34, 3, 2, 2, 2, 267, 268, 7, 94, 2, 2, 268, 269, 9, 6, 2, 2, 269, 36, 3, 2, 2, 2, 270, 271, 10, 7, 2, 2, 271, 38, 3, 2, 2, 2, 272, 274, 9, 8, 2, 2, 273, 275, 9, 9, 2, 2, 274, 273, 3, 2, 2, 2, 274, 275, 3, 2, 2, 2, 275, 277, 3, 2, 2, 2, 276, 278, 5, 31, 15, 2, 277, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 40, 3, 2, 2, 2, 281, 286, 7, 36, 2, 2, 282, 285, 5, 35, 17, 2, 283, 285, 5, 37, 18, 2, 284, 282, 3, 2, 2, 2, 284, 283, 3, 2, 2, 2, 285, 288, 3, 2, 2, 2, 286, 284, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 289, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 289, 311, 7, 36, 2, 2, 290, 291, 7, 36, 2, 2, 291, 292, 7, 36, 2, 2, 292, 293, 7, 36, 2, 2, 293, 297, 3, 2, 2, 2, 294, 296, 10, 2, 2, 2, 295, 294, 3, 2, 2, 2, 296, 299, 3, 2, 2, 2, 297, 298, 3, 2, 2, 2, 297, 295, 3, 2, 2, 2, 298, 300, 3, 2, 2, 2, 299, 297, 3, 2, 2, 2, 300, 301, 7, 36, 2, 2, 301, 302, 7, 36, 2, 2, 302, 303, 7, 36, 2, 2, 303, 305, 3, 2, 2, 2, 304, 306, 7, 36, 2, 2, 305, 304, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 308, 3, 2, 2, 2, 307, 309, 7, 36, 2, 2, 308, 307, 3, 2, 2, 2, 308, 309, 3, 2, 2, 2, 309, 311, 3, 2, 2, 2, 310, 281, 3, 2, 2, 2, 310, 290, 3, 2, 2, 2, 311, 42, 3, 2, 2, 2, 312, 314, 5, 31, 15, 2, 313, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 313, 3, 2, 2, 2, 315, 316, 3, 2, 2, 2, 316, 44, 3, 2, 2, 2, 317, 319, 5, 31, 15, 2, 318, 317, 3, 2, 2, 2, 319, 320, 3, 2, 2, 2, 320, 318, 3, 2, 2, 2, 320, 321, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 326, 5, 59, 29, 2, 323, 325, 5, 31, 15, 2, 324, 323, 3, 2, 2, 2, 325, 328, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 360, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 329, 331, 5, 59, 29, 2, 330, 332, 5, 31, 15, 2, 331, 330, 3, 2, 2, 2, 332, 333, 3, 2, 2, 2, 333, 331, 3, 2, 2, 2, 333, 334, 3, 2, 2, 2, 334, 360, 3, 2, 2, 2, 335, 337, 5, 31, 15, 2, 336, 335, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 336, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 347, 3, 2, 2, 2, 340, 344, 5, 59, 29, 2, 341, 343, 5, 31, 15, 2, 342, 341, 3, 2, 2, 2, 343, 346, 3, 2, 2, 2, 344, 342, 3, 2, 2, 2, 344, 345, 3, 2, 2, 2, 345, 348, 3, 2, 2, 2, 346, 344, 3, 2, 2, 2, 347, 340, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 5, 39, 19, 2, 350, 360, 3, 2, 2, 2, 351, 353, 5, 59, 29, 2, 352, 354, 5, 31, 15, 2, 353, 352, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 353, 3, 2, 2, 2, 355, 356, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 358, 5, 39, 19, 2, 358, 360, 3, 2, 2, 2, 359, 318, 3, 2, 2, 2, 359, 329, 3, 2, 2, 2, 359, 336, 3, 2, 2, 2, 359, 351, 3, 2, 2, 2, 360, 46, 3, 2, 2, 2, 361, 362, 7, 100, 2, 2, 362, 363, 7, 123, 2, 2, 363, 48, 3, 2, 2, 2, 364, 365, 7, 99, 2, 2, 365, 366, 7, 112, 2, 2, 366, 367, 7, 102, 2, 2, 367, 50, 3, 2, 2, 2, 368, 369, 7, 99, 2, 2, 369, 370, 7, 117, 2, 2, 370, 371, 7, 101, 2, 2, 371, 52, 3, 2, 2, 2, 372, 373, 7, 63, 2, 2, 373, 54, 3, 2, 2, 2, 374, 375, 7, 46, 2, 2, 375, 56, 3, 2, 2, 2, 376, 377, 7, 102, 2, 2, 377, 378, 7, 103, 2, 2, 378, 379, 7, 117, 2, 2, 379, 380, 7, 101, 2, 2, 380, 58, 3, 2, 2, 2, 381, 382, 7, 48, 2, 2, 382, 60, 3, 2, 2, 2, 383, 384, 7, 104, 2, 2, 384, 385, 7, 99, 2, 2, 385, 386, 7, 110, 2, 2, 386, 387, 7, 117, 2, 2, 387, 388, 7, 103, 2, 2, 388, 62, 3, 2, 2, 2, 389, 390, 7, 104, 2, 2, 390, 391, 7, 107, 2, 2, 391, 392, 7, 116, 2, 2, 392, 393, 7, 117, 2, 2, 393, 394, 7, 118, 2, 2, 394, 64, 3, 2, 2, 2, 395, 396, 7, 110, 2, 2, 396, 397, 7, 99, 2, 2, 397, 398, 7, 117, 2, 2, 398, 399, 7, 118, 2, 2, 399, 66, 3, 2, 2, 2, 400, 401, 7, 42, 2, 2, 401, 68, 3, 2, 2, 2, 402, 403, 7, 93, 2, 2, 403, 404, 3, 2, 2, 2, 404, 405, 8, 34, 6, 2, 405, 70, 3, 2, 2, 2, 406, 407, 7, 95, 2, 2, 407, 408, 3, 2, 2, 2, 408, 409, 8, 35, 5, 2, 409, 410, 8, 35, 5, 2, 410, 72, 3, 2, 2, 2, 411, 412, 7, 112, 2, 2, 412, 413, 7, 113, 2, 2, 413, 414, 7, 118, 2, 2, 414, 74, 3, 2, 2, 2, 415, 416, 7, 112, 2, 2, 416, 417, 7, 119, 2, 2, 417, 418, 7, 110, 2, 2, 418, 419, 7, 110, 2, 2, 419, 76, 3, 2, 2, 2, 420, 421, 7, 112, 2, 2, 421, 422, 7, 119, 2, 2, 422, 423, 7, 110, 2, 2, 423, 424, 7, 110, 2, 2, 424, 425, 7, 117, 2, 2, 425, 78, 3, 2, 2, 2, 426, 427, 7, 113, 2, 2, 427, 428, 7, 116, 2, 2, 428, 80, 3, 2, 2, 2, 429, 430, 7, 43, 2, 2, 430, 82, 3, 2, 2, 2, 431, 432, 7, 118, 2, 2, 432, 433, 7, 116, 2, 2, 433, 434, 7, 119, 2, 2, 434, 435, 7, 103, 2, 2, 435, 84, 3, 2, 2, 2, 436, 437, 7, 63, 2, 2, 437, 438, 7, 63, 2, 2, 438, 86, 3, 2, 2, 2, 439, 440, 7, 35, 2, 2, 440, 441, 7, 63, 2, 2, 441, 88, 3, 2, 2, 2, 442, 443, 7, 62, 2, 2, 443, 90, 3, 2, 2, 2, 444, 445, 7, 62, 2, 2, 445, 446, 7, 63, 2, 2, 446, 92, 3, 2, 2, 2, 447, 448, 7, 64, 2, 2, 448, 94, 3, 2, 2, 2, 449, 450, 7, 64, 2, 2, 450, 451, 7, 63, 2, 2, 451, 96, 3, 2, 2, 2, 452, 453, 7, 45, 2, 2, 453, 98, 3, 2, 2, 2, 454, 455, 7, 47, 2, 2, 455, 100, 3, 2, 2, 2, 456, 457, 7, 44, 2, 2, 457, 102, 3, 2, 2, 2, 458, 459, 7, 49, 2, 2, 459, 104, 3, 2, 2, 2, 460, 461, 7, 39, 2, 2, 461, 106, 3, 2, 2, 2, 462, 463, 7, 116, 2, 2, 463, 464, 7, 113, 2, 2, 464, 465, 7, 119, 2, 2, 465, 466, 7, 112, 2, 2, 466, 467, 7, 102, 2, 2, 467, 108, 3, 2, 2, 2, 468, 469, 7, 99, 2, 2, 469, 470, 7, 120, 2, 2, 470, 471, 7, 105, 2, 2, 471, 110, 3, 2, 2, 2, 472, 473, 7, 117, 2, 2, 473, 474, 7, 119, 2, 2, 474, 475, 7, 111, 2, 2, 475, 112, 3, 2, 2, 2, 476, 477, 7, 111, 2, 2, 477, 478, 7, 107, 2, 2, 478, 479, 7, 112, 2, 2, 479, 114, 3, 2, 2, 2, 480, 481, 7, 111, 2, 2, 481, 482, 7, 99, 2, 2, 482, 483, 7, 122, 2, 2, 483, 116, 3, 2, 2, 2, 484, 487, 5, 33, 16, 2, 485, 487, 7, 97, 2, 2, 486, 484, 3, 2, 2, 2, 486, 485, 3, 2, 2, 2, 487, 493, 3, 2, 2, 2, 488, 492, 5, 33, 16, 2, 489, 492, 5, 31, 15, 2, 490, 492, 7, 97, 2, 2, 491, 488, 3, 2, 2, 2, 491, 489, 3, 2, 2, 2, 491, 490, 3, 2, 2, 2, 492, 495, 3, 2, 2, 2, 493, 491, 3, 2, 2, 2, 493, 494, 3, 2, 2, 2, 494, 118, 3, 2, 2, 2, 495, 493, 3, 2, 2, 2, 496, 502, 7, 98, 2, 2, 497, 501, 10, 10, 2, 2, 498, 499, 7, 98, 2, 2, 499, 501, 7, 98, 2, 2, 500, 497, 3, 2, 2, 2, 500, 498, 3, 2, 2, 2, 501, 504, 3, 2, 2, 2, 502, 500, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 505, 3, 2, 2, 2, 504, 502, 3, 2, 2, 2, 505, 506, 7, 98, 2, 2, 506, 120, 3, 2, 2, 2, 507, 508, 5, 23, 11, 2, 508, 509, 3, 2, 2, 2, 509, 510, 8, 60, 4, 2, 510, 122, 3, 2, 2, 2, 511, 512, 5, 25, 12, 2, 512, 513, 3, 2, 2, 2, 513, 514, 8, 61, 4, 2, 514, 124, 3, 2, 2, 2, 515, 516, 5, 27, 13, 2, 516, 517, 3, 2, 2, 2, 517, 518, 8, 62, 4, 2, 518, 126, 3, 2, 2, 2, 519, 520, 7, 126, 2, 2, 520, 521, 3, 2, 2, 2, 521, 522, 8, 63, 7, 2, 522, 523, 8, 63, 5, 2, 523, 128, 3, 2, 2, 2, 524, 525, 7, 95, 2, 2, 525, 526, 3, 2, 2, 2, 526, 527, 8, 64, 5, 2, 527, 528, 8, 64, 5, 2, 528, 529, 8, 64, 8, 2, 529, 130, 3, 2, 2, 2, 530, 531, 7, 46, 2, 2, 531, 532, 3, 2, 2, 2, 532, 533, 8, 65, 9, 2, 533, 132, 3, 2, 2, 2, 534, 535, 7, 63, 2, 2, 535, 536, 3, 2, 2, 2, 536, 537, 8, 66, 10, 2, 537, 134, 3, 2, 2, 2, 538, 540, 5, 137, 68, 2, 539, 538, 3, 2, 2, 2, 540, 541, 3, 2, 2, 2, 541, 539, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 136, 3, 2, 2, 2, 543, 545, 10, 11, 2, 2, 544, 543, 3, 2, 2, 2, 545, 546, 3, 2, 2, 2, 546, 544, 3, 2, 2, 2, 546, 547, 3, 2, 2, 2, 547, 551, 3, 2, 2, 2, 548, 549, 7, 49, 2, 2, 549, 551, 10, 12, 2, 2, 550, 544, 3, 2, 2, 2, 550, 548, 3, 2, 2, 2, 551, 138, 3, 2, 2, 2, 552, 553, 5, 119, 59, 2, 553, 140, 3, 2, 2, 2, 554, 555, 5, 23, 11, 2, 555, 556, 3, 2, 2, 2, 556, 557, 8, 70, 4, 2, 557, 142, 3, 2, 2, 2, 558, 559, 5, 25, 12, 2, 559, 560, 3, 2, 2, 2, 560, 561, 8, 71, 4, 2, 561, 144, 3, 2, 2, 2, 562, 563, 5, 27, 13, 2, 563, 564, 3, 2, 2, 2, 564, 565, 8, 72, 4, 2, 565, 146, 3, 2, 2, 2, 566, 568, 10, 13, 2, 2, 567, 566, 3, 2, 2, 2, 568, 569, 3, 2, 2, 2, 569, 567, 3, 2, 2, 2, 569, 570, 3, 2, 2, 2, 570, 571, 3, 2, 2, 2, 571, 572, 8, 73, 2, 2, 572, 148, 3, 2, 2, 2, 37, 2, 3, 4, 226, 230, 233, 242, 244, 255, 274, 279, 284, 286, 297, 305, 308, 310, 315, 320, 326, 333, 338, 344, 347, 355, 359, 486, 491, 493, 500, 502, 541, 546, 550, 569, 11, 7, 3, 2, 7, 4, 2, 2, 3, 2, 6, 2, 2, 7, 2, 2, 9, 15, 2, 9, 31, 2, 9, 23, 2, 9, 22, 2] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 51, 533, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 199, 10, 11, 12, 11, 14, 11, 202, 11, 11, 3, 11, 5, 11, 205, 10, 11, 3, 11, 5, 11, 208, 10, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 217, 10, 12, 12, 12, 14, 12, 220, 11, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 6, 13, 228, 10, 13, 13, 13, 14, 13, 229, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 5, 19, 249, 10, 19, 3, 19, 6, 19, 252, 10, 19, 13, 19, 14, 19, 253, 3, 20, 3, 20, 3, 20, 7, 20, 259, 10, 20, 12, 20, 14, 20, 262, 11, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 270, 10, 20, 12, 20, 14, 20, 273, 11, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 280, 10, 20, 3, 20, 5, 20, 283, 10, 20, 5, 20, 285, 10, 20, 3, 21, 6, 21, 288, 10, 21, 13, 21, 14, 21, 289, 3, 22, 6, 22, 293, 10, 22, 13, 22, 14, 22, 294, 3, 22, 3, 22, 7, 22, 299, 10, 22, 12, 22, 14, 22, 302, 11, 22, 3, 22, 3, 22, 6, 22, 306, 10, 22, 13, 22, 14, 22, 307, 3, 22, 6, 22, 311, 10, 22, 13, 22, 14, 22, 312, 3, 22, 3, 22, 7, 22, 317, 10, 22, 12, 22, 14, 22, 320, 11, 22, 5, 22, 322, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 6, 22, 328, 10, 22, 13, 22, 14, 22, 329, 3, 22, 3, 22, 5, 22, 334, 10, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 383, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 395, 10, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 5, 42, 414, 10, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 5, 44, 431, 10, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 5, 45, 450, 10, 45, 3, 46, 3, 46, 5, 46, 454, 10, 46, 3, 46, 3, 46, 3, 46, 7, 46, 459, 10, 46, 12, 46, 14, 46, 462, 11, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 468, 10, 47, 12, 47, 14, 47, 471, 11, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 6, 55, 507, 10, 55, 13, 55, 14, 55, 508, 3, 56, 6, 56, 512, 10, 56, 13, 56, 14, 56, 513, 3, 56, 3, 56, 5, 56, 518, 10, 56, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 4, 218, 271, 2, 2, 61, 5, 2, 3, 7, 2, 4, 9, 2, 5, 11, 2, 6, 13, 2, 7, 15, 2, 8, 17, 2, 9, 19, 2, 10, 21, 2, 11, 23, 2, 12, 25, 2, 13, 27, 2, 14, 29, 2, 15, 31, 2, 2, 33, 2, 2, 35, 2, 2, 37, 2, 2, 39, 2, 2, 41, 2, 16, 43, 2, 17, 45, 2, 18, 47, 2, 19, 49, 2, 20, 51, 2, 21, 53, 2, 22, 55, 2, 23, 57, 2, 24, 59, 2, 25, 61, 2, 26, 63, 2, 27, 65, 2, 28, 67, 2, 29, 69, 2, 30, 71, 2, 31, 73, 2, 32, 75, 2, 33, 77, 2, 34, 79, 2, 35, 81, 2, 36, 83, 2, 37, 85, 2, 38, 87, 2, 39, 89, 2, 40, 91, 2, 41, 93, 2, 42, 95, 2, 43, 97, 2, 44, 99, 2, 45, 101, 2, 46, 103, 2, 2, 105, 2, 2, 107, 2, 2, 109, 2, 2, 111, 2, 47, 113, 2, 2, 115, 2, 48, 117, 2, 49, 119, 2, 50, 121, 2, 51, 5, 2, 3, 4, 13, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 15, 15, 34, 34, 3, 2, 50, 59, 4, 2, 67, 92, 99, 124, 7, 2, 36, 36, 94, 94, 112, 112, 116, 116, 118, 118, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 3, 2, 98, 98, 12, 2, 11, 12, 15, 15, 34, 34, 46, 46, 49, 49, 63, 63, 93, 93, 95, 95, 98, 98, 126, 126, 4, 2, 44, 44, 49, 49, 2, 570, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 3, 29, 3, 2, 2, 2, 3, 41, 3, 2, 2, 2, 3, 43, 3, 2, 2, 2, 3, 45, 3, 2, 2, 2, 3, 47, 3, 2, 2, 2, 3, 49, 3, 2, 2, 2, 3, 51, 3, 2, 2, 2, 3, 53, 3, 2, 2, 2, 3, 55, 3, 2, 2, 2, 3, 57, 3, 2, 2, 2, 3, 59, 3, 2, 2, 2, 3, 61, 3, 2, 2, 2, 3, 63, 3, 2, 2, 2, 3, 65, 3, 2, 2, 2, 3, 67, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 3, 71, 3, 2, 2, 2, 3, 73, 3, 2, 2, 2, 3, 75, 3, 2, 2, 2, 3, 77, 3, 2, 2, 2, 3, 79, 3, 2, 2, 2, 3, 81, 3, 2, 2, 2, 3, 83, 3, 2, 2, 2, 3, 85, 3, 2, 2, 2, 3, 87, 3, 2, 2, 2, 3, 89, 3, 2, 2, 2, 3, 91, 3, 2, 2, 2, 3, 93, 3, 2, 2, 2, 3, 95, 3, 2, 2, 2, 3, 97, 3, 2, 2, 2, 3, 99, 3, 2, 2, 2, 3, 101, 3, 2, 2, 2, 4, 103, 3, 2, 2, 2, 4, 105, 3, 2, 2, 2, 4, 107, 3, 2, 2, 2, 4, 109, 3, 2, 2, 2, 4, 111, 3, 2, 2, 2, 4, 115, 3, 2, 2, 2, 4, 117, 3, 2, 2, 2, 4, 119, 3, 2, 2, 2, 4, 121, 3, 2, 2, 2, 5, 123, 3, 2, 2, 2, 7, 130, 3, 2, 2, 2, 9, 140, 3, 2, 2, 2, 11, 147, 3, 2, 2, 2, 13, 153, 3, 2, 2, 2, 15, 161, 3, 2, 2, 2, 17, 169, 3, 2, 2, 2, 19, 176, 3, 2, 2, 2, 21, 184, 3, 2, 2, 2, 23, 194, 3, 2, 2, 2, 25, 211, 3, 2, 2, 2, 27, 227, 3, 2, 2, 2, 29, 233, 3, 2, 2, 2, 31, 237, 3, 2, 2, 2, 33, 239, 3, 2, 2, 2, 35, 241, 3, 2, 2, 2, 37, 244, 3, 2, 2, 2, 39, 246, 3, 2, 2, 2, 41, 284, 3, 2, 2, 2, 43, 287, 3, 2, 2, 2, 45, 333, 3, 2, 2, 2, 47, 335, 3, 2, 2, 2, 49, 338, 3, 2, 2, 2, 51, 342, 3, 2, 2, 2, 53, 344, 3, 2, 2, 2, 55, 346, 3, 2, 2, 2, 57, 348, 3, 2, 2, 2, 59, 350, 3, 2, 2, 2, 61, 354, 3, 2, 2, 2, 63, 359, 3, 2, 2, 2, 65, 363, 3, 2, 2, 2, 67, 368, 3, 2, 2, 2, 69, 371, 3, 2, 2, 2, 71, 382, 3, 2, 2, 2, 73, 394, 3, 2, 2, 2, 75, 396, 3, 2, 2, 2, 77, 398, 3, 2, 2, 2, 79, 400, 3, 2, 2, 2, 81, 402, 3, 2, 2, 2, 83, 404, 3, 2, 2, 2, 85, 413, 3, 2, 2, 2, 87, 415, 3, 2, 2, 2, 89, 430, 3, 2, 2, 2, 91, 449, 3, 2, 2, 2, 93, 453, 3, 2, 2, 2, 95, 463, 3, 2, 2, 2, 97, 474, 3, 2, 2, 2, 99, 478, 3, 2, 2, 2, 101, 482, 3, 2, 2, 2, 103, 486, 3, 2, 2, 2, 105, 491, 3, 2, 2, 2, 107, 497, 3, 2, 2, 2, 109, 501, 3, 2, 2, 2, 111, 506, 3, 2, 2, 2, 113, 517, 3, 2, 2, 2, 115, 519, 3, 2, 2, 2, 117, 521, 3, 2, 2, 2, 119, 525, 3, 2, 2, 2, 121, 529, 3, 2, 2, 2, 123, 124, 7, 103, 2, 2, 124, 125, 7, 120, 2, 2, 125, 126, 7, 99, 2, 2, 126, 127, 7, 110, 2, 2, 127, 128, 3, 2, 2, 2, 128, 129, 8, 2, 2, 2, 129, 6, 3, 2, 2, 2, 130, 131, 7, 103, 2, 2, 131, 132, 7, 122, 2, 2, 132, 133, 7, 114, 2, 2, 133, 134, 7, 110, 2, 2, 134, 135, 7, 99, 2, 2, 135, 136, 7, 107, 2, 2, 136, 137, 7, 112, 2, 2, 137, 138, 3, 2, 2, 2, 138, 139, 8, 3, 2, 2, 139, 8, 3, 2, 2, 2, 140, 141, 7, 104, 2, 2, 141, 142, 7, 116, 2, 2, 142, 143, 7, 113, 2, 2, 143, 144, 7, 111, 2, 2, 144, 145, 3, 2, 2, 2, 145, 146, 8, 4, 3, 2, 146, 10, 3, 2, 2, 2, 147, 148, 7, 116, 2, 2, 148, 149, 7, 113, 2, 2, 149, 150, 7, 121, 2, 2, 150, 151, 3, 2, 2, 2, 151, 152, 8, 5, 2, 2, 152, 12, 3, 2, 2, 2, 153, 154, 7, 117, 2, 2, 154, 155, 7, 118, 2, 2, 155, 156, 7, 99, 2, 2, 156, 157, 7, 118, 2, 2, 157, 158, 7, 117, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 8, 6, 2, 2, 160, 14, 3, 2, 2, 2, 161, 162, 7, 121, 2, 2, 162, 163, 7, 106, 2, 2, 163, 164, 7, 103, 2, 2, 164, 165, 7, 116, 2, 2, 165, 166, 7, 103, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 8, 7, 2, 2, 168, 16, 3, 2, 2, 2, 169, 170, 7, 117, 2, 2, 170, 171, 7, 113, 2, 2, 171, 172, 7, 116, 2, 2, 172, 173, 7, 118, 2, 2, 173, 174, 3, 2, 2, 2, 174, 175, 8, 8, 2, 2, 175, 18, 3, 2, 2, 2, 176, 177, 7, 110, 2, 2, 177, 178, 7, 107, 2, 2, 178, 179, 7, 111, 2, 2, 179, 180, 7, 107, 2, 2, 180, 181, 7, 118, 2, 2, 181, 182, 3, 2, 2, 2, 182, 183, 8, 9, 2, 2, 183, 20, 3, 2, 2, 2, 184, 185, 7, 114, 2, 2, 185, 186, 7, 116, 2, 2, 186, 187, 7, 113, 2, 2, 187, 188, 7, 108, 2, 2, 188, 189, 7, 103, 2, 2, 189, 190, 7, 101, 2, 2, 190, 191, 7, 118, 2, 2, 191, 192, 3, 2, 2, 2, 192, 193, 8, 10, 3, 2, 193, 22, 3, 2, 2, 2, 194, 195, 7, 49, 2, 2, 195, 196, 7, 49, 2, 2, 196, 200, 3, 2, 2, 2, 197, 199, 10, 2, 2, 2, 198, 197, 3, 2, 2, 2, 199, 202, 3, 2, 2, 2, 200, 198, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 204, 3, 2, 2, 2, 202, 200, 3, 2, 2, 2, 203, 205, 7, 15, 2, 2, 204, 203, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 207, 3, 2, 2, 2, 206, 208, 7, 12, 2, 2, 207, 206, 3, 2, 2, 2, 207, 208, 3, 2, 2, 2, 208, 209, 3, 2, 2, 2, 209, 210, 8, 11, 4, 2, 210, 24, 3, 2, 2, 2, 211, 212, 7, 49, 2, 2, 212, 213, 7, 44, 2, 2, 213, 218, 3, 2, 2, 2, 214, 217, 5, 25, 12, 2, 215, 217, 11, 2, 2, 2, 216, 214, 3, 2, 2, 2, 216, 215, 3, 2, 2, 2, 217, 220, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 219, 221, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 221, 222, 7, 44, 2, 2, 222, 223, 7, 49, 2, 2, 223, 224, 3, 2, 2, 2, 224, 225, 8, 12, 4, 2, 225, 26, 3, 2, 2, 2, 226, 228, 9, 3, 2, 2, 227, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 229, 230, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 232, 8, 13, 4, 2, 232, 28, 3, 2, 2, 2, 233, 234, 7, 126, 2, 2, 234, 235, 3, 2, 2, 2, 235, 236, 8, 14, 5, 2, 236, 30, 3, 2, 2, 2, 237, 238, 9, 4, 2, 2, 238, 32, 3, 2, 2, 2, 239, 240, 9, 5, 2, 2, 240, 34, 3, 2, 2, 2, 241, 242, 7, 94, 2, 2, 242, 243, 9, 6, 2, 2, 243, 36, 3, 2, 2, 2, 244, 245, 10, 7, 2, 2, 245, 38, 3, 2, 2, 2, 246, 248, 9, 8, 2, 2, 247, 249, 9, 9, 2, 2, 248, 247, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 251, 3, 2, 2, 2, 250, 252, 5, 31, 15, 2, 251, 250, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 251, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 40, 3, 2, 2, 2, 255, 260, 7, 36, 2, 2, 256, 259, 5, 35, 17, 2, 257, 259, 5, 37, 18, 2, 258, 256, 3, 2, 2, 2, 258, 257, 3, 2, 2, 2, 259, 262, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 263, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 263, 285, 7, 36, 2, 2, 264, 265, 7, 36, 2, 2, 265, 266, 7, 36, 2, 2, 266, 267, 7, 36, 2, 2, 267, 271, 3, 2, 2, 2, 268, 270, 10, 2, 2, 2, 269, 268, 3, 2, 2, 2, 270, 273, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 272, 274, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 274, 275, 7, 36, 2, 2, 275, 276, 7, 36, 2, 2, 276, 277, 7, 36, 2, 2, 277, 279, 3, 2, 2, 2, 278, 280, 7, 36, 2, 2, 279, 278, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 282, 3, 2, 2, 2, 281, 283, 7, 36, 2, 2, 282, 281, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 285, 3, 2, 2, 2, 284, 255, 3, 2, 2, 2, 284, 264, 3, 2, 2, 2, 285, 42, 3, 2, 2, 2, 286, 288, 5, 31, 15, 2, 287, 286, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 44, 3, 2, 2, 2, 291, 293, 5, 31, 15, 2, 292, 291, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 294, 295, 3, 2, 2, 2, 295, 296, 3, 2, 2, 2, 296, 300, 5, 55, 27, 2, 297, 299, 5, 31, 15, 2, 298, 297, 3, 2, 2, 2, 299, 302, 3, 2, 2, 2, 300, 298, 3, 2, 2, 2, 300, 301, 3, 2, 2, 2, 301, 334, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 303, 305, 5, 55, 27, 2, 304, 306, 5, 31, 15, 2, 305, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 334, 3, 2, 2, 2, 309, 311, 5, 31, 15, 2, 310, 309, 3, 2, 2, 2, 311, 312, 3, 2, 2, 2, 312, 310, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 321, 3, 2, 2, 2, 314, 318, 5, 55, 27, 2, 315, 317, 5, 31, 15, 2, 316, 315, 3, 2, 2, 2, 317, 320, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 319, 322, 3, 2, 2, 2, 320, 318, 3, 2, 2, 2, 321, 314, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 324, 5, 39, 19, 2, 324, 334, 3, 2, 2, 2, 325, 327, 5, 55, 27, 2, 326, 328, 5, 31, 15, 2, 327, 326, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 327, 3, 2, 2, 2, 329, 330, 3, 2, 2, 2, 330, 331, 3, 2, 2, 2, 331, 332, 5, 39, 19, 2, 332, 334, 3, 2, 2, 2, 333, 292, 3, 2, 2, 2, 333, 303, 3, 2, 2, 2, 333, 310, 3, 2, 2, 2, 333, 325, 3, 2, 2, 2, 334, 46, 3, 2, 2, 2, 335, 336, 7, 100, 2, 2, 336, 337, 7, 123, 2, 2, 337, 48, 3, 2, 2, 2, 338, 339, 7, 99, 2, 2, 339, 340, 7, 112, 2, 2, 340, 341, 7, 102, 2, 2, 341, 50, 3, 2, 2, 2, 342, 343, 7, 63, 2, 2, 343, 52, 3, 2, 2, 2, 344, 345, 7, 46, 2, 2, 345, 54, 3, 2, 2, 2, 346, 347, 7, 48, 2, 2, 347, 56, 3, 2, 2, 2, 348, 349, 7, 42, 2, 2, 349, 58, 3, 2, 2, 2, 350, 351, 7, 93, 2, 2, 351, 352, 3, 2, 2, 2, 352, 353, 8, 29, 6, 2, 353, 60, 3, 2, 2, 2, 354, 355, 7, 95, 2, 2, 355, 356, 3, 2, 2, 2, 356, 357, 8, 30, 5, 2, 357, 358, 8, 30, 5, 2, 358, 62, 3, 2, 2, 2, 359, 360, 7, 112, 2, 2, 360, 361, 7, 113, 2, 2, 361, 362, 7, 118, 2, 2, 362, 64, 3, 2, 2, 2, 363, 364, 7, 112, 2, 2, 364, 365, 7, 119, 2, 2, 365, 366, 7, 110, 2, 2, 366, 367, 7, 110, 2, 2, 367, 66, 3, 2, 2, 2, 368, 369, 7, 113, 2, 2, 369, 370, 7, 116, 2, 2, 370, 68, 3, 2, 2, 2, 371, 372, 7, 43, 2, 2, 372, 70, 3, 2, 2, 2, 373, 374, 7, 118, 2, 2, 374, 375, 7, 116, 2, 2, 375, 376, 7, 119, 2, 2, 376, 383, 7, 103, 2, 2, 377, 378, 7, 104, 2, 2, 378, 379, 7, 99, 2, 2, 379, 380, 7, 110, 2, 2, 380, 381, 7, 117, 2, 2, 381, 383, 7, 103, 2, 2, 382, 373, 3, 2, 2, 2, 382, 377, 3, 2, 2, 2, 383, 72, 3, 2, 2, 2, 384, 385, 7, 63, 2, 2, 385, 395, 7, 63, 2, 2, 386, 387, 7, 35, 2, 2, 387, 395, 7, 63, 2, 2, 388, 395, 7, 62, 2, 2, 389, 390, 7, 62, 2, 2, 390, 395, 7, 63, 2, 2, 391, 395, 7, 64, 2, 2, 392, 393, 7, 64, 2, 2, 393, 395, 7, 63, 2, 2, 394, 384, 3, 2, 2, 2, 394, 386, 3, 2, 2, 2, 394, 388, 3, 2, 2, 2, 394, 389, 3, 2, 2, 2, 394, 391, 3, 2, 2, 2, 394, 392, 3, 2, 2, 2, 395, 74, 3, 2, 2, 2, 396, 397, 7, 45, 2, 2, 397, 76, 3, 2, 2, 2, 398, 399, 7, 47, 2, 2, 399, 78, 3, 2, 2, 2, 400, 401, 7, 44, 2, 2, 401, 80, 3, 2, 2, 2, 402, 403, 7, 49, 2, 2, 403, 82, 3, 2, 2, 2, 404, 405, 7, 39, 2, 2, 405, 84, 3, 2, 2, 2, 406, 407, 7, 99, 2, 2, 407, 408, 7, 117, 2, 2, 408, 414, 7, 101, 2, 2, 409, 410, 7, 102, 2, 2, 410, 411, 7, 103, 2, 2, 411, 412, 7, 117, 2, 2, 412, 414, 7, 101, 2, 2, 413, 406, 3, 2, 2, 2, 413, 409, 3, 2, 2, 2, 414, 86, 3, 2, 2, 2, 415, 416, 7, 112, 2, 2, 416, 417, 7, 119, 2, 2, 417, 418, 7, 110, 2, 2, 418, 419, 7, 110, 2, 2, 419, 420, 7, 117, 2, 2, 420, 88, 3, 2, 2, 2, 421, 422, 7, 104, 2, 2, 422, 423, 7, 107, 2, 2, 423, 424, 7, 116, 2, 2, 424, 425, 7, 117, 2, 2, 425, 431, 7, 118, 2, 2, 426, 427, 7, 110, 2, 2, 427, 428, 7, 99, 2, 2, 428, 429, 7, 117, 2, 2, 429, 431, 7, 118, 2, 2, 430, 421, 3, 2, 2, 2, 430, 426, 3, 2, 2, 2, 431, 90, 3, 2, 2, 2, 432, 433, 7, 116, 2, 2, 433, 434, 7, 113, 2, 2, 434, 435, 7, 119, 2, 2, 435, 436, 7, 112, 2, 2, 436, 450, 7, 102, 2, 2, 437, 438, 7, 99, 2, 2, 438, 439, 7, 120, 2, 2, 439, 450, 7, 105, 2, 2, 440, 441, 7, 111, 2, 2, 441, 442, 7, 107, 2, 2, 442, 450, 7, 112, 2, 2, 443, 444, 7, 111, 2, 2, 444, 445, 7, 99, 2, 2, 445, 450, 7, 122, 2, 2, 446, 447, 7, 117, 2, 2, 447, 448, 7, 119, 2, 2, 448, 450, 7, 111, 2, 2, 449, 432, 3, 2, 2, 2, 449, 437, 3, 2, 2, 2, 449, 440, 3, 2, 2, 2, 449, 443, 3, 2, 2, 2, 449, 446, 3, 2, 2, 2, 450, 92, 3, 2, 2, 2, 451, 454, 5, 33, 16, 2, 452, 454, 7, 97, 2, 2, 453, 451, 3, 2, 2, 2, 453, 452, 3, 2, 2, 2, 454, 460, 3, 2, 2, 2, 455, 459, 5, 33, 16, 2, 456, 459, 5, 31, 15, 2, 457, 459, 7, 97, 2, 2, 458, 455, 3, 2, 2, 2, 458, 456, 3, 2, 2, 2, 458, 457, 3, 2, 2, 2, 459, 462, 3, 2, 2, 2, 460, 458, 3, 2, 2, 2, 460, 461, 3, 2, 2, 2, 461, 94, 3, 2, 2, 2, 462, 460, 3, 2, 2, 2, 463, 469, 7, 98, 2, 2, 464, 468, 10, 10, 2, 2, 465, 466, 7, 98, 2, 2, 466, 468, 7, 98, 2, 2, 467, 464, 3, 2, 2, 2, 467, 465, 3, 2, 2, 2, 468, 471, 3, 2, 2, 2, 469, 467, 3, 2, 2, 2, 469, 470, 3, 2, 2, 2, 470, 472, 3, 2, 2, 2, 471, 469, 3, 2, 2, 2, 472, 473, 7, 98, 2, 2, 473, 96, 3, 2, 2, 2, 474, 475, 5, 23, 11, 2, 475, 476, 3, 2, 2, 2, 476, 477, 8, 48, 4, 2, 477, 98, 3, 2, 2, 2, 478, 479, 5, 25, 12, 2, 479, 480, 3, 2, 2, 2, 480, 481, 8, 49, 4, 2, 481, 100, 3, 2, 2, 2, 482, 483, 5, 27, 13, 2, 483, 484, 3, 2, 2, 2, 484, 485, 8, 50, 4, 2, 485, 102, 3, 2, 2, 2, 486, 487, 7, 126, 2, 2, 487, 488, 3, 2, 2, 2, 488, 489, 8, 51, 7, 2, 489, 490, 8, 51, 5, 2, 490, 104, 3, 2, 2, 2, 491, 492, 7, 95, 2, 2, 492, 493, 3, 2, 2, 2, 493, 494, 8, 52, 5, 2, 494, 495, 8, 52, 5, 2, 495, 496, 8, 52, 8, 2, 496, 106, 3, 2, 2, 2, 497, 498, 7, 46, 2, 2, 498, 499, 3, 2, 2, 2, 499, 500, 8, 53, 9, 2, 500, 108, 3, 2, 2, 2, 501, 502, 7, 63, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 8, 54, 10, 2, 504, 110, 3, 2, 2, 2, 505, 507, 5, 113, 56, 2, 506, 505, 3, 2, 2, 2, 507, 508, 3, 2, 2, 2, 508, 506, 3, 2, 2, 2, 508, 509, 3, 2, 2, 2, 509, 112, 3, 2, 2, 2, 510, 512, 10, 11, 2, 2, 511, 510, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 511, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 518, 3, 2, 2, 2, 515, 516, 7, 49, 2, 2, 516, 518, 10, 12, 2, 2, 517, 511, 3, 2, 2, 2, 517, 515, 3, 2, 2, 2, 518, 114, 3, 2, 2, 2, 519, 520, 5, 95, 47, 2, 520, 116, 3, 2, 2, 2, 521, 522, 5, 23, 11, 2, 522, 523, 3, 2, 2, 2, 523, 524, 8, 58, 4, 2, 524, 118, 3, 2, 2, 2, 525, 526, 5, 25, 12, 2, 526, 527, 3, 2, 2, 2, 527, 528, 8, 59, 4, 2, 528, 120, 3, 2, 2, 2, 529, 530, 5, 27, 13, 2, 530, 531, 3, 2, 2, 2, 531, 532, 8, 60, 4, 2, 532, 122, 3, 2, 2, 2, 41, 2, 3, 4, 200, 204, 207, 216, 218, 229, 248, 253, 258, 260, 271, 279, 282, 284, 289, 294, 300, 307, 312, 318, 321, 329, 333, 382, 394, 413, 430, 449, 453, 458, 460, 467, 469, 508, 513, 517, 11, 7, 3, 2, 7, 4, 2, 2, 3, 2, 6, 2, 2, 7, 2, 2, 9, 15, 2, 9, 26, 2, 9, 22, 2, 9, 21, 2] \ No newline at end of file diff --git a/packages/kbn-monaco/src/esql/antlr/esql_lexer.tokens b/packages/kbn-monaco/src/esql/antlr/esql_lexer.tokens index b39004ce4ce3..c2dafff2f222 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_lexer.tokens +++ b/packages/kbn-monaco/src/esql/antlr/esql_lexer.tokens @@ -16,50 +16,37 @@ INTEGER_LITERAL=15 DECIMAL_LITERAL=16 BY=17 AND=18 -ASC=19 -ASSIGN=20 -COMMA=21 -DESC=22 -DOT=23 -FALSE=24 -FIRST=25 -LAST=26 -LP=27 -OPENING_BRACKET=28 -CLOSING_BRACKET=29 -NOT=30 -NULL=31 -NULLS=32 -OR=33 -RP=34 -TRUE=35 -EQ=36 -NEQ=37 -LT=38 -LTE=39 -GT=40 -GTE=41 -PLUS=42 -MINUS=43 -ASTERISK=44 -SLASH=45 -PERCENT=46 -ROUND_FUNCTION_MATH=47 -AVG_FUNCTION_MATH=48 -SUM_FUNCTION_MATH=49 -MIN_FUNCTION_MATH=50 -MAX_FUNCTION_MATH=51 -UNQUOTED_IDENTIFIER=52 -QUOTED_IDENTIFIER=53 -EXPR_LINE_COMMENT=54 -EXPR_MULTILINE_COMMENT=55 -EXPR_WS=56 -SRC_UNQUOTED_IDENTIFIER=57 -SRC_QUOTED_IDENTIFIER=58 -SRC_LINE_COMMENT=59 -SRC_MULTILINE_COMMENT=60 -SRC_WS=61 -UNKNOWN_CMD=62 +ASSIGN=19 +COMMA=20 +DOT=21 +LP=22 +OPENING_BRACKET=23 +CLOSING_BRACKET=24 +NOT=25 +NULL=26 +OR=27 +RP=28 +BOOLEAN_VALUE=29 +COMPARISON_OPERATOR=30 +PLUS=31 +MINUS=32 +ASTERISK=33 +SLASH=34 +PERCENT=35 +ORDERING=36 +NULLS_ORDERING=37 +NULLS_ORDERING_DIRECTION=38 +UNARY_FUNCTION=39 +UNQUOTED_IDENTIFIER=40 +QUOTED_IDENTIFIER=41 +EXPR_LINE_COMMENT=42 +EXPR_MULTILINE_COMMENT=43 +EXPR_WS=44 +SRC_UNQUOTED_IDENTIFIER=45 +SRC_QUOTED_IDENTIFIER=46 +SRC_LINE_COMMENT=47 +SRC_MULTILINE_COMMENT=48 +SRC_WS=49 'eval'=1 'explain'=2 'from'=3 @@ -71,34 +58,17 @@ UNKNOWN_CMD=62 'project'=9 'by'=17 'and'=18 -'asc'=19 -'desc'=22 -'.'=23 -'false'=24 -'first'=25 -'last'=26 -'('=27 -'['=28 -']'=29 -'not'=30 -'null'=31 -'nulls'=32 -'or'=33 -')'=34 -'true'=35 -'=='=36 -'!='=37 -'<'=38 -'<='=39 -'>'=40 -'>='=41 -'+'=42 -'-'=43 -'*'=44 -'/'=45 -'%'=46 -'round'=47 -'avg'=48 -'sum'=49 -'min'=50 -'max'=51 +'.'=21 +'('=22 +'['=23 +']'=24 +'not'=25 +'null'=26 +'or'=27 +')'=28 +'+'=31 +'-'=32 +'*'=33 +'/'=34 +'%'=35 +'nulls'=37 diff --git a/packages/kbn-monaco/src/esql/antlr/esql_lexer.ts b/packages/kbn-monaco/src/esql/antlr/esql_lexer.ts index de10e76f9c72..064b2fe2c02d 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_lexer.ts +++ b/packages/kbn-monaco/src/esql/antlr/esql_lexer.ts @@ -35,50 +35,37 @@ export class esql_lexer extends Lexer { public static readonly DECIMAL_LITERAL = 16; public static readonly BY = 17; public static readonly AND = 18; - public static readonly ASC = 19; - public static readonly ASSIGN = 20; - public static readonly COMMA = 21; - public static readonly DESC = 22; - public static readonly DOT = 23; - public static readonly FALSE = 24; - public static readonly FIRST = 25; - public static readonly LAST = 26; - public static readonly LP = 27; - public static readonly OPENING_BRACKET = 28; - public static readonly CLOSING_BRACKET = 29; - public static readonly NOT = 30; - public static readonly NULL = 31; - public static readonly NULLS = 32; - public static readonly OR = 33; - public static readonly RP = 34; - public static readonly TRUE = 35; - public static readonly EQ = 36; - public static readonly NEQ = 37; - public static readonly LT = 38; - public static readonly LTE = 39; - public static readonly GT = 40; - public static readonly GTE = 41; - public static readonly PLUS = 42; - public static readonly MINUS = 43; - public static readonly ASTERISK = 44; - public static readonly SLASH = 45; - public static readonly PERCENT = 46; - public static readonly ROUND_FUNCTION_MATH = 47; - public static readonly AVG_FUNCTION_MATH = 48; - public static readonly SUM_FUNCTION_MATH = 49; - public static readonly MIN_FUNCTION_MATH = 50; - public static readonly MAX_FUNCTION_MATH = 51; - public static readonly UNQUOTED_IDENTIFIER = 52; - public static readonly QUOTED_IDENTIFIER = 53; - public static readonly EXPR_LINE_COMMENT = 54; - public static readonly EXPR_MULTILINE_COMMENT = 55; - public static readonly EXPR_WS = 56; - public static readonly SRC_UNQUOTED_IDENTIFIER = 57; - public static readonly SRC_QUOTED_IDENTIFIER = 58; - public static readonly SRC_LINE_COMMENT = 59; - public static readonly SRC_MULTILINE_COMMENT = 60; - public static readonly SRC_WS = 61; - public static readonly UNKNOWN_CMD = 62; + public static readonly ASSIGN = 19; + public static readonly COMMA = 20; + public static readonly DOT = 21; + public static readonly LP = 22; + public static readonly OPENING_BRACKET = 23; + public static readonly CLOSING_BRACKET = 24; + public static readonly NOT = 25; + public static readonly NULL = 26; + public static readonly OR = 27; + public static readonly RP = 28; + public static readonly BOOLEAN_VALUE = 29; + public static readonly COMPARISON_OPERATOR = 30; + public static readonly PLUS = 31; + public static readonly MINUS = 32; + public static readonly ASTERISK = 33; + public static readonly SLASH = 34; + public static readonly PERCENT = 35; + public static readonly ORDERING = 36; + public static readonly NULLS_ORDERING = 37; + public static readonly NULLS_ORDERING_DIRECTION = 38; + public static readonly UNARY_FUNCTION = 39; + public static readonly UNQUOTED_IDENTIFIER = 40; + public static readonly QUOTED_IDENTIFIER = 41; + public static readonly EXPR_LINE_COMMENT = 42; + public static readonly EXPR_MULTILINE_COMMENT = 43; + public static readonly EXPR_WS = 44; + public static readonly SRC_UNQUOTED_IDENTIFIER = 45; + public static readonly SRC_QUOTED_IDENTIFIER = 46; + public static readonly SRC_LINE_COMMENT = 47; + public static readonly SRC_MULTILINE_COMMENT = 48; + public static readonly SRC_WS = 49; public static readonly EXPRESSION = 1; public static readonly SOURCE_IDENTIFIERS = 2; @@ -96,37 +83,33 @@ export class esql_lexer extends Lexer { "EVAL", "EXPLAIN", "FROM", "ROW", "STATS", "WHERE", "SORT", "LIMIT", "PROJECT", "LINE_COMMENT", "MULTILINE_COMMENT", "WS", "PIPE", "DIGIT", "LETTER", "ESCAPE_SEQUENCE", "UNESCAPED_CHARS", "EXPONENT", "STRING", "INTEGER_LITERAL", - "DECIMAL_LITERAL", "BY", "AND", "ASC", "ASSIGN", "COMMA", "DESC", "DOT", - "FALSE", "FIRST", "LAST", "LP", "OPENING_BRACKET", "CLOSING_BRACKET", - "NOT", "NULL", "NULLS", "OR", "RP", "TRUE", "EQ", "NEQ", "LT", "LTE", - "GT", "GTE", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "ROUND_FUNCTION_MATH", - "AVG_FUNCTION_MATH", "SUM_FUNCTION_MATH", "MIN_FUNCTION_MATH", "MAX_FUNCTION_MATH", - "UNQUOTED_IDENTIFIER", "QUOTED_IDENTIFIER", "EXPR_LINE_COMMENT", "EXPR_MULTILINE_COMMENT", - "EXPR_WS", "SRC_PIPE", "SRC_CLOSING_BRACKET", "SRC_COMMA", "SRC_ASSIGN", - "SRC_UNQUOTED_IDENTIFIER", "SRC_UNQUOTED_IDENTIFIER_PART", "SRC_QUOTED_IDENTIFIER", - "SRC_LINE_COMMENT", "SRC_MULTILINE_COMMENT", "SRC_WS", "UNKNOWN_CMD", + "DECIMAL_LITERAL", "BY", "AND", "ASSIGN", "COMMA", "DOT", "LP", "OPENING_BRACKET", + "CLOSING_BRACKET", "NOT", "NULL", "OR", "RP", "BOOLEAN_VALUE", "COMPARISON_OPERATOR", + "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "ORDERING", "NULLS_ORDERING", + "NULLS_ORDERING_DIRECTION", "UNARY_FUNCTION", "UNQUOTED_IDENTIFIER", "QUOTED_IDENTIFIER", + "EXPR_LINE_COMMENT", "EXPR_MULTILINE_COMMENT", "EXPR_WS", "SRC_PIPE", + "SRC_CLOSING_BRACKET", "SRC_COMMA", "SRC_ASSIGN", "SRC_UNQUOTED_IDENTIFIER", + "SRC_UNQUOTED_IDENTIFIER_PART", "SRC_QUOTED_IDENTIFIER", "SRC_LINE_COMMENT", + "SRC_MULTILINE_COMMENT", "SRC_WS", ]; private static readonly _LITERAL_NAMES: Array = [ undefined, "'eval'", "'explain'", "'from'", "'row'", "'stats'", "'where'", "'sort'", "'limit'", "'project'", undefined, undefined, undefined, undefined, - undefined, undefined, undefined, "'by'", "'and'", "'asc'", undefined, - undefined, "'desc'", "'.'", "'false'", "'first'", "'last'", "'('", "'['", - "']'", "'not'", "'null'", "'nulls'", "'or'", "')'", "'true'", "'=='", - "'!='", "'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'", "'%'", - "'round'", "'avg'", "'sum'", "'min'", "'max'", + undefined, undefined, undefined, "'by'", "'and'", undefined, undefined, + "'.'", "'('", "'['", "']'", "'not'", "'null'", "'or'", "')'", undefined, + undefined, "'+'", "'-'", "'*'", "'/'", "'%'", undefined, "'nulls'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ undefined, "EVAL", "EXPLAIN", "FROM", "ROW", "STATS", "WHERE", "SORT", "LIMIT", "PROJECT", "LINE_COMMENT", "MULTILINE_COMMENT", "WS", "PIPE", - "STRING", "INTEGER_LITERAL", "DECIMAL_LITERAL", "BY", "AND", "ASC", "ASSIGN", - "COMMA", "DESC", "DOT", "FALSE", "FIRST", "LAST", "LP", "OPENING_BRACKET", - "CLOSING_BRACKET", "NOT", "NULL", "NULLS", "OR", "RP", "TRUE", "EQ", "NEQ", - "LT", "LTE", "GT", "GTE", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", - "ROUND_FUNCTION_MATH", "AVG_FUNCTION_MATH", "SUM_FUNCTION_MATH", "MIN_FUNCTION_MATH", - "MAX_FUNCTION_MATH", "UNQUOTED_IDENTIFIER", "QUOTED_IDENTIFIER", "EXPR_LINE_COMMENT", + "STRING", "INTEGER_LITERAL", "DECIMAL_LITERAL", "BY", "AND", "ASSIGN", + "COMMA", "DOT", "LP", "OPENING_BRACKET", "CLOSING_BRACKET", "NOT", "NULL", + "OR", "RP", "BOOLEAN_VALUE", "COMPARISON_OPERATOR", "PLUS", "MINUS", "ASTERISK", + "SLASH", "PERCENT", "ORDERING", "NULLS_ORDERING", "NULLS_ORDERING_DIRECTION", + "UNARY_FUNCTION", "UNQUOTED_IDENTIFIER", "QUOTED_IDENTIFIER", "EXPR_LINE_COMMENT", "EXPR_MULTILINE_COMMENT", "EXPR_WS", "SRC_UNQUOTED_IDENTIFIER", "SRC_QUOTED_IDENTIFIER", - "SRC_LINE_COMMENT", "SRC_MULTILINE_COMMENT", "SRC_WS", "UNKNOWN_CMD", + "SRC_LINE_COMMENT", "SRC_MULTILINE_COMMENT", "SRC_WS", ]; public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(esql_lexer._LITERAL_NAMES, esql_lexer._SYMBOLIC_NAMES, []); @@ -158,9 +141,8 @@ export class esql_lexer extends Lexer { // @Override public get modeNames(): string[] { return esql_lexer.modeNames; } - private static readonly _serializedATNSegments: number = 2; - private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02@\u023D\b\x01" + + public static readonly _serializedATN: string = + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x023\u0215\b\x01" + "\b\x01\b\x01\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04" + "\x06\t\x06\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f" + "\t\f\x04\r\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11" + @@ -170,280 +152,255 @@ export class esql_lexer extends Lexer { "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t" + ")\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x04" + "2\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04" + - ";\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04" + - "D\tD\x04E\tE\x04F\tF\x04G\tG\x04H\tH\x04I\tI\x03\x02\x03\x02\x03\x02\x03" + - "\x02\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + - "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x04\x03\x04\x03\x04\x03\x04\x03" + - "\x04\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03" + - "\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x07\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\b\x03\b\x03\b" + - "\x03\b\x03\b\x03\b\x03\b\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03" + - "\t\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\v\x03" + - "\v\x03\v\x03\v\x07\v\xE1\n\v\f\v\x0E\v\xE4\v\v\x03\v\x05\v\xE7\n\v\x03" + - "\v\x05\v\xEA\n\v\x03\v\x03\v\x03\f\x03\f\x03\f\x03\f\x03\f\x07\f\xF3\n" + - "\f\f\f\x0E\f\xF6\v\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\r\x06\r\xFE\n\r" + - "\r\r\x0E\r\xFF\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x03\x0F\x03" + - "\x0F\x03\x10\x03\x10\x03\x11\x03\x11\x03\x11\x03\x12\x03\x12\x03\x13\x03" + - "\x13\x05\x13\u0113\n\x13\x03\x13\x06\x13\u0116\n\x13\r\x13\x0E\x13\u0117" + - "\x03\x14\x03\x14\x03\x14\x07\x14\u011D\n\x14\f\x14\x0E\x14\u0120\v\x14" + - "\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x07\x14\u0128\n\x14\f" + - "\x14\x0E\x14\u012B\v\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x05\x14" + - "\u0132\n\x14\x03\x14\x05\x14\u0135\n\x14\x05\x14\u0137\n\x14\x03\x15\x06" + - "\x15\u013A\n\x15\r\x15\x0E\x15\u013B\x03\x16\x06\x16\u013F\n\x16\r\x16" + - "\x0E\x16\u0140\x03\x16\x03\x16\x07\x16\u0145\n\x16\f\x16\x0E\x16\u0148" + - "\v\x16\x03\x16\x03\x16\x06\x16\u014C\n\x16\r\x16\x0E\x16\u014D\x03\x16" + - "\x06\x16\u0151\n\x16\r\x16\x0E\x16\u0152\x03\x16\x03\x16\x07\x16\u0157" + - "\n\x16\f\x16\x0E\x16\u015A\v\x16\x05\x16\u015C\n\x16\x03\x16\x03\x16\x03" + - "\x16\x03\x16\x06\x16\u0162\n\x16\r\x16\x0E\x16\u0163\x03\x16\x03\x16\x05" + - "\x16\u0168\n\x16\x03\x17\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x18" + - "\x03\x19\x03\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1C" + - "\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E" + - "\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F" + - "\x03 \x03 \x03 \x03 \x03 \x03!\x03!\x03\"\x03\"\x03\"\x03\"\x03#\x03#" + - "\x03#\x03#\x03#\x03$\x03$\x03$\x03$\x03%\x03%\x03%\x03%\x03%\x03&\x03" + - "&\x03&\x03&\x03&\x03&\x03\'\x03\'\x03\'\x03(\x03(\x03)\x03)\x03)\x03)" + - "\x03)\x03*\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03-\x03-\x03.\x03" + - ".\x03/\x03/\x03/\x030\x030\x031\x031\x032\x032\x033\x033\x034\x034\x03" + - "5\x035\x035\x035\x035\x035\x036\x036\x036\x036\x037\x037\x037\x037\x03" + - "8\x038\x038\x038\x039\x039\x039\x039\x03:\x03:\x05:\u01E7\n:\x03:\x03" + - ":\x03:\x07:\u01EC\n:\f:\x0E:\u01EF\v:\x03;\x03;\x03;\x03;\x07;\u01F5\n" + - ";\f;\x0E;\u01F8\v;\x03;\x03;\x03<\x03<\x03<\x03<\x03=\x03=\x03=\x03=\x03" + - ">\x03>\x03>\x03>\x03?\x03?\x03?\x03?\x03?\x03@\x03@\x03@\x03@\x03@\x03" + - "@\x03A\x03A\x03A\x03A\x03B\x03B\x03B\x03B\x03C\x06C\u021C\nC\rC\x0EC\u021D" + - "\x03D\x06D\u0221\nD\rD\x0ED\u0222\x03D\x03D\x05D\u0227\nD\x03E\x03E\x03" + - "F\x03F\x03F\x03F\x03G\x03G\x03G\x03G\x03H\x03H\x03H\x03H\x03I\x06I\u0238" + - "\nI\rI\x0EI\u0239\x03I\x03I\x04\xF4\u0129\x02\x02J\x05\x02\x03\x07\x02" + - "\x04\t\x02\x05\v\x02\x06\r\x02\x07\x0F\x02\b\x11\x02\t\x13\x02\n\x15\x02" + - "\v\x17\x02\f\x19\x02\r\x1B\x02\x0E\x1D\x02\x0F\x1F\x02\x02!\x02\x02#\x02" + - "\x02%\x02\x02\'\x02\x02)\x02\x10+\x02\x11-\x02\x12/\x02\x131\x02\x143" + - "\x02\x155\x02\x167\x02\x179\x02\x18;\x02\x19=\x02\x1A?\x02\x1BA\x02\x1C" + - "C\x02\x1DE\x02\x1EG\x02\x1FI\x02 K\x02!M\x02\"O\x02#Q\x02$S\x02%U\x02" + - "&W\x02\'Y\x02([\x02)]\x02*_\x02+a\x02,c\x02-e\x02.g\x02/i\x020k\x021m" + - "\x022o\x023q\x024s\x025u\x026w\x027y\x028{\x029}\x02:\x7F\x02\x02\x81" + - "\x02\x02\x83\x02\x02\x85\x02\x02\x87\x02;\x89\x02\x02\x8B\x02<\x8D\x02" + - "=\x8F\x02>\x91\x02?\x93\x02@\x05\x02\x03\x04\x0E\x04\x02\f\f\x0F\x0F\x05" + - "\x02\v\f\x0F\x0F\"\"\x03\x022;\x04\x02C\\c|\x07\x02$$^^ppttvv\x06\x02" + - "\f\f\x0F\x0F$$^^\x04\x02GGgg\x04\x02--//\x03\x02bb\f\x02\v\f\x0F\x0F\"" + - "\"..11??]]__bb~~\x04\x02,,11\b\x02\v\f\x0F\x0F\"\"11]]__\x02\u0257\x02" + - "\x05\x03\x02\x02\x02\x02\x07\x03\x02\x02\x02\x02\t\x03\x02\x02\x02\x02" + - "\v\x03\x02\x02\x02\x02\r\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02\x02\x11" + - "\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17" + - "\x03\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x03\x1D" + - "\x03\x02\x02\x02\x03)\x03\x02\x02\x02\x03+\x03\x02\x02\x02\x03-\x03\x02" + - "\x02\x02\x03/\x03\x02\x02\x02\x031\x03\x02\x02\x02\x033\x03\x02\x02\x02" + - "\x035\x03\x02\x02\x02\x037\x03\x02\x02\x02\x039\x03\x02\x02\x02\x03;\x03" + - "\x02\x02\x02\x03=\x03\x02\x02\x02\x03?\x03\x02\x02\x02\x03A\x03\x02\x02" + - "\x02\x03C\x03\x02\x02\x02\x03E\x03\x02\x02\x02\x03G\x03\x02\x02\x02\x03" + - "I\x03\x02\x02\x02\x03K\x03\x02\x02\x02\x03M\x03\x02\x02\x02\x03O\x03\x02" + - "\x02\x02\x03Q\x03\x02\x02\x02\x03S\x03\x02\x02\x02\x03U\x03\x02\x02\x02" + - "\x03W\x03\x02\x02\x02\x03Y\x03\x02\x02\x02\x03[\x03\x02\x02\x02\x03]\x03" + - "\x02\x02\x02\x03_\x03\x02\x02\x02\x03a\x03\x02\x02\x02\x03c\x03\x02\x02" + - "\x02\x03e\x03\x02\x02\x02\x03g\x03\x02\x02\x02\x03i\x03\x02\x02\x02\x03" + - "k\x03\x02\x02\x02\x03m\x03\x02\x02\x02\x03o\x03\x02\x02\x02\x03q\x03\x02" + - "\x02\x02\x03s\x03\x02\x02\x02\x03u\x03\x02\x02\x02\x03w\x03\x02\x02\x02" + - "\x03y\x03\x02\x02\x02\x03{\x03\x02\x02\x02\x03}\x03\x02\x02\x02\x04\x7F" + - "\x03\x02\x02\x02\x04\x81\x03\x02\x02\x02\x04\x83\x03\x02\x02\x02\x04\x85" + - "\x03\x02\x02\x02\x04\x87\x03\x02\x02\x02\x04\x8B\x03\x02\x02\x02\x04\x8D" + - "\x03\x02\x02\x02\x04\x8F\x03\x02\x02\x02\x04\x91\x03\x02\x02\x02\x04\x93" + - "\x03\x02\x02\x02\x05\x95\x03\x02\x02\x02\x07\x9C\x03\x02\x02\x02\t\xA6" + - "\x03\x02\x02\x02\v\xAD\x03\x02\x02\x02\r\xB3\x03\x02\x02\x02\x0F\xBB\x03" + - "\x02\x02\x02\x11\xC3\x03\x02\x02\x02\x13\xCA\x03\x02\x02\x02\x15\xD2\x03" + - "\x02\x02\x02\x17\xDC\x03\x02\x02\x02\x19\xED\x03\x02\x02\x02\x1B\xFD\x03" + - "\x02\x02\x02\x1D\u0103\x03\x02\x02\x02\x1F\u0107\x03\x02\x02\x02!\u0109" + - "\x03\x02\x02\x02#\u010B\x03\x02\x02\x02%\u010E\x03\x02\x02\x02\'\u0110" + - "\x03\x02\x02\x02)\u0136\x03\x02\x02\x02+\u0139\x03\x02\x02\x02-\u0167" + - "\x03\x02\x02\x02/\u0169\x03\x02\x02\x021\u016C\x03\x02\x02\x023\u0170" + - "\x03\x02\x02\x025\u0174\x03\x02\x02\x027\u0176\x03\x02\x02\x029\u0178" + - "\x03\x02\x02\x02;\u017D\x03\x02\x02\x02=\u017F\x03\x02\x02\x02?\u0185" + - "\x03\x02\x02\x02A\u018B\x03\x02\x02\x02C\u0190\x03\x02\x02\x02E\u0192" + - "\x03\x02\x02\x02G\u0196\x03\x02\x02\x02I\u019B\x03\x02\x02\x02K\u019F" + - "\x03\x02\x02\x02M\u01A4\x03\x02\x02\x02O\u01AA\x03\x02\x02\x02Q\u01AD" + - "\x03\x02\x02\x02S\u01AF\x03\x02\x02\x02U\u01B4\x03\x02\x02\x02W\u01B7" + - "\x03\x02\x02\x02Y\u01BA\x03\x02\x02\x02[\u01BC\x03\x02\x02\x02]\u01BF" + - "\x03\x02\x02\x02_\u01C1\x03\x02\x02\x02a\u01C4\x03\x02\x02\x02c\u01C6" + - "\x03\x02\x02\x02e\u01C8\x03\x02\x02\x02g\u01CA\x03\x02\x02\x02i\u01CC" + - "\x03\x02\x02\x02k\u01CE\x03\x02\x02\x02m\u01D4\x03\x02\x02\x02o\u01D8" + - "\x03\x02\x02\x02q\u01DC\x03\x02\x02\x02s\u01E0\x03\x02\x02\x02u\u01E6" + - "\x03\x02\x02\x02w\u01F0\x03\x02\x02\x02y\u01FB\x03\x02\x02\x02{\u01FF" + - "\x03\x02\x02\x02}\u0203\x03\x02\x02\x02\x7F\u0207\x03\x02\x02\x02\x81" + - "\u020C\x03\x02\x02\x02\x83\u0212\x03\x02\x02\x02\x85\u0216\x03\x02\x02" + - "\x02\x87\u021B\x03\x02\x02\x02\x89\u0226\x03\x02\x02\x02\x8B\u0228\x03" + - "\x02\x02\x02\x8D\u022A\x03\x02\x02\x02\x8F\u022E\x03\x02\x02\x02\x91\u0232" + - "\x03\x02\x02\x02\x93\u0237\x03\x02\x02\x02\x95\x96\x07g\x02\x02\x96\x97" + - "\x07x\x02\x02\x97\x98\x07c\x02\x02\x98\x99\x07n\x02\x02\x99\x9A\x03\x02" + - "\x02\x02\x9A\x9B\b\x02\x02\x02\x9B\x06\x03\x02\x02\x02\x9C\x9D\x07g\x02" + - "\x02\x9D\x9E\x07z\x02\x02\x9E\x9F\x07r\x02\x02\x9F\xA0\x07n\x02\x02\xA0" + - "\xA1\x07c\x02\x02\xA1\xA2\x07k\x02\x02\xA2\xA3\x07p\x02\x02\xA3\xA4\x03" + - "\x02\x02\x02\xA4\xA5\b\x03\x02\x02\xA5\b\x03\x02\x02\x02\xA6\xA7\x07h" + - "\x02\x02\xA7\xA8\x07t\x02\x02\xA8\xA9\x07q\x02\x02\xA9\xAA\x07o\x02\x02" + - "\xAA\xAB\x03\x02\x02\x02\xAB\xAC\b\x04\x03\x02\xAC\n\x03\x02\x02\x02\xAD" + - "\xAE\x07t\x02\x02\xAE\xAF\x07q\x02\x02\xAF\xB0\x07y\x02\x02\xB0\xB1\x03" + - "\x02\x02\x02\xB1\xB2\b\x05\x02\x02\xB2\f\x03\x02\x02\x02\xB3\xB4\x07u" + - "\x02\x02\xB4\xB5\x07v\x02\x02\xB5\xB6\x07c\x02\x02\xB6\xB7\x07v\x02\x02" + - "\xB7\xB8\x07u\x02\x02\xB8\xB9\x03\x02\x02\x02\xB9\xBA\b\x06\x02\x02\xBA" + - "\x0E\x03\x02\x02\x02\xBB\xBC\x07y\x02\x02\xBC\xBD\x07j\x02\x02\xBD\xBE" + - "\x07g\x02\x02\xBE\xBF\x07t\x02\x02\xBF\xC0\x07g\x02\x02\xC0\xC1\x03\x02" + - "\x02\x02\xC1\xC2\b\x07\x02\x02\xC2\x10\x03\x02\x02\x02\xC3\xC4\x07u\x02" + - "\x02\xC4\xC5\x07q\x02\x02\xC5\xC6\x07t\x02\x02\xC6\xC7\x07v\x02\x02\xC7" + - "\xC8\x03\x02\x02\x02\xC8\xC9\b\b\x02\x02\xC9\x12\x03\x02\x02\x02\xCA\xCB" + - "\x07n\x02\x02\xCB\xCC\x07k\x02\x02\xCC\xCD\x07o\x02\x02\xCD\xCE\x07k\x02" + - "\x02\xCE\xCF\x07v\x02\x02\xCF\xD0\x03\x02\x02\x02\xD0\xD1\b\t\x02\x02" + - "\xD1\x14\x03\x02\x02\x02\xD2\xD3\x07r\x02\x02\xD3\xD4\x07t\x02\x02\xD4" + - "\xD5\x07q\x02\x02\xD5\xD6\x07l\x02\x02\xD6\xD7\x07g\x02\x02\xD7\xD8\x07" + - "e\x02\x02\xD8\xD9\x07v\x02\x02\xD9\xDA\x03\x02\x02\x02\xDA\xDB\b\n\x03" + - "\x02\xDB\x16\x03\x02\x02\x02\xDC\xDD\x071\x02\x02\xDD\xDE\x071\x02\x02" + - "\xDE\xE2\x03\x02\x02\x02\xDF\xE1\n\x02\x02\x02\xE0\xDF\x03\x02\x02\x02" + - "\xE1\xE4\x03\x02\x02\x02\xE2\xE0\x03\x02\x02\x02\xE2\xE3\x03\x02\x02\x02" + - "\xE3\xE6\x03\x02\x02\x02\xE4\xE2\x03\x02\x02\x02\xE5\xE7\x07\x0F\x02\x02" + - "\xE6\xE5\x03\x02\x02\x02\xE6\xE7\x03\x02\x02\x02\xE7\xE9\x03\x02\x02\x02" + - "\xE8\xEA\x07\f\x02\x02\xE9\xE8\x03\x02\x02\x02\xE9\xEA\x03\x02\x02\x02" + - "\xEA\xEB\x03\x02\x02\x02\xEB\xEC\b\v\x04\x02\xEC\x18\x03\x02\x02\x02\xED" + - "\xEE\x071\x02\x02\xEE\xEF\x07,\x02\x02\xEF\xF4\x03\x02\x02\x02\xF0\xF3" + - "\x05\x19\f\x02\xF1\xF3\v\x02\x02\x02\xF2\xF0\x03\x02\x02\x02\xF2\xF1\x03" + - "\x02\x02\x02\xF3\xF6\x03\x02\x02\x02\xF4\xF5\x03\x02\x02\x02\xF4\xF2\x03" + - "\x02\x02\x02\xF5\xF7\x03\x02\x02\x02\xF6\xF4\x03\x02\x02\x02\xF7\xF8\x07" + - ",\x02\x02\xF8\xF9\x071\x02\x02\xF9\xFA\x03\x02\x02\x02\xFA\xFB\b\f\x04" + - "\x02\xFB\x1A\x03\x02\x02\x02\xFC\xFE\t\x03\x02\x02\xFD\xFC\x03\x02\x02" + - "\x02\xFE\xFF\x03\x02\x02\x02\xFF\xFD\x03\x02\x02\x02\xFF\u0100\x03\x02" + - "\x02\x02\u0100\u0101\x03\x02\x02\x02\u0101\u0102\b\r\x04\x02\u0102\x1C" + - "\x03\x02\x02\x02\u0103\u0104\x07~\x02\x02\u0104\u0105\x03\x02\x02\x02" + - "\u0105\u0106\b\x0E\x05\x02\u0106\x1E\x03\x02\x02\x02\u0107\u0108\t\x04" + - "\x02\x02\u0108 \x03\x02\x02\x02\u0109\u010A\t\x05\x02\x02\u010A\"\x03" + - "\x02\x02\x02\u010B\u010C\x07^\x02\x02\u010C\u010D\t\x06\x02\x02\u010D" + - "$\x03\x02\x02\x02\u010E\u010F\n\x07\x02\x02\u010F&\x03\x02\x02\x02\u0110" + - "\u0112\t\b\x02\x02\u0111\u0113\t\t\x02\x02\u0112\u0111\x03\x02\x02\x02" + - "\u0112\u0113\x03\x02\x02\x02\u0113\u0115\x03\x02\x02\x02\u0114\u0116\x05" + - "\x1F\x0F\x02\u0115\u0114\x03\x02\x02\x02\u0116\u0117\x03\x02\x02\x02\u0117" + - "\u0115\x03\x02\x02\x02\u0117\u0118\x03\x02\x02\x02\u0118(\x03\x02\x02" + - "\x02\u0119\u011E\x07$\x02\x02\u011A\u011D\x05#\x11\x02\u011B\u011D\x05" + - "%\x12\x02\u011C\u011A\x03\x02\x02\x02\u011C\u011B\x03\x02\x02\x02\u011D" + - "\u0120\x03\x02\x02\x02\u011E\u011C\x03\x02\x02\x02\u011E\u011F\x03\x02" + - "\x02\x02\u011F\u0121\x03\x02\x02\x02\u0120\u011E\x03\x02\x02\x02\u0121" + - "\u0137\x07$\x02\x02\u0122\u0123\x07$\x02\x02\u0123\u0124\x07$\x02\x02" + - "\u0124\u0125\x07$\x02\x02\u0125\u0129\x03\x02\x02\x02\u0126\u0128\n\x02" + - "\x02\x02\u0127\u0126\x03\x02\x02\x02\u0128\u012B\x03\x02\x02\x02\u0129" + - "\u012A\x03\x02\x02\x02\u0129\u0127\x03\x02\x02\x02\u012A\u012C\x03\x02" + - "\x02\x02\u012B\u0129\x03\x02\x02\x02\u012C\u012D\x07$\x02\x02\u012D\u012E" + - "\x07$\x02\x02\u012E\u012F\x07$\x02\x02\u012F\u0131\x03\x02\x02\x02\u0130" + - "\u0132\x07$\x02\x02\u0131\u0130\x03\x02\x02\x02\u0131\u0132\x03\x02\x02" + - "\x02\u0132\u0134\x03\x02\x02\x02\u0133\u0135\x07$\x02\x02\u0134\u0133" + - "\x03\x02\x02\x02\u0134\u0135\x03\x02\x02\x02\u0135\u0137\x03\x02\x02\x02" + - "\u0136\u0119\x03\x02\x02\x02\u0136\u0122\x03\x02\x02\x02\u0137*\x03\x02" + - "\x02\x02\u0138\u013A\x05\x1F\x0F\x02\u0139\u0138\x03\x02\x02\x02\u013A" + - "\u013B\x03\x02\x02\x02\u013B\u0139\x03\x02\x02\x02\u013B\u013C\x03\x02" + - "\x02\x02\u013C,\x03\x02\x02\x02\u013D\u013F\x05\x1F\x0F\x02\u013E\u013D" + - "\x03\x02\x02\x02\u013F\u0140\x03\x02\x02\x02\u0140\u013E\x03\x02\x02\x02" + - "\u0140\u0141\x03\x02\x02\x02\u0141\u0142\x03\x02\x02\x02\u0142\u0146\x05" + - ";\x1D\x02\u0143\u0145\x05\x1F\x0F\x02\u0144\u0143\x03\x02\x02\x02\u0145" + - "\u0148\x03\x02\x02\x02\u0146\u0144\x03\x02\x02\x02\u0146\u0147\x03\x02" + - "\x02\x02\u0147\u0168\x03\x02\x02\x02\u0148\u0146\x03\x02\x02\x02\u0149" + - "\u014B\x05;\x1D\x02\u014A\u014C\x05\x1F\x0F\x02\u014B\u014A\x03\x02\x02" + - "\x02\u014C\u014D\x03\x02\x02\x02\u014D\u014B\x03\x02\x02\x02\u014D\u014E" + - "\x03\x02\x02\x02\u014E\u0168\x03\x02\x02\x02\u014F\u0151\x05\x1F\x0F\x02" + - "\u0150\u014F\x03\x02\x02\x02\u0151\u0152\x03\x02\x02\x02\u0152\u0150\x03" + - "\x02\x02\x02\u0152\u0153\x03\x02\x02\x02\u0153\u015B\x03\x02\x02\x02\u0154" + - "\u0158\x05;\x1D\x02\u0155\u0157\x05\x1F\x0F\x02\u0156\u0155\x03\x02\x02" + - "\x02\u0157\u015A\x03\x02\x02\x02\u0158\u0156\x03\x02\x02\x02\u0158\u0159" + - "\x03\x02\x02\x02\u0159\u015C\x03\x02\x02\x02\u015A\u0158\x03\x02\x02\x02" + - "\u015B\u0154\x03\x02\x02\x02\u015B\u015C\x03\x02\x02\x02\u015C\u015D\x03" + - "\x02\x02\x02\u015D\u015E\x05\'\x13\x02\u015E\u0168\x03\x02\x02\x02\u015F" + - "\u0161\x05;\x1D\x02\u0160\u0162\x05\x1F\x0F\x02\u0161\u0160\x03\x02\x02" + - "\x02\u0162\u0163\x03\x02\x02\x02\u0163\u0161\x03\x02\x02\x02\u0163\u0164" + - "\x03\x02\x02\x02\u0164\u0165\x03\x02\x02\x02\u0165\u0166\x05\'\x13\x02" + - "\u0166\u0168\x03\x02\x02\x02\u0167\u013E\x03\x02\x02\x02\u0167\u0149\x03" + - "\x02\x02\x02\u0167\u0150\x03\x02\x02\x02\u0167\u015F\x03\x02\x02\x02\u0168" + - ".\x03\x02\x02\x02\u0169\u016A\x07d\x02\x02\u016A\u016B\x07{\x02\x02\u016B" + - "0\x03\x02\x02\x02\u016C\u016D\x07c\x02\x02\u016D\u016E\x07p\x02\x02\u016E" + - "\u016F\x07f\x02\x02\u016F2\x03\x02\x02\x02\u0170\u0171\x07c\x02\x02\u0171" + - "\u0172\x07u\x02\x02\u0172\u0173\x07e\x02\x02\u01734\x03\x02\x02\x02\u0174" + - "\u0175\x07?\x02\x02\u01756\x03\x02\x02\x02\u0176\u0177\x07.\x02\x02\u0177" + - "8\x03\x02\x02\x02\u0178\u0179\x07f\x02\x02\u0179\u017A\x07g\x02\x02\u017A" + - "\u017B\x07u\x02\x02\u017B\u017C\x07e\x02\x02\u017C:\x03\x02\x02\x02\u017D" + - "\u017E\x070\x02\x02\u017E<\x03\x02\x02\x02\u017F\u0180\x07h\x02\x02\u0180" + - "\u0181\x07c\x02\x02\u0181\u0182\x07n\x02\x02\u0182\u0183\x07u\x02\x02" + - "\u0183\u0184\x07g\x02\x02\u0184>\x03\x02\x02\x02\u0185\u0186\x07h\x02" + - "\x02\u0186\u0187\x07k\x02\x02\u0187\u0188\x07t\x02\x02\u0188\u0189\x07" + - "u\x02\x02\u0189\u018A\x07v\x02\x02\u018A@\x03\x02\x02\x02\u018B\u018C" + - "\x07n\x02\x02\u018C\u018D\x07c\x02\x02\u018D\u018E\x07u\x02\x02\u018E" + - "\u018F\x07v\x02\x02\u018FB\x03\x02\x02\x02\u0190\u0191\x07*\x02\x02\u0191" + - "D\x03\x02\x02\x02\u0192\u0193\x07]\x02\x02\u0193\u0194\x03\x02\x02\x02" + - "\u0194\u0195\b\"\x06\x02\u0195F\x03\x02\x02\x02\u0196\u0197\x07_\x02\x02" + - "\u0197\u0198\x03\x02\x02\x02\u0198\u0199\b#\x05\x02\u0199\u019A\b#\x05" + - "\x02\u019AH\x03\x02\x02\x02\u019B\u019C\x07p\x02\x02\u019C\u019D\x07q" + - "\x02\x02\u019D\u019E\x07v\x02\x02\u019EJ\x03\x02\x02\x02\u019F\u01A0\x07" + - "p\x02\x02\u01A0\u01A1\x07w\x02\x02\u01A1\u01A2\x07n\x02\x02\u01A2\u01A3" + - "\x07n\x02\x02\u01A3L\x03\x02\x02\x02\u01A4\u01A5\x07p\x02\x02\u01A5\u01A6" + - "\x07w\x02\x02\u01A6\u01A7\x07n\x02\x02\u01A7\u01A8\x07n\x02\x02\u01A8" + - "\u01A9\x07u\x02\x02\u01A9N\x03\x02\x02\x02\u01AA\u01AB\x07q\x02\x02\u01AB" + - "\u01AC\x07t\x02\x02\u01ACP\x03\x02\x02\x02\u01AD\u01AE\x07+\x02\x02\u01AE" + - "R\x03\x02\x02\x02\u01AF\u01B0\x07v\x02\x02\u01B0\u01B1\x07t\x02\x02\u01B1" + - "\u01B2\x07w\x02\x02\u01B2\u01B3\x07g\x02\x02\u01B3T\x03\x02\x02\x02\u01B4" + - "\u01B5\x07?\x02\x02\u01B5\u01B6\x07?\x02\x02\u01B6V\x03\x02\x02\x02\u01B7" + - "\u01B8\x07#\x02\x02\u01B8\u01B9\x07?\x02\x02\u01B9X\x03\x02\x02\x02\u01BA" + - "\u01BB\x07>\x02\x02\u01BBZ\x03\x02\x02\x02\u01BC\u01BD\x07>\x02\x02\u01BD" + - "\u01BE\x07?\x02\x02\u01BE\\\x03\x02\x02\x02\u01BF\u01C0\x07@\x02\x02\u01C0" + - "^\x03\x02\x02\x02\u01C1\u01C2\x07@\x02\x02\u01C2\u01C3\x07?\x02\x02\u01C3" + - "`\x03\x02\x02\x02\u01C4\u01C5\x07-\x02\x02\u01C5b\x03\x02\x02\x02\u01C6" + - "\u01C7\x07/\x02\x02\u01C7d\x03\x02\x02\x02\u01C8\u01C9\x07,\x02\x02\u01C9" + - "f\x03\x02\x02\x02\u01CA\u01CB\x071\x02\x02\u01CBh\x03\x02\x02\x02\u01CC" + - "\u01CD\x07\'\x02\x02\u01CDj\x03\x02\x02\x02\u01CE\u01CF\x07t\x02\x02\u01CF" + - "\u01D0\x07q\x02\x02\u01D0\u01D1\x07w\x02\x02\u01D1\u01D2\x07p\x02\x02" + - "\u01D2\u01D3\x07f\x02\x02\u01D3l\x03\x02\x02\x02\u01D4\u01D5\x07c\x02" + - "\x02\u01D5\u01D6\x07x\x02\x02\u01D6\u01D7\x07i\x02\x02\u01D7n\x03\x02" + - "\x02\x02\u01D8\u01D9\x07u\x02\x02\u01D9\u01DA\x07w\x02\x02\u01DA\u01DB" + - "\x07o\x02\x02\u01DBp\x03\x02\x02\x02\u01DC\u01DD\x07o\x02\x02\u01DD\u01DE" + - "\x07k\x02\x02\u01DE\u01DF\x07p\x02\x02\u01DFr\x03\x02\x02\x02\u01E0\u01E1" + - "\x07o\x02\x02\u01E1\u01E2\x07c\x02\x02\u01E2\u01E3\x07z\x02\x02\u01E3" + - "t\x03\x02\x02\x02\u01E4\u01E7\x05!\x10\x02\u01E5\u01E7\x07a\x02\x02\u01E6" + - "\u01E4\x03\x02\x02\x02\u01E6\u01E5\x03\x02\x02\x02\u01E7\u01ED\x03\x02" + - "\x02\x02\u01E8\u01EC\x05!\x10\x02\u01E9\u01EC\x05\x1F\x0F\x02\u01EA\u01EC" + - "\x07a\x02\x02\u01EB\u01E8\x03\x02\x02\x02\u01EB\u01E9\x03\x02\x02\x02" + - "\u01EB\u01EA\x03\x02\x02\x02\u01EC\u01EF\x03\x02\x02\x02\u01ED\u01EB\x03" + - "\x02\x02\x02\u01ED\u01EE\x03\x02\x02\x02\u01EEv\x03\x02\x02\x02\u01EF" + - "\u01ED\x03\x02\x02\x02\u01F0\u01F6\x07b\x02\x02\u01F1\u01F5\n\n\x02\x02" + - "\u01F2\u01F3\x07b\x02\x02\u01F3\u01F5\x07b\x02\x02\u01F4\u01F1\x03\x02" + - "\x02\x02\u01F4\u01F2\x03\x02\x02\x02\u01F5\u01F8\x03\x02\x02\x02\u01F6" + - "\u01F4\x03\x02\x02\x02\u01F6\u01F7\x03\x02\x02\x02\u01F7\u01F9\x03\x02" + - "\x02\x02\u01F8\u01F6\x03\x02\x02\x02\u01F9\u01FA\x07b\x02\x02\u01FAx\x03" + - "\x02\x02\x02\u01FB\u01FC\x05\x17\v\x02\u01FC\u01FD\x03\x02\x02\x02\u01FD" + - "\u01FE\b<\x04\x02\u01FEz\x03\x02\x02\x02\u01FF\u0200\x05\x19\f\x02\u0200" + - "\u0201\x03\x02\x02\x02\u0201\u0202\b=\x04\x02\u0202|\x03\x02\x02\x02\u0203" + - "\u0204\x05\x1B\r\x02\u0204\u0205\x03\x02\x02\x02\u0205\u0206\b>\x04\x02" + - "\u0206~\x03\x02\x02\x02\u0207\u0208\x07~\x02\x02\u0208\u0209\x03\x02\x02" + - "\x02\u0209\u020A\b?\x07\x02\u020A\u020B\b?\x05\x02\u020B\x80\x03\x02\x02" + - "\x02\u020C\u020D\x07_\x02\x02\u020D\u020E\x03\x02\x02\x02\u020E\u020F" + - "\b@\x05\x02\u020F\u0210\b@\x05\x02\u0210\u0211\b@\b\x02\u0211\x82\x03" + - "\x02\x02\x02\u0212\u0213\x07.\x02\x02\u0213\u0214\x03\x02\x02\x02\u0214" + - "\u0215\bA\t\x02\u0215\x84\x03\x02\x02\x02\u0216\u0217\x07?\x02\x02\u0217" + - "\u0218\x03\x02\x02\x02\u0218\u0219\bB\n\x02\u0219\x86\x03\x02\x02\x02" + - "\u021A\u021C\x05\x89D\x02\u021B\u021A\x03\x02\x02\x02\u021C\u021D\x03" + - "\x02\x02\x02\u021D\u021B\x03\x02\x02\x02\u021D\u021E\x03\x02\x02\x02\u021E" + - "\x88\x03\x02\x02\x02\u021F\u0221\n\v\x02\x02\u0220\u021F\x03\x02\x02\x02" + - "\u0221\u0222\x03\x02\x02\x02\u0222\u0220\x03\x02\x02\x02\u0222\u0223\x03" + - "\x02\x02\x02\u0223\u0227\x03\x02\x02\x02\u0224\u0225\x071\x02\x02\u0225" + - "\u0227\n\f\x02\x02\u0226\u0220\x03\x02\x02\x02\u0226\u0224\x03\x02\x02" + - "\x02\u0227\x8A\x03\x02\x02\x02\u0228\u0229\x05w;\x02\u0229\x8C\x03\x02" + - "\x02\x02\u022A\u022B\x05\x17\v"; - private static readonly _serializedATNSegment1: string = - "\x02\u022B\u022C\x03\x02\x02\x02\u022C\u022D\bF\x04\x02\u022D\x8E\x03" + - "\x02\x02\x02\u022E\u022F\x05\x19\f\x02\u022F\u0230\x03\x02\x02\x02\u0230" + - "\u0231\bG\x04\x02\u0231\x90\x03\x02\x02\x02\u0232\u0233\x05\x1B\r\x02" + - "\u0233\u0234\x03\x02\x02\x02\u0234\u0235\bH\x04\x02\u0235\x92\x03\x02" + - "\x02\x02\u0236\u0238\n\r\x02\x02\u0237\u0236\x03\x02\x02\x02\u0238\u0239" + - "\x03\x02\x02\x02\u0239\u0237\x03\x02\x02\x02\u0239\u023A\x03\x02\x02\x02" + - "\u023A\u023B\x03\x02\x02\x02\u023B\u023C\bI\x02\x02\u023C\x94\x03\x02" + - "\x02\x02%\x02\x03\x04\xE2\xE6\xE9\xF2\xF4\xFF\u0112\u0117\u011C\u011E" + - "\u0129\u0131\u0134\u0136\u013B\u0140\u0146\u014D\u0152\u0158\u015B\u0163" + - "\u0167\u01E6\u01EB\u01ED\u01F4\u01F6\u021D\u0222\u0226\u0239\v\x07\x03" + - "\x02\x07\x04\x02\x02\x03\x02\x06\x02\x02\x07\x02\x02\t\x0F\x02\t\x1F\x02" + - "\t\x17\x02\t\x16\x02"; - public static readonly _serializedATN: string = Utils.join( - [ - esql_lexer._serializedATNSegment0, - esql_lexer._serializedATNSegment1, - ], - "", - ); + ";\t;\x04<\t<\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03" + + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + + "\x03\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x05\x03" + + "\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x06\x03\x06\x03" + + "\x06\x03\x06\x03\x06\x03\x06\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03" + + "\x07\x03\x07\x03\x07\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\t\x03" + + "\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x03" + + "\n\x03\n\x03\n\x03\n\x03\n\x03\v\x03\v\x03\v\x03\v\x07\v\xC7\n\v\f\v\x0E" + + "\v\xCA\v\v\x03\v\x05\v\xCD\n\v\x03\v\x05\v\xD0\n\v\x03\v\x03\v\x03\f\x03" + + "\f\x03\f\x03\f\x03\f\x07\f\xD9\n\f\f\f\x0E\f\xDC\v\f\x03\f\x03\f\x03\f" + + "\x03\f\x03\f\x03\r\x06\r\xE4\n\r\r\r\x0E\r\xE5\x03\r\x03\r\x03\x0E\x03" + + "\x0E\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x11\x03\x11\x03" + + "\x11\x03\x12\x03\x12\x03\x13\x03\x13\x05\x13\xF9\n\x13\x03\x13\x06\x13" + + "\xFC\n\x13\r\x13\x0E\x13\xFD\x03\x14\x03\x14\x03\x14\x07\x14\u0103\n\x14" + + "\f\x14\x0E\x14\u0106\v\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03" + + "\x14\x07\x14\u010E\n\x14\f\x14\x0E\x14\u0111\v\x14\x03\x14\x03\x14\x03" + + "\x14\x03\x14\x03\x14\x05\x14\u0118\n\x14\x03\x14\x05\x14\u011B\n\x14\x05" + + "\x14\u011D\n\x14\x03\x15\x06\x15\u0120\n\x15\r\x15\x0E\x15\u0121\x03\x16" + + "\x06\x16\u0125\n\x16\r\x16\x0E\x16\u0126\x03\x16\x03\x16\x07\x16\u012B" + + "\n\x16\f\x16\x0E\x16\u012E\v\x16\x03\x16\x03\x16\x06\x16\u0132\n\x16\r" + + "\x16\x0E\x16\u0133\x03\x16\x06\x16\u0137\n\x16\r\x16\x0E\x16\u0138\x03" + + "\x16\x03\x16\x07\x16\u013D\n\x16\f\x16\x0E\x16\u0140\v\x16\x05\x16\u0142" + + "\n\x16\x03\x16\x03\x16\x03\x16\x03\x16\x06\x16\u0148\n\x16\r\x16\x0E\x16" + + "\u0149\x03\x16\x03\x16\x05\x16\u014E\n\x16\x03\x17\x03\x17\x03\x17\x03" + + "\x18\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1B\x03" + + "\x1B\x03\x1C\x03\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03" + + "\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03 \x03 \x03 \x03" + + " \x03 \x03!\x03!\x03!\x03\"\x03\"\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x03" + + "#\x03#\x05#\u017F\n#\x03$\x03$\x03$\x03$\x03$\x03$\x03$\x03$\x03$\x03" + + "$\x05$\u018B\n$\x03%\x03%\x03&\x03&\x03\'\x03\'\x03(\x03(\x03)\x03)\x03" + + "*\x03*\x03*\x03*\x03*\x03*\x03*\x05*\u019E\n*\x03+\x03+\x03+\x03+\x03" + + "+\x03+\x03,\x03,\x03,\x03,\x03,\x03,\x03,\x03,\x03,\x05,\u01AF\n,\x03" + + "-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03" + + "-\x03-\x03-\x05-\u01C2\n-\x03.\x03.\x05.\u01C6\n.\x03.\x03.\x03.\x07." + + "\u01CB\n.\f.\x0E.\u01CE\v.\x03/\x03/\x03/\x03/\x07/\u01D4\n/\f/\x0E/\u01D7" + + "\v/\x03/\x03/\x030\x030\x030\x030\x031\x031\x031\x031\x032\x032\x032\x03" + + "2\x033\x033\x033\x033\x033\x034\x034\x034\x034\x034\x034\x035\x035\x03" + + "5\x035\x036\x036\x036\x036\x037\x067\u01FB\n7\r7\x0E7\u01FC\x038\x068" + + "\u0200\n8\r8\x0E8\u0201\x038\x038\x058\u0206\n8\x039\x039\x03:\x03:\x03" + + ":\x03:\x03;\x03;\x03;\x03;\x03<\x03<\x03<\x03<\x04\xDA\u010F\x02\x02=" + + "\x05\x02\x03\x07\x02\x04\t\x02\x05\v\x02\x06\r\x02\x07\x0F\x02\b\x11\x02" + + "\t\x13\x02\n\x15\x02\v\x17\x02\f\x19\x02\r\x1B\x02\x0E\x1D\x02\x0F\x1F" + + "\x02\x02!\x02\x02#\x02\x02%\x02\x02\'\x02\x02)\x02\x10+\x02\x11-\x02\x12" + + "/\x02\x131\x02\x143\x02\x155\x02\x167\x02\x179\x02\x18;\x02\x19=\x02\x1A" + + "?\x02\x1BA\x02\x1CC\x02\x1DE\x02\x1EG\x02\x1FI\x02 K\x02!M\x02\"O\x02" + + "#Q\x02$S\x02%U\x02&W\x02\'Y\x02([\x02)]\x02*_\x02+a\x02,c\x02-e\x02.g" + + "\x02\x02i\x02\x02k\x02\x02m\x02\x02o\x02/q\x02\x02s\x020u\x021w\x022y" + + "\x023\x05\x02\x03\x04\r\x04\x02\f\f\x0F\x0F\x05\x02\v\f\x0F\x0F\"\"\x03" + + "\x022;\x04\x02C\\c|\x07\x02$$^^ppttvv\x06\x02\f\f\x0F\x0F$$^^\x04\x02" + + "GGgg\x04\x02--//\x03\x02bb\f\x02\v\f\x0F\x0F\"\"..11??]]__bb~~\x04\x02" + + ",,11\x02\u023A\x02\x05\x03\x02\x02\x02\x02\x07\x03\x02\x02\x02\x02\t\x03" + + "\x02\x02\x02\x02\v\x03\x02\x02\x02\x02\r\x03\x02\x02\x02\x02\x0F\x03\x02" + + "\x02\x02\x02\x11\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02" + + "\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02" + + "\x02\x02\x03\x1D\x03\x02\x02\x02\x03)\x03\x02\x02\x02\x03+\x03\x02\x02" + + "\x02\x03-\x03\x02\x02\x02\x03/\x03\x02\x02\x02\x031\x03\x02\x02\x02\x03" + + "3\x03\x02\x02\x02\x035\x03\x02\x02\x02\x037\x03\x02\x02\x02\x039\x03\x02" + + "\x02\x02\x03;\x03\x02\x02\x02\x03=\x03\x02\x02\x02\x03?\x03\x02\x02\x02" + + "\x03A\x03\x02\x02\x02\x03C\x03\x02\x02\x02\x03E\x03\x02\x02\x02\x03G\x03" + + "\x02\x02\x02\x03I\x03\x02\x02\x02\x03K\x03\x02\x02\x02\x03M\x03\x02\x02" + + "\x02\x03O\x03\x02\x02\x02\x03Q\x03\x02\x02\x02\x03S\x03\x02\x02\x02\x03" + + "U\x03\x02\x02\x02\x03W\x03\x02\x02\x02\x03Y\x03\x02\x02\x02\x03[\x03\x02" + + "\x02\x02\x03]\x03\x02\x02\x02\x03_\x03\x02\x02\x02\x03a\x03\x02\x02\x02" + + "\x03c\x03\x02\x02\x02\x03e\x03\x02\x02\x02\x04g\x03\x02\x02\x02\x04i\x03" + + "\x02\x02\x02\x04k\x03\x02\x02\x02\x04m\x03\x02\x02\x02\x04o\x03\x02\x02" + + "\x02\x04s\x03\x02\x02\x02\x04u\x03\x02\x02\x02\x04w\x03\x02\x02\x02\x04" + + "y\x03\x02\x02\x02\x05{\x03\x02\x02\x02\x07\x82\x03\x02\x02\x02\t\x8C\x03" + + "\x02\x02\x02\v\x93\x03\x02\x02\x02\r\x99\x03\x02\x02\x02\x0F\xA1\x03\x02" + + "\x02\x02\x11\xA9\x03\x02\x02\x02\x13\xB0\x03\x02\x02\x02\x15\xB8\x03\x02" + + "\x02\x02\x17\xC2\x03\x02\x02\x02\x19\xD3\x03\x02\x02\x02\x1B\xE3\x03\x02" + + "\x02\x02\x1D\xE9\x03\x02\x02\x02\x1F\xED\x03\x02\x02\x02!\xEF\x03\x02" + + "\x02\x02#\xF1\x03\x02\x02\x02%\xF4\x03\x02\x02\x02\'\xF6\x03\x02\x02\x02" + + ")\u011C\x03\x02\x02\x02+\u011F\x03\x02\x02\x02-\u014D\x03\x02\x02\x02" + + "/\u014F\x03\x02\x02\x021\u0152\x03\x02\x02\x023\u0156\x03\x02\x02\x02" + + "5\u0158\x03\x02\x02\x027\u015A\x03\x02\x02\x029\u015C\x03\x02\x02\x02" + + ";\u015E\x03\x02\x02\x02=\u0162\x03\x02\x02\x02?\u0167\x03\x02\x02\x02" + + "A\u016B\x03\x02\x02\x02C\u0170\x03\x02\x02\x02E\u0173\x03\x02\x02\x02" + + "G\u017E\x03\x02\x02\x02I\u018A\x03\x02\x02\x02K\u018C\x03\x02\x02\x02" + + "M\u018E\x03\x02\x02\x02O\u0190\x03\x02\x02\x02Q\u0192\x03\x02\x02\x02" + + "S\u0194\x03\x02\x02\x02U\u019D\x03\x02\x02\x02W\u019F\x03\x02\x02\x02" + + "Y\u01AE\x03\x02\x02\x02[\u01C1\x03\x02\x02\x02]\u01C5\x03\x02\x02\x02" + + "_\u01CF\x03\x02\x02\x02a\u01DA\x03\x02\x02\x02c\u01DE\x03\x02\x02\x02" + + "e\u01E2\x03\x02\x02\x02g\u01E6\x03\x02\x02\x02i\u01EB\x03\x02\x02\x02" + + "k\u01F1\x03\x02\x02\x02m\u01F5\x03\x02\x02\x02o\u01FA\x03\x02\x02\x02" + + "q\u0205\x03\x02\x02\x02s\u0207\x03\x02\x02\x02u\u0209\x03\x02\x02\x02" + + "w\u020D\x03\x02\x02\x02y\u0211\x03\x02\x02\x02{|\x07g\x02\x02|}\x07x\x02" + + "\x02}~\x07c\x02\x02~\x7F\x07n\x02\x02\x7F\x80\x03\x02\x02\x02\x80\x81" + + "\b\x02\x02\x02\x81\x06\x03\x02\x02\x02\x82\x83\x07g\x02\x02\x83\x84\x07" + + "z\x02\x02\x84\x85\x07r\x02\x02\x85\x86\x07n\x02\x02\x86\x87\x07c\x02\x02" + + "\x87\x88\x07k\x02\x02\x88\x89\x07p\x02\x02\x89\x8A\x03\x02\x02\x02\x8A" + + "\x8B\b\x03\x02\x02\x8B\b\x03\x02\x02\x02\x8C\x8D\x07h\x02\x02\x8D\x8E" + + "\x07t\x02\x02\x8E\x8F\x07q\x02\x02\x8F\x90\x07o\x02\x02\x90\x91\x03\x02" + + "\x02\x02\x91\x92\b\x04\x03\x02\x92\n\x03\x02\x02\x02\x93\x94\x07t\x02" + + "\x02\x94\x95\x07q\x02\x02\x95\x96\x07y\x02\x02\x96\x97\x03\x02\x02\x02" + + "\x97\x98\b\x05\x02\x02\x98\f\x03\x02\x02\x02\x99\x9A\x07u\x02\x02\x9A" + + "\x9B\x07v\x02\x02\x9B\x9C\x07c\x02\x02\x9C\x9D\x07v\x02\x02\x9D\x9E\x07" + + "u\x02\x02\x9E\x9F\x03\x02\x02\x02\x9F\xA0\b\x06\x02\x02\xA0\x0E\x03\x02" + + "\x02\x02\xA1\xA2\x07y\x02\x02\xA2\xA3\x07j\x02\x02\xA3\xA4\x07g\x02\x02" + + "\xA4\xA5\x07t\x02\x02\xA5\xA6\x07g\x02\x02\xA6\xA7\x03\x02\x02\x02\xA7" + + "\xA8\b\x07\x02\x02\xA8\x10\x03\x02\x02\x02\xA9\xAA\x07u\x02\x02\xAA\xAB" + + "\x07q\x02\x02\xAB\xAC\x07t\x02\x02\xAC\xAD\x07v\x02\x02\xAD\xAE\x03\x02" + + "\x02\x02\xAE\xAF\b\b\x02\x02\xAF\x12\x03\x02\x02\x02\xB0\xB1\x07n\x02" + + "\x02\xB1\xB2\x07k\x02\x02\xB2\xB3\x07o\x02\x02\xB3\xB4\x07k\x02\x02\xB4" + + "\xB5\x07v\x02\x02\xB5\xB6\x03\x02\x02\x02\xB6\xB7\b\t\x02\x02\xB7\x14" + + "\x03\x02\x02\x02\xB8\xB9\x07r\x02\x02\xB9\xBA\x07t\x02\x02\xBA\xBB\x07" + + "q\x02\x02\xBB\xBC\x07l\x02\x02\xBC\xBD\x07g\x02\x02\xBD\xBE\x07e\x02\x02" + + "\xBE\xBF\x07v\x02\x02\xBF\xC0\x03\x02\x02\x02\xC0\xC1\b\n\x03\x02\xC1" + + "\x16\x03\x02\x02\x02\xC2\xC3\x071\x02\x02\xC3\xC4\x071\x02\x02\xC4\xC8" + + "\x03\x02\x02\x02\xC5\xC7\n\x02\x02\x02\xC6\xC5\x03\x02\x02\x02\xC7\xCA" + + "\x03\x02\x02\x02\xC8\xC6\x03\x02\x02\x02\xC8\xC9\x03\x02\x02\x02\xC9\xCC" + + "\x03\x02\x02\x02\xCA\xC8\x03\x02\x02\x02\xCB\xCD\x07\x0F\x02\x02\xCC\xCB" + + "\x03\x02\x02\x02\xCC\xCD\x03\x02\x02\x02\xCD\xCF\x03\x02\x02\x02\xCE\xD0" + + "\x07\f\x02\x02\xCF\xCE\x03\x02\x02\x02\xCF\xD0\x03\x02\x02\x02\xD0\xD1" + + "\x03\x02\x02\x02\xD1\xD2\b\v\x04\x02\xD2\x18\x03\x02\x02\x02\xD3\xD4\x07" + + "1\x02\x02\xD4\xD5\x07,\x02\x02\xD5\xDA\x03\x02\x02\x02\xD6\xD9\x05\x19" + + "\f\x02\xD7\xD9\v\x02\x02\x02\xD8\xD6\x03\x02\x02\x02\xD8\xD7\x03\x02\x02" + + "\x02\xD9\xDC\x03\x02\x02\x02\xDA\xDB\x03\x02\x02\x02\xDA\xD8\x03\x02\x02" + + "\x02\xDB\xDD\x03\x02\x02\x02\xDC\xDA\x03\x02\x02\x02\xDD\xDE\x07,\x02" + + "\x02\xDE\xDF\x071\x02\x02\xDF\xE0\x03\x02\x02\x02\xE0\xE1\b\f\x04\x02" + + "\xE1\x1A\x03\x02\x02\x02\xE2\xE4\t\x03\x02\x02\xE3\xE2\x03\x02\x02\x02" + + "\xE4\xE5\x03\x02\x02\x02\xE5\xE3\x03\x02\x02\x02\xE5\xE6\x03\x02\x02\x02" + + "\xE6\xE7\x03\x02\x02\x02\xE7\xE8\b\r\x04\x02\xE8\x1C\x03\x02\x02\x02\xE9" + + "\xEA\x07~\x02\x02\xEA\xEB\x03\x02\x02\x02\xEB\xEC\b\x0E\x05\x02\xEC\x1E" + + "\x03\x02\x02\x02\xED\xEE\t\x04\x02\x02\xEE \x03\x02\x02\x02\xEF\xF0\t" + + "\x05\x02\x02\xF0\"\x03\x02\x02\x02\xF1\xF2\x07^\x02\x02\xF2\xF3\t\x06" + + "\x02\x02\xF3$\x03\x02\x02\x02\xF4\xF5\n\x07\x02\x02\xF5&\x03\x02\x02\x02" + + "\xF6\xF8\t\b\x02\x02\xF7\xF9\t\t\x02\x02\xF8\xF7\x03\x02\x02\x02\xF8\xF9" + + "\x03\x02\x02\x02\xF9\xFB\x03\x02\x02\x02\xFA\xFC\x05\x1F\x0F\x02\xFB\xFA" + + "\x03\x02\x02\x02\xFC\xFD\x03\x02\x02\x02\xFD\xFB\x03\x02\x02\x02\xFD\xFE" + + "\x03\x02\x02\x02\xFE(\x03\x02\x02\x02\xFF\u0104\x07$\x02\x02\u0100\u0103" + + "\x05#\x11\x02\u0101\u0103\x05%\x12\x02\u0102\u0100\x03\x02\x02\x02\u0102" + + "\u0101\x03\x02\x02\x02\u0103\u0106\x03\x02\x02\x02\u0104\u0102\x03\x02" + + "\x02\x02\u0104\u0105\x03\x02\x02\x02\u0105\u0107\x03\x02\x02\x02\u0106" + + "\u0104\x03\x02\x02\x02\u0107\u011D\x07$\x02\x02\u0108\u0109\x07$\x02\x02" + + "\u0109\u010A\x07$\x02\x02\u010A\u010B\x07$\x02\x02\u010B\u010F\x03\x02" + + "\x02\x02\u010C\u010E\n\x02\x02\x02\u010D\u010C\x03\x02\x02\x02\u010E\u0111" + + "\x03\x02\x02\x02\u010F\u0110\x03\x02\x02\x02\u010F\u010D\x03\x02\x02\x02" + + "\u0110\u0112\x03\x02\x02\x02\u0111\u010F\x03\x02\x02\x02\u0112\u0113\x07" + + "$\x02\x02\u0113\u0114\x07$\x02\x02\u0114\u0115\x07$\x02\x02\u0115\u0117" + + "\x03\x02\x02\x02\u0116\u0118\x07$\x02\x02\u0117\u0116\x03\x02\x02\x02" + + "\u0117\u0118\x03\x02\x02\x02\u0118\u011A\x03\x02\x02\x02\u0119\u011B\x07" + + "$\x02\x02\u011A\u0119\x03\x02\x02\x02\u011A\u011B\x03\x02\x02\x02\u011B" + + "\u011D\x03\x02\x02\x02\u011C\xFF\x03\x02\x02\x02\u011C\u0108\x03\x02\x02" + + "\x02\u011D*\x03\x02\x02\x02\u011E\u0120\x05\x1F\x0F\x02\u011F\u011E\x03" + + "\x02\x02\x02\u0120\u0121\x03\x02\x02\x02\u0121\u011F\x03\x02\x02\x02\u0121" + + "\u0122\x03\x02\x02\x02\u0122,\x03\x02\x02\x02\u0123\u0125\x05\x1F\x0F" + + "\x02\u0124\u0123\x03\x02\x02\x02\u0125\u0126\x03\x02\x02\x02\u0126\u0124" + + "\x03\x02\x02\x02\u0126\u0127\x03\x02\x02\x02\u0127\u0128\x03\x02\x02\x02" + + "\u0128\u012C\x057\x1B\x02\u0129\u012B\x05\x1F\x0F\x02\u012A\u0129\x03" + + "\x02\x02\x02\u012B\u012E\x03\x02\x02\x02\u012C\u012A\x03\x02\x02\x02\u012C" + + "\u012D\x03\x02\x02\x02\u012D\u014E\x03\x02\x02\x02\u012E\u012C\x03\x02" + + "\x02\x02\u012F\u0131\x057\x1B\x02\u0130\u0132\x05\x1F\x0F\x02\u0131\u0130" + + "\x03\x02\x02\x02\u0132\u0133\x03\x02\x02\x02\u0133\u0131\x03\x02\x02\x02" + + "\u0133\u0134\x03\x02\x02\x02\u0134\u014E\x03\x02\x02\x02\u0135\u0137\x05" + + "\x1F\x0F\x02\u0136\u0135\x03\x02\x02\x02\u0137\u0138\x03\x02\x02\x02\u0138" + + "\u0136\x03\x02\x02\x02\u0138\u0139\x03\x02\x02\x02\u0139\u0141\x03\x02" + + "\x02\x02\u013A\u013E\x057\x1B\x02\u013B\u013D\x05\x1F\x0F\x02\u013C\u013B" + + "\x03\x02\x02\x02\u013D\u0140\x03\x02\x02\x02\u013E\u013C\x03\x02\x02\x02" + + "\u013E\u013F\x03\x02\x02\x02\u013F\u0142\x03\x02\x02\x02\u0140\u013E\x03" + + "\x02\x02\x02\u0141\u013A\x03\x02\x02\x02\u0141\u0142\x03\x02\x02\x02\u0142" + + "\u0143\x03\x02\x02\x02\u0143\u0144\x05\'\x13\x02\u0144\u014E\x03\x02\x02" + + "\x02\u0145\u0147\x057\x1B\x02\u0146\u0148\x05\x1F\x0F\x02\u0147\u0146" + + "\x03\x02\x02\x02\u0148\u0149\x03\x02\x02\x02\u0149\u0147\x03\x02\x02\x02" + + "\u0149\u014A\x03\x02\x02\x02\u014A\u014B\x03\x02\x02\x02\u014B\u014C\x05" + + "\'\x13\x02\u014C\u014E\x03\x02\x02\x02\u014D\u0124\x03\x02\x02\x02\u014D" + + "\u012F\x03\x02\x02\x02\u014D\u0136\x03\x02\x02\x02\u014D\u0145\x03\x02" + + "\x02\x02\u014E.\x03\x02\x02\x02\u014F\u0150\x07d\x02\x02\u0150\u0151\x07" + + "{\x02\x02\u01510\x03\x02\x02\x02\u0152\u0153\x07c\x02\x02\u0153\u0154" + + "\x07p\x02\x02\u0154\u0155\x07f\x02\x02\u01552\x03\x02\x02\x02\u0156\u0157" + + "\x07?\x02\x02\u01574\x03\x02\x02\x02\u0158\u0159\x07.\x02\x02\u01596\x03" + + "\x02\x02\x02\u015A\u015B\x070\x02\x02\u015B8\x03\x02\x02\x02\u015C\u015D" + + "\x07*\x02\x02\u015D:\x03\x02\x02\x02\u015E\u015F\x07]\x02\x02\u015F\u0160" + + "\x03\x02\x02\x02\u0160\u0161\b\x1D\x06\x02\u0161<\x03\x02\x02\x02\u0162" + + "\u0163\x07_\x02\x02\u0163\u0164\x03\x02\x02\x02\u0164\u0165\b\x1E\x05" + + "\x02\u0165\u0166\b\x1E\x05\x02\u0166>\x03\x02\x02\x02\u0167\u0168\x07" + + "p\x02\x02\u0168\u0169\x07q\x02\x02\u0169\u016A\x07v\x02\x02\u016A@\x03" + + "\x02\x02\x02\u016B\u016C\x07p\x02\x02\u016C\u016D\x07w\x02\x02\u016D\u016E" + + "\x07n\x02\x02\u016E\u016F\x07n\x02\x02\u016FB\x03\x02\x02\x02\u0170\u0171" + + "\x07q\x02\x02\u0171\u0172\x07t\x02\x02\u0172D\x03\x02\x02\x02\u0173\u0174" + + "\x07+\x02\x02\u0174F\x03\x02\x02\x02\u0175\u0176\x07v\x02\x02\u0176\u0177" + + "\x07t\x02\x02\u0177\u0178\x07w\x02\x02\u0178\u017F\x07g\x02\x02\u0179" + + "\u017A\x07h\x02\x02\u017A\u017B\x07c\x02\x02\u017B\u017C\x07n\x02\x02" + + "\u017C\u017D\x07u\x02\x02\u017D\u017F\x07g\x02\x02\u017E\u0175\x03\x02" + + "\x02\x02\u017E\u0179\x03\x02\x02\x02\u017FH\x03\x02\x02\x02\u0180\u0181" + + "\x07?\x02\x02\u0181\u018B\x07?\x02\x02\u0182\u0183\x07#\x02\x02\u0183" + + "\u018B\x07?\x02\x02\u0184\u018B\x07>\x02\x02\u0185\u0186\x07>\x02\x02" + + "\u0186\u018B\x07?\x02\x02\u0187\u018B\x07@\x02\x02\u0188\u0189\x07@\x02" + + "\x02\u0189\u018B\x07?\x02\x02\u018A\u0180\x03\x02\x02\x02\u018A\u0182" + + "\x03\x02\x02\x02\u018A\u0184\x03\x02\x02\x02\u018A\u0185\x03\x02\x02\x02" + + "\u018A\u0187\x03\x02\x02\x02\u018A\u0188\x03\x02\x02\x02\u018BJ\x03\x02" + + "\x02\x02\u018C\u018D\x07-\x02\x02\u018DL\x03\x02\x02\x02\u018E\u018F\x07" + + "/\x02\x02\u018FN\x03\x02\x02\x02\u0190\u0191\x07,\x02\x02\u0191P\x03\x02" + + "\x02\x02\u0192\u0193\x071\x02\x02\u0193R\x03\x02\x02\x02\u0194\u0195\x07" + + "\'\x02\x02\u0195T\x03\x02\x02\x02\u0196\u0197\x07c\x02\x02\u0197\u0198" + + "\x07u\x02\x02\u0198\u019E\x07e\x02\x02\u0199\u019A\x07f\x02\x02\u019A" + + "\u019B\x07g\x02\x02\u019B\u019C\x07u\x02\x02\u019C\u019E\x07e\x02\x02" + + "\u019D\u0196\x03\x02\x02\x02\u019D\u0199\x03\x02\x02\x02\u019EV\x03\x02" + + "\x02\x02\u019F\u01A0\x07p\x02\x02\u01A0\u01A1\x07w\x02\x02\u01A1\u01A2" + + "\x07n\x02\x02\u01A2\u01A3\x07n\x02\x02\u01A3\u01A4\x07u\x02\x02\u01A4" + + "X\x03\x02\x02\x02\u01A5\u01A6\x07h\x02\x02\u01A6\u01A7\x07k\x02\x02\u01A7" + + "\u01A8\x07t\x02\x02\u01A8\u01A9\x07u\x02\x02\u01A9\u01AF\x07v\x02\x02" + + "\u01AA\u01AB\x07n\x02\x02\u01AB\u01AC\x07c\x02\x02\u01AC\u01AD\x07u\x02" + + "\x02\u01AD\u01AF\x07v\x02\x02\u01AE\u01A5\x03\x02\x02\x02\u01AE\u01AA" + + "\x03\x02\x02\x02\u01AFZ\x03\x02\x02\x02\u01B0\u01B1\x07t\x02\x02\u01B1" + + "\u01B2\x07q\x02\x02\u01B2\u01B3\x07w\x02\x02\u01B3\u01B4\x07p\x02\x02" + + "\u01B4\u01C2\x07f\x02\x02\u01B5\u01B6\x07c\x02\x02\u01B6\u01B7\x07x\x02" + + "\x02\u01B7\u01C2\x07i\x02\x02\u01B8\u01B9\x07o\x02\x02\u01B9\u01BA\x07" + + "k\x02\x02\u01BA\u01C2\x07p\x02\x02\u01BB\u01BC\x07o\x02\x02\u01BC\u01BD" + + "\x07c\x02\x02\u01BD\u01C2\x07z\x02\x02\u01BE\u01BF\x07u\x02\x02\u01BF" + + "\u01C0\x07w\x02\x02\u01C0\u01C2\x07o\x02\x02\u01C1\u01B0\x03\x02\x02\x02" + + "\u01C1\u01B5\x03\x02\x02\x02\u01C1\u01B8\x03\x02\x02\x02\u01C1\u01BB\x03" + + "\x02\x02\x02\u01C1\u01BE\x03\x02\x02\x02\u01C2\\\x03\x02\x02\x02\u01C3" + + "\u01C6\x05!\x10\x02\u01C4\u01C6\x07a\x02\x02\u01C5\u01C3\x03\x02\x02\x02" + + "\u01C5\u01C4\x03\x02\x02\x02\u01C6\u01CC\x03\x02\x02\x02\u01C7\u01CB\x05" + + "!\x10\x02\u01C8\u01CB\x05\x1F\x0F\x02\u01C9\u01CB\x07a\x02\x02\u01CA\u01C7" + + "\x03\x02\x02\x02\u01CA\u01C8\x03\x02\x02\x02\u01CA\u01C9\x03\x02\x02\x02" + + "\u01CB\u01CE\x03\x02\x02\x02\u01CC\u01CA\x03\x02\x02\x02\u01CC\u01CD\x03" + + "\x02\x02\x02\u01CD^\x03\x02\x02\x02\u01CE\u01CC\x03\x02\x02\x02\u01CF" + + "\u01D5\x07b\x02\x02\u01D0\u01D4\n\n\x02\x02\u01D1\u01D2\x07b\x02\x02\u01D2" + + "\u01D4\x07b\x02\x02\u01D3\u01D0\x03\x02\x02\x02\u01D3\u01D1\x03\x02\x02" + + "\x02\u01D4\u01D7\x03\x02\x02\x02\u01D5\u01D3\x03\x02\x02\x02\u01D5\u01D6" + + "\x03\x02\x02\x02\u01D6\u01D8\x03\x02\x02\x02\u01D7\u01D5\x03\x02\x02\x02" + + "\u01D8\u01D9\x07b\x02\x02\u01D9`\x03\x02\x02\x02\u01DA\u01DB\x05\x17\v" + + "\x02\u01DB\u01DC\x03\x02\x02\x02\u01DC\u01DD\b0\x04\x02\u01DDb\x03\x02" + + "\x02\x02\u01DE\u01DF\x05\x19\f\x02\u01DF\u01E0\x03\x02\x02\x02\u01E0\u01E1" + + "\b1\x04\x02\u01E1d\x03\x02\x02\x02\u01E2\u01E3\x05\x1B\r\x02\u01E3\u01E4" + + "\x03\x02\x02\x02\u01E4\u01E5\b2\x04\x02\u01E5f\x03\x02\x02\x02\u01E6\u01E7" + + "\x07~\x02\x02\u01E7\u01E8\x03\x02\x02\x02\u01E8\u01E9\b3\x07\x02\u01E9" + + "\u01EA\b3\x05\x02\u01EAh\x03\x02\x02\x02\u01EB\u01EC\x07_\x02\x02\u01EC" + + "\u01ED\x03\x02\x02\x02\u01ED\u01EE\b4\x05\x02\u01EE\u01EF\b4\x05\x02\u01EF" + + "\u01F0\b4\b\x02\u01F0j\x03\x02\x02\x02\u01F1\u01F2\x07.\x02\x02\u01F2" + + "\u01F3\x03\x02\x02\x02\u01F3\u01F4\b5\t\x02\u01F4l\x03\x02\x02\x02\u01F5" + + "\u01F6\x07?\x02\x02\u01F6\u01F7\x03\x02\x02\x02\u01F7\u01F8\b6\n\x02\u01F8" + + "n\x03\x02\x02\x02\u01F9\u01FB\x05q8\x02\u01FA\u01F9\x03\x02\x02\x02\u01FB" + + "\u01FC\x03\x02\x02\x02\u01FC\u01FA\x03\x02\x02\x02\u01FC\u01FD\x03\x02" + + "\x02\x02\u01FDp\x03\x02\x02\x02\u01FE\u0200\n\v\x02\x02\u01FF\u01FE\x03" + + "\x02\x02\x02\u0200\u0201\x03\x02\x02\x02\u0201\u01FF\x03\x02\x02\x02\u0201" + + "\u0202\x03\x02\x02\x02\u0202\u0206\x03\x02\x02\x02\u0203\u0204\x071\x02" + + "\x02\u0204\u0206\n\f\x02\x02\u0205\u01FF\x03\x02\x02\x02\u0205\u0203\x03" + + "\x02\x02\x02\u0206r\x03\x02\x02\x02\u0207\u0208\x05_/\x02\u0208t\x03\x02" + + "\x02\x02\u0209\u020A\x05\x17\v\x02\u020A\u020B\x03\x02\x02\x02\u020B\u020C" + + "\b:\x04\x02\u020Cv\x03\x02\x02\x02\u020D\u020E\x05\x19\f\x02\u020E\u020F" + + "\x03\x02\x02\x02\u020F\u0210\b;\x04\x02\u0210x\x03\x02\x02\x02\u0211\u0212" + + "\x05\x1B\r\x02\u0212\u0213\x03\x02\x02\x02\u0213\u0214\b<\x04\x02\u0214" + + "z\x03\x02\x02\x02)\x02\x03\x04\xC8\xCC\xCF\xD8\xDA\xE5\xF8\xFD\u0102\u0104" + + "\u010F\u0117\u011A\u011C\u0121\u0126\u012C\u0133\u0138\u013E\u0141\u0149" + + "\u014D\u017E\u018A\u019D\u01AE\u01C1\u01C5\u01CA\u01CC\u01D3\u01D5\u01FC" + + "\u0201\u0205\v\x07\x03\x02\x07\x04\x02\x02\x03\x02\x06\x02\x02\x07\x02" + + "\x02\t\x0F\x02\t\x1A\x02\t\x16\x02\t\x15\x02"; public static __ATN: ATN; public static get _ATN(): ATN { if (!esql_lexer.__ATN) { diff --git a/packages/kbn-monaco/src/esql/antlr/esql_parser.g4 b/packages/kbn-monaco/src/esql/antlr/esql_parser.g4 index f3141d22c5c8..6196874af91b 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_parser.g4 +++ b/packages/kbn-monaco/src/esql/antlr/esql_parser.g4 @@ -39,30 +39,38 @@ whereCommand ; booleanExpression - : NOT booleanExpression #logicalNot - | valueExpression #booleanDefault - | left=booleanExpression operator=AND right=booleanExpression #logicalBinary - | left=booleanExpression operator=OR right=booleanExpression #logicalBinary + : NOT booleanExpression + | valueExpression + | left=booleanExpression operator=AND right=booleanExpression + | left=booleanExpression operator=OR right=booleanExpression ; valueExpression - : functionIdentifier LP (functionExpressionArgument (COMMA functionExpressionArgument)*)? RP #valueFunctionExpression - | operatorExpression #valueExpressionDefault - | left=operatorExpression comparisonOperator right=operatorExpression #comparison + : operatorExpression + | comparison + ; + +comparison + : left=operatorExpression comparisonOperator right=operatorExpression + ; + +mathFn + : functionIdentifier LP (functionExpressionArgument (COMMA functionExpressionArgument)*)? RP ; operatorExpression - : primaryExpression #operatorExpressionDefault - | operator=(MINUS | PLUS) operatorExpression #arithmeticUnary - | left=operatorExpression operator=(ASTERISK | SLASH | PERCENT) right=operatorExpression #arithmeticBinary - | left=operatorExpression operator=(PLUS | MINUS) right=operatorExpression #arithmeticBinary + : primaryExpression + | mathFn + | operator=(MINUS | PLUS) operatorExpression + | left=operatorExpression operator=(ASTERISK | SLASH | PERCENT) right=operatorExpression + | left=operatorExpression operator=(PLUS | MINUS) right=operatorExpression ; primaryExpression - : constant #constantDefault - | qualifiedName #dereference - | LP booleanExpression RP #parenthesizedExpression - | identifier LP (booleanExpression (COMMA booleanExpression)*)? RP #functionExpression + : constant + | qualifiedName + | LP booleanExpression RP + | identifier LP (booleanExpression (COMMA booleanExpression)*)? RP ; rowCommand @@ -74,11 +82,14 @@ fields ; field - : qualifiedName ASSIGN valueExpression - | booleanExpression - | qualifiedName ASSIGN booleanExpression + : booleanExpression + | userVariable ASSIGN booleanExpression ; +userVariable + : identifier + ; + fromCommand : FROM sourceIdentifier (COMMA sourceIdentifier)* ; @@ -115,14 +126,9 @@ identifier ; functionIdentifier - : ROUND_FUNCTION_MATH - | AVG_FUNCTION_MATH - | SUM_FUNCTION_MATH - | MIN_FUNCTION_MATH - | MAX_FUNCTION_MATH + : UNARY_FUNCTION ; - constant : NULL #nullLiteral | number #numericLiteral @@ -139,7 +145,7 @@ sortCommand ; orderExpression - : booleanExpression ordering=(ASC | DESC)? (NULLS nullOrdering=(FIRST | LAST))? + : booleanExpression (ORDERING)? (NULLS_ORDERING (NULLS_ORDERING_DIRECTION))? ; projectCommand @@ -152,7 +158,7 @@ projectClause ; booleanValue - : TRUE | FALSE + : BOOLEAN_VALUE ; number @@ -165,7 +171,7 @@ string ; comparisonOperator - : EQ | NEQ | LT | LTE | GT | GTE + : COMPARISON_OPERATOR ; explainCommand diff --git a/packages/kbn-monaco/src/esql/antlr/esql_parser.interp b/packages/kbn-monaco/src/esql/antlr/esql_parser.interp index 8355a7acb9fb..39dc1a09fb8b 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_parser.interp +++ b/packages/kbn-monaco/src/esql/antlr/esql_parser.interp @@ -18,39 +18,26 @@ null null 'by' 'and' -'asc' null null -'desc' '.' -'false' -'first' -'last' '(' '[' ']' 'not' 'null' -'nulls' 'or' ')' -'true' -'==' -'!=' -'<' -'<=' -'>' -'>=' +null +null '+' '-' '*' '/' '%' -'round' -'avg' -'sum' -'min' -'max' +null +'nulls' +null null null null @@ -83,39 +70,27 @@ INTEGER_LITERAL DECIMAL_LITERAL BY AND -ASC ASSIGN COMMA -DESC DOT -FALSE -FIRST -LAST LP OPENING_BRACKET CLOSING_BRACKET NOT NULL -NULLS OR RP -TRUE -EQ -NEQ -LT -LTE -GT -GTE +BOOLEAN_VALUE +COMPARISON_OPERATOR PLUS MINUS ASTERISK SLASH PERCENT -ROUND_FUNCTION_MATH -AVG_FUNCTION_MATH -SUM_FUNCTION_MATH -MIN_FUNCTION_MATH -MAX_FUNCTION_MATH +ORDERING +NULLS_ORDERING +NULLS_ORDERING_DIRECTION +UNARY_FUNCTION UNQUOTED_IDENTIFIER QUOTED_IDENTIFIER EXPR_LINE_COMMENT @@ -126,7 +101,6 @@ SRC_QUOTED_IDENTIFIER SRC_LINE_COMMENT SRC_MULTILINE_COMMENT SRC_WS -UNKNOWN_CMD rule names: singleStatement @@ -136,11 +110,14 @@ processingCommand whereCommand booleanExpression valueExpression +comparison +mathFn operatorExpression primaryExpression rowCommand fields field +userVariable fromCommand evalCommand statsCommand @@ -165,4 +142,4 @@ subqueryExpression atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 64, 301, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 78, 10, 3, 12, 3, 14, 3, 81, 11, 3, 3, 4, 3, 4, 3, 4, 5, 4, 86, 10, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 94, 10, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 103, 10, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 7, 7, 111, 10, 7, 12, 7, 14, 7, 114, 11, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 7, 8, 121, 10, 8, 12, 8, 14, 8, 124, 11, 8, 5, 8, 126, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 135, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 141, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 149, 10, 9, 12, 9, 14, 9, 152, 11, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 165, 10, 10, 12, 10, 14, 10, 168, 11, 10, 5, 10, 170, 10, 10, 3, 10, 3, 10, 5, 10, 174, 10, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 7, 12, 182, 10, 12, 12, 12, 14, 12, 185, 11, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 196, 10, 13, 3, 14, 3, 14, 3, 14, 3, 14, 7, 14, 202, 10, 14, 12, 14, 14, 14, 205, 11, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 5, 16, 214, 10, 16, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 220, 10, 18, 3, 19, 3, 19, 3, 19, 7, 19, 225, 10, 19, 12, 19, 14, 19, 228, 11, 19, 3, 20, 3, 20, 3, 20, 7, 20, 233, 10, 20, 12, 20, 14, 20, 236, 11, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 246, 10, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 255, 10, 25, 12, 25, 14, 25, 258, 11, 25, 3, 26, 3, 26, 5, 26, 262, 10, 26, 3, 26, 3, 26, 5, 26, 266, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 272, 10, 27, 12, 27, 14, 27, 275, 11, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 282, 10, 28, 3, 29, 3, 29, 3, 30, 3, 30, 5, 30, 288, 10, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 2, 2, 5, 4, 12, 16, 35, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 2, 11, 3, 2, 44, 45, 3, 2, 46, 48, 3, 2, 59, 60, 3, 2, 54, 55, 3, 2, 49, 53, 4, 2, 21, 21, 24, 24, 3, 2, 27, 28, 4, 2, 26, 26, 37, 37, 3, 2, 38, 43, 2, 307, 2, 68, 3, 2, 2, 2, 4, 71, 3, 2, 2, 2, 6, 85, 3, 2, 2, 2, 8, 93, 3, 2, 2, 2, 10, 95, 3, 2, 2, 2, 12, 102, 3, 2, 2, 2, 14, 134, 3, 2, 2, 2, 16, 140, 3, 2, 2, 2, 18, 173, 3, 2, 2, 2, 20, 175, 3, 2, 2, 2, 22, 178, 3, 2, 2, 2, 24, 195, 3, 2, 2, 2, 26, 197, 3, 2, 2, 2, 28, 206, 3, 2, 2, 2, 30, 209, 3, 2, 2, 2, 32, 215, 3, 2, 2, 2, 34, 219, 3, 2, 2, 2, 36, 221, 3, 2, 2, 2, 38, 229, 3, 2, 2, 2, 40, 237, 3, 2, 2, 2, 42, 239, 3, 2, 2, 2, 44, 245, 3, 2, 2, 2, 46, 247, 3, 2, 2, 2, 48, 250, 3, 2, 2, 2, 50, 259, 3, 2, 2, 2, 52, 267, 3, 2, 2, 2, 54, 281, 3, 2, 2, 2, 56, 283, 3, 2, 2, 2, 58, 287, 3, 2, 2, 2, 60, 289, 3, 2, 2, 2, 62, 291, 3, 2, 2, 2, 64, 293, 3, 2, 2, 2, 66, 296, 3, 2, 2, 2, 68, 69, 5, 4, 3, 2, 69, 70, 7, 2, 2, 3, 70, 3, 3, 2, 2, 2, 71, 72, 8, 3, 1, 2, 72, 73, 5, 6, 4, 2, 73, 79, 3, 2, 2, 2, 74, 75, 12, 3, 2, 2, 75, 76, 7, 15, 2, 2, 76, 78, 5, 8, 5, 2, 77, 74, 3, 2, 2, 2, 78, 81, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 79, 80, 3, 2, 2, 2, 80, 5, 3, 2, 2, 2, 81, 79, 3, 2, 2, 2, 82, 86, 5, 64, 33, 2, 83, 86, 5, 26, 14, 2, 84, 86, 5, 20, 11, 2, 85, 82, 3, 2, 2, 2, 85, 83, 3, 2, 2, 2, 85, 84, 3, 2, 2, 2, 86, 7, 3, 2, 2, 2, 87, 94, 5, 28, 15, 2, 88, 94, 5, 46, 24, 2, 89, 94, 5, 52, 27, 2, 90, 94, 5, 48, 25, 2, 91, 94, 5, 30, 16, 2, 92, 94, 5, 10, 6, 2, 93, 87, 3, 2, 2, 2, 93, 88, 3, 2, 2, 2, 93, 89, 3, 2, 2, 2, 93, 90, 3, 2, 2, 2, 93, 91, 3, 2, 2, 2, 93, 92, 3, 2, 2, 2, 94, 9, 3, 2, 2, 2, 95, 96, 7, 8, 2, 2, 96, 97, 5, 12, 7, 2, 97, 11, 3, 2, 2, 2, 98, 99, 8, 7, 1, 2, 99, 100, 7, 32, 2, 2, 100, 103, 5, 12, 7, 6, 101, 103, 5, 14, 8, 2, 102, 98, 3, 2, 2, 2, 102, 101, 3, 2, 2, 2, 103, 112, 3, 2, 2, 2, 104, 105, 12, 4, 2, 2, 105, 106, 7, 20, 2, 2, 106, 111, 5, 12, 7, 5, 107, 108, 12, 3, 2, 2, 108, 109, 7, 35, 2, 2, 109, 111, 5, 12, 7, 4, 110, 104, 3, 2, 2, 2, 110, 107, 3, 2, 2, 2, 111, 114, 3, 2, 2, 2, 112, 110, 3, 2, 2, 2, 112, 113, 3, 2, 2, 2, 113, 13, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 115, 116, 5, 42, 22, 2, 116, 125, 7, 29, 2, 2, 117, 122, 5, 34, 18, 2, 118, 119, 7, 23, 2, 2, 119, 121, 5, 34, 18, 2, 120, 118, 3, 2, 2, 2, 121, 124, 3, 2, 2, 2, 122, 120, 3, 2, 2, 2, 122, 123, 3, 2, 2, 2, 123, 126, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 125, 117, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 128, 7, 36, 2, 2, 128, 135, 3, 2, 2, 2, 129, 135, 5, 16, 9, 2, 130, 131, 5, 16, 9, 2, 131, 132, 5, 62, 32, 2, 132, 133, 5, 16, 9, 2, 133, 135, 3, 2, 2, 2, 134, 115, 3, 2, 2, 2, 134, 129, 3, 2, 2, 2, 134, 130, 3, 2, 2, 2, 135, 15, 3, 2, 2, 2, 136, 137, 8, 9, 1, 2, 137, 141, 5, 18, 10, 2, 138, 139, 9, 2, 2, 2, 139, 141, 5, 16, 9, 5, 140, 136, 3, 2, 2, 2, 140, 138, 3, 2, 2, 2, 141, 150, 3, 2, 2, 2, 142, 143, 12, 4, 2, 2, 143, 144, 9, 3, 2, 2, 144, 149, 5, 16, 9, 5, 145, 146, 12, 3, 2, 2, 146, 147, 9, 2, 2, 2, 147, 149, 5, 16, 9, 4, 148, 142, 3, 2, 2, 2, 148, 145, 3, 2, 2, 2, 149, 152, 3, 2, 2, 2, 150, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 17, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 153, 174, 5, 44, 23, 2, 154, 174, 5, 36, 19, 2, 155, 156, 7, 29, 2, 2, 156, 157, 5, 12, 7, 2, 157, 158, 7, 36, 2, 2, 158, 174, 3, 2, 2, 2, 159, 160, 5, 40, 21, 2, 160, 169, 7, 29, 2, 2, 161, 166, 5, 12, 7, 2, 162, 163, 7, 23, 2, 2, 163, 165, 5, 12, 7, 2, 164, 162, 3, 2, 2, 2, 165, 168, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 170, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 169, 161, 3, 2, 2, 2, 169, 170, 3, 2, 2, 2, 170, 171, 3, 2, 2, 2, 171, 172, 7, 36, 2, 2, 172, 174, 3, 2, 2, 2, 173, 153, 3, 2, 2, 2, 173, 154, 3, 2, 2, 2, 173, 155, 3, 2, 2, 2, 173, 159, 3, 2, 2, 2, 174, 19, 3, 2, 2, 2, 175, 176, 7, 6, 2, 2, 176, 177, 5, 22, 12, 2, 177, 21, 3, 2, 2, 2, 178, 183, 5, 24, 13, 2, 179, 180, 7, 23, 2, 2, 180, 182, 5, 24, 13, 2, 181, 179, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 23, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 187, 5, 36, 19, 2, 187, 188, 7, 22, 2, 2, 188, 189, 5, 14, 8, 2, 189, 196, 3, 2, 2, 2, 190, 196, 5, 12, 7, 2, 191, 192, 5, 36, 19, 2, 192, 193, 7, 22, 2, 2, 193, 194, 5, 12, 7, 2, 194, 196, 3, 2, 2, 2, 195, 186, 3, 2, 2, 2, 195, 190, 3, 2, 2, 2, 195, 191, 3, 2, 2, 2, 196, 25, 3, 2, 2, 2, 197, 198, 7, 5, 2, 2, 198, 203, 5, 32, 17, 2, 199, 200, 7, 23, 2, 2, 200, 202, 5, 32, 17, 2, 201, 199, 3, 2, 2, 2, 202, 205, 3, 2, 2, 2, 203, 201, 3, 2, 2, 2, 203, 204, 3, 2, 2, 2, 204, 27, 3, 2, 2, 2, 205, 203, 3, 2, 2, 2, 206, 207, 7, 3, 2, 2, 207, 208, 5, 22, 12, 2, 208, 29, 3, 2, 2, 2, 209, 210, 7, 7, 2, 2, 210, 213, 5, 22, 12, 2, 211, 212, 7, 19, 2, 2, 212, 214, 5, 38, 20, 2, 213, 211, 3, 2, 2, 2, 213, 214, 3, 2, 2, 2, 214, 31, 3, 2, 2, 2, 215, 216, 9, 4, 2, 2, 216, 33, 3, 2, 2, 2, 217, 220, 5, 36, 19, 2, 218, 220, 5, 60, 31, 2, 219, 217, 3, 2, 2, 2, 219, 218, 3, 2, 2, 2, 220, 35, 3, 2, 2, 2, 221, 226, 5, 40, 21, 2, 222, 223, 7, 25, 2, 2, 223, 225, 5, 40, 21, 2, 224, 222, 3, 2, 2, 2, 225, 228, 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 37, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 229, 234, 5, 36, 19, 2, 230, 231, 7, 23, 2, 2, 231, 233, 5, 36, 19, 2, 232, 230, 3, 2, 2, 2, 233, 236, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 39, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 237, 238, 9, 5, 2, 2, 238, 41, 3, 2, 2, 2, 239, 240, 9, 6, 2, 2, 240, 43, 3, 2, 2, 2, 241, 246, 7, 33, 2, 2, 242, 246, 5, 58, 30, 2, 243, 246, 5, 56, 29, 2, 244, 246, 5, 60, 31, 2, 245, 241, 3, 2, 2, 2, 245, 242, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 245, 244, 3, 2, 2, 2, 246, 45, 3, 2, 2, 2, 247, 248, 7, 10, 2, 2, 248, 249, 7, 17, 2, 2, 249, 47, 3, 2, 2, 2, 250, 251, 7, 9, 2, 2, 251, 256, 5, 50, 26, 2, 252, 253, 7, 23, 2, 2, 253, 255, 5, 50, 26, 2, 254, 252, 3, 2, 2, 2, 255, 258, 3, 2, 2, 2, 256, 254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 49, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 259, 261, 5, 12, 7, 2, 260, 262, 9, 7, 2, 2, 261, 260, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 265, 3, 2, 2, 2, 263, 264, 7, 34, 2, 2, 264, 266, 9, 8, 2, 2, 265, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 51, 3, 2, 2, 2, 267, 268, 7, 11, 2, 2, 268, 273, 5, 54, 28, 2, 269, 270, 7, 23, 2, 2, 270, 272, 5, 54, 28, 2, 271, 269, 3, 2, 2, 2, 272, 275, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 53, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 276, 282, 5, 32, 17, 2, 277, 278, 5, 32, 17, 2, 278, 279, 7, 22, 2, 2, 279, 280, 5, 32, 17, 2, 280, 282, 3, 2, 2, 2, 281, 276, 3, 2, 2, 2, 281, 277, 3, 2, 2, 2, 282, 55, 3, 2, 2, 2, 283, 284, 9, 9, 2, 2, 284, 57, 3, 2, 2, 2, 285, 288, 7, 18, 2, 2, 286, 288, 7, 17, 2, 2, 287, 285, 3, 2, 2, 2, 287, 286, 3, 2, 2, 2, 288, 59, 3, 2, 2, 2, 289, 290, 7, 16, 2, 2, 290, 61, 3, 2, 2, 2, 291, 292, 9, 10, 2, 2, 292, 63, 3, 2, 2, 2, 293, 294, 7, 4, 2, 2, 294, 295, 5, 66, 34, 2, 295, 65, 3, 2, 2, 2, 296, 297, 7, 30, 2, 2, 297, 298, 5, 4, 3, 2, 298, 299, 7, 31, 2, 2, 299, 67, 3, 2, 2, 2, 31, 79, 85, 93, 102, 110, 112, 122, 125, 134, 140, 148, 150, 166, 169, 173, 183, 195, 203, 213, 219, 226, 234, 245, 256, 261, 265, 273, 281, 287] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 51, 307, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 84, 10, 3, 12, 3, 14, 3, 87, 11, 3, 3, 4, 3, 4, 3, 4, 5, 4, 92, 10, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 100, 10, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 109, 10, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 7, 7, 117, 10, 7, 12, 7, 14, 7, 120, 11, 7, 3, 8, 3, 8, 5, 8, 124, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 135, 10, 10, 12, 10, 14, 10, 138, 11, 10, 5, 10, 140, 10, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 149, 10, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 157, 10, 11, 12, 11, 14, 11, 160, 11, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 173, 10, 12, 12, 12, 14, 12, 176, 11, 12, 5, 12, 178, 10, 12, 3, 12, 3, 12, 5, 12, 182, 10, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 7, 14, 190, 10, 14, 12, 14, 14, 14, 193, 11, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 5, 15, 200, 10, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 208, 10, 17, 12, 17, 14, 17, 211, 11, 17, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 220, 10, 19, 3, 20, 3, 20, 3, 21, 3, 21, 5, 21, 226, 10, 21, 3, 22, 3, 22, 3, 22, 7, 22, 231, 10, 22, 12, 22, 14, 22, 234, 11, 22, 3, 23, 3, 23, 3, 23, 7, 23, 239, 10, 23, 12, 23, 14, 23, 242, 11, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 252, 10, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 7, 28, 261, 10, 28, 12, 28, 14, 28, 264, 11, 28, 3, 29, 3, 29, 5, 29, 268, 10, 29, 3, 29, 3, 29, 5, 29, 272, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 7, 30, 278, 10, 30, 12, 30, 14, 30, 281, 11, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 288, 10, 31, 3, 32, 3, 32, 3, 33, 3, 33, 5, 33, 294, 10, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 2, 2, 5, 4, 12, 20, 38, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 2, 6, 3, 2, 33, 34, 3, 2, 35, 37, 3, 2, 47, 48, 3, 2, 42, 43, 2, 309, 2, 74, 3, 2, 2, 2, 4, 77, 3, 2, 2, 2, 6, 91, 3, 2, 2, 2, 8, 99, 3, 2, 2, 2, 10, 101, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 123, 3, 2, 2, 2, 16, 125, 3, 2, 2, 2, 18, 129, 3, 2, 2, 2, 20, 148, 3, 2, 2, 2, 22, 181, 3, 2, 2, 2, 24, 183, 3, 2, 2, 2, 26, 186, 3, 2, 2, 2, 28, 199, 3, 2, 2, 2, 30, 201, 3, 2, 2, 2, 32, 203, 3, 2, 2, 2, 34, 212, 3, 2, 2, 2, 36, 215, 3, 2, 2, 2, 38, 221, 3, 2, 2, 2, 40, 225, 3, 2, 2, 2, 42, 227, 3, 2, 2, 2, 44, 235, 3, 2, 2, 2, 46, 243, 3, 2, 2, 2, 48, 245, 3, 2, 2, 2, 50, 251, 3, 2, 2, 2, 52, 253, 3, 2, 2, 2, 54, 256, 3, 2, 2, 2, 56, 265, 3, 2, 2, 2, 58, 273, 3, 2, 2, 2, 60, 287, 3, 2, 2, 2, 62, 289, 3, 2, 2, 2, 64, 293, 3, 2, 2, 2, 66, 295, 3, 2, 2, 2, 68, 297, 3, 2, 2, 2, 70, 299, 3, 2, 2, 2, 72, 302, 3, 2, 2, 2, 74, 75, 5, 4, 3, 2, 75, 76, 7, 2, 2, 3, 76, 3, 3, 2, 2, 2, 77, 78, 8, 3, 1, 2, 78, 79, 5, 6, 4, 2, 79, 85, 3, 2, 2, 2, 80, 81, 12, 3, 2, 2, 81, 82, 7, 15, 2, 2, 82, 84, 5, 8, 5, 2, 83, 80, 3, 2, 2, 2, 84, 87, 3, 2, 2, 2, 85, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 5, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 88, 92, 5, 70, 36, 2, 89, 92, 5, 32, 17, 2, 90, 92, 5, 24, 13, 2, 91, 88, 3, 2, 2, 2, 91, 89, 3, 2, 2, 2, 91, 90, 3, 2, 2, 2, 92, 7, 3, 2, 2, 2, 93, 100, 5, 34, 18, 2, 94, 100, 5, 52, 27, 2, 95, 100, 5, 58, 30, 2, 96, 100, 5, 54, 28, 2, 97, 100, 5, 36, 19, 2, 98, 100, 5, 10, 6, 2, 99, 93, 3, 2, 2, 2, 99, 94, 3, 2, 2, 2, 99, 95, 3, 2, 2, 2, 99, 96, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 98, 3, 2, 2, 2, 100, 9, 3, 2, 2, 2, 101, 102, 7, 8, 2, 2, 102, 103, 5, 12, 7, 2, 103, 11, 3, 2, 2, 2, 104, 105, 8, 7, 1, 2, 105, 106, 7, 27, 2, 2, 106, 109, 5, 12, 7, 6, 107, 109, 5, 14, 8, 2, 108, 104, 3, 2, 2, 2, 108, 107, 3, 2, 2, 2, 109, 118, 3, 2, 2, 2, 110, 111, 12, 4, 2, 2, 111, 112, 7, 20, 2, 2, 112, 117, 5, 12, 7, 5, 113, 114, 12, 3, 2, 2, 114, 115, 7, 29, 2, 2, 115, 117, 5, 12, 7, 4, 116, 110, 3, 2, 2, 2, 116, 113, 3, 2, 2, 2, 117, 120, 3, 2, 2, 2, 118, 116, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 13, 3, 2, 2, 2, 120, 118, 3, 2, 2, 2, 121, 124, 5, 20, 11, 2, 122, 124, 5, 16, 9, 2, 123, 121, 3, 2, 2, 2, 123, 122, 3, 2, 2, 2, 124, 15, 3, 2, 2, 2, 125, 126, 5, 20, 11, 2, 126, 127, 5, 68, 35, 2, 127, 128, 5, 20, 11, 2, 128, 17, 3, 2, 2, 2, 129, 130, 5, 48, 25, 2, 130, 139, 7, 24, 2, 2, 131, 136, 5, 40, 21, 2, 132, 133, 7, 22, 2, 2, 133, 135, 5, 40, 21, 2, 134, 132, 3, 2, 2, 2, 135, 138, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 140, 3, 2, 2, 2, 138, 136, 3, 2, 2, 2, 139, 131, 3, 2, 2, 2, 139, 140, 3, 2, 2, 2, 140, 141, 3, 2, 2, 2, 141, 142, 7, 30, 2, 2, 142, 19, 3, 2, 2, 2, 143, 144, 8, 11, 1, 2, 144, 149, 5, 22, 12, 2, 145, 149, 5, 18, 10, 2, 146, 147, 9, 2, 2, 2, 147, 149, 5, 20, 11, 5, 148, 143, 3, 2, 2, 2, 148, 145, 3, 2, 2, 2, 148, 146, 3, 2, 2, 2, 149, 158, 3, 2, 2, 2, 150, 151, 12, 4, 2, 2, 151, 152, 9, 3, 2, 2, 152, 157, 5, 20, 11, 5, 153, 154, 12, 3, 2, 2, 154, 155, 9, 2, 2, 2, 155, 157, 5, 20, 11, 4, 156, 150, 3, 2, 2, 2, 156, 153, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 21, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 161, 182, 5, 50, 26, 2, 162, 182, 5, 42, 22, 2, 163, 164, 7, 24, 2, 2, 164, 165, 5, 12, 7, 2, 165, 166, 7, 30, 2, 2, 166, 182, 3, 2, 2, 2, 167, 168, 5, 46, 24, 2, 168, 177, 7, 24, 2, 2, 169, 174, 5, 12, 7, 2, 170, 171, 7, 22, 2, 2, 171, 173, 5, 12, 7, 2, 172, 170, 3, 2, 2, 2, 173, 176, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 178, 3, 2, 2, 2, 176, 174, 3, 2, 2, 2, 177, 169, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, 180, 7, 30, 2, 2, 180, 182, 3, 2, 2, 2, 181, 161, 3, 2, 2, 2, 181, 162, 3, 2, 2, 2, 181, 163, 3, 2, 2, 2, 181, 167, 3, 2, 2, 2, 182, 23, 3, 2, 2, 2, 183, 184, 7, 6, 2, 2, 184, 185, 5, 26, 14, 2, 185, 25, 3, 2, 2, 2, 186, 191, 5, 28, 15, 2, 187, 188, 7, 22, 2, 2, 188, 190, 5, 28, 15, 2, 189, 187, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 27, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 200, 5, 12, 7, 2, 195, 196, 5, 30, 16, 2, 196, 197, 7, 21, 2, 2, 197, 198, 5, 12, 7, 2, 198, 200, 3, 2, 2, 2, 199, 194, 3, 2, 2, 2, 199, 195, 3, 2, 2, 2, 200, 29, 3, 2, 2, 2, 201, 202, 5, 46, 24, 2, 202, 31, 3, 2, 2, 2, 203, 204, 7, 5, 2, 2, 204, 209, 5, 38, 20, 2, 205, 206, 7, 22, 2, 2, 206, 208, 5, 38, 20, 2, 207, 205, 3, 2, 2, 2, 208, 211, 3, 2, 2, 2, 209, 207, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 33, 3, 2, 2, 2, 211, 209, 3, 2, 2, 2, 212, 213, 7, 3, 2, 2, 213, 214, 5, 26, 14, 2, 214, 35, 3, 2, 2, 2, 215, 216, 7, 7, 2, 2, 216, 219, 5, 26, 14, 2, 217, 218, 7, 19, 2, 2, 218, 220, 5, 44, 23, 2, 219, 217, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 37, 3, 2, 2, 2, 221, 222, 9, 4, 2, 2, 222, 39, 3, 2, 2, 2, 223, 226, 5, 42, 22, 2, 224, 226, 5, 66, 34, 2, 225, 223, 3, 2, 2, 2, 225, 224, 3, 2, 2, 2, 226, 41, 3, 2, 2, 2, 227, 232, 5, 46, 24, 2, 228, 229, 7, 23, 2, 2, 229, 231, 5, 46, 24, 2, 230, 228, 3, 2, 2, 2, 231, 234, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 232, 233, 3, 2, 2, 2, 233, 43, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 235, 240, 5, 42, 22, 2, 236, 237, 7, 22, 2, 2, 237, 239, 5, 42, 22, 2, 238, 236, 3, 2, 2, 2, 239, 242, 3, 2, 2, 2, 240, 238, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 45, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 243, 244, 9, 5, 2, 2, 244, 47, 3, 2, 2, 2, 245, 246, 7, 41, 2, 2, 246, 49, 3, 2, 2, 2, 247, 252, 7, 28, 2, 2, 248, 252, 5, 64, 33, 2, 249, 252, 5, 62, 32, 2, 250, 252, 5, 66, 34, 2, 251, 247, 3, 2, 2, 2, 251, 248, 3, 2, 2, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 51, 3, 2, 2, 2, 253, 254, 7, 10, 2, 2, 254, 255, 7, 17, 2, 2, 255, 53, 3, 2, 2, 2, 256, 257, 7, 9, 2, 2, 257, 262, 5, 56, 29, 2, 258, 259, 7, 22, 2, 2, 259, 261, 5, 56, 29, 2, 260, 258, 3, 2, 2, 2, 261, 264, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 55, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 265, 267, 5, 12, 7, 2, 266, 268, 7, 38, 2, 2, 267, 266, 3, 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 271, 3, 2, 2, 2, 269, 270, 7, 39, 2, 2, 270, 272, 7, 40, 2, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 57, 3, 2, 2, 2, 273, 274, 7, 11, 2, 2, 274, 279, 5, 60, 31, 2, 275, 276, 7, 22, 2, 2, 276, 278, 5, 60, 31, 2, 277, 275, 3, 2, 2, 2, 278, 281, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 59, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 282, 288, 5, 38, 20, 2, 283, 284, 5, 38, 20, 2, 284, 285, 7, 21, 2, 2, 285, 286, 5, 38, 20, 2, 286, 288, 3, 2, 2, 2, 287, 282, 3, 2, 2, 2, 287, 283, 3, 2, 2, 2, 288, 61, 3, 2, 2, 2, 289, 290, 7, 31, 2, 2, 290, 63, 3, 2, 2, 2, 291, 294, 7, 18, 2, 2, 292, 294, 7, 17, 2, 2, 293, 291, 3, 2, 2, 2, 293, 292, 3, 2, 2, 2, 294, 65, 3, 2, 2, 2, 295, 296, 7, 16, 2, 2, 296, 67, 3, 2, 2, 2, 297, 298, 7, 32, 2, 2, 298, 69, 3, 2, 2, 2, 299, 300, 7, 4, 2, 2, 300, 301, 5, 72, 37, 2, 301, 71, 3, 2, 2, 2, 302, 303, 7, 25, 2, 2, 303, 304, 5, 4, 3, 2, 304, 305, 7, 26, 2, 2, 305, 73, 3, 2, 2, 2, 31, 85, 91, 99, 108, 116, 118, 123, 136, 139, 148, 156, 158, 174, 177, 181, 191, 199, 209, 219, 225, 232, 240, 251, 262, 267, 271, 279, 287, 293] \ No newline at end of file diff --git a/packages/kbn-monaco/src/esql/antlr/esql_parser.tokens b/packages/kbn-monaco/src/esql/antlr/esql_parser.tokens index b39004ce4ce3..c2dafff2f222 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_parser.tokens +++ b/packages/kbn-monaco/src/esql/antlr/esql_parser.tokens @@ -16,50 +16,37 @@ INTEGER_LITERAL=15 DECIMAL_LITERAL=16 BY=17 AND=18 -ASC=19 -ASSIGN=20 -COMMA=21 -DESC=22 -DOT=23 -FALSE=24 -FIRST=25 -LAST=26 -LP=27 -OPENING_BRACKET=28 -CLOSING_BRACKET=29 -NOT=30 -NULL=31 -NULLS=32 -OR=33 -RP=34 -TRUE=35 -EQ=36 -NEQ=37 -LT=38 -LTE=39 -GT=40 -GTE=41 -PLUS=42 -MINUS=43 -ASTERISK=44 -SLASH=45 -PERCENT=46 -ROUND_FUNCTION_MATH=47 -AVG_FUNCTION_MATH=48 -SUM_FUNCTION_MATH=49 -MIN_FUNCTION_MATH=50 -MAX_FUNCTION_MATH=51 -UNQUOTED_IDENTIFIER=52 -QUOTED_IDENTIFIER=53 -EXPR_LINE_COMMENT=54 -EXPR_MULTILINE_COMMENT=55 -EXPR_WS=56 -SRC_UNQUOTED_IDENTIFIER=57 -SRC_QUOTED_IDENTIFIER=58 -SRC_LINE_COMMENT=59 -SRC_MULTILINE_COMMENT=60 -SRC_WS=61 -UNKNOWN_CMD=62 +ASSIGN=19 +COMMA=20 +DOT=21 +LP=22 +OPENING_BRACKET=23 +CLOSING_BRACKET=24 +NOT=25 +NULL=26 +OR=27 +RP=28 +BOOLEAN_VALUE=29 +COMPARISON_OPERATOR=30 +PLUS=31 +MINUS=32 +ASTERISK=33 +SLASH=34 +PERCENT=35 +ORDERING=36 +NULLS_ORDERING=37 +NULLS_ORDERING_DIRECTION=38 +UNARY_FUNCTION=39 +UNQUOTED_IDENTIFIER=40 +QUOTED_IDENTIFIER=41 +EXPR_LINE_COMMENT=42 +EXPR_MULTILINE_COMMENT=43 +EXPR_WS=44 +SRC_UNQUOTED_IDENTIFIER=45 +SRC_QUOTED_IDENTIFIER=46 +SRC_LINE_COMMENT=47 +SRC_MULTILINE_COMMENT=48 +SRC_WS=49 'eval'=1 'explain'=2 'from'=3 @@ -71,34 +58,17 @@ UNKNOWN_CMD=62 'project'=9 'by'=17 'and'=18 -'asc'=19 -'desc'=22 -'.'=23 -'false'=24 -'first'=25 -'last'=26 -'('=27 -'['=28 -']'=29 -'not'=30 -'null'=31 -'nulls'=32 -'or'=33 -')'=34 -'true'=35 -'=='=36 -'!='=37 -'<'=38 -'<='=39 -'>'=40 -'>='=41 -'+'=42 -'-'=43 -'*'=44 -'/'=45 -'%'=46 -'round'=47 -'avg'=48 -'sum'=49 -'min'=50 -'max'=51 +'.'=21 +'('=22 +'['=23 +']'=24 +'not'=25 +'null'=26 +'or'=27 +')'=28 +'+'=31 +'-'=32 +'*'=33 +'/'=34 +'%'=35 +'nulls'=37 diff --git a/packages/kbn-monaco/src/esql/antlr/esql_parser.ts b/packages/kbn-monaco/src/esql/antlr/esql_parser.ts index e913ccde441b..de825a0b3698 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_parser.ts +++ b/packages/kbn-monaco/src/esql/antlr/esql_parser.ts @@ -45,50 +45,37 @@ export class esql_parser extends Parser { public static readonly DECIMAL_LITERAL = 16; public static readonly BY = 17; public static readonly AND = 18; - public static readonly ASC = 19; - public static readonly ASSIGN = 20; - public static readonly COMMA = 21; - public static readonly DESC = 22; - public static readonly DOT = 23; - public static readonly FALSE = 24; - public static readonly FIRST = 25; - public static readonly LAST = 26; - public static readonly LP = 27; - public static readonly OPENING_BRACKET = 28; - public static readonly CLOSING_BRACKET = 29; - public static readonly NOT = 30; - public static readonly NULL = 31; - public static readonly NULLS = 32; - public static readonly OR = 33; - public static readonly RP = 34; - public static readonly TRUE = 35; - public static readonly EQ = 36; - public static readonly NEQ = 37; - public static readonly LT = 38; - public static readonly LTE = 39; - public static readonly GT = 40; - public static readonly GTE = 41; - public static readonly PLUS = 42; - public static readonly MINUS = 43; - public static readonly ASTERISK = 44; - public static readonly SLASH = 45; - public static readonly PERCENT = 46; - public static readonly ROUND_FUNCTION_MATH = 47; - public static readonly AVG_FUNCTION_MATH = 48; - public static readonly SUM_FUNCTION_MATH = 49; - public static readonly MIN_FUNCTION_MATH = 50; - public static readonly MAX_FUNCTION_MATH = 51; - public static readonly UNQUOTED_IDENTIFIER = 52; - public static readonly QUOTED_IDENTIFIER = 53; - public static readonly EXPR_LINE_COMMENT = 54; - public static readonly EXPR_MULTILINE_COMMENT = 55; - public static readonly EXPR_WS = 56; - public static readonly SRC_UNQUOTED_IDENTIFIER = 57; - public static readonly SRC_QUOTED_IDENTIFIER = 58; - public static readonly SRC_LINE_COMMENT = 59; - public static readonly SRC_MULTILINE_COMMENT = 60; - public static readonly SRC_WS = 61; - public static readonly UNKNOWN_CMD = 62; + public static readonly ASSIGN = 19; + public static readonly COMMA = 20; + public static readonly DOT = 21; + public static readonly LP = 22; + public static readonly OPENING_BRACKET = 23; + public static readonly CLOSING_BRACKET = 24; + public static readonly NOT = 25; + public static readonly NULL = 26; + public static readonly OR = 27; + public static readonly RP = 28; + public static readonly BOOLEAN_VALUE = 29; + public static readonly COMPARISON_OPERATOR = 30; + public static readonly PLUS = 31; + public static readonly MINUS = 32; + public static readonly ASTERISK = 33; + public static readonly SLASH = 34; + public static readonly PERCENT = 35; + public static readonly ORDERING = 36; + public static readonly NULLS_ORDERING = 37; + public static readonly NULLS_ORDERING_DIRECTION = 38; + public static readonly UNARY_FUNCTION = 39; + public static readonly UNQUOTED_IDENTIFIER = 40; + public static readonly QUOTED_IDENTIFIER = 41; + public static readonly EXPR_LINE_COMMENT = 42; + public static readonly EXPR_MULTILINE_COMMENT = 43; + public static readonly EXPR_WS = 44; + public static readonly SRC_UNQUOTED_IDENTIFIER = 45; + public static readonly SRC_QUOTED_IDENTIFIER = 46; + public static readonly SRC_LINE_COMMENT = 47; + public static readonly SRC_MULTILINE_COMMENT = 48; + public static readonly SRC_WS = 49; public static readonly RULE_singleStatement = 0; public static readonly RULE_query = 1; public static readonly RULE_sourceCommand = 2; @@ -96,63 +83,64 @@ export class esql_parser extends Parser { public static readonly RULE_whereCommand = 4; public static readonly RULE_booleanExpression = 5; public static readonly RULE_valueExpression = 6; - public static readonly RULE_operatorExpression = 7; - public static readonly RULE_primaryExpression = 8; - public static readonly RULE_rowCommand = 9; - public static readonly RULE_fields = 10; - public static readonly RULE_field = 11; - public static readonly RULE_fromCommand = 12; - public static readonly RULE_evalCommand = 13; - public static readonly RULE_statsCommand = 14; - public static readonly RULE_sourceIdentifier = 15; - public static readonly RULE_functionExpressionArgument = 16; - public static readonly RULE_qualifiedName = 17; - public static readonly RULE_qualifiedNames = 18; - public static readonly RULE_identifier = 19; - public static readonly RULE_functionIdentifier = 20; - public static readonly RULE_constant = 21; - public static readonly RULE_limitCommand = 22; - public static readonly RULE_sortCommand = 23; - public static readonly RULE_orderExpression = 24; - public static readonly RULE_projectCommand = 25; - public static readonly RULE_projectClause = 26; - public static readonly RULE_booleanValue = 27; - public static readonly RULE_number = 28; - public static readonly RULE_string = 29; - public static readonly RULE_comparisonOperator = 30; - public static readonly RULE_explainCommand = 31; - public static readonly RULE_subqueryExpression = 32; + public static readonly RULE_comparison = 7; + public static readonly RULE_mathFn = 8; + public static readonly RULE_operatorExpression = 9; + public static readonly RULE_primaryExpression = 10; + public static readonly RULE_rowCommand = 11; + public static readonly RULE_fields = 12; + public static readonly RULE_field = 13; + public static readonly RULE_userVariable = 14; + public static readonly RULE_fromCommand = 15; + public static readonly RULE_evalCommand = 16; + public static readonly RULE_statsCommand = 17; + public static readonly RULE_sourceIdentifier = 18; + public static readonly RULE_functionExpressionArgument = 19; + public static readonly RULE_qualifiedName = 20; + public static readonly RULE_qualifiedNames = 21; + public static readonly RULE_identifier = 22; + public static readonly RULE_functionIdentifier = 23; + public static readonly RULE_constant = 24; + public static readonly RULE_limitCommand = 25; + public static readonly RULE_sortCommand = 26; + public static readonly RULE_orderExpression = 27; + public static readonly RULE_projectCommand = 28; + public static readonly RULE_projectClause = 29; + public static readonly RULE_booleanValue = 30; + public static readonly RULE_number = 31; + public static readonly RULE_string = 32; + public static readonly RULE_comparisonOperator = 33; + public static readonly RULE_explainCommand = 34; + public static readonly RULE_subqueryExpression = 35; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ "singleStatement", "query", "sourceCommand", "processingCommand", "whereCommand", - "booleanExpression", "valueExpression", "operatorExpression", "primaryExpression", - "rowCommand", "fields", "field", "fromCommand", "evalCommand", "statsCommand", - "sourceIdentifier", "functionExpressionArgument", "qualifiedName", "qualifiedNames", - "identifier", "functionIdentifier", "constant", "limitCommand", "sortCommand", - "orderExpression", "projectCommand", "projectClause", "booleanValue", - "number", "string", "comparisonOperator", "explainCommand", "subqueryExpression", + "booleanExpression", "valueExpression", "comparison", "mathFn", "operatorExpression", + "primaryExpression", "rowCommand", "fields", "field", "userVariable", + "fromCommand", "evalCommand", "statsCommand", "sourceIdentifier", "functionExpressionArgument", + "qualifiedName", "qualifiedNames", "identifier", "functionIdentifier", + "constant", "limitCommand", "sortCommand", "orderExpression", "projectCommand", + "projectClause", "booleanValue", "number", "string", "comparisonOperator", + "explainCommand", "subqueryExpression", ]; private static readonly _LITERAL_NAMES: Array = [ undefined, "'eval'", "'explain'", "'from'", "'row'", "'stats'", "'where'", "'sort'", "'limit'", "'project'", undefined, undefined, undefined, undefined, - undefined, undefined, undefined, "'by'", "'and'", "'asc'", undefined, - undefined, "'desc'", "'.'", "'false'", "'first'", "'last'", "'('", "'['", - "']'", "'not'", "'null'", "'nulls'", "'or'", "')'", "'true'", "'=='", - "'!='", "'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'", "'%'", - "'round'", "'avg'", "'sum'", "'min'", "'max'", + undefined, undefined, undefined, "'by'", "'and'", undefined, undefined, + "'.'", "'('", "'['", "']'", "'not'", "'null'", "'or'", "')'", undefined, + undefined, "'+'", "'-'", "'*'", "'/'", "'%'", undefined, "'nulls'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ undefined, "EVAL", "EXPLAIN", "FROM", "ROW", "STATS", "WHERE", "SORT", "LIMIT", "PROJECT", "LINE_COMMENT", "MULTILINE_COMMENT", "WS", "PIPE", - "STRING", "INTEGER_LITERAL", "DECIMAL_LITERAL", "BY", "AND", "ASC", "ASSIGN", - "COMMA", "DESC", "DOT", "FALSE", "FIRST", "LAST", "LP", "OPENING_BRACKET", - "CLOSING_BRACKET", "NOT", "NULL", "NULLS", "OR", "RP", "TRUE", "EQ", "NEQ", - "LT", "LTE", "GT", "GTE", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", - "ROUND_FUNCTION_MATH", "AVG_FUNCTION_MATH", "SUM_FUNCTION_MATH", "MIN_FUNCTION_MATH", - "MAX_FUNCTION_MATH", "UNQUOTED_IDENTIFIER", "QUOTED_IDENTIFIER", "EXPR_LINE_COMMENT", + "STRING", "INTEGER_LITERAL", "DECIMAL_LITERAL", "BY", "AND", "ASSIGN", + "COMMA", "DOT", "LP", "OPENING_BRACKET", "CLOSING_BRACKET", "NOT", "NULL", + "OR", "RP", "BOOLEAN_VALUE", "COMPARISON_OPERATOR", "PLUS", "MINUS", "ASTERISK", + "SLASH", "PERCENT", "ORDERING", "NULLS_ORDERING", "NULLS_ORDERING_DIRECTION", + "UNARY_FUNCTION", "UNQUOTED_IDENTIFIER", "QUOTED_IDENTIFIER", "EXPR_LINE_COMMENT", "EXPR_MULTILINE_COMMENT", "EXPR_WS", "SRC_UNQUOTED_IDENTIFIER", "SRC_QUOTED_IDENTIFIER", - "SRC_LINE_COMMENT", "SRC_MULTILINE_COMMENT", "SRC_WS", "UNKNOWN_CMD", + "SRC_LINE_COMMENT", "SRC_MULTILINE_COMMENT", "SRC_WS", ]; public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(esql_parser._LITERAL_NAMES, esql_parser._SYMBOLIC_NAMES, []); @@ -183,9 +171,9 @@ export class esql_parser extends Parser { try { this.enterOuterAlt(_localctx, 1); { - this.state = 66; + this.state = 72; this.query(0); - this.state = 67; + this.state = 73; this.match(esql_parser.EOF); } } @@ -227,11 +215,11 @@ export class esql_parser extends Parser { this._ctx = _localctx; _prevctx = _localctx; - this.state = 70; + this.state = 76; this.sourceCommand(); } this._ctx._stop = this._input.tryLT(-1); - this.state = 77; + this.state = 83; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 0, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -244,18 +232,18 @@ export class esql_parser extends Parser { { _localctx = new CompositeQueryContext(new QueryContext(_parentctx, _parentState)); this.pushNewRecursionContext(_localctx, _startState, esql_parser.RULE_query); - this.state = 72; + this.state = 78; if (!(this.precpred(this._ctx, 1))) { throw new FailedPredicateException(this, "this.precpred(this._ctx, 1)"); } - this.state = 73; + this.state = 79; this.match(esql_parser.PIPE); - this.state = 74; + this.state = 80; this.processingCommand(); } } } - this.state = 79; + this.state = 85; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 0, this._ctx); } @@ -280,27 +268,27 @@ export class esql_parser extends Parser { let _localctx: SourceCommandContext = new SourceCommandContext(this._ctx, this.state); this.enterRule(_localctx, 4, esql_parser.RULE_sourceCommand); try { - this.state = 83; + this.state = 89; this._errHandler.sync(this); switch (this._input.LA(1)) { case esql_parser.EXPLAIN: this.enterOuterAlt(_localctx, 1); { - this.state = 80; + this.state = 86; this.explainCommand(); } break; case esql_parser.FROM: this.enterOuterAlt(_localctx, 2); { - this.state = 81; + this.state = 87; this.fromCommand(); } break; case esql_parser.ROW: this.enterOuterAlt(_localctx, 3); { - this.state = 82; + this.state = 88; this.rowCommand(); } break; @@ -327,48 +315,48 @@ export class esql_parser extends Parser { let _localctx: ProcessingCommandContext = new ProcessingCommandContext(this._ctx, this.state); this.enterRule(_localctx, 6, esql_parser.RULE_processingCommand); try { - this.state = 91; + this.state = 97; this._errHandler.sync(this); switch (this._input.LA(1)) { case esql_parser.EVAL: this.enterOuterAlt(_localctx, 1); { - this.state = 85; + this.state = 91; this.evalCommand(); } break; case esql_parser.LIMIT: this.enterOuterAlt(_localctx, 2); { - this.state = 86; + this.state = 92; this.limitCommand(); } break; case esql_parser.PROJECT: this.enterOuterAlt(_localctx, 3); { - this.state = 87; + this.state = 93; this.projectCommand(); } break; case esql_parser.SORT: this.enterOuterAlt(_localctx, 4); { - this.state = 88; + this.state = 94; this.sortCommand(); } break; case esql_parser.STATS: this.enterOuterAlt(_localctx, 5); { - this.state = 89; + this.state = 95; this.statsCommand(); } break; case esql_parser.WHERE: this.enterOuterAlt(_localctx, 6); { - this.state = 90; + this.state = 96; this.whereCommand(); } break; @@ -397,9 +385,9 @@ export class esql_parser extends Parser { try { this.enterOuterAlt(_localctx, 1); { - this.state = 93; + this.state = 99; this.match(esql_parser.WHERE); - this.state = 94; + this.state = 100; this.booleanExpression(0); } } @@ -436,42 +424,30 @@ export class esql_parser extends Parser { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 100; + this.state = 106; this._errHandler.sync(this); switch (this._input.LA(1)) { case esql_parser.NOT: { - _localctx = new LogicalNotContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 97; + this.state = 103; this.match(esql_parser.NOT); - this.state = 98; + this.state = 104; this.booleanExpression(4); } break; case esql_parser.STRING: case esql_parser.INTEGER_LITERAL: case esql_parser.DECIMAL_LITERAL: - case esql_parser.FALSE: case esql_parser.LP: case esql_parser.NULL: - case esql_parser.TRUE: + case esql_parser.BOOLEAN_VALUE: case esql_parser.PLUS: case esql_parser.MINUS: - case esql_parser.ROUND_FUNCTION_MATH: - case esql_parser.AVG_FUNCTION_MATH: - case esql_parser.SUM_FUNCTION_MATH: - case esql_parser.MIN_FUNCTION_MATH: - case esql_parser.MAX_FUNCTION_MATH: + case esql_parser.UNARY_FUNCTION: case esql_parser.UNQUOTED_IDENTIFIER: case esql_parser.QUOTED_IDENTIFIER: { - _localctx = new BooleanDefaultContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 99; + this.state = 105; this.valueExpression(); } break; @@ -479,7 +455,7 @@ export class esql_parser extends Parser { throw new NoViableAltException(this); } this._ctx._stop = this._input.tryLT(-1); - this.state = 110; + this.state = 116; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -489,44 +465,44 @@ export class esql_parser extends Parser { } _prevctx = _localctx; { - this.state = 108; + this.state = 114; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 4, this._ctx) ) { case 1: { - _localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState)); - (_localctx as LogicalBinaryContext)._left = _prevctx; + _localctx = new BooleanExpressionContext(_parentctx, _parentState); + _localctx._left = _prevctx; this.pushNewRecursionContext(_localctx, _startState, esql_parser.RULE_booleanExpression); - this.state = 102; + this.state = 108; if (!(this.precpred(this._ctx, 2))) { throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); } - this.state = 103; - (_localctx as LogicalBinaryContext)._operator = this.match(esql_parser.AND); - this.state = 104; - (_localctx as LogicalBinaryContext)._right = this.booleanExpression(3); + this.state = 109; + _localctx._operator = this.match(esql_parser.AND); + this.state = 110; + _localctx._right = this.booleanExpression(3); } break; case 2: { - _localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState)); - (_localctx as LogicalBinaryContext)._left = _prevctx; + _localctx = new BooleanExpressionContext(_parentctx, _parentState); + _localctx._left = _prevctx; this.pushNewRecursionContext(_localctx, _startState, esql_parser.RULE_booleanExpression); - this.state = 105; + this.state = 111; if (!(this.precpred(this._ctx, 1))) { throw new FailedPredicateException(this, "this.precpred(this._ctx, 1)"); } - this.state = 106; - (_localctx as LogicalBinaryContext)._operator = this.match(esql_parser.OR); - this.state = 107; - (_localctx as LogicalBinaryContext)._right = this.booleanExpression(2); + this.state = 112; + _localctx._operator = this.match(esql_parser.OR); + this.state = 113; + _localctx._right = this.booleanExpression(2); } break; } } } - this.state = 112; + this.state = 118; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx); } @@ -550,71 +526,110 @@ export class esql_parser extends Parser { public valueExpression(): ValueExpressionContext { let _localctx: ValueExpressionContext = new ValueExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 12, esql_parser.RULE_valueExpression); - let _la: number; try { - this.state = 132; + this.state = 121; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 8, this._ctx) ) { + switch ( this.interpreter.adaptivePredict(this._input, 6, this._ctx) ) { case 1: - _localctx = new ValueFunctionExpressionContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 113; - this.functionIdentifier(); - this.state = 114; - this.match(esql_parser.LP); - this.state = 123; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === esql_parser.STRING || _la === esql_parser.UNQUOTED_IDENTIFIER || _la === esql_parser.QUOTED_IDENTIFIER) { - { - this.state = 115; - this.functionExpressionArgument(); - this.state = 120; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === esql_parser.COMMA) { - { - { - this.state = 116; - this.match(esql_parser.COMMA); - this.state = 117; - this.functionExpressionArgument(); - } - } - this.state = 122; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - } - } - - this.state = 125; - this.match(esql_parser.RP); + this.state = 119; + this.operatorExpression(0); } break; case 2: - _localctx = new ValueExpressionDefaultContext(_localctx); this.enterOuterAlt(_localctx, 2); { - this.state = 127; - this.operatorExpression(0); + this.state = 120; + this.comparison(); } break; - - case 3: - _localctx = new ComparisonContext(_localctx); - this.enterOuterAlt(_localctx, 3); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public comparison(): ComparisonContext { + let _localctx: ComparisonContext = new ComparisonContext(this._ctx, this.state); + this.enterRule(_localctx, 14, esql_parser.RULE_comparison); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 123; + _localctx._left = this.operatorExpression(0); + this.state = 124; + this.comparisonOperator(); + this.state = 125; + _localctx._right = this.operatorExpression(0); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public mathFn(): MathFnContext { + let _localctx: MathFnContext = new MathFnContext(this._ctx, this.state); + this.enterRule(_localctx, 16, esql_parser.RULE_mathFn); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 127; + this.functionIdentifier(); + this.state = 128; + this.match(esql_parser.LP); + this.state = 137; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 14)) & ~0x1F) === 0 && ((1 << (_la - 14)) & ((1 << (esql_parser.STRING - 14)) | (1 << (esql_parser.UNQUOTED_IDENTIFIER - 14)) | (1 << (esql_parser.QUOTED_IDENTIFIER - 14)))) !== 0)) { { - this.state = 128; - (_localctx as ComparisonContext)._left = this.operatorExpression(0); this.state = 129; - this.comparisonOperator(); - this.state = 130; - (_localctx as ComparisonContext)._right = this.operatorExpression(0); + this.functionExpressionArgument(); + this.state = 134; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === esql_parser.COMMA) { + { + { + this.state = 130; + this.match(esql_parser.COMMA); + this.state = 131; + this.functionExpressionArgument(); + } + } + this.state = 136; + this._errHandler.sync(this); + _la = this._input.LA(1); } - break; + } + } + + this.state = 139; + this.match(esql_parser.RP); } } catch (re) { @@ -644,45 +659,43 @@ export class esql_parser extends Parser { let _parentState: number = this.state; let _localctx: OperatorExpressionContext = new OperatorExpressionContext(this._ctx, _parentState); let _prevctx: OperatorExpressionContext = _localctx; - let _startState: number = 14; - this.enterRecursionRule(_localctx, 14, esql_parser.RULE_operatorExpression, _p); + let _startState: number = 18; + this.enterRecursionRule(_localctx, 18, esql_parser.RULE_operatorExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 138; + this.state = 146; this._errHandler.sync(this); switch (this._input.LA(1)) { case esql_parser.STRING: case esql_parser.INTEGER_LITERAL: case esql_parser.DECIMAL_LITERAL: - case esql_parser.FALSE: case esql_parser.LP: case esql_parser.NULL: - case esql_parser.TRUE: + case esql_parser.BOOLEAN_VALUE: case esql_parser.UNQUOTED_IDENTIFIER: case esql_parser.QUOTED_IDENTIFIER: { - _localctx = new OperatorExpressionDefaultContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 135; + this.state = 142; this.primaryExpression(); } break; + case esql_parser.UNARY_FUNCTION: + { + this.state = 143; + this.mathFn(); + } + break; case esql_parser.PLUS: case esql_parser.MINUS: { - _localctx = new ArithmeticUnaryContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 136; - (_localctx as ArithmeticUnaryContext)._operator = this._input.LT(1); + this.state = 144; + _localctx._operator = this._input.LT(1); _la = this._input.LA(1); if (!(_la === esql_parser.PLUS || _la === esql_parser.MINUS)) { - (_localctx as ArithmeticUnaryContext)._operator = this._errHandler.recoverInline(this); + _localctx._operator = this._errHandler.recoverInline(this); } else { if (this._input.LA(1) === Token.EOF) { this.matchedEOF = true; @@ -691,7 +704,7 @@ export class esql_parser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 137; + this.state = 145; this.operatorExpression(3); } break; @@ -699,7 +712,7 @@ export class esql_parser extends Parser { throw new NoViableAltException(this); } this._ctx._stop = this._input.tryLT(-1); - this.state = 148; + this.state = 156; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -709,23 +722,23 @@ export class esql_parser extends Parser { } _prevctx = _localctx; { - this.state = 146; + this.state = 154; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) { case 1: { - _localctx = new ArithmeticBinaryContext(new OperatorExpressionContext(_parentctx, _parentState)); - (_localctx as ArithmeticBinaryContext)._left = _prevctx; + _localctx = new OperatorExpressionContext(_parentctx, _parentState); + _localctx._left = _prevctx; this.pushNewRecursionContext(_localctx, _startState, esql_parser.RULE_operatorExpression); - this.state = 140; + this.state = 148; if (!(this.precpred(this._ctx, 2))) { throw new FailedPredicateException(this, "this.precpred(this._ctx, 2)"); } - this.state = 141; - (_localctx as ArithmeticBinaryContext)._operator = this._input.LT(1); + this.state = 149; + _localctx._operator = this._input.LT(1); _la = this._input.LA(1); - if (!(((((_la - 44)) & ~0x1F) === 0 && ((1 << (_la - 44)) & ((1 << (esql_parser.ASTERISK - 44)) | (1 << (esql_parser.SLASH - 44)) | (1 << (esql_parser.PERCENT - 44)))) !== 0))) { - (_localctx as ArithmeticBinaryContext)._operator = this._errHandler.recoverInline(this); + if (!(((((_la - 33)) & ~0x1F) === 0 && ((1 << (_la - 33)) & ((1 << (esql_parser.ASTERISK - 33)) | (1 << (esql_parser.SLASH - 33)) | (1 << (esql_parser.PERCENT - 33)))) !== 0))) { + _localctx._operator = this._errHandler.recoverInline(this); } else { if (this._input.LA(1) === Token.EOF) { this.matchedEOF = true; @@ -734,25 +747,25 @@ export class esql_parser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 142; - (_localctx as ArithmeticBinaryContext)._right = this.operatorExpression(3); + this.state = 150; + _localctx._right = this.operatorExpression(3); } break; case 2: { - _localctx = new ArithmeticBinaryContext(new OperatorExpressionContext(_parentctx, _parentState)); - (_localctx as ArithmeticBinaryContext)._left = _prevctx; + _localctx = new OperatorExpressionContext(_parentctx, _parentState); + _localctx._left = _prevctx; this.pushNewRecursionContext(_localctx, _startState, esql_parser.RULE_operatorExpression); - this.state = 143; + this.state = 151; if (!(this.precpred(this._ctx, 1))) { throw new FailedPredicateException(this, "this.precpred(this._ctx, 1)"); } - this.state = 144; - (_localctx as ArithmeticBinaryContext)._operator = this._input.LT(1); + this.state = 152; + _localctx._operator = this._input.LT(1); _la = this._input.LA(1); if (!(_la === esql_parser.PLUS || _la === esql_parser.MINUS)) { - (_localctx as ArithmeticBinaryContext)._operator = this._errHandler.recoverInline(this); + _localctx._operator = this._errHandler.recoverInline(this); } else { if (this._input.LA(1) === Token.EOF) { this.matchedEOF = true; @@ -761,14 +774,14 @@ export class esql_parser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 145; - (_localctx as ArithmeticBinaryContext)._right = this.operatorExpression(2); + this.state = 153; + _localctx._right = this.operatorExpression(2); } break; } } } - this.state = 150; + this.state = 158; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx); } @@ -791,78 +804,74 @@ export class esql_parser extends Parser { // @RuleVersion(0) public primaryExpression(): PrimaryExpressionContext { let _localctx: PrimaryExpressionContext = new PrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 16, esql_parser.RULE_primaryExpression); + this.enterRule(_localctx, 20, esql_parser.RULE_primaryExpression); let _la: number; try { - this.state = 171; + this.state = 179; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 14, this._ctx) ) { case 1: - _localctx = new ConstantDefaultContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 151; + this.state = 159; this.constant(); } break; case 2: - _localctx = new DereferenceContext(_localctx); this.enterOuterAlt(_localctx, 2); { - this.state = 152; + this.state = 160; this.qualifiedName(); } break; case 3: - _localctx = new ParenthesizedExpressionContext(_localctx); this.enterOuterAlt(_localctx, 3); { - this.state = 153; + this.state = 161; this.match(esql_parser.LP); - this.state = 154; + this.state = 162; this.booleanExpression(0); - this.state = 155; + this.state = 163; this.match(esql_parser.RP); } break; case 4: - _localctx = new FunctionExpressionContext(_localctx); this.enterOuterAlt(_localctx, 4); { - this.state = 157; + this.state = 165; this.identifier(); - this.state = 158; + this.state = 166; this.match(esql_parser.LP); - this.state = 167; + this.state = 175; this._errHandler.sync(this); _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << esql_parser.STRING) | (1 << esql_parser.INTEGER_LITERAL) | (1 << esql_parser.DECIMAL_LITERAL) | (1 << esql_parser.FALSE) | (1 << esql_parser.LP) | (1 << esql_parser.NOT) | (1 << esql_parser.NULL))) !== 0) || ((((_la - 35)) & ~0x1F) === 0 && ((1 << (_la - 35)) & ((1 << (esql_parser.TRUE - 35)) | (1 << (esql_parser.PLUS - 35)) | (1 << (esql_parser.MINUS - 35)) | (1 << (esql_parser.ROUND_FUNCTION_MATH - 35)) | (1 << (esql_parser.AVG_FUNCTION_MATH - 35)) | (1 << (esql_parser.SUM_FUNCTION_MATH - 35)) | (1 << (esql_parser.MIN_FUNCTION_MATH - 35)) | (1 << (esql_parser.MAX_FUNCTION_MATH - 35)) | (1 << (esql_parser.UNQUOTED_IDENTIFIER - 35)) | (1 << (esql_parser.QUOTED_IDENTIFIER - 35)))) !== 0)) { + if (((((_la - 14)) & ~0x1F) === 0 && ((1 << (_la - 14)) & ((1 << (esql_parser.STRING - 14)) | (1 << (esql_parser.INTEGER_LITERAL - 14)) | (1 << (esql_parser.DECIMAL_LITERAL - 14)) | (1 << (esql_parser.LP - 14)) | (1 << (esql_parser.NOT - 14)) | (1 << (esql_parser.NULL - 14)) | (1 << (esql_parser.BOOLEAN_VALUE - 14)) | (1 << (esql_parser.PLUS - 14)) | (1 << (esql_parser.MINUS - 14)) | (1 << (esql_parser.UNARY_FUNCTION - 14)) | (1 << (esql_parser.UNQUOTED_IDENTIFIER - 14)) | (1 << (esql_parser.QUOTED_IDENTIFIER - 14)))) !== 0)) { { - this.state = 159; + this.state = 167; this.booleanExpression(0); - this.state = 164; + this.state = 172; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === esql_parser.COMMA) { { { - this.state = 160; + this.state = 168; this.match(esql_parser.COMMA); - this.state = 161; + this.state = 169; this.booleanExpression(0); } } - this.state = 166; + this.state = 174; this._errHandler.sync(this); _la = this._input.LA(1); } } } - this.state = 169; + this.state = 177; this.match(esql_parser.RP); } break; @@ -885,13 +894,13 @@ export class esql_parser extends Parser { // @RuleVersion(0) public rowCommand(): RowCommandContext { let _localctx: RowCommandContext = new RowCommandContext(this._ctx, this.state); - this.enterRule(_localctx, 18, esql_parser.RULE_rowCommand); + this.enterRule(_localctx, 22, esql_parser.RULE_rowCommand); try { this.enterOuterAlt(_localctx, 1); { - this.state = 173; + this.state = 181; this.match(esql_parser.ROW); - this.state = 174; + this.state = 182; this.fields(); } } @@ -912,28 +921,28 @@ export class esql_parser extends Parser { // @RuleVersion(0) public fields(): FieldsContext { let _localctx: FieldsContext = new FieldsContext(this._ctx, this.state); - this.enterRule(_localctx, 20, esql_parser.RULE_fields); + this.enterRule(_localctx, 24, esql_parser.RULE_fields); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 176; + this.state = 184; this.field(); - this.state = 181; + this.state = 189; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 15, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 177; + this.state = 185; this.match(esql_parser.COMMA); - this.state = 178; + this.state = 186; this.field(); } } } - this.state = 183; + this.state = 191; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 15, this._ctx); } @@ -956,39 +965,27 @@ export class esql_parser extends Parser { // @RuleVersion(0) public field(): FieldContext { let _localctx: FieldContext = new FieldContext(this._ctx, this.state); - this.enterRule(_localctx, 22, esql_parser.RULE_field); + this.enterRule(_localctx, 26, esql_parser.RULE_field); try { - this.state = 193; + this.state = 197; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 16, this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { - this.state = 184; - this.qualifiedName(); - this.state = 185; - this.match(esql_parser.ASSIGN); - this.state = 186; - this.valueExpression(); + this.state = 192; + this.booleanExpression(0); } break; case 2: this.enterOuterAlt(_localctx, 2); { - this.state = 188; - this.booleanExpression(0); - } - break; - - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 189; - this.qualifiedName(); - this.state = 190; + this.state = 193; + this.userVariable(); + this.state = 194; this.match(esql_parser.ASSIGN); - this.state = 191; + this.state = 195; this.booleanExpression(0); } break; @@ -1009,32 +1006,57 @@ export class esql_parser extends Parser { return _localctx; } // @RuleVersion(0) + public userVariable(): UserVariableContext { + let _localctx: UserVariableContext = new UserVariableContext(this._ctx, this.state); + this.enterRule(_localctx, 28, esql_parser.RULE_userVariable); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 199; + this.identifier(); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) public fromCommand(): FromCommandContext { let _localctx: FromCommandContext = new FromCommandContext(this._ctx, this.state); - this.enterRule(_localctx, 24, esql_parser.RULE_fromCommand); + this.enterRule(_localctx, 30, esql_parser.RULE_fromCommand); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 195; + this.state = 201; this.match(esql_parser.FROM); - this.state = 196; + this.state = 202; this.sourceIdentifier(); - this.state = 201; + this.state = 207; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 17, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 197; + this.state = 203; this.match(esql_parser.COMMA); - this.state = 198; + this.state = 204; this.sourceIdentifier(); } } } - this.state = 203; + this.state = 209; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 17, this._ctx); } @@ -1057,13 +1079,13 @@ export class esql_parser extends Parser { // @RuleVersion(0) public evalCommand(): EvalCommandContext { let _localctx: EvalCommandContext = new EvalCommandContext(this._ctx, this.state); - this.enterRule(_localctx, 26, esql_parser.RULE_evalCommand); + this.enterRule(_localctx, 32, esql_parser.RULE_evalCommand); try { this.enterOuterAlt(_localctx, 1); { - this.state = 204; + this.state = 210; this.match(esql_parser.EVAL); - this.state = 205; + this.state = 211; this.fields(); } } @@ -1084,22 +1106,22 @@ export class esql_parser extends Parser { // @RuleVersion(0) public statsCommand(): StatsCommandContext { let _localctx: StatsCommandContext = new StatsCommandContext(this._ctx, this.state); - this.enterRule(_localctx, 28, esql_parser.RULE_statsCommand); + this.enterRule(_localctx, 34, esql_parser.RULE_statsCommand); try { this.enterOuterAlt(_localctx, 1); { - this.state = 207; + this.state = 213; this.match(esql_parser.STATS); - this.state = 208; + this.state = 214; this.fields(); - this.state = 211; + this.state = 217; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 18, this._ctx) ) { case 1: { - this.state = 209; + this.state = 215; this.match(esql_parser.BY); - this.state = 210; + this.state = 216; this.qualifiedNames(); } break; @@ -1123,12 +1145,12 @@ export class esql_parser extends Parser { // @RuleVersion(0) public sourceIdentifier(): SourceIdentifierContext { let _localctx: SourceIdentifierContext = new SourceIdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 30, esql_parser.RULE_sourceIdentifier); + this.enterRule(_localctx, 36, esql_parser.RULE_sourceIdentifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 213; + this.state = 219; _la = this._input.LA(1); if (!(_la === esql_parser.SRC_UNQUOTED_IDENTIFIER || _la === esql_parser.SRC_QUOTED_IDENTIFIER)) { this._errHandler.recoverInline(this); @@ -1159,23 +1181,23 @@ export class esql_parser extends Parser { // @RuleVersion(0) public functionExpressionArgument(): FunctionExpressionArgumentContext { let _localctx: FunctionExpressionArgumentContext = new FunctionExpressionArgumentContext(this._ctx, this.state); - this.enterRule(_localctx, 32, esql_parser.RULE_functionExpressionArgument); + this.enterRule(_localctx, 38, esql_parser.RULE_functionExpressionArgument); try { - this.state = 217; + this.state = 223; this._errHandler.sync(this); switch (this._input.LA(1)) { case esql_parser.UNQUOTED_IDENTIFIER: case esql_parser.QUOTED_IDENTIFIER: this.enterOuterAlt(_localctx, 1); { - this.state = 215; + this.state = 221; this.qualifiedName(); } break; case esql_parser.STRING: this.enterOuterAlt(_localctx, 2); { - this.state = 216; + this.state = 222; this.string(); } break; @@ -1200,28 +1222,28 @@ export class esql_parser extends Parser { // @RuleVersion(0) public qualifiedName(): QualifiedNameContext { let _localctx: QualifiedNameContext = new QualifiedNameContext(this._ctx, this.state); - this.enterRule(_localctx, 34, esql_parser.RULE_qualifiedName); + this.enterRule(_localctx, 40, esql_parser.RULE_qualifiedName); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 219; + this.state = 225; this.identifier(); - this.state = 224; + this.state = 230; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 220; + this.state = 226; this.match(esql_parser.DOT); - this.state = 221; + this.state = 227; this.identifier(); } } } - this.state = 226; + this.state = 232; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx); } @@ -1244,28 +1266,28 @@ export class esql_parser extends Parser { // @RuleVersion(0) public qualifiedNames(): QualifiedNamesContext { let _localctx: QualifiedNamesContext = new QualifiedNamesContext(this._ctx, this.state); - this.enterRule(_localctx, 36, esql_parser.RULE_qualifiedNames); + this.enterRule(_localctx, 42, esql_parser.RULE_qualifiedNames); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 227; + this.state = 233; this.qualifiedName(); - this.state = 232; + this.state = 238; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 21, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 228; + this.state = 234; this.match(esql_parser.COMMA); - this.state = 229; + this.state = 235; this.qualifiedName(); } } } - this.state = 234; + this.state = 240; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 21, this._ctx); } @@ -1288,12 +1310,12 @@ export class esql_parser extends Parser { // @RuleVersion(0) public identifier(): IdentifierContext { let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 38, esql_parser.RULE_identifier); + this.enterRule(_localctx, 44, esql_parser.RULE_identifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 235; + this.state = 241; _la = this._input.LA(1); if (!(_la === esql_parser.UNQUOTED_IDENTIFIER || _la === esql_parser.QUOTED_IDENTIFIER)) { this._errHandler.recoverInline(this); @@ -1324,23 +1346,12 @@ export class esql_parser extends Parser { // @RuleVersion(0) public functionIdentifier(): FunctionIdentifierContext { let _localctx: FunctionIdentifierContext = new FunctionIdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 40, esql_parser.RULE_functionIdentifier); - let _la: number; + this.enterRule(_localctx, 46, esql_parser.RULE_functionIdentifier); try { this.enterOuterAlt(_localctx, 1); { - this.state = 237; - _la = this._input.LA(1); - if (!(((((_la - 47)) & ~0x1F) === 0 && ((1 << (_la - 47)) & ((1 << (esql_parser.ROUND_FUNCTION_MATH - 47)) | (1 << (esql_parser.AVG_FUNCTION_MATH - 47)) | (1 << (esql_parser.SUM_FUNCTION_MATH - 47)) | (1 << (esql_parser.MIN_FUNCTION_MATH - 47)) | (1 << (esql_parser.MAX_FUNCTION_MATH - 47)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } + this.state = 243; + this.match(esql_parser.UNARY_FUNCTION); } } catch (re) { @@ -1360,16 +1371,16 @@ export class esql_parser extends Parser { // @RuleVersion(0) public constant(): ConstantContext { let _localctx: ConstantContext = new ConstantContext(this._ctx, this.state); - this.enterRule(_localctx, 42, esql_parser.RULE_constant); + this.enterRule(_localctx, 48, esql_parser.RULE_constant); try { - this.state = 243; + this.state = 249; this._errHandler.sync(this); switch (this._input.LA(1)) { case esql_parser.NULL: _localctx = new NullLiteralContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 239; + this.state = 245; this.match(esql_parser.NULL); } break; @@ -1378,16 +1389,15 @@ export class esql_parser extends Parser { _localctx = new NumericLiteralContext(_localctx); this.enterOuterAlt(_localctx, 2); { - this.state = 240; + this.state = 246; this.number(); } break; - case esql_parser.FALSE: - case esql_parser.TRUE: + case esql_parser.BOOLEAN_VALUE: _localctx = new BooleanLiteralContext(_localctx); this.enterOuterAlt(_localctx, 3); { - this.state = 241; + this.state = 247; this.booleanValue(); } break; @@ -1395,7 +1405,7 @@ export class esql_parser extends Parser { _localctx = new StringLiteralContext(_localctx); this.enterOuterAlt(_localctx, 4); { - this.state = 242; + this.state = 248; this.string(); } break; @@ -1420,13 +1430,13 @@ export class esql_parser extends Parser { // @RuleVersion(0) public limitCommand(): LimitCommandContext { let _localctx: LimitCommandContext = new LimitCommandContext(this._ctx, this.state); - this.enterRule(_localctx, 44, esql_parser.RULE_limitCommand); + this.enterRule(_localctx, 50, esql_parser.RULE_limitCommand); try { this.enterOuterAlt(_localctx, 1); { - this.state = 245; + this.state = 251; this.match(esql_parser.LIMIT); - this.state = 246; + this.state = 252; this.match(esql_parser.INTEGER_LITERAL); } } @@ -1447,30 +1457,30 @@ export class esql_parser extends Parser { // @RuleVersion(0) public sortCommand(): SortCommandContext { let _localctx: SortCommandContext = new SortCommandContext(this._ctx, this.state); - this.enterRule(_localctx, 46, esql_parser.RULE_sortCommand); + this.enterRule(_localctx, 52, esql_parser.RULE_sortCommand); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 248; + this.state = 254; this.match(esql_parser.SORT); - this.state = 249; + this.state = 255; this.orderExpression(); - this.state = 254; + this.state = 260; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 23, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 250; + this.state = 256; this.match(esql_parser.COMMA); - this.state = 251; + this.state = 257; this.orderExpression(); } } } - this.state = 256; + this.state = 262; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 23, this._ctx); } @@ -1493,53 +1503,32 @@ export class esql_parser extends Parser { // @RuleVersion(0) public orderExpression(): OrderExpressionContext { let _localctx: OrderExpressionContext = new OrderExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 48, esql_parser.RULE_orderExpression); - let _la: number; + this.enterRule(_localctx, 54, esql_parser.RULE_orderExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 257; + this.state = 263; this.booleanExpression(0); - this.state = 259; + this.state = 265; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 24, this._ctx) ) { case 1: { - this.state = 258; - _localctx._ordering = this._input.LT(1); - _la = this._input.LA(1); - if (!(_la === esql_parser.ASC || _la === esql_parser.DESC)) { - _localctx._ordering = this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } + this.state = 264; + this.match(esql_parser.ORDERING); } break; } - this.state = 263; + this.state = 269; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 25, this._ctx) ) { case 1: { - this.state = 261; - this.match(esql_parser.NULLS); - this.state = 262; - _localctx._nullOrdering = this._input.LT(1); - _la = this._input.LA(1); - if (!(_la === esql_parser.FIRST || _la === esql_parser.LAST)) { - _localctx._nullOrdering = this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 267; + this.match(esql_parser.NULLS_ORDERING); + { + this.state = 268; + this.match(esql_parser.NULLS_ORDERING_DIRECTION); } } break; @@ -1563,30 +1552,30 @@ export class esql_parser extends Parser { // @RuleVersion(0) public projectCommand(): ProjectCommandContext { let _localctx: ProjectCommandContext = new ProjectCommandContext(this._ctx, this.state); - this.enterRule(_localctx, 50, esql_parser.RULE_projectCommand); + this.enterRule(_localctx, 56, esql_parser.RULE_projectCommand); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 265; + this.state = 271; this.match(esql_parser.PROJECT); - this.state = 266; + this.state = 272; this.projectClause(); - this.state = 271; + this.state = 277; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 267; + this.state = 273; this.match(esql_parser.COMMA); - this.state = 268; + this.state = 274; this.projectClause(); } } } - this.state = 273; + this.state = 279; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx); } @@ -1609,15 +1598,15 @@ export class esql_parser extends Parser { // @RuleVersion(0) public projectClause(): ProjectClauseContext { let _localctx: ProjectClauseContext = new ProjectClauseContext(this._ctx, this.state); - this.enterRule(_localctx, 52, esql_parser.RULE_projectClause); + this.enterRule(_localctx, 58, esql_parser.RULE_projectClause); try { - this.state = 279; + this.state = 285; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 27, this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { - this.state = 274; + this.state = 280; this.sourceIdentifier(); } break; @@ -1625,11 +1614,11 @@ export class esql_parser extends Parser { case 2: this.enterOuterAlt(_localctx, 2); { - this.state = 275; + this.state = 281; _localctx._newName = this.sourceIdentifier(); - this.state = 276; + this.state = 282; this.match(esql_parser.ASSIGN); - this.state = 277; + this.state = 283; _localctx._oldName = this.sourceIdentifier(); } break; @@ -1652,23 +1641,12 @@ export class esql_parser extends Parser { // @RuleVersion(0) public booleanValue(): BooleanValueContext { let _localctx: BooleanValueContext = new BooleanValueContext(this._ctx, this.state); - this.enterRule(_localctx, 54, esql_parser.RULE_booleanValue); - let _la: number; + this.enterRule(_localctx, 60, esql_parser.RULE_booleanValue); try { this.enterOuterAlt(_localctx, 1); { - this.state = 281; - _la = this._input.LA(1); - if (!(_la === esql_parser.FALSE || _la === esql_parser.TRUE)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } + this.state = 287; + this.match(esql_parser.BOOLEAN_VALUE); } } catch (re) { @@ -1688,16 +1666,16 @@ export class esql_parser extends Parser { // @RuleVersion(0) public number(): NumberContext { let _localctx: NumberContext = new NumberContext(this._ctx, this.state); - this.enterRule(_localctx, 56, esql_parser.RULE_number); + this.enterRule(_localctx, 62, esql_parser.RULE_number); try { - this.state = 285; + this.state = 291; this._errHandler.sync(this); switch (this._input.LA(1)) { case esql_parser.DECIMAL_LITERAL: _localctx = new DecimalLiteralContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 283; + this.state = 289; this.match(esql_parser.DECIMAL_LITERAL); } break; @@ -1705,7 +1683,7 @@ export class esql_parser extends Parser { _localctx = new IntegerLiteralContext(_localctx); this.enterOuterAlt(_localctx, 2); { - this.state = 284; + this.state = 290; this.match(esql_parser.INTEGER_LITERAL); } break; @@ -1730,11 +1708,11 @@ export class esql_parser extends Parser { // @RuleVersion(0) public string(): StringContext { let _localctx: StringContext = new StringContext(this._ctx, this.state); - this.enterRule(_localctx, 58, esql_parser.RULE_string); + this.enterRule(_localctx, 64, esql_parser.RULE_string); try { this.enterOuterAlt(_localctx, 1); { - this.state = 287; + this.state = 293; this.match(esql_parser.STRING); } } @@ -1755,23 +1733,12 @@ export class esql_parser extends Parser { // @RuleVersion(0) public comparisonOperator(): ComparisonOperatorContext { let _localctx: ComparisonOperatorContext = new ComparisonOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 60, esql_parser.RULE_comparisonOperator); - let _la: number; + this.enterRule(_localctx, 66, esql_parser.RULE_comparisonOperator); try { this.enterOuterAlt(_localctx, 1); { - this.state = 289; - _la = this._input.LA(1); - if (!(((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & ((1 << (esql_parser.EQ - 36)) | (1 << (esql_parser.NEQ - 36)) | (1 << (esql_parser.LT - 36)) | (1 << (esql_parser.LTE - 36)) | (1 << (esql_parser.GT - 36)) | (1 << (esql_parser.GTE - 36)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } + this.state = 295; + this.match(esql_parser.COMPARISON_OPERATOR); } } catch (re) { @@ -1791,13 +1758,13 @@ export class esql_parser extends Parser { // @RuleVersion(0) public explainCommand(): ExplainCommandContext { let _localctx: ExplainCommandContext = new ExplainCommandContext(this._ctx, this.state); - this.enterRule(_localctx, 62, esql_parser.RULE_explainCommand); + this.enterRule(_localctx, 68, esql_parser.RULE_explainCommand); try { this.enterOuterAlt(_localctx, 1); { - this.state = 291; + this.state = 297; this.match(esql_parser.EXPLAIN); - this.state = 292; + this.state = 298; this.subqueryExpression(); } } @@ -1818,15 +1785,15 @@ export class esql_parser extends Parser { // @RuleVersion(0) public subqueryExpression(): SubqueryExpressionContext { let _localctx: SubqueryExpressionContext = new SubqueryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 64, esql_parser.RULE_subqueryExpression); + this.enterRule(_localctx, 70, esql_parser.RULE_subqueryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 294; + this.state = 300; this.match(esql_parser.OPENING_BRACKET); - this.state = 295; + this.state = 301; this.query(0); - this.state = 296; + this.state = 302; this.match(esql_parser.CLOSING_BRACKET); } } @@ -1853,7 +1820,7 @@ export class esql_parser extends Parser { case 5: return this.booleanExpression_sempred(_localctx as BooleanExpressionContext, predIndex); - case 7: + case 9: return this.operatorExpression_sempred(_localctx as OperatorExpressionContext, predIndex); } return true; @@ -1887,140 +1854,141 @@ export class esql_parser extends Parser { } public static readonly _serializedATN: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03@\u012D\x04\x02" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x033\u0133\x04\x02" + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + "\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + - "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x03\x02" + - "\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x07\x03" + - "N\n\x03\f\x03\x0E\x03Q\v\x03\x03\x04\x03\x04\x03\x04\x05\x04V\n\x04\x03" + - "\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x05\x05^\n\x05\x03\x06\x03" + - "\x06\x03\x06\x03\x07\x03\x07\x03\x07\x03\x07\x05\x07g\n\x07\x03\x07\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x03\x07\x07\x07o\n\x07\f\x07\x0E\x07r\v\x07" + - "\x03\b\x03\b\x03\b\x03\b\x03\b\x07\by\n\b\f\b\x0E\b|\v\b\x05\b~\n\b\x03" + - "\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x05\b\x87\n\b\x03\t\x03\t\x03\t" + - "\x03\t\x05\t\x8D\n\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x07\t\x95\n\t" + - "\f\t\x0E\t\x98\v\t\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03" + - "\n\x03\n\x03\n\x07\n\xA5\n\n\f\n\x0E\n\xA8\v\n\x05\n\xAA\n\n\x03\n\x03" + - "\n\x05\n\xAE\n\n\x03\v\x03\v\x03\v\x03\f\x03\f\x03\f\x07\f\xB6\n\f\f\f" + - "\x0E\f\xB9\v\f\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x05" + - "\r\xC4\n\r\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x07\x0E\xCA\n\x0E\f\x0E\x0E" + - "\x0E\xCD\v\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x10\x03\x10" + - "\x05\x10\xD6\n\x10\x03\x11\x03\x11\x03\x12\x03\x12\x05\x12\xDC\n\x12\x03" + - "\x13\x03\x13\x03\x13\x07\x13\xE1\n\x13\f\x13\x0E\x13\xE4\v\x13\x03\x14" + - "\x03\x14\x03\x14\x07\x14\xE9\n\x14\f\x14\x0E\x14\xEC\v\x14\x03\x15\x03" + - "\x15\x03\x16\x03\x16\x03\x17\x03\x17\x03\x17\x03\x17\x05\x17\xF6\n\x17" + - "\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x19\x07\x19\xFF\n" + - "\x19\f\x19\x0E\x19\u0102\v\x19\x03\x1A\x03\x1A\x05\x1A\u0106\n\x1A\x03" + - "\x1A\x03\x1A\x05\x1A\u010A\n\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x07\x1B" + - "\u0110\n\x1B\f\x1B\x0E\x1B\u0113\v\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C" + - "\x03\x1C\x05\x1C\u011A\n\x1C\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x05\x1E\u0120" + - "\n\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03!\x03\"\x03\"\x03\"\x03" + - "\"\x03\"\x02\x02\x05\x04\f\x10#\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f" + - "\x02\x0E\x02\x10\x02\x12\x02\x14\x02\x16\x02\x18\x02\x1A\x02\x1C\x02\x1E" + - "\x02 \x02\"\x02$\x02&\x02(\x02*\x02,\x02.\x020\x022\x024\x026\x028\x02" + - ":\x02<\x02>\x02@\x02B\x02\x02\v\x03\x02,-\x03\x02.0\x03\x02;<\x03\x02" + - "67\x03\x0215\x04\x02\x15\x15\x18\x18\x03\x02\x1B\x1C\x04\x02\x1A\x1A%" + - "%\x03\x02&+\x02\u0133\x02D\x03\x02\x02\x02\x04G\x03\x02\x02\x02\x06U\x03" + - "\x02\x02\x02\b]\x03\x02\x02\x02\n_\x03\x02\x02\x02\ff\x03\x02\x02\x02" + - "\x0E\x86\x03\x02\x02\x02\x10\x8C\x03\x02\x02\x02\x12\xAD\x03\x02\x02\x02" + - "\x14\xAF\x03\x02\x02\x02\x16\xB2\x03\x02\x02\x02\x18\xC3\x03\x02\x02\x02" + - "\x1A\xC5\x03\x02\x02\x02\x1C\xCE\x03\x02\x02\x02\x1E\xD1\x03\x02\x02\x02" + - " \xD7\x03\x02\x02\x02\"\xDB\x03\x02\x02\x02$\xDD\x03\x02\x02\x02&\xE5" + - "\x03\x02\x02\x02(\xED\x03\x02\x02\x02*\xEF\x03\x02\x02\x02,\xF5\x03\x02" + - "\x02\x02.\xF7\x03\x02\x02\x020\xFA\x03\x02\x02\x022\u0103\x03\x02\x02" + - "\x024\u010B\x03\x02\x02\x026\u0119\x03\x02\x02\x028\u011B\x03\x02\x02" + - "\x02:\u011F\x03\x02\x02\x02<\u0121\x03\x02\x02\x02>\u0123\x03\x02\x02" + - "\x02@\u0125\x03\x02\x02\x02B\u0128\x03\x02\x02\x02DE\x05\x04\x03\x02E" + - "F\x07\x02\x02\x03F\x03\x03\x02\x02\x02GH\b\x03\x01\x02HI\x05\x06\x04\x02" + - "IO\x03\x02\x02\x02JK\f\x03\x02\x02KL\x07\x0F\x02\x02LN\x05\b\x05\x02M" + - "J\x03\x02\x02\x02NQ\x03\x02\x02\x02OM\x03\x02\x02\x02OP\x03\x02\x02\x02" + - "P\x05\x03\x02\x02\x02QO\x03\x02\x02\x02RV\x05@!\x02SV\x05\x1A\x0E\x02" + - "TV\x05\x14\v\x02UR\x03\x02\x02\x02US\x03\x02\x02\x02UT\x03\x02\x02\x02" + - "V\x07\x03\x02\x02\x02W^\x05\x1C\x0F\x02X^\x05.\x18\x02Y^\x054\x1B\x02" + - "Z^\x050\x19\x02[^\x05\x1E\x10\x02\\^\x05\n\x06\x02]W\x03\x02\x02\x02]" + - "X\x03\x02\x02\x02]Y\x03\x02\x02\x02]Z\x03\x02\x02\x02][\x03\x02\x02\x02" + - "]\\\x03\x02\x02\x02^\t\x03\x02\x02\x02_`\x07\b\x02\x02`a\x05\f\x07\x02" + - "a\v\x03\x02\x02\x02bc\b\x07\x01\x02cd\x07 \x02\x02dg\x05\f\x07\x06eg\x05" + - "\x0E\b\x02fb\x03\x02\x02\x02fe\x03\x02\x02\x02gp\x03\x02\x02\x02hi\f\x04" + - "\x02\x02ij\x07\x14\x02\x02jo\x05\f\x07\x05kl\f\x03\x02\x02lm\x07#\x02" + - "\x02mo\x05\f\x07\x04nh\x03\x02\x02\x02nk\x03\x02\x02\x02or\x03\x02\x02" + - "\x02pn\x03\x02\x02\x02pq\x03\x02\x02\x02q\r\x03\x02\x02\x02rp\x03\x02" + - "\x02\x02st\x05*\x16\x02t}\x07\x1D\x02\x02uz\x05\"\x12\x02vw\x07\x17\x02" + - "\x02wy\x05\"\x12\x02xv\x03\x02\x02\x02y|\x03\x02\x02\x02zx\x03\x02\x02" + - "\x02z{\x03\x02\x02\x02{~\x03\x02\x02\x02|z\x03\x02\x02\x02}u\x03\x02\x02" + - "\x02}~\x03\x02\x02\x02~\x7F\x03\x02\x02\x02\x7F\x80\x07$\x02\x02\x80\x87" + - "\x03\x02\x02\x02\x81\x87\x05\x10\t\x02\x82\x83\x05\x10\t\x02\x83\x84\x05" + - "> \x02\x84\x85\x05\x10\t\x02\x85\x87\x03\x02\x02\x02\x86s\x03\x02\x02" + - "\x02\x86\x81\x03\x02\x02\x02\x86\x82\x03\x02\x02\x02\x87\x0F\x03\x02\x02" + - "\x02\x88\x89\b\t\x01\x02\x89\x8D\x05\x12\n\x02\x8A\x8B\t\x02\x02\x02\x8B" + - "\x8D\x05\x10\t\x05\x8C\x88\x03\x02\x02\x02\x8C\x8A\x03\x02\x02\x02\x8D" + - "\x96\x03\x02\x02\x02\x8E\x8F\f\x04\x02\x02\x8F\x90\t\x03\x02\x02\x90\x95" + - "\x05\x10\t\x05\x91\x92\f\x03\x02\x02\x92\x93\t\x02\x02\x02\x93\x95\x05" + - "\x10\t\x04\x94\x8E\x03\x02\x02\x02\x94\x91\x03\x02\x02\x02\x95\x98\x03" + - "\x02\x02\x02\x96\x94\x03\x02\x02\x02\x96\x97\x03\x02\x02\x02\x97\x11\x03" + - "\x02\x02\x02\x98\x96\x03\x02\x02\x02\x99\xAE\x05,\x17\x02\x9A\xAE\x05" + - "$\x13\x02\x9B\x9C\x07\x1D\x02\x02\x9C\x9D\x05\f\x07\x02\x9D\x9E\x07$\x02" + - "\x02\x9E\xAE\x03\x02\x02\x02\x9F\xA0\x05(\x15\x02\xA0\xA9\x07\x1D\x02" + - "\x02\xA1\xA6\x05\f\x07\x02\xA2\xA3\x07\x17\x02\x02\xA3\xA5\x05\f\x07\x02" + - "\xA4\xA2\x03\x02\x02\x02\xA5\xA8\x03\x02\x02\x02\xA6\xA4\x03\x02\x02\x02" + - "\xA6\xA7\x03\x02\x02\x02\xA7\xAA\x03\x02\x02\x02\xA8\xA6\x03\x02\x02\x02" + - "\xA9\xA1\x03\x02\x02\x02\xA9\xAA\x03\x02\x02\x02\xAA\xAB\x03\x02\x02\x02" + - "\xAB\xAC\x07$\x02\x02\xAC\xAE\x03\x02\x02\x02\xAD\x99\x03\x02\x02\x02" + - "\xAD\x9A\x03\x02\x02\x02\xAD\x9B\x03\x02\x02\x02\xAD\x9F\x03\x02\x02\x02" + - "\xAE\x13\x03\x02\x02\x02\xAF\xB0\x07\x06\x02\x02\xB0\xB1\x05\x16\f\x02" + - "\xB1\x15\x03\x02\x02\x02\xB2\xB7\x05\x18\r\x02\xB3\xB4\x07\x17\x02\x02" + - "\xB4\xB6\x05\x18\r\x02\xB5\xB3\x03\x02\x02\x02\xB6\xB9\x03\x02\x02\x02" + - "\xB7\xB5\x03\x02\x02\x02\xB7\xB8\x03\x02\x02\x02\xB8\x17\x03\x02\x02\x02" + - "\xB9\xB7\x03\x02\x02\x02\xBA\xBB\x05$\x13\x02\xBB\xBC\x07\x16\x02\x02" + - "\xBC\xBD\x05\x0E\b\x02\xBD\xC4\x03\x02\x02\x02\xBE\xC4\x05\f\x07\x02\xBF" + - "\xC0\x05$\x13\x02\xC0\xC1\x07\x16\x02\x02\xC1\xC2\x05\f\x07\x02\xC2\xC4" + - "\x03\x02\x02\x02\xC3\xBA\x03\x02\x02\x02\xC3\xBE\x03\x02\x02\x02\xC3\xBF" + - "\x03\x02\x02\x02\xC4\x19\x03\x02\x02\x02\xC5\xC6\x07\x05\x02\x02\xC6\xCB" + - "\x05 \x11\x02\xC7\xC8\x07\x17\x02\x02\xC8\xCA\x05 \x11\x02\xC9\xC7\x03" + - "\x02\x02\x02\xCA\xCD\x03\x02\x02\x02\xCB\xC9\x03\x02\x02\x02\xCB\xCC\x03" + - "\x02\x02\x02\xCC\x1B\x03\x02\x02\x02\xCD\xCB\x03\x02\x02\x02\xCE\xCF\x07" + - "\x03\x02\x02\xCF\xD0\x05\x16\f\x02\xD0\x1D\x03\x02\x02\x02\xD1\xD2\x07" + - "\x07\x02\x02\xD2\xD5\x05\x16\f\x02\xD3\xD4\x07\x13\x02\x02\xD4\xD6\x05" + - "&\x14\x02\xD5\xD3\x03\x02\x02\x02\xD5\xD6\x03\x02\x02\x02\xD6\x1F\x03" + - "\x02\x02\x02\xD7\xD8\t\x04\x02\x02\xD8!\x03\x02\x02\x02\xD9\xDC\x05$\x13" + - "\x02\xDA\xDC\x05<\x1F\x02\xDB\xD9\x03\x02\x02\x02\xDB\xDA\x03\x02\x02" + - "\x02\xDC#\x03\x02\x02\x02\xDD\xE2\x05(\x15\x02\xDE\xDF\x07\x19\x02\x02" + - "\xDF\xE1\x05(\x15\x02\xE0\xDE\x03\x02\x02\x02\xE1\xE4\x03\x02\x02\x02" + - "\xE2\xE0\x03\x02\x02\x02\xE2\xE3\x03\x02\x02\x02\xE3%\x03\x02\x02\x02" + - "\xE4\xE2\x03\x02\x02\x02\xE5\xEA\x05$\x13\x02\xE6\xE7\x07\x17\x02\x02" + - "\xE7\xE9\x05$\x13\x02\xE8\xE6\x03\x02\x02\x02\xE9\xEC\x03\x02\x02\x02" + - "\xEA\xE8\x03\x02\x02\x02\xEA\xEB\x03\x02\x02\x02\xEB\'\x03\x02\x02\x02" + - "\xEC\xEA\x03\x02\x02\x02\xED\xEE\t\x05\x02\x02\xEE)\x03\x02\x02\x02\xEF" + - "\xF0\t\x06\x02\x02\xF0+\x03\x02\x02\x02\xF1\xF6\x07!\x02\x02\xF2\xF6\x05" + - ":\x1E\x02\xF3\xF6\x058\x1D\x02\xF4\xF6\x05<\x1F\x02\xF5\xF1\x03\x02\x02" + - "\x02\xF5\xF2\x03\x02\x02\x02\xF5\xF3\x03\x02\x02\x02\xF5\xF4\x03\x02\x02" + - "\x02\xF6-\x03\x02\x02\x02\xF7\xF8\x07\n\x02\x02\xF8\xF9\x07\x11\x02\x02" + - "\xF9/\x03\x02\x02\x02\xFA\xFB\x07\t\x02\x02\xFB\u0100\x052\x1A\x02\xFC" + - "\xFD\x07\x17\x02\x02\xFD\xFF\x052\x1A\x02\xFE\xFC\x03\x02\x02\x02\xFF" + - "\u0102\x03\x02\x02\x02\u0100\xFE\x03\x02\x02\x02\u0100\u0101\x03\x02\x02" + - "\x02\u01011\x03\x02\x02\x02\u0102\u0100\x03\x02\x02\x02\u0103\u0105\x05" + - "\f\x07\x02\u0104\u0106\t\x07\x02\x02\u0105\u0104\x03\x02\x02\x02\u0105" + - "\u0106\x03\x02\x02\x02\u0106\u0109\x03\x02\x02\x02\u0107\u0108\x07\"\x02" + - "\x02\u0108\u010A\t\b\x02\x02\u0109\u0107\x03\x02\x02\x02\u0109\u010A\x03" + - "\x02\x02\x02\u010A3\x03\x02\x02\x02\u010B\u010C\x07\v\x02\x02\u010C\u0111" + - "\x056\x1C\x02\u010D\u010E\x07\x17\x02\x02\u010E\u0110\x056\x1C\x02\u010F" + - "\u010D\x03\x02\x02\x02\u0110\u0113\x03\x02\x02\x02\u0111\u010F\x03\x02" + - "\x02\x02\u0111\u0112\x03\x02\x02\x02\u01125\x03\x02\x02\x02\u0113\u0111" + - "\x03\x02\x02\x02\u0114\u011A\x05 \x11\x02\u0115\u0116\x05 \x11\x02\u0116" + - "\u0117\x07\x16\x02\x02\u0117\u0118\x05 \x11\x02\u0118\u011A\x03\x02\x02" + - "\x02\u0119\u0114\x03\x02\x02\x02\u0119\u0115\x03\x02\x02\x02\u011A7\x03" + - "\x02\x02\x02\u011B\u011C\t\t\x02\x02\u011C9\x03\x02\x02\x02\u011D\u0120" + - "\x07\x12\x02\x02\u011E\u0120\x07\x11\x02\x02\u011F\u011D\x03\x02\x02\x02" + - "\u011F\u011E\x03\x02\x02\x02\u0120;\x03\x02\x02\x02\u0121\u0122\x07\x10" + - "\x02\x02\u0122=\x03\x02\x02\x02\u0123\u0124\t\n\x02\x02\u0124?\x03\x02" + - "\x02\x02\u0125\u0126\x07\x04\x02\x02\u0126\u0127\x05B\"\x02\u0127A\x03" + - "\x02\x02\x02\u0128\u0129\x07\x1E\x02\x02\u0129\u012A\x05\x04\x03\x02\u012A" + - "\u012B\x07\x1F\x02\x02\u012BC\x03\x02\x02\x02\x1FOU]fnpz}\x86\x8C\x94" + - "\x96\xA6\xA9\xAD\xB7\xC3\xCB\xD5\xDB\xE2\xEA\xF5\u0100\u0105\u0109\u0111" + - "\u0119\u011F"; + "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#" + + "\t#\x04$\t$\x04%\t%\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03" + + "\x03\x03\x03\x03\x03\x07\x03T\n\x03\f\x03\x0E\x03W\v\x03\x03\x04\x03\x04" + + "\x03\x04\x05\x04\\\n\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05" + + "\x05\x05d\n\x05\x03\x06\x03\x06\x03\x06\x03\x07\x03\x07\x03\x07\x03\x07" + + "\x05\x07m\n\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x07\x07" + + "u\n\x07\f\x07\x0E\x07x\v\x07\x03\b\x03\b\x05\b|\n\b\x03\t\x03\t\x03\t" + + "\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x07\n\x87\n\n\f\n\x0E\n\x8A\v\n\x05" + + "\n\x8C\n\n\x03\n\x03\n\x03\v\x03\v\x03\v\x03\v\x03\v\x05\v\x95\n\v\x03" + + "\v\x03\v\x03\v\x03\v\x03\v\x03\v\x07\v\x9D\n\v\f\v\x0E\v\xA0\v\v\x03\f" + + "\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x07\f\xAD" + + "\n\f\f\f\x0E\f\xB0\v\f\x05\f\xB2\n\f\x03\f\x03\f\x05\f\xB6\n\f\x03\r\x03" + + "\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x07\x0E\xBE\n\x0E\f\x0E\x0E\x0E\xC1\v" + + "\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x05\x0F\xC8\n\x0F\x03\x10" + + "\x03\x10\x03\x11\x03\x11\x03\x11\x03\x11\x07\x11\xD0\n\x11\f\x11\x0E\x11" + + "\xD3\v\x11\x03\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x13\x05" + + "\x13\xDC\n\x13\x03\x14\x03\x14\x03\x15\x03\x15\x05\x15\xE2\n\x15\x03\x16" + + "\x03\x16\x03\x16\x07\x16\xE7\n\x16\f\x16\x0E\x16\xEA\v\x16\x03\x17\x03" + + "\x17\x03\x17\x07\x17\xEF\n\x17\f\x17\x0E\x17\xF2\v\x17\x03\x18\x03\x18" + + "\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x05\x1A\xFC\n\x1A\x03" + + "\x1B\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x07\x1C\u0105\n\x1C" + + "\f\x1C\x0E\x1C\u0108\v\x1C\x03\x1D\x03\x1D\x05\x1D\u010C\n\x1D\x03\x1D" + + "\x03\x1D\x05\x1D\u0110\n\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x07\x1E\u0116" + + "\n\x1E\f\x1E\x0E\x1E\u0119\v\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F" + + "\x05\x1F\u0120\n\x1F\x03 \x03 \x03!\x03!\x05!\u0126\n!\x03\"\x03\"\x03" + + "#\x03#\x03$\x03$\x03$\x03%\x03%\x03%\x03%\x03%\x02\x02\x05\x04\f\x14&" + + "\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12\x02\x14" + + "\x02\x16\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02 \x02\"\x02$\x02&\x02(\x02" + + "*\x02,\x02.\x020\x022\x024\x026\x028\x02:\x02<\x02>\x02@\x02B\x02D\x02" + + "F\x02H\x02\x02\x06\x03\x02!\"\x03\x02#%\x03\x02/0\x03\x02*+\x02\u0135" + + "\x02J\x03\x02\x02\x02\x04M\x03\x02\x02\x02\x06[\x03\x02\x02\x02\bc\x03" + + "\x02\x02\x02\ne\x03\x02\x02\x02\fl\x03\x02\x02\x02\x0E{\x03\x02\x02\x02" + + "\x10}\x03\x02\x02\x02\x12\x81\x03\x02\x02\x02\x14\x94\x03\x02\x02\x02" + + "\x16\xB5\x03\x02\x02\x02\x18\xB7\x03\x02\x02\x02\x1A\xBA\x03\x02\x02\x02" + + "\x1C\xC7\x03\x02\x02\x02\x1E\xC9\x03\x02\x02\x02 \xCB\x03\x02\x02\x02" + + "\"\xD4\x03\x02\x02\x02$\xD7\x03\x02\x02\x02&\xDD\x03\x02\x02\x02(\xE1" + + "\x03\x02\x02\x02*\xE3\x03\x02\x02\x02,\xEB\x03\x02\x02\x02.\xF3\x03\x02" + + "\x02\x020\xF5\x03\x02\x02\x022\xFB\x03\x02\x02\x024\xFD\x03\x02\x02\x02" + + "6\u0100\x03\x02\x02\x028\u0109\x03\x02\x02\x02:\u0111\x03\x02\x02\x02" + + "<\u011F\x03\x02\x02\x02>\u0121\x03\x02\x02\x02@\u0125\x03\x02\x02\x02" + + "B\u0127\x03\x02\x02\x02D\u0129\x03\x02\x02\x02F\u012B\x03\x02\x02\x02" + + "H\u012E\x03\x02\x02\x02JK\x05\x04\x03\x02KL\x07\x02\x02\x03L\x03\x03\x02" + + "\x02\x02MN\b\x03\x01\x02NO\x05\x06\x04\x02OU\x03\x02\x02\x02PQ\f\x03\x02" + + "\x02QR\x07\x0F\x02\x02RT\x05\b\x05\x02SP\x03\x02\x02\x02TW\x03\x02\x02" + + "\x02US\x03\x02\x02\x02UV\x03\x02\x02\x02V\x05\x03\x02\x02\x02WU\x03\x02" + + "\x02\x02X\\\x05F$\x02Y\\\x05 \x11\x02Z\\\x05\x18\r\x02[X\x03\x02\x02\x02" + + "[Y\x03\x02\x02\x02[Z\x03\x02\x02\x02\\\x07\x03\x02\x02\x02]d\x05\"\x12" + + "\x02^d\x054\x1B\x02_d\x05:\x1E\x02`d\x056\x1C\x02ad\x05$\x13\x02bd\x05" + + "\n\x06\x02c]\x03\x02\x02\x02c^\x03\x02\x02\x02c_\x03\x02\x02\x02c`\x03" + + "\x02\x02\x02ca\x03\x02\x02\x02cb\x03\x02\x02\x02d\t\x03\x02\x02\x02ef" + + "\x07\b\x02\x02fg\x05\f\x07\x02g\v\x03\x02\x02\x02hi\b\x07\x01\x02ij\x07" + + "\x1B\x02\x02jm\x05\f\x07\x06km\x05\x0E\b\x02lh\x03\x02\x02\x02lk\x03\x02" + + "\x02\x02mv\x03\x02\x02\x02no\f\x04\x02\x02op\x07\x14\x02\x02pu\x05\f\x07" + + "\x05qr\f\x03\x02\x02rs\x07\x1D\x02\x02su\x05\f\x07\x04tn\x03\x02\x02\x02" + + "tq\x03\x02\x02\x02ux\x03\x02\x02\x02vt\x03\x02\x02\x02vw\x03\x02\x02\x02" + + "w\r\x03\x02\x02\x02xv\x03\x02\x02\x02y|\x05\x14\v\x02z|\x05\x10\t\x02" + + "{y\x03\x02\x02\x02{z\x03\x02\x02\x02|\x0F\x03\x02\x02\x02}~\x05\x14\v" + + "\x02~\x7F\x05D#\x02\x7F\x80\x05\x14\v\x02\x80\x11\x03\x02\x02\x02\x81" + + "\x82\x050\x19\x02\x82\x8B\x07\x18\x02\x02\x83\x88\x05(\x15\x02\x84\x85" + + "\x07\x16\x02\x02\x85\x87\x05(\x15\x02\x86\x84\x03\x02\x02\x02\x87\x8A" + + "\x03\x02\x02\x02\x88\x86\x03\x02\x02\x02\x88\x89\x03\x02\x02\x02\x89\x8C" + + "\x03\x02\x02\x02\x8A\x88\x03\x02\x02\x02\x8B\x83\x03\x02\x02\x02\x8B\x8C" + + "\x03\x02\x02\x02\x8C\x8D\x03\x02\x02\x02\x8D\x8E\x07\x1E\x02\x02\x8E\x13" + + "\x03\x02\x02\x02\x8F\x90\b\v\x01\x02\x90\x95\x05\x16\f\x02\x91\x95\x05" + + "\x12\n\x02\x92\x93\t\x02\x02\x02\x93\x95\x05\x14\v\x05\x94\x8F\x03\x02" + + "\x02\x02\x94\x91\x03\x02\x02\x02\x94\x92\x03\x02\x02\x02\x95\x9E\x03\x02" + + "\x02\x02\x96\x97\f\x04\x02\x02\x97\x98\t\x03\x02\x02\x98\x9D\x05\x14\v" + + "\x05\x99\x9A\f\x03\x02\x02\x9A\x9B\t\x02\x02\x02\x9B\x9D\x05\x14\v\x04" + + "\x9C\x96\x03\x02\x02\x02\x9C\x99\x03\x02\x02\x02\x9D\xA0\x03\x02\x02\x02" + + "\x9E\x9C\x03\x02\x02\x02\x9E\x9F\x03\x02\x02\x02\x9F\x15\x03\x02\x02\x02" + + "\xA0\x9E\x03\x02\x02\x02\xA1\xB6\x052\x1A\x02\xA2\xB6\x05*\x16\x02\xA3" + + "\xA4\x07\x18\x02\x02\xA4\xA5\x05\f\x07\x02\xA5\xA6\x07\x1E\x02\x02\xA6" + + "\xB6\x03\x02\x02\x02\xA7\xA8\x05.\x18\x02\xA8\xB1\x07\x18\x02\x02\xA9" + + "\xAE\x05\f\x07\x02\xAA\xAB\x07\x16\x02\x02\xAB\xAD\x05\f\x07\x02\xAC\xAA" + + "\x03\x02\x02\x02\xAD\xB0\x03\x02\x02\x02\xAE\xAC\x03\x02\x02\x02\xAE\xAF" + + "\x03\x02\x02\x02\xAF\xB2\x03\x02\x02\x02\xB0\xAE\x03\x02\x02\x02\xB1\xA9" + + "\x03\x02\x02\x02\xB1\xB2\x03\x02\x02\x02\xB2\xB3\x03\x02\x02\x02\xB3\xB4" + + "\x07\x1E\x02\x02\xB4\xB6\x03\x02\x02\x02\xB5\xA1\x03\x02\x02\x02\xB5\xA2" + + "\x03\x02\x02\x02\xB5\xA3\x03\x02\x02\x02\xB5\xA7\x03\x02\x02\x02\xB6\x17" + + "\x03\x02\x02\x02\xB7\xB8\x07\x06\x02\x02\xB8\xB9\x05\x1A\x0E\x02\xB9\x19" + + "\x03\x02\x02\x02\xBA\xBF\x05\x1C\x0F\x02\xBB\xBC\x07\x16\x02\x02\xBC\xBE" + + "\x05\x1C\x0F\x02\xBD\xBB\x03\x02\x02\x02\xBE\xC1\x03\x02\x02\x02\xBF\xBD" + + "\x03\x02\x02\x02\xBF\xC0\x03\x02\x02\x02\xC0\x1B\x03\x02\x02\x02\xC1\xBF" + + "\x03\x02\x02\x02\xC2\xC8\x05\f\x07\x02\xC3\xC4\x05\x1E\x10\x02\xC4\xC5" + + "\x07\x15\x02\x02\xC5\xC6\x05\f\x07\x02\xC6\xC8\x03\x02\x02\x02\xC7\xC2" + + "\x03\x02\x02\x02\xC7\xC3\x03\x02\x02\x02\xC8\x1D\x03\x02\x02\x02\xC9\xCA" + + "\x05.\x18\x02\xCA\x1F\x03\x02\x02\x02\xCB\xCC\x07\x05\x02\x02\xCC\xD1" + + "\x05&\x14\x02\xCD\xCE\x07\x16\x02\x02\xCE\xD0\x05&\x14\x02\xCF\xCD\x03" + + "\x02\x02\x02\xD0\xD3\x03\x02\x02\x02\xD1\xCF\x03\x02\x02\x02\xD1\xD2\x03" + + "\x02\x02\x02\xD2!\x03\x02\x02\x02\xD3\xD1\x03\x02\x02\x02\xD4\xD5\x07" + + "\x03\x02\x02\xD5\xD6\x05\x1A\x0E\x02\xD6#\x03\x02\x02\x02\xD7\xD8\x07" + + "\x07\x02\x02\xD8\xDB\x05\x1A\x0E\x02\xD9\xDA\x07\x13\x02\x02\xDA\xDC\x05" + + ",\x17\x02\xDB\xD9\x03\x02\x02\x02\xDB\xDC\x03\x02\x02\x02\xDC%\x03\x02" + + "\x02\x02\xDD\xDE\t\x04\x02\x02\xDE\'\x03\x02\x02\x02\xDF\xE2\x05*\x16" + + "\x02\xE0\xE2\x05B\"\x02\xE1\xDF\x03\x02\x02\x02\xE1\xE0\x03\x02\x02\x02" + + "\xE2)\x03\x02\x02\x02\xE3\xE8\x05.\x18\x02\xE4\xE5\x07\x17\x02\x02\xE5" + + "\xE7\x05.\x18\x02\xE6\xE4\x03\x02\x02\x02\xE7\xEA\x03\x02\x02\x02\xE8" + + "\xE6\x03\x02\x02\x02\xE8\xE9\x03\x02\x02\x02\xE9+\x03\x02\x02\x02\xEA" + + "\xE8\x03\x02\x02\x02\xEB\xF0\x05*\x16\x02\xEC\xED\x07\x16\x02\x02\xED" + + "\xEF\x05*\x16\x02\xEE\xEC\x03\x02\x02\x02\xEF\xF2\x03\x02\x02\x02\xF0" + + "\xEE\x03\x02\x02\x02\xF0\xF1\x03\x02\x02\x02\xF1-\x03\x02\x02\x02\xF2" + + "\xF0\x03\x02\x02\x02\xF3\xF4\t\x05\x02\x02\xF4/\x03\x02\x02\x02\xF5\xF6" + + "\x07)\x02\x02\xF61\x03\x02\x02\x02\xF7\xFC\x07\x1C\x02\x02\xF8\xFC\x05" + + "@!\x02\xF9\xFC\x05> \x02\xFA\xFC\x05B\"\x02\xFB\xF7\x03\x02\x02\x02\xFB" + + "\xF8\x03\x02\x02\x02\xFB\xF9\x03\x02\x02\x02\xFB\xFA\x03\x02\x02\x02\xFC" + + "3\x03\x02\x02\x02\xFD\xFE\x07\n\x02\x02\xFE\xFF\x07\x11\x02\x02\xFF5\x03" + + "\x02\x02\x02\u0100\u0101\x07\t\x02\x02\u0101\u0106\x058\x1D\x02\u0102" + + "\u0103\x07\x16\x02\x02\u0103\u0105\x058\x1D\x02\u0104\u0102\x03\x02\x02" + + "\x02\u0105\u0108\x03\x02\x02\x02\u0106\u0104\x03\x02\x02\x02\u0106\u0107" + + "\x03\x02\x02\x02\u01077\x03\x02\x02\x02\u0108\u0106\x03\x02\x02\x02\u0109" + + "\u010B\x05\f\x07\x02\u010A\u010C\x07&\x02\x02\u010B\u010A\x03\x02\x02" + + "\x02\u010B\u010C\x03\x02\x02\x02\u010C\u010F\x03\x02\x02\x02\u010D\u010E" + + "\x07\'\x02\x02\u010E\u0110\x07(\x02\x02\u010F\u010D\x03\x02\x02\x02\u010F" + + "\u0110\x03\x02\x02\x02\u01109\x03\x02\x02\x02\u0111\u0112\x07\v\x02\x02" + + "\u0112\u0117\x05<\x1F\x02\u0113\u0114\x07\x16\x02\x02\u0114\u0116\x05" + + "<\x1F\x02\u0115\u0113\x03\x02\x02\x02\u0116\u0119\x03\x02\x02\x02\u0117" + + "\u0115\x03\x02\x02\x02\u0117\u0118\x03\x02\x02\x02\u0118;\x03\x02\x02" + + "\x02\u0119\u0117\x03\x02\x02\x02\u011A\u0120\x05&\x14\x02\u011B\u011C" + + "\x05&\x14\x02\u011C\u011D\x07\x15\x02\x02\u011D\u011E\x05&\x14\x02\u011E" + + "\u0120\x03\x02\x02\x02\u011F\u011A\x03\x02\x02\x02\u011F\u011B\x03\x02" + + "\x02\x02\u0120=\x03\x02\x02\x02\u0121\u0122\x07\x1F\x02\x02\u0122?\x03" + + "\x02\x02\x02\u0123\u0126\x07\x12\x02\x02\u0124\u0126\x07\x11\x02\x02\u0125" + + "\u0123\x03\x02\x02\x02\u0125\u0124\x03\x02\x02\x02\u0126A\x03\x02\x02" + + "\x02\u0127\u0128\x07\x10\x02\x02\u0128C\x03\x02\x02\x02\u0129\u012A\x07" + + " \x02\x02\u012AE\x03\x02\x02\x02\u012B\u012C\x07\x04\x02\x02\u012C\u012D" + + "\x05H%\x02\u012DG\x03\x02\x02\x02\u012E\u012F\x07\x19\x02\x02\u012F\u0130" + + "\x05\x04\x03\x02\u0130\u0131\x07\x1A\x02\x02\u0131I\x03\x02\x02\x02\x1F" + + "U[cltv{\x88\x8B\x94\x9C\x9E\xAE\xB1\xB5\xBF\xC7\xD1\xDB\xE1\xE8\xF0\xFB" + + "\u0106\u010B\u010F\u0117\u011F\u0125"; public static __ATN: ATN; public static get _ATN(): ATN { if (!esql_parser.__ATN) { @@ -2210,62 +2178,10 @@ export class WhereCommandContext extends ParserRuleContext { export class BooleanExpressionContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return esql_parser.RULE_booleanExpression; } - public copyFrom(ctx: BooleanExpressionContext): void { - super.copyFrom(ctx); - } -} -export class LogicalNotContext extends BooleanExpressionContext { - public NOT(): TerminalNode { return this.getToken(esql_parser.NOT, 0); } - public booleanExpression(): BooleanExpressionContext { - return this.getRuleContext(0, BooleanExpressionContext); - } - constructor(ctx: BooleanExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: esql_parserListener): void { - if (listener.enterLogicalNot) { - listener.enterLogicalNot(this); - } - } - // @Override - public exitRule(listener: esql_parserListener): void { - if (listener.exitLogicalNot) { - listener.exitLogicalNot(this); - } - } -} -export class BooleanDefaultContext extends BooleanExpressionContext { - public valueExpression(): ValueExpressionContext { - return this.getRuleContext(0, ValueExpressionContext); - } - constructor(ctx: BooleanExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: esql_parserListener): void { - if (listener.enterBooleanDefault) { - listener.enterBooleanDefault(this); - } - } - // @Override - public exitRule(listener: esql_parserListener): void { - if (listener.exitBooleanDefault) { - listener.exitBooleanDefault(this); - } - } -} -export class LogicalBinaryContext extends BooleanExpressionContext { public _left: BooleanExpressionContext; public _operator: Token; public _right: BooleanExpressionContext; + public NOT(): TerminalNode | undefined { return this.tryGetToken(esql_parser.NOT, 0); } public booleanExpression(): BooleanExpressionContext[]; public booleanExpression(i: number): BooleanExpressionContext; public booleanExpression(i?: number): BooleanExpressionContext | BooleanExpressionContext[] { @@ -2275,100 +2191,59 @@ export class LogicalBinaryContext extends BooleanExpressionContext { return this.getRuleContext(i, BooleanExpressionContext); } } + public valueExpression(): ValueExpressionContext | undefined { + return this.tryGetRuleContext(0, ValueExpressionContext); + } public AND(): TerminalNode | undefined { return this.tryGetToken(esql_parser.AND, 0); } public OR(): TerminalNode | undefined { return this.tryGetToken(esql_parser.OR, 0); } - constructor(ctx: BooleanExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return esql_parser.RULE_booleanExpression; } + // @Override public enterRule(listener: esql_parserListener): void { - if (listener.enterLogicalBinary) { - listener.enterLogicalBinary(this); + if (listener.enterBooleanExpression) { + listener.enterBooleanExpression(this); } } // @Override public exitRule(listener: esql_parserListener): void { - if (listener.exitLogicalBinary) { - listener.exitLogicalBinary(this); + if (listener.exitBooleanExpression) { + listener.exitBooleanExpression(this); } } } export class ValueExpressionContext extends ParserRuleContext { + public operatorExpression(): OperatorExpressionContext | undefined { + return this.tryGetRuleContext(0, OperatorExpressionContext); + } + public comparison(): ComparisonContext | undefined { + return this.tryGetRuleContext(0, ComparisonContext); + } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return esql_parser.RULE_valueExpression; } - public copyFrom(ctx: ValueExpressionContext): void { - super.copyFrom(ctx); - } -} -export class ValueFunctionExpressionContext extends ValueExpressionContext { - public functionIdentifier(): FunctionIdentifierContext { - return this.getRuleContext(0, FunctionIdentifierContext); - } - public LP(): TerminalNode { return this.getToken(esql_parser.LP, 0); } - public RP(): TerminalNode { return this.getToken(esql_parser.RP, 0); } - public functionExpressionArgument(): FunctionExpressionArgumentContext[]; - public functionExpressionArgument(i: number): FunctionExpressionArgumentContext; - public functionExpressionArgument(i?: number): FunctionExpressionArgumentContext | FunctionExpressionArgumentContext[] { - if (i === undefined) { - return this.getRuleContexts(FunctionExpressionArgumentContext); - } else { - return this.getRuleContext(i, FunctionExpressionArgumentContext); - } - } - public COMMA(): TerminalNode[]; - public COMMA(i: number): TerminalNode; - public COMMA(i?: number): TerminalNode | TerminalNode[] { - if (i === undefined) { - return this.getTokens(esql_parser.COMMA); - } else { - return this.getToken(esql_parser.COMMA, i); - } - } - constructor(ctx: ValueExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: esql_parserListener): void { - if (listener.enterValueFunctionExpression) { - listener.enterValueFunctionExpression(this); - } - } - // @Override - public exitRule(listener: esql_parserListener): void { - if (listener.exitValueFunctionExpression) { - listener.exitValueFunctionExpression(this); - } - } -} -export class ValueExpressionDefaultContext extends ValueExpressionContext { - public operatorExpression(): OperatorExpressionContext { - return this.getRuleContext(0, OperatorExpressionContext); - } - constructor(ctx: ValueExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } // @Override public enterRule(listener: esql_parserListener): void { - if (listener.enterValueExpressionDefault) { - listener.enterValueExpressionDefault(this); + if (listener.enterValueExpression) { + listener.enterValueExpression(this); } } // @Override public exitRule(listener: esql_parserListener): void { - if (listener.exitValueExpressionDefault) { - listener.exitValueExpressionDefault(this); + if (listener.exitValueExpression) { + listener.exitValueExpression(this); } } } -export class ComparisonContext extends ValueExpressionContext { + + +export class ComparisonContext extends ParserRuleContext { public _left: OperatorExpressionContext; public _right: OperatorExpressionContext; public comparisonOperator(): ComparisonOperatorContext { @@ -2383,11 +2258,12 @@ export class ComparisonContext extends ValueExpressionContext { return this.getRuleContext(i, OperatorExpressionContext); } } - constructor(ctx: ValueExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return esql_parser.RULE_comparison; } + // @Override public enterRule(listener: esql_parserListener): void { if (listener.enterComparison) { listener.enterComparison(this); @@ -2402,65 +2278,60 @@ export class ComparisonContext extends ValueExpressionContext { } -export class OperatorExpressionContext extends ParserRuleContext { - constructor(parent: ParserRuleContext | undefined, invokingState: number) { - super(parent, invokingState); - } - // @Override - public get ruleIndex(): number { return esql_parser.RULE_operatorExpression; } - public copyFrom(ctx: OperatorExpressionContext): void { - super.copyFrom(ctx); - } -} -export class OperatorExpressionDefaultContext extends OperatorExpressionContext { - public primaryExpression(): PrimaryExpressionContext { - return this.getRuleContext(0, PrimaryExpressionContext); - } - constructor(ctx: OperatorExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); +export class MathFnContext extends ParserRuleContext { + public functionIdentifier(): FunctionIdentifierContext { + return this.getRuleContext(0, FunctionIdentifierContext); } - // @Override - public enterRule(listener: esql_parserListener): void { - if (listener.enterOperatorExpressionDefault) { - listener.enterOperatorExpressionDefault(this); + public LP(): TerminalNode { return this.getToken(esql_parser.LP, 0); } + public RP(): TerminalNode { return this.getToken(esql_parser.RP, 0); } + public functionExpressionArgument(): FunctionExpressionArgumentContext[]; + public functionExpressionArgument(i: number): FunctionExpressionArgumentContext; + public functionExpressionArgument(i?: number): FunctionExpressionArgumentContext | FunctionExpressionArgumentContext[] { + if (i === undefined) { + return this.getRuleContexts(FunctionExpressionArgumentContext); + } else { + return this.getRuleContext(i, FunctionExpressionArgumentContext); } } - // @Override - public exitRule(listener: esql_parserListener): void { - if (listener.exitOperatorExpressionDefault) { - listener.exitOperatorExpressionDefault(this); + public COMMA(): TerminalNode[]; + public COMMA(i: number): TerminalNode; + public COMMA(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(esql_parser.COMMA); + } else { + return this.getToken(esql_parser.COMMA, i); } } -} -export class ArithmeticUnaryContext extends OperatorExpressionContext { - public _operator: Token; - public operatorExpression(): OperatorExpressionContext { - return this.getRuleContext(0, OperatorExpressionContext); - } - public MINUS(): TerminalNode | undefined { return this.tryGetToken(esql_parser.MINUS, 0); } - public PLUS(): TerminalNode | undefined { return this.tryGetToken(esql_parser.PLUS, 0); } - constructor(ctx: OperatorExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return esql_parser.RULE_mathFn; } + // @Override public enterRule(listener: esql_parserListener): void { - if (listener.enterArithmeticUnary) { - listener.enterArithmeticUnary(this); + if (listener.enterMathFn) { + listener.enterMathFn(this); } } // @Override public exitRule(listener: esql_parserListener): void { - if (listener.exitArithmeticUnary) { - listener.exitArithmeticUnary(this); + if (listener.exitMathFn) { + listener.exitMathFn(this); } } } -export class ArithmeticBinaryContext extends OperatorExpressionContext { + + +export class OperatorExpressionContext extends ParserRuleContext { public _left: OperatorExpressionContext; public _operator: Token; public _right: OperatorExpressionContext; + public primaryExpression(): PrimaryExpressionContext | undefined { + return this.tryGetRuleContext(0, PrimaryExpressionContext); + } + public mathFn(): MathFnContext | undefined { + return this.tryGetRuleContext(0, MathFnContext); + } public operatorExpression(): OperatorExpressionContext[]; public operatorExpression(i: number): OperatorExpressionContext; public operatorExpression(i?: number): OperatorExpressionContext | OperatorExpressionContext[] { @@ -2470,111 +2341,39 @@ export class ArithmeticBinaryContext extends OperatorExpressionContext { return this.getRuleContext(i, OperatorExpressionContext); } } + public MINUS(): TerminalNode | undefined { return this.tryGetToken(esql_parser.MINUS, 0); } + public PLUS(): TerminalNode | undefined { return this.tryGetToken(esql_parser.PLUS, 0); } public ASTERISK(): TerminalNode | undefined { return this.tryGetToken(esql_parser.ASTERISK, 0); } public SLASH(): TerminalNode | undefined { return this.tryGetToken(esql_parser.SLASH, 0); } public PERCENT(): TerminalNode | undefined { return this.tryGetToken(esql_parser.PERCENT, 0); } - public PLUS(): TerminalNode | undefined { return this.tryGetToken(esql_parser.PLUS, 0); } - public MINUS(): TerminalNode | undefined { return this.tryGetToken(esql_parser.MINUS, 0); } - constructor(ctx: OperatorExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: esql_parserListener): void { - if (listener.enterArithmeticBinary) { - listener.enterArithmeticBinary(this); - } - } - // @Override - public exitRule(listener: esql_parserListener): void { - if (listener.exitArithmeticBinary) { - listener.exitArithmeticBinary(this); - } - } -} - - -export class PrimaryExpressionContext extends ParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return esql_parser.RULE_primaryExpression; } - public copyFrom(ctx: PrimaryExpressionContext): void { - super.copyFrom(ctx); - } -} -export class ConstantDefaultContext extends PrimaryExpressionContext { - public constant(): ConstantContext { - return this.getRuleContext(0, ConstantContext); - } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: esql_parserListener): void { - if (listener.enterConstantDefault) { - listener.enterConstantDefault(this); - } - } - // @Override - public exitRule(listener: esql_parserListener): void { - if (listener.exitConstantDefault) { - listener.exitConstantDefault(this); - } - } -} -export class DereferenceContext extends PrimaryExpressionContext { - public qualifiedName(): QualifiedNameContext { - return this.getRuleContext(0, QualifiedNameContext); - } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } + public get ruleIndex(): number { return esql_parser.RULE_operatorExpression; } // @Override public enterRule(listener: esql_parserListener): void { - if (listener.enterDereference) { - listener.enterDereference(this); + if (listener.enterOperatorExpression) { + listener.enterOperatorExpression(this); } } // @Override public exitRule(listener: esql_parserListener): void { - if (listener.exitDereference) { - listener.exitDereference(this); + if (listener.exitOperatorExpression) { + listener.exitOperatorExpression(this); } } } -export class ParenthesizedExpressionContext extends PrimaryExpressionContext { - public LP(): TerminalNode { return this.getToken(esql_parser.LP, 0); } - public booleanExpression(): BooleanExpressionContext { - return this.getRuleContext(0, BooleanExpressionContext); - } - public RP(): TerminalNode { return this.getToken(esql_parser.RP, 0); } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); - } - // @Override - public enterRule(listener: esql_parserListener): void { - if (listener.enterParenthesizedExpression) { - listener.enterParenthesizedExpression(this); - } - } - // @Override - public exitRule(listener: esql_parserListener): void { - if (listener.exitParenthesizedExpression) { - listener.exitParenthesizedExpression(this); - } + + +export class PrimaryExpressionContext extends ParserRuleContext { + public constant(): ConstantContext | undefined { + return this.tryGetRuleContext(0, ConstantContext); } -} -export class FunctionExpressionContext extends PrimaryExpressionContext { - public identifier(): IdentifierContext { - return this.getRuleContext(0, IdentifierContext); + public qualifiedName(): QualifiedNameContext | undefined { + return this.tryGetRuleContext(0, QualifiedNameContext); } - public LP(): TerminalNode { return this.getToken(esql_parser.LP, 0); } - public RP(): TerminalNode { return this.getToken(esql_parser.RP, 0); } + public LP(): TerminalNode | undefined { return this.tryGetToken(esql_parser.LP, 0); } public booleanExpression(): BooleanExpressionContext[]; public booleanExpression(i: number): BooleanExpressionContext; public booleanExpression(i?: number): BooleanExpressionContext | BooleanExpressionContext[] { @@ -2584,6 +2383,10 @@ export class FunctionExpressionContext extends PrimaryExpressionContext { return this.getRuleContext(i, BooleanExpressionContext); } } + public RP(): TerminalNode | undefined { return this.tryGetToken(esql_parser.RP, 0); } + public identifier(): IdentifierContext | undefined { + return this.tryGetRuleContext(0, IdentifierContext); + } public COMMA(): TerminalNode[]; public COMMA(i: number): TerminalNode; public COMMA(i?: number): TerminalNode | TerminalNode[] { @@ -2593,20 +2396,21 @@ export class FunctionExpressionContext extends PrimaryExpressionContext { return this.getToken(esql_parser.COMMA, i); } } - constructor(ctx: PrimaryExpressionContext) { - super(ctx.parent, ctx.invokingState); - this.copyFrom(ctx); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } // @Override + public get ruleIndex(): number { return esql_parser.RULE_primaryExpression; } + // @Override public enterRule(listener: esql_parserListener): void { - if (listener.enterFunctionExpression) { - listener.enterFunctionExpression(this); + if (listener.enterPrimaryExpression) { + listener.enterPrimaryExpression(this); } } // @Override public exitRule(listener: esql_parserListener): void { - if (listener.exitFunctionExpression) { - listener.exitFunctionExpression(this); + if (listener.exitPrimaryExpression) { + listener.exitPrimaryExpression(this); } } } @@ -2677,16 +2481,13 @@ export class FieldsContext extends ParserRuleContext { export class FieldContext extends ParserRuleContext { - public qualifiedName(): QualifiedNameContext | undefined { - return this.tryGetRuleContext(0, QualifiedNameContext); - } - public ASSIGN(): TerminalNode | undefined { return this.tryGetToken(esql_parser.ASSIGN, 0); } - public valueExpression(): ValueExpressionContext | undefined { - return this.tryGetRuleContext(0, ValueExpressionContext); + public booleanExpression(): BooleanExpressionContext { + return this.getRuleContext(0, BooleanExpressionContext); } - public booleanExpression(): BooleanExpressionContext | undefined { - return this.tryGetRuleContext(0, BooleanExpressionContext); + public userVariable(): UserVariableContext | undefined { + return this.tryGetRuleContext(0, UserVariableContext); } + public ASSIGN(): TerminalNode | undefined { return this.tryGetToken(esql_parser.ASSIGN, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } @@ -2707,6 +2508,30 @@ export class FieldContext extends ParserRuleContext { } +export class UserVariableContext extends ParserRuleContext { + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return esql_parser.RULE_userVariable; } + // @Override + public enterRule(listener: esql_parserListener): void { + if (listener.enterUserVariable) { + listener.enterUserVariable(this); + } + } + // @Override + public exitRule(listener: esql_parserListener): void { + if (listener.exitUserVariable) { + listener.exitUserVariable(this); + } + } +} + + export class FromCommandContext extends ParserRuleContext { public FROM(): TerminalNode { return this.getToken(esql_parser.FROM, 0); } public sourceIdentifier(): SourceIdentifierContext[]; @@ -2953,11 +2778,7 @@ export class IdentifierContext extends ParserRuleContext { export class FunctionIdentifierContext extends ParserRuleContext { - public ROUND_FUNCTION_MATH(): TerminalNode | undefined { return this.tryGetToken(esql_parser.ROUND_FUNCTION_MATH, 0); } - public AVG_FUNCTION_MATH(): TerminalNode | undefined { return this.tryGetToken(esql_parser.AVG_FUNCTION_MATH, 0); } - public SUM_FUNCTION_MATH(): TerminalNode | undefined { return this.tryGetToken(esql_parser.SUM_FUNCTION_MATH, 0); } - public MIN_FUNCTION_MATH(): TerminalNode | undefined { return this.tryGetToken(esql_parser.MIN_FUNCTION_MATH, 0); } - public MAX_FUNCTION_MATH(): TerminalNode | undefined { return this.tryGetToken(esql_parser.MAX_FUNCTION_MATH, 0); } + public UNARY_FUNCTION(): TerminalNode { return this.getToken(esql_parser.UNARY_FUNCTION, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } @@ -3136,16 +2957,12 @@ export class SortCommandContext extends ParserRuleContext { export class OrderExpressionContext extends ParserRuleContext { - public _ordering: Token; - public _nullOrdering: Token; public booleanExpression(): BooleanExpressionContext { return this.getRuleContext(0, BooleanExpressionContext); } - public NULLS(): TerminalNode | undefined { return this.tryGetToken(esql_parser.NULLS, 0); } - public ASC(): TerminalNode | undefined { return this.tryGetToken(esql_parser.ASC, 0); } - public DESC(): TerminalNode | undefined { return this.tryGetToken(esql_parser.DESC, 0); } - public FIRST(): TerminalNode | undefined { return this.tryGetToken(esql_parser.FIRST, 0); } - public LAST(): TerminalNode | undefined { return this.tryGetToken(esql_parser.LAST, 0); } + public ORDERING(): TerminalNode | undefined { return this.tryGetToken(esql_parser.ORDERING, 0); } + public NULLS_ORDERING(): TerminalNode | undefined { return this.tryGetToken(esql_parser.NULLS_ORDERING, 0); } + public NULLS_ORDERING_DIRECTION(): TerminalNode | undefined { return this.tryGetToken(esql_parser.NULLS_ORDERING_DIRECTION, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } @@ -3240,8 +3057,7 @@ export class ProjectClauseContext extends ParserRuleContext { export class BooleanValueContext extends ParserRuleContext { - public TRUE(): TerminalNode | undefined { return this.tryGetToken(esql_parser.TRUE, 0); } - public FALSE(): TerminalNode | undefined { return this.tryGetToken(esql_parser.FALSE, 0); } + public BOOLEAN_VALUE(): TerminalNode { return this.getToken(esql_parser.BOOLEAN_VALUE, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } @@ -3335,12 +3151,7 @@ export class StringContext extends ParserRuleContext { export class ComparisonOperatorContext extends ParserRuleContext { - public EQ(): TerminalNode | undefined { return this.tryGetToken(esql_parser.EQ, 0); } - public NEQ(): TerminalNode | undefined { return this.tryGetToken(esql_parser.NEQ, 0); } - public LT(): TerminalNode | undefined { return this.tryGetToken(esql_parser.LT, 0); } - public LTE(): TerminalNode | undefined { return this.tryGetToken(esql_parser.LTE, 0); } - public GT(): TerminalNode | undefined { return this.tryGetToken(esql_parser.GT, 0); } - public GTE(): TerminalNode | undefined { return this.tryGetToken(esql_parser.GTE, 0); } + public COMPARISON_OPERATOR(): TerminalNode { return this.getToken(esql_parser.COMPARISON_OPERATOR, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } diff --git a/packages/kbn-monaco/src/esql/antlr/esql_parser_listener.ts b/packages/kbn-monaco/src/esql/antlr/esql_parser_listener.ts index d3a3c68a1394..2b943a8bcff4 100644 --- a/packages/kbn-monaco/src/esql/antlr/esql_parser_listener.ts +++ b/packages/kbn-monaco/src/esql/antlr/esql_parser_listener.ts @@ -4,27 +4,14 @@ import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import { ValueFunctionExpressionContext } from "./esql_parser"; -import { ValueExpressionDefaultContext } from "./esql_parser"; -import { ComparisonContext } from "./esql_parser"; import { NullLiteralContext } from "./esql_parser"; import { NumericLiteralContext } from "./esql_parser"; import { BooleanLiteralContext } from "./esql_parser"; import { StringLiteralContext } from "./esql_parser"; import { DecimalLiteralContext } from "./esql_parser"; import { IntegerLiteralContext } from "./esql_parser"; -import { ConstantDefaultContext } from "./esql_parser"; -import { DereferenceContext } from "./esql_parser"; -import { ParenthesizedExpressionContext } from "./esql_parser"; -import { FunctionExpressionContext } from "./esql_parser"; import { SingleCommandQueryContext } from "./esql_parser"; import { CompositeQueryContext } from "./esql_parser"; -import { LogicalNotContext } from "./esql_parser"; -import { BooleanDefaultContext } from "./esql_parser"; -import { LogicalBinaryContext } from "./esql_parser"; -import { OperatorExpressionDefaultContext } from "./esql_parser"; -import { ArithmeticUnaryContext } from "./esql_parser"; -import { ArithmeticBinaryContext } from "./esql_parser"; import { SingleStatementContext } from "./esql_parser"; import { QueryContext } from "./esql_parser"; import { SourceCommandContext } from "./esql_parser"; @@ -32,11 +19,14 @@ import { ProcessingCommandContext } from "./esql_parser"; import { WhereCommandContext } from "./esql_parser"; import { BooleanExpressionContext } from "./esql_parser"; import { ValueExpressionContext } from "./esql_parser"; +import { ComparisonContext } from "./esql_parser"; +import { MathFnContext } from "./esql_parser"; import { OperatorExpressionContext } from "./esql_parser"; import { PrimaryExpressionContext } from "./esql_parser"; import { RowCommandContext } from "./esql_parser"; import { FieldsContext } from "./esql_parser"; import { FieldContext } from "./esql_parser"; +import { UserVariableContext } from "./esql_parser"; import { FromCommandContext } from "./esql_parser"; import { EvalCommandContext } from "./esql_parser"; import { StatsCommandContext } from "./esql_parser"; @@ -65,45 +55,6 @@ import { SubqueryExpressionContext } from "./esql_parser"; * `esql_parser`. */ export interface esql_parserListener extends ParseTreeListener { - /** - * Enter a parse tree produced by the `valueFunctionExpression` - * labeled alternative in `esql_parser.valueExpression`. - * @param ctx the parse tree - */ - enterValueFunctionExpression?: (ctx: ValueFunctionExpressionContext) => void; - /** - * Exit a parse tree produced by the `valueFunctionExpression` - * labeled alternative in `esql_parser.valueExpression`. - * @param ctx the parse tree - */ - exitValueFunctionExpression?: (ctx: ValueFunctionExpressionContext) => void; - - /** - * Enter a parse tree produced by the `valueExpressionDefault` - * labeled alternative in `esql_parser.valueExpression`. - * @param ctx the parse tree - */ - enterValueExpressionDefault?: (ctx: ValueExpressionDefaultContext) => void; - /** - * Exit a parse tree produced by the `valueExpressionDefault` - * labeled alternative in `esql_parser.valueExpression`. - * @param ctx the parse tree - */ - exitValueExpressionDefault?: (ctx: ValueExpressionDefaultContext) => void; - - /** - * Enter a parse tree produced by the `comparison` - * labeled alternative in `esql_parser.valueExpression`. - * @param ctx the parse tree - */ - enterComparison?: (ctx: ComparisonContext) => void; - /** - * Exit a parse tree produced by the `comparison` - * labeled alternative in `esql_parser.valueExpression`. - * @param ctx the parse tree - */ - exitComparison?: (ctx: ComparisonContext) => void; - /** * Enter a parse tree produced by the `nullLiteral` * labeled alternative in `esql_parser.constant`. @@ -182,58 +133,6 @@ export interface esql_parserListener extends ParseTreeListener { */ exitIntegerLiteral?: (ctx: IntegerLiteralContext) => void; - /** - * Enter a parse tree produced by the `constantDefault` - * labeled alternative in `esql_parser.primaryExpression`. - * @param ctx the parse tree - */ - enterConstantDefault?: (ctx: ConstantDefaultContext) => void; - /** - * Exit a parse tree produced by the `constantDefault` - * labeled alternative in `esql_parser.primaryExpression`. - * @param ctx the parse tree - */ - exitConstantDefault?: (ctx: ConstantDefaultContext) => void; - - /** - * Enter a parse tree produced by the `dereference` - * labeled alternative in `esql_parser.primaryExpression`. - * @param ctx the parse tree - */ - enterDereference?: (ctx: DereferenceContext) => void; - /** - * Exit a parse tree produced by the `dereference` - * labeled alternative in `esql_parser.primaryExpression`. - * @param ctx the parse tree - */ - exitDereference?: (ctx: DereferenceContext) => void; - - /** - * Enter a parse tree produced by the `parenthesizedExpression` - * labeled alternative in `esql_parser.primaryExpression`. - * @param ctx the parse tree - */ - enterParenthesizedExpression?: (ctx: ParenthesizedExpressionContext) => void; - /** - * Exit a parse tree produced by the `parenthesizedExpression` - * labeled alternative in `esql_parser.primaryExpression`. - * @param ctx the parse tree - */ - exitParenthesizedExpression?: (ctx: ParenthesizedExpressionContext) => void; - - /** - * Enter a parse tree produced by the `functionExpression` - * labeled alternative in `esql_parser.primaryExpression`. - * @param ctx the parse tree - */ - enterFunctionExpression?: (ctx: FunctionExpressionContext) => void; - /** - * Exit a parse tree produced by the `functionExpression` - * labeled alternative in `esql_parser.primaryExpression`. - * @param ctx the parse tree - */ - exitFunctionExpression?: (ctx: FunctionExpressionContext) => void; - /** * Enter a parse tree produced by the `singleCommandQuery` * labeled alternative in `esql_parser.query`. @@ -260,84 +159,6 @@ export interface esql_parserListener extends ParseTreeListener { */ exitCompositeQuery?: (ctx: CompositeQueryContext) => void; - /** - * Enter a parse tree produced by the `logicalNot` - * labeled alternative in `esql_parser.booleanExpression`. - * @param ctx the parse tree - */ - enterLogicalNot?: (ctx: LogicalNotContext) => void; - /** - * Exit a parse tree produced by the `logicalNot` - * labeled alternative in `esql_parser.booleanExpression`. - * @param ctx the parse tree - */ - exitLogicalNot?: (ctx: LogicalNotContext) => void; - - /** - * Enter a parse tree produced by the `booleanDefault` - * labeled alternative in `esql_parser.booleanExpression`. - * @param ctx the parse tree - */ - enterBooleanDefault?: (ctx: BooleanDefaultContext) => void; - /** - * Exit a parse tree produced by the `booleanDefault` - * labeled alternative in `esql_parser.booleanExpression`. - * @param ctx the parse tree - */ - exitBooleanDefault?: (ctx: BooleanDefaultContext) => void; - - /** - * Enter a parse tree produced by the `logicalBinary` - * labeled alternative in `esql_parser.booleanExpression`. - * @param ctx the parse tree - */ - enterLogicalBinary?: (ctx: LogicalBinaryContext) => void; - /** - * Exit a parse tree produced by the `logicalBinary` - * labeled alternative in `esql_parser.booleanExpression`. - * @param ctx the parse tree - */ - exitLogicalBinary?: (ctx: LogicalBinaryContext) => void; - - /** - * Enter a parse tree produced by the `operatorExpressionDefault` - * labeled alternative in `esql_parser.operatorExpression`. - * @param ctx the parse tree - */ - enterOperatorExpressionDefault?: (ctx: OperatorExpressionDefaultContext) => void; - /** - * Exit a parse tree produced by the `operatorExpressionDefault` - * labeled alternative in `esql_parser.operatorExpression`. - * @param ctx the parse tree - */ - exitOperatorExpressionDefault?: (ctx: OperatorExpressionDefaultContext) => void; - - /** - * Enter a parse tree produced by the `arithmeticUnary` - * labeled alternative in `esql_parser.operatorExpression`. - * @param ctx the parse tree - */ - enterArithmeticUnary?: (ctx: ArithmeticUnaryContext) => void; - /** - * Exit a parse tree produced by the `arithmeticUnary` - * labeled alternative in `esql_parser.operatorExpression`. - * @param ctx the parse tree - */ - exitArithmeticUnary?: (ctx: ArithmeticUnaryContext) => void; - - /** - * Enter a parse tree produced by the `arithmeticBinary` - * labeled alternative in `esql_parser.operatorExpression`. - * @param ctx the parse tree - */ - enterArithmeticBinary?: (ctx: ArithmeticBinaryContext) => void; - /** - * Exit a parse tree produced by the `arithmeticBinary` - * labeled alternative in `esql_parser.operatorExpression`. - * @param ctx the parse tree - */ - exitArithmeticBinary?: (ctx: ArithmeticBinaryContext) => void; - /** * Enter a parse tree produced by `esql_parser.singleStatement`. * @param ctx the parse tree @@ -415,6 +236,28 @@ export interface esql_parserListener extends ParseTreeListener { */ exitValueExpression?: (ctx: ValueExpressionContext) => void; + /** + * Enter a parse tree produced by `esql_parser.comparison`. + * @param ctx the parse tree + */ + enterComparison?: (ctx: ComparisonContext) => void; + /** + * Exit a parse tree produced by `esql_parser.comparison`. + * @param ctx the parse tree + */ + exitComparison?: (ctx: ComparisonContext) => void; + + /** + * Enter a parse tree produced by `esql_parser.mathFn`. + * @param ctx the parse tree + */ + enterMathFn?: (ctx: MathFnContext) => void; + /** + * Exit a parse tree produced by `esql_parser.mathFn`. + * @param ctx the parse tree + */ + exitMathFn?: (ctx: MathFnContext) => void; + /** * Enter a parse tree produced by `esql_parser.operatorExpression`. * @param ctx the parse tree @@ -470,6 +313,17 @@ export interface esql_parserListener extends ParseTreeListener { */ exitField?: (ctx: FieldContext) => void; + /** + * Enter a parse tree produced by `esql_parser.userVariable`. + * @param ctx the parse tree + */ + enterUserVariable?: (ctx: UserVariableContext) => void; + /** + * Exit a parse tree produced by `esql_parser.userVariable`. + * @param ctx the parse tree + */ + exitUserVariable?: (ctx: UserVariableContext) => void; + /** * Enter a parse tree produced by `esql_parser.fromCommand`. * @param ctx the parse tree diff --git a/packages/kbn-monaco/src/esql/index.ts b/packages/kbn-monaco/src/esql/index.ts index e34fb4917fe0..46ae9fe7f6bc 100644 --- a/packages/kbn-monaco/src/esql/index.ts +++ b/packages/kbn-monaco/src/esql/index.ts @@ -8,5 +8,5 @@ export { ESQL_LANG_ID, ESQL_THEME_ID } from './lib/constants'; export { ESQLLang } from './language'; - +export type { ESQLCustomAutocompleteCallbacks } from './lib/autocomplete/types'; export { buildESQlTheme } from './lib/monaco/esql_theme'; diff --git a/packages/kbn-monaco/src/esql/language.ts b/packages/kbn-monaco/src/esql/language.ts index 6da924ee2f0c..8ab28106460f 100644 --- a/packages/kbn-monaco/src/esql/language.ts +++ b/packages/kbn-monaco/src/esql/language.ts @@ -15,12 +15,15 @@ import type { ESQLWorker } from './worker/esql_worker'; import { DiagnosticsAdapter } from '../common/diagnostics_adapter'; import { WorkerProxyService } from '../common/worker_proxy'; +import { ESQLCompletionAdapter } from './lib/monaco/esql_completion_provider'; +import type { ESQLCustomAutocompleteCallbacks } from './lib/autocomplete/types'; + +const workerProxyService = new WorkerProxyService(); export const ESQLLang: CustomLangModuleType = { ID: ESQL_LANG_ID, async onLanguage() { const { ESQLTokensProvider } = await import('./lib/monaco'); - const workerProxyService = new WorkerProxyService(); workerProxyService.setup(ESQL_LANG_ID); @@ -28,4 +31,8 @@ export const ESQLLang: CustomLangModuleType = { new DiagnosticsAdapter(ESQL_LANG_ID, (...uris) => workerProxyService.getWorker(uris)); }, + + getSuggestionProvider(callbacks?: ESQLCustomAutocompleteCallbacks) { + return new ESQLCompletionAdapter((...uris) => workerProxyService.getWorker(uris), callbacks); + }, }; diff --git a/packages/kbn-monaco/src/esql/lib/antlr_facade.ts b/packages/kbn-monaco/src/esql/lib/antlr_facade.ts index d8c0c1f6e87e..e6bf97e44314 100644 --- a/packages/kbn-monaco/src/esql/lib/antlr_facade.ts +++ b/packages/kbn-monaco/src/esql/lib/antlr_facade.ts @@ -10,10 +10,17 @@ import { CommonTokenStream, CodePointCharStream } from 'antlr4ts'; import { esql_lexer as ESQLLexer } from '../antlr/esql_lexer'; import { esql_parser as ESQLParser } from '../antlr/esql_parser'; +import type { esql_parserListener as ESQLParserListener } from '../antlr/esql_parser_listener'; import type { ANTLREErrorListener } from '../../common/error_listener'; -export const getParser = (inputStream: CodePointCharStream, errorListener: ANTLREErrorListener) => { +export const ROOT_STATEMENT = 'singleStatement'; + +export const getParser = ( + inputStream: CodePointCharStream, + errorListener: ANTLREErrorListener, + parseListener?: ESQLParserListener +) => { const lexer = getLexer(inputStream, errorListener); const tokenStream = new CommonTokenStream(lexer); const parser = new ESQLParser(tokenStream); @@ -21,6 +28,10 @@ export const getParser = (inputStream: CodePointCharStream, errorListener: ANTLR parser.removeErrorListeners(); parser.addErrorListener(errorListener); + if (parseListener) { + parser.addParseListener(parseListener); + } + return parser; }; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/comparison_commands.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/comparison_commands.ts new file mode 100644 index 000000000000..ec8cfe8e596c --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/comparison_commands.ts @@ -0,0 +1,88 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import type { AutocompleteCommandDefinition } from '../types'; + +export const comparisonOperatorsCommandsDefinitions: AutocompleteCommandDefinition[] = [ + { + label: 'or', + insertText: 'or', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.orDoc', { + defaultMessage: 'or', + }), + sortText: 'D', + }, + { + label: 'and', + insertText: 'and', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.andDoc', { + defaultMessage: 'and', + }), + sortText: 'D', + }, +]; + +export const comparisonCommandsDefinitions: AutocompleteCommandDefinition[] = [ + { + label: '==', + insertText: '==', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.equalToDoc', { + defaultMessage: 'Equal to', + }), + sortText: 'D', + }, + { + label: '!=', + insertText: '!=', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.notEqualToDoc', { + defaultMessage: 'Not equal to', + }), + sortText: 'D', + }, + { + label: '<', + insertText: '<', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.lessThanDoc', { + defaultMessage: 'Less than', + }), + sortText: 'D', + }, + { + label: '>', + insertText: '>', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.greaterThanDoc', { + defaultMessage: 'Greater than', + }), + sortText: 'D', + }, + { + label: '<=', + insertText: '<=', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.lessThanOrEqualToDoc', { + defaultMessage: 'Less than or equal to', + }), + sortText: 'D', + }, + { + label: '>=', + insertText: '>=', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.greaterThanOrEqualToDoc', { + defaultMessage: 'Greater than or equal to', + }), + sortText: 'D', + }, +]; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/dynamic_commands.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/dynamic_commands.ts new file mode 100644 index 000000000000..aa9a9f1777ff --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/dynamic_commands.ts @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import type { AutocompleteCommandDefinition } from '../types'; + +export const buildFieldsDefinitions = (fields: string[]): AutocompleteCommandDefinition[] => + fields.map((label) => ({ + label, + insertText: label, + kind: 4, + detail: i18n.translate('monaco.esql.autocomplete.fieldDefinition', { + defaultMessage: `Field specified by the input table`, + }), + sortText: 'D', + })); + +export const buildNewVarDefinition = (label: string): AutocompleteCommandDefinition => { + return { + label, + insertText: label, + kind: 21, + detail: i18n.translate('monaco.esql.autocomplete.newVarDoc', { + defaultMessage: 'Define a new variable', + }), + sortText: 'D', + }; +}; + +export const buildSourcesDefinitions = (sources: string[]): AutocompleteCommandDefinition[] => + sources.map((label) => ({ + label, + insertText: label, + kind: 21, + detail: i18n.translate('monaco.esql.autocomplete.sourceDefinition', { + defaultMessage: `Input table`, + }), + sortText: 'A', + })); + +export const buildConstantsDefinitions = ( + userConstants: string[], + detail?: string +): AutocompleteCommandDefinition[] => + userConstants.map((label) => ({ + label, + insertText: label, + kind: 14, + detail: + detail ?? + i18n.translate('monaco.esql.autocomplete.constantDefinition', { + defaultMessage: `User defined variable`, + }), + sortText: 'A', + })); diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/functions_commands.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/functions_commands.ts new file mode 100644 index 000000000000..119a443c4019 --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/functions_commands.ts @@ -0,0 +1,87 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { buildDocumentation } from './utils'; + +import type { AutocompleteCommandDefinition } from '../types'; + +export const roundCommandDefinition: AutocompleteCommandDefinition = { + label: 'round', + insertText: 'round', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.roundDoc', { + defaultMessage: + 'Returns a number rounded to the decimal, specified by he closest integer value. The default is to round to an integer.', + }), + documentation: { + value: buildDocumentation('round(grouped[T]): aggregated[T]', [ + 'from index where field="value" | eval rounded = round(field)', + ]), + }, + sortText: 'C', +}; + +export const aggregationFunctionsDefinitions: AutocompleteCommandDefinition[] = [ + { + label: 'avg', + insertText: 'avg', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.avgDoc', { + defaultMessage: 'Returns the average of the values in a field', + }), + documentation: { + value: buildDocumentation('avg(grouped[T]): aggregated[T]', [ + 'from index | stats average = avg(field)', + ]), + }, + sortText: 'C', + }, + { + label: 'max', + insertText: 'max', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.maxDoc', { + defaultMessage: 'Returns the maximum value in a field.', + }), + documentation: { + value: buildDocumentation('max(grouped[T]): aggregated[T]', [ + 'from index | stats max = max(field)', + ]), + }, + sortText: 'C', + }, + { + label: 'min', + insertText: 'min', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.minDoc', { + defaultMessage: 'Returns the minimum value in a field.', + }), + documentation: { + value: buildDocumentation('min(grouped[T]): aggregated[T]', [ + 'from index | stats min = min(field)', + ]), + }, + sortText: 'C', + }, + { + label: 'sum', + insertText: 'sum', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.sumDoc', { + defaultMessage: 'Returns the sum of the values in a field.', + }), + documentation: { + value: buildDocumentation('sum(grouped[T]): aggregated[T]', [ + 'from index | stats sum = sum(field)', + ]), + }, + sortText: 'C', + }, +]; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/index.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/index.ts new file mode 100644 index 000000000000..ef096d678acc --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/index.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { aggregationFunctionsDefinitions, roundCommandDefinition } from './functions_commands'; +export { sourceCommandsDefinitions } from './source_commands'; +export { processingCommandsDefinitions, pipeDefinition } from './processing_commands'; + +export { + comparisonCommandsDefinitions, + comparisonOperatorsCommandsDefinitions, +} from './comparison_commands'; +export { + mathOperatorsCommandsDefinitions, + assignOperatorDefinition, + byOperatorDefinition, + openBracketDefinition, + closeBracketDefinition, +} from './operators_commands'; + +export { + orderingCommandsDefinitions, + nullsCommandsDefinition, + nullsOrderingCommandsDefinitions, +} from './ordering_commands'; + +export { + buildNewVarDefinition, + buildSourcesDefinitions, + buildFieldsDefinitions, + buildConstantsDefinitions, +} from './dynamic_commands'; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/operators_commands.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/operators_commands.ts new file mode 100644 index 000000000000..21a5f6260ced --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/operators_commands.ts @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import type { AutocompleteCommandDefinition } from '../types'; + +export const byOperatorDefinition: AutocompleteCommandDefinition = { + label: 'by', + insertText: 'by ', + kind: 21, + detail: i18n.translate('monaco.esql.autocomplete.byDoc', { + defaultMessage: 'By', + }), + sortText: 'D', +}; + +export const assignOperatorDefinition: AutocompleteCommandDefinition = { + label: '=', + insertText: '=', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.assignDoc', { + defaultMessage: 'Assign (=)', + }), + sortText: 'D', +}; + +export const openBracketDefinition: AutocompleteCommandDefinition = { + label: '(', + insertText: '(', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.openBracketDoc', { + defaultMessage: 'Open Bracket (', + }), + sortText: 'A', +}; + +export const closeBracketDefinition: AutocompleteCommandDefinition = { + label: ')', + insertText: ')', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.closeBracketDoc', { + defaultMessage: 'Close Bracket )', + }), + sortText: 'A', +}; + +export const mathOperatorsCommandsDefinitions: AutocompleteCommandDefinition[] = [ + { + label: '+', + insertText: '+', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.addDoc', { + defaultMessage: 'Add (+)', + }), + sortText: 'D', + }, + { + label: '-', + insertText: '-', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.subtractDoc', { + defaultMessage: 'Subtract (-)', + }), + sortText: 'D', + }, + { + label: '/', + insertText: '/', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.divideDoc', { + defaultMessage: 'Divide (/)', + }), + sortText: 'D', + }, + { + label: '*', + insertText: '*', + kind: 11, + detail: i18n.translate('monaco.esql.autocomplete.multiplyDoc', { + defaultMessage: 'Multiply (*)', + }), + sortText: 'D', + }, +]; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/ordering_commands.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/ordering_commands.ts new file mode 100644 index 000000000000..6e932e742a69 --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/ordering_commands.ts @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; + +import type { AutocompleteCommandDefinition } from '../types'; + +export const orderingCommandsDefinitions: AutocompleteCommandDefinition[] = [ + { + label: 'asc', + insertText: 'asc', + kind: 17, + detail: i18n.translate('monaco.esql.autocomplete.ascDoc', { + defaultMessage: 'Ascending Order', + }), + sortText: 'D', + }, + { + label: 'desc', + insertText: 'desc', + kind: 17, + detail: i18n.translate('monaco.esql.autocomplete.descDoc', { + defaultMessage: 'Descending Order', + }), + sortText: 'D', + }, +]; + +export const nullsCommandsDefinition: AutocompleteCommandDefinition = { + label: 'nulls', + insertText: 'nulls', + kind: 13, + sortText: 'D', +}; + +export const nullsOrderingCommandsDefinitions: AutocompleteCommandDefinition[] = [ + { + label: 'first', + insertText: 'first', + kind: 13, + sortText: 'D', + }, + { + label: 'last', + insertText: 'last', + kind: 13, + sortText: 'D', + }, +]; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/processing_commands.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/processing_commands.ts new file mode 100644 index 000000000000..8dbc1ebe3d9c --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/processing_commands.ts @@ -0,0 +1,99 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { buildDocumentation } from './utils'; + +import type { AutocompleteCommandDefinition } from '../types'; + +export const pipeDefinition: AutocompleteCommandDefinition = { + label: '|', + insertText: '|', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.pipeDoc', { + defaultMessage: 'Pipe (|)', + }), + sortText: 'B', +}; + +export const processingCommandsDefinitions: AutocompleteCommandDefinition[] = [ + { + label: 'stats', + insertText: 'stats', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.statsDoc', { + defaultMessage: + 'Calculates aggregate statistics, such as average, count, and sum, over the incoming search results set. Similar to SQL aggregation, if the stats command is used without a BY clause, only one row is returned, which is the aggregation over the entire incoming search results set. When you use a BY clause, one row is returned for each distinct value in the field specified in the BY clause. The stats command returns only the fields in the aggregation, and you can use a wide range of statistical functions with the stats command. When you perform more than one aggregation, separate each aggregation with a comma.', + }), + documentation: { + value: buildDocumentation( + 'stats aggs = fieldSpecification ( `,` fieldSpecification )* ( `by` groups = identifier ( `,` identifier )* )?', + ['… | stats sum(b) by b)', '… | stats avg = avg(a)'] + ), + }, + sortText: 'B', + }, + { + label: 'limit', + insertText: 'limit', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.limitDoc', { + defaultMessage: + 'Returns the first search results, in search order, based on the "limit" specified.', + }), + documentation: { + value: buildDocumentation('limit size = integerLiteral', ['… | limit 100', '… | limit 0']), + }, + sortText: 'B', + }, + { + label: 'eval', + insertText: 'eval', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.evalDoc', { + defaultMessage: + 'Calculates an expression and puts the resulting value into a search results field.', + }), + documentation: { + value: buildDocumentation('eval columns = fieldSpecification ( `,` fieldSpecification )*', [ + '… | eval a = b * c', + ]), + }, + sortText: 'B', + }, + { + label: 'sort', + insertText: 'sort', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.sortDoc', { + defaultMessage: + 'Sorts all results by the specified fields. When in descending order, the results missing a field are considered the smallest possible value of the field, or the largest possible value of the field when in ascending order.', + }), + documentation: { + value: buildDocumentation('sort orders = orderExpression ( `,` orderExpression )*', [ + '… | sort a desc, b nulls last, c asc nulls first', + '… | sort b nulls last`', + '… | sort c asc nulls first`', + ]), + }, + sortText: 'B', + }, + { + label: 'where', + insertText: 'where', + kind: 1, + detail: i18n.translate('monaco.esql.autocomplete.whereDoc', { + defaultMessage: + 'Uses "predicate-expressions" to filter search results. A predicate expression, when evaluated, returns TRUE or FALSE. The where command only returns the results that evaluate to TRUE. For example, to filter results for a specific field value', + }), + documentation: { + value: buildDocumentation('where condition = expression', ['… | where status_code == 200']), + }, + sortText: 'B', + }, +]; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/source_commands.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/source_commands.ts new file mode 100644 index 000000000000..a14f776de1bb --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/source_commands.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { buildDocumentation } from './utils'; + +import type { AutocompleteCommandDefinition } from '../types'; + +export const sourceCommandsDefinitions: AutocompleteCommandDefinition[] = [ + { + label: 'from', + insertText: 'from', + kind: 0, + detail: i18n.translate('monaco.esql.autocomplete.fromDoc', { + defaultMessage: + 'Retrieves data from one or more datasets. A dataset is a collection of data that you want to search. The only supported dataset is an index. In a query or subquery, you must use the from command first and it does not need a leading pipe. For example, to retrieve data from an index:', + }), + documentation: { + value: buildDocumentation( + 'from` indexPatterns = wildcardIdentifier (`,` wildcardIdentifier)*', + ['from logs', 'from logs-*', 'from logs_*, events-*', 'from from remote*:logs*'] + ), + }, + sortText: 'A', + }, +]; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/utils.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/utils.ts new file mode 100644 index 000000000000..87b0c6dc087a --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_definitions/utils.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; + +const declarationLabel = i18n.translate('monaco.esql.autocomplete.declarationLabel', { + defaultMessage: 'Declaration:', +}); + +const examplesLabel = i18n.translate('monaco.esql.autocomplete.examplesLabel', { + defaultMessage: 'Examples:', +}); + +/** @internal **/ +export const buildDocumentation = (declaration: string, examples?: string[]) => ` +--- +\ +***${declarationLabel}*** +\ + - \`\`${declaration}\`\` +\ +--- +${ + examples + ? `\ +***${examplesLabel}*** +\ +${examples.map( + (i) => ` + - \`\`${i}\`\` +` +)}` + : '' +}`; diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_listener.test.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_listener.test.ts new file mode 100644 index 000000000000..157d111154f1 --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_listener.test.ts @@ -0,0 +1,109 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CharStreams } from 'antlr4ts'; +import { AutocompleteListener } from './autocomplete_listener'; +import { ANTLREErrorListener } from '../../../common/error_listener'; + +import { getParser, ROOT_STATEMENT } from '../antlr_facade'; + +import { isDynamicAutocompleteItem } from './dymanic_item'; + +describe('autocomplete_listener', () => { + const getAutocompleteSuggestions = (text: string) => { + const errorListener = new ANTLREErrorListener(); + const parseListener = new AutocompleteListener(); + const parser = getParser(CharStreams.fromString(text), errorListener, parseListener); + + parser[ROOT_STATEMENT](); + + return parseListener.getAutocompleteSuggestions(); + }; + + const testSuggestions = (text: string, expected: string[]) => { + test(`${text} => [${expected.join(',')}]`, () => { + const { suggestions } = getAutocompleteSuggestions(text); + expect(suggestions.map((i) => (isDynamicAutocompleteItem(i) ? i : i.label))).toEqual( + expected + ); + }); + }; + + describe('from', () => { + testSuggestions('f', ['from']); + testSuggestions('from ', ['SourceIdentifier']); + testSuggestions('from a,', ['SourceIdentifier']); + testSuggestions('from a, b ', ['|']); + }); + + describe('where', () => { + testSuggestions('from a | where ', ['FieldIdentifier']); + testSuggestions('from a | where "field" ', ['==', '!=', '<', '>', '<=', '>=']); + testSuggestions('from a | where "field" >= ', ['FieldIdentifier']); + testSuggestions('from a | where "field" >= "field1" ', ['or', 'and', '|']); + testSuggestions('from a | where "field" >= "field1" and ', ['FieldIdentifier']); + testSuggestions('from a | where "field" >= "field1" and "field2" ', [ + '==', + '!=', + '<', + '>', + '<=', + '>=', + ]); + testSuggestions('from a | stats a=avg("field") | where a ', ['==', '!=', '<', '>', '<=', '>=']); + testSuggestions('from a | stats a=avg("b") | where "c" ', ['==', '!=', '<', '>', '<=', '>=']); + testSuggestions('from a | where "field" >= "field1" and "field2 == ', ['FieldIdentifier']); + }); + + describe('sort', () => { + testSuggestions('from a | sort ', ['FieldIdentifier']); + testSuggestions('from a | sort "field" ', ['asc', 'desc']); + testSuggestions('from a | sort "field" desc ', ['nulls']); + testSuggestions('from a | sort "field" desc nulls ', ['first', 'last']); + }); + + describe('limit', () => { + testSuggestions('from a | limit ', ['1000']); + testSuggestions('from a | limit 4 ', ['|']); + }); + + describe('stats', () => { + testSuggestions('from a | stats ', ['var0']); + testSuggestions('from a | stats a ', ['=']); + testSuggestions('from a | stats a=', ['avg', 'max', 'min', 'sum', 'FieldIdentifier']); + testSuggestions('from a | stats a=b', ['|', 'by']); + testSuggestions('from a | stats a=b by ', ['FieldIdentifier']); + testSuggestions('from a | stats a=c by d', ['|']); + testSuggestions('from a | stats a=b, ', ['var0']); + testSuggestions('from a | stats a=max', ['(']); + testSuggestions('from a | stats a=min(', ['FieldIdentifier']); + testSuggestions('from a | stats a=min(b', [')', 'FieldIdentifier']); + testSuggestions('from a | stats a=min(b) ', ['|', 'by']); + testSuggestions('from a | stats a=min(b) by ', ['FieldIdentifier']); + testSuggestions('from a | stats a=min(b),', ['var0']); + testSuggestions('from a | stats var0=min(b),var1=c,', ['var2']); + testSuggestions('from a | stats a=min(b), b=max(', ['FieldIdentifier']); + }); + + describe('eval', () => { + testSuggestions('from a | eval ', ['var0']); + testSuggestions('from a | eval a ', ['=']); + testSuggestions('from a | eval a=', ['round', 'FieldIdentifier']); + testSuggestions('from a | eval a=b', ['|', '+', '-', '/', '*']); + testSuggestions('from a | eval a=b, ', ['var0']); + testSuggestions('from a | eval a=round', ['(']); + testSuggestions('from a | eval a=round(', ['FieldIdentifier']); + testSuggestions('from a | eval a=round(b) ', ['|', '+', '-', '/', '*']); + testSuggestions('from a | eval a=round(b),', ['var0']); + testSuggestions('from a | eval a=round(b) +', ['FieldIdentifier']); + testSuggestions('from a | eval a=round(b', [')', 'FieldIdentifier']); + testSuggestions('from a | eval a=round(b), b=round(', ['FieldIdentifier']); + testSuggestions('from a | stats a=round(b), b=round(', ['FieldIdentifier']); + testSuggestions('from a | eval var0=round(b), var1=round(c) | stats ', ['var2']); + }); +}); diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_listener.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_listener.ts new file mode 100644 index 000000000000..d3cda1712434 --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/autocomplete_listener.ts @@ -0,0 +1,316 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import type { TerminalNode } from 'antlr4ts/tree/TerminalNode'; +import type { AutocompleteCommandDefinition, UserDefinedVariables } from './types'; +import { DynamicAutocompleteItem } from './dymanic_item'; + +import { esql_parserListener as ESQLParserListener } from '../../antlr/esql_parser_listener'; +import { esql_parser, esql_parser as ESQLParser } from '../../antlr/esql_parser'; + +import { + processingCommandsDefinitions, + sourceCommandsDefinitions, + orderingCommandsDefinitions, + nullsCommandsDefinition, + nullsOrderingCommandsDefinitions, + comparisonCommandsDefinitions, + comparisonOperatorsCommandsDefinitions, + byOperatorDefinition, + pipeDefinition, + openBracketDefinition, + closeBracketDefinition, + mathOperatorsCommandsDefinitions, + aggregationFunctionsDefinitions, + roundCommandDefinition, + assignOperatorDefinition, + buildConstantsDefinitions, + buildNewVarDefinition, +} from './autocomplete_definitions'; + +import { + EvalCommandContext, + StatsCommandContext, + ComparisonContext, + WhereCommandContext, + SourceCommandContext, + OrderExpressionContext, + FieldContext, + QualifiedNameContext, + ProcessingCommandContext, + SourceIdentifierContext, + UserVariableContext, + BooleanExpressionContext, + LimitCommandContext, + ValueExpressionContext, +} from '../../antlr/esql_parser'; + +export class AutocompleteListener implements ESQLParserListener { + private suggestions: Array = []; + private readonly userDefinedVariables: UserDefinedVariables = { + sourceIdentifiers: [], + }; + private readonly tables: string[][] = []; + private parentContext: number | undefined; + + private get fields() { + return this.tables.length > 1 + ? buildConstantsDefinitions(this.tables.at(-2)!) + : [DynamicAutocompleteItem.FieldIdentifier]; + } + + private get hasSuggestions() { + return Boolean(this.suggestions.length); + } + + private isTerminalNodeExists(node: TerminalNode | undefined) { + return node && node.payload?.startIndex >= 0; + } + + private getEndCommandSuggestions(skipDefinitions: AutocompleteCommandDefinition[] = []) { + const suggestions = [pipeDefinition]; + + if ( + !skipDefinitions.find((i) => i === byOperatorDefinition) && + this.parentContext === ESQLParser.STATS + ) { + suggestions.push(byOperatorDefinition); + } + return suggestions; + } + + private getNewVarName() { + const vars = this.tables.flat(); + let index = 0; + + while (true) { + const value = `var${index}`; + if (!vars.includes(value)) { + return value; + } + index++; + } + } + + getAutocompleteSuggestions() { + return { + suggestions: this.suggestions, + userDefinedVariables: this.userDefinedVariables, + }; + } + + /** ESQLParserListener fields **/ + + enterSourceCommand(ctx: SourceCommandContext) { + this.suggestions = []; + } + + exitSourceCommand(ctx: SourceCommandContext) { + if (ctx.exception) { + this.suggestions = sourceCommandsDefinitions; + } else if (!this.hasSuggestions) { + this.suggestions = this.getEndCommandSuggestions(); + } + } + + exitSourceIdentifier(ctx: SourceIdentifierContext) { + if (!ctx.childCount) { + this.suggestions = [DynamicAutocompleteItem.SourceIdentifier]; + } else if (!ctx.exception && ctx.text) { + this.userDefinedVariables.sourceIdentifiers.push(ctx.text); + } + } + + enterProcessingCommand(ctx: ProcessingCommandContext) { + this.tables.push([]); + this.suggestions = []; + this.parentContext = undefined; + } + + exitProcessingCommand(ctx: ProcessingCommandContext) { + if (ctx.exception) { + this.suggestions = processingCommandsDefinitions; + } + this.parentContext = undefined; + } + + enterStatsCommand(ctx: StatsCommandContext) { + this.suggestions = []; + this.parentContext = ESQLParser.STATS; + } + + enterEvalCommand(ctx: EvalCommandContext) { + this.suggestions = []; + this.parentContext = ESQLParser.EVAL; + } + + exitStatsCommand(ctx: StatsCommandContext) { + const qn = ctx.qualifiedNames(); + if (qn && qn.text) { + this.suggestions = this.getEndCommandSuggestions([byOperatorDefinition]); + } + } + + exitQualifiedName(ctx: QualifiedNameContext) { + if ( + ctx + .identifier() + .some( + (i) => + !( + this.isTerminalNodeExists(i.QUOTED_IDENTIFIER()) || + this.isTerminalNodeExists(i.UNQUOTED_IDENTIFIER()) + ) + ) + ) { + this.suggestions = this.fields; + } + } + + enterField(ctx: FieldContext) { + this.suggestions = []; + } + + exitField(ctx: FieldContext) { + const hasAssign = this.isTerminalNodeExists(ctx.ASSIGN()); + + if (ctx.exception) { + if (!hasAssign) { + this.suggestions = [buildNewVarDefinition(this.getNewVarName())]; + return; + } + } else { + if (!hasAssign) { + this.suggestions = [assignOperatorDefinition]; + } + } + } + + exitUserVariable(ctx: UserVariableContext) { + if (!ctx.exception && ctx.text) { + this.tables.at(-1)?.push(ctx.text); + } + } + + enterBooleanExpression(ctx: BooleanExpressionContext) { + this.suggestions = []; + } + + exitBooleanExpression(ctx: BooleanExpressionContext) { + if (ctx.exception) { + const ve = ctx.valueExpression(); + if (!ve) { + if (this.parentContext === ESQLParser.STATS) { + this.suggestions = [...aggregationFunctionsDefinitions, ...this.fields]; + return; + } + + if (this.parentContext === ESQLParser.EVAL) { + this.suggestions = [roundCommandDefinition, ...this.fields]; + return; + } + } + } + } + + exitValueExpression(ctx: ValueExpressionContext) { + const isInStats = this.parentContext === ESQLParser.STATS; + const isInEval = this.parentContext === ESQLParser.EVAL; + + if (this.parentContext && (isInStats || isInEval)) { + const hasFN = ctx.tryGetToken(esql_parser.UNARY_FUNCTION, 0); + const hasLP = ctx.tryGetToken(esql_parser.LP, 0); + const hasRP = ctx.tryGetToken(esql_parser.RP, 0); + + if (hasFN) { + if (!hasLP) { + this.suggestions = [openBracketDefinition]; + return; + } + if (!hasRP) { + if (ctx.childCount === 3) { + this.suggestions = [closeBracketDefinition, ...this.fields]; + return; + } + } + } else { + if (ctx.childCount === 1) { + this.suggestions = [ + ...this.getEndCommandSuggestions(), + ...(isInEval ? mathOperatorsCommandsDefinitions : []), + ]; + return; + } + } + this.suggestions = this.fields; + } + } + + enterWhereCommand(ctx: WhereCommandContext) { + this.suggestions = []; + this.parentContext = ESQLParser.WHERE; + } + + exitWhereCommand(ctx: WhereCommandContext) { + const booleanExpression = ctx.booleanExpression(); + + if (booleanExpression.exception) { + this.suggestions = this.fields; + return; + } else { + const innerBooleanExpressions = booleanExpression.getRuleContexts(BooleanExpressionContext); + if (innerBooleanExpressions.some((be) => be.exception)) { + this.suggestions = this.fields; + return; + } + } + if (!this.hasSuggestions) { + this.suggestions = comparisonCommandsDefinitions; + } + } + + exitComparison(ctx: ComparisonContext) { + const operatorExpression = ctx.operatorExpression(); + if (operatorExpression.some((o) => o.exception)) { + this.suggestions = this.fields; + return; + } + this.suggestions = [ + ...comparisonOperatorsCommandsDefinitions, + ...this.getEndCommandSuggestions(), + ]; + } + + exitOrderExpression(ctx: OrderExpressionContext) { + if (ctx.booleanExpression().exception) { + this.suggestions = this.fields; + return; + } + if (!this.isTerminalNodeExists(ctx.ORDERING())) { + this.suggestions = orderingCommandsDefinitions; + return; + } + if (!this.isTerminalNodeExists(ctx.NULLS_ORDERING())) { + this.suggestions = [nullsCommandsDefinition]; + return; + } + if (!this.isTerminalNodeExists(ctx.NULLS_ORDERING_DIRECTION())) { + this.suggestions = nullsOrderingCommandsDefinitions; + return; + } + } + + exitLimitCommand(ctx: LimitCommandContext) { + const DEFAULT_LIMIT_SIZE = 1000; + + if (!this.isTerminalNodeExists(ctx.INTEGER_LITERAL())) { + this.suggestions = buildConstantsDefinitions([DEFAULT_LIMIT_SIZE.toString()], ''); + } else { + this.suggestions = this.getEndCommandSuggestions(); + } + } +} diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/dymanic_item.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/dymanic_item.ts new file mode 100644 index 000000000000..b819dc34059a --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/dymanic_item.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export enum DynamicAutocompleteItem { + SourceIdentifier = 'SourceIdentifier', + FieldIdentifier = 'FieldIdentifier', +} + +export function isDynamicAutocompleteItem(v: unknown): v is DynamicAutocompleteItem { + return ( + v === DynamicAutocompleteItem.SourceIdentifier || v === DynamicAutocompleteItem.FieldIdentifier + ); +} diff --git a/packages/kbn-monaco/src/esql/lib/autocomplete/types.ts b/packages/kbn-monaco/src/esql/lib/autocomplete/types.ts new file mode 100644 index 000000000000..58438baa298a --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/autocomplete/types.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { monaco } from '../../../..'; + +/** @public **/ +export interface ESQLCustomAutocompleteCallbacks { + getSourceIdentifiers?: CallbackFn; + getFieldsIdentifiers?: CallbackFn; +} + +/** @internal **/ +type CallbackFn = (ctx: { + word: string; + userDefinedVariables: UserDefinedVariables; +}) => string[] | Promise; + +/** @internal **/ +export interface UserDefinedVariables { + sourceIdentifiers: string[]; +} + +/** @internal **/ +export type AutocompleteCommandDefinition = Pick< + monaco.languages.CompletionItem, + 'label' | 'insertText' | 'kind' | 'detail' | 'documentation' | 'sortText' +>; diff --git a/packages/kbn-monaco/src/esql/lib/monaco/esql_completion_provider.ts b/packages/kbn-monaco/src/esql/lib/monaco/esql_completion_provider.ts new file mode 100644 index 000000000000..40393fe1b844 --- /dev/null +++ b/packages/kbn-monaco/src/esql/lib/monaco/esql_completion_provider.ts @@ -0,0 +1,111 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { monaco } from '../../../monaco_imports'; +import { DynamicAutocompleteItem, isDynamicAutocompleteItem } from '../autocomplete/dymanic_item'; +import { + buildFieldsDefinitions, + buildSourcesDefinitions, +} from '../autocomplete/autocomplete_definitions/dynamic_commands'; + +import type { + AutocompleteCommandDefinition, + ESQLCustomAutocompleteCallbacks, + UserDefinedVariables, +} from '../autocomplete/types'; +import type { ESQLWorker } from '../../worker/esql_worker'; + +const emptyCompletionList: monaco.languages.CompletionList = { + incomplete: false, + suggestions: [], +}; + +export class ESQLCompletionAdapter implements monaco.languages.CompletionItemProvider { + constructor( + private worker: (...uris: monaco.Uri[]) => Promise, + private callbacks?: ESQLCustomAutocompleteCallbacks + ) {} + + public triggerCharacters = ['(', ' ', '']; + + private async injectDynamicAutocompleteItems( + suggestions: Array, + ctx: { + word: string; + userDefinedVariables: UserDefinedVariables; + } + ): Promise { + let result: AutocompleteCommandDefinition[] = []; + + for (const suggestion of suggestions) { + if (isDynamicAutocompleteItem(suggestion)) { + let dynamicItems: AutocompleteCommandDefinition[] = []; + + if (suggestion === DynamicAutocompleteItem.SourceIdentifier) { + dynamicItems = buildSourcesDefinitions( + (await this.callbacks?.getSourceIdentifiers?.(ctx)) ?? [] + ); + } + + if (suggestion === DynamicAutocompleteItem.FieldIdentifier) { + dynamicItems = buildFieldsDefinitions( + (await this.callbacks?.getFieldsIdentifiers?.(ctx)) ?? [] + ); + } + result = [...result, ...dynamicItems]; + } else { + result = [...result, suggestion]; + } + } + + return result; + } + + async provideCompletionItems( + model: monaco.editor.IReadOnlyModel, + position: monaco.Position + ): Promise { + const lines = model.getLineCount(); + + if ( + lines !== position.lineNumber || + model.getLineContent(position.lineNumber).trimEnd().length >= position.column + ) { + return emptyCompletionList; + } + + const worker = await this.worker(model.uri); + const wordInfo = model.getWordUntilPosition(position); + + const providedSuggestions = await worker.provideAutocompleteSuggestions(model.uri.toString(), { + word: wordInfo.word, + line: position.lineNumber, + index: position.column, + }); + + const withDynamicItems = providedSuggestions + ? await this.injectDynamicAutocompleteItems(providedSuggestions.suggestions, { + word: wordInfo.word, + userDefinedVariables: providedSuggestions.userDefinedVariables, + }) + : []; + + return { + incomplete: true, + suggestions: withDynamicItems.map((i) => ({ + ...i, + range: { + startLineNumber: position.lineNumber, + endLineNumber: position.lineNumber, + startColumn: wordInfo.startColumn, + endColumn: wordInfo.endColumn, + }, + })), + }; + } +} diff --git a/packages/kbn-monaco/src/esql/lib/monaco/esql_theme.ts b/packages/kbn-monaco/src/esql/lib/monaco/esql_theme.ts index 7e150ddc7487..94c3c6bbe689 100644 --- a/packages/kbn-monaco/src/esql/lib/monaco/esql_theme.ts +++ b/packages/kbn-monaco/src/esql/lib/monaco/esql_theme.ts @@ -39,6 +39,14 @@ export const buildESQlTheme = (): monaco.editor.IStandaloneThemeData => ({ 'quoted_identifier', 'src_ws', 'unquoted_identifier', + 'pipe', + 'not', + 'percent', + 'integer_literal', + 'decimal_literal', + 'src_unquoted_identifier', + 'src_quoted_identifier', + 'string', ], euiThemeVars.euiTextColor ), @@ -52,79 +60,24 @@ export const buildESQlTheme = (): monaco.editor.IStandaloneThemeData => ({ 'sort', 'by', 'where', - 'unknown_cmd', 'expr_ws', 'row', 'limit', - 'asc', - 'desc', + 'nulls_ordering_direction', + 'nulls_ordering', + 'null', + 'boolean_value', + 'comparison_operator', ], euiThemeVars.euiColorPrimaryText ), // math functions - ...buildRuleGroup( - [ - 'round_function_math', - 'avg_function_math', - 'sum_function_math', - 'min_function_math', - 'max_function_math', - ], - euiThemeVars.euiColorPrimaryText - ), - - // values - ...buildRuleGroup( - [ - 'pipe', - 'true', - 'not', - 'null', - 'nulls', - 'false', - 'src_unquoted_identifier', - 'src_quoted_identifier', - 'string', - ], - euiThemeVars.euiTextColor - ), - - // values #2 - ...buildRuleGroup( - [ - 'true', - 'not', - 'null', - 'nulls', - 'false', - 'not', - 'null', - 'percent', - 'integer_literal', - 'decimal_literal', - ], - euiThemeVars.euiTextColor - ), + ...buildRuleGroup(['unary_function'], euiThemeVars.euiColorPrimaryText), // operators ...buildRuleGroup( - [ - 'or', - 'and', - 'rp', - 'eq', - 'neq', - 'lp', - 'lt', - 'lte', - 'gt', - 'gte', - 'plus', - 'minus', - 'asterisk', - 'slash', - ], + ['or', 'and', 'rp', 'lp', 'plus', 'minus', 'asterisk', 'slash'], euiThemeVars.euiTextSubduedColor ), diff --git a/packages/kbn-monaco/src/esql/worker/esql_worker.ts b/packages/kbn-monaco/src/esql/worker/esql_worker.ts index c83d8707dac6..4d52c2b1094c 100644 --- a/packages/kbn-monaco/src/esql/worker/esql_worker.ts +++ b/packages/kbn-monaco/src/esql/worker/esql_worker.ts @@ -8,8 +8,9 @@ import { CharStreams } from 'antlr4ts'; import { monaco } from '../../monaco_imports'; +import { AutocompleteListener } from '../lib/autocomplete/autocomplete_listener'; import type { BaseWorkerDefinition } from '../../types'; -import { getParser } from '../lib/antlr_facade'; +import { getParser, ROOT_STATEMENT } from '../lib/antlr_facade'; import { ANTLREErrorListener } from '../../common/error_listener'; export class ESQLWorker implements BaseWorkerDefinition { @@ -19,23 +20,47 @@ export class ESQLWorker implements BaseWorkerDefinition { this._ctx = ctx; } - private getTextDocument(modelUri: string): string | undefined { + private getModelCharStream(modelUri: string) { const model = this._ctx.getMirrorModels().find((m) => m.uri.toString() === modelUri); + const text = model?.getValue(); - return model?.getValue(); + if (text) { + return CharStreams.fromString(text); + } } public async getSyntaxErrors(modelUri: string) { - const code = this.getTextDocument(modelUri); + const inputStream = this.getModelCharStream(modelUri); - if (code) { - const inputStream = CharStreams.fromString(code); + if (inputStream) { const errorListener = new ANTLREErrorListener(); const parser = getParser(inputStream, errorListener); - parser.singleStatement(); + parser[ROOT_STATEMENT](); return errorListener.getErrors(); } + return []; + } + + public async provideAutocompleteSuggestions( + modelUri: string, + meta: { + word: string; + line: number; + index: number; + } + ) { + const inputStream = this.getModelCharStream(modelUri); + + if (inputStream) { + const errorListener = new ANTLREErrorListener(); + const parseListener = new AutocompleteListener(); + const parser = getParser(inputStream, errorListener, parseListener); + + parser[ROOT_STATEMENT](); + + return parseListener.getAutocompleteSuggestions(); + } } } diff --git a/packages/kbn-monaco/src/types.ts b/packages/kbn-monaco/src/types.ts index 380f76fb55ad..0e5952db8344 100644 --- a/packages/kbn-monaco/src/types.ts +++ b/packages/kbn-monaco/src/types.ts @@ -7,13 +7,13 @@ */ import type { Observable } from 'rxjs'; - import { monaco } from './monaco_imports'; export interface LangModuleType { ID: string; lexerRules?: monaco.languages.IMonarchLanguage; languageConfiguration?: monaco.languages.LanguageConfiguration; + getSuggestionProvider?: Function; } export interface CompleteLangModuleType extends LangModuleType {