From cde64f2d783a6280e85662c7f7ae036d194ed5e0 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Tue, 2 Jul 2024 13:20:27 -0700 Subject: [PATCH 01/34] Antlr autocomplete (#7159) * dql grammar with rudamentary testing parser Signed-off-by: Paul Sebastian * show suggestion of fields depending on current index pattern Signed-off-by: Paul Sebastian * basic code completion with fields populated Signed-off-by: Paul Sebastian * updated grammar and generated for better group handling Signed-off-by: Paul Sebastian * add ignored tokens Signed-off-by: Paul Sebastian * remove console logs Signed-off-by: Paul Sebastian --------- Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 82 ++ .../antlr/dql/generated/DQLLexer.interp | 62 + .../antlr/dql/generated/DQLLexer.tokens | 23 + .../public/antlr/dql/generated/DQLLexer.ts | 121 ++ .../antlr/dql/generated/DQLParser.interp | 55 + .../antlr/dql/generated/DQLParser.tokens | 23 + .../public/antlr/dql/generated/DQLParser.ts | 1189 +++++++++++++++++ .../antlr/dql/generated/DQLParserListener.ts | 173 +++ .../antlr/dql/generated/DQLParserVisitor.ts | 115 ++ .../antlr/dql/grammar/.antlr/DQLLexer.interp | 62 + .../antlr/dql/grammar/.antlr/DQLLexer.java | 178 +++ .../antlr/dql/grammar/.antlr/DQLLexer.tokens | 23 + .../antlr/dql/grammar/.antlr/DQLParser.interp | 57 + .../antlr/dql/grammar/.antlr/DQLParser.java | 868 ++++++++++++ .../antlr/dql/grammar/.antlr/DQLParser.tokens | 24 + .../data/public/antlr/dql/grammar/DQLLexer.g4 | 26 + .../public/antlr/dql/grammar/DQLParser.g4 | 25 + src/plugins/data/public/plugin.ts | 6 +- .../public/ui/query_editor/query_editor.tsx | 8 +- 19 files changed, 3117 insertions(+), 3 deletions(-) create mode 100644 src/plugins/data/public/antlr/dql/code_completion.ts create mode 100644 src/plugins/data/public/antlr/dql/generated/DQLLexer.interp create mode 100644 src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens create mode 100644 src/plugins/data/public/antlr/dql/generated/DQLLexer.ts create mode 100644 src/plugins/data/public/antlr/dql/generated/DQLParser.interp create mode 100644 src/plugins/data/public/antlr/dql/generated/DQLParser.tokens create mode 100644 src/plugins/data/public/antlr/dql/generated/DQLParser.ts create mode 100644 src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts create mode 100644 src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts create mode 100644 src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp create mode 100644 src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java create mode 100644 src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens create mode 100644 src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp create mode 100644 src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java create mode 100644 src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens create mode 100644 src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 create mode 100644 src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts new file mode 100644 index 000000000000..c9ee422d9643 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -0,0 +1,82 @@ +import { CharStream, CommonTokenStream } from 'antlr4ng'; +import { DQLLexer } from './generated/DQLLexer'; +import { DQLParser, FieldContext } from './generated/DQLParser'; +import { DQLParserVisitor } from './generated/DQLParserVisitor'; +import { CodeCompletionCore } from 'antlr4-c3'; +import { findCursorTokenIndex } from '../opensearch_sql/cursor'; +import { QuerySuggestion, QuerySuggestionField } from '../../autocomplete'; + +const findFieldSuggestions = (indexPatterns) => { + const fieldNames: string[] = indexPatterns[0].fields + .filter((idxField: { readFromDocValues: boolean }) => idxField.readFromDocValues) + .map((idxField: { displayName: string }) => { + return idxField.displayName; + }); + + const fieldSuggestions: { text: string; type: string }[] = fieldNames.map((field: string) => { + return { text: field, type: 'text' }; + }); + + return fieldSuggestions; +}; + +export const getSuggestions = async ({ + selectionStart, + selectionEnd, + query, + language, + indexPatterns, +}) => { + const inputStream = CharStream.fromString(query); + const lexer = new DQLLexer(inputStream); + const tokenStream = new CommonTokenStream(lexer); + const parser = new DQLParser(tokenStream); + const tree = parser.query(); + + // find token index + const cursorIndex = + findCursorTokenIndex(tokenStream, { line: 1, column: selectionStart }, DQLParser.WS) ?? 0; + + const core = new CodeCompletionCore(parser); + + // specify preferred rules to appear in candidate collection + core.preferredRules = new Set([DQLParser.RULE_field]); + + // specify tokens to ignore + core.ignoredTokens = new Set([ + DQLParser.EOF, + DQLParser.LPAREN, + DQLParser.RPAREN, + DQLParser.DOT, + DQLParser.EQ, + DQLParser.GE, + DQLParser.GT, + DQLParser.LE, + DQLParser.LT, + DQLParser.NUMBER, + DQLParser.PHRASE, + ]); + + // gets candidates at specified token index + const candidates = core.collectCandidates(cursorIndex); + + let completions = []; + + // check to see if field rule is a candidate. if so, suggest field names + if (candidates.rules.has(DQLParser.RULE_field)) { + completions.push(...findFieldSuggestions(indexPatterns)); + } + + // suggest other candidates, mainly keywords + [...candidates.tokens.keys()].forEach((token: number) => { + // ignore identifier, already handled with field rule + if (token === DQLParser.IDENTIFIER) { + return; + } + + const tokenSymbolName = parser.vocabulary.getSymbolicName(token)?.toLowerCase(); + completions.push({ text: tokenSymbolName, type: 'function' }); + }); + + return completions; +}; diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp new file mode 100644 index 000000000000..370011ad4a31 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp @@ -0,0 +1,62 @@ +token literal names: +null +null +null +null +'>' +'<' +'>=' +'<=' +':' +'(' +')' +'.' +null +null +null +null + +token symbolic names: +null +OR +AND +NOT +GT +LT +GE +LE +EQ +LPAREN +RPAREN +DOT +PHRASE +NUMBER +IDENTIFIER +WS + +rule names: +OR +AND +NOT +GT +LT +GE +LE +EQ +LPAREN +RPAREN +DOT +PHRASE +NUMBER +IDENTIFIER +WS + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 15, 99, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 63, 8, 11, 10, 11, 12, 11, 66, 9, 11, 1, 11, 1, 11, 1, 12, 3, 12, 71, 8, 12, 1, 12, 4, 12, 74, 8, 12, 11, 12, 12, 12, 75, 1, 12, 1, 12, 4, 12, 80, 8, 12, 11, 12, 12, 12, 81, 3, 12, 84, 8, 12, 1, 13, 1, 13, 5, 13, 88, 8, 13, 10, 13, 12, 13, 91, 9, 13, 1, 14, 4, 14, 94, 8, 14, 11, 14, 12, 14, 95, 1, 14, 1, 14, 0, 0, 15, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 5, 0, 42, 42, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 105, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 1, 31, 1, 0, 0, 0, 3, 34, 1, 0, 0, 0, 5, 38, 1, 0, 0, 0, 7, 42, 1, 0, 0, 0, 9, 44, 1, 0, 0, 0, 11, 46, 1, 0, 0, 0, 13, 49, 1, 0, 0, 0, 15, 52, 1, 0, 0, 0, 17, 54, 1, 0, 0, 0, 19, 56, 1, 0, 0, 0, 21, 58, 1, 0, 0, 0, 23, 60, 1, 0, 0, 0, 25, 70, 1, 0, 0, 0, 27, 85, 1, 0, 0, 0, 29, 93, 1, 0, 0, 0, 31, 32, 7, 0, 0, 0, 32, 33, 7, 1, 0, 0, 33, 2, 1, 0, 0, 0, 34, 35, 7, 2, 0, 0, 35, 36, 7, 3, 0, 0, 36, 37, 7, 4, 0, 0, 37, 4, 1, 0, 0, 0, 38, 39, 7, 3, 0, 0, 39, 40, 7, 0, 0, 0, 40, 41, 7, 5, 0, 0, 41, 6, 1, 0, 0, 0, 42, 43, 5, 62, 0, 0, 43, 8, 1, 0, 0, 0, 44, 45, 5, 60, 0, 0, 45, 10, 1, 0, 0, 0, 46, 47, 5, 62, 0, 0, 47, 48, 5, 61, 0, 0, 48, 12, 1, 0, 0, 0, 49, 50, 5, 60, 0, 0, 50, 51, 5, 61, 0, 0, 51, 14, 1, 0, 0, 0, 52, 53, 5, 58, 0, 0, 53, 16, 1, 0, 0, 0, 54, 55, 5, 40, 0, 0, 55, 18, 1, 0, 0, 0, 56, 57, 5, 41, 0, 0, 57, 20, 1, 0, 0, 0, 58, 59, 5, 46, 0, 0, 59, 22, 1, 0, 0, 0, 60, 64, 5, 34, 0, 0, 61, 63, 8, 6, 0, 0, 62, 61, 1, 0, 0, 0, 63, 66, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 68, 5, 34, 0, 0, 68, 24, 1, 0, 0, 0, 69, 71, 5, 45, 0, 0, 70, 69, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 73, 1, 0, 0, 0, 72, 74, 7, 7, 0, 0, 73, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 83, 1, 0, 0, 0, 77, 79, 5, 46, 0, 0, 78, 80, 7, 7, 0, 0, 79, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 77, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 26, 1, 0, 0, 0, 85, 89, 7, 8, 0, 0, 86, 88, 7, 9, 0, 0, 87, 86, 1, 0, 0, 0, 88, 91, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 28, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 92, 94, 7, 10, 0, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 6, 14, 0, 0, 98, 30, 1, 0, 0, 0, 8, 0, 64, 70, 75, 81, 83, 89, 95, 1, 0, 1, 0] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens b/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens new file mode 100644 index 000000000000..3210060bf7d1 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens @@ -0,0 +1,23 @@ +OR=1 +AND=2 +NOT=3 +GT=4 +LT=5 +GE=6 +LE=7 +EQ=8 +LPAREN=9 +RPAREN=10 +DOT=11 +PHRASE=12 +NUMBER=13 +IDENTIFIER=14 +WS=15 +'>'=4 +'<'=5 +'>='=6 +'<='=7 +':'=8 +'('=9 +')'=10 +'.'=11 diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts new file mode 100644 index 000000000000..dbeb7cc58d11 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts @@ -0,0 +1,121 @@ +// Generated from grammar/DQLLexer.g4 by ANTLR 4.13.1 + +import * as antlr from "antlr4ng"; +import { Token } from "antlr4ng"; + + +export class DQLLexer extends antlr.Lexer { + public static readonly OR = 1; + public static readonly AND = 2; + public static readonly NOT = 3; + public static readonly GT = 4; + public static readonly LT = 5; + public static readonly GE = 6; + public static readonly LE = 7; + public static readonly EQ = 8; + public static readonly LPAREN = 9; + public static readonly RPAREN = 10; + public static readonly DOT = 11; + public static readonly PHRASE = 12; + public static readonly NUMBER = 13; + public static readonly IDENTIFIER = 14; + public static readonly WS = 15; + + public static readonly channelNames = [ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + ]; + + public static readonly literalNames = [ + null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", + "')'", "'.'" + ]; + + public static readonly symbolicNames = [ + null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", + "RPAREN", "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + ]; + + public static readonly modeNames = [ + "DEFAULT_MODE", + ]; + + public static readonly ruleNames = [ + "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", + "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS", + ]; + + + public constructor(input: antlr.CharStream) { + super(input); + this.interpreter = new antlr.LexerATNSimulator(this, DQLLexer._ATN, DQLLexer.decisionsToDFA, new antlr.PredictionContextCache()); + } + + public get grammarFileName(): string { return "DQLLexer.g4"; } + + public get literalNames(): (string | null)[] { return DQLLexer.literalNames; } + public get symbolicNames(): (string | null)[] { return DQLLexer.symbolicNames; } + public get ruleNames(): string[] { return DQLLexer.ruleNames; } + + public get serializedATN(): number[] { return DQLLexer._serializedATN; } + + public get channelNames(): string[] { return DQLLexer.channelNames; } + + public get modeNames(): string[] { return DQLLexer.modeNames; } + + public static readonly _serializedATN: number[] = [ + 4,0,15,99,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2, + 6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13, + 7,13,2,14,7,14,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1, + 3,1,4,1,4,1,5,1,5,1,5,1,6,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1, + 10,1,11,1,11,5,11,63,8,11,10,11,12,11,66,9,11,1,11,1,11,1,12,3,12, + 71,8,12,1,12,4,12,74,8,12,11,12,12,12,75,1,12,1,12,4,12,80,8,12, + 11,12,12,12,81,3,12,84,8,12,1,13,1,13,5,13,88,8,13,10,13,12,13,91, + 9,13,1,14,4,14,94,8,14,11,14,12,14,95,1,14,1,14,0,0,15,1,1,3,2,5, + 3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15, + 1,0,11,2,0,79,79,111,111,2,0,82,82,114,114,2,0,65,65,97,97,2,0,78, + 78,110,110,2,0,68,68,100,100,2,0,84,84,116,116,2,0,34,34,92,92,1, + 0,48,57,4,0,42,42,65,90,95,95,97,122,5,0,42,42,48,57,65,90,95,95, + 97,122,3,0,9,10,13,13,32,32,105,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0, + 0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0, + 0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0, + 0,0,27,1,0,0,0,0,29,1,0,0,0,1,31,1,0,0,0,3,34,1,0,0,0,5,38,1,0,0, + 0,7,42,1,0,0,0,9,44,1,0,0,0,11,46,1,0,0,0,13,49,1,0,0,0,15,52,1, + 0,0,0,17,54,1,0,0,0,19,56,1,0,0,0,21,58,1,0,0,0,23,60,1,0,0,0,25, + 70,1,0,0,0,27,85,1,0,0,0,29,93,1,0,0,0,31,32,7,0,0,0,32,33,7,1,0, + 0,33,2,1,0,0,0,34,35,7,2,0,0,35,36,7,3,0,0,36,37,7,4,0,0,37,4,1, + 0,0,0,38,39,7,3,0,0,39,40,7,0,0,0,40,41,7,5,0,0,41,6,1,0,0,0,42, + 43,5,62,0,0,43,8,1,0,0,0,44,45,5,60,0,0,45,10,1,0,0,0,46,47,5,62, + 0,0,47,48,5,61,0,0,48,12,1,0,0,0,49,50,5,60,0,0,50,51,5,61,0,0,51, + 14,1,0,0,0,52,53,5,58,0,0,53,16,1,0,0,0,54,55,5,40,0,0,55,18,1,0, + 0,0,56,57,5,41,0,0,57,20,1,0,0,0,58,59,5,46,0,0,59,22,1,0,0,0,60, + 64,5,34,0,0,61,63,8,6,0,0,62,61,1,0,0,0,63,66,1,0,0,0,64,62,1,0, + 0,0,64,65,1,0,0,0,65,67,1,0,0,0,66,64,1,0,0,0,67,68,5,34,0,0,68, + 24,1,0,0,0,69,71,5,45,0,0,70,69,1,0,0,0,70,71,1,0,0,0,71,73,1,0, + 0,0,72,74,7,7,0,0,73,72,1,0,0,0,74,75,1,0,0,0,75,73,1,0,0,0,75,76, + 1,0,0,0,76,83,1,0,0,0,77,79,5,46,0,0,78,80,7,7,0,0,79,78,1,0,0,0, + 80,81,1,0,0,0,81,79,1,0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,77,1, + 0,0,0,83,84,1,0,0,0,84,26,1,0,0,0,85,89,7,8,0,0,86,88,7,9,0,0,87, + 86,1,0,0,0,88,91,1,0,0,0,89,87,1,0,0,0,89,90,1,0,0,0,90,28,1,0,0, + 0,91,89,1,0,0,0,92,94,7,10,0,0,93,92,1,0,0,0,94,95,1,0,0,0,95,93, + 1,0,0,0,95,96,1,0,0,0,96,97,1,0,0,0,97,98,6,14,0,0,98,30,1,0,0,0, + 8,0,64,70,75,81,83,89,95,1,0,1,0 + ]; + + private static __ATN: antlr.ATN; + public static get _ATN(): antlr.ATN { + if (!DQLLexer.__ATN) { + DQLLexer.__ATN = new antlr.ATNDeserializer().deserialize(DQLLexer._serializedATN); + } + + return DQLLexer.__ATN; + } + + + private static readonly vocabulary = new antlr.Vocabulary(DQLLexer.literalNames, DQLLexer.symbolicNames, []); + + public override get vocabulary(): antlr.Vocabulary { + return DQLLexer.vocabulary; + } + + private static readonly decisionsToDFA = DQLLexer._ATN.decisionToState.map( (ds: antlr.DecisionState, index: number) => new antlr.DFA(ds, index) ); +} \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp new file mode 100644 index 000000000000..62c1ce8e8240 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp @@ -0,0 +1,55 @@ +token literal names: +null +null +null +null +'>' +'<' +'>=' +'<=' +':' +'(' +')' +'.' +null +null +null +null + +token symbolic names: +null +OR +AND +NOT +GT +LT +GE +LE +EQ +LPAREN +RPAREN +DOT +PHRASE +NUMBER +IDENTIFIER +WS + +rule names: +query +orExpression +andExpression +notExpression +primaryExpression +comparisonExpression +fieldExpression +termSearch +groupExpression +groupContent +field +rangeValue +value +comparisonOperator + + +atn: +[4, 1, 15, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 35, 8, 1, 10, 1, 12, 1, 38, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 43, 8, 2, 10, 2, 12, 2, 46, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 51, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 60, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 76, 8, 8, 1, 8, 5, 8, 79, 8, 8, 10, 8, 12, 8, 82, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 88, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 31, 1, 0, 0, 0, 4, 39, 1, 0, 0, 0, 6, 50, 1, 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 61, 1, 0, 0, 0, 12, 65, 1, 0, 0, 0, 14, 69, 1, 0, 0, 0, 16, 71, 1, 0, 0, 0, 18, 87, 1, 0, 0, 0, 20, 89, 1, 0, 0, 0, 22, 91, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 30, 5, 0, 0, 1, 30, 1, 1, 0, 0, 0, 31, 36, 3, 4, 2, 0, 32, 33, 5, 1, 0, 0, 33, 35, 3, 4, 2, 0, 34, 32, 1, 0, 0, 0, 35, 38, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 36, 1, 0, 0, 0, 39, 44, 3, 6, 3, 0, 40, 41, 5, 2, 0, 0, 41, 43, 3, 6, 3, 0, 42, 40, 1, 0, 0, 0, 43, 46, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 5, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 47, 48, 5, 3, 0, 0, 48, 51, 3, 6, 3, 0, 49, 51, 3, 8, 4, 0, 50, 47, 1, 0, 0, 0, 50, 49, 1, 0, 0, 0, 51, 7, 1, 0, 0, 0, 52, 53, 5, 9, 0, 0, 53, 54, 3, 0, 0, 0, 54, 55, 5, 10, 0, 0, 55, 60, 1, 0, 0, 0, 56, 60, 3, 10, 5, 0, 57, 60, 3, 12, 6, 0, 58, 60, 3, 14, 7, 0, 59, 52, 1, 0, 0, 0, 59, 56, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 58, 1, 0, 0, 0, 60, 9, 1, 0, 0, 0, 61, 62, 3, 20, 10, 0, 62, 63, 3, 26, 13, 0, 63, 64, 3, 22, 11, 0, 64, 11, 1, 0, 0, 0, 65, 66, 3, 20, 10, 0, 66, 67, 5, 8, 0, 0, 67, 68, 3, 24, 12, 0, 68, 13, 1, 0, 0, 0, 69, 70, 5, 14, 0, 0, 70, 15, 1, 0, 0, 0, 71, 72, 5, 9, 0, 0, 72, 80, 3, 18, 9, 0, 73, 75, 7, 0, 0, 0, 74, 76, 5, 3, 0, 0, 75, 74, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 79, 3, 18, 9, 0, 78, 73, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 10, 0, 0, 84, 17, 1, 0, 0, 0, 85, 88, 3, 16, 8, 0, 86, 88, 3, 14, 7, 0, 87, 85, 1, 0, 0, 0, 87, 86, 1, 0, 0, 0, 88, 19, 1, 0, 0, 0, 89, 90, 5, 14, 0, 0, 90, 21, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 23, 1, 0, 0, 0, 93, 98, 5, 12, 0, 0, 94, 98, 5, 13, 0, 0, 95, 98, 3, 14, 7, 0, 96, 98, 3, 16, 8, 0, 97, 93, 1, 0, 0, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 8, 36, 44, 50, 59, 75, 80, 87, 97] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens b/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens new file mode 100644 index 000000000000..3210060bf7d1 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens @@ -0,0 +1,23 @@ +OR=1 +AND=2 +NOT=3 +GT=4 +LT=5 +GE=6 +LE=7 +EQ=8 +LPAREN=9 +RPAREN=10 +DOT=11 +PHRASE=12 +NUMBER=13 +IDENTIFIER=14 +WS=15 +'>'=4 +'<'=5 +'>='=6 +'<='=7 +':'=8 +'('=9 +')'=10 +'.'=11 diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts new file mode 100644 index 000000000000..959e98eb79f4 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts @@ -0,0 +1,1189 @@ +// Generated from grammar/DQLParser.g4 by ANTLR 4.13.1 + +import * as antlr from "antlr4ng"; +import { Token } from "antlr4ng"; + +import { DQLParserListener } from "./DQLParserListener.js"; +import { DQLParserVisitor } from "./DQLParserVisitor.js"; + +// for running tests with parameters, TODO: discuss strategy for typed parameters in CI +// eslint-disable-next-line no-unused-vars +type int = number; + + +export class DQLParser extends antlr.Parser { + public static readonly OR = 1; + public static readonly AND = 2; + public static readonly NOT = 3; + public static readonly GT = 4; + public static readonly LT = 5; + public static readonly GE = 6; + public static readonly LE = 7; + public static readonly EQ = 8; + public static readonly LPAREN = 9; + public static readonly RPAREN = 10; + public static readonly DOT = 11; + public static readonly PHRASE = 12; + public static readonly NUMBER = 13; + public static readonly IDENTIFIER = 14; + public static readonly WS = 15; + public static readonly RULE_query = 0; + public static readonly RULE_orExpression = 1; + public static readonly RULE_andExpression = 2; + public static readonly RULE_notExpression = 3; + public static readonly RULE_primaryExpression = 4; + public static readonly RULE_comparisonExpression = 5; + public static readonly RULE_fieldExpression = 6; + public static readonly RULE_termSearch = 7; + public static readonly RULE_groupExpression = 8; + public static readonly RULE_groupContent = 9; + public static readonly RULE_field = 10; + public static readonly RULE_rangeValue = 11; + public static readonly RULE_value = 12; + public static readonly RULE_comparisonOperator = 13; + + public static readonly literalNames = [ + null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", + "')'", "'.'" + ]; + + public static readonly symbolicNames = [ + null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", + "RPAREN", "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + ]; + public static readonly ruleNames = [ + "query", "orExpression", "andExpression", "notExpression", "primaryExpression", + "comparisonExpression", "fieldExpression", "termSearch", "groupExpression", + "groupContent", "field", "rangeValue", "value", "comparisonOperator", + ]; + + public get grammarFileName(): string { return "DQLParser.g4"; } + public get literalNames(): (string | null)[] { return DQLParser.literalNames; } + public get symbolicNames(): (string | null)[] { return DQLParser.symbolicNames; } + public get ruleNames(): string[] { return DQLParser.ruleNames; } + public get serializedATN(): number[] { return DQLParser._serializedATN; } + + protected createFailedPredicateException(predicate?: string, message?: string): antlr.FailedPredicateException { + return new antlr.FailedPredicateException(this, predicate, message); + } + + public constructor(input: antlr.TokenStream) { + super(input); + this.interpreter = new antlr.ParserATNSimulator(this, DQLParser._ATN, DQLParser.decisionsToDFA, new antlr.PredictionContextCache()); + } + public query(): QueryContext { + let localContext = new QueryContext(this.context, this.state); + this.enterRule(localContext, 0, DQLParser.RULE_query); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 28; + this.orExpression(); + this.state = 29; + this.match(DQLParser.EOF); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public orExpression(): OrExpressionContext { + let localContext = new OrExpressionContext(this.context, this.state); + this.enterRule(localContext, 2, DQLParser.RULE_orExpression); + let _la: number; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 31; + this.andExpression(); + this.state = 36; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 1) { + { + { + this.state = 32; + this.match(DQLParser.OR); + this.state = 33; + this.andExpression(); + } + } + this.state = 38; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public andExpression(): AndExpressionContext { + let localContext = new AndExpressionContext(this.context, this.state); + this.enterRule(localContext, 4, DQLParser.RULE_andExpression); + let _la: number; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 39; + this.notExpression(); + this.state = 44; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 2) { + { + { + this.state = 40; + this.match(DQLParser.AND); + this.state = 41; + this.notExpression(); + } + } + this.state = 46; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public notExpression(): NotExpressionContext { + let localContext = new NotExpressionContext(this.context, this.state); + this.enterRule(localContext, 6, DQLParser.RULE_notExpression); + try { + this.state = 50; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case DQLParser.NOT: + this.enterOuterAlt(localContext, 1); + { + this.state = 47; + this.match(DQLParser.NOT); + this.state = 48; + this.notExpression(); + } + break; + case DQLParser.LPAREN: + case DQLParser.IDENTIFIER: + this.enterOuterAlt(localContext, 2); + { + this.state = 49; + this.primaryExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public primaryExpression(): PrimaryExpressionContext { + let localContext = new PrimaryExpressionContext(this.context, this.state); + this.enterRule(localContext, 8, DQLParser.RULE_primaryExpression); + try { + this.state = 59; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context) ) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 52; + this.match(DQLParser.LPAREN); + this.state = 53; + this.query(); + this.state = 54; + this.match(DQLParser.RPAREN); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 56; + this.comparisonExpression(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 57; + this.fieldExpression(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 58; + this.termSearch(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public comparisonExpression(): ComparisonExpressionContext { + let localContext = new ComparisonExpressionContext(this.context, this.state); + this.enterRule(localContext, 10, DQLParser.RULE_comparisonExpression); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 61; + this.field(); + this.state = 62; + this.comparisonOperator(); + this.state = 63; + this.rangeValue(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public fieldExpression(): FieldExpressionContext { + let localContext = new FieldExpressionContext(this.context, this.state); + this.enterRule(localContext, 12, DQLParser.RULE_fieldExpression); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 65; + this.field(); + this.state = 66; + this.match(DQLParser.EQ); + this.state = 67; + this.value(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public termSearch(): TermSearchContext { + let localContext = new TermSearchContext(this.context, this.state); + this.enterRule(localContext, 14, DQLParser.RULE_termSearch); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 69; + this.match(DQLParser.IDENTIFIER); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public groupExpression(): GroupExpressionContext { + let localContext = new GroupExpressionContext(this.context, this.state); + this.enterRule(localContext, 16, DQLParser.RULE_groupExpression); + let _la: number; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 71; + this.match(DQLParser.LPAREN); + this.state = 72; + this.groupContent(); + this.state = 80; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 1 || _la === 2) { + { + { + this.state = 73; + _la = this.tokenStream.LA(1); + if(!(_la === 1 || _la === 2)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + { + this.state = 75; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 3) { + { + this.state = 74; + this.match(DQLParser.NOT); + } + } + + } + this.state = 77; + this.groupContent(); + } + } + this.state = 82; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 83; + this.match(DQLParser.RPAREN); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public groupContent(): GroupContentContext { + let localContext = new GroupContentContext(this.context, this.state); + this.enterRule(localContext, 18, DQLParser.RULE_groupContent); + try { + this.state = 87; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case DQLParser.LPAREN: + this.enterOuterAlt(localContext, 1); + { + this.state = 85; + this.groupExpression(); + } + break; + case DQLParser.IDENTIFIER: + this.enterOuterAlt(localContext, 2); + { + this.state = 86; + this.termSearch(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public field(): FieldContext { + let localContext = new FieldContext(this.context, this.state); + this.enterRule(localContext, 20, DQLParser.RULE_field); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 89; + this.match(DQLParser.IDENTIFIER); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public rangeValue(): RangeValueContext { + let localContext = new RangeValueContext(this.context, this.state); + this.enterRule(localContext, 22, DQLParser.RULE_rangeValue); + let _la: number; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 91; + _la = this.tokenStream.LA(1); + if(!(_la === 12 || _la === 13)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public value(): ValueContext { + let localContext = new ValueContext(this.context, this.state); + this.enterRule(localContext, 24, DQLParser.RULE_value); + try { + this.state = 97; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case DQLParser.PHRASE: + this.enterOuterAlt(localContext, 1); + { + this.state = 93; + this.match(DQLParser.PHRASE); + } + break; + case DQLParser.NUMBER: + this.enterOuterAlt(localContext, 2); + { + this.state = 94; + this.match(DQLParser.NUMBER); + } + break; + case DQLParser.IDENTIFIER: + this.enterOuterAlt(localContext, 3); + { + this.state = 95; + this.termSearch(); + } + break; + case DQLParser.LPAREN: + this.enterOuterAlt(localContext, 4); + { + this.state = 96; + this.groupExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public comparisonOperator(): ComparisonOperatorContext { + let localContext = new ComparisonOperatorContext(this.context, this.state); + this.enterRule(localContext, 26, DQLParser.RULE_comparisonOperator); + let _la: number; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 99; + _la = this.tokenStream.LA(1); + if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 240) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + + public static readonly _serializedATN: number[] = [ + 4,1,15,102,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, + 1,0,1,0,1,0,1,1,1,1,1,1,5,1,35,8,1,10,1,12,1,38,9,1,1,2,1,2,1,2, + 5,2,43,8,2,10,2,12,2,46,9,2,1,3,1,3,1,3,3,3,51,8,3,1,4,1,4,1,4,1, + 4,1,4,1,4,1,4,3,4,60,8,4,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,7,1,7, + 1,8,1,8,1,8,1,8,3,8,76,8,8,1,8,5,8,79,8,8,10,8,12,8,82,9,8,1,8,1, + 8,1,9,1,9,3,9,88,8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12,1,12,3,12, + 98,8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,14,16,18,20,22,24, + 26,0,3,1,0,1,2,1,0,12,13,1,0,4,7,99,0,28,1,0,0,0,2,31,1,0,0,0,4, + 39,1,0,0,0,6,50,1,0,0,0,8,59,1,0,0,0,10,61,1,0,0,0,12,65,1,0,0,0, + 14,69,1,0,0,0,16,71,1,0,0,0,18,87,1,0,0,0,20,89,1,0,0,0,22,91,1, + 0,0,0,24,97,1,0,0,0,26,99,1,0,0,0,28,29,3,2,1,0,29,30,5,0,0,1,30, + 1,1,0,0,0,31,36,3,4,2,0,32,33,5,1,0,0,33,35,3,4,2,0,34,32,1,0,0, + 0,35,38,1,0,0,0,36,34,1,0,0,0,36,37,1,0,0,0,37,3,1,0,0,0,38,36,1, + 0,0,0,39,44,3,6,3,0,40,41,5,2,0,0,41,43,3,6,3,0,42,40,1,0,0,0,43, + 46,1,0,0,0,44,42,1,0,0,0,44,45,1,0,0,0,45,5,1,0,0,0,46,44,1,0,0, + 0,47,48,5,3,0,0,48,51,3,6,3,0,49,51,3,8,4,0,50,47,1,0,0,0,50,49, + 1,0,0,0,51,7,1,0,0,0,52,53,5,9,0,0,53,54,3,0,0,0,54,55,5,10,0,0, + 55,60,1,0,0,0,56,60,3,10,5,0,57,60,3,12,6,0,58,60,3,14,7,0,59,52, + 1,0,0,0,59,56,1,0,0,0,59,57,1,0,0,0,59,58,1,0,0,0,60,9,1,0,0,0,61, + 62,3,20,10,0,62,63,3,26,13,0,63,64,3,22,11,0,64,11,1,0,0,0,65,66, + 3,20,10,0,66,67,5,8,0,0,67,68,3,24,12,0,68,13,1,0,0,0,69,70,5,14, + 0,0,70,15,1,0,0,0,71,72,5,9,0,0,72,80,3,18,9,0,73,75,7,0,0,0,74, + 76,5,3,0,0,75,74,1,0,0,0,75,76,1,0,0,0,76,77,1,0,0,0,77,79,3,18, + 9,0,78,73,1,0,0,0,79,82,1,0,0,0,80,78,1,0,0,0,80,81,1,0,0,0,81,83, + 1,0,0,0,82,80,1,0,0,0,83,84,5,10,0,0,84,17,1,0,0,0,85,88,3,16,8, + 0,86,88,3,14,7,0,87,85,1,0,0,0,87,86,1,0,0,0,88,19,1,0,0,0,89,90, + 5,14,0,0,90,21,1,0,0,0,91,92,7,1,0,0,92,23,1,0,0,0,93,98,5,12,0, + 0,94,98,5,13,0,0,95,98,3,14,7,0,96,98,3,16,8,0,97,93,1,0,0,0,97, + 94,1,0,0,0,97,95,1,0,0,0,97,96,1,0,0,0,98,25,1,0,0,0,99,100,7,2, + 0,0,100,27,1,0,0,0,8,36,44,50,59,75,80,87,97 + ]; + + private static __ATN: antlr.ATN; + public static get _ATN(): antlr.ATN { + if (!DQLParser.__ATN) { + DQLParser.__ATN = new antlr.ATNDeserializer().deserialize(DQLParser._serializedATN); + } + + return DQLParser.__ATN; + } + + + private static readonly vocabulary = new antlr.Vocabulary(DQLParser.literalNames, DQLParser.symbolicNames, []); + + public override get vocabulary(): antlr.Vocabulary { + return DQLParser.vocabulary; + } + + private static readonly decisionsToDFA = DQLParser._ATN.decisionToState.map( (ds: antlr.DecisionState, index: number) => new antlr.DFA(ds, index) ); +} + +export class QueryContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public orExpression(): OrExpressionContext { + return this.getRuleContext(0, OrExpressionContext)!; + } + public EOF(): antlr.TerminalNode { + return this.getToken(DQLParser.EOF, 0)!; + } + public override get ruleIndex(): number { + return DQLParser.RULE_query; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterQuery) { + listener.enterQuery(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitQuery) { + listener.exitQuery(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitQuery) { + return visitor.visitQuery(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class OrExpressionContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public andExpression(): AndExpressionContext[]; + public andExpression(i: number): AndExpressionContext | null; + public andExpression(i?: number): AndExpressionContext[] | AndExpressionContext | null { + if (i === undefined) { + return this.getRuleContexts(AndExpressionContext); + } + + return this.getRuleContext(i, AndExpressionContext); + } + public OR(): antlr.TerminalNode[]; + public OR(i: number): antlr.TerminalNode | null; + public OR(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(DQLParser.OR); + } else { + return this.getToken(DQLParser.OR, i); + } + } + public override get ruleIndex(): number { + return DQLParser.RULE_orExpression; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterOrExpression) { + listener.enterOrExpression(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitOrExpression) { + listener.exitOrExpression(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitOrExpression) { + return visitor.visitOrExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class AndExpressionContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public notExpression(): NotExpressionContext[]; + public notExpression(i: number): NotExpressionContext | null; + public notExpression(i?: number): NotExpressionContext[] | NotExpressionContext | null { + if (i === undefined) { + return this.getRuleContexts(NotExpressionContext); + } + + return this.getRuleContext(i, NotExpressionContext); + } + public AND(): antlr.TerminalNode[]; + public AND(i: number): antlr.TerminalNode | null; + public AND(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(DQLParser.AND); + } else { + return this.getToken(DQLParser.AND, i); + } + } + public override get ruleIndex(): number { + return DQLParser.RULE_andExpression; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterAndExpression) { + listener.enterAndExpression(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitAndExpression) { + listener.exitAndExpression(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitAndExpression) { + return visitor.visitAndExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class NotExpressionContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public NOT(): antlr.TerminalNode | null { + return this.getToken(DQLParser.NOT, 0); + } + public notExpression(): NotExpressionContext | null { + return this.getRuleContext(0, NotExpressionContext); + } + public primaryExpression(): PrimaryExpressionContext | null { + return this.getRuleContext(0, PrimaryExpressionContext); + } + public override get ruleIndex(): number { + return DQLParser.RULE_notExpression; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterNotExpression) { + listener.enterNotExpression(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitNotExpression) { + listener.exitNotExpression(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitNotExpression) { + return visitor.visitNotExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class PrimaryExpressionContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public LPAREN(): antlr.TerminalNode | null { + return this.getToken(DQLParser.LPAREN, 0); + } + public query(): QueryContext | null { + return this.getRuleContext(0, QueryContext); + } + public RPAREN(): antlr.TerminalNode | null { + return this.getToken(DQLParser.RPAREN, 0); + } + public comparisonExpression(): ComparisonExpressionContext | null { + return this.getRuleContext(0, ComparisonExpressionContext); + } + public fieldExpression(): FieldExpressionContext | null { + return this.getRuleContext(0, FieldExpressionContext); + } + public termSearch(): TermSearchContext | null { + return this.getRuleContext(0, TermSearchContext); + } + public override get ruleIndex(): number { + return DQLParser.RULE_primaryExpression; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterPrimaryExpression) { + listener.enterPrimaryExpression(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitPrimaryExpression) { + listener.exitPrimaryExpression(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitPrimaryExpression) { + return visitor.visitPrimaryExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ComparisonExpressionContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public field(): FieldContext { + return this.getRuleContext(0, FieldContext)!; + } + public comparisonOperator(): ComparisonOperatorContext { + return this.getRuleContext(0, ComparisonOperatorContext)!; + } + public rangeValue(): RangeValueContext { + return this.getRuleContext(0, RangeValueContext)!; + } + public override get ruleIndex(): number { + return DQLParser.RULE_comparisonExpression; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterComparisonExpression) { + listener.enterComparisonExpression(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitComparisonExpression) { + listener.exitComparisonExpression(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitComparisonExpression) { + return visitor.visitComparisonExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class FieldExpressionContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public field(): FieldContext { + return this.getRuleContext(0, FieldContext)!; + } + public EQ(): antlr.TerminalNode { + return this.getToken(DQLParser.EQ, 0)!; + } + public value(): ValueContext { + return this.getRuleContext(0, ValueContext)!; + } + public override get ruleIndex(): number { + return DQLParser.RULE_fieldExpression; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterFieldExpression) { + listener.enterFieldExpression(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitFieldExpression) { + listener.exitFieldExpression(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitFieldExpression) { + return visitor.visitFieldExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class TermSearchContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public IDENTIFIER(): antlr.TerminalNode { + return this.getToken(DQLParser.IDENTIFIER, 0)!; + } + public override get ruleIndex(): number { + return DQLParser.RULE_termSearch; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterTermSearch) { + listener.enterTermSearch(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitTermSearch) { + listener.exitTermSearch(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitTermSearch) { + return visitor.visitTermSearch(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class GroupExpressionContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public LPAREN(): antlr.TerminalNode { + return this.getToken(DQLParser.LPAREN, 0)!; + } + public groupContent(): GroupContentContext[]; + public groupContent(i: number): GroupContentContext | null; + public groupContent(i?: number): GroupContentContext[] | GroupContentContext | null { + if (i === undefined) { + return this.getRuleContexts(GroupContentContext); + } + + return this.getRuleContext(i, GroupContentContext); + } + public RPAREN(): antlr.TerminalNode { + return this.getToken(DQLParser.RPAREN, 0)!; + } + public OR(): antlr.TerminalNode[]; + public OR(i: number): antlr.TerminalNode | null; + public OR(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(DQLParser.OR); + } else { + return this.getToken(DQLParser.OR, i); + } + } + public AND(): antlr.TerminalNode[]; + public AND(i: number): antlr.TerminalNode | null; + public AND(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(DQLParser.AND); + } else { + return this.getToken(DQLParser.AND, i); + } + } + public NOT(): antlr.TerminalNode[]; + public NOT(i: number): antlr.TerminalNode | null; + public NOT(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(DQLParser.NOT); + } else { + return this.getToken(DQLParser.NOT, i); + } + } + public override get ruleIndex(): number { + return DQLParser.RULE_groupExpression; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterGroupExpression) { + listener.enterGroupExpression(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitGroupExpression) { + listener.exitGroupExpression(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitGroupExpression) { + return visitor.visitGroupExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class GroupContentContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public groupExpression(): GroupExpressionContext | null { + return this.getRuleContext(0, GroupExpressionContext); + } + public termSearch(): TermSearchContext | null { + return this.getRuleContext(0, TermSearchContext); + } + public override get ruleIndex(): number { + return DQLParser.RULE_groupContent; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterGroupContent) { + listener.enterGroupContent(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitGroupContent) { + listener.exitGroupContent(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitGroupContent) { + return visitor.visitGroupContent(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class FieldContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public IDENTIFIER(): antlr.TerminalNode { + return this.getToken(DQLParser.IDENTIFIER, 0)!; + } + public override get ruleIndex(): number { + return DQLParser.RULE_field; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterField) { + listener.enterField(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitField) { + listener.exitField(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitField) { + return visitor.visitField(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class RangeValueContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public NUMBER(): antlr.TerminalNode | null { + return this.getToken(DQLParser.NUMBER, 0); + } + public PHRASE(): antlr.TerminalNode | null { + return this.getToken(DQLParser.PHRASE, 0); + } + public override get ruleIndex(): number { + return DQLParser.RULE_rangeValue; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterRangeValue) { + listener.enterRangeValue(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitRangeValue) { + listener.exitRangeValue(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitRangeValue) { + return visitor.visitRangeValue(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ValueContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public PHRASE(): antlr.TerminalNode | null { + return this.getToken(DQLParser.PHRASE, 0); + } + public NUMBER(): antlr.TerminalNode | null { + return this.getToken(DQLParser.NUMBER, 0); + } + public termSearch(): TermSearchContext | null { + return this.getRuleContext(0, TermSearchContext); + } + public groupExpression(): GroupExpressionContext | null { + return this.getRuleContext(0, GroupExpressionContext); + } + public override get ruleIndex(): number { + return DQLParser.RULE_value; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterValue) { + listener.enterValue(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitValue) { + listener.exitValue(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitValue) { + return visitor.visitValue(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ComparisonOperatorContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public GT(): antlr.TerminalNode | null { + return this.getToken(DQLParser.GT, 0); + } + public LT(): antlr.TerminalNode | null { + return this.getToken(DQLParser.LT, 0); + } + public GE(): antlr.TerminalNode | null { + return this.getToken(DQLParser.GE, 0); + } + public LE(): antlr.TerminalNode | null { + return this.getToken(DQLParser.LE, 0); + } + public override get ruleIndex(): number { + return DQLParser.RULE_comparisonOperator; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterComparisonOperator) { + listener.enterComparisonOperator(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitComparisonOperator) { + listener.exitComparisonOperator(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitComparisonOperator) { + return visitor.visitComparisonOperator(this); + } else { + return visitor.visitChildren(this); + } + } +} diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts new file mode 100644 index 000000000000..cb830937af95 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts @@ -0,0 +1,173 @@ +// Generated from grammar/DQLParser.g4 by ANTLR 4.13.1 + +import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "antlr4ng"; + + +import { QueryContext } from "./DQLParser.js"; +import { OrExpressionContext } from "./DQLParser.js"; +import { AndExpressionContext } from "./DQLParser.js"; +import { NotExpressionContext } from "./DQLParser.js"; +import { PrimaryExpressionContext } from "./DQLParser.js"; +import { ComparisonExpressionContext } from "./DQLParser.js"; +import { FieldExpressionContext } from "./DQLParser.js"; +import { TermSearchContext } from "./DQLParser.js"; +import { GroupExpressionContext } from "./DQLParser.js"; +import { GroupContentContext } from "./DQLParser.js"; +import { FieldContext } from "./DQLParser.js"; +import { RangeValueContext } from "./DQLParser.js"; +import { ValueContext } from "./DQLParser.js"; +import { ComparisonOperatorContext } from "./DQLParser.js"; + + +/** + * This interface defines a complete listener for a parse tree produced by + * `DQLParser`. + */ +export class DQLParserListener implements ParseTreeListener { + /** + * Enter a parse tree produced by `DQLParser.query`. + * @param ctx the parse tree + */ + enterQuery?: (ctx: QueryContext) => void; + /** + * Exit a parse tree produced by `DQLParser.query`. + * @param ctx the parse tree + */ + exitQuery?: (ctx: QueryContext) => void; + /** + * Enter a parse tree produced by `DQLParser.orExpression`. + * @param ctx the parse tree + */ + enterOrExpression?: (ctx: OrExpressionContext) => void; + /** + * Exit a parse tree produced by `DQLParser.orExpression`. + * @param ctx the parse tree + */ + exitOrExpression?: (ctx: OrExpressionContext) => void; + /** + * Enter a parse tree produced by `DQLParser.andExpression`. + * @param ctx the parse tree + */ + enterAndExpression?: (ctx: AndExpressionContext) => void; + /** + * Exit a parse tree produced by `DQLParser.andExpression`. + * @param ctx the parse tree + */ + exitAndExpression?: (ctx: AndExpressionContext) => void; + /** + * Enter a parse tree produced by `DQLParser.notExpression`. + * @param ctx the parse tree + */ + enterNotExpression?: (ctx: NotExpressionContext) => void; + /** + * Exit a parse tree produced by `DQLParser.notExpression`. + * @param ctx the parse tree + */ + exitNotExpression?: (ctx: NotExpressionContext) => void; + /** + * Enter a parse tree produced by `DQLParser.primaryExpression`. + * @param ctx the parse tree + */ + enterPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; + /** + * Exit a parse tree produced by `DQLParser.primaryExpression`. + * @param ctx the parse tree + */ + exitPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; + /** + * Enter a parse tree produced by `DQLParser.comparisonExpression`. + * @param ctx the parse tree + */ + enterComparisonExpression?: (ctx: ComparisonExpressionContext) => void; + /** + * Exit a parse tree produced by `DQLParser.comparisonExpression`. + * @param ctx the parse tree + */ + exitComparisonExpression?: (ctx: ComparisonExpressionContext) => void; + /** + * Enter a parse tree produced by `DQLParser.fieldExpression`. + * @param ctx the parse tree + */ + enterFieldExpression?: (ctx: FieldExpressionContext) => void; + /** + * Exit a parse tree produced by `DQLParser.fieldExpression`. + * @param ctx the parse tree + */ + exitFieldExpression?: (ctx: FieldExpressionContext) => void; + /** + * Enter a parse tree produced by `DQLParser.termSearch`. + * @param ctx the parse tree + */ + enterTermSearch?: (ctx: TermSearchContext) => void; + /** + * Exit a parse tree produced by `DQLParser.termSearch`. + * @param ctx the parse tree + */ + exitTermSearch?: (ctx: TermSearchContext) => void; + /** + * Enter a parse tree produced by `DQLParser.groupExpression`. + * @param ctx the parse tree + */ + enterGroupExpression?: (ctx: GroupExpressionContext) => void; + /** + * Exit a parse tree produced by `DQLParser.groupExpression`. + * @param ctx the parse tree + */ + exitGroupExpression?: (ctx: GroupExpressionContext) => void; + /** + * Enter a parse tree produced by `DQLParser.groupContent`. + * @param ctx the parse tree + */ + enterGroupContent?: (ctx: GroupContentContext) => void; + /** + * Exit a parse tree produced by `DQLParser.groupContent`. + * @param ctx the parse tree + */ + exitGroupContent?: (ctx: GroupContentContext) => void; + /** + * Enter a parse tree produced by `DQLParser.field`. + * @param ctx the parse tree + */ + enterField?: (ctx: FieldContext) => void; + /** + * Exit a parse tree produced by `DQLParser.field`. + * @param ctx the parse tree + */ + exitField?: (ctx: FieldContext) => void; + /** + * Enter a parse tree produced by `DQLParser.rangeValue`. + * @param ctx the parse tree + */ + enterRangeValue?: (ctx: RangeValueContext) => void; + /** + * Exit a parse tree produced by `DQLParser.rangeValue`. + * @param ctx the parse tree + */ + exitRangeValue?: (ctx: RangeValueContext) => void; + /** + * Enter a parse tree produced by `DQLParser.value`. + * @param ctx the parse tree + */ + enterValue?: (ctx: ValueContext) => void; + /** + * Exit a parse tree produced by `DQLParser.value`. + * @param ctx the parse tree + */ + exitValue?: (ctx: ValueContext) => void; + /** + * Enter a parse tree produced by `DQLParser.comparisonOperator`. + * @param ctx the parse tree + */ + enterComparisonOperator?: (ctx: ComparisonOperatorContext) => void; + /** + * Exit a parse tree produced by `DQLParser.comparisonOperator`. + * @param ctx the parse tree + */ + exitComparisonOperator?: (ctx: ComparisonOperatorContext) => void; + + visitTerminal(node: TerminalNode): void {} + visitErrorNode(node: ErrorNode): void {} + enterEveryRule(node: ParserRuleContext): void {} + exitEveryRule(node: ParserRuleContext): void {} +} + diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts new file mode 100644 index 000000000000..759e316f84da --- /dev/null +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts @@ -0,0 +1,115 @@ +// Generated from grammar/DQLParser.g4 by ANTLR 4.13.1 + +import { AbstractParseTreeVisitor } from "antlr4ng"; + + +import { QueryContext } from "./DQLParser.js"; +import { OrExpressionContext } from "./DQLParser.js"; +import { AndExpressionContext } from "./DQLParser.js"; +import { NotExpressionContext } from "./DQLParser.js"; +import { PrimaryExpressionContext } from "./DQLParser.js"; +import { ComparisonExpressionContext } from "./DQLParser.js"; +import { FieldExpressionContext } from "./DQLParser.js"; +import { TermSearchContext } from "./DQLParser.js"; +import { GroupExpressionContext } from "./DQLParser.js"; +import { GroupContentContext } from "./DQLParser.js"; +import { FieldContext } from "./DQLParser.js"; +import { RangeValueContext } from "./DQLParser.js"; +import { ValueContext } from "./DQLParser.js"; +import { ComparisonOperatorContext } from "./DQLParser.js"; + + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by `DQLParser`. + * + * @param The return type of the visit operation. Use `void` for + * operations with no return type. + */ +export class DQLParserVisitor extends AbstractParseTreeVisitor { + /** + * Visit a parse tree produced by `DQLParser.query`. + * @param ctx the parse tree + * @return the visitor result + */ + visitQuery?: (ctx: QueryContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.orExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitOrExpression?: (ctx: OrExpressionContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.andExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAndExpression?: (ctx: AndExpressionContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.notExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitNotExpression?: (ctx: NotExpressionContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.primaryExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPrimaryExpression?: (ctx: PrimaryExpressionContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.comparisonExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitComparisonExpression?: (ctx: ComparisonExpressionContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.fieldExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFieldExpression?: (ctx: FieldExpressionContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.termSearch`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTermSearch?: (ctx: TermSearchContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.groupExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitGroupExpression?: (ctx: GroupExpressionContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.groupContent`. + * @param ctx the parse tree + * @return the visitor result + */ + visitGroupContent?: (ctx: GroupContentContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.field`. + * @param ctx the parse tree + * @return the visitor result + */ + visitField?: (ctx: FieldContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.rangeValue`. + * @param ctx the parse tree + * @return the visitor result + */ + visitRangeValue?: (ctx: RangeValueContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.value`. + * @param ctx the parse tree + * @return the visitor result + */ + visitValue?: (ctx: ValueContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.comparisonOperator`. + * @param ctx the parse tree + * @return the visitor result + */ + visitComparisonOperator?: (ctx: ComparisonOperatorContext) => Result; +} + diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp new file mode 100644 index 000000000000..370011ad4a31 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp @@ -0,0 +1,62 @@ +token literal names: +null +null +null +null +'>' +'<' +'>=' +'<=' +':' +'(' +')' +'.' +null +null +null +null + +token symbolic names: +null +OR +AND +NOT +GT +LT +GE +LE +EQ +LPAREN +RPAREN +DOT +PHRASE +NUMBER +IDENTIFIER +WS + +rule names: +OR +AND +NOT +GT +LT +GE +LE +EQ +LPAREN +RPAREN +DOT +PHRASE +NUMBER +IDENTIFIER +WS + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 15, 99, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 63, 8, 11, 10, 11, 12, 11, 66, 9, 11, 1, 11, 1, 11, 1, 12, 3, 12, 71, 8, 12, 1, 12, 4, 12, 74, 8, 12, 11, 12, 12, 12, 75, 1, 12, 1, 12, 4, 12, 80, 8, 12, 11, 12, 12, 12, 81, 3, 12, 84, 8, 12, 1, 13, 1, 13, 5, 13, 88, 8, 13, 10, 13, 12, 13, 91, 9, 13, 1, 14, 4, 14, 94, 8, 14, 11, 14, 12, 14, 95, 1, 14, 1, 14, 0, 0, 15, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 5, 0, 42, 42, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 105, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 1, 31, 1, 0, 0, 0, 3, 34, 1, 0, 0, 0, 5, 38, 1, 0, 0, 0, 7, 42, 1, 0, 0, 0, 9, 44, 1, 0, 0, 0, 11, 46, 1, 0, 0, 0, 13, 49, 1, 0, 0, 0, 15, 52, 1, 0, 0, 0, 17, 54, 1, 0, 0, 0, 19, 56, 1, 0, 0, 0, 21, 58, 1, 0, 0, 0, 23, 60, 1, 0, 0, 0, 25, 70, 1, 0, 0, 0, 27, 85, 1, 0, 0, 0, 29, 93, 1, 0, 0, 0, 31, 32, 7, 0, 0, 0, 32, 33, 7, 1, 0, 0, 33, 2, 1, 0, 0, 0, 34, 35, 7, 2, 0, 0, 35, 36, 7, 3, 0, 0, 36, 37, 7, 4, 0, 0, 37, 4, 1, 0, 0, 0, 38, 39, 7, 3, 0, 0, 39, 40, 7, 0, 0, 0, 40, 41, 7, 5, 0, 0, 41, 6, 1, 0, 0, 0, 42, 43, 5, 62, 0, 0, 43, 8, 1, 0, 0, 0, 44, 45, 5, 60, 0, 0, 45, 10, 1, 0, 0, 0, 46, 47, 5, 62, 0, 0, 47, 48, 5, 61, 0, 0, 48, 12, 1, 0, 0, 0, 49, 50, 5, 60, 0, 0, 50, 51, 5, 61, 0, 0, 51, 14, 1, 0, 0, 0, 52, 53, 5, 58, 0, 0, 53, 16, 1, 0, 0, 0, 54, 55, 5, 40, 0, 0, 55, 18, 1, 0, 0, 0, 56, 57, 5, 41, 0, 0, 57, 20, 1, 0, 0, 0, 58, 59, 5, 46, 0, 0, 59, 22, 1, 0, 0, 0, 60, 64, 5, 34, 0, 0, 61, 63, 8, 6, 0, 0, 62, 61, 1, 0, 0, 0, 63, 66, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 68, 5, 34, 0, 0, 68, 24, 1, 0, 0, 0, 69, 71, 5, 45, 0, 0, 70, 69, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 73, 1, 0, 0, 0, 72, 74, 7, 7, 0, 0, 73, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 83, 1, 0, 0, 0, 77, 79, 5, 46, 0, 0, 78, 80, 7, 7, 0, 0, 79, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 77, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 26, 1, 0, 0, 0, 85, 89, 7, 8, 0, 0, 86, 88, 7, 9, 0, 0, 87, 86, 1, 0, 0, 0, 88, 91, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 28, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 92, 94, 7, 10, 0, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 6, 14, 0, 0, 98, 30, 1, 0, 0, 0, 8, 0, 64, 70, 75, 81, 83, 89, 95, 1, 0, 1, 0] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java new file mode 100644 index 000000000000..c486c68bd632 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java @@ -0,0 +1,178 @@ +// Generated from /Users/paulstn/Documents/opensearch-2.15.0/OpenSearch-Dashboards/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 by ANTLR 4.13.1 +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"}) +public class DQLLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, + DOT=11, PHRASE=12, NUMBER=13, IDENTIFIER=14, WS=15; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + private static String[] makeRuleNames() { + return new String[] { + "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", + "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", "')'", + "'.'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", + "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public DQLLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "DQLLexer.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getChannelNames() { return channelNames; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + public static final String _serializedATN = + "\u0004\u0000\u000fc\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ + "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+ + "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+ + "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+ + "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0001"+ + "\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+ + "\u0001\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0001"+ + "\u0003\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+ + "\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001\b\u0001\b"+ + "\u0001\t\u0001\t\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0005\u000b?"+ + "\b\u000b\n\u000b\f\u000bB\t\u000b\u0001\u000b\u0001\u000b\u0001\f\u0003"+ + "\fG\b\f\u0001\f\u0004\fJ\b\f\u000b\f\f\fK\u0001\f\u0001\f\u0004\fP\b\f"+ + "\u000b\f\f\fQ\u0003\fT\b\f\u0001\r\u0001\r\u0005\rX\b\r\n\r\f\r[\t\r\u0001"+ + "\u000e\u0004\u000e^\b\u000e\u000b\u000e\f\u000e_\u0001\u000e\u0001\u000e"+ + "\u0000\u0000\u000f\u0001\u0001\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005"+ + "\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019"+ + "\r\u001b\u000e\u001d\u000f\u0001\u0000\u000b\u0002\u0000OOoo\u0002\u0000"+ + "RRrr\u0002\u0000AAaa\u0002\u0000NNnn\u0002\u0000DDdd\u0002\u0000TTtt\u0002"+ + "\u0000\"\"\\\\\u0001\u000009\u0004\u0000**AZ__az\u0005\u0000**09AZ__a"+ + "z\u0003\u0000\t\n\r\r i\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0003"+ + "\u0001\u0000\u0000\u0000\u0000\u0005\u0001\u0000\u0000\u0000\u0000\u0007"+ + "\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u000b\u0001"+ + "\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000\u0000\u0000\u000f\u0001\u0000"+ + "\u0000\u0000\u0000\u0011\u0001\u0000\u0000\u0000\u0000\u0013\u0001\u0000"+ + "\u0000\u0000\u0000\u0015\u0001\u0000\u0000\u0000\u0000\u0017\u0001\u0000"+ + "\u0000\u0000\u0000\u0019\u0001\u0000\u0000\u0000\u0000\u001b\u0001\u0000"+ + "\u0000\u0000\u0000\u001d\u0001\u0000\u0000\u0000\u0001\u001f\u0001\u0000"+ + "\u0000\u0000\u0003\"\u0001\u0000\u0000\u0000\u0005&\u0001\u0000\u0000"+ + "\u0000\u0007*\u0001\u0000\u0000\u0000\t,\u0001\u0000\u0000\u0000\u000b"+ + ".\u0001\u0000\u0000\u0000\r1\u0001\u0000\u0000\u0000\u000f4\u0001\u0000"+ + "\u0000\u0000\u00116\u0001\u0000\u0000\u0000\u00138\u0001\u0000\u0000\u0000"+ + "\u0015:\u0001\u0000\u0000\u0000\u0017<\u0001\u0000\u0000\u0000\u0019F"+ + "\u0001\u0000\u0000\u0000\u001bU\u0001\u0000\u0000\u0000\u001d]\u0001\u0000"+ + "\u0000\u0000\u001f \u0007\u0000\u0000\u0000 !\u0007\u0001\u0000\u0000"+ + "!\u0002\u0001\u0000\u0000\u0000\"#\u0007\u0002\u0000\u0000#$\u0007\u0003"+ + "\u0000\u0000$%\u0007\u0004\u0000\u0000%\u0004\u0001\u0000\u0000\u0000"+ + "&\'\u0007\u0003\u0000\u0000\'(\u0007\u0000\u0000\u0000()\u0007\u0005\u0000"+ + "\u0000)\u0006\u0001\u0000\u0000\u0000*+\u0005>\u0000\u0000+\b\u0001\u0000"+ + "\u0000\u0000,-\u0005<\u0000\u0000-\n\u0001\u0000\u0000\u0000./\u0005>"+ + "\u0000\u0000/0\u0005=\u0000\u00000\f\u0001\u0000\u0000\u000012\u0005<"+ + "\u0000\u000023\u0005=\u0000\u00003\u000e\u0001\u0000\u0000\u000045\u0005"+ + ":\u0000\u00005\u0010\u0001\u0000\u0000\u000067\u0005(\u0000\u00007\u0012"+ + "\u0001\u0000\u0000\u000089\u0005)\u0000\u00009\u0014\u0001\u0000\u0000"+ + "\u0000:;\u0005.\u0000\u0000;\u0016\u0001\u0000\u0000\u0000<@\u0005\"\u0000"+ + "\u0000=?\b\u0006\u0000\u0000>=\u0001\u0000\u0000\u0000?B\u0001\u0000\u0000"+ + "\u0000@>\u0001\u0000\u0000\u0000@A\u0001\u0000\u0000\u0000AC\u0001\u0000"+ + "\u0000\u0000B@\u0001\u0000\u0000\u0000CD\u0005\"\u0000\u0000D\u0018\u0001"+ + "\u0000\u0000\u0000EG\u0005-\u0000\u0000FE\u0001\u0000\u0000\u0000FG\u0001"+ + "\u0000\u0000\u0000GI\u0001\u0000\u0000\u0000HJ\u0007\u0007\u0000\u0000"+ + "IH\u0001\u0000\u0000\u0000JK\u0001\u0000\u0000\u0000KI\u0001\u0000\u0000"+ + "\u0000KL\u0001\u0000\u0000\u0000LS\u0001\u0000\u0000\u0000MO\u0005.\u0000"+ + "\u0000NP\u0007\u0007\u0000\u0000ON\u0001\u0000\u0000\u0000PQ\u0001\u0000"+ + "\u0000\u0000QO\u0001\u0000\u0000\u0000QR\u0001\u0000\u0000\u0000RT\u0001"+ + "\u0000\u0000\u0000SM\u0001\u0000\u0000\u0000ST\u0001\u0000\u0000\u0000"+ + "T\u001a\u0001\u0000\u0000\u0000UY\u0007\b\u0000\u0000VX\u0007\t\u0000"+ + "\u0000WV\u0001\u0000\u0000\u0000X[\u0001\u0000\u0000\u0000YW\u0001\u0000"+ + "\u0000\u0000YZ\u0001\u0000\u0000\u0000Z\u001c\u0001\u0000\u0000\u0000"+ + "[Y\u0001\u0000\u0000\u0000\\^\u0007\n\u0000\u0000]\\\u0001\u0000\u0000"+ + "\u0000^_\u0001\u0000\u0000\u0000_]\u0001\u0000\u0000\u0000_`\u0001\u0000"+ + "\u0000\u0000`a\u0001\u0000\u0000\u0000ab\u0006\u000e\u0000\u0000b\u001e"+ + "\u0001\u0000\u0000\u0000\b\u0000@FKQSY_\u0001\u0000\u0001\u0000"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens new file mode 100644 index 000000000000..3210060bf7d1 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens @@ -0,0 +1,23 @@ +OR=1 +AND=2 +NOT=3 +GT=4 +LT=5 +GE=6 +LE=7 +EQ=8 +LPAREN=9 +RPAREN=10 +DOT=11 +PHRASE=12 +NUMBER=13 +IDENTIFIER=14 +WS=15 +'>'=4 +'<'=5 +'>='=6 +'<='=7 +':'=8 +'('=9 +')'=10 +'.'=11 diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp new file mode 100644 index 000000000000..b9af1477ac89 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -0,0 +1,57 @@ +token literal names: +null +null +null +null +'>' +'<' +'>=' +'<=' +':' +'(' +')' +'.' +null +null +null +null +null + +token symbolic names: +null +OR +AND +NOT +GT +LT +GE +LE +EQ +LPAREN +RPAREN +DOT +PHRASE +NUMBER +DATESTRING +IDENTIFIER +WS + +rule names: +query +orExpression +andExpression +notExpression +primaryExpression +comparisonExpression +fieldExpression +termSearch +groupExpression +groupContent +field +rangeValue +value +comparisonOperator + + +atn: +[4, 1, 16, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 35, 8, 1, 10, 1, 12, 1, 38, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 43, 8, 2, 10, 2, 12, 2, 46, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 51, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 60, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 76, 8, 8, 1, 8, 5, 8, 79, 8, 8, 10, 8, 12, 8, 82, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 88, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 31, 1, 0, 0, 0, 4, 39, 1, 0, 0, 0, 6, 50, 1, 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 61, 1, 0, 0, 0, 12, 65, 1, 0, 0, 0, 14, 69, 1, 0, 0, 0, 16, 71, 1, 0, 0, 0, 18, 87, 1, 0, 0, 0, 20, 89, 1, 0, 0, 0, 22, 91, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 30, 5, 0, 0, 1, 30, 1, 1, 0, 0, 0, 31, 36, 3, 4, 2, 0, 32, 33, 5, 1, 0, 0, 33, 35, 3, 4, 2, 0, 34, 32, 1, 0, 0, 0, 35, 38, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 36, 1, 0, 0, 0, 39, 44, 3, 6, 3, 0, 40, 41, 5, 2, 0, 0, 41, 43, 3, 6, 3, 0, 42, 40, 1, 0, 0, 0, 43, 46, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 5, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 47, 48, 5, 3, 0, 0, 48, 51, 3, 6, 3, 0, 49, 51, 3, 8, 4, 0, 50, 47, 1, 0, 0, 0, 50, 49, 1, 0, 0, 0, 51, 7, 1, 0, 0, 0, 52, 53, 5, 9, 0, 0, 53, 54, 3, 0, 0, 0, 54, 55, 5, 10, 0, 0, 55, 60, 1, 0, 0, 0, 56, 60, 3, 10, 5, 0, 57, 60, 3, 12, 6, 0, 58, 60, 3, 14, 7, 0, 59, 52, 1, 0, 0, 0, 59, 56, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 58, 1, 0, 0, 0, 60, 9, 1, 0, 0, 0, 61, 62, 3, 20, 10, 0, 62, 63, 3, 26, 13, 0, 63, 64, 3, 22, 11, 0, 64, 11, 1, 0, 0, 0, 65, 66, 3, 20, 10, 0, 66, 67, 5, 8, 0, 0, 67, 68, 3, 24, 12, 0, 68, 13, 1, 0, 0, 0, 69, 70, 5, 15, 0, 0, 70, 15, 1, 0, 0, 0, 71, 72, 5, 9, 0, 0, 72, 80, 3, 18, 9, 0, 73, 75, 7, 0, 0, 0, 74, 76, 5, 3, 0, 0, 75, 74, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 79, 3, 18, 9, 0, 78, 73, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 10, 0, 0, 84, 17, 1, 0, 0, 0, 85, 88, 3, 16, 8, 0, 86, 88, 3, 14, 7, 0, 87, 85, 1, 0, 0, 0, 87, 86, 1, 0, 0, 0, 88, 19, 1, 0, 0, 0, 89, 90, 5, 15, 0, 0, 90, 21, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 23, 1, 0, 0, 0, 93, 98, 5, 12, 0, 0, 94, 98, 5, 13, 0, 0, 95, 98, 3, 14, 7, 0, 96, 98, 3, 16, 8, 0, 97, 93, 1, 0, 0, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 8, 36, 44, 50, 59, 75, 80, 87, 97] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java new file mode 100644 index 000000000000..1467436bd0e2 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -0,0 +1,868 @@ +// Generated from /Users/paulstn/Documents/opensearch-2.15.0/OpenSearch-Dashboards/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 by ANTLR 4.13.1 +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.*; +import org.antlr.v4.runtime.tree.*; +import java.util.List; +import java.util.Iterator; +import java.util.ArrayList; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"}) +public class DQLParser extends Parser { + static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, + DOT=11, PHRASE=12, NUMBER=13, DATESTRING=14, IDENTIFIER=15, WS=16; + public static final int + RULE_query = 0, RULE_orExpression = 1, RULE_andExpression = 2, RULE_notExpression = 3, + RULE_primaryExpression = 4, RULE_comparisonExpression = 5, RULE_fieldExpression = 6, + RULE_termSearch = 7, RULE_groupExpression = 8, RULE_groupContent = 9, + RULE_field = 10, RULE_rangeValue = 11, RULE_value = 12, RULE_comparisonOperator = 13; + private static String[] makeRuleNames() { + return new String[] { + "query", "orExpression", "andExpression", "notExpression", "primaryExpression", + "comparisonExpression", "fieldExpression", "termSearch", "groupExpression", + "groupContent", "field", "rangeValue", "value", "comparisonOperator" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", "')'", + "'.'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", + "DOT", "PHRASE", "NUMBER", "DATESTRING", "IDENTIFIER", "WS" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "DQLParser.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + public DQLParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @SuppressWarnings("CheckReturnValue") + public static class QueryContext extends ParserRuleContext { + public OrExpressionContext orExpression() { + return getRuleContext(OrExpressionContext.class,0); + } + public TerminalNode EOF() { return getToken(DQLParser.EOF, 0); } + public QueryContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_query; } + } + + public final QueryContext query() throws RecognitionException { + QueryContext _localctx = new QueryContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_query); + try { + enterOuterAlt(_localctx, 1); + { + setState(28); + orExpression(); + setState(29); + match(EOF); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class OrExpressionContext extends ParserRuleContext { + public List andExpression() { + return getRuleContexts(AndExpressionContext.class); + } + public AndExpressionContext andExpression(int i) { + return getRuleContext(AndExpressionContext.class,i); + } + public List OR() { return getTokens(DQLParser.OR); } + public TerminalNode OR(int i) { + return getToken(DQLParser.OR, i); + } + public OrExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_orExpression; } + } + + public final OrExpressionContext orExpression() throws RecognitionException { + OrExpressionContext _localctx = new OrExpressionContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_orExpression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(31); + andExpression(); + setState(36); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==OR) { + { + { + setState(32); + match(OR); + setState(33); + andExpression(); + } + } + setState(38); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class AndExpressionContext extends ParserRuleContext { + public List notExpression() { + return getRuleContexts(NotExpressionContext.class); + } + public NotExpressionContext notExpression(int i) { + return getRuleContext(NotExpressionContext.class,i); + } + public List AND() { return getTokens(DQLParser.AND); } + public TerminalNode AND(int i) { + return getToken(DQLParser.AND, i); + } + public AndExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_andExpression; } + } + + public final AndExpressionContext andExpression() throws RecognitionException { + AndExpressionContext _localctx = new AndExpressionContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_andExpression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(39); + notExpression(); + setState(44); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==AND) { + { + { + setState(40); + match(AND); + setState(41); + notExpression(); + } + } + setState(46); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class NotExpressionContext extends ParserRuleContext { + public TerminalNode NOT() { return getToken(DQLParser.NOT, 0); } + public NotExpressionContext notExpression() { + return getRuleContext(NotExpressionContext.class,0); + } + public PrimaryExpressionContext primaryExpression() { + return getRuleContext(PrimaryExpressionContext.class,0); + } + public NotExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_notExpression; } + } + + public final NotExpressionContext notExpression() throws RecognitionException { + NotExpressionContext _localctx = new NotExpressionContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_notExpression); + try { + setState(50); + _errHandler.sync(this); + switch (_input.LA(1)) { + case NOT: + enterOuterAlt(_localctx, 1); + { + setState(47); + match(NOT); + setState(48); + notExpression(); + } + break; + case LPAREN: + case IDENTIFIER: + enterOuterAlt(_localctx, 2); + { + setState(49); + primaryExpression(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class PrimaryExpressionContext extends ParserRuleContext { + public TerminalNode LPAREN() { return getToken(DQLParser.LPAREN, 0); } + public QueryContext query() { + return getRuleContext(QueryContext.class,0); + } + public TerminalNode RPAREN() { return getToken(DQLParser.RPAREN, 0); } + public ComparisonExpressionContext comparisonExpression() { + return getRuleContext(ComparisonExpressionContext.class,0); + } + public FieldExpressionContext fieldExpression() { + return getRuleContext(FieldExpressionContext.class,0); + } + public TermSearchContext termSearch() { + return getRuleContext(TermSearchContext.class,0); + } + public PrimaryExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_primaryExpression; } + } + + public final PrimaryExpressionContext primaryExpression() throws RecognitionException { + PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_primaryExpression); + try { + setState(59); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(52); + match(LPAREN); + setState(53); + query(); + setState(54); + match(RPAREN); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(56); + comparisonExpression(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(57); + fieldExpression(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(58); + termSearch(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ComparisonExpressionContext extends ParserRuleContext { + public FieldContext field() { + return getRuleContext(FieldContext.class,0); + } + public ComparisonOperatorContext comparisonOperator() { + return getRuleContext(ComparisonOperatorContext.class,0); + } + public RangeValueContext rangeValue() { + return getRuleContext(RangeValueContext.class,0); + } + public ComparisonExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_comparisonExpression; } + } + + public final ComparisonExpressionContext comparisonExpression() throws RecognitionException { + ComparisonExpressionContext _localctx = new ComparisonExpressionContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_comparisonExpression); + try { + enterOuterAlt(_localctx, 1); + { + setState(61); + field(); + setState(62); + comparisonOperator(); + setState(63); + rangeValue(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class FieldExpressionContext extends ParserRuleContext { + public FieldContext field() { + return getRuleContext(FieldContext.class,0); + } + public TerminalNode EQ() { return getToken(DQLParser.EQ, 0); } + public ValueContext value() { + return getRuleContext(ValueContext.class,0); + } + public FieldExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fieldExpression; } + } + + public final FieldExpressionContext fieldExpression() throws RecognitionException { + FieldExpressionContext _localctx = new FieldExpressionContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_fieldExpression); + try { + enterOuterAlt(_localctx, 1); + { + setState(65); + field(); + setState(66); + match(EQ); + setState(67); + value(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class TermSearchContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(DQLParser.IDENTIFIER, 0); } + public TermSearchContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_termSearch; } + } + + public final TermSearchContext termSearch() throws RecognitionException { + TermSearchContext _localctx = new TermSearchContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_termSearch); + try { + enterOuterAlt(_localctx, 1); + { + setState(69); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class GroupExpressionContext extends ParserRuleContext { + public TerminalNode LPAREN() { return getToken(DQLParser.LPAREN, 0); } + public List groupContent() { + return getRuleContexts(GroupContentContext.class); + } + public GroupContentContext groupContent(int i) { + return getRuleContext(GroupContentContext.class,i); + } + public TerminalNode RPAREN() { return getToken(DQLParser.RPAREN, 0); } + public List OR() { return getTokens(DQLParser.OR); } + public TerminalNode OR(int i) { + return getToken(DQLParser.OR, i); + } + public List AND() { return getTokens(DQLParser.AND); } + public TerminalNode AND(int i) { + return getToken(DQLParser.AND, i); + } + public List NOT() { return getTokens(DQLParser.NOT); } + public TerminalNode NOT(int i) { + return getToken(DQLParser.NOT, i); + } + public GroupExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_groupExpression; } + } + + public final GroupExpressionContext groupExpression() throws RecognitionException { + GroupExpressionContext _localctx = new GroupExpressionContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_groupExpression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(71); + match(LPAREN); + setState(72); + groupContent(); + setState(80); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==OR || _la==AND) { + { + { + setState(73); + _la = _input.LA(1); + if ( !(_la==OR || _la==AND) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + { + setState(75); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==NOT) { + { + setState(74); + match(NOT); + } + } + + } + setState(77); + groupContent(); + } + } + setState(82); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(83); + match(RPAREN); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class GroupContentContext extends ParserRuleContext { + public GroupExpressionContext groupExpression() { + return getRuleContext(GroupExpressionContext.class,0); + } + public TermSearchContext termSearch() { + return getRuleContext(TermSearchContext.class,0); + } + public GroupContentContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_groupContent; } + } + + public final GroupContentContext groupContent() throws RecognitionException { + GroupContentContext _localctx = new GroupContentContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_groupContent); + try { + setState(87); + _errHandler.sync(this); + switch (_input.LA(1)) { + case LPAREN: + enterOuterAlt(_localctx, 1); + { + setState(85); + groupExpression(); + } + break; + case IDENTIFIER: + enterOuterAlt(_localctx, 2); + { + setState(86); + termSearch(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class FieldContext extends ParserRuleContext { + public TerminalNode IDENTIFIER() { return getToken(DQLParser.IDENTIFIER, 0); } + public FieldContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_field; } + } + + public final FieldContext field() throws RecognitionException { + FieldContext _localctx = new FieldContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_field); + try { + enterOuterAlt(_localctx, 1); + { + setState(89); + match(IDENTIFIER); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class RangeValueContext extends ParserRuleContext { + public TerminalNode NUMBER() { return getToken(DQLParser.NUMBER, 0); } + public TerminalNode PHRASE() { return getToken(DQLParser.PHRASE, 0); } + public RangeValueContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_rangeValue; } + } + + public final RangeValueContext rangeValue() throws RecognitionException { + RangeValueContext _localctx = new RangeValueContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_rangeValue); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(91); + _la = _input.LA(1); + if ( !(_la==PHRASE || _la==NUMBER) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ValueContext extends ParserRuleContext { + public TerminalNode PHRASE() { return getToken(DQLParser.PHRASE, 0); } + public TerminalNode NUMBER() { return getToken(DQLParser.NUMBER, 0); } + public TermSearchContext termSearch() { + return getRuleContext(TermSearchContext.class,0); + } + public GroupExpressionContext groupExpression() { + return getRuleContext(GroupExpressionContext.class,0); + } + public ValueContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_value; } + } + + public final ValueContext value() throws RecognitionException { + ValueContext _localctx = new ValueContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_value); + try { + setState(97); + _errHandler.sync(this); + switch (_input.LA(1)) { + case PHRASE: + enterOuterAlt(_localctx, 1); + { + setState(93); + match(PHRASE); + } + break; + case NUMBER: + enterOuterAlt(_localctx, 2); + { + setState(94); + match(NUMBER); + } + break; + case IDENTIFIER: + enterOuterAlt(_localctx, 3); + { + setState(95); + termSearch(); + } + break; + case LPAREN: + enterOuterAlt(_localctx, 4); + { + setState(96); + groupExpression(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ComparisonOperatorContext extends ParserRuleContext { + public TerminalNode GT() { return getToken(DQLParser.GT, 0); } + public TerminalNode LT() { return getToken(DQLParser.LT, 0); } + public TerminalNode GE() { return getToken(DQLParser.GE, 0); } + public TerminalNode LE() { return getToken(DQLParser.LE, 0); } + public ComparisonOperatorContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_comparisonOperator; } + } + + public final ComparisonOperatorContext comparisonOperator() throws RecognitionException { + ComparisonOperatorContext _localctx = new ComparisonOperatorContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_comparisonOperator); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(99); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 240L) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static final String _serializedATN = + "\u0004\u0001\u0010f\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ + "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ + "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ + "\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001"+ + "\u0001\u0001\u0001\u0001\u0005\u0001#\b\u0001\n\u0001\f\u0001&\t\u0001"+ + "\u0001\u0002\u0001\u0002\u0001\u0002\u0005\u0002+\b\u0002\n\u0002\f\u0002"+ + ".\t\u0002\u0001\u0003\u0001\u0003\u0001\u0003\u0003\u00033\b\u0003\u0001"+ + "\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001"+ + "\u0004\u0003\u0004<\b\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+ + "\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001"+ + "\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bL\b\b\u0001\b\u0005\bO\b"+ + "\b\n\b\f\bR\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\tX\b\t\u0001\n\u0001"+ + "\n\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0003\fb\b"+ + "\f\u0001\r\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002\u0004\u0006\b"+ + "\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003\u0001\u0000"+ + "\u0001\u0002\u0001\u0000\f\r\u0001\u0000\u0004\u0007c\u0000\u001c\u0001"+ + "\u0000\u0000\u0000\u0002\u001f\u0001\u0000\u0000\u0000\u0004\'\u0001\u0000"+ + "\u0000\u0000\u00062\u0001\u0000\u0000\u0000\b;\u0001\u0000\u0000\u0000"+ + "\n=\u0001\u0000\u0000\u0000\fA\u0001\u0000\u0000\u0000\u000eE\u0001\u0000"+ + "\u0000\u0000\u0010G\u0001\u0000\u0000\u0000\u0012W\u0001\u0000\u0000\u0000"+ + "\u0014Y\u0001\u0000\u0000\u0000\u0016[\u0001\u0000\u0000\u0000\u0018a"+ + "\u0001\u0000\u0000\u0000\u001ac\u0001\u0000\u0000\u0000\u001c\u001d\u0003"+ + "\u0002\u0001\u0000\u001d\u001e\u0005\u0000\u0000\u0001\u001e\u0001\u0001"+ + "\u0000\u0000\u0000\u001f$\u0003\u0004\u0002\u0000 !\u0005\u0001\u0000"+ + "\u0000!#\u0003\u0004\u0002\u0000\" \u0001\u0000\u0000\u0000#&\u0001\u0000"+ + "\u0000\u0000$\"\u0001\u0000\u0000\u0000$%\u0001\u0000\u0000\u0000%\u0003"+ + "\u0001\u0000\u0000\u0000&$\u0001\u0000\u0000\u0000\',\u0003\u0006\u0003"+ + "\u0000()\u0005\u0002\u0000\u0000)+\u0003\u0006\u0003\u0000*(\u0001\u0000"+ + "\u0000\u0000+.\u0001\u0000\u0000\u0000,*\u0001\u0000\u0000\u0000,-\u0001"+ + "\u0000\u0000\u0000-\u0005\u0001\u0000\u0000\u0000.,\u0001\u0000\u0000"+ + "\u0000/0\u0005\u0003\u0000\u000003\u0003\u0006\u0003\u000013\u0003\b\u0004"+ + "\u00002/\u0001\u0000\u0000\u000021\u0001\u0000\u0000\u00003\u0007\u0001"+ + "\u0000\u0000\u000045\u0005\t\u0000\u000056\u0003\u0000\u0000\u000067\u0005"+ + "\n\u0000\u00007<\u0001\u0000\u0000\u00008<\u0003\n\u0005\u00009<\u0003"+ + "\f\u0006\u0000:<\u0003\u000e\u0007\u0000;4\u0001\u0000\u0000\u0000;8\u0001"+ + "\u0000\u0000\u0000;9\u0001\u0000\u0000\u0000;:\u0001\u0000\u0000\u0000"+ + "<\t\u0001\u0000\u0000\u0000=>\u0003\u0014\n\u0000>?\u0003\u001a\r\u0000"+ + "?@\u0003\u0016\u000b\u0000@\u000b\u0001\u0000\u0000\u0000AB\u0003\u0014"+ + "\n\u0000BC\u0005\b\u0000\u0000CD\u0003\u0018\f\u0000D\r\u0001\u0000\u0000"+ + "\u0000EF\u0005\u000f\u0000\u0000F\u000f\u0001\u0000\u0000\u0000GH\u0005"+ + "\t\u0000\u0000HP\u0003\u0012\t\u0000IK\u0007\u0000\u0000\u0000JL\u0005"+ + "\u0003\u0000\u0000KJ\u0001\u0000\u0000\u0000KL\u0001\u0000\u0000\u0000"+ + "LM\u0001\u0000\u0000\u0000MO\u0003\u0012\t\u0000NI\u0001\u0000\u0000\u0000"+ + "OR\u0001\u0000\u0000\u0000PN\u0001\u0000\u0000\u0000PQ\u0001\u0000\u0000"+ + "\u0000QS\u0001\u0000\u0000\u0000RP\u0001\u0000\u0000\u0000ST\u0005\n\u0000"+ + "\u0000T\u0011\u0001\u0000\u0000\u0000UX\u0003\u0010\b\u0000VX\u0003\u000e"+ + "\u0007\u0000WU\u0001\u0000\u0000\u0000WV\u0001\u0000\u0000\u0000X\u0013"+ + "\u0001\u0000\u0000\u0000YZ\u0005\u000f\u0000\u0000Z\u0015\u0001\u0000"+ + "\u0000\u0000[\\\u0007\u0001\u0000\u0000\\\u0017\u0001\u0000\u0000\u0000"+ + "]b\u0005\f\u0000\u0000^b\u0005\r\u0000\u0000_b\u0003\u000e\u0007\u0000"+ + "`b\u0003\u0010\b\u0000a]\u0001\u0000\u0000\u0000a^\u0001\u0000\u0000\u0000"+ + "a_\u0001\u0000\u0000\u0000a`\u0001\u0000\u0000\u0000b\u0019\u0001\u0000"+ + "\u0000\u0000cd\u0007\u0002\u0000\u0000d\u001b\u0001\u0000\u0000\u0000"+ + "\b$,2;KPWa"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens new file mode 100644 index 000000000000..00fa5d537f7b --- /dev/null +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens @@ -0,0 +1,24 @@ +OR=1 +AND=2 +NOT=3 +GT=4 +LT=5 +GE=6 +LE=7 +EQ=8 +LPAREN=9 +RPAREN=10 +DOT=11 +PHRASE=12 +NUMBER=13 +DATESTRING=14 +IDENTIFIER=15 +WS=16 +'>'=4 +'<'=5 +'>='=6 +'<='=7 +':'=8 +'('=9 +')'=10 +'.'=11 diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 new file mode 100644 index 000000000000..65af7662e999 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 @@ -0,0 +1,26 @@ +lexer grammar DQLLexer; + +// Keywords +OR: [oO] [rR]; +AND: [aA] [nN] [dD]; +NOT: [nN] [oO] [tT]; + +// Operators +GT: '>'; +LT: '<'; +GE: '>='; +LE: '<='; +EQ: ':'; + +// Delimiters +LPAREN: '('; +RPAREN: ')'; +DOT: '.'; + +// Literals +PHRASE: '"' (~["\\])* '"'; +NUMBER: '-'? [0-9]+ ('.' [0-9]+)?; +IDENTIFIER: [a-zA-Z_*][a-zA-Z0-9_*]*; + +// SKIP +WS: [ \t\r\n]+ -> channel(HIDDEN); \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 new file mode 100644 index 000000000000..6a94185e28cf --- /dev/null +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -0,0 +1,25 @@ +parser grammar DQLParser; + +options { + tokenVocab = DQLLexer; +} + +query: orExpression EOF; +orExpression: andExpression (OR andExpression)*; +andExpression: notExpression (AND notExpression)*; +notExpression: NOT notExpression | primaryExpression; +primaryExpression: + LPAREN query RPAREN + | comparisonExpression + | fieldExpression + | termSearch; +comparisonExpression: field comparisonOperator rangeValue; +fieldExpression: field EQ value; +termSearch: IDENTIFIER; +groupExpression: + LPAREN groupContent ((OR | AND) (NOT?) groupContent)* RPAREN; +groupContent: groupExpression | termSearch; +field: IDENTIFIER; +rangeValue: NUMBER | PHRASE; +value: PHRASE | NUMBER | termSearch | groupExpression; +comparisonOperator: GT | LT | GE | LE; \ No newline at end of file diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index ba1fbbf5abb1..ced04c4de9cc 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -94,6 +94,8 @@ import { registerDefaultDataSource } from './data_sources/register_default_datas import { DefaultDslDataSource } from './data_sources/default_datasource'; import { DEFAULT_DATA_SOURCE_TYPE } from './data_sources/constants'; import { getSuggestions as getSQLSuggestions } from './antlr/opensearch_sql/code_completion'; +import { getSuggestions as getPPLSuggestions } from './antlr/opensearch_ppl/code_completion'; +import { getSuggestions as getDQLSuggestions } from './antlr/dql/code_completion'; declare module '../../ui_actions/public' { export interface ActionContextMapping { @@ -167,7 +169,9 @@ export class DataPublicPlugin const uiService = this.uiService.setup(core, {}); const ac = this.autocomplete.setup(core); - ac.addQuerySuggestionProvider('SQL', getSQLSuggestions); + ac.addQuerySuggestionProvider('PPL', getPPLSuggestions); + ac.addQuerySuggestionProvider('SQL', getDQLSuggestions); + ac.addQuerySuggestionProvider('kuery', getDQLSuggestions); return { // TODO: MQL diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index db4984b637d4..f2dd0acc9436 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -30,7 +30,7 @@ import { QueryLanguageSelector } from './language_selector'; import { QueryEditorExtensions } from './query_editor_extensions'; import { QueryEditorBtnCollapse } from './query_editor_btn_collapse'; -const LANGUAGE_ID = 'SQL'; +const LANGUAGE_ID = 'kuery'; monaco.languages.register({ id: LANGUAGE_ID }); export interface QueryEditorProps { @@ -257,10 +257,14 @@ export default class QueryEditorUI extends Component { } this.initPersistedLog(); - // this.fetchIndexPatterns().then(this.updateSuggestions); + this.fetchIndexPatterns(); } public componentDidUpdate(prevProps: Props) { + if (prevProps.indexPatterns !== this.props.indexPatterns) { + this.fetchIndexPatterns(); + } + const parsedQuery = fromUser(toUser(this.props.query.query)); if (!isEqual(this.props.query.query, parsedQuery)) { this.onChange({ ...this.props.query, query: parsedQuery }); From 758708c1a3eaefa7ac659cb40ea978ae5edc27f2 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Tue, 2 Jul 2024 14:50:32 -0700 Subject: [PATCH 02/34] dql Antlr autocomplete (#7160) * re-add provider for sql Signed-off-by: Paul Sebastian * added temporary fix for language providor to appear for more than one language Signed-off-by: Paul Sebastian --------- Signed-off-by: Paul Sebastian --- src/plugins/data/public/plugin.ts | 2 +- .../public/ui/query_editor/query_editor.tsx | 9 ++-- .../public/code_editor/code_editor.tsx | 50 +++++++++---------- 3 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index ced04c4de9cc..ba32243412df 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -170,7 +170,7 @@ export class DataPublicPlugin const ac = this.autocomplete.setup(core); ac.addQuerySuggestionProvider('PPL', getPPLSuggestions); - ac.addQuerySuggestionProvider('SQL', getDQLSuggestions); + ac.addQuerySuggestionProvider('SQL', getSQLSuggestions); ac.addQuerySuggestionProvider('kuery', getDQLSuggestions); return { diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index f2dd0acc9436..0c5ca046c497 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -30,8 +30,11 @@ import { QueryLanguageSelector } from './language_selector'; import { QueryEditorExtensions } from './query_editor_extensions'; import { QueryEditorBtnCollapse } from './query_editor_btn_collapse'; -const LANGUAGE_ID = 'kuery'; -monaco.languages.register({ id: LANGUAGE_ID }); +const LANGUAGE_ID_SQL = 'SQL'; +monaco.languages.register({ id: LANGUAGE_ID_SQL }); + +const LANGUAGE_ID_KUERY = 'kuery'; +monaco.languages.register({ id: LANGUAGE_ID_KUERY }); export interface QueryEditorProps { indexPatterns: Array; @@ -261,7 +264,7 @@ export default class QueryEditorUI extends Component { } public componentDidUpdate(prevProps: Props) { - if (prevProps.indexPatterns !== this.props.indexPatterns) { + if (!isEqual(prevProps.indexPatterns, this.props.indexPatterns)) { this.fetchIndexPatterns(); } diff --git a/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx b/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx index 5dc0d94ba00f..26ab5b482a48 100644 --- a/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx +++ b/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx @@ -127,31 +127,31 @@ export class CodeEditor extends React.Component { this.props.editorWillMount(); } - monaco.languages.onLanguage(this.props.languageId, () => { - if (this.props.suggestionProvider) { - monaco.languages.registerCompletionItemProvider( - this.props.languageId, - this.props.suggestionProvider - ); - } - - if (this.props.signatureProvider) { - monaco.languages.registerSignatureHelpProvider( - this.props.languageId, - this.props.signatureProvider - ); - } - - if (this.props.hoverProvider) { - monaco.languages.registerHoverProvider(this.props.languageId, this.props.hoverProvider); - } - - if (this.props.languageConfiguration) { - monaco.languages.setLanguageConfiguration( - this.props.languageId, - this.props.languageConfiguration - ); - } + // TEMPORARY fix for suggestion providor not appear for more than one language + ['SQL', 'kuery'].forEach((language) => { + monaco.languages.onLanguage(language, () => { + if (this.props.suggestionProvider) { + monaco.languages.registerCompletionItemProvider(language, this.props.suggestionProvider); + } + + if (this.props.signatureProvider) { + monaco.languages.registerSignatureHelpProvider( + this.props.languageId, + this.props.signatureProvider + ); + } + + if (this.props.hoverProvider) { + monaco.languages.registerHoverProvider(this.props.languageId, this.props.hoverProvider); + } + + if (this.props.languageConfiguration) { + monaco.languages.setLanguageConfiguration( + this.props.languageId, + this.props.languageConfiguration + ); + } + }); }); // Register the theme From f5a3d6a1098df067cef0cf5a4c4ea586692ef813 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Thu, 11 Jul 2024 14:32:52 -0700 Subject: [PATCH 03/34] remove EOF in parser to fix suggestions Signed-off-by: Paul Sebastian --- .../antlr/dql/generated/DQLParser.interp | 2 +- .../public/antlr/dql/generated/DQLParser.ts | 161 +++++++------- .../antlr/dql/grammar/.antlr/DQLParser.interp | 4 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 206 +++++++++--------- .../antlr/dql/grammar/.antlr/DQLParser.tokens | 5 +- .../public/antlr/dql/grammar/DQLParser.g4 | 2 +- 6 files changed, 184 insertions(+), 196 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp index 62c1ce8e8240..99dca7502428 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp @@ -52,4 +52,4 @@ comparisonOperator atn: -[4, 1, 15, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 35, 8, 1, 10, 1, 12, 1, 38, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 43, 8, 2, 10, 2, 12, 2, 46, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 51, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 60, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 76, 8, 8, 1, 8, 5, 8, 79, 8, 8, 10, 8, 12, 8, 82, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 88, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 31, 1, 0, 0, 0, 4, 39, 1, 0, 0, 0, 6, 50, 1, 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 61, 1, 0, 0, 0, 12, 65, 1, 0, 0, 0, 14, 69, 1, 0, 0, 0, 16, 71, 1, 0, 0, 0, 18, 87, 1, 0, 0, 0, 20, 89, 1, 0, 0, 0, 22, 91, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 30, 5, 0, 0, 1, 30, 1, 1, 0, 0, 0, 31, 36, 3, 4, 2, 0, 32, 33, 5, 1, 0, 0, 33, 35, 3, 4, 2, 0, 34, 32, 1, 0, 0, 0, 35, 38, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 36, 1, 0, 0, 0, 39, 44, 3, 6, 3, 0, 40, 41, 5, 2, 0, 0, 41, 43, 3, 6, 3, 0, 42, 40, 1, 0, 0, 0, 43, 46, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 5, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 47, 48, 5, 3, 0, 0, 48, 51, 3, 6, 3, 0, 49, 51, 3, 8, 4, 0, 50, 47, 1, 0, 0, 0, 50, 49, 1, 0, 0, 0, 51, 7, 1, 0, 0, 0, 52, 53, 5, 9, 0, 0, 53, 54, 3, 0, 0, 0, 54, 55, 5, 10, 0, 0, 55, 60, 1, 0, 0, 0, 56, 60, 3, 10, 5, 0, 57, 60, 3, 12, 6, 0, 58, 60, 3, 14, 7, 0, 59, 52, 1, 0, 0, 0, 59, 56, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 58, 1, 0, 0, 0, 60, 9, 1, 0, 0, 0, 61, 62, 3, 20, 10, 0, 62, 63, 3, 26, 13, 0, 63, 64, 3, 22, 11, 0, 64, 11, 1, 0, 0, 0, 65, 66, 3, 20, 10, 0, 66, 67, 5, 8, 0, 0, 67, 68, 3, 24, 12, 0, 68, 13, 1, 0, 0, 0, 69, 70, 5, 14, 0, 0, 70, 15, 1, 0, 0, 0, 71, 72, 5, 9, 0, 0, 72, 80, 3, 18, 9, 0, 73, 75, 7, 0, 0, 0, 74, 76, 5, 3, 0, 0, 75, 74, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 79, 3, 18, 9, 0, 78, 73, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 10, 0, 0, 84, 17, 1, 0, 0, 0, 85, 88, 3, 16, 8, 0, 86, 88, 3, 14, 7, 0, 87, 85, 1, 0, 0, 0, 87, 86, 1, 0, 0, 0, 88, 19, 1, 0, 0, 0, 89, 90, 5, 14, 0, 0, 90, 21, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 23, 1, 0, 0, 0, 93, 98, 5, 12, 0, 0, 94, 98, 5, 13, 0, 0, 95, 98, 3, 14, 7, 0, 96, 98, 3, 16, 8, 0, 97, 93, 1, 0, 0, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 8, 36, 44, 50, 59, 75, 80, 87, 97] \ No newline at end of file +[4, 1, 15, 101, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 75, 8, 8, 1, 8, 5, 8, 78, 8, 8, 10, 8, 12, 8, 81, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 87, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 97, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 98, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 68, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 22, 90, 1, 0, 0, 0, 24, 96, 1, 0, 0, 0, 26, 98, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 66, 5, 8, 0, 0, 66, 67, 3, 24, 12, 0, 67, 13, 1, 0, 0, 0, 68, 69, 5, 14, 0, 0, 69, 15, 1, 0, 0, 0, 70, 71, 5, 9, 0, 0, 71, 79, 3, 18, 9, 0, 72, 74, 7, 0, 0, 0, 73, 75, 5, 3, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 3, 18, 9, 0, 77, 72, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 10, 0, 0, 83, 17, 1, 0, 0, 0, 84, 87, 3, 16, 8, 0, 85, 87, 3, 14, 7, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 19, 1, 0, 0, 0, 88, 89, 5, 14, 0, 0, 89, 21, 1, 0, 0, 0, 90, 91, 7, 1, 0, 0, 91, 23, 1, 0, 0, 0, 92, 97, 5, 12, 0, 0, 93, 97, 5, 13, 0, 0, 94, 97, 3, 14, 7, 0, 95, 97, 3, 16, 8, 0, 96, 92, 1, 0, 0, 0, 96, 93, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 25, 1, 0, 0, 0, 98, 99, 7, 2, 0, 0, 99, 27, 1, 0, 0, 0, 8, 35, 43, 49, 58, 74, 79, 86, 96] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts index 959e98eb79f4..d8adfdfe4853 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts @@ -79,8 +79,6 @@ export class DQLParser extends antlr.Parser { { this.state = 28; this.orExpression(); - this.state = 29; - this.match(DQLParser.EOF); } } catch (re) { @@ -103,21 +101,21 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 31; + this.state = 30; this.andExpression(); - this.state = 36; + this.state = 35; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 32; + this.state = 31; this.match(DQLParser.OR); - this.state = 33; + this.state = 32; this.andExpression(); } } - this.state = 38; + this.state = 37; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -143,21 +141,21 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 39; + this.state = 38; this.notExpression(); - this.state = 44; + this.state = 43; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 2) { { { - this.state = 40; + this.state = 39; this.match(DQLParser.AND); - this.state = 41; + this.state = 40; this.notExpression(); } } - this.state = 46; + this.state = 45; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -180,15 +178,15 @@ export class DQLParser extends antlr.Parser { let localContext = new NotExpressionContext(this.context, this.state); this.enterRule(localContext, 6, DQLParser.RULE_notExpression); try { - this.state = 50; + this.state = 49; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.NOT: this.enterOuterAlt(localContext, 1); { - this.state = 47; + this.state = 46; this.match(DQLParser.NOT); - this.state = 48; + this.state = 47; this.notExpression(); } break; @@ -196,7 +194,7 @@ export class DQLParser extends antlr.Parser { case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 2); { - this.state = 49; + this.state = 48; this.primaryExpression(); } break; @@ -221,38 +219,38 @@ export class DQLParser extends antlr.Parser { let localContext = new PrimaryExpressionContext(this.context, this.state); this.enterRule(localContext, 8, DQLParser.RULE_primaryExpression); try { - this.state = 59; + this.state = 58; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context) ) { case 1: this.enterOuterAlt(localContext, 1); { - this.state = 52; + this.state = 51; this.match(DQLParser.LPAREN); - this.state = 53; + this.state = 52; this.query(); - this.state = 54; + this.state = 53; this.match(DQLParser.RPAREN); } break; case 2: this.enterOuterAlt(localContext, 2); { - this.state = 56; + this.state = 55; this.comparisonExpression(); } break; case 3: this.enterOuterAlt(localContext, 3); { - this.state = 57; + this.state = 56; this.fieldExpression(); } break; case 4: this.enterOuterAlt(localContext, 4); { - this.state = 58; + this.state = 57; this.termSearch(); } break; @@ -277,11 +275,11 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 61; + this.state = 60; this.field(); - this.state = 62; + this.state = 61; this.comparisonOperator(); - this.state = 63; + this.state = 62; this.rangeValue(); } } @@ -304,11 +302,11 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 65; + this.state = 64; this.field(); - this.state = 66; + this.state = 65; this.match(DQLParser.EQ); - this.state = 67; + this.state = 66; this.value(); } } @@ -331,7 +329,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 69; + this.state = 68; this.match(DQLParser.IDENTIFIER); } } @@ -355,17 +353,17 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 71; + this.state = 70; this.match(DQLParser.LPAREN); - this.state = 72; + this.state = 71; this.groupContent(); - this.state = 80; + this.state = 79; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1 || _la === 2) { { { - this.state = 73; + this.state = 72; _la = this.tokenStream.LA(1); if(!(_la === 1 || _la === 2)) { this.errorHandler.recoverInline(this); @@ -375,26 +373,26 @@ export class DQLParser extends antlr.Parser { this.consume(); } { - this.state = 75; + this.state = 74; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 3) { { - this.state = 74; + this.state = 73; this.match(DQLParser.NOT); } } } - this.state = 77; + this.state = 76; this.groupContent(); } } - this.state = 82; + this.state = 81; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 83; + this.state = 82; this.match(DQLParser.RPAREN); } } @@ -415,20 +413,20 @@ export class DQLParser extends antlr.Parser { let localContext = new GroupContentContext(this.context, this.state); this.enterRule(localContext, 18, DQLParser.RULE_groupContent); try { - this.state = 87; + this.state = 86; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.LPAREN: this.enterOuterAlt(localContext, 1); { - this.state = 85; + this.state = 84; this.groupExpression(); } break; case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 2); { - this.state = 86; + this.state = 85; this.termSearch(); } break; @@ -455,7 +453,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 89; + this.state = 88; this.match(DQLParser.IDENTIFIER); } } @@ -479,7 +477,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 91; + this.state = 90; _la = this.tokenStream.LA(1); if(!(_la === 12 || _la === 13)) { this.errorHandler.recoverInline(this); @@ -507,34 +505,34 @@ export class DQLParser extends antlr.Parser { let localContext = new ValueContext(this.context, this.state); this.enterRule(localContext, 24, DQLParser.RULE_value); try { - this.state = 97; + this.state = 96; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: this.enterOuterAlt(localContext, 1); { - this.state = 93; + this.state = 92; this.match(DQLParser.PHRASE); } break; case DQLParser.NUMBER: this.enterOuterAlt(localContext, 2); { - this.state = 94; + this.state = 93; this.match(DQLParser.NUMBER); } break; case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 3); { - this.state = 95; + this.state = 94; this.termSearch(); } break; case DQLParser.LPAREN: this.enterOuterAlt(localContext, 4); { - this.state = 96; + this.state = 95; this.groupExpression(); } break; @@ -562,7 +560,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 99; + this.state = 98; _la = this.tokenStream.LA(1); if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 240) !== 0))) { this.errorHandler.recoverInline(this); @@ -588,37 +586,37 @@ export class DQLParser extends antlr.Parser { } public static readonly _serializedATN: number[] = [ - 4,1,15,102,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,1,15,101,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, - 1,0,1,0,1,0,1,1,1,1,1,1,5,1,35,8,1,10,1,12,1,38,9,1,1,2,1,2,1,2, - 5,2,43,8,2,10,2,12,2,46,9,2,1,3,1,3,1,3,3,3,51,8,3,1,4,1,4,1,4,1, - 4,1,4,1,4,1,4,3,4,60,8,4,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,7,1,7, - 1,8,1,8,1,8,1,8,3,8,76,8,8,1,8,5,8,79,8,8,10,8,12,8,82,9,8,1,8,1, - 8,1,9,1,9,3,9,88,8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12,1,12,3,12, - 98,8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,14,16,18,20,22,24, - 26,0,3,1,0,1,2,1,0,12,13,1,0,4,7,99,0,28,1,0,0,0,2,31,1,0,0,0,4, - 39,1,0,0,0,6,50,1,0,0,0,8,59,1,0,0,0,10,61,1,0,0,0,12,65,1,0,0,0, - 14,69,1,0,0,0,16,71,1,0,0,0,18,87,1,0,0,0,20,89,1,0,0,0,22,91,1, - 0,0,0,24,97,1,0,0,0,26,99,1,0,0,0,28,29,3,2,1,0,29,30,5,0,0,1,30, - 1,1,0,0,0,31,36,3,4,2,0,32,33,5,1,0,0,33,35,3,4,2,0,34,32,1,0,0, - 0,35,38,1,0,0,0,36,34,1,0,0,0,36,37,1,0,0,0,37,3,1,0,0,0,38,36,1, - 0,0,0,39,44,3,6,3,0,40,41,5,2,0,0,41,43,3,6,3,0,42,40,1,0,0,0,43, - 46,1,0,0,0,44,42,1,0,0,0,44,45,1,0,0,0,45,5,1,0,0,0,46,44,1,0,0, - 0,47,48,5,3,0,0,48,51,3,6,3,0,49,51,3,8,4,0,50,47,1,0,0,0,50,49, - 1,0,0,0,51,7,1,0,0,0,52,53,5,9,0,0,53,54,3,0,0,0,54,55,5,10,0,0, - 55,60,1,0,0,0,56,60,3,10,5,0,57,60,3,12,6,0,58,60,3,14,7,0,59,52, - 1,0,0,0,59,56,1,0,0,0,59,57,1,0,0,0,59,58,1,0,0,0,60,9,1,0,0,0,61, - 62,3,20,10,0,62,63,3,26,13,0,63,64,3,22,11,0,64,11,1,0,0,0,65,66, - 3,20,10,0,66,67,5,8,0,0,67,68,3,24,12,0,68,13,1,0,0,0,69,70,5,14, - 0,0,70,15,1,0,0,0,71,72,5,9,0,0,72,80,3,18,9,0,73,75,7,0,0,0,74, - 76,5,3,0,0,75,74,1,0,0,0,75,76,1,0,0,0,76,77,1,0,0,0,77,79,3,18, - 9,0,78,73,1,0,0,0,79,82,1,0,0,0,80,78,1,0,0,0,80,81,1,0,0,0,81,83, - 1,0,0,0,82,80,1,0,0,0,83,84,5,10,0,0,84,17,1,0,0,0,85,88,3,16,8, - 0,86,88,3,14,7,0,87,85,1,0,0,0,87,86,1,0,0,0,88,19,1,0,0,0,89,90, - 5,14,0,0,90,21,1,0,0,0,91,92,7,1,0,0,92,23,1,0,0,0,93,98,5,12,0, - 0,94,98,5,13,0,0,95,98,3,14,7,0,96,98,3,16,8,0,97,93,1,0,0,0,97, - 94,1,0,0,0,97,95,1,0,0,0,97,96,1,0,0,0,98,25,1,0,0,0,99,100,7,2, - 0,0,100,27,1,0,0,0,8,36,44,50,59,75,80,87,97 + 1,0,1,0,1,1,1,1,1,1,5,1,34,8,1,10,1,12,1,37,9,1,1,2,1,2,1,2,5,2, + 42,8,2,10,2,12,2,45,9,2,1,3,1,3,1,3,3,3,50,8,3,1,4,1,4,1,4,1,4,1, + 4,1,4,1,4,3,4,59,8,4,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,7,1,7,1,8, + 1,8,1,8,1,8,3,8,75,8,8,1,8,5,8,78,8,8,10,8,12,8,81,9,8,1,8,1,8,1, + 9,1,9,3,9,87,8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12,1,12,3,12,97, + 8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,14,16,18,20,22,24,26, + 0,3,1,0,1,2,1,0,12,13,1,0,4,7,98,0,28,1,0,0,0,2,30,1,0,0,0,4,38, + 1,0,0,0,6,49,1,0,0,0,8,58,1,0,0,0,10,60,1,0,0,0,12,64,1,0,0,0,14, + 68,1,0,0,0,16,70,1,0,0,0,18,86,1,0,0,0,20,88,1,0,0,0,22,90,1,0,0, + 0,24,96,1,0,0,0,26,98,1,0,0,0,28,29,3,2,1,0,29,1,1,0,0,0,30,35,3, + 4,2,0,31,32,5,1,0,0,32,34,3,4,2,0,33,31,1,0,0,0,34,37,1,0,0,0,35, + 33,1,0,0,0,35,36,1,0,0,0,36,3,1,0,0,0,37,35,1,0,0,0,38,43,3,6,3, + 0,39,40,5,2,0,0,40,42,3,6,3,0,41,39,1,0,0,0,42,45,1,0,0,0,43,41, + 1,0,0,0,43,44,1,0,0,0,44,5,1,0,0,0,45,43,1,0,0,0,46,47,5,3,0,0,47, + 50,3,6,3,0,48,50,3,8,4,0,49,46,1,0,0,0,49,48,1,0,0,0,50,7,1,0,0, + 0,51,52,5,9,0,0,52,53,3,0,0,0,53,54,5,10,0,0,54,59,1,0,0,0,55,59, + 3,10,5,0,56,59,3,12,6,0,57,59,3,14,7,0,58,51,1,0,0,0,58,55,1,0,0, + 0,58,56,1,0,0,0,58,57,1,0,0,0,59,9,1,0,0,0,60,61,3,20,10,0,61,62, + 3,26,13,0,62,63,3,22,11,0,63,11,1,0,0,0,64,65,3,20,10,0,65,66,5, + 8,0,0,66,67,3,24,12,0,67,13,1,0,0,0,68,69,5,14,0,0,69,15,1,0,0,0, + 70,71,5,9,0,0,71,79,3,18,9,0,72,74,7,0,0,0,73,75,5,3,0,0,74,73,1, + 0,0,0,74,75,1,0,0,0,75,76,1,0,0,0,76,78,3,18,9,0,77,72,1,0,0,0,78, + 81,1,0,0,0,79,77,1,0,0,0,79,80,1,0,0,0,80,82,1,0,0,0,81,79,1,0,0, + 0,82,83,5,10,0,0,83,17,1,0,0,0,84,87,3,16,8,0,85,87,3,14,7,0,86, + 84,1,0,0,0,86,85,1,0,0,0,87,19,1,0,0,0,88,89,5,14,0,0,89,21,1,0, + 0,0,90,91,7,1,0,0,91,23,1,0,0,0,92,97,5,12,0,0,93,97,5,13,0,0,94, + 97,3,14,7,0,95,97,3,16,8,0,96,92,1,0,0,0,96,93,1,0,0,0,96,94,1,0, + 0,0,96,95,1,0,0,0,97,25,1,0,0,0,98,99,7,2,0,0,99,27,1,0,0,0,8,35, + 43,49,58,74,79,86,96 ]; private static __ATN: antlr.ATN; @@ -647,9 +645,6 @@ export class QueryContext extends antlr.ParserRuleContext { public orExpression(): OrExpressionContext { return this.getRuleContext(0, OrExpressionContext)!; } - public EOF(): antlr.TerminalNode { - return this.getToken(DQLParser.EOF, 0)!; - } public override get ruleIndex(): number { return DQLParser.RULE_query; } diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp index b9af1477ac89..99dca7502428 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -15,7 +15,6 @@ null null null null -null token symbolic names: null @@ -32,7 +31,6 @@ RPAREN DOT PHRASE NUMBER -DATESTRING IDENTIFIER WS @@ -54,4 +52,4 @@ comparisonOperator atn: -[4, 1, 16, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 35, 8, 1, 10, 1, 12, 1, 38, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 43, 8, 2, 10, 2, 12, 2, 46, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 51, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 60, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 76, 8, 8, 1, 8, 5, 8, 79, 8, 8, 10, 8, 12, 8, 82, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 88, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 31, 1, 0, 0, 0, 4, 39, 1, 0, 0, 0, 6, 50, 1, 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 61, 1, 0, 0, 0, 12, 65, 1, 0, 0, 0, 14, 69, 1, 0, 0, 0, 16, 71, 1, 0, 0, 0, 18, 87, 1, 0, 0, 0, 20, 89, 1, 0, 0, 0, 22, 91, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 30, 5, 0, 0, 1, 30, 1, 1, 0, 0, 0, 31, 36, 3, 4, 2, 0, 32, 33, 5, 1, 0, 0, 33, 35, 3, 4, 2, 0, 34, 32, 1, 0, 0, 0, 35, 38, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 36, 1, 0, 0, 0, 39, 44, 3, 6, 3, 0, 40, 41, 5, 2, 0, 0, 41, 43, 3, 6, 3, 0, 42, 40, 1, 0, 0, 0, 43, 46, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 5, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 47, 48, 5, 3, 0, 0, 48, 51, 3, 6, 3, 0, 49, 51, 3, 8, 4, 0, 50, 47, 1, 0, 0, 0, 50, 49, 1, 0, 0, 0, 51, 7, 1, 0, 0, 0, 52, 53, 5, 9, 0, 0, 53, 54, 3, 0, 0, 0, 54, 55, 5, 10, 0, 0, 55, 60, 1, 0, 0, 0, 56, 60, 3, 10, 5, 0, 57, 60, 3, 12, 6, 0, 58, 60, 3, 14, 7, 0, 59, 52, 1, 0, 0, 0, 59, 56, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 58, 1, 0, 0, 0, 60, 9, 1, 0, 0, 0, 61, 62, 3, 20, 10, 0, 62, 63, 3, 26, 13, 0, 63, 64, 3, 22, 11, 0, 64, 11, 1, 0, 0, 0, 65, 66, 3, 20, 10, 0, 66, 67, 5, 8, 0, 0, 67, 68, 3, 24, 12, 0, 68, 13, 1, 0, 0, 0, 69, 70, 5, 15, 0, 0, 70, 15, 1, 0, 0, 0, 71, 72, 5, 9, 0, 0, 72, 80, 3, 18, 9, 0, 73, 75, 7, 0, 0, 0, 74, 76, 5, 3, 0, 0, 75, 74, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 79, 3, 18, 9, 0, 78, 73, 1, 0, 0, 0, 79, 82, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 5, 10, 0, 0, 84, 17, 1, 0, 0, 0, 85, 88, 3, 16, 8, 0, 86, 88, 3, 14, 7, 0, 87, 85, 1, 0, 0, 0, 87, 86, 1, 0, 0, 0, 88, 19, 1, 0, 0, 0, 89, 90, 5, 15, 0, 0, 90, 21, 1, 0, 0, 0, 91, 92, 7, 1, 0, 0, 92, 23, 1, 0, 0, 0, 93, 98, 5, 12, 0, 0, 94, 98, 5, 13, 0, 0, 95, 98, 3, 14, 7, 0, 96, 98, 3, 16, 8, 0, 97, 93, 1, 0, 0, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 8, 36, 44, 50, 59, 75, 80, 87, 97] \ No newline at end of file +[4, 1, 15, 101, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 75, 8, 8, 1, 8, 5, 8, 78, 8, 8, 10, 8, 12, 8, 81, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 87, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 97, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 98, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 68, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 22, 90, 1, 0, 0, 0, 24, 96, 1, 0, 0, 0, 26, 98, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 66, 5, 8, 0, 0, 66, 67, 3, 24, 12, 0, 67, 13, 1, 0, 0, 0, 68, 69, 5, 14, 0, 0, 69, 15, 1, 0, 0, 0, 70, 71, 5, 9, 0, 0, 71, 79, 3, 18, 9, 0, 72, 74, 7, 0, 0, 0, 73, 75, 5, 3, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 3, 18, 9, 0, 77, 72, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 10, 0, 0, 83, 17, 1, 0, 0, 0, 84, 87, 3, 16, 8, 0, 85, 87, 3, 14, 7, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 19, 1, 0, 0, 0, 88, 89, 5, 14, 0, 0, 89, 21, 1, 0, 0, 0, 90, 91, 7, 1, 0, 0, 91, 23, 1, 0, 0, 0, 92, 97, 5, 12, 0, 0, 93, 97, 5, 13, 0, 0, 94, 97, 3, 14, 7, 0, 95, 97, 3, 16, 8, 0, 96, 92, 1, 0, 0, 0, 96, 93, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 25, 1, 0, 0, 0, 98, 99, 7, 2, 0, 0, 99, 27, 1, 0, 0, 0, 8, 35, 43, 49, 58, 74, 79, 86, 96] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index 1467436bd0e2..5ee1ae777d13 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -17,7 +17,7 @@ public class DQLParser extends Parser { new PredictionContextCache(); public static final int OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, - DOT=11, PHRASE=12, NUMBER=13, DATESTRING=14, IDENTIFIER=15, WS=16; + DOT=11, PHRASE=12, NUMBER=13, IDENTIFIER=14, WS=15; public static final int RULE_query = 0, RULE_orExpression = 1, RULE_andExpression = 2, RULE_notExpression = 3, RULE_primaryExpression = 4, RULE_comparisonExpression = 5, RULE_fieldExpression = 6, @@ -42,7 +42,7 @@ private static String[] makeLiteralNames() { private static String[] makeSymbolicNames() { return new String[] { null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "DOT", "PHRASE", "NUMBER", "DATESTRING", "IDENTIFIER", "WS" + "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); @@ -101,7 +101,6 @@ public static class QueryContext extends ParserRuleContext { public OrExpressionContext orExpression() { return getRuleContext(OrExpressionContext.class,0); } - public TerminalNode EOF() { return getToken(DQLParser.EOF, 0); } public QueryContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -116,8 +115,6 @@ public final QueryContext query() throws RecognitionException { { setState(28); orExpression(); - setState(29); - match(EOF); } } catch (RecognitionException re) { @@ -156,21 +153,21 @@ public final OrExpressionContext orExpression() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(31); + setState(30); andExpression(); - setState(36); + setState(35); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR) { { { - setState(32); + setState(31); match(OR); - setState(33); + setState(32); andExpression(); } } - setState(38); + setState(37); _errHandler.sync(this); _la = _input.LA(1); } @@ -212,21 +209,21 @@ public final AndExpressionContext andExpression() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(39); + setState(38); notExpression(); - setState(44); + setState(43); _errHandler.sync(this); _la = _input.LA(1); while (_la==AND) { { { - setState(40); + setState(39); match(AND); - setState(41); + setState(40); notExpression(); } } - setState(46); + setState(45); _errHandler.sync(this); _la = _input.LA(1); } @@ -262,15 +259,15 @@ public final NotExpressionContext notExpression() throws RecognitionException { NotExpressionContext _localctx = new NotExpressionContext(_ctx, getState()); enterRule(_localctx, 6, RULE_notExpression); try { - setState(50); + setState(49); _errHandler.sync(this); switch (_input.LA(1)) { case NOT: enterOuterAlt(_localctx, 1); { - setState(47); + setState(46); match(NOT); - setState(48); + setState(47); notExpression(); } break; @@ -278,7 +275,7 @@ public final NotExpressionContext notExpression() throws RecognitionException { case IDENTIFIER: enterOuterAlt(_localctx, 2); { - setState(49); + setState(48); primaryExpression(); } break; @@ -323,38 +320,38 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState()); enterRule(_localctx, 8, RULE_primaryExpression); try { - setState(59); + setState(58); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(52); + setState(51); match(LPAREN); - setState(53); + setState(52); query(); - setState(54); + setState(53); match(RPAREN); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(56); + setState(55); comparisonExpression(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(57); + setState(56); fieldExpression(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(58); + setState(57); termSearch(); } break; @@ -394,11 +391,11 @@ public final ComparisonExpressionContext comparisonExpression() throws Recogniti try { enterOuterAlt(_localctx, 1); { - setState(61); + setState(60); field(); - setState(62); + setState(61); comparisonOperator(); - setState(63); + setState(62); rangeValue(); } } @@ -434,11 +431,11 @@ public final FieldExpressionContext fieldExpression() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(65); + setState(64); field(); - setState(66); + setState(65); match(EQ); - setState(67); + setState(66); value(); } } @@ -468,7 +465,7 @@ public final TermSearchContext termSearch() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(69); + setState(68); match(IDENTIFIER); } } @@ -518,17 +515,17 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(71); + setState(70); match(LPAREN); - setState(72); + setState(71); groupContent(); - setState(80); + setState(79); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR || _la==AND) { { { - setState(73); + setState(72); _la = _input.LA(1); if ( !(_la==OR || _la==AND) ) { _errHandler.recoverInline(this); @@ -539,26 +536,26 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio consume(); } { - setState(75); + setState(74); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(74); + setState(73); match(NOT); } } } - setState(77); + setState(76); groupContent(); } } - setState(82); + setState(81); _errHandler.sync(this); _la = _input.LA(1); } - setState(83); + setState(82); match(RPAREN); } } @@ -591,20 +588,20 @@ public final GroupContentContext groupContent() throws RecognitionException { GroupContentContext _localctx = new GroupContentContext(_ctx, getState()); enterRule(_localctx, 18, RULE_groupContent); try { - setState(87); + setState(86); _errHandler.sync(this); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(85); + setState(84); groupExpression(); } break; case IDENTIFIER: enterOuterAlt(_localctx, 2); { - setState(86); + setState(85); termSearch(); } break; @@ -638,7 +635,7 @@ public final FieldContext field() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(89); + setState(88); match(IDENTIFIER); } } @@ -670,7 +667,7 @@ public final RangeValueContext rangeValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(91); + setState(90); _la = _input.LA(1); if ( !(_la==PHRASE || _la==NUMBER) ) { _errHandler.recoverInline(this); @@ -713,34 +710,34 @@ public final ValueContext value() throws RecognitionException { ValueContext _localctx = new ValueContext(_ctx, getState()); enterRule(_localctx, 24, RULE_value); try { - setState(97); + setState(96); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: enterOuterAlt(_localctx, 1); { - setState(93); + setState(92); match(PHRASE); } break; case NUMBER: enterOuterAlt(_localctx, 2); { - setState(94); + setState(93); match(NUMBER); } break; case IDENTIFIER: enterOuterAlt(_localctx, 3); { - setState(95); + setState(94); termSearch(); } break; case LPAREN: enterOuterAlt(_localctx, 4); { - setState(96); + setState(95); groupExpression(); } break; @@ -778,7 +775,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(99); + setState(98); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 240L) != 0)) ) { _errHandler.recoverInline(this); @@ -802,61 +799,60 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx } public static final String _serializedATN = - "\u0004\u0001\u0010f\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u0001\u000fe\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ - "\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001"+ - "\u0001\u0001\u0001\u0001\u0005\u0001#\b\u0001\n\u0001\f\u0001&\t\u0001"+ - "\u0001\u0002\u0001\u0002\u0001\u0002\u0005\u0002+\b\u0002\n\u0002\f\u0002"+ - ".\t\u0002\u0001\u0003\u0001\u0003\u0001\u0003\u0003\u00033\b\u0003\u0001"+ - "\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001"+ - "\u0004\u0003\u0004<\b\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+ - "\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001"+ - "\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bL\b\b\u0001\b\u0005\bO\b"+ - "\b\n\b\f\bR\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\tX\b\t\u0001\n\u0001"+ - "\n\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0003\fb\b"+ - "\f\u0001\r\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002\u0004\u0006\b"+ - "\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003\u0001\u0000"+ - "\u0001\u0002\u0001\u0000\f\r\u0001\u0000\u0004\u0007c\u0000\u001c\u0001"+ - "\u0000\u0000\u0000\u0002\u001f\u0001\u0000\u0000\u0000\u0004\'\u0001\u0000"+ - "\u0000\u0000\u00062\u0001\u0000\u0000\u0000\b;\u0001\u0000\u0000\u0000"+ - "\n=\u0001\u0000\u0000\u0000\fA\u0001\u0000\u0000\u0000\u000eE\u0001\u0000"+ - "\u0000\u0000\u0010G\u0001\u0000\u0000\u0000\u0012W\u0001\u0000\u0000\u0000"+ - "\u0014Y\u0001\u0000\u0000\u0000\u0016[\u0001\u0000\u0000\u0000\u0018a"+ - "\u0001\u0000\u0000\u0000\u001ac\u0001\u0000\u0000\u0000\u001c\u001d\u0003"+ - "\u0002\u0001\u0000\u001d\u001e\u0005\u0000\u0000\u0001\u001e\u0001\u0001"+ - "\u0000\u0000\u0000\u001f$\u0003\u0004\u0002\u0000 !\u0005\u0001\u0000"+ - "\u0000!#\u0003\u0004\u0002\u0000\" \u0001\u0000\u0000\u0000#&\u0001\u0000"+ - "\u0000\u0000$\"\u0001\u0000\u0000\u0000$%\u0001\u0000\u0000\u0000%\u0003"+ - "\u0001\u0000\u0000\u0000&$\u0001\u0000\u0000\u0000\',\u0003\u0006\u0003"+ - "\u0000()\u0005\u0002\u0000\u0000)+\u0003\u0006\u0003\u0000*(\u0001\u0000"+ - "\u0000\u0000+.\u0001\u0000\u0000\u0000,*\u0001\u0000\u0000\u0000,-\u0001"+ - "\u0000\u0000\u0000-\u0005\u0001\u0000\u0000\u0000.,\u0001\u0000\u0000"+ - "\u0000/0\u0005\u0003\u0000\u000003\u0003\u0006\u0003\u000013\u0003\b\u0004"+ - "\u00002/\u0001\u0000\u0000\u000021\u0001\u0000\u0000\u00003\u0007\u0001"+ - "\u0000\u0000\u000045\u0005\t\u0000\u000056\u0003\u0000\u0000\u000067\u0005"+ - "\n\u0000\u00007<\u0001\u0000\u0000\u00008<\u0003\n\u0005\u00009<\u0003"+ - "\f\u0006\u0000:<\u0003\u000e\u0007\u0000;4\u0001\u0000\u0000\u0000;8\u0001"+ - "\u0000\u0000\u0000;9\u0001\u0000\u0000\u0000;:\u0001\u0000\u0000\u0000"+ - "<\t\u0001\u0000\u0000\u0000=>\u0003\u0014\n\u0000>?\u0003\u001a\r\u0000"+ - "?@\u0003\u0016\u000b\u0000@\u000b\u0001\u0000\u0000\u0000AB\u0003\u0014"+ - "\n\u0000BC\u0005\b\u0000\u0000CD\u0003\u0018\f\u0000D\r\u0001\u0000\u0000"+ - "\u0000EF\u0005\u000f\u0000\u0000F\u000f\u0001\u0000\u0000\u0000GH\u0005"+ - "\t\u0000\u0000HP\u0003\u0012\t\u0000IK\u0007\u0000\u0000\u0000JL\u0005"+ - "\u0003\u0000\u0000KJ\u0001\u0000\u0000\u0000KL\u0001\u0000\u0000\u0000"+ - "LM\u0001\u0000\u0000\u0000MO\u0003\u0012\t\u0000NI\u0001\u0000\u0000\u0000"+ - "OR\u0001\u0000\u0000\u0000PN\u0001\u0000\u0000\u0000PQ\u0001\u0000\u0000"+ - "\u0000QS\u0001\u0000\u0000\u0000RP\u0001\u0000\u0000\u0000ST\u0005\n\u0000"+ - "\u0000T\u0011\u0001\u0000\u0000\u0000UX\u0003\u0010\b\u0000VX\u0003\u000e"+ - "\u0007\u0000WU\u0001\u0000\u0000\u0000WV\u0001\u0000\u0000\u0000X\u0013"+ - "\u0001\u0000\u0000\u0000YZ\u0005\u000f\u0000\u0000Z\u0015\u0001\u0000"+ - "\u0000\u0000[\\\u0007\u0001\u0000\u0000\\\u0017\u0001\u0000\u0000\u0000"+ - "]b\u0005\f\u0000\u0000^b\u0005\r\u0000\u0000_b\u0003\u000e\u0007\u0000"+ - "`b\u0003\u0010\b\u0000a]\u0001\u0000\u0000\u0000a^\u0001\u0000\u0000\u0000"+ - "a_\u0001\u0000\u0000\u0000a`\u0001\u0000\u0000\u0000b\u0019\u0001\u0000"+ - "\u0000\u0000cd\u0007\u0002\u0000\u0000d\u001b\u0001\u0000\u0000\u0000"+ - "\b$,2;KPWa"; + "\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001"+ + "\u0001\u0001\u0005\u0001\"\b\u0001\n\u0001\f\u0001%\t\u0001\u0001\u0002"+ + "\u0001\u0002\u0001\u0002\u0005\u0002*\b\u0002\n\u0002\f\u0002-\t\u0002"+ + "\u0001\u0003\u0001\u0003\u0001\u0003\u0003\u00032\b\u0003\u0001\u0004"+ + "\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+ + "\u0003\u0004;\b\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005"+ + "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007"+ + "\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bK\b\b\u0001\b\u0005\bN\b\b\n\b"+ + "\f\bQ\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\tW\b\t\u0001\n\u0001\n"+ + "\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0003\fa\b\f"+ + "\u0001\r\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002\u0004\u0006\b\n"+ + "\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003\u0001\u0000\u0001"+ + "\u0002\u0001\u0000\f\r\u0001\u0000\u0004\u0007b\u0000\u001c\u0001\u0000"+ + "\u0000\u0000\u0002\u001e\u0001\u0000\u0000\u0000\u0004&\u0001\u0000\u0000"+ + "\u0000\u00061\u0001\u0000\u0000\u0000\b:\u0001\u0000\u0000\u0000\n<\u0001"+ + "\u0000\u0000\u0000\f@\u0001\u0000\u0000\u0000\u000eD\u0001\u0000\u0000"+ + "\u0000\u0010F\u0001\u0000\u0000\u0000\u0012V\u0001\u0000\u0000\u0000\u0014"+ + "X\u0001\u0000\u0000\u0000\u0016Z\u0001\u0000\u0000\u0000\u0018`\u0001"+ + "\u0000\u0000\u0000\u001ab\u0001\u0000\u0000\u0000\u001c\u001d\u0003\u0002"+ + "\u0001\u0000\u001d\u0001\u0001\u0000\u0000\u0000\u001e#\u0003\u0004\u0002"+ + "\u0000\u001f \u0005\u0001\u0000\u0000 \"\u0003\u0004\u0002\u0000!\u001f"+ + "\u0001\u0000\u0000\u0000\"%\u0001\u0000\u0000\u0000#!\u0001\u0000\u0000"+ + "\u0000#$\u0001\u0000\u0000\u0000$\u0003\u0001\u0000\u0000\u0000%#\u0001"+ + "\u0000\u0000\u0000&+\u0003\u0006\u0003\u0000\'(\u0005\u0002\u0000\u0000"+ + "(*\u0003\u0006\u0003\u0000)\'\u0001\u0000\u0000\u0000*-\u0001\u0000\u0000"+ + "\u0000+)\u0001\u0000\u0000\u0000+,\u0001\u0000\u0000\u0000,\u0005\u0001"+ + "\u0000\u0000\u0000-+\u0001\u0000\u0000\u0000./\u0005\u0003\u0000\u0000"+ + "/2\u0003\u0006\u0003\u000002\u0003\b\u0004\u00001.\u0001\u0000\u0000\u0000"+ + "10\u0001\u0000\u0000\u00002\u0007\u0001\u0000\u0000\u000034\u0005\t\u0000"+ + "\u000045\u0003\u0000\u0000\u000056\u0005\n\u0000\u00006;\u0001\u0000\u0000"+ + "\u00007;\u0003\n\u0005\u00008;\u0003\f\u0006\u00009;\u0003\u000e\u0007"+ + "\u0000:3\u0001\u0000\u0000\u0000:7\u0001\u0000\u0000\u0000:8\u0001\u0000"+ + "\u0000\u0000:9\u0001\u0000\u0000\u0000;\t\u0001\u0000\u0000\u0000<=\u0003"+ + "\u0014\n\u0000=>\u0003\u001a\r\u0000>?\u0003\u0016\u000b\u0000?\u000b"+ + "\u0001\u0000\u0000\u0000@A\u0003\u0014\n\u0000AB\u0005\b\u0000\u0000B"+ + "C\u0003\u0018\f\u0000C\r\u0001\u0000\u0000\u0000DE\u0005\u000e\u0000\u0000"+ + "E\u000f\u0001\u0000\u0000\u0000FG\u0005\t\u0000\u0000GO\u0003\u0012\t"+ + "\u0000HJ\u0007\u0000\u0000\u0000IK\u0005\u0003\u0000\u0000JI\u0001\u0000"+ + "\u0000\u0000JK\u0001\u0000\u0000\u0000KL\u0001\u0000\u0000\u0000LN\u0003"+ + "\u0012\t\u0000MH\u0001\u0000\u0000\u0000NQ\u0001\u0000\u0000\u0000OM\u0001"+ + "\u0000\u0000\u0000OP\u0001\u0000\u0000\u0000PR\u0001\u0000\u0000\u0000"+ + "QO\u0001\u0000\u0000\u0000RS\u0005\n\u0000\u0000S\u0011\u0001\u0000\u0000"+ + "\u0000TW\u0003\u0010\b\u0000UW\u0003\u000e\u0007\u0000VT\u0001\u0000\u0000"+ + "\u0000VU\u0001\u0000\u0000\u0000W\u0013\u0001\u0000\u0000\u0000XY\u0005"+ + "\u000e\u0000\u0000Y\u0015\u0001\u0000\u0000\u0000Z[\u0007\u0001\u0000"+ + "\u0000[\u0017\u0001\u0000\u0000\u0000\\a\u0005\f\u0000\u0000]a\u0005\r"+ + "\u0000\u0000^a\u0003\u000e\u0007\u0000_a\u0003\u0010\b\u0000`\\\u0001"+ + "\u0000\u0000\u0000`]\u0001\u0000\u0000\u0000`^\u0001\u0000\u0000\u0000"+ + "`_\u0001\u0000\u0000\u0000a\u0019\u0001\u0000\u0000\u0000bc\u0007\u0002"+ + "\u0000\u0000c\u001b\u0001\u0000\u0000\u0000\b#+1:JOV`"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens index 00fa5d537f7b..3210060bf7d1 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens @@ -11,9 +11,8 @@ RPAREN=10 DOT=11 PHRASE=12 NUMBER=13 -DATESTRING=14 -IDENTIFIER=15 -WS=16 +IDENTIFIER=14 +WS=15 '>'=4 '<'=5 '>='=6 diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index 6a94185e28cf..6e9d5ff01b7e 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -4,7 +4,7 @@ options { tokenVocab = DQLLexer; } -query: orExpression EOF; +query: orExpression; orExpression: andExpression (OR andExpression)*; andExpression: notExpression (AND notExpression)*; notExpression: NOT notExpression | primaryExpression; From c8ad399115a1fef4c58ff0c06b4a1719f687f3c8 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Fri, 12 Jul 2024 18:51:46 -0700 Subject: [PATCH 04/34] use custom version of cursor token index for dql Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 60 ++++++++++++++++--- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index c9ee422d9643..5aff0c93c815 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,14 +1,53 @@ -import { CharStream, CommonTokenStream } from 'antlr4ng'; +import { CharStream, CommonTokenStream, TokenStream, Trees } from 'antlr4ng'; import { DQLLexer } from './generated/DQLLexer'; -import { DQLParser, FieldContext } from './generated/DQLParser'; -import { DQLParserVisitor } from './generated/DQLParserVisitor'; +import { DQLParser } from './generated/DQLParser'; import { CodeCompletionCore } from 'antlr4-c3'; -import { findCursorTokenIndex } from '../opensearch_sql/cursor'; -import { QuerySuggestion, QuerySuggestionField } from '../../autocomplete'; +import { getTokenPosition } from '../opensearch_sql/cursor'; +import { IndexPatternField } from '../../index_patterns'; +import { CursorPosition } from '../opensearch_sql/types'; + +// const validField = (idxPatField: IndexPatternField) => { +// return idxPatField.aggregatable || +// } + +const findCursorIndex = ( + tokenStream: TokenStream, + cursor: CursorPosition, + whitespaceToken: number, + actualIndex?: boolean +): number | undefined => { + const cursorCol = cursor.column - 1; + + for (let i = 0; i < tokenStream.size; i++) { + const token = tokenStream.get(i); + console.log('token:', token); + const { startLine, endColumn, endLine } = getTokenPosition(token, whitespaceToken); + + // endColumn makes sense only if startLine === endLine + if (endLine > cursor.line || (startLine === cursor.line && endColumn > cursorCol)) { + if (actualIndex) { + return i; + } + + if (tokenStream.get(i).type === whitespaceToken) { + return i + 1; + } + return i; + } + } + + return undefined; +}; const findFieldSuggestions = (indexPatterns) => { + // console.log( + // indexPatterns[0].fields + // .getAll() + // .filter((idxPatField: IndexPatternField) => !idxPatField.subType) + // ); const fieldNames: string[] = indexPatterns[0].fields - .filter((idxField: { readFromDocValues: boolean }) => idxField.readFromDocValues) + .getAll() + .filter((idxField: IndexPatternField) => !idxField.subType) .map((idxField: { displayName: string }) => { return idxField.displayName; }); @@ -31,11 +70,13 @@ export const getSuggestions = async ({ const lexer = new DQLLexer(inputStream); const tokenStream = new CommonTokenStream(lexer); const parser = new DQLParser(tokenStream); - const tree = parser.query(); + const tree = parser.query(); // used to check if parsing is happening properly // find token index const cursorIndex = - findCursorTokenIndex(tokenStream, { line: 1, column: selectionStart }, DQLParser.WS) ?? 0; + findCursorIndex(tokenStream, { line: 1, column: selectionStart }, DQLParser.WS) ?? 0; + + console.log('cursor index:', cursorIndex); const core = new CodeCompletionCore(parser); @@ -59,6 +100,7 @@ export const getSuggestions = async ({ // gets candidates at specified token index const candidates = core.collectCandidates(cursorIndex); + console.log('candidates', candidates); let completions = []; @@ -78,5 +120,7 @@ export const getSuggestions = async ({ completions.push({ text: tokenSymbolName, type: 'function' }); }); + console.log('completions', completions); + return completions; }; From 4d449b89d8964ced942a69069ef48ec6e31efac9 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Mon, 15 Jul 2024 12:44:32 -0700 Subject: [PATCH 05/34] implemented value suggestions based on field Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 84 +++++++++++++------ src/plugins/data/public/plugin.ts | 2 + src/plugins/data/public/services.ts | 2 + .../public/ui/query_editor/query_editor.tsx | 2 + 4 files changed, 65 insertions(+), 25 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 5aff0c93c815..6d08b188d060 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,14 +1,12 @@ -import { CharStream, CommonTokenStream, TokenStream, Trees } from 'antlr4ng'; +import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; import { DQLLexer } from './generated/DQLLexer'; -import { DQLParser } from './generated/DQLParser'; +import { DQLParser, FieldContext } from './generated/DQLParser'; import { CodeCompletionCore } from 'antlr4-c3'; import { getTokenPosition } from '../opensearch_sql/cursor'; -import { IndexPatternField } from '../../index_patterns'; +import { IndexPattern, IndexPatternField } from '../../index_patterns'; import { CursorPosition } from '../opensearch_sql/types'; - -// const validField = (idxPatField: IndexPatternField) => { -// return idxPatField.aggregatable || -// } +import { getHttp } from '../../services'; +import { DQLParserListener } from './generated/DQLParserListener'; const findCursorIndex = ( tokenStream: TokenStream, @@ -20,7 +18,7 @@ const findCursorIndex = ( for (let i = 0; i < tokenStream.size; i++) { const token = tokenStream.get(i); - console.log('token:', token); + // console.log('token:', token); const { startLine, endColumn, endLine } = getTokenPosition(token, whitespaceToken); // endColumn makes sense only if startLine === endLine @@ -39,13 +37,8 @@ const findCursorIndex = ( return undefined; }; -const findFieldSuggestions = (indexPatterns) => { - // console.log( - // indexPatterns[0].fields - // .getAll() - // .filter((idxPatField: IndexPatternField) => !idxPatField.subType) - // ); - const fieldNames: string[] = indexPatterns[0].fields +const findFieldSuggestions = (indexPattern: IndexPattern) => { + const fieldNames: string[] = indexPattern.fields .getAll() .filter((idxField: IndexPatternField) => !idxField.subType) .map((idxField: { displayName: string }) => { @@ -53,12 +46,20 @@ const findFieldSuggestions = (indexPatterns) => { }); const fieldSuggestions: { text: string; type: string }[] = fieldNames.map((field: string) => { - return { text: field, type: 'text' }; + return { text: field, type: 'field' }; }); return fieldSuggestions; }; +const findValuesFromField = async (indexTitle: string, fieldName: string) => { + const http = getHttp(); + return await http.fetch(`/api/opensearch-dashboards/suggestions/values/${indexTitle}`, { + method: 'POST', + body: JSON.stringify({ query: '', field: fieldName, boolFilter: [] }), + }); +}; + export const getSuggestions = async ({ selectionStart, selectionEnd, @@ -66,17 +67,41 @@ export const getSuggestions = async ({ language, indexPatterns, }) => { + const currentIndexPattern: IndexPattern = indexPatterns[0]; + const inputStream = CharStream.fromString(query); const lexer = new DQLLexer(inputStream); const tokenStream = new CommonTokenStream(lexer); const parser = new DQLParser(tokenStream); - const tree = parser.query(); // used to check if parsing is happening properly + // const tree = parser.query(); // used to check if parsing is happening properly + + // listener for parsing the current query + class FieldListener extends DQLParserListener { + lastField: string | undefined; + + constructor() { + super(); + this.lastField; + } + + public enterField = (ctx: FieldContext) => { + this.lastField = ctx.start?.text; + }; + + getLastField() { + return this.lastField; + } + } + + const listener = new FieldListener(); + parser.addParseListener(listener); + parser.query(); // find token index const cursorIndex = findCursorIndex(tokenStream, { line: 1, column: selectionStart }, DQLParser.WS) ?? 0; - console.log('cursor index:', cursorIndex); + // console.log('cursor index:', cursorIndex); const core = new CodeCompletionCore(parser); @@ -85,7 +110,6 @@ export const getSuggestions = async ({ // specify tokens to ignore core.ignoredTokens = new Set([ - DQLParser.EOF, DQLParser.LPAREN, DQLParser.RPAREN, DQLParser.DOT, @@ -95,32 +119,42 @@ export const getSuggestions = async ({ DQLParser.LE, DQLParser.LT, DQLParser.NUMBER, - DQLParser.PHRASE, ]); // gets candidates at specified token index const candidates = core.collectCandidates(cursorIndex); - console.log('candidates', candidates); + // console.log('candidates', candidates); let completions = []; // check to see if field rule is a candidate. if so, suggest field names if (candidates.rules.has(DQLParser.RULE_field)) { - completions.push(...findFieldSuggestions(indexPatterns)); + completions.push(...findFieldSuggestions(currentIndexPattern)); + } + + const lastField = listener.getLastField(); + if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { + const values = await findValuesFromField(currentIndexPattern.title, lastField); + console.log(values); + completions.push( + ...values.map((val: any) => { + return { text: val, type: 'value' }; + }) + ); } // suggest other candidates, mainly keywords [...candidates.tokens.keys()].forEach((token: number) => { // ignore identifier, already handled with field rule - if (token === DQLParser.IDENTIFIER) { + if (token === DQLParser.IDENTIFIER || token === DQLParser.PHRASE) { return; } const tokenSymbolName = parser.vocabulary.getSymbolicName(token)?.toLowerCase(); - completions.push({ text: tokenSymbolName, type: 'function' }); + completions.push({ text: tokenSymbolName, type: 'keyword' }); }); - console.log('completions', completions); + // console.log('completions', completions); return completions; }; diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index ba32243412df..c1adc7df9f37 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -58,6 +58,7 @@ import { } from './index_patterns'; import { setFieldFormats, + setHttp, setIndexPatterns, setNotifications, setOverlays, @@ -191,6 +192,7 @@ export class DataPublicPlugin setNotifications(notifications); setOverlays(overlays); setUiSettings(uiSettings); + setHttp(http); const fieldFormats = this.fieldFormatsService.start(); setFieldFormats(fieldFormats); diff --git a/src/plugins/data/public/services.ts b/src/plugins/data/public/services.ts index d75dab2986ca..8cf42862c4d4 100644 --- a/src/plugins/data/public/services.ts +++ b/src/plugins/data/public/services.ts @@ -42,6 +42,8 @@ export const [getUiSettings, setUiSettings] = createGetterSetter('Http'); + export const [getFieldFormats, setFieldFormats] = createGetterSetter( 'FieldFormats' ); diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index 0c5ca046c497..adccf7a1f46b 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -298,6 +298,8 @@ export default class QueryEditorUI extends Component { return monaco.languages.CompletionItemKind.Field; case 'value': return monaco.languages.CompletionItemKind.Value; + case 'keyword': + return monaco.languages.CompletionItemKind.Keyword; default: return monaco.languages.CompletionItemKind.Text; } From 66bc42b5ab12b25a96868af1b31801795bb30c55 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Mon, 15 Jul 2024 12:48:48 -0700 Subject: [PATCH 06/34] set param type Signed-off-by: Paul Sebastian --- src/plugins/data/public/antlr/dql/code_completion.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 6d08b188d060..2602d8b69742 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -7,6 +7,7 @@ import { IndexPattern, IndexPatternField } from '../../index_patterns'; import { CursorPosition } from '../opensearch_sql/types'; import { getHttp } from '../../services'; import { DQLParserListener } from './generated/DQLParserListener'; +import { QuerySuggestionGetFnArgs } from '../../autocomplete'; const findCursorIndex = ( tokenStream: TokenStream, @@ -66,8 +67,8 @@ export const getSuggestions = async ({ query, language, indexPatterns, -}) => { - const currentIndexPattern: IndexPattern = indexPatterns[0]; +}: QuerySuggestionGetFnArgs) => { + const currentIndexPattern = indexPatterns[0] as IndexPattern; const inputStream = CharStream.fromString(query); const lexer = new DQLLexer(inputStream); From 20e0e47bc5ff103b10e7cfbd726c8abc49aa510b Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Wed, 17 Jul 2024 09:58:37 -0700 Subject: [PATCH 07/34] update grouping grammar Signed-off-by: Paul Sebastian --- .../antlr/dql/generated/DQLParser.interp | 2 +- .../public/antlr/dql/generated/DQLParser.ts | 143 +++++++------- .../antlr/dql/grammar/.antlr/DQLParser.interp | 2 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 174 ++++++++++-------- .../public/antlr/dql/grammar/DQLParser.g4 | 6 +- 5 files changed, 177 insertions(+), 150 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp index 99dca7502428..243a73d55843 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp @@ -52,4 +52,4 @@ comparisonOperator atn: -[4, 1, 15, 101, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 75, 8, 8, 1, 8, 5, 8, 78, 8, 8, 10, 8, 12, 8, 81, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 87, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 97, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 98, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 68, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 22, 90, 1, 0, 0, 0, 24, 96, 1, 0, 0, 0, 26, 98, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 66, 5, 8, 0, 0, 66, 67, 3, 24, 12, 0, 67, 13, 1, 0, 0, 0, 68, 69, 5, 14, 0, 0, 69, 15, 1, 0, 0, 0, 70, 71, 5, 9, 0, 0, 71, 79, 3, 18, 9, 0, 72, 74, 7, 0, 0, 0, 73, 75, 5, 3, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 3, 18, 9, 0, 77, 72, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 10, 0, 0, 83, 17, 1, 0, 0, 0, 84, 87, 3, 16, 8, 0, 85, 87, 3, 14, 7, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 19, 1, 0, 0, 0, 88, 89, 5, 14, 0, 0, 89, 21, 1, 0, 0, 0, 90, 91, 7, 1, 0, 0, 91, 23, 1, 0, 0, 0, 92, 97, 5, 12, 0, 0, 93, 97, 5, 13, 0, 0, 94, 97, 3, 14, 7, 0, 95, 97, 3, 16, 8, 0, 96, 92, 1, 0, 0, 0, 96, 93, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 25, 1, 0, 0, 0, 98, 99, 7, 2, 0, 0, 99, 27, 1, 0, 0, 0, 8, 35, 43, 49, 58, 74, 79, 86, 96] \ No newline at end of file +[4, 1, 15, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 69, 8, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 77, 8, 8, 1, 8, 5, 8, 80, 8, 8, 10, 8, 12, 8, 83, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 89, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 70, 1, 0, 0, 0, 16, 72, 1, 0, 0, 0, 18, 88, 1, 0, 0, 0, 20, 90, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 68, 5, 8, 0, 0, 66, 69, 3, 24, 12, 0, 67, 69, 3, 16, 8, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 13, 1, 0, 0, 0, 70, 71, 5, 14, 0, 0, 71, 15, 1, 0, 0, 0, 72, 73, 5, 9, 0, 0, 73, 81, 3, 18, 9, 0, 74, 76, 7, 0, 0, 0, 75, 77, 5, 3, 0, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 3, 18, 9, 0, 79, 74, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 85, 5, 10, 0, 0, 85, 17, 1, 0, 0, 0, 86, 89, 3, 16, 8, 0, 87, 89, 3, 24, 12, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 19, 1, 0, 0, 0, 90, 91, 5, 14, 0, 0, 91, 21, 1, 0, 0, 0, 92, 93, 7, 1, 0, 0, 93, 23, 1, 0, 0, 0, 94, 98, 5, 12, 0, 0, 95, 98, 5, 13, 0, 0, 96, 98, 3, 14, 7, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 9, 35, 43, 49, 58, 68, 76, 81, 88, 97] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts index d8adfdfe4853..f943fd73555e 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts @@ -306,8 +306,26 @@ export class DQLParser extends antlr.Parser { this.field(); this.state = 65; this.match(DQLParser.EQ); - this.state = 66; - this.value(); + this.state = 68; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case DQLParser.PHRASE: + case DQLParser.NUMBER: + case DQLParser.IDENTIFIER: + { + this.state = 66; + this.value(); + } + break; + case DQLParser.LPAREN: + { + this.state = 67; + this.groupExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } } } catch (re) { @@ -329,7 +347,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 68; + this.state = 70; this.match(DQLParser.IDENTIFIER); } } @@ -353,17 +371,17 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 70; + this.state = 72; this.match(DQLParser.LPAREN); - this.state = 71; + this.state = 73; this.groupContent(); - this.state = 79; + this.state = 81; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1 || _la === 2) { { { - this.state = 72; + this.state = 74; _la = this.tokenStream.LA(1); if(!(_la === 1 || _la === 2)) { this.errorHandler.recoverInline(this); @@ -373,26 +391,26 @@ export class DQLParser extends antlr.Parser { this.consume(); } { - this.state = 74; + this.state = 76; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 3) { { - this.state = 73; + this.state = 75; this.match(DQLParser.NOT); } } } - this.state = 76; + this.state = 78; this.groupContent(); } } - this.state = 81; + this.state = 83; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 82; + this.state = 84; this.match(DQLParser.RPAREN); } } @@ -413,21 +431,23 @@ export class DQLParser extends antlr.Parser { let localContext = new GroupContentContext(this.context, this.state); this.enterRule(localContext, 18, DQLParser.RULE_groupContent); try { - this.state = 86; + this.state = 88; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.LPAREN: this.enterOuterAlt(localContext, 1); { - this.state = 84; + this.state = 86; this.groupExpression(); } break; + case DQLParser.PHRASE: + case DQLParser.NUMBER: case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 2); { - this.state = 85; - this.termSearch(); + this.state = 87; + this.value(); } break; default: @@ -453,7 +473,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 88; + this.state = 90; this.match(DQLParser.IDENTIFIER); } } @@ -477,7 +497,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 90; + this.state = 92; _la = this.tokenStream.LA(1); if(!(_la === 12 || _la === 13)) { this.errorHandler.recoverInline(this); @@ -505,37 +525,30 @@ export class DQLParser extends antlr.Parser { let localContext = new ValueContext(this.context, this.state); this.enterRule(localContext, 24, DQLParser.RULE_value); try { - this.state = 96; + this.state = 97; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: this.enterOuterAlt(localContext, 1); { - this.state = 92; + this.state = 94; this.match(DQLParser.PHRASE); } break; case DQLParser.NUMBER: this.enterOuterAlt(localContext, 2); { - this.state = 93; + this.state = 95; this.match(DQLParser.NUMBER); } break; case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 3); { - this.state = 94; + this.state = 96; this.termSearch(); } break; - case DQLParser.LPAREN: - this.enterOuterAlt(localContext, 4); - { - this.state = 95; - this.groupExpression(); - } - break; default: throw new antlr.NoViableAltException(this); } @@ -560,7 +573,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 98; + this.state = 99; _la = this.tokenStream.LA(1); if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 240) !== 0))) { this.errorHandler.recoverInline(this); @@ -586,37 +599,37 @@ export class DQLParser extends antlr.Parser { } public static readonly _serializedATN: number[] = [ - 4,1,15,101,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,1,15,102,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, 1,0,1,0,1,1,1,1,1,1,5,1,34,8,1,10,1,12,1,37,9,1,1,2,1,2,1,2,5,2, 42,8,2,10,2,12,2,45,9,2,1,3,1,3,1,3,3,3,50,8,3,1,4,1,4,1,4,1,4,1, - 4,1,4,1,4,3,4,59,8,4,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,7,1,7,1,8, - 1,8,1,8,1,8,3,8,75,8,8,1,8,5,8,78,8,8,10,8,12,8,81,9,8,1,8,1,8,1, - 9,1,9,3,9,87,8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12,1,12,3,12,97, - 8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,14,16,18,20,22,24,26, - 0,3,1,0,1,2,1,0,12,13,1,0,4,7,98,0,28,1,0,0,0,2,30,1,0,0,0,4,38, - 1,0,0,0,6,49,1,0,0,0,8,58,1,0,0,0,10,60,1,0,0,0,12,64,1,0,0,0,14, - 68,1,0,0,0,16,70,1,0,0,0,18,86,1,0,0,0,20,88,1,0,0,0,22,90,1,0,0, - 0,24,96,1,0,0,0,26,98,1,0,0,0,28,29,3,2,1,0,29,1,1,0,0,0,30,35,3, - 4,2,0,31,32,5,1,0,0,32,34,3,4,2,0,33,31,1,0,0,0,34,37,1,0,0,0,35, - 33,1,0,0,0,35,36,1,0,0,0,36,3,1,0,0,0,37,35,1,0,0,0,38,43,3,6,3, - 0,39,40,5,2,0,0,40,42,3,6,3,0,41,39,1,0,0,0,42,45,1,0,0,0,43,41, - 1,0,0,0,43,44,1,0,0,0,44,5,1,0,0,0,45,43,1,0,0,0,46,47,5,3,0,0,47, - 50,3,6,3,0,48,50,3,8,4,0,49,46,1,0,0,0,49,48,1,0,0,0,50,7,1,0,0, - 0,51,52,5,9,0,0,52,53,3,0,0,0,53,54,5,10,0,0,54,59,1,0,0,0,55,59, - 3,10,5,0,56,59,3,12,6,0,57,59,3,14,7,0,58,51,1,0,0,0,58,55,1,0,0, - 0,58,56,1,0,0,0,58,57,1,0,0,0,59,9,1,0,0,0,60,61,3,20,10,0,61,62, - 3,26,13,0,62,63,3,22,11,0,63,11,1,0,0,0,64,65,3,20,10,0,65,66,5, - 8,0,0,66,67,3,24,12,0,67,13,1,0,0,0,68,69,5,14,0,0,69,15,1,0,0,0, - 70,71,5,9,0,0,71,79,3,18,9,0,72,74,7,0,0,0,73,75,5,3,0,0,74,73,1, - 0,0,0,74,75,1,0,0,0,75,76,1,0,0,0,76,78,3,18,9,0,77,72,1,0,0,0,78, - 81,1,0,0,0,79,77,1,0,0,0,79,80,1,0,0,0,80,82,1,0,0,0,81,79,1,0,0, - 0,82,83,5,10,0,0,83,17,1,0,0,0,84,87,3,16,8,0,85,87,3,14,7,0,86, - 84,1,0,0,0,86,85,1,0,0,0,87,19,1,0,0,0,88,89,5,14,0,0,89,21,1,0, - 0,0,90,91,7,1,0,0,91,23,1,0,0,0,92,97,5,12,0,0,93,97,5,13,0,0,94, - 97,3,14,7,0,95,97,3,16,8,0,96,92,1,0,0,0,96,93,1,0,0,0,96,94,1,0, - 0,0,96,95,1,0,0,0,97,25,1,0,0,0,98,99,7,2,0,0,99,27,1,0,0,0,8,35, - 43,49,58,74,79,86,96 + 4,1,4,1,4,3,4,59,8,4,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,3,6,69,8,6, + 1,7,1,7,1,8,1,8,1,8,1,8,3,8,77,8,8,1,8,5,8,80,8,8,10,8,12,8,83,9, + 8,1,8,1,8,1,9,1,9,3,9,89,8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12, + 3,12,98,8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,14,16,18,20,22, + 24,26,0,3,1,0,1,2,1,0,12,13,1,0,4,7,99,0,28,1,0,0,0,2,30,1,0,0,0, + 4,38,1,0,0,0,6,49,1,0,0,0,8,58,1,0,0,0,10,60,1,0,0,0,12,64,1,0,0, + 0,14,70,1,0,0,0,16,72,1,0,0,0,18,88,1,0,0,0,20,90,1,0,0,0,22,92, + 1,0,0,0,24,97,1,0,0,0,26,99,1,0,0,0,28,29,3,2,1,0,29,1,1,0,0,0,30, + 35,3,4,2,0,31,32,5,1,0,0,32,34,3,4,2,0,33,31,1,0,0,0,34,37,1,0,0, + 0,35,33,1,0,0,0,35,36,1,0,0,0,36,3,1,0,0,0,37,35,1,0,0,0,38,43,3, + 6,3,0,39,40,5,2,0,0,40,42,3,6,3,0,41,39,1,0,0,0,42,45,1,0,0,0,43, + 41,1,0,0,0,43,44,1,0,0,0,44,5,1,0,0,0,45,43,1,0,0,0,46,47,5,3,0, + 0,47,50,3,6,3,0,48,50,3,8,4,0,49,46,1,0,0,0,49,48,1,0,0,0,50,7,1, + 0,0,0,51,52,5,9,0,0,52,53,3,0,0,0,53,54,5,10,0,0,54,59,1,0,0,0,55, + 59,3,10,5,0,56,59,3,12,6,0,57,59,3,14,7,0,58,51,1,0,0,0,58,55,1, + 0,0,0,58,56,1,0,0,0,58,57,1,0,0,0,59,9,1,0,0,0,60,61,3,20,10,0,61, + 62,3,26,13,0,62,63,3,22,11,0,63,11,1,0,0,0,64,65,3,20,10,0,65,68, + 5,8,0,0,66,69,3,24,12,0,67,69,3,16,8,0,68,66,1,0,0,0,68,67,1,0,0, + 0,69,13,1,0,0,0,70,71,5,14,0,0,71,15,1,0,0,0,72,73,5,9,0,0,73,81, + 3,18,9,0,74,76,7,0,0,0,75,77,5,3,0,0,76,75,1,0,0,0,76,77,1,0,0,0, + 77,78,1,0,0,0,78,80,3,18,9,0,79,74,1,0,0,0,80,83,1,0,0,0,81,79,1, + 0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,81,1,0,0,0,84,85,5,10,0,0,85, + 17,1,0,0,0,86,89,3,16,8,0,87,89,3,24,12,0,88,86,1,0,0,0,88,87,1, + 0,0,0,89,19,1,0,0,0,90,91,5,14,0,0,91,21,1,0,0,0,92,93,7,1,0,0,93, + 23,1,0,0,0,94,98,5,12,0,0,95,98,5,13,0,0,96,98,3,14,7,0,97,94,1, + 0,0,0,97,95,1,0,0,0,97,96,1,0,0,0,98,25,1,0,0,0,99,100,7,2,0,0,100, + 27,1,0,0,0,9,35,43,49,58,68,76,81,88,97 ]; private static __ATN: antlr.ATN; @@ -885,8 +898,11 @@ export class FieldExpressionContext extends antlr.ParserRuleContext { public EQ(): antlr.TerminalNode { return this.getToken(DQLParser.EQ, 0)!; } - public value(): ValueContext { - return this.getRuleContext(0, ValueContext)!; + public value(): ValueContext | null { + return this.getRuleContext(0, ValueContext); + } + public groupExpression(): GroupExpressionContext | null { + return this.getRuleContext(0, GroupExpressionContext); } public override get ruleIndex(): number { return DQLParser.RULE_fieldExpression; @@ -1017,8 +1033,8 @@ export class GroupContentContext extends antlr.ParserRuleContext { public groupExpression(): GroupExpressionContext | null { return this.getRuleContext(0, GroupExpressionContext); } - public termSearch(): TermSearchContext | null { - return this.getRuleContext(0, TermSearchContext); + public value(): ValueContext | null { + return this.getRuleContext(0, ValueContext); } public override get ruleIndex(): number { return DQLParser.RULE_groupContent; @@ -1119,9 +1135,6 @@ export class ValueContext extends antlr.ParserRuleContext { public termSearch(): TermSearchContext | null { return this.getRuleContext(0, TermSearchContext); } - public groupExpression(): GroupExpressionContext | null { - return this.getRuleContext(0, GroupExpressionContext); - } public override get ruleIndex(): number { return DQLParser.RULE_value; } diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp index 99dca7502428..243a73d55843 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -52,4 +52,4 @@ comparisonOperator atn: -[4, 1, 15, 101, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 75, 8, 8, 1, 8, 5, 8, 78, 8, 8, 10, 8, 12, 8, 81, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 87, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 97, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 98, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 68, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 22, 90, 1, 0, 0, 0, 24, 96, 1, 0, 0, 0, 26, 98, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 66, 5, 8, 0, 0, 66, 67, 3, 24, 12, 0, 67, 13, 1, 0, 0, 0, 68, 69, 5, 14, 0, 0, 69, 15, 1, 0, 0, 0, 70, 71, 5, 9, 0, 0, 71, 79, 3, 18, 9, 0, 72, 74, 7, 0, 0, 0, 73, 75, 5, 3, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 3, 18, 9, 0, 77, 72, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 10, 0, 0, 83, 17, 1, 0, 0, 0, 84, 87, 3, 16, 8, 0, 85, 87, 3, 14, 7, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 19, 1, 0, 0, 0, 88, 89, 5, 14, 0, 0, 89, 21, 1, 0, 0, 0, 90, 91, 7, 1, 0, 0, 91, 23, 1, 0, 0, 0, 92, 97, 5, 12, 0, 0, 93, 97, 5, 13, 0, 0, 94, 97, 3, 14, 7, 0, 95, 97, 3, 16, 8, 0, 96, 92, 1, 0, 0, 0, 96, 93, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 25, 1, 0, 0, 0, 98, 99, 7, 2, 0, 0, 99, 27, 1, 0, 0, 0, 8, 35, 43, 49, 58, 74, 79, 86, 96] \ No newline at end of file +[4, 1, 15, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 69, 8, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 77, 8, 8, 1, 8, 5, 8, 80, 8, 8, 10, 8, 12, 8, 83, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 89, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 70, 1, 0, 0, 0, 16, 72, 1, 0, 0, 0, 18, 88, 1, 0, 0, 0, 20, 90, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 68, 5, 8, 0, 0, 66, 69, 3, 24, 12, 0, 67, 69, 3, 16, 8, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 13, 1, 0, 0, 0, 70, 71, 5, 14, 0, 0, 71, 15, 1, 0, 0, 0, 72, 73, 5, 9, 0, 0, 73, 81, 3, 18, 9, 0, 74, 76, 7, 0, 0, 0, 75, 77, 5, 3, 0, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 3, 18, 9, 0, 79, 74, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 85, 5, 10, 0, 0, 85, 17, 1, 0, 0, 0, 86, 89, 3, 16, 8, 0, 87, 89, 3, 24, 12, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 19, 1, 0, 0, 0, 90, 91, 5, 14, 0, 0, 91, 21, 1, 0, 0, 0, 92, 93, 7, 1, 0, 0, 93, 23, 1, 0, 0, 0, 94, 98, 5, 12, 0, 0, 95, 98, 5, 13, 0, 0, 96, 98, 3, 14, 7, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 9, 35, 43, 49, 58, 68, 76, 81, 88, 97] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index 5ee1ae777d13..e022011150fd 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -419,6 +419,9 @@ public FieldContext field() { public ValueContext value() { return getRuleContext(ValueContext.class,0); } + public GroupExpressionContext groupExpression() { + return getRuleContext(GroupExpressionContext.class,0); + } public FieldExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -435,8 +438,26 @@ public final FieldExpressionContext fieldExpression() throws RecognitionExceptio field(); setState(65); match(EQ); - setState(66); - value(); + setState(68); + _errHandler.sync(this); + switch (_input.LA(1)) { + case PHRASE: + case NUMBER: + case IDENTIFIER: + { + setState(66); + value(); + } + break; + case LPAREN: + { + setState(67); + groupExpression(); + } + break; + default: + throw new NoViableAltException(this); + } } } catch (RecognitionException re) { @@ -465,7 +486,7 @@ public final TermSearchContext termSearch() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(68); + setState(70); match(IDENTIFIER); } } @@ -515,17 +536,17 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(70); + setState(72); match(LPAREN); - setState(71); + setState(73); groupContent(); - setState(79); + setState(81); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR || _la==AND) { { { - setState(72); + setState(74); _la = _input.LA(1); if ( !(_la==OR || _la==AND) ) { _errHandler.recoverInline(this); @@ -536,26 +557,26 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio consume(); } { - setState(74); + setState(76); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(73); + setState(75); match(NOT); } } } - setState(76); + setState(78); groupContent(); } } - setState(81); + setState(83); _errHandler.sync(this); _la = _input.LA(1); } - setState(82); + setState(84); match(RPAREN); } } @@ -575,8 +596,8 @@ public static class GroupContentContext extends ParserRuleContext { public GroupExpressionContext groupExpression() { return getRuleContext(GroupExpressionContext.class,0); } - public TermSearchContext termSearch() { - return getRuleContext(TermSearchContext.class,0); + public ValueContext value() { + return getRuleContext(ValueContext.class,0); } public GroupContentContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); @@ -588,21 +609,23 @@ public final GroupContentContext groupContent() throws RecognitionException { GroupContentContext _localctx = new GroupContentContext(_ctx, getState()); enterRule(_localctx, 18, RULE_groupContent); try { - setState(86); + setState(88); _errHandler.sync(this); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(84); + setState(86); groupExpression(); } break; + case PHRASE: + case NUMBER: case IDENTIFIER: enterOuterAlt(_localctx, 2); { - setState(85); - termSearch(); + setState(87); + value(); } break; default: @@ -635,7 +658,7 @@ public final FieldContext field() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(88); + setState(90); match(IDENTIFIER); } } @@ -667,7 +690,7 @@ public final RangeValueContext rangeValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(90); + setState(92); _la = _input.LA(1); if ( !(_la==PHRASE || _la==NUMBER) ) { _errHandler.recoverInline(this); @@ -697,9 +720,6 @@ public static class ValueContext extends ParserRuleContext { public TermSearchContext termSearch() { return getRuleContext(TermSearchContext.class,0); } - public GroupExpressionContext groupExpression() { - return getRuleContext(GroupExpressionContext.class,0); - } public ValueContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -710,37 +730,30 @@ public final ValueContext value() throws RecognitionException { ValueContext _localctx = new ValueContext(_ctx, getState()); enterRule(_localctx, 24, RULE_value); try { - setState(96); + setState(97); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: enterOuterAlt(_localctx, 1); { - setState(92); + setState(94); match(PHRASE); } break; case NUMBER: enterOuterAlt(_localctx, 2); { - setState(93); + setState(95); match(NUMBER); } break; case IDENTIFIER: enterOuterAlt(_localctx, 3); { - setState(94); + setState(96); termSearch(); } break; - case LPAREN: - enterOuterAlt(_localctx, 4); - { - setState(95); - groupExpression(); - } - break; default: throw new NoViableAltException(this); } @@ -775,7 +788,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(98); + setState(99); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 240L) != 0)) ) { _errHandler.recoverInline(this); @@ -799,7 +812,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx } public static final String _serializedATN = - "\u0004\u0001\u000fe\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u0001\u000ff\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ @@ -809,50 +822,51 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx "\u0001\u0003\u0001\u0003\u0001\u0003\u0003\u00032\b\u0003\u0001\u0004"+ "\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+ "\u0003\u0004;\b\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007"+ - "\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bK\b\b\u0001\b\u0005\bN\b\b\n\b"+ - "\f\bQ\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\tW\b\t\u0001\n\u0001\n"+ - "\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0003\fa\b\f"+ - "\u0001\r\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002\u0004\u0006\b\n"+ - "\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003\u0001\u0000\u0001"+ - "\u0002\u0001\u0000\f\r\u0001\u0000\u0004\u0007b\u0000\u001c\u0001\u0000"+ - "\u0000\u0000\u0002\u001e\u0001\u0000\u0000\u0000\u0004&\u0001\u0000\u0000"+ - "\u0000\u00061\u0001\u0000\u0000\u0000\b:\u0001\u0000\u0000\u0000\n<\u0001"+ - "\u0000\u0000\u0000\f@\u0001\u0000\u0000\u0000\u000eD\u0001\u0000\u0000"+ - "\u0000\u0010F\u0001\u0000\u0000\u0000\u0012V\u0001\u0000\u0000\u0000\u0014"+ - "X\u0001\u0000\u0000\u0000\u0016Z\u0001\u0000\u0000\u0000\u0018`\u0001"+ - "\u0000\u0000\u0000\u001ab\u0001\u0000\u0000\u0000\u001c\u001d\u0003\u0002"+ - "\u0001\u0000\u001d\u0001\u0001\u0000\u0000\u0000\u001e#\u0003\u0004\u0002"+ - "\u0000\u001f \u0005\u0001\u0000\u0000 \"\u0003\u0004\u0002\u0000!\u001f"+ - "\u0001\u0000\u0000\u0000\"%\u0001\u0000\u0000\u0000#!\u0001\u0000\u0000"+ - "\u0000#$\u0001\u0000\u0000\u0000$\u0003\u0001\u0000\u0000\u0000%#\u0001"+ - "\u0000\u0000\u0000&+\u0003\u0006\u0003\u0000\'(\u0005\u0002\u0000\u0000"+ - "(*\u0003\u0006\u0003\u0000)\'\u0001\u0000\u0000\u0000*-\u0001\u0000\u0000"+ - "\u0000+)\u0001\u0000\u0000\u0000+,\u0001\u0000\u0000\u0000,\u0005\u0001"+ - "\u0000\u0000\u0000-+\u0001\u0000\u0000\u0000./\u0005\u0003\u0000\u0000"+ - "/2\u0003\u0006\u0003\u000002\u0003\b\u0004\u00001.\u0001\u0000\u0000\u0000"+ - "10\u0001\u0000\u0000\u00002\u0007\u0001\u0000\u0000\u000034\u0005\t\u0000"+ - "\u000045\u0003\u0000\u0000\u000056\u0005\n\u0000\u00006;\u0001\u0000\u0000"+ - "\u00007;\u0003\n\u0005\u00008;\u0003\f\u0006\u00009;\u0003\u000e\u0007"+ - "\u0000:3\u0001\u0000\u0000\u0000:7\u0001\u0000\u0000\u0000:8\u0001\u0000"+ - "\u0000\u0000:9\u0001\u0000\u0000\u0000;\t\u0001\u0000\u0000\u0000<=\u0003"+ - "\u0014\n\u0000=>\u0003\u001a\r\u0000>?\u0003\u0016\u000b\u0000?\u000b"+ - "\u0001\u0000\u0000\u0000@A\u0003\u0014\n\u0000AB\u0005\b\u0000\u0000B"+ - "C\u0003\u0018\f\u0000C\r\u0001\u0000\u0000\u0000DE\u0005\u000e\u0000\u0000"+ - "E\u000f\u0001\u0000\u0000\u0000FG\u0005\t\u0000\u0000GO\u0003\u0012\t"+ - "\u0000HJ\u0007\u0000\u0000\u0000IK\u0005\u0003\u0000\u0000JI\u0001\u0000"+ - "\u0000\u0000JK\u0001\u0000\u0000\u0000KL\u0001\u0000\u0000\u0000LN\u0003"+ - "\u0012\t\u0000MH\u0001\u0000\u0000\u0000NQ\u0001\u0000\u0000\u0000OM\u0001"+ - "\u0000\u0000\u0000OP\u0001\u0000\u0000\u0000PR\u0001\u0000\u0000\u0000"+ - "QO\u0001\u0000\u0000\u0000RS\u0005\n\u0000\u0000S\u0011\u0001\u0000\u0000"+ - "\u0000TW\u0003\u0010\b\u0000UW\u0003\u000e\u0007\u0000VT\u0001\u0000\u0000"+ - "\u0000VU\u0001\u0000\u0000\u0000W\u0013\u0001\u0000\u0000\u0000XY\u0005"+ - "\u000e\u0000\u0000Y\u0015\u0001\u0000\u0000\u0000Z[\u0007\u0001\u0000"+ - "\u0000[\u0017\u0001\u0000\u0000\u0000\\a\u0005\f\u0000\u0000]a\u0005\r"+ - "\u0000\u0000^a\u0003\u000e\u0007\u0000_a\u0003\u0010\b\u0000`\\\u0001"+ - "\u0000\u0000\u0000`]\u0001\u0000\u0000\u0000`^\u0001\u0000\u0000\u0000"+ - "`_\u0001\u0000\u0000\u0000a\u0019\u0001\u0000\u0000\u0000bc\u0007\u0002"+ - "\u0000\u0000c\u001b\u0001\u0000\u0000\u0000\b#+1:JOV`"; + "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0003\u0006E\b\u0006"+ + "\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bM\b\b"+ + "\u0001\b\u0005\bP\b\b\n\b\f\bS\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003"+ + "\tY\b\t\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001"+ + "\f\u0003\fb\b\f\u0001\r\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002"+ + "\u0004\u0006\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003"+ + "\u0001\u0000\u0001\u0002\u0001\u0000\f\r\u0001\u0000\u0004\u0007c\u0000"+ + "\u001c\u0001\u0000\u0000\u0000\u0002\u001e\u0001\u0000\u0000\u0000\u0004"+ + "&\u0001\u0000\u0000\u0000\u00061\u0001\u0000\u0000\u0000\b:\u0001\u0000"+ + "\u0000\u0000\n<\u0001\u0000\u0000\u0000\f@\u0001\u0000\u0000\u0000\u000e"+ + "F\u0001\u0000\u0000\u0000\u0010H\u0001\u0000\u0000\u0000\u0012X\u0001"+ + "\u0000\u0000\u0000\u0014Z\u0001\u0000\u0000\u0000\u0016\\\u0001\u0000"+ + "\u0000\u0000\u0018a\u0001\u0000\u0000\u0000\u001ac\u0001\u0000\u0000\u0000"+ + "\u001c\u001d\u0003\u0002\u0001\u0000\u001d\u0001\u0001\u0000\u0000\u0000"+ + "\u001e#\u0003\u0004\u0002\u0000\u001f \u0005\u0001\u0000\u0000 \"\u0003"+ + "\u0004\u0002\u0000!\u001f\u0001\u0000\u0000\u0000\"%\u0001\u0000\u0000"+ + "\u0000#!\u0001\u0000\u0000\u0000#$\u0001\u0000\u0000\u0000$\u0003\u0001"+ + "\u0000\u0000\u0000%#\u0001\u0000\u0000\u0000&+\u0003\u0006\u0003\u0000"+ + "\'(\u0005\u0002\u0000\u0000(*\u0003\u0006\u0003\u0000)\'\u0001\u0000\u0000"+ + "\u0000*-\u0001\u0000\u0000\u0000+)\u0001\u0000\u0000\u0000+,\u0001\u0000"+ + "\u0000\u0000,\u0005\u0001\u0000\u0000\u0000-+\u0001\u0000\u0000\u0000"+ + "./\u0005\u0003\u0000\u0000/2\u0003\u0006\u0003\u000002\u0003\b\u0004\u0000"+ + "1.\u0001\u0000\u0000\u000010\u0001\u0000\u0000\u00002\u0007\u0001\u0000"+ + "\u0000\u000034\u0005\t\u0000\u000045\u0003\u0000\u0000\u000056\u0005\n"+ + "\u0000\u00006;\u0001\u0000\u0000\u00007;\u0003\n\u0005\u00008;\u0003\f"+ + "\u0006\u00009;\u0003\u000e\u0007\u0000:3\u0001\u0000\u0000\u0000:7\u0001"+ + "\u0000\u0000\u0000:8\u0001\u0000\u0000\u0000:9\u0001\u0000\u0000\u0000"+ + ";\t\u0001\u0000\u0000\u0000<=\u0003\u0014\n\u0000=>\u0003\u001a\r\u0000"+ + ">?\u0003\u0016\u000b\u0000?\u000b\u0001\u0000\u0000\u0000@A\u0003\u0014"+ + "\n\u0000AD\u0005\b\u0000\u0000BE\u0003\u0018\f\u0000CE\u0003\u0010\b\u0000"+ + "DB\u0001\u0000\u0000\u0000DC\u0001\u0000\u0000\u0000E\r\u0001\u0000\u0000"+ + "\u0000FG\u0005\u000e\u0000\u0000G\u000f\u0001\u0000\u0000\u0000HI\u0005"+ + "\t\u0000\u0000IQ\u0003\u0012\t\u0000JL\u0007\u0000\u0000\u0000KM\u0005"+ + "\u0003\u0000\u0000LK\u0001\u0000\u0000\u0000LM\u0001\u0000\u0000\u0000"+ + "MN\u0001\u0000\u0000\u0000NP\u0003\u0012\t\u0000OJ\u0001\u0000\u0000\u0000"+ + "PS\u0001\u0000\u0000\u0000QO\u0001\u0000\u0000\u0000QR\u0001\u0000\u0000"+ + "\u0000RT\u0001\u0000\u0000\u0000SQ\u0001\u0000\u0000\u0000TU\u0005\n\u0000"+ + "\u0000U\u0011\u0001\u0000\u0000\u0000VY\u0003\u0010\b\u0000WY\u0003\u0018"+ + "\f\u0000XV\u0001\u0000\u0000\u0000XW\u0001\u0000\u0000\u0000Y\u0013\u0001"+ + "\u0000\u0000\u0000Z[\u0005\u000e\u0000\u0000[\u0015\u0001\u0000\u0000"+ + "\u0000\\]\u0007\u0001\u0000\u0000]\u0017\u0001\u0000\u0000\u0000^b\u0005"+ + "\f\u0000\u0000_b\u0005\r\u0000\u0000`b\u0003\u000e\u0007\u0000a^\u0001"+ + "\u0000\u0000\u0000a_\u0001\u0000\u0000\u0000a`\u0001\u0000\u0000\u0000"+ + "b\u0019\u0001\u0000\u0000\u0000cd\u0007\u0002\u0000\u0000d\u001b\u0001"+ + "\u0000\u0000\u0000\t#+1:DLQXa"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index 6e9d5ff01b7e..05b2a8494093 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -14,12 +14,12 @@ primaryExpression: | fieldExpression | termSearch; comparisonExpression: field comparisonOperator rangeValue; -fieldExpression: field EQ value; +fieldExpression: field EQ (value | groupExpression); termSearch: IDENTIFIER; groupExpression: LPAREN groupContent ((OR | AND) (NOT?) groupContent)* RPAREN; -groupContent: groupExpression | termSearch; +groupContent: groupExpression | value; field: IDENTIFIER; rangeValue: NUMBER | PHRASE; -value: PHRASE | NUMBER | termSearch | groupExpression; +value: PHRASE | NUMBER | termSearch; comparisonOperator: GT | LT | GE | LE; \ No newline at end of file From d1f2dc2e46f4477a7869a1b40b78c502660c6adb Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Wed, 17 Jul 2024 11:52:03 -0700 Subject: [PATCH 08/34] fix grammar for dots in field and value term search with spaces Signed-off-by: Paul Sebastian --- .../antlr/dql/generated/DQLLexer.interp | 5 +- .../antlr/dql/generated/DQLLexer.tokens | 10 +- .../public/antlr/dql/generated/DQLLexer.ts | 84 +++++----- .../antlr/dql/generated/DQLParser.interp | 4 +- .../antlr/dql/generated/DQLParser.tokens | 10 +- .../public/antlr/dql/generated/DQLParser.ts | 134 +++++++++------- .../antlr/dql/grammar/.antlr/DQLLexer.interp | 5 +- .../antlr/dql/grammar/.antlr/DQLLexer.java | 123 +++++++------- .../antlr/dql/grammar/.antlr/DQLLexer.tokens | 10 +- .../antlr/dql/grammar/.antlr/DQLParser.interp | 2 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 151 ++++++++++-------- .../data/public/antlr/dql/grammar/DQLLexer.g4 | 3 +- .../public/antlr/dql/grammar/DQLParser.g4 | 2 +- 13 files changed, 283 insertions(+), 260 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp index 370011ad4a31..d9b1db4ba256 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp @@ -10,7 +10,6 @@ null ':' '(' ')' -'.' null null null @@ -28,7 +27,6 @@ LE EQ LPAREN RPAREN -DOT PHRASE NUMBER IDENTIFIER @@ -45,7 +43,6 @@ LE EQ LPAREN RPAREN -DOT PHRASE NUMBER IDENTIFIER @@ -59,4 +56,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 15, 99, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 63, 8, 11, 10, 11, 12, 11, 66, 9, 11, 1, 11, 1, 11, 1, 12, 3, 12, 71, 8, 12, 1, 12, 4, 12, 74, 8, 12, 11, 12, 12, 12, 75, 1, 12, 1, 12, 4, 12, 80, 8, 12, 11, 12, 12, 12, 81, 3, 12, 84, 8, 12, 1, 13, 1, 13, 5, 13, 88, 8, 13, 10, 13, 12, 13, 91, 9, 13, 1, 14, 4, 14, 94, 8, 14, 11, 14, 12, 14, 95, 1, 14, 1, 14, 0, 0, 15, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 5, 0, 42, 42, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 105, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 1, 31, 1, 0, 0, 0, 3, 34, 1, 0, 0, 0, 5, 38, 1, 0, 0, 0, 7, 42, 1, 0, 0, 0, 9, 44, 1, 0, 0, 0, 11, 46, 1, 0, 0, 0, 13, 49, 1, 0, 0, 0, 15, 52, 1, 0, 0, 0, 17, 54, 1, 0, 0, 0, 19, 56, 1, 0, 0, 0, 21, 58, 1, 0, 0, 0, 23, 60, 1, 0, 0, 0, 25, 70, 1, 0, 0, 0, 27, 85, 1, 0, 0, 0, 29, 93, 1, 0, 0, 0, 31, 32, 7, 0, 0, 0, 32, 33, 7, 1, 0, 0, 33, 2, 1, 0, 0, 0, 34, 35, 7, 2, 0, 0, 35, 36, 7, 3, 0, 0, 36, 37, 7, 4, 0, 0, 37, 4, 1, 0, 0, 0, 38, 39, 7, 3, 0, 0, 39, 40, 7, 0, 0, 0, 40, 41, 7, 5, 0, 0, 41, 6, 1, 0, 0, 0, 42, 43, 5, 62, 0, 0, 43, 8, 1, 0, 0, 0, 44, 45, 5, 60, 0, 0, 45, 10, 1, 0, 0, 0, 46, 47, 5, 62, 0, 0, 47, 48, 5, 61, 0, 0, 48, 12, 1, 0, 0, 0, 49, 50, 5, 60, 0, 0, 50, 51, 5, 61, 0, 0, 51, 14, 1, 0, 0, 0, 52, 53, 5, 58, 0, 0, 53, 16, 1, 0, 0, 0, 54, 55, 5, 40, 0, 0, 55, 18, 1, 0, 0, 0, 56, 57, 5, 41, 0, 0, 57, 20, 1, 0, 0, 0, 58, 59, 5, 46, 0, 0, 59, 22, 1, 0, 0, 0, 60, 64, 5, 34, 0, 0, 61, 63, 8, 6, 0, 0, 62, 61, 1, 0, 0, 0, 63, 66, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 68, 5, 34, 0, 0, 68, 24, 1, 0, 0, 0, 69, 71, 5, 45, 0, 0, 70, 69, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 73, 1, 0, 0, 0, 72, 74, 7, 7, 0, 0, 73, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 83, 1, 0, 0, 0, 77, 79, 5, 46, 0, 0, 78, 80, 7, 7, 0, 0, 79, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 77, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 26, 1, 0, 0, 0, 85, 89, 7, 8, 0, 0, 86, 88, 7, 9, 0, 0, 87, 86, 1, 0, 0, 0, 88, 91, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 28, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 92, 94, 7, 10, 0, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 6, 14, 0, 0, 98, 30, 1, 0, 0, 0, 8, 0, 64, 70, 75, 81, 83, 89, 95, 1, 0, 1, 0] \ No newline at end of file +[4, 0, 14, 95, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 59, 8, 10, 10, 10, 12, 10, 62, 9, 10, 1, 10, 1, 10, 1, 11, 3, 11, 67, 8, 11, 1, 11, 4, 11, 70, 8, 11, 11, 11, 12, 11, 71, 1, 11, 1, 11, 4, 11, 76, 8, 11, 11, 11, 12, 11, 77, 3, 11, 80, 8, 11, 1, 12, 1, 12, 5, 12, 84, 8, 12, 10, 12, 12, 12, 87, 9, 12, 1, 13, 4, 13, 90, 8, 13, 11, 13, 12, 13, 91, 1, 13, 1, 13, 0, 0, 14, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 101, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 1, 29, 1, 0, 0, 0, 3, 32, 1, 0, 0, 0, 5, 36, 1, 0, 0, 0, 7, 40, 1, 0, 0, 0, 9, 42, 1, 0, 0, 0, 11, 44, 1, 0, 0, 0, 13, 47, 1, 0, 0, 0, 15, 50, 1, 0, 0, 0, 17, 52, 1, 0, 0, 0, 19, 54, 1, 0, 0, 0, 21, 56, 1, 0, 0, 0, 23, 66, 1, 0, 0, 0, 25, 81, 1, 0, 0, 0, 27, 89, 1, 0, 0, 0, 29, 30, 7, 0, 0, 0, 30, 31, 7, 1, 0, 0, 31, 2, 1, 0, 0, 0, 32, 33, 7, 2, 0, 0, 33, 34, 7, 3, 0, 0, 34, 35, 7, 4, 0, 0, 35, 4, 1, 0, 0, 0, 36, 37, 7, 3, 0, 0, 37, 38, 7, 0, 0, 0, 38, 39, 7, 5, 0, 0, 39, 6, 1, 0, 0, 0, 40, 41, 5, 62, 0, 0, 41, 8, 1, 0, 0, 0, 42, 43, 5, 60, 0, 0, 43, 10, 1, 0, 0, 0, 44, 45, 5, 62, 0, 0, 45, 46, 5, 61, 0, 0, 46, 12, 1, 0, 0, 0, 47, 48, 5, 60, 0, 0, 48, 49, 5, 61, 0, 0, 49, 14, 1, 0, 0, 0, 50, 51, 5, 58, 0, 0, 51, 16, 1, 0, 0, 0, 52, 53, 5, 40, 0, 0, 53, 18, 1, 0, 0, 0, 54, 55, 5, 41, 0, 0, 55, 20, 1, 0, 0, 0, 56, 60, 5, 34, 0, 0, 57, 59, 8, 6, 0, 0, 58, 57, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 63, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 63, 64, 5, 34, 0, 0, 64, 22, 1, 0, 0, 0, 65, 67, 5, 45, 0, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 69, 1, 0, 0, 0, 68, 70, 7, 7, 0, 0, 69, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 79, 1, 0, 0, 0, 73, 75, 5, 46, 0, 0, 74, 76, 7, 7, 0, 0, 75, 74, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 1, 0, 0, 0, 79, 73, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 24, 1, 0, 0, 0, 81, 85, 7, 8, 0, 0, 82, 84, 7, 9, 0, 0, 83, 82, 1, 0, 0, 0, 84, 87, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 26, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 88, 90, 7, 10, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 13, 0, 0, 94, 28, 1, 0, 0, 0, 8, 0, 60, 66, 71, 77, 79, 85, 91, 1, 0, 1, 0] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens b/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens index 3210060bf7d1..ac6c6fa0231b 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens @@ -8,11 +8,10 @@ LE=7 EQ=8 LPAREN=9 RPAREN=10 -DOT=11 -PHRASE=12 -NUMBER=13 -IDENTIFIER=14 -WS=15 +PHRASE=11 +NUMBER=12 +IDENTIFIER=13 +WS=14 '>'=4 '<'=5 '>='=6 @@ -20,4 +19,3 @@ WS=15 ':'=8 '('=9 ')'=10 -'.'=11 diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts index dbeb7cc58d11..169e36df52c6 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts @@ -15,11 +15,10 @@ export class DQLLexer extends antlr.Lexer { public static readonly EQ = 8; public static readonly LPAREN = 9; public static readonly RPAREN = 10; - public static readonly DOT = 11; - public static readonly PHRASE = 12; - public static readonly NUMBER = 13; - public static readonly IDENTIFIER = 14; - public static readonly WS = 15; + public static readonly PHRASE = 11; + public static readonly NUMBER = 12; + public static readonly IDENTIFIER = 13; + public static readonly WS = 14; public static readonly channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" @@ -27,12 +26,12 @@ export class DQLLexer extends antlr.Lexer { public static readonly literalNames = [ null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", - "')'", "'.'" + "')'" ]; public static readonly symbolicNames = [ null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", - "RPAREN", "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "RPAREN", "PHRASE", "NUMBER", "IDENTIFIER", "WS" ]; public static readonly modeNames = [ @@ -41,7 +40,7 @@ export class DQLLexer extends antlr.Lexer { public static readonly ruleNames = [ "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS", + "PHRASE", "NUMBER", "IDENTIFIER", "WS", ]; @@ -63,42 +62,41 @@ export class DQLLexer extends antlr.Lexer { public get modeNames(): string[] { return DQLLexer.modeNames; } public static readonly _serializedATN: number[] = [ - 4,0,15,99,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2, + 4,0,14,95,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2, 6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13, - 7,13,2,14,7,14,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1, - 3,1,4,1,4,1,5,1,5,1,5,1,6,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1, - 10,1,11,1,11,5,11,63,8,11,10,11,12,11,66,9,11,1,11,1,11,1,12,3,12, - 71,8,12,1,12,4,12,74,8,12,11,12,12,12,75,1,12,1,12,4,12,80,8,12, - 11,12,12,12,81,3,12,84,8,12,1,13,1,13,5,13,88,8,13,10,13,12,13,91, - 9,13,1,14,4,14,94,8,14,11,14,12,14,95,1,14,1,14,0,0,15,1,1,3,2,5, - 3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15, - 1,0,11,2,0,79,79,111,111,2,0,82,82,114,114,2,0,65,65,97,97,2,0,78, - 78,110,110,2,0,68,68,100,100,2,0,84,84,116,116,2,0,34,34,92,92,1, - 0,48,57,4,0,42,42,65,90,95,95,97,122,5,0,42,42,48,57,65,90,95,95, - 97,122,3,0,9,10,13,13,32,32,105,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0, - 0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0, - 0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0, - 0,0,27,1,0,0,0,0,29,1,0,0,0,1,31,1,0,0,0,3,34,1,0,0,0,5,38,1,0,0, - 0,7,42,1,0,0,0,9,44,1,0,0,0,11,46,1,0,0,0,13,49,1,0,0,0,15,52,1, - 0,0,0,17,54,1,0,0,0,19,56,1,0,0,0,21,58,1,0,0,0,23,60,1,0,0,0,25, - 70,1,0,0,0,27,85,1,0,0,0,29,93,1,0,0,0,31,32,7,0,0,0,32,33,7,1,0, - 0,33,2,1,0,0,0,34,35,7,2,0,0,35,36,7,3,0,0,36,37,7,4,0,0,37,4,1, - 0,0,0,38,39,7,3,0,0,39,40,7,0,0,0,40,41,7,5,0,0,41,6,1,0,0,0,42, - 43,5,62,0,0,43,8,1,0,0,0,44,45,5,60,0,0,45,10,1,0,0,0,46,47,5,62, - 0,0,47,48,5,61,0,0,48,12,1,0,0,0,49,50,5,60,0,0,50,51,5,61,0,0,51, - 14,1,0,0,0,52,53,5,58,0,0,53,16,1,0,0,0,54,55,5,40,0,0,55,18,1,0, - 0,0,56,57,5,41,0,0,57,20,1,0,0,0,58,59,5,46,0,0,59,22,1,0,0,0,60, - 64,5,34,0,0,61,63,8,6,0,0,62,61,1,0,0,0,63,66,1,0,0,0,64,62,1,0, - 0,0,64,65,1,0,0,0,65,67,1,0,0,0,66,64,1,0,0,0,67,68,5,34,0,0,68, - 24,1,0,0,0,69,71,5,45,0,0,70,69,1,0,0,0,70,71,1,0,0,0,71,73,1,0, - 0,0,72,74,7,7,0,0,73,72,1,0,0,0,74,75,1,0,0,0,75,73,1,0,0,0,75,76, - 1,0,0,0,76,83,1,0,0,0,77,79,5,46,0,0,78,80,7,7,0,0,79,78,1,0,0,0, - 80,81,1,0,0,0,81,79,1,0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,77,1, - 0,0,0,83,84,1,0,0,0,84,26,1,0,0,0,85,89,7,8,0,0,86,88,7,9,0,0,87, - 86,1,0,0,0,88,91,1,0,0,0,89,87,1,0,0,0,89,90,1,0,0,0,90,28,1,0,0, - 0,91,89,1,0,0,0,92,94,7,10,0,0,93,92,1,0,0,0,94,95,1,0,0,0,95,93, - 1,0,0,0,95,96,1,0,0,0,96,97,1,0,0,0,97,98,6,14,0,0,98,30,1,0,0,0, - 8,0,64,70,75,81,83,89,95,1,0,1,0 + 7,13,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1,3,1,4,1,4, + 1,5,1,5,1,5,1,6,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,5,10,59, + 8,10,10,10,12,10,62,9,10,1,10,1,10,1,11,3,11,67,8,11,1,11,4,11,70, + 8,11,11,11,12,11,71,1,11,1,11,4,11,76,8,11,11,11,12,11,77,3,11,80, + 8,11,1,12,1,12,5,12,84,8,12,10,12,12,12,87,9,12,1,13,4,13,90,8,13, + 11,13,12,13,91,1,13,1,13,0,0,14,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15, + 8,17,9,19,10,21,11,23,12,25,13,27,14,1,0,11,2,0,79,79,111,111,2, + 0,82,82,114,114,2,0,65,65,97,97,2,0,78,78,110,110,2,0,68,68,100, + 100,2,0,84,84,116,116,2,0,34,34,92,92,1,0,48,57,4,0,42,42,65,90, + 95,95,97,122,6,0,42,42,46,46,48,57,65,90,95,95,97,122,3,0,9,10,13, + 13,32,32,101,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9, + 1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19, + 1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,1,29, + 1,0,0,0,3,32,1,0,0,0,5,36,1,0,0,0,7,40,1,0,0,0,9,42,1,0,0,0,11,44, + 1,0,0,0,13,47,1,0,0,0,15,50,1,0,0,0,17,52,1,0,0,0,19,54,1,0,0,0, + 21,56,1,0,0,0,23,66,1,0,0,0,25,81,1,0,0,0,27,89,1,0,0,0,29,30,7, + 0,0,0,30,31,7,1,0,0,31,2,1,0,0,0,32,33,7,2,0,0,33,34,7,3,0,0,34, + 35,7,4,0,0,35,4,1,0,0,0,36,37,7,3,0,0,37,38,7,0,0,0,38,39,7,5,0, + 0,39,6,1,0,0,0,40,41,5,62,0,0,41,8,1,0,0,0,42,43,5,60,0,0,43,10, + 1,0,0,0,44,45,5,62,0,0,45,46,5,61,0,0,46,12,1,0,0,0,47,48,5,60,0, + 0,48,49,5,61,0,0,49,14,1,0,0,0,50,51,5,58,0,0,51,16,1,0,0,0,52,53, + 5,40,0,0,53,18,1,0,0,0,54,55,5,41,0,0,55,20,1,0,0,0,56,60,5,34,0, + 0,57,59,8,6,0,0,58,57,1,0,0,0,59,62,1,0,0,0,60,58,1,0,0,0,60,61, + 1,0,0,0,61,63,1,0,0,0,62,60,1,0,0,0,63,64,5,34,0,0,64,22,1,0,0,0, + 65,67,5,45,0,0,66,65,1,0,0,0,66,67,1,0,0,0,67,69,1,0,0,0,68,70,7, + 7,0,0,69,68,1,0,0,0,70,71,1,0,0,0,71,69,1,0,0,0,71,72,1,0,0,0,72, + 79,1,0,0,0,73,75,5,46,0,0,74,76,7,7,0,0,75,74,1,0,0,0,76,77,1,0, + 0,0,77,75,1,0,0,0,77,78,1,0,0,0,78,80,1,0,0,0,79,73,1,0,0,0,79,80, + 1,0,0,0,80,24,1,0,0,0,81,85,7,8,0,0,82,84,7,9,0,0,83,82,1,0,0,0, + 84,87,1,0,0,0,85,83,1,0,0,0,85,86,1,0,0,0,86,26,1,0,0,0,87,85,1, + 0,0,0,88,90,7,10,0,0,89,88,1,0,0,0,90,91,1,0,0,0,91,89,1,0,0,0,91, + 92,1,0,0,0,92,93,1,0,0,0,93,94,6,13,0,0,94,28,1,0,0,0,8,0,60,66, + 71,77,79,85,91,1,0,1,0 ]; private static __ATN: antlr.ATN; diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp index 243a73d55843..8d36a19fa1a8 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp @@ -10,7 +10,6 @@ null ':' '(' ')' -'.' null null null @@ -28,7 +27,6 @@ LE EQ LPAREN RPAREN -DOT PHRASE NUMBER IDENTIFIER @@ -52,4 +50,4 @@ comparisonOperator atn: -[4, 1, 15, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 69, 8, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 77, 8, 8, 1, 8, 5, 8, 80, 8, 8, 10, 8, 12, 8, 83, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 89, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 70, 1, 0, 0, 0, 16, 72, 1, 0, 0, 0, 18, 88, 1, 0, 0, 0, 20, 90, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 68, 5, 8, 0, 0, 66, 69, 3, 24, 12, 0, 67, 69, 3, 16, 8, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 13, 1, 0, 0, 0, 70, 71, 5, 14, 0, 0, 71, 15, 1, 0, 0, 0, 72, 73, 5, 9, 0, 0, 73, 81, 3, 18, 9, 0, 74, 76, 7, 0, 0, 0, 75, 77, 5, 3, 0, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 3, 18, 9, 0, 79, 74, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 85, 5, 10, 0, 0, 85, 17, 1, 0, 0, 0, 86, 89, 3, 16, 8, 0, 87, 89, 3, 24, 12, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 19, 1, 0, 0, 0, 90, 91, 5, 14, 0, 0, 91, 21, 1, 0, 0, 0, 92, 93, 7, 1, 0, 0, 93, 23, 1, 0, 0, 0, 94, 98, 5, 12, 0, 0, 95, 98, 5, 13, 0, 0, 96, 98, 3, 14, 7, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 9, 35, 43, 49, 58, 68, 76, 81, 88, 97] \ No newline at end of file +[4, 1, 14, 107, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 69, 8, 6, 1, 7, 1, 7, 5, 7, 73, 8, 7, 10, 7, 12, 7, 76, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 82, 8, 8, 1, 8, 5, 8, 85, 8, 8, 10, 8, 12, 8, 88, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 94, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 103, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 105, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 70, 1, 0, 0, 0, 16, 77, 1, 0, 0, 0, 18, 93, 1, 0, 0, 0, 20, 95, 1, 0, 0, 0, 22, 97, 1, 0, 0, 0, 24, 102, 1, 0, 0, 0, 26, 104, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 68, 5, 8, 0, 0, 66, 69, 3, 24, 12, 0, 67, 69, 3, 16, 8, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 13, 1, 0, 0, 0, 70, 74, 5, 13, 0, 0, 71, 73, 5, 13, 0, 0, 72, 71, 1, 0, 0, 0, 73, 76, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 15, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 78, 5, 9, 0, 0, 78, 86, 3, 18, 9, 0, 79, 81, 7, 0, 0, 0, 80, 82, 5, 3, 0, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 85, 3, 18, 9, 0, 84, 79, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 89, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 90, 5, 10, 0, 0, 90, 17, 1, 0, 0, 0, 91, 94, 3, 16, 8, 0, 92, 94, 3, 24, 12, 0, 93, 91, 1, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 19, 1, 0, 0, 0, 95, 96, 5, 13, 0, 0, 96, 21, 1, 0, 0, 0, 97, 98, 7, 1, 0, 0, 98, 23, 1, 0, 0, 0, 99, 103, 5, 11, 0, 0, 100, 103, 5, 12, 0, 0, 101, 103, 3, 14, 7, 0, 102, 99, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 25, 1, 0, 0, 0, 104, 105, 7, 2, 0, 0, 105, 27, 1, 0, 0, 0, 10, 35, 43, 49, 58, 68, 74, 81, 86, 93, 102] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens b/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens index 3210060bf7d1..ac6c6fa0231b 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens @@ -8,11 +8,10 @@ LE=7 EQ=8 LPAREN=9 RPAREN=10 -DOT=11 -PHRASE=12 -NUMBER=13 -IDENTIFIER=14 -WS=15 +PHRASE=11 +NUMBER=12 +IDENTIFIER=13 +WS=14 '>'=4 '<'=5 '>='=6 @@ -20,4 +19,3 @@ WS=15 ':'=8 '('=9 ')'=10 -'.'=11 diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts index f943fd73555e..eed0e5f025ff 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts @@ -22,11 +22,10 @@ export class DQLParser extends antlr.Parser { public static readonly EQ = 8; public static readonly LPAREN = 9; public static readonly RPAREN = 10; - public static readonly DOT = 11; - public static readonly PHRASE = 12; - public static readonly NUMBER = 13; - public static readonly IDENTIFIER = 14; - public static readonly WS = 15; + public static readonly PHRASE = 11; + public static readonly NUMBER = 12; + public static readonly IDENTIFIER = 13; + public static readonly WS = 14; public static readonly RULE_query = 0; public static readonly RULE_orExpression = 1; public static readonly RULE_andExpression = 2; @@ -44,12 +43,12 @@ export class DQLParser extends antlr.Parser { public static readonly literalNames = [ null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", - "')'", "'.'" + "')'" ]; public static readonly symbolicNames = [ null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", - "RPAREN", "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "RPAREN", "PHRASE", "NUMBER", "IDENTIFIER", "WS" ]; public static readonly ruleNames = [ "query", "orExpression", "andExpression", "notExpression", "primaryExpression", @@ -344,11 +343,26 @@ export class DQLParser extends antlr.Parser { public termSearch(): TermSearchContext { let localContext = new TermSearchContext(this.context, this.state); this.enterRule(localContext, 14, DQLParser.RULE_termSearch); + let _la: number; try { this.enterOuterAlt(localContext, 1); { this.state = 70; this.match(DQLParser.IDENTIFIER); + this.state = 74; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 13) { + { + { + this.state = 71; + this.match(DQLParser.IDENTIFIER); + } + } + this.state = 76; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } } } catch (re) { @@ -371,17 +385,17 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 72; + this.state = 77; this.match(DQLParser.LPAREN); - this.state = 73; + this.state = 78; this.groupContent(); - this.state = 81; + this.state = 86; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1 || _la === 2) { { { - this.state = 74; + this.state = 79; _la = this.tokenStream.LA(1); if(!(_la === 1 || _la === 2)) { this.errorHandler.recoverInline(this); @@ -391,26 +405,26 @@ export class DQLParser extends antlr.Parser { this.consume(); } { - this.state = 76; + this.state = 81; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 3) { { - this.state = 75; + this.state = 80; this.match(DQLParser.NOT); } } } - this.state = 78; + this.state = 83; this.groupContent(); } } - this.state = 83; + this.state = 88; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 84; + this.state = 89; this.match(DQLParser.RPAREN); } } @@ -431,13 +445,13 @@ export class DQLParser extends antlr.Parser { let localContext = new GroupContentContext(this.context, this.state); this.enterRule(localContext, 18, DQLParser.RULE_groupContent); try { - this.state = 88; + this.state = 93; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.LPAREN: this.enterOuterAlt(localContext, 1); { - this.state = 86; + this.state = 91; this.groupExpression(); } break; @@ -446,7 +460,7 @@ export class DQLParser extends antlr.Parser { case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 2); { - this.state = 87; + this.state = 92; this.value(); } break; @@ -473,7 +487,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 90; + this.state = 95; this.match(DQLParser.IDENTIFIER); } } @@ -497,9 +511,9 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 92; + this.state = 97; _la = this.tokenStream.LA(1); - if(!(_la === 12 || _la === 13)) { + if(!(_la === 11 || _la === 12)) { this.errorHandler.recoverInline(this); } else { @@ -525,27 +539,27 @@ export class DQLParser extends antlr.Parser { let localContext = new ValueContext(this.context, this.state); this.enterRule(localContext, 24, DQLParser.RULE_value); try { - this.state = 97; + this.state = 102; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: this.enterOuterAlt(localContext, 1); { - this.state = 94; + this.state = 99; this.match(DQLParser.PHRASE); } break; case DQLParser.NUMBER: this.enterOuterAlt(localContext, 2); { - this.state = 95; + this.state = 100; this.match(DQLParser.NUMBER); } break; case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 3); { - this.state = 96; + this.state = 101; this.termSearch(); } break; @@ -573,7 +587,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 99; + this.state = 104; _la = this.tokenStream.LA(1); if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 240) !== 0))) { this.errorHandler.recoverInline(this); @@ -599,37 +613,39 @@ export class DQLParser extends antlr.Parser { } public static readonly _serializedATN: number[] = [ - 4,1,15,102,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,1,14,107,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, 1,0,1,0,1,1,1,1,1,1,5,1,34,8,1,10,1,12,1,37,9,1,1,2,1,2,1,2,5,2, 42,8,2,10,2,12,2,45,9,2,1,3,1,3,1,3,3,3,50,8,3,1,4,1,4,1,4,1,4,1, 4,1,4,1,4,3,4,59,8,4,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,3,6,69,8,6, - 1,7,1,7,1,8,1,8,1,8,1,8,3,8,77,8,8,1,8,5,8,80,8,8,10,8,12,8,83,9, - 8,1,8,1,8,1,9,1,9,3,9,89,8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12, - 3,12,98,8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,14,16,18,20,22, - 24,26,0,3,1,0,1,2,1,0,12,13,1,0,4,7,99,0,28,1,0,0,0,2,30,1,0,0,0, - 4,38,1,0,0,0,6,49,1,0,0,0,8,58,1,0,0,0,10,60,1,0,0,0,12,64,1,0,0, - 0,14,70,1,0,0,0,16,72,1,0,0,0,18,88,1,0,0,0,20,90,1,0,0,0,22,92, - 1,0,0,0,24,97,1,0,0,0,26,99,1,0,0,0,28,29,3,2,1,0,29,1,1,0,0,0,30, - 35,3,4,2,0,31,32,5,1,0,0,32,34,3,4,2,0,33,31,1,0,0,0,34,37,1,0,0, - 0,35,33,1,0,0,0,35,36,1,0,0,0,36,3,1,0,0,0,37,35,1,0,0,0,38,43,3, - 6,3,0,39,40,5,2,0,0,40,42,3,6,3,0,41,39,1,0,0,0,42,45,1,0,0,0,43, - 41,1,0,0,0,43,44,1,0,0,0,44,5,1,0,0,0,45,43,1,0,0,0,46,47,5,3,0, - 0,47,50,3,6,3,0,48,50,3,8,4,0,49,46,1,0,0,0,49,48,1,0,0,0,50,7,1, - 0,0,0,51,52,5,9,0,0,52,53,3,0,0,0,53,54,5,10,0,0,54,59,1,0,0,0,55, - 59,3,10,5,0,56,59,3,12,6,0,57,59,3,14,7,0,58,51,1,0,0,0,58,55,1, - 0,0,0,58,56,1,0,0,0,58,57,1,0,0,0,59,9,1,0,0,0,60,61,3,20,10,0,61, - 62,3,26,13,0,62,63,3,22,11,0,63,11,1,0,0,0,64,65,3,20,10,0,65,68, - 5,8,0,0,66,69,3,24,12,0,67,69,3,16,8,0,68,66,1,0,0,0,68,67,1,0,0, - 0,69,13,1,0,0,0,70,71,5,14,0,0,71,15,1,0,0,0,72,73,5,9,0,0,73,81, - 3,18,9,0,74,76,7,0,0,0,75,77,5,3,0,0,76,75,1,0,0,0,76,77,1,0,0,0, - 77,78,1,0,0,0,78,80,3,18,9,0,79,74,1,0,0,0,80,83,1,0,0,0,81,79,1, - 0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,81,1,0,0,0,84,85,5,10,0,0,85, - 17,1,0,0,0,86,89,3,16,8,0,87,89,3,24,12,0,88,86,1,0,0,0,88,87,1, - 0,0,0,89,19,1,0,0,0,90,91,5,14,0,0,91,21,1,0,0,0,92,93,7,1,0,0,93, - 23,1,0,0,0,94,98,5,12,0,0,95,98,5,13,0,0,96,98,3,14,7,0,97,94,1, - 0,0,0,97,95,1,0,0,0,97,96,1,0,0,0,98,25,1,0,0,0,99,100,7,2,0,0,100, - 27,1,0,0,0,9,35,43,49,58,68,76,81,88,97 + 1,7,1,7,5,7,73,8,7,10,7,12,7,76,9,7,1,8,1,8,1,8,1,8,3,8,82,8,8,1, + 8,5,8,85,8,8,10,8,12,8,88,9,8,1,8,1,8,1,9,1,9,3,9,94,8,9,1,10,1, + 10,1,11,1,11,1,12,1,12,1,12,3,12,103,8,12,1,13,1,13,1,13,0,0,14, + 0,2,4,6,8,10,12,14,16,18,20,22,24,26,0,3,1,0,1,2,1,0,11,12,1,0,4, + 7,105,0,28,1,0,0,0,2,30,1,0,0,0,4,38,1,0,0,0,6,49,1,0,0,0,8,58,1, + 0,0,0,10,60,1,0,0,0,12,64,1,0,0,0,14,70,1,0,0,0,16,77,1,0,0,0,18, + 93,1,0,0,0,20,95,1,0,0,0,22,97,1,0,0,0,24,102,1,0,0,0,26,104,1,0, + 0,0,28,29,3,2,1,0,29,1,1,0,0,0,30,35,3,4,2,0,31,32,5,1,0,0,32,34, + 3,4,2,0,33,31,1,0,0,0,34,37,1,0,0,0,35,33,1,0,0,0,35,36,1,0,0,0, + 36,3,1,0,0,0,37,35,1,0,0,0,38,43,3,6,3,0,39,40,5,2,0,0,40,42,3,6, + 3,0,41,39,1,0,0,0,42,45,1,0,0,0,43,41,1,0,0,0,43,44,1,0,0,0,44,5, + 1,0,0,0,45,43,1,0,0,0,46,47,5,3,0,0,47,50,3,6,3,0,48,50,3,8,4,0, + 49,46,1,0,0,0,49,48,1,0,0,0,50,7,1,0,0,0,51,52,5,9,0,0,52,53,3,0, + 0,0,53,54,5,10,0,0,54,59,1,0,0,0,55,59,3,10,5,0,56,59,3,12,6,0,57, + 59,3,14,7,0,58,51,1,0,0,0,58,55,1,0,0,0,58,56,1,0,0,0,58,57,1,0, + 0,0,59,9,1,0,0,0,60,61,3,20,10,0,61,62,3,26,13,0,62,63,3,22,11,0, + 63,11,1,0,0,0,64,65,3,20,10,0,65,68,5,8,0,0,66,69,3,24,12,0,67,69, + 3,16,8,0,68,66,1,0,0,0,68,67,1,0,0,0,69,13,1,0,0,0,70,74,5,13,0, + 0,71,73,5,13,0,0,72,71,1,0,0,0,73,76,1,0,0,0,74,72,1,0,0,0,74,75, + 1,0,0,0,75,15,1,0,0,0,76,74,1,0,0,0,77,78,5,9,0,0,78,86,3,18,9,0, + 79,81,7,0,0,0,80,82,5,3,0,0,81,80,1,0,0,0,81,82,1,0,0,0,82,83,1, + 0,0,0,83,85,3,18,9,0,84,79,1,0,0,0,85,88,1,0,0,0,86,84,1,0,0,0,86, + 87,1,0,0,0,87,89,1,0,0,0,88,86,1,0,0,0,89,90,5,10,0,0,90,17,1,0, + 0,0,91,94,3,16,8,0,92,94,3,24,12,0,93,91,1,0,0,0,93,92,1,0,0,0,94, + 19,1,0,0,0,95,96,5,13,0,0,96,21,1,0,0,0,97,98,7,1,0,0,98,23,1,0, + 0,0,99,103,5,11,0,0,100,103,5,12,0,0,101,103,3,14,7,0,102,99,1,0, + 0,0,102,100,1,0,0,0,102,101,1,0,0,0,103,25,1,0,0,0,104,105,7,2,0, + 0,105,27,1,0,0,0,10,35,43,49,58,68,74,81,86,93,102 ]; private static __ATN: antlr.ATN; @@ -931,8 +947,14 @@ export class TermSearchContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public IDENTIFIER(): antlr.TerminalNode { - return this.getToken(DQLParser.IDENTIFIER, 0)!; + public IDENTIFIER(): antlr.TerminalNode[]; + public IDENTIFIER(i: number): antlr.TerminalNode | null; + public IDENTIFIER(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(DQLParser.IDENTIFIER); + } else { + return this.getToken(DQLParser.IDENTIFIER, i); + } } public override get ruleIndex(): number { return DQLParser.RULE_termSearch; diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp index 370011ad4a31..d9b1db4ba256 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp @@ -10,7 +10,6 @@ null ':' '(' ')' -'.' null null null @@ -28,7 +27,6 @@ LE EQ LPAREN RPAREN -DOT PHRASE NUMBER IDENTIFIER @@ -45,7 +43,6 @@ LE EQ LPAREN RPAREN -DOT PHRASE NUMBER IDENTIFIER @@ -59,4 +56,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 15, 99, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 5, 11, 63, 8, 11, 10, 11, 12, 11, 66, 9, 11, 1, 11, 1, 11, 1, 12, 3, 12, 71, 8, 12, 1, 12, 4, 12, 74, 8, 12, 11, 12, 12, 12, 75, 1, 12, 1, 12, 4, 12, 80, 8, 12, 11, 12, 12, 12, 81, 3, 12, 84, 8, 12, 1, 13, 1, 13, 5, 13, 88, 8, 13, 10, 13, 12, 13, 91, 9, 13, 1, 14, 4, 14, 94, 8, 14, 11, 14, 12, 14, 95, 1, 14, 1, 14, 0, 0, 15, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 5, 0, 42, 42, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 105, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 1, 31, 1, 0, 0, 0, 3, 34, 1, 0, 0, 0, 5, 38, 1, 0, 0, 0, 7, 42, 1, 0, 0, 0, 9, 44, 1, 0, 0, 0, 11, 46, 1, 0, 0, 0, 13, 49, 1, 0, 0, 0, 15, 52, 1, 0, 0, 0, 17, 54, 1, 0, 0, 0, 19, 56, 1, 0, 0, 0, 21, 58, 1, 0, 0, 0, 23, 60, 1, 0, 0, 0, 25, 70, 1, 0, 0, 0, 27, 85, 1, 0, 0, 0, 29, 93, 1, 0, 0, 0, 31, 32, 7, 0, 0, 0, 32, 33, 7, 1, 0, 0, 33, 2, 1, 0, 0, 0, 34, 35, 7, 2, 0, 0, 35, 36, 7, 3, 0, 0, 36, 37, 7, 4, 0, 0, 37, 4, 1, 0, 0, 0, 38, 39, 7, 3, 0, 0, 39, 40, 7, 0, 0, 0, 40, 41, 7, 5, 0, 0, 41, 6, 1, 0, 0, 0, 42, 43, 5, 62, 0, 0, 43, 8, 1, 0, 0, 0, 44, 45, 5, 60, 0, 0, 45, 10, 1, 0, 0, 0, 46, 47, 5, 62, 0, 0, 47, 48, 5, 61, 0, 0, 48, 12, 1, 0, 0, 0, 49, 50, 5, 60, 0, 0, 50, 51, 5, 61, 0, 0, 51, 14, 1, 0, 0, 0, 52, 53, 5, 58, 0, 0, 53, 16, 1, 0, 0, 0, 54, 55, 5, 40, 0, 0, 55, 18, 1, 0, 0, 0, 56, 57, 5, 41, 0, 0, 57, 20, 1, 0, 0, 0, 58, 59, 5, 46, 0, 0, 59, 22, 1, 0, 0, 0, 60, 64, 5, 34, 0, 0, 61, 63, 8, 6, 0, 0, 62, 61, 1, 0, 0, 0, 63, 66, 1, 0, 0, 0, 64, 62, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 67, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 68, 5, 34, 0, 0, 68, 24, 1, 0, 0, 0, 69, 71, 5, 45, 0, 0, 70, 69, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 73, 1, 0, 0, 0, 72, 74, 7, 7, 0, 0, 73, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 83, 1, 0, 0, 0, 77, 79, 5, 46, 0, 0, 78, 80, 7, 7, 0, 0, 79, 78, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 77, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 26, 1, 0, 0, 0, 85, 89, 7, 8, 0, 0, 86, 88, 7, 9, 0, 0, 87, 86, 1, 0, 0, 0, 88, 91, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 28, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 92, 94, 7, 10, 0, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 6, 14, 0, 0, 98, 30, 1, 0, 0, 0, 8, 0, 64, 70, 75, 81, 83, 89, 95, 1, 0, 1, 0] \ No newline at end of file +[4, 0, 14, 95, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 59, 8, 10, 10, 10, 12, 10, 62, 9, 10, 1, 10, 1, 10, 1, 11, 3, 11, 67, 8, 11, 1, 11, 4, 11, 70, 8, 11, 11, 11, 12, 11, 71, 1, 11, 1, 11, 4, 11, 76, 8, 11, 11, 11, 12, 11, 77, 3, 11, 80, 8, 11, 1, 12, 1, 12, 5, 12, 84, 8, 12, 10, 12, 12, 12, 87, 9, 12, 1, 13, 4, 13, 90, 8, 13, 11, 13, 12, 13, 91, 1, 13, 1, 13, 0, 0, 14, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 101, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 1, 29, 1, 0, 0, 0, 3, 32, 1, 0, 0, 0, 5, 36, 1, 0, 0, 0, 7, 40, 1, 0, 0, 0, 9, 42, 1, 0, 0, 0, 11, 44, 1, 0, 0, 0, 13, 47, 1, 0, 0, 0, 15, 50, 1, 0, 0, 0, 17, 52, 1, 0, 0, 0, 19, 54, 1, 0, 0, 0, 21, 56, 1, 0, 0, 0, 23, 66, 1, 0, 0, 0, 25, 81, 1, 0, 0, 0, 27, 89, 1, 0, 0, 0, 29, 30, 7, 0, 0, 0, 30, 31, 7, 1, 0, 0, 31, 2, 1, 0, 0, 0, 32, 33, 7, 2, 0, 0, 33, 34, 7, 3, 0, 0, 34, 35, 7, 4, 0, 0, 35, 4, 1, 0, 0, 0, 36, 37, 7, 3, 0, 0, 37, 38, 7, 0, 0, 0, 38, 39, 7, 5, 0, 0, 39, 6, 1, 0, 0, 0, 40, 41, 5, 62, 0, 0, 41, 8, 1, 0, 0, 0, 42, 43, 5, 60, 0, 0, 43, 10, 1, 0, 0, 0, 44, 45, 5, 62, 0, 0, 45, 46, 5, 61, 0, 0, 46, 12, 1, 0, 0, 0, 47, 48, 5, 60, 0, 0, 48, 49, 5, 61, 0, 0, 49, 14, 1, 0, 0, 0, 50, 51, 5, 58, 0, 0, 51, 16, 1, 0, 0, 0, 52, 53, 5, 40, 0, 0, 53, 18, 1, 0, 0, 0, 54, 55, 5, 41, 0, 0, 55, 20, 1, 0, 0, 0, 56, 60, 5, 34, 0, 0, 57, 59, 8, 6, 0, 0, 58, 57, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 63, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 63, 64, 5, 34, 0, 0, 64, 22, 1, 0, 0, 0, 65, 67, 5, 45, 0, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 69, 1, 0, 0, 0, 68, 70, 7, 7, 0, 0, 69, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 79, 1, 0, 0, 0, 73, 75, 5, 46, 0, 0, 74, 76, 7, 7, 0, 0, 75, 74, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 1, 0, 0, 0, 79, 73, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 24, 1, 0, 0, 0, 81, 85, 7, 8, 0, 0, 82, 84, 7, 9, 0, 0, 83, 82, 1, 0, 0, 0, 84, 87, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 26, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 88, 90, 7, 10, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 13, 0, 0, 94, 28, 1, 0, 0, 0, 8, 0, 60, 66, 71, 77, 79, 85, 91, 1, 0, 1, 0] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java index c486c68bd632..cb8768eb8383 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java @@ -17,7 +17,7 @@ public class DQLLexer extends Lexer { new PredictionContextCache(); public static final int OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, - DOT=11, PHRASE=12, NUMBER=13, IDENTIFIER=14, WS=15; + PHRASE=11, NUMBER=12, IDENTIFIER=13, WS=14; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; @@ -29,22 +29,21 @@ public class DQLLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "PHRASE", "NUMBER", "IDENTIFIER", "WS" }; } public static final String[] ruleNames = makeRuleNames(); private static String[] makeLiteralNames() { return new String[] { - null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", "')'", - "'.'" + null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", "')'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "PHRASE", "NUMBER", "IDENTIFIER", "WS" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); @@ -106,67 +105,65 @@ public DQLLexer(CharStream input) { public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\u0004\u0000\u000fc\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ + "\u0004\u0000\u000e_\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+ "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+ "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+ - "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0001"+ - "\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+ - "\u0001\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0001"+ - "\u0003\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+ - "\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001\b\u0001\b"+ - "\u0001\t\u0001\t\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0005\u000b?"+ - "\b\u000b\n\u000b\f\u000bB\t\u000b\u0001\u000b\u0001\u000b\u0001\f\u0003"+ - "\fG\b\f\u0001\f\u0004\fJ\b\f\u000b\f\f\fK\u0001\f\u0001\f\u0004\fP\b\f"+ - "\u000b\f\f\fQ\u0003\fT\b\f\u0001\r\u0001\r\u0005\rX\b\r\n\r\f\r[\t\r\u0001"+ - "\u000e\u0004\u000e^\b\u000e\u000b\u000e\f\u000e_\u0001\u000e\u0001\u000e"+ - "\u0000\u0000\u000f\u0001\u0001\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005"+ - "\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019"+ - "\r\u001b\u000e\u001d\u000f\u0001\u0000\u000b\u0002\u0000OOoo\u0002\u0000"+ - "RRrr\u0002\u0000AAaa\u0002\u0000NNnn\u0002\u0000DDdd\u0002\u0000TTtt\u0002"+ - "\u0000\"\"\\\\\u0001\u000009\u0004\u0000**AZ__az\u0005\u0000**09AZ__a"+ - "z\u0003\u0000\t\n\r\r i\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0003"+ - "\u0001\u0000\u0000\u0000\u0000\u0005\u0001\u0000\u0000\u0000\u0000\u0007"+ - "\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u000b\u0001"+ - "\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000\u0000\u0000\u000f\u0001\u0000"+ - "\u0000\u0000\u0000\u0011\u0001\u0000\u0000\u0000\u0000\u0013\u0001\u0000"+ - "\u0000\u0000\u0000\u0015\u0001\u0000\u0000\u0000\u0000\u0017\u0001\u0000"+ - "\u0000\u0000\u0000\u0019\u0001\u0000\u0000\u0000\u0000\u001b\u0001\u0000"+ - "\u0000\u0000\u0000\u001d\u0001\u0000\u0000\u0000\u0001\u001f\u0001\u0000"+ - "\u0000\u0000\u0003\"\u0001\u0000\u0000\u0000\u0005&\u0001\u0000\u0000"+ - "\u0000\u0007*\u0001\u0000\u0000\u0000\t,\u0001\u0000\u0000\u0000\u000b"+ - ".\u0001\u0000\u0000\u0000\r1\u0001\u0000\u0000\u0000\u000f4\u0001\u0000"+ - "\u0000\u0000\u00116\u0001\u0000\u0000\u0000\u00138\u0001\u0000\u0000\u0000"+ - "\u0015:\u0001\u0000\u0000\u0000\u0017<\u0001\u0000\u0000\u0000\u0019F"+ - "\u0001\u0000\u0000\u0000\u001bU\u0001\u0000\u0000\u0000\u001d]\u0001\u0000"+ - "\u0000\u0000\u001f \u0007\u0000\u0000\u0000 !\u0007\u0001\u0000\u0000"+ - "!\u0002\u0001\u0000\u0000\u0000\"#\u0007\u0002\u0000\u0000#$\u0007\u0003"+ - "\u0000\u0000$%\u0007\u0004\u0000\u0000%\u0004\u0001\u0000\u0000\u0000"+ - "&\'\u0007\u0003\u0000\u0000\'(\u0007\u0000\u0000\u0000()\u0007\u0005\u0000"+ - "\u0000)\u0006\u0001\u0000\u0000\u0000*+\u0005>\u0000\u0000+\b\u0001\u0000"+ - "\u0000\u0000,-\u0005<\u0000\u0000-\n\u0001\u0000\u0000\u0000./\u0005>"+ - "\u0000\u0000/0\u0005=\u0000\u00000\f\u0001\u0000\u0000\u000012\u0005<"+ - "\u0000\u000023\u0005=\u0000\u00003\u000e\u0001\u0000\u0000\u000045\u0005"+ - ":\u0000\u00005\u0010\u0001\u0000\u0000\u000067\u0005(\u0000\u00007\u0012"+ - "\u0001\u0000\u0000\u000089\u0005)\u0000\u00009\u0014\u0001\u0000\u0000"+ - "\u0000:;\u0005.\u0000\u0000;\u0016\u0001\u0000\u0000\u0000<@\u0005\"\u0000"+ - "\u0000=?\b\u0006\u0000\u0000>=\u0001\u0000\u0000\u0000?B\u0001\u0000\u0000"+ - "\u0000@>\u0001\u0000\u0000\u0000@A\u0001\u0000\u0000\u0000AC\u0001\u0000"+ - "\u0000\u0000B@\u0001\u0000\u0000\u0000CD\u0005\"\u0000\u0000D\u0018\u0001"+ - "\u0000\u0000\u0000EG\u0005-\u0000\u0000FE\u0001\u0000\u0000\u0000FG\u0001"+ - "\u0000\u0000\u0000GI\u0001\u0000\u0000\u0000HJ\u0007\u0007\u0000\u0000"+ - "IH\u0001\u0000\u0000\u0000JK\u0001\u0000\u0000\u0000KI\u0001\u0000\u0000"+ - "\u0000KL\u0001\u0000\u0000\u0000LS\u0001\u0000\u0000\u0000MO\u0005.\u0000"+ - "\u0000NP\u0007\u0007\u0000\u0000ON\u0001\u0000\u0000\u0000PQ\u0001\u0000"+ - "\u0000\u0000QO\u0001\u0000\u0000\u0000QR\u0001\u0000\u0000\u0000RT\u0001"+ - "\u0000\u0000\u0000SM\u0001\u0000\u0000\u0000ST\u0001\u0000\u0000\u0000"+ - "T\u001a\u0001\u0000\u0000\u0000UY\u0007\b\u0000\u0000VX\u0007\t\u0000"+ - "\u0000WV\u0001\u0000\u0000\u0000X[\u0001\u0000\u0000\u0000YW\u0001\u0000"+ - "\u0000\u0000YZ\u0001\u0000\u0000\u0000Z\u001c\u0001\u0000\u0000\u0000"+ - "[Y\u0001\u0000\u0000\u0000\\^\u0007\n\u0000\u0000]\\\u0001\u0000\u0000"+ - "\u0000^_\u0001\u0000\u0000\u0000_]\u0001\u0000\u0000\u0000_`\u0001\u0000"+ - "\u0000\u0000`a\u0001\u0000\u0000\u0000ab\u0006\u000e\u0000\u0000b\u001e"+ - "\u0001\u0000\u0000\u0000\b\u0000@FKQSY_\u0001\u0000\u0001\u0000"; + "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001"+ + "\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0002\u0001"+ + "\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0004\u0001"+ + "\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001"+ + "\u0006\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001\t\u0001\t\u0001\n"+ + "\u0001\n\u0005\n;\b\n\n\n\f\n>\t\n\u0001\n\u0001\n\u0001\u000b\u0003\u000b"+ + "C\b\u000b\u0001\u000b\u0004\u000bF\b\u000b\u000b\u000b\f\u000bG\u0001"+ + "\u000b\u0001\u000b\u0004\u000bL\b\u000b\u000b\u000b\f\u000bM\u0003\u000b"+ + "P\b\u000b\u0001\f\u0001\f\u0005\fT\b\f\n\f\f\fW\t\f\u0001\r\u0004\rZ\b"+ + "\r\u000b\r\f\r[\u0001\r\u0001\r\u0000\u0000\u000e\u0001\u0001\u0003\u0002"+ + "\u0005\u0003\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013"+ + "\n\u0015\u000b\u0017\f\u0019\r\u001b\u000e\u0001\u0000\u000b\u0002\u0000"+ + "OOoo\u0002\u0000RRrr\u0002\u0000AAaa\u0002\u0000NNnn\u0002\u0000DDdd\u0002"+ + "\u0000TTtt\u0002\u0000\"\"\\\\\u0001\u000009\u0004\u0000**AZ__az\u0006"+ + "\u0000**..09AZ__az\u0003\u0000\t\n\r\r e\u0000\u0001\u0001\u0000\u0000"+ + "\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001\u0000\u0000"+ + "\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000"+ + "\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000\u0000\u0000"+ + "\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000\u0000\u0000"+ + "\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000\u0000\u0000"+ + "\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000\u0000\u0000"+ + "\u001b\u0001\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000\u0000\u0003"+ + " \u0001\u0000\u0000\u0000\u0005$\u0001\u0000\u0000\u0000\u0007(\u0001"+ + "\u0000\u0000\u0000\t*\u0001\u0000\u0000\u0000\u000b,\u0001\u0000\u0000"+ + "\u0000\r/\u0001\u0000\u0000\u0000\u000f2\u0001\u0000\u0000\u0000\u0011"+ + "4\u0001\u0000\u0000\u0000\u00136\u0001\u0000\u0000\u0000\u00158\u0001"+ + "\u0000\u0000\u0000\u0017B\u0001\u0000\u0000\u0000\u0019Q\u0001\u0000\u0000"+ + "\u0000\u001bY\u0001\u0000\u0000\u0000\u001d\u001e\u0007\u0000\u0000\u0000"+ + "\u001e\u001f\u0007\u0001\u0000\u0000\u001f\u0002\u0001\u0000\u0000\u0000"+ + " !\u0007\u0002\u0000\u0000!\"\u0007\u0003\u0000\u0000\"#\u0007\u0004\u0000"+ + "\u0000#\u0004\u0001\u0000\u0000\u0000$%\u0007\u0003\u0000\u0000%&\u0007"+ + "\u0000\u0000\u0000&\'\u0007\u0005\u0000\u0000\'\u0006\u0001\u0000\u0000"+ + "\u0000()\u0005>\u0000\u0000)\b\u0001\u0000\u0000\u0000*+\u0005<\u0000"+ + "\u0000+\n\u0001\u0000\u0000\u0000,-\u0005>\u0000\u0000-.\u0005=\u0000"+ + "\u0000.\f\u0001\u0000\u0000\u0000/0\u0005<\u0000\u000001\u0005=\u0000"+ + "\u00001\u000e\u0001\u0000\u0000\u000023\u0005:\u0000\u00003\u0010\u0001"+ + "\u0000\u0000\u000045\u0005(\u0000\u00005\u0012\u0001\u0000\u0000\u0000"+ + "67\u0005)\u0000\u00007\u0014\u0001\u0000\u0000\u00008<\u0005\"\u0000\u0000"+ + "9;\b\u0006\u0000\u0000:9\u0001\u0000\u0000\u0000;>\u0001\u0000\u0000\u0000"+ + "<:\u0001\u0000\u0000\u0000<=\u0001\u0000\u0000\u0000=?\u0001\u0000\u0000"+ + "\u0000><\u0001\u0000\u0000\u0000?@\u0005\"\u0000\u0000@\u0016\u0001\u0000"+ + "\u0000\u0000AC\u0005-\u0000\u0000BA\u0001\u0000\u0000\u0000BC\u0001\u0000"+ + "\u0000\u0000CE\u0001\u0000\u0000\u0000DF\u0007\u0007\u0000\u0000ED\u0001"+ + "\u0000\u0000\u0000FG\u0001\u0000\u0000\u0000GE\u0001\u0000\u0000\u0000"+ + "GH\u0001\u0000\u0000\u0000HO\u0001\u0000\u0000\u0000IK\u0005.\u0000\u0000"+ + "JL\u0007\u0007\u0000\u0000KJ\u0001\u0000\u0000\u0000LM\u0001\u0000\u0000"+ + "\u0000MK\u0001\u0000\u0000\u0000MN\u0001\u0000\u0000\u0000NP\u0001\u0000"+ + "\u0000\u0000OI\u0001\u0000\u0000\u0000OP\u0001\u0000\u0000\u0000P\u0018"+ + "\u0001\u0000\u0000\u0000QU\u0007\b\u0000\u0000RT\u0007\t\u0000\u0000S"+ + "R\u0001\u0000\u0000\u0000TW\u0001\u0000\u0000\u0000US\u0001\u0000\u0000"+ + "\u0000UV\u0001\u0000\u0000\u0000V\u001a\u0001\u0000\u0000\u0000WU\u0001"+ + "\u0000\u0000\u0000XZ\u0007\n\u0000\u0000YX\u0001\u0000\u0000\u0000Z[\u0001"+ + "\u0000\u0000\u0000[Y\u0001\u0000\u0000\u0000[\\\u0001\u0000\u0000\u0000"+ + "\\]\u0001\u0000\u0000\u0000]^\u0006\r\u0000\u0000^\u001c\u0001\u0000\u0000"+ + "\u0000\b\u0000'=4 '<'=5 '>='=6 @@ -20,4 +19,3 @@ WS=15 ':'=8 '('=9 ')'=10 -'.'=11 diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp index 243a73d55843..1d85f870d100 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -52,4 +52,4 @@ comparisonOperator atn: -[4, 1, 15, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 69, 8, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 77, 8, 8, 1, 8, 5, 8, 80, 8, 8, 10, 8, 12, 8, 83, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 89, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 70, 1, 0, 0, 0, 16, 72, 1, 0, 0, 0, 18, 88, 1, 0, 0, 0, 20, 90, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 68, 5, 8, 0, 0, 66, 69, 3, 24, 12, 0, 67, 69, 3, 16, 8, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 13, 1, 0, 0, 0, 70, 71, 5, 14, 0, 0, 71, 15, 1, 0, 0, 0, 72, 73, 5, 9, 0, 0, 73, 81, 3, 18, 9, 0, 74, 76, 7, 0, 0, 0, 75, 77, 5, 3, 0, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 3, 18, 9, 0, 79, 74, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 85, 5, 10, 0, 0, 85, 17, 1, 0, 0, 0, 86, 89, 3, 16, 8, 0, 87, 89, 3, 24, 12, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 19, 1, 0, 0, 0, 90, 91, 5, 14, 0, 0, 91, 21, 1, 0, 0, 0, 92, 93, 7, 1, 0, 0, 93, 23, 1, 0, 0, 0, 94, 98, 5, 12, 0, 0, 95, 98, 5, 13, 0, 0, 96, 98, 3, 14, 7, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 9, 35, 43, 49, 58, 68, 76, 81, 88, 97] \ No newline at end of file +[4, 1, 15, 107, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 69, 8, 6, 1, 7, 1, 7, 5, 7, 73, 8, 7, 10, 7, 12, 7, 76, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 82, 8, 8, 1, 8, 5, 8, 85, 8, 8, 10, 8, 12, 8, 88, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 94, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 103, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 105, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 70, 1, 0, 0, 0, 16, 77, 1, 0, 0, 0, 18, 93, 1, 0, 0, 0, 20, 95, 1, 0, 0, 0, 22, 97, 1, 0, 0, 0, 24, 102, 1, 0, 0, 0, 26, 104, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 68, 5, 8, 0, 0, 66, 69, 3, 24, 12, 0, 67, 69, 3, 16, 8, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 13, 1, 0, 0, 0, 70, 74, 5, 14, 0, 0, 71, 73, 5, 14, 0, 0, 72, 71, 1, 0, 0, 0, 73, 76, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 15, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 78, 5, 9, 0, 0, 78, 86, 3, 18, 9, 0, 79, 81, 7, 0, 0, 0, 80, 82, 5, 3, 0, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 85, 3, 18, 9, 0, 84, 79, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 89, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 90, 5, 10, 0, 0, 90, 17, 1, 0, 0, 0, 91, 94, 3, 16, 8, 0, 92, 94, 3, 24, 12, 0, 93, 91, 1, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 19, 1, 0, 0, 0, 95, 96, 5, 14, 0, 0, 96, 21, 1, 0, 0, 0, 97, 98, 7, 1, 0, 0, 98, 23, 1, 0, 0, 0, 99, 103, 5, 12, 0, 0, 100, 103, 5, 13, 0, 0, 101, 103, 3, 14, 7, 0, 102, 99, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 25, 1, 0, 0, 0, 104, 105, 7, 2, 0, 0, 105, 27, 1, 0, 0, 0, 10, 35, 43, 49, 58, 68, 74, 81, 86, 93, 102] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index e022011150fd..97a606df9811 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -473,7 +473,10 @@ public final FieldExpressionContext fieldExpression() throws RecognitionExceptio @SuppressWarnings("CheckReturnValue") public static class TermSearchContext extends ParserRuleContext { - public TerminalNode IDENTIFIER() { return getToken(DQLParser.IDENTIFIER, 0); } + public List IDENTIFIER() { return getTokens(DQLParser.IDENTIFIER); } + public TerminalNode IDENTIFIER(int i) { + return getToken(DQLParser.IDENTIFIER, i); + } public TermSearchContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -483,11 +486,26 @@ public TermSearchContext(ParserRuleContext parent, int invokingState) { public final TermSearchContext termSearch() throws RecognitionException { TermSearchContext _localctx = new TermSearchContext(_ctx, getState()); enterRule(_localctx, 14, RULE_termSearch); + int _la; try { enterOuterAlt(_localctx, 1); { setState(70); match(IDENTIFIER); + setState(74); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==IDENTIFIER) { + { + { + setState(71); + match(IDENTIFIER); + } + } + setState(76); + _errHandler.sync(this); + _la = _input.LA(1); + } } } catch (RecognitionException re) { @@ -536,17 +554,17 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(72); + setState(77); match(LPAREN); - setState(73); + setState(78); groupContent(); - setState(81); + setState(86); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR || _la==AND) { { { - setState(74); + setState(79); _la = _input.LA(1); if ( !(_la==OR || _la==AND) ) { _errHandler.recoverInline(this); @@ -557,26 +575,26 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio consume(); } { - setState(76); + setState(81); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(75); + setState(80); match(NOT); } } } - setState(78); + setState(83); groupContent(); } } - setState(83); + setState(88); _errHandler.sync(this); _la = _input.LA(1); } - setState(84); + setState(89); match(RPAREN); } } @@ -609,13 +627,13 @@ public final GroupContentContext groupContent() throws RecognitionException { GroupContentContext _localctx = new GroupContentContext(_ctx, getState()); enterRule(_localctx, 18, RULE_groupContent); try { - setState(88); + setState(93); _errHandler.sync(this); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(86); + setState(91); groupExpression(); } break; @@ -624,7 +642,7 @@ public final GroupContentContext groupContent() throws RecognitionException { case IDENTIFIER: enterOuterAlt(_localctx, 2); { - setState(87); + setState(92); value(); } break; @@ -658,7 +676,7 @@ public final FieldContext field() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(90); + setState(95); match(IDENTIFIER); } } @@ -690,7 +708,7 @@ public final RangeValueContext rangeValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(92); + setState(97); _la = _input.LA(1); if ( !(_la==PHRASE || _la==NUMBER) ) { _errHandler.recoverInline(this); @@ -730,27 +748,27 @@ public final ValueContext value() throws RecognitionException { ValueContext _localctx = new ValueContext(_ctx, getState()); enterRule(_localctx, 24, RULE_value); try { - setState(97); + setState(102); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: enterOuterAlt(_localctx, 1); { - setState(94); + setState(99); match(PHRASE); } break; case NUMBER: enterOuterAlt(_localctx, 2); { - setState(95); + setState(100); match(NUMBER); } break; case IDENTIFIER: enterOuterAlt(_localctx, 3); { - setState(96); + setState(101); termSearch(); } break; @@ -788,7 +806,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(99); + setState(104); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 240L) != 0)) ) { _errHandler.recoverInline(this); @@ -812,7 +830,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx } public static final String _serializedATN = - "\u0004\u0001\u000ff\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u0001\u000fk\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ @@ -823,50 +841,53 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx "\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+ "\u0003\u0004;\b\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005"+ "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0003\u0006E\b\u0006"+ - "\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bM\b\b"+ - "\u0001\b\u0005\bP\b\b\n\b\f\bS\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003"+ - "\tY\b\t\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001"+ - "\f\u0003\fb\b\f\u0001\r\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002"+ - "\u0004\u0006\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003"+ - "\u0001\u0000\u0001\u0002\u0001\u0000\f\r\u0001\u0000\u0004\u0007c\u0000"+ - "\u001c\u0001\u0000\u0000\u0000\u0002\u001e\u0001\u0000\u0000\u0000\u0004"+ - "&\u0001\u0000\u0000\u0000\u00061\u0001\u0000\u0000\u0000\b:\u0001\u0000"+ - "\u0000\u0000\n<\u0001\u0000\u0000\u0000\f@\u0001\u0000\u0000\u0000\u000e"+ - "F\u0001\u0000\u0000\u0000\u0010H\u0001\u0000\u0000\u0000\u0012X\u0001"+ - "\u0000\u0000\u0000\u0014Z\u0001\u0000\u0000\u0000\u0016\\\u0001\u0000"+ - "\u0000\u0000\u0018a\u0001\u0000\u0000\u0000\u001ac\u0001\u0000\u0000\u0000"+ - "\u001c\u001d\u0003\u0002\u0001\u0000\u001d\u0001\u0001\u0000\u0000\u0000"+ - "\u001e#\u0003\u0004\u0002\u0000\u001f \u0005\u0001\u0000\u0000 \"\u0003"+ - "\u0004\u0002\u0000!\u001f\u0001\u0000\u0000\u0000\"%\u0001\u0000\u0000"+ - "\u0000#!\u0001\u0000\u0000\u0000#$\u0001\u0000\u0000\u0000$\u0003\u0001"+ - "\u0000\u0000\u0000%#\u0001\u0000\u0000\u0000&+\u0003\u0006\u0003\u0000"+ - "\'(\u0005\u0002\u0000\u0000(*\u0003\u0006\u0003\u0000)\'\u0001\u0000\u0000"+ - "\u0000*-\u0001\u0000\u0000\u0000+)\u0001\u0000\u0000\u0000+,\u0001\u0000"+ - "\u0000\u0000,\u0005\u0001\u0000\u0000\u0000-+\u0001\u0000\u0000\u0000"+ - "./\u0005\u0003\u0000\u0000/2\u0003\u0006\u0003\u000002\u0003\b\u0004\u0000"+ - "1.\u0001\u0000\u0000\u000010\u0001\u0000\u0000\u00002\u0007\u0001\u0000"+ - "\u0000\u000034\u0005\t\u0000\u000045\u0003\u0000\u0000\u000056\u0005\n"+ - "\u0000\u00006;\u0001\u0000\u0000\u00007;\u0003\n\u0005\u00008;\u0003\f"+ - "\u0006\u00009;\u0003\u000e\u0007\u0000:3\u0001\u0000\u0000\u0000:7\u0001"+ - "\u0000\u0000\u0000:8\u0001\u0000\u0000\u0000:9\u0001\u0000\u0000\u0000"+ - ";\t\u0001\u0000\u0000\u0000<=\u0003\u0014\n\u0000=>\u0003\u001a\r\u0000"+ - ">?\u0003\u0016\u000b\u0000?\u000b\u0001\u0000\u0000\u0000@A\u0003\u0014"+ - "\n\u0000AD\u0005\b\u0000\u0000BE\u0003\u0018\f\u0000CE\u0003\u0010\b\u0000"+ - "DB\u0001\u0000\u0000\u0000DC\u0001\u0000\u0000\u0000E\r\u0001\u0000\u0000"+ - "\u0000FG\u0005\u000e\u0000\u0000G\u000f\u0001\u0000\u0000\u0000HI\u0005"+ - "\t\u0000\u0000IQ\u0003\u0012\t\u0000JL\u0007\u0000\u0000\u0000KM\u0005"+ - "\u0003\u0000\u0000LK\u0001\u0000\u0000\u0000LM\u0001\u0000\u0000\u0000"+ - "MN\u0001\u0000\u0000\u0000NP\u0003\u0012\t\u0000OJ\u0001\u0000\u0000\u0000"+ - "PS\u0001\u0000\u0000\u0000QO\u0001\u0000\u0000\u0000QR\u0001\u0000\u0000"+ - "\u0000RT\u0001\u0000\u0000\u0000SQ\u0001\u0000\u0000\u0000TU\u0005\n\u0000"+ - "\u0000U\u0011\u0001\u0000\u0000\u0000VY\u0003\u0010\b\u0000WY\u0003\u0018"+ - "\f\u0000XV\u0001\u0000\u0000\u0000XW\u0001\u0000\u0000\u0000Y\u0013\u0001"+ - "\u0000\u0000\u0000Z[\u0005\u000e\u0000\u0000[\u0015\u0001\u0000\u0000"+ - "\u0000\\]\u0007\u0001\u0000\u0000]\u0017\u0001\u0000\u0000\u0000^b\u0005"+ - "\f\u0000\u0000_b\u0005\r\u0000\u0000`b\u0003\u000e\u0007\u0000a^\u0001"+ - "\u0000\u0000\u0000a_\u0001\u0000\u0000\u0000a`\u0001\u0000\u0000\u0000"+ - "b\u0019\u0001\u0000\u0000\u0000cd\u0007\u0002\u0000\u0000d\u001b\u0001"+ - "\u0000\u0000\u0000\t#+1:DLQXa"; + "\u0001\u0007\u0001\u0007\u0005\u0007I\b\u0007\n\u0007\f\u0007L\t\u0007"+ + "\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bR\b\b\u0001\b\u0005\bU\b\b\n\b"+ + "\f\bX\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\t^\b\t\u0001\n\u0001\n"+ + "\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0003\fg\b\f\u0001\r"+ + "\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002\u0004\u0006\b\n\f\u000e"+ + "\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003\u0001\u0000\u0001\u0002"+ + "\u0001\u0000\f\r\u0001\u0000\u0004\u0007i\u0000\u001c\u0001\u0000\u0000"+ + "\u0000\u0002\u001e\u0001\u0000\u0000\u0000\u0004&\u0001\u0000\u0000\u0000"+ + "\u00061\u0001\u0000\u0000\u0000\b:\u0001\u0000\u0000\u0000\n<\u0001\u0000"+ + "\u0000\u0000\f@\u0001\u0000\u0000\u0000\u000eF\u0001\u0000\u0000\u0000"+ + "\u0010M\u0001\u0000\u0000\u0000\u0012]\u0001\u0000\u0000\u0000\u0014_"+ + "\u0001\u0000\u0000\u0000\u0016a\u0001\u0000\u0000\u0000\u0018f\u0001\u0000"+ + "\u0000\u0000\u001ah\u0001\u0000\u0000\u0000\u001c\u001d\u0003\u0002\u0001"+ + "\u0000\u001d\u0001\u0001\u0000\u0000\u0000\u001e#\u0003\u0004\u0002\u0000"+ + "\u001f \u0005\u0001\u0000\u0000 \"\u0003\u0004\u0002\u0000!\u001f\u0001"+ + "\u0000\u0000\u0000\"%\u0001\u0000\u0000\u0000#!\u0001\u0000\u0000\u0000"+ + "#$\u0001\u0000\u0000\u0000$\u0003\u0001\u0000\u0000\u0000%#\u0001\u0000"+ + "\u0000\u0000&+\u0003\u0006\u0003\u0000\'(\u0005\u0002\u0000\u0000(*\u0003"+ + "\u0006\u0003\u0000)\'\u0001\u0000\u0000\u0000*-\u0001\u0000\u0000\u0000"+ + "+)\u0001\u0000\u0000\u0000+,\u0001\u0000\u0000\u0000,\u0005\u0001\u0000"+ + "\u0000\u0000-+\u0001\u0000\u0000\u0000./\u0005\u0003\u0000\u0000/2\u0003"+ + "\u0006\u0003\u000002\u0003\b\u0004\u00001.\u0001\u0000\u0000\u000010\u0001"+ + "\u0000\u0000\u00002\u0007\u0001\u0000\u0000\u000034\u0005\t\u0000\u0000"+ + "45\u0003\u0000\u0000\u000056\u0005\n\u0000\u00006;\u0001\u0000\u0000\u0000"+ + "7;\u0003\n\u0005\u00008;\u0003\f\u0006\u00009;\u0003\u000e\u0007\u0000"+ + ":3\u0001\u0000\u0000\u0000:7\u0001\u0000\u0000\u0000:8\u0001\u0000\u0000"+ + "\u0000:9\u0001\u0000\u0000\u0000;\t\u0001\u0000\u0000\u0000<=\u0003\u0014"+ + "\n\u0000=>\u0003\u001a\r\u0000>?\u0003\u0016\u000b\u0000?\u000b\u0001"+ + "\u0000\u0000\u0000@A\u0003\u0014\n\u0000AD\u0005\b\u0000\u0000BE\u0003"+ + "\u0018\f\u0000CE\u0003\u0010\b\u0000DB\u0001\u0000\u0000\u0000DC\u0001"+ + "\u0000\u0000\u0000E\r\u0001\u0000\u0000\u0000FJ\u0005\u000e\u0000\u0000"+ + "GI\u0005\u000e\u0000\u0000HG\u0001\u0000\u0000\u0000IL\u0001\u0000\u0000"+ + "\u0000JH\u0001\u0000\u0000\u0000JK\u0001\u0000\u0000\u0000K\u000f\u0001"+ + "\u0000\u0000\u0000LJ\u0001\u0000\u0000\u0000MN\u0005\t\u0000\u0000NV\u0003"+ + "\u0012\t\u0000OQ\u0007\u0000\u0000\u0000PR\u0005\u0003\u0000\u0000QP\u0001"+ + "\u0000\u0000\u0000QR\u0001\u0000\u0000\u0000RS\u0001\u0000\u0000\u0000"+ + "SU\u0003\u0012\t\u0000TO\u0001\u0000\u0000\u0000UX\u0001\u0000\u0000\u0000"+ + "VT\u0001\u0000\u0000\u0000VW\u0001\u0000\u0000\u0000WY\u0001\u0000\u0000"+ + "\u0000XV\u0001\u0000\u0000\u0000YZ\u0005\n\u0000\u0000Z\u0011\u0001\u0000"+ + "\u0000\u0000[^\u0003\u0010\b\u0000\\^\u0003\u0018\f\u0000][\u0001\u0000"+ + "\u0000\u0000]\\\u0001\u0000\u0000\u0000^\u0013\u0001\u0000\u0000\u0000"+ + "_`\u0005\u000e\u0000\u0000`\u0015\u0001\u0000\u0000\u0000ab\u0007\u0001"+ + "\u0000\u0000b\u0017\u0001\u0000\u0000\u0000cg\u0005\f\u0000\u0000dg\u0005"+ + "\r\u0000\u0000eg\u0003\u000e\u0007\u0000fc\u0001\u0000\u0000\u0000fd\u0001"+ + "\u0000\u0000\u0000fe\u0001\u0000\u0000\u0000g\u0019\u0001\u0000\u0000"+ + "\u0000hi\u0007\u0002\u0000\u0000i\u001b\u0001\u0000\u0000\u0000\n#+1:"+ + "DJQV]f"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 index 65af7662e999..bcb68062aeb7 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 @@ -15,12 +15,11 @@ EQ: ':'; // Delimiters LPAREN: '('; RPAREN: ')'; -DOT: '.'; // Literals PHRASE: '"' (~["\\])* '"'; NUMBER: '-'? [0-9]+ ('.' [0-9]+)?; -IDENTIFIER: [a-zA-Z_*][a-zA-Z0-9_*]*; +IDENTIFIER: [a-zA-Z_*][a-zA-Z0-9_.*]*; // SKIP WS: [ \t\r\n]+ -> channel(HIDDEN); \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index 05b2a8494093..a936c36df267 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -15,7 +15,7 @@ primaryExpression: | termSearch; comparisonExpression: field comparisonOperator rangeValue; fieldExpression: field EQ (value | groupExpression); -termSearch: IDENTIFIER; +termSearch: IDENTIFIER (IDENTIFIER)*; groupExpression: LPAREN groupContent ((OR | AND) (NOT?) groupContent)* RPAREN; groupContent: groupExpression | value; From 2217b039c900d4a485e78296aca598713bb0b9db Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Wed, 17 Jul 2024 11:53:59 -0700 Subject: [PATCH 09/34] value suggestions match field to avoid failing api call and to find assc keyword field Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 63 ++++++++++--------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 2602d8b69742..851190ca48b5 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -19,7 +19,6 @@ const findCursorIndex = ( for (let i = 0; i < tokenStream.size; i++) { const token = tokenStream.get(i); - // console.log('token:', token); const { startLine, endColumn, endLine } = getTokenPosition(token, whitespaceToken); // endColumn makes sense only if startLine === endLine @@ -41,7 +40,7 @@ const findCursorIndex = ( const findFieldSuggestions = (indexPattern: IndexPattern) => { const fieldNames: string[] = indexPattern.fields .getAll() - .filter((idxField: IndexPatternField) => !idxField.subType) + .filter((idxField: IndexPatternField) => !idxField.subType) // filter removed .keyword fields .map((idxField: { displayName: string }) => { return idxField.displayName; }); @@ -61,6 +60,24 @@ const findValuesFromField = async (indexTitle: string, fieldName: string) => { }); }; +// listener for parsing the current query +class FieldListener extends DQLParserListener { + lastField: string | undefined; + + constructor() { + super(); + this.lastField; + } + + public enterField = (ctx: FieldContext) => { + this.lastField = ctx.start?.text; + }; + + getLastField() { + return this.lastField; + } +} + export const getSuggestions = async ({ selectionStart, selectionEnd, @@ -74,25 +91,6 @@ export const getSuggestions = async ({ const lexer = new DQLLexer(inputStream); const tokenStream = new CommonTokenStream(lexer); const parser = new DQLParser(tokenStream); - // const tree = parser.query(); // used to check if parsing is happening properly - - // listener for parsing the current query - class FieldListener extends DQLParserListener { - lastField: string | undefined; - - constructor() { - super(); - this.lastField; - } - - public enterField = (ctx: FieldContext) => { - this.lastField = ctx.start?.text; - }; - - getLastField() { - return this.lastField; - } - } const listener = new FieldListener(); parser.addParseListener(listener); @@ -102,8 +100,6 @@ export const getSuggestions = async ({ const cursorIndex = findCursorIndex(tokenStream, { line: 1, column: selectionStart }, DQLParser.WS) ?? 0; - // console.log('cursor index:', cursorIndex); - const core = new CodeCompletionCore(parser); // specify preferred rules to appear in candidate collection @@ -113,7 +109,6 @@ export const getSuggestions = async ({ core.ignoredTokens = new Set([ DQLParser.LPAREN, DQLParser.RPAREN, - DQLParser.DOT, DQLParser.EQ, DQLParser.GE, DQLParser.GT, @@ -124,7 +119,6 @@ export const getSuggestions = async ({ // gets candidates at specified token index const candidates = core.collectCandidates(cursorIndex); - // console.log('candidates', candidates); let completions = []; @@ -133,9 +127,24 @@ export const getSuggestions = async ({ completions.push(...findFieldSuggestions(currentIndexPattern)); } + // find suggested values for the last found field const lastField = listener.getLastField(); if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { - const values = await findValuesFromField(currentIndexPattern.title, lastField); + // check to see if last field is within index and if it can suggest values, first check + // if .keyword appended field exists because that has values + const matchedField = + currentIndexPattern.fields.getAll().find((idxField: IndexPatternField) => { + // check to see if the field matches another field with .keyword appended + if (idxField.displayName === `${lastField}.keyword`) return idxField; + }) || + currentIndexPattern.fields.getAll().find((idxField: IndexPatternField) => { + // if the display name matches, return + if (idxField.displayName === lastField) return idxField; + }); + if (!matchedField || !matchedField.aggregatable || matchedField.type !== 'string') return; + + // ask api for suggestions + const values = await findValuesFromField(currentIndexPattern.title, matchedField.displayName); console.log(values); completions.push( ...values.map((val: any) => { @@ -155,7 +164,5 @@ export const getSuggestions = async ({ completions.push({ text: tokenSymbolName, type: 'keyword' }); }); - // console.log('completions', completions); - return completions; }; From 73f0ecdf7f8305b245a47be63a000ddeaf387060 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Wed, 17 Jul 2024 13:39:57 -0700 Subject: [PATCH 10/34] update value suggestions from partially formed value Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 851190ca48b5..08467d0f63d0 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,6 +1,6 @@ import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; import { DQLLexer } from './generated/DQLLexer'; -import { DQLParser, FieldContext } from './generated/DQLParser'; +import { DQLParser, FieldContext, ValueContext } from './generated/DQLParser'; import { CodeCompletionCore } from 'antlr4-c3'; import { getTokenPosition } from '../opensearch_sql/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; @@ -52,17 +52,18 @@ const findFieldSuggestions = (indexPattern: IndexPattern) => { return fieldSuggestions; }; -const findValuesFromField = async (indexTitle: string, fieldName: string) => { +const findValuesFromField = async (indexTitle: string, fieldName: string, currentValue: string) => { const http = getHttp(); return await http.fetch(`/api/opensearch-dashboards/suggestions/values/${indexTitle}`, { method: 'POST', - body: JSON.stringify({ query: '', field: fieldName, boolFilter: [] }), + body: JSON.stringify({ query: currentValue, field: fieldName, boolFilter: [] }), }); }; // listener for parsing the current query class FieldListener extends DQLParserListener { lastField: string | undefined; + lastValue: string | undefined; constructor() { super(); @@ -73,8 +74,12 @@ class FieldListener extends DQLParserListener { this.lastField = ctx.start?.text; }; - getLastField() { - return this.lastField; + public enterValue = (ctx: ValueContext) => { + this.lastValue = ctx.start?.text; + }; + + getLastFieldValue() { + return { field: this.lastField, value: this.lastValue }; } } @@ -128,7 +133,7 @@ export const getSuggestions = async ({ } // find suggested values for the last found field - const lastField = listener.getLastField(); + const { field: lastField, value: lastValue } = listener.getLastFieldValue(); if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { // check to see if last field is within index and if it can suggest values, first check // if .keyword appended field exists because that has values @@ -144,7 +149,11 @@ export const getSuggestions = async ({ if (!matchedField || !matchedField.aggregatable || matchedField.type !== 'string') return; // ask api for suggestions - const values = await findValuesFromField(currentIndexPattern.title, matchedField.displayName); + const values = await findValuesFromField( + currentIndexPattern.title, + matchedField.displayName, + lastValue ?? '' + ); console.log(values); completions.push( ...values.map((val: any) => { From abe398b53b238e3d53c19b7c78f725b38c341f1b Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Wed, 17 Jul 2024 16:01:18 -0700 Subject: [PATCH 11/34] refactor value suggestions and change fieldval listener to visitor Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 08467d0f63d0..eaad786a89d1 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,6 +1,11 @@ import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; import { DQLLexer } from './generated/DQLLexer'; -import { DQLParser, FieldContext, ValueContext } from './generated/DQLParser'; +import { + DQLParser, + FieldContext, + ValueContext, + FieldExpressionContext, +} from './generated/DQLParser'; import { CodeCompletionCore } from 'antlr4-c3'; import { getTokenPosition } from '../opensearch_sql/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; @@ -8,6 +13,7 @@ import { CursorPosition } from '../opensearch_sql/types'; import { getHttp } from '../../services'; import { DQLParserListener } from './generated/DQLParserListener'; import { QuerySuggestionGetFnArgs } from '../../autocomplete'; +import { DQLParserVisitor } from './generated/DQLParserVisitor'; const findCursorIndex = ( tokenStream: TokenStream, @@ -52,7 +58,11 @@ const findFieldSuggestions = (indexPattern: IndexPattern) => { return fieldSuggestions; }; -const findValuesFromField = async (indexTitle: string, fieldName: string, currentValue: string) => { +const getFieldSuggestedValues = async ( + indexTitle: string, + fieldName: string, + currentValue: string +) => { const http = getHttp(); return await http.fetch(`/api/opensearch-dashboards/suggestions/values/${indexTitle}`, { method: 'POST', @@ -60,27 +70,35 @@ const findValuesFromField = async (indexTitle: string, fieldName: string, curren }); }; -// listener for parsing the current query -class FieldListener extends DQLParserListener { - lastField: string | undefined; - lastValue: string | undefined; +const findValueSuggestions = async (index: IndexPattern, field: string, value: string) => { + // check to see if last field is within index and if it can suggest values, first check + // if .keyword appended field exists because that has values + const matchedField = + index.fields.getAll().find((idxField: IndexPatternField) => { + // check to see if the field matches another field with .keyword appended + if (idxField.displayName === `${field}.keyword`) return idxField; + }) || + index.fields.getAll().find((idxField: IndexPatternField) => { + // if the display name matches, return + if (idxField.displayName === field) return idxField; + }); - constructor() { - super(); - this.lastField; + if (matchedField?.type === 'boolean') { + return ['true', 'false']; } - public enterField = (ctx: FieldContext) => { - this.lastField = ctx.start?.text; - }; + if (!matchedField || !matchedField.aggregatable || matchedField.type !== 'string') return; - public enterValue = (ctx: ValueContext) => { - this.lastValue = ctx.start?.text; - }; + // ask api for suggestions + return await getFieldSuggestedValues(index.title, matchedField.displayName, value); +}; - getLastFieldValue() { - return { field: this.lastField, value: this.lastValue }; - } +// visitor for parsing the current query +class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { + public visitFieldExpression = (ctx: FieldExpressionContext) => { + console.log('value:', ctx); + return { field: ctx.field().getText(), value: ctx.value()?.getText() ?? '' }; + }; } export const getSuggestions = async ({ @@ -96,10 +114,9 @@ export const getSuggestions = async ({ const lexer = new DQLLexer(inputStream); const tokenStream = new CommonTokenStream(lexer); const parser = new DQLParser(tokenStream); + const tree = parser.query(); - const listener = new FieldListener(); - parser.addParseListener(listener); - parser.query(); + const visitor = new QueryVisitor(); // find token index const cursorIndex = @@ -133,28 +150,11 @@ export const getSuggestions = async ({ } // find suggested values for the last found field - const { field: lastField, value: lastValue } = listener.getLastFieldValue(); + const { field: lastField = '', value: lastValue = '' } = visitor.visit(tree) ?? {}; + // console.log('lastField: ', lastField); + console.log('lastValue: ', lastValue); if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { - // check to see if last field is within index and if it can suggest values, first check - // if .keyword appended field exists because that has values - const matchedField = - currentIndexPattern.fields.getAll().find((idxField: IndexPatternField) => { - // check to see if the field matches another field with .keyword appended - if (idxField.displayName === `${lastField}.keyword`) return idxField; - }) || - currentIndexPattern.fields.getAll().find((idxField: IndexPatternField) => { - // if the display name matches, return - if (idxField.displayName === lastField) return idxField; - }); - if (!matchedField || !matchedField.aggregatable || matchedField.type !== 'string') return; - - // ask api for suggestions - const values = await findValuesFromField( - currentIndexPattern.title, - matchedField.displayName, - lastValue ?? '' - ); - console.log(values); + const values = await findValueSuggestions(currentIndexPattern, lastField, lastValue ?? ''); completions.push( ...values.map((val: any) => { return { text: val, type: 'value' }; From 2b586d1db2ed6fac46ce74d851db0dfda4e32077 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Wed, 17 Jul 2024 16:56:54 -0700 Subject: [PATCH 12/34] implement value suggestions within phrases Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 20 +++- .../antlr/dql/generated/DQLLexer.interp | 2 +- .../public/antlr/dql/generated/DQLLexer.ts | 64 +++++------ .../antlr/dql/grammar/.antlr/DQLLexer.interp | 2 +- .../antlr/dql/grammar/.antlr/DQLLexer.java | 103 +++++++++--------- .../data/public/antlr/dql/grammar/DQLLexer.g4 | 2 +- 6 files changed, 105 insertions(+), 88 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index eaad786a89d1..1a98d10332bc 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -96,8 +96,24 @@ const findValueSuggestions = async (index: IndexPattern, field: string, value: s // visitor for parsing the current query class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { public visitFieldExpression = (ctx: FieldExpressionContext) => { - console.log('value:', ctx); - return { field: ctx.field().getText(), value: ctx.value()?.getText() ?? '' }; + let foundValue = ''; + + if (ctx.value()?.PHRASE()) { + const strippedPhrase = ctx + .value() + ?.PHRASE() + ?.getText() + .replace(/^["']|["']$/g, ''); + if (strippedPhrase) foundValue = strippedPhrase; + } + if (ctx.value()?.termSearch() || ctx.value()?.NUMBER()) { + const valueText = ctx.value()?.getText(); + if (valueText) foundValue = valueText; + } + // if (ctx.groupExpression()) { + // console.log('in a group'); + // } + return { field: ctx.field().getText(), value: foundValue }; }; } diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp index d9b1db4ba256..79935719e1a4 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp @@ -56,4 +56,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 14, 95, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 59, 8, 10, 10, 10, 12, 10, 62, 9, 10, 1, 10, 1, 10, 1, 11, 3, 11, 67, 8, 11, 1, 11, 4, 11, 70, 8, 11, 11, 11, 12, 11, 71, 1, 11, 1, 11, 4, 11, 76, 8, 11, 11, 11, 12, 11, 77, 3, 11, 80, 8, 11, 1, 12, 1, 12, 5, 12, 84, 8, 12, 10, 12, 12, 12, 87, 9, 12, 1, 13, 4, 13, 90, 8, 13, 11, 13, 12, 13, 91, 1, 13, 1, 13, 0, 0, 14, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 101, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 1, 29, 1, 0, 0, 0, 3, 32, 1, 0, 0, 0, 5, 36, 1, 0, 0, 0, 7, 40, 1, 0, 0, 0, 9, 42, 1, 0, 0, 0, 11, 44, 1, 0, 0, 0, 13, 47, 1, 0, 0, 0, 15, 50, 1, 0, 0, 0, 17, 52, 1, 0, 0, 0, 19, 54, 1, 0, 0, 0, 21, 56, 1, 0, 0, 0, 23, 66, 1, 0, 0, 0, 25, 81, 1, 0, 0, 0, 27, 89, 1, 0, 0, 0, 29, 30, 7, 0, 0, 0, 30, 31, 7, 1, 0, 0, 31, 2, 1, 0, 0, 0, 32, 33, 7, 2, 0, 0, 33, 34, 7, 3, 0, 0, 34, 35, 7, 4, 0, 0, 35, 4, 1, 0, 0, 0, 36, 37, 7, 3, 0, 0, 37, 38, 7, 0, 0, 0, 38, 39, 7, 5, 0, 0, 39, 6, 1, 0, 0, 0, 40, 41, 5, 62, 0, 0, 41, 8, 1, 0, 0, 0, 42, 43, 5, 60, 0, 0, 43, 10, 1, 0, 0, 0, 44, 45, 5, 62, 0, 0, 45, 46, 5, 61, 0, 0, 46, 12, 1, 0, 0, 0, 47, 48, 5, 60, 0, 0, 48, 49, 5, 61, 0, 0, 49, 14, 1, 0, 0, 0, 50, 51, 5, 58, 0, 0, 51, 16, 1, 0, 0, 0, 52, 53, 5, 40, 0, 0, 53, 18, 1, 0, 0, 0, 54, 55, 5, 41, 0, 0, 55, 20, 1, 0, 0, 0, 56, 60, 5, 34, 0, 0, 57, 59, 8, 6, 0, 0, 58, 57, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 63, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 63, 64, 5, 34, 0, 0, 64, 22, 1, 0, 0, 0, 65, 67, 5, 45, 0, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 69, 1, 0, 0, 0, 68, 70, 7, 7, 0, 0, 69, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 79, 1, 0, 0, 0, 73, 75, 5, 46, 0, 0, 74, 76, 7, 7, 0, 0, 75, 74, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 1, 0, 0, 0, 79, 73, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 24, 1, 0, 0, 0, 81, 85, 7, 8, 0, 0, 82, 84, 7, 9, 0, 0, 83, 82, 1, 0, 0, 0, 84, 87, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 26, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 88, 90, 7, 10, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 13, 0, 0, 94, 28, 1, 0, 0, 0, 8, 0, 60, 66, 71, 77, 79, 85, 91, 1, 0, 1, 0] \ No newline at end of file +[4, 0, 14, 96, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 59, 8, 10, 10, 10, 12, 10, 62, 9, 10, 1, 10, 3, 10, 65, 8, 10, 1, 11, 3, 11, 68, 8, 11, 1, 11, 4, 11, 71, 8, 11, 11, 11, 12, 11, 72, 1, 11, 1, 11, 4, 11, 77, 8, 11, 11, 11, 12, 11, 78, 3, 11, 81, 8, 11, 1, 12, 1, 12, 5, 12, 85, 8, 12, 10, 12, 12, 12, 88, 9, 12, 1, 13, 4, 13, 91, 8, 13, 11, 13, 12, 13, 92, 1, 13, 1, 13, 0, 0, 14, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 103, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 1, 29, 1, 0, 0, 0, 3, 32, 1, 0, 0, 0, 5, 36, 1, 0, 0, 0, 7, 40, 1, 0, 0, 0, 9, 42, 1, 0, 0, 0, 11, 44, 1, 0, 0, 0, 13, 47, 1, 0, 0, 0, 15, 50, 1, 0, 0, 0, 17, 52, 1, 0, 0, 0, 19, 54, 1, 0, 0, 0, 21, 56, 1, 0, 0, 0, 23, 67, 1, 0, 0, 0, 25, 82, 1, 0, 0, 0, 27, 90, 1, 0, 0, 0, 29, 30, 7, 0, 0, 0, 30, 31, 7, 1, 0, 0, 31, 2, 1, 0, 0, 0, 32, 33, 7, 2, 0, 0, 33, 34, 7, 3, 0, 0, 34, 35, 7, 4, 0, 0, 35, 4, 1, 0, 0, 0, 36, 37, 7, 3, 0, 0, 37, 38, 7, 0, 0, 0, 38, 39, 7, 5, 0, 0, 39, 6, 1, 0, 0, 0, 40, 41, 5, 62, 0, 0, 41, 8, 1, 0, 0, 0, 42, 43, 5, 60, 0, 0, 43, 10, 1, 0, 0, 0, 44, 45, 5, 62, 0, 0, 45, 46, 5, 61, 0, 0, 46, 12, 1, 0, 0, 0, 47, 48, 5, 60, 0, 0, 48, 49, 5, 61, 0, 0, 49, 14, 1, 0, 0, 0, 50, 51, 5, 58, 0, 0, 51, 16, 1, 0, 0, 0, 52, 53, 5, 40, 0, 0, 53, 18, 1, 0, 0, 0, 54, 55, 5, 41, 0, 0, 55, 20, 1, 0, 0, 0, 56, 60, 5, 34, 0, 0, 57, 59, 8, 6, 0, 0, 58, 57, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 63, 65, 5, 34, 0, 0, 64, 63, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 22, 1, 0, 0, 0, 66, 68, 5, 45, 0, 0, 67, 66, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 71, 7, 7, 0, 0, 70, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 80, 1, 0, 0, 0, 74, 76, 5, 46, 0, 0, 75, 77, 7, 7, 0, 0, 76, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 81, 1, 0, 0, 0, 80, 74, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 24, 1, 0, 0, 0, 82, 86, 7, 8, 0, 0, 83, 85, 7, 9, 0, 0, 84, 83, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 26, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 91, 7, 10, 0, 0, 90, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 6, 13, 0, 0, 95, 28, 1, 0, 0, 0, 9, 0, 60, 64, 67, 72, 78, 80, 86, 92, 1, 0, 1, 0] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts index 169e36df52c6..0ef46b1db22b 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts @@ -62,41 +62,41 @@ export class DQLLexer extends antlr.Lexer { public get modeNames(): string[] { return DQLLexer.modeNames; } public static readonly _serializedATN: number[] = [ - 4,0,14,95,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2, + 4,0,14,96,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2, 6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13, 7,13,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1,3,1,4,1,4, 1,5,1,5,1,5,1,6,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,5,10,59, - 8,10,10,10,12,10,62,9,10,1,10,1,10,1,11,3,11,67,8,11,1,11,4,11,70, - 8,11,11,11,12,11,71,1,11,1,11,4,11,76,8,11,11,11,12,11,77,3,11,80, - 8,11,1,12,1,12,5,12,84,8,12,10,12,12,12,87,9,12,1,13,4,13,90,8,13, - 11,13,12,13,91,1,13,1,13,0,0,14,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15, - 8,17,9,19,10,21,11,23,12,25,13,27,14,1,0,11,2,0,79,79,111,111,2, - 0,82,82,114,114,2,0,65,65,97,97,2,0,78,78,110,110,2,0,68,68,100, - 100,2,0,84,84,116,116,2,0,34,34,92,92,1,0,48,57,4,0,42,42,65,90, - 95,95,97,122,6,0,42,42,46,46,48,57,65,90,95,95,97,122,3,0,9,10,13, - 13,32,32,101,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9, - 1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19, - 1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,1,29, - 1,0,0,0,3,32,1,0,0,0,5,36,1,0,0,0,7,40,1,0,0,0,9,42,1,0,0,0,11,44, - 1,0,0,0,13,47,1,0,0,0,15,50,1,0,0,0,17,52,1,0,0,0,19,54,1,0,0,0, - 21,56,1,0,0,0,23,66,1,0,0,0,25,81,1,0,0,0,27,89,1,0,0,0,29,30,7, - 0,0,0,30,31,7,1,0,0,31,2,1,0,0,0,32,33,7,2,0,0,33,34,7,3,0,0,34, - 35,7,4,0,0,35,4,1,0,0,0,36,37,7,3,0,0,37,38,7,0,0,0,38,39,7,5,0, - 0,39,6,1,0,0,0,40,41,5,62,0,0,41,8,1,0,0,0,42,43,5,60,0,0,43,10, - 1,0,0,0,44,45,5,62,0,0,45,46,5,61,0,0,46,12,1,0,0,0,47,48,5,60,0, - 0,48,49,5,61,0,0,49,14,1,0,0,0,50,51,5,58,0,0,51,16,1,0,0,0,52,53, - 5,40,0,0,53,18,1,0,0,0,54,55,5,41,0,0,55,20,1,0,0,0,56,60,5,34,0, - 0,57,59,8,6,0,0,58,57,1,0,0,0,59,62,1,0,0,0,60,58,1,0,0,0,60,61, - 1,0,0,0,61,63,1,0,0,0,62,60,1,0,0,0,63,64,5,34,0,0,64,22,1,0,0,0, - 65,67,5,45,0,0,66,65,1,0,0,0,66,67,1,0,0,0,67,69,1,0,0,0,68,70,7, - 7,0,0,69,68,1,0,0,0,70,71,1,0,0,0,71,69,1,0,0,0,71,72,1,0,0,0,72, - 79,1,0,0,0,73,75,5,46,0,0,74,76,7,7,0,0,75,74,1,0,0,0,76,77,1,0, - 0,0,77,75,1,0,0,0,77,78,1,0,0,0,78,80,1,0,0,0,79,73,1,0,0,0,79,80, - 1,0,0,0,80,24,1,0,0,0,81,85,7,8,0,0,82,84,7,9,0,0,83,82,1,0,0,0, - 84,87,1,0,0,0,85,83,1,0,0,0,85,86,1,0,0,0,86,26,1,0,0,0,87,85,1, - 0,0,0,88,90,7,10,0,0,89,88,1,0,0,0,90,91,1,0,0,0,91,89,1,0,0,0,91, - 92,1,0,0,0,92,93,1,0,0,0,93,94,6,13,0,0,94,28,1,0,0,0,8,0,60,66, - 71,77,79,85,91,1,0,1,0 + 8,10,10,10,12,10,62,9,10,1,10,3,10,65,8,10,1,11,3,11,68,8,11,1,11, + 4,11,71,8,11,11,11,12,11,72,1,11,1,11,4,11,77,8,11,11,11,12,11,78, + 3,11,81,8,11,1,12,1,12,5,12,85,8,12,10,12,12,12,88,9,12,1,13,4,13, + 91,8,13,11,13,12,13,92,1,13,1,13,0,0,14,1,1,3,2,5,3,7,4,9,5,11,6, + 13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,1,0,11,2,0,79,79,111, + 111,2,0,82,82,114,114,2,0,65,65,97,97,2,0,78,78,110,110,2,0,68,68, + 100,100,2,0,84,84,116,116,2,0,34,34,92,92,1,0,48,57,4,0,42,42,65, + 90,95,95,97,122,6,0,42,42,46,46,48,57,65,90,95,95,97,122,3,0,9,10, + 13,13,32,32,103,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0, + 0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0, + 0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0, + 1,29,1,0,0,0,3,32,1,0,0,0,5,36,1,0,0,0,7,40,1,0,0,0,9,42,1,0,0,0, + 11,44,1,0,0,0,13,47,1,0,0,0,15,50,1,0,0,0,17,52,1,0,0,0,19,54,1, + 0,0,0,21,56,1,0,0,0,23,67,1,0,0,0,25,82,1,0,0,0,27,90,1,0,0,0,29, + 30,7,0,0,0,30,31,7,1,0,0,31,2,1,0,0,0,32,33,7,2,0,0,33,34,7,3,0, + 0,34,35,7,4,0,0,35,4,1,0,0,0,36,37,7,3,0,0,37,38,7,0,0,0,38,39,7, + 5,0,0,39,6,1,0,0,0,40,41,5,62,0,0,41,8,1,0,0,0,42,43,5,60,0,0,43, + 10,1,0,0,0,44,45,5,62,0,0,45,46,5,61,0,0,46,12,1,0,0,0,47,48,5,60, + 0,0,48,49,5,61,0,0,49,14,1,0,0,0,50,51,5,58,0,0,51,16,1,0,0,0,52, + 53,5,40,0,0,53,18,1,0,0,0,54,55,5,41,0,0,55,20,1,0,0,0,56,60,5,34, + 0,0,57,59,8,6,0,0,58,57,1,0,0,0,59,62,1,0,0,0,60,58,1,0,0,0,60,61, + 1,0,0,0,61,64,1,0,0,0,62,60,1,0,0,0,63,65,5,34,0,0,64,63,1,0,0,0, + 64,65,1,0,0,0,65,22,1,0,0,0,66,68,5,45,0,0,67,66,1,0,0,0,67,68,1, + 0,0,0,68,70,1,0,0,0,69,71,7,7,0,0,70,69,1,0,0,0,71,72,1,0,0,0,72, + 70,1,0,0,0,72,73,1,0,0,0,73,80,1,0,0,0,74,76,5,46,0,0,75,77,7,7, + 0,0,76,75,1,0,0,0,77,78,1,0,0,0,78,76,1,0,0,0,78,79,1,0,0,0,79,81, + 1,0,0,0,80,74,1,0,0,0,80,81,1,0,0,0,81,24,1,0,0,0,82,86,7,8,0,0, + 83,85,7,9,0,0,84,83,1,0,0,0,85,88,1,0,0,0,86,84,1,0,0,0,86,87,1, + 0,0,0,87,26,1,0,0,0,88,86,1,0,0,0,89,91,7,10,0,0,90,89,1,0,0,0,91, + 92,1,0,0,0,92,90,1,0,0,0,92,93,1,0,0,0,93,94,1,0,0,0,94,95,6,13, + 0,0,95,28,1,0,0,0,9,0,60,64,67,72,78,80,86,92,1,0,1,0 ]; private static __ATN: antlr.ATN; diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp index d9b1db4ba256..79935719e1a4 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp @@ -56,4 +56,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 14, 95, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 59, 8, 10, 10, 10, 12, 10, 62, 9, 10, 1, 10, 1, 10, 1, 11, 3, 11, 67, 8, 11, 1, 11, 4, 11, 70, 8, 11, 11, 11, 12, 11, 71, 1, 11, 1, 11, 4, 11, 76, 8, 11, 11, 11, 12, 11, 77, 3, 11, 80, 8, 11, 1, 12, 1, 12, 5, 12, 84, 8, 12, 10, 12, 12, 12, 87, 9, 12, 1, 13, 4, 13, 90, 8, 13, 11, 13, 12, 13, 91, 1, 13, 1, 13, 0, 0, 14, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 101, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 1, 29, 1, 0, 0, 0, 3, 32, 1, 0, 0, 0, 5, 36, 1, 0, 0, 0, 7, 40, 1, 0, 0, 0, 9, 42, 1, 0, 0, 0, 11, 44, 1, 0, 0, 0, 13, 47, 1, 0, 0, 0, 15, 50, 1, 0, 0, 0, 17, 52, 1, 0, 0, 0, 19, 54, 1, 0, 0, 0, 21, 56, 1, 0, 0, 0, 23, 66, 1, 0, 0, 0, 25, 81, 1, 0, 0, 0, 27, 89, 1, 0, 0, 0, 29, 30, 7, 0, 0, 0, 30, 31, 7, 1, 0, 0, 31, 2, 1, 0, 0, 0, 32, 33, 7, 2, 0, 0, 33, 34, 7, 3, 0, 0, 34, 35, 7, 4, 0, 0, 35, 4, 1, 0, 0, 0, 36, 37, 7, 3, 0, 0, 37, 38, 7, 0, 0, 0, 38, 39, 7, 5, 0, 0, 39, 6, 1, 0, 0, 0, 40, 41, 5, 62, 0, 0, 41, 8, 1, 0, 0, 0, 42, 43, 5, 60, 0, 0, 43, 10, 1, 0, 0, 0, 44, 45, 5, 62, 0, 0, 45, 46, 5, 61, 0, 0, 46, 12, 1, 0, 0, 0, 47, 48, 5, 60, 0, 0, 48, 49, 5, 61, 0, 0, 49, 14, 1, 0, 0, 0, 50, 51, 5, 58, 0, 0, 51, 16, 1, 0, 0, 0, 52, 53, 5, 40, 0, 0, 53, 18, 1, 0, 0, 0, 54, 55, 5, 41, 0, 0, 55, 20, 1, 0, 0, 0, 56, 60, 5, 34, 0, 0, 57, 59, 8, 6, 0, 0, 58, 57, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 63, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 63, 64, 5, 34, 0, 0, 64, 22, 1, 0, 0, 0, 65, 67, 5, 45, 0, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 69, 1, 0, 0, 0, 68, 70, 7, 7, 0, 0, 69, 68, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 79, 1, 0, 0, 0, 73, 75, 5, 46, 0, 0, 74, 76, 7, 7, 0, 0, 75, 74, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 1, 0, 0, 0, 79, 73, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 24, 1, 0, 0, 0, 81, 85, 7, 8, 0, 0, 82, 84, 7, 9, 0, 0, 83, 82, 1, 0, 0, 0, 84, 87, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 26, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 88, 90, 7, 10, 0, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 6, 13, 0, 0, 94, 28, 1, 0, 0, 0, 8, 0, 60, 66, 71, 77, 79, 85, 91, 1, 0, 1, 0] \ No newline at end of file +[4, 0, 14, 96, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 59, 8, 10, 10, 10, 12, 10, 62, 9, 10, 1, 10, 3, 10, 65, 8, 10, 1, 11, 3, 11, 68, 8, 11, 1, 11, 4, 11, 71, 8, 11, 11, 11, 12, 11, 72, 1, 11, 1, 11, 4, 11, 77, 8, 11, 11, 11, 12, 11, 78, 3, 11, 81, 8, 11, 1, 12, 1, 12, 5, 12, 85, 8, 12, 10, 12, 12, 12, 88, 9, 12, 1, 13, 4, 13, 91, 8, 13, 11, 13, 12, 13, 92, 1, 13, 1, 13, 0, 0, 14, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 103, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 1, 29, 1, 0, 0, 0, 3, 32, 1, 0, 0, 0, 5, 36, 1, 0, 0, 0, 7, 40, 1, 0, 0, 0, 9, 42, 1, 0, 0, 0, 11, 44, 1, 0, 0, 0, 13, 47, 1, 0, 0, 0, 15, 50, 1, 0, 0, 0, 17, 52, 1, 0, 0, 0, 19, 54, 1, 0, 0, 0, 21, 56, 1, 0, 0, 0, 23, 67, 1, 0, 0, 0, 25, 82, 1, 0, 0, 0, 27, 90, 1, 0, 0, 0, 29, 30, 7, 0, 0, 0, 30, 31, 7, 1, 0, 0, 31, 2, 1, 0, 0, 0, 32, 33, 7, 2, 0, 0, 33, 34, 7, 3, 0, 0, 34, 35, 7, 4, 0, 0, 35, 4, 1, 0, 0, 0, 36, 37, 7, 3, 0, 0, 37, 38, 7, 0, 0, 0, 38, 39, 7, 5, 0, 0, 39, 6, 1, 0, 0, 0, 40, 41, 5, 62, 0, 0, 41, 8, 1, 0, 0, 0, 42, 43, 5, 60, 0, 0, 43, 10, 1, 0, 0, 0, 44, 45, 5, 62, 0, 0, 45, 46, 5, 61, 0, 0, 46, 12, 1, 0, 0, 0, 47, 48, 5, 60, 0, 0, 48, 49, 5, 61, 0, 0, 49, 14, 1, 0, 0, 0, 50, 51, 5, 58, 0, 0, 51, 16, 1, 0, 0, 0, 52, 53, 5, 40, 0, 0, 53, 18, 1, 0, 0, 0, 54, 55, 5, 41, 0, 0, 55, 20, 1, 0, 0, 0, 56, 60, 5, 34, 0, 0, 57, 59, 8, 6, 0, 0, 58, 57, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 63, 65, 5, 34, 0, 0, 64, 63, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 22, 1, 0, 0, 0, 66, 68, 5, 45, 0, 0, 67, 66, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 71, 7, 7, 0, 0, 70, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 80, 1, 0, 0, 0, 74, 76, 5, 46, 0, 0, 75, 77, 7, 7, 0, 0, 76, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 81, 1, 0, 0, 0, 80, 74, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 24, 1, 0, 0, 0, 82, 86, 7, 8, 0, 0, 83, 85, 7, 9, 0, 0, 84, 83, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 26, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 91, 7, 10, 0, 0, 90, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 6, 13, 0, 0, 95, 28, 1, 0, 0, 0, 9, 0, 60, 64, 67, 72, 78, 80, 86, 92, 1, 0, 1, 0] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java index cb8768eb8383..b807821ab04e 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java @@ -105,7 +105,7 @@ public DQLLexer(CharStream input) { public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\u0004\u0000\u000e_\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ + "\u0004\u0000\u000e`\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+ "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+ "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+ @@ -114,56 +114,57 @@ public DQLLexer(CharStream input) { "\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0004\u0001"+ "\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001"+ "\u0006\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001\t\u0001\t\u0001\n"+ - "\u0001\n\u0005\n;\b\n\n\n\f\n>\t\n\u0001\n\u0001\n\u0001\u000b\u0003\u000b"+ - "C\b\u000b\u0001\u000b\u0004\u000bF\b\u000b\u000b\u000b\f\u000bG\u0001"+ - "\u000b\u0001\u000b\u0004\u000bL\b\u000b\u000b\u000b\f\u000bM\u0003\u000b"+ - "P\b\u000b\u0001\f\u0001\f\u0005\fT\b\f\n\f\f\fW\t\f\u0001\r\u0004\rZ\b"+ - "\r\u000b\r\f\r[\u0001\r\u0001\r\u0000\u0000\u000e\u0001\u0001\u0003\u0002"+ - "\u0005\u0003\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013"+ - "\n\u0015\u000b\u0017\f\u0019\r\u001b\u000e\u0001\u0000\u000b\u0002\u0000"+ - "OOoo\u0002\u0000RRrr\u0002\u0000AAaa\u0002\u0000NNnn\u0002\u0000DDdd\u0002"+ - "\u0000TTtt\u0002\u0000\"\"\\\\\u0001\u000009\u0004\u0000**AZ__az\u0006"+ - "\u0000**..09AZ__az\u0003\u0000\t\n\r\r e\u0000\u0001\u0001\u0000\u0000"+ - "\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001\u0000\u0000"+ - "\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000"+ - "\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000\u0000\u0000"+ - "\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000\u0000\u0000"+ - "\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000\u0000\u0000"+ - "\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000\u0000\u0000"+ - "\u001b\u0001\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000\u0000\u0003"+ - " \u0001\u0000\u0000\u0000\u0005$\u0001\u0000\u0000\u0000\u0007(\u0001"+ - "\u0000\u0000\u0000\t*\u0001\u0000\u0000\u0000\u000b,\u0001\u0000\u0000"+ - "\u0000\r/\u0001\u0000\u0000\u0000\u000f2\u0001\u0000\u0000\u0000\u0011"+ - "4\u0001\u0000\u0000\u0000\u00136\u0001\u0000\u0000\u0000\u00158\u0001"+ - "\u0000\u0000\u0000\u0017B\u0001\u0000\u0000\u0000\u0019Q\u0001\u0000\u0000"+ - "\u0000\u001bY\u0001\u0000\u0000\u0000\u001d\u001e\u0007\u0000\u0000\u0000"+ - "\u001e\u001f\u0007\u0001\u0000\u0000\u001f\u0002\u0001\u0000\u0000\u0000"+ - " !\u0007\u0002\u0000\u0000!\"\u0007\u0003\u0000\u0000\"#\u0007\u0004\u0000"+ - "\u0000#\u0004\u0001\u0000\u0000\u0000$%\u0007\u0003\u0000\u0000%&\u0007"+ - "\u0000\u0000\u0000&\'\u0007\u0005\u0000\u0000\'\u0006\u0001\u0000\u0000"+ - "\u0000()\u0005>\u0000\u0000)\b\u0001\u0000\u0000\u0000*+\u0005<\u0000"+ - "\u0000+\n\u0001\u0000\u0000\u0000,-\u0005>\u0000\u0000-.\u0005=\u0000"+ - "\u0000.\f\u0001\u0000\u0000\u0000/0\u0005<\u0000\u000001\u0005=\u0000"+ - "\u00001\u000e\u0001\u0000\u0000\u000023\u0005:\u0000\u00003\u0010\u0001"+ - "\u0000\u0000\u000045\u0005(\u0000\u00005\u0012\u0001\u0000\u0000\u0000"+ - "67\u0005)\u0000\u00007\u0014\u0001\u0000\u0000\u00008<\u0005\"\u0000\u0000"+ - "9;\b\u0006\u0000\u0000:9\u0001\u0000\u0000\u0000;>\u0001\u0000\u0000\u0000"+ - "<:\u0001\u0000\u0000\u0000<=\u0001\u0000\u0000\u0000=?\u0001\u0000\u0000"+ - "\u0000><\u0001\u0000\u0000\u0000?@\u0005\"\u0000\u0000@\u0016\u0001\u0000"+ - "\u0000\u0000AC\u0005-\u0000\u0000BA\u0001\u0000\u0000\u0000BC\u0001\u0000"+ - "\u0000\u0000CE\u0001\u0000\u0000\u0000DF\u0007\u0007\u0000\u0000ED\u0001"+ - "\u0000\u0000\u0000FG\u0001\u0000\u0000\u0000GE\u0001\u0000\u0000\u0000"+ - "GH\u0001\u0000\u0000\u0000HO\u0001\u0000\u0000\u0000IK\u0005.\u0000\u0000"+ - "JL\u0007\u0007\u0000\u0000KJ\u0001\u0000\u0000\u0000LM\u0001\u0000\u0000"+ - "\u0000MK\u0001\u0000\u0000\u0000MN\u0001\u0000\u0000\u0000NP\u0001\u0000"+ - "\u0000\u0000OI\u0001\u0000\u0000\u0000OP\u0001\u0000\u0000\u0000P\u0018"+ - "\u0001\u0000\u0000\u0000QU\u0007\b\u0000\u0000RT\u0007\t\u0000\u0000S"+ - "R\u0001\u0000\u0000\u0000TW\u0001\u0000\u0000\u0000US\u0001\u0000\u0000"+ - "\u0000UV\u0001\u0000\u0000\u0000V\u001a\u0001\u0000\u0000\u0000WU\u0001"+ - "\u0000\u0000\u0000XZ\u0007\n\u0000\u0000YX\u0001\u0000\u0000\u0000Z[\u0001"+ - "\u0000\u0000\u0000[Y\u0001\u0000\u0000\u0000[\\\u0001\u0000\u0000\u0000"+ - "\\]\u0001\u0000\u0000\u0000]^\u0006\r\u0000\u0000^\u001c\u0001\u0000\u0000"+ - "\u0000\b\u0000\t\n\u0001\n\u0003\nA\b\n\u0001\u000b\u0003"+ + "\u000bD\b\u000b\u0001\u000b\u0004\u000bG\b\u000b\u000b\u000b\f\u000bH"+ + "\u0001\u000b\u0001\u000b\u0004\u000bM\b\u000b\u000b\u000b\f\u000bN\u0003"+ + "\u000bQ\b\u000b\u0001\f\u0001\f\u0005\fU\b\f\n\f\f\fX\t\f\u0001\r\u0004"+ + "\r[\b\r\u000b\r\f\r\\\u0001\r\u0001\r\u0000\u0000\u000e\u0001\u0001\u0003"+ + "\u0002\u0005\u0003\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f\b\u0011"+ + "\t\u0013\n\u0015\u000b\u0017\f\u0019\r\u001b\u000e\u0001\u0000\u000b\u0002"+ + "\u0000OOoo\u0002\u0000RRrr\u0002\u0000AAaa\u0002\u0000NNnn\u0002\u0000"+ + "DDdd\u0002\u0000TTtt\u0002\u0000\"\"\\\\\u0001\u000009\u0004\u0000**A"+ + "Z__az\u0006\u0000**..09AZ__az\u0003\u0000\t\n\r\r g\u0000\u0001\u0001"+ + "\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001"+ + "\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000"+ + "\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000"+ + "\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000"+ + "\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000"+ + "\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000"+ + "\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000"+ + "\u0000\u0003 \u0001\u0000\u0000\u0000\u0005$\u0001\u0000\u0000\u0000\u0007"+ + "(\u0001\u0000\u0000\u0000\t*\u0001\u0000\u0000\u0000\u000b,\u0001\u0000"+ + "\u0000\u0000\r/\u0001\u0000\u0000\u0000\u000f2\u0001\u0000\u0000\u0000"+ + "\u00114\u0001\u0000\u0000\u0000\u00136\u0001\u0000\u0000\u0000\u00158"+ + "\u0001\u0000\u0000\u0000\u0017C\u0001\u0000\u0000\u0000\u0019R\u0001\u0000"+ + "\u0000\u0000\u001bZ\u0001\u0000\u0000\u0000\u001d\u001e\u0007\u0000\u0000"+ + "\u0000\u001e\u001f\u0007\u0001\u0000\u0000\u001f\u0002\u0001\u0000\u0000"+ + "\u0000 !\u0007\u0002\u0000\u0000!\"\u0007\u0003\u0000\u0000\"#\u0007\u0004"+ + "\u0000\u0000#\u0004\u0001\u0000\u0000\u0000$%\u0007\u0003\u0000\u0000"+ + "%&\u0007\u0000\u0000\u0000&\'\u0007\u0005\u0000\u0000\'\u0006\u0001\u0000"+ + "\u0000\u0000()\u0005>\u0000\u0000)\b\u0001\u0000\u0000\u0000*+\u0005<"+ + "\u0000\u0000+\n\u0001\u0000\u0000\u0000,-\u0005>\u0000\u0000-.\u0005="+ + "\u0000\u0000.\f\u0001\u0000\u0000\u0000/0\u0005<\u0000\u000001\u0005="+ + "\u0000\u00001\u000e\u0001\u0000\u0000\u000023\u0005:\u0000\u00003\u0010"+ + "\u0001\u0000\u0000\u000045\u0005(\u0000\u00005\u0012\u0001\u0000\u0000"+ + "\u000067\u0005)\u0000\u00007\u0014\u0001\u0000\u0000\u00008<\u0005\"\u0000"+ + "\u00009;\b\u0006\u0000\u0000:9\u0001\u0000\u0000\u0000;>\u0001\u0000\u0000"+ + "\u0000<:\u0001\u0000\u0000\u0000<=\u0001\u0000\u0000\u0000=@\u0001\u0000"+ + "\u0000\u0000><\u0001\u0000\u0000\u0000?A\u0005\"\u0000\u0000@?\u0001\u0000"+ + "\u0000\u0000@A\u0001\u0000\u0000\u0000A\u0016\u0001\u0000\u0000\u0000"+ + "BD\u0005-\u0000\u0000CB\u0001\u0000\u0000\u0000CD\u0001\u0000\u0000\u0000"+ + "DF\u0001\u0000\u0000\u0000EG\u0007\u0007\u0000\u0000FE\u0001\u0000\u0000"+ + "\u0000GH\u0001\u0000\u0000\u0000HF\u0001\u0000\u0000\u0000HI\u0001\u0000"+ + "\u0000\u0000IP\u0001\u0000\u0000\u0000JL\u0005.\u0000\u0000KM\u0007\u0007"+ + "\u0000\u0000LK\u0001\u0000\u0000\u0000MN\u0001\u0000\u0000\u0000NL\u0001"+ + "\u0000\u0000\u0000NO\u0001\u0000\u0000\u0000OQ\u0001\u0000\u0000\u0000"+ + "PJ\u0001\u0000\u0000\u0000PQ\u0001\u0000\u0000\u0000Q\u0018\u0001\u0000"+ + "\u0000\u0000RV\u0007\b\u0000\u0000SU\u0007\t\u0000\u0000TS\u0001\u0000"+ + "\u0000\u0000UX\u0001\u0000\u0000\u0000VT\u0001\u0000\u0000\u0000VW\u0001"+ + "\u0000\u0000\u0000W\u001a\u0001\u0000\u0000\u0000XV\u0001\u0000\u0000"+ + "\u0000Y[\u0007\n\u0000\u0000ZY\u0001\u0000\u0000\u0000[\\\u0001\u0000"+ + "\u0000\u0000\\Z\u0001\u0000\u0000\u0000\\]\u0001\u0000\u0000\u0000]^\u0001"+ + "\u0000\u0000\u0000^_\u0006\r\u0000\u0000_\u001c\u0001\u0000\u0000\u0000"+ + "\t\u0000<@CHNPV\\\u0001\u0000\u0001\u0000"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 index bcb68062aeb7..8efdd3c73540 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 @@ -17,7 +17,7 @@ LPAREN: '('; RPAREN: ')'; // Literals -PHRASE: '"' (~["\\])* '"'; +PHRASE: '"' (~["\\])* '"'?; NUMBER: '-'? [0-9]+ ('.' [0-9]+)?; IDENTIFIER: [a-zA-Z_*][a-zA-Z0-9_.*]*; From 613b82de5d522c24c9e063a823fbee36ddc12c0a Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Thu, 18 Jul 2024 13:36:36 -0700 Subject: [PATCH 13/34] make grammar more readable Signed-off-by: Paul Sebastian --- .../antlr/dql/generated/DQLParser.interp | 5 +- .../public/antlr/dql/generated/DQLParser.ts | 478 +++++++++++------- .../antlr/dql/generated/DQLParserListener.ts | 29 +- .../antlr/dql/generated/DQLParserVisitor.ts | 17 +- .../antlr/dql/grammar/.antlr/DQLParser.interp | 7 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 459 ++++++++++------- .../antlr/dql/grammar/.antlr/DQLParser.tokens | 10 +- .../public/antlr/dql/grammar/DQLParser.g4 | 88 +++- 8 files changed, 668 insertions(+), 425 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp index 8d36a19fa1a8..69f5027272c3 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp @@ -34,9 +34,10 @@ WS rule names: query +operatorExpression orExpression +orTerm andExpression -notExpression primaryExpression comparisonExpression fieldExpression @@ -50,4 +51,4 @@ comparisonOperator atn: -[4, 1, 14, 107, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 69, 8, 6, 1, 7, 1, 7, 5, 7, 73, 8, 7, 10, 7, 12, 7, 76, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 82, 8, 8, 1, 8, 5, 8, 85, 8, 8, 10, 8, 12, 8, 88, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 94, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 103, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 105, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 70, 1, 0, 0, 0, 16, 77, 1, 0, 0, 0, 18, 93, 1, 0, 0, 0, 20, 95, 1, 0, 0, 0, 22, 97, 1, 0, 0, 0, 24, 102, 1, 0, 0, 0, 26, 104, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 68, 5, 8, 0, 0, 66, 69, 3, 24, 12, 0, 67, 69, 3, 16, 8, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 13, 1, 0, 0, 0, 70, 74, 5, 13, 0, 0, 71, 73, 5, 13, 0, 0, 72, 71, 1, 0, 0, 0, 73, 76, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 15, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 78, 5, 9, 0, 0, 78, 86, 3, 18, 9, 0, 79, 81, 7, 0, 0, 0, 80, 82, 5, 3, 0, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 85, 3, 18, 9, 0, 84, 79, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 89, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 90, 5, 10, 0, 0, 90, 17, 1, 0, 0, 0, 91, 94, 3, 16, 8, 0, 92, 94, 3, 24, 12, 0, 93, 91, 1, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 19, 1, 0, 0, 0, 95, 96, 5, 13, 0, 0, 96, 21, 1, 0, 0, 0, 97, 98, 7, 1, 0, 0, 98, 23, 1, 0, 0, 0, 99, 103, 5, 11, 0, 0, 100, 103, 5, 12, 0, 0, 101, 103, 3, 14, 7, 0, 102, 99, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 25, 1, 0, 0, 0, 104, 105, 7, 2, 0, 0, 105, 27, 1, 0, 0, 0, 10, 35, 43, 49, 58, 68, 74, 81, 86, 93, 102] \ No newline at end of file +[4, 1, 14, 116, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 1, 0, 3, 0, 33, 8, 0, 1, 1, 1, 1, 3, 1, 37, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 3, 3, 49, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 54, 8, 4, 10, 4, 12, 4, 57, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 68, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 78, 8, 7, 1, 8, 1, 8, 5, 8, 82, 8, 8, 10, 8, 12, 8, 85, 9, 8, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 91, 8, 9, 1, 9, 5, 9, 94, 8, 9, 10, 9, 12, 9, 97, 9, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 103, 8, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 112, 8, 13, 1, 14, 1, 14, 1, 14, 0, 0, 15, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 116, 0, 32, 1, 0, 0, 0, 2, 36, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 48, 1, 0, 0, 0, 8, 50, 1, 0, 0, 0, 10, 67, 1, 0, 0, 0, 12, 69, 1, 0, 0, 0, 14, 73, 1, 0, 0, 0, 16, 79, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 102, 1, 0, 0, 0, 22, 104, 1, 0, 0, 0, 24, 106, 1, 0, 0, 0, 26, 111, 1, 0, 0, 0, 28, 113, 1, 0, 0, 0, 30, 33, 3, 10, 5, 0, 31, 33, 3, 2, 1, 0, 32, 30, 1, 0, 0, 0, 32, 31, 1, 0, 0, 0, 33, 1, 1, 0, 0, 0, 34, 37, 3, 8, 4, 0, 35, 37, 3, 4, 2, 0, 36, 34, 1, 0, 0, 0, 36, 35, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 1, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 49, 3, 10, 5, 0, 47, 49, 3, 8, 4, 0, 48, 46, 1, 0, 0, 0, 48, 47, 1, 0, 0, 0, 49, 7, 1, 0, 0, 0, 50, 55, 3, 10, 5, 0, 51, 52, 5, 2, 0, 0, 52, 54, 3, 10, 5, 0, 53, 51, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 9, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 9, 0, 0, 59, 60, 3, 0, 0, 0, 60, 61, 5, 10, 0, 0, 61, 68, 1, 0, 0, 0, 62, 63, 5, 3, 0, 0, 63, 68, 3, 10, 5, 0, 64, 68, 3, 12, 6, 0, 65, 68, 3, 14, 7, 0, 66, 68, 3, 16, 8, 0, 67, 58, 1, 0, 0, 0, 67, 62, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 11, 1, 0, 0, 0, 69, 70, 3, 22, 11, 0, 70, 71, 3, 28, 14, 0, 71, 72, 3, 24, 12, 0, 72, 13, 1, 0, 0, 0, 73, 74, 3, 22, 11, 0, 74, 77, 5, 8, 0, 0, 75, 78, 3, 26, 13, 0, 76, 78, 3, 18, 9, 0, 77, 75, 1, 0, 0, 0, 77, 76, 1, 0, 0, 0, 78, 15, 1, 0, 0, 0, 79, 83, 5, 13, 0, 0, 80, 82, 5, 13, 0, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 17, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 9, 0, 0, 87, 95, 3, 20, 10, 0, 88, 90, 7, 0, 0, 0, 89, 91, 5, 3, 0, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 94, 3, 20, 10, 0, 93, 88, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 10, 0, 0, 99, 19, 1, 0, 0, 0, 100, 103, 3, 18, 9, 0, 101, 103, 3, 26, 13, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 21, 1, 0, 0, 0, 104, 105, 5, 13, 0, 0, 105, 23, 1, 0, 0, 0, 106, 107, 7, 1, 0, 0, 107, 25, 1, 0, 0, 0, 108, 112, 5, 11, 0, 0, 109, 112, 5, 12, 0, 0, 110, 112, 3, 16, 8, 0, 111, 108, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 110, 1, 0, 0, 0, 112, 27, 1, 0, 0, 0, 113, 114, 7, 2, 0, 0, 114, 29, 1, 0, 0, 0, 12, 32, 36, 43, 48, 55, 67, 77, 83, 90, 95, 102, 111] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts index eed0e5f025ff..2f2cf47ad111 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts @@ -27,19 +27,20 @@ export class DQLParser extends antlr.Parser { public static readonly IDENTIFIER = 13; public static readonly WS = 14; public static readonly RULE_query = 0; - public static readonly RULE_orExpression = 1; - public static readonly RULE_andExpression = 2; - public static readonly RULE_notExpression = 3; - public static readonly RULE_primaryExpression = 4; - public static readonly RULE_comparisonExpression = 5; - public static readonly RULE_fieldExpression = 6; - public static readonly RULE_termSearch = 7; - public static readonly RULE_groupExpression = 8; - public static readonly RULE_groupContent = 9; - public static readonly RULE_field = 10; - public static readonly RULE_rangeValue = 11; - public static readonly RULE_value = 12; - public static readonly RULE_comparisonOperator = 13; + public static readonly RULE_operatorExpression = 1; + public static readonly RULE_orExpression = 2; + public static readonly RULE_orTerm = 3; + public static readonly RULE_andExpression = 4; + public static readonly RULE_primaryExpression = 5; + public static readonly RULE_comparisonExpression = 6; + public static readonly RULE_fieldExpression = 7; + public static readonly RULE_termSearch = 8; + public static readonly RULE_groupExpression = 9; + public static readonly RULE_groupContent = 10; + public static readonly RULE_field = 11; + public static readonly RULE_rangeValue = 12; + public static readonly RULE_value = 13; + public static readonly RULE_comparisonOperator = 14; public static readonly literalNames = [ null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", @@ -51,9 +52,10 @@ export class DQLParser extends antlr.Parser { "RPAREN", "PHRASE", "NUMBER", "IDENTIFIER", "WS" ]; public static readonly ruleNames = [ - "query", "orExpression", "andExpression", "notExpression", "primaryExpression", - "comparisonExpression", "fieldExpression", "termSearch", "groupExpression", - "groupContent", "field", "rangeValue", "value", "comparisonOperator", + "query", "operatorExpression", "orExpression", "orTerm", "andExpression", + "primaryExpression", "comparisonExpression", "fieldExpression", + "termSearch", "groupExpression", "groupContent", "field", "rangeValue", + "value", "comparisonOperator", ]; public get grammarFileName(): string { return "DQLParser.g4"; } @@ -74,10 +76,23 @@ export class DQLParser extends antlr.Parser { let localContext = new QueryContext(this.context, this.state); this.enterRule(localContext, 0, DQLParser.RULE_query); try { - this.enterOuterAlt(localContext, 1); - { - this.state = 28; - this.orExpression(); + this.state = 32; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 0, this.context) ) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 30; + this.primaryExpression(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 31; + this.operatorExpression(); + } + break; } } catch (re) { @@ -93,31 +108,27 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public orExpression(): OrExpressionContext { - let localContext = new OrExpressionContext(this.context, this.state); - this.enterRule(localContext, 2, DQLParser.RULE_orExpression); - let _la: number; + public operatorExpression(): OperatorExpressionContext { + let localContext = new OperatorExpressionContext(this.context, this.state); + this.enterRule(localContext, 2, DQLParser.RULE_operatorExpression); try { - this.enterOuterAlt(localContext, 1); - { - this.state = 30; - this.andExpression(); - this.state = 35; + this.state = 36; this.errorHandler.sync(this); - _la = this.tokenStream.LA(1); - while (_la === 1) { - { + switch (this.interpreter.adaptivePredict(this.tokenStream, 1, this.context) ) { + case 1: + this.enterOuterAlt(localContext, 1); { - this.state = 31; - this.match(DQLParser.OR); - this.state = 32; + this.state = 34; this.andExpression(); } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 35; + this.orExpression(); } - this.state = 37; - this.errorHandler.sync(this); - _la = this.tokenStream.LA(1); - } + break; } } catch (re) { @@ -133,25 +144,25 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public andExpression(): AndExpressionContext { - let localContext = new AndExpressionContext(this.context, this.state); - this.enterRule(localContext, 4, DQLParser.RULE_andExpression); + public orExpression(): OrExpressionContext { + let localContext = new OrExpressionContext(this.context, this.state); + this.enterRule(localContext, 4, DQLParser.RULE_orExpression); let _la: number; try { this.enterOuterAlt(localContext, 1); { this.state = 38; - this.notExpression(); + this.orTerm(); this.state = 43; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); - while (_la === 2) { + while (_la === 1) { { { this.state = 39; - this.match(DQLParser.AND); + this.match(DQLParser.OR); this.state = 40; - this.notExpression(); + this.orTerm(); } } this.state = 45; @@ -173,32 +184,67 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public notExpression(): NotExpressionContext { - let localContext = new NotExpressionContext(this.context, this.state); - this.enterRule(localContext, 6, DQLParser.RULE_notExpression); + public orTerm(): OrTermContext { + let localContext = new OrTermContext(this.context, this.state); + this.enterRule(localContext, 6, DQLParser.RULE_orTerm); try { - this.state = 49; + this.state = 48; this.errorHandler.sync(this); - switch (this.tokenStream.LA(1)) { - case DQLParser.NOT: + switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context) ) { + case 1: this.enterOuterAlt(localContext, 1); { this.state = 46; - this.match(DQLParser.NOT); - this.state = 47; - this.notExpression(); + this.primaryExpression(); } break; - case DQLParser.LPAREN: - case DQLParser.IDENTIFIER: + case 2: this.enterOuterAlt(localContext, 2); { - this.state = 48; - this.primaryExpression(); + this.state = 47; + this.andExpression(); } break; - default: - throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public andExpression(): AndExpressionContext { + let localContext = new AndExpressionContext(this.context, this.state); + this.enterRule(localContext, 8, DQLParser.RULE_andExpression); + let _la: number; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 50; + this.primaryExpression(); + this.state = 55; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 2) { + { + { + this.state = 51; + this.match(DQLParser.AND); + this.state = 52; + this.primaryExpression(); + } + } + this.state = 57; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } } } catch (re) { @@ -216,40 +262,49 @@ export class DQLParser extends antlr.Parser { } public primaryExpression(): PrimaryExpressionContext { let localContext = new PrimaryExpressionContext(this.context, this.state); - this.enterRule(localContext, 8, DQLParser.RULE_primaryExpression); + this.enterRule(localContext, 10, DQLParser.RULE_primaryExpression); try { - this.state = 58; + this.state = 67; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 5, this.context) ) { case 1: this.enterOuterAlt(localContext, 1); { - this.state = 51; + this.state = 58; this.match(DQLParser.LPAREN); - this.state = 52; + this.state = 59; this.query(); - this.state = 53; + this.state = 60; this.match(DQLParser.RPAREN); } break; case 2: this.enterOuterAlt(localContext, 2); { - this.state = 55; - this.comparisonExpression(); + this.state = 62; + this.match(DQLParser.NOT); + this.state = 63; + this.primaryExpression(); } break; case 3: this.enterOuterAlt(localContext, 3); { - this.state = 56; - this.fieldExpression(); + this.state = 64; + this.comparisonExpression(); } break; case 4: this.enterOuterAlt(localContext, 4); { - this.state = 57; + this.state = 65; + this.fieldExpression(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 66; this.termSearch(); } break; @@ -270,15 +325,15 @@ export class DQLParser extends antlr.Parser { } public comparisonExpression(): ComparisonExpressionContext { let localContext = new ComparisonExpressionContext(this.context, this.state); - this.enterRule(localContext, 10, DQLParser.RULE_comparisonExpression); + this.enterRule(localContext, 12, DQLParser.RULE_comparisonExpression); try { this.enterOuterAlt(localContext, 1); { - this.state = 60; + this.state = 69; this.field(); - this.state = 61; + this.state = 70; this.comparisonOperator(); - this.state = 62; + this.state = 71; this.rangeValue(); } } @@ -297,28 +352,28 @@ export class DQLParser extends antlr.Parser { } public fieldExpression(): FieldExpressionContext { let localContext = new FieldExpressionContext(this.context, this.state); - this.enterRule(localContext, 12, DQLParser.RULE_fieldExpression); + this.enterRule(localContext, 14, DQLParser.RULE_fieldExpression); try { this.enterOuterAlt(localContext, 1); { - this.state = 64; + this.state = 73; this.field(); - this.state = 65; + this.state = 74; this.match(DQLParser.EQ); - this.state = 68; + this.state = 77; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: case DQLParser.NUMBER: case DQLParser.IDENTIFIER: { - this.state = 66; + this.state = 75; this.value(); } break; case DQLParser.LPAREN: { - this.state = 67; + this.state = 76; this.groupExpression(); } break; @@ -342,24 +397,24 @@ export class DQLParser extends antlr.Parser { } public termSearch(): TermSearchContext { let localContext = new TermSearchContext(this.context, this.state); - this.enterRule(localContext, 14, DQLParser.RULE_termSearch); + this.enterRule(localContext, 16, DQLParser.RULE_termSearch); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 70; + this.state = 79; this.match(DQLParser.IDENTIFIER); - this.state = 74; + this.state = 83; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 13) { { { - this.state = 71; + this.state = 80; this.match(DQLParser.IDENTIFIER); } } - this.state = 76; + this.state = 85; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -380,22 +435,22 @@ export class DQLParser extends antlr.Parser { } public groupExpression(): GroupExpressionContext { let localContext = new GroupExpressionContext(this.context, this.state); - this.enterRule(localContext, 16, DQLParser.RULE_groupExpression); + this.enterRule(localContext, 18, DQLParser.RULE_groupExpression); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 77; + this.state = 86; this.match(DQLParser.LPAREN); - this.state = 78; + this.state = 87; this.groupContent(); - this.state = 86; + this.state = 95; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1 || _la === 2) { { { - this.state = 79; + this.state = 88; _la = this.tokenStream.LA(1); if(!(_la === 1 || _la === 2)) { this.errorHandler.recoverInline(this); @@ -405,26 +460,26 @@ export class DQLParser extends antlr.Parser { this.consume(); } { - this.state = 81; + this.state = 90; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 3) { { - this.state = 80; + this.state = 89; this.match(DQLParser.NOT); } } } - this.state = 83; + this.state = 92; this.groupContent(); } } - this.state = 88; + this.state = 97; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 89; + this.state = 98; this.match(DQLParser.RPAREN); } } @@ -443,15 +498,15 @@ export class DQLParser extends antlr.Parser { } public groupContent(): GroupContentContext { let localContext = new GroupContentContext(this.context, this.state); - this.enterRule(localContext, 18, DQLParser.RULE_groupContent); + this.enterRule(localContext, 20, DQLParser.RULE_groupContent); try { - this.state = 93; + this.state = 102; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.LPAREN: this.enterOuterAlt(localContext, 1); { - this.state = 91; + this.state = 100; this.groupExpression(); } break; @@ -460,7 +515,7 @@ export class DQLParser extends antlr.Parser { case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 2); { - this.state = 92; + this.state = 101; this.value(); } break; @@ -483,11 +538,11 @@ export class DQLParser extends antlr.Parser { } public field(): FieldContext { let localContext = new FieldContext(this.context, this.state); - this.enterRule(localContext, 20, DQLParser.RULE_field); + this.enterRule(localContext, 22, DQLParser.RULE_field); try { this.enterOuterAlt(localContext, 1); { - this.state = 95; + this.state = 104; this.match(DQLParser.IDENTIFIER); } } @@ -506,12 +561,12 @@ export class DQLParser extends antlr.Parser { } public rangeValue(): RangeValueContext { let localContext = new RangeValueContext(this.context, this.state); - this.enterRule(localContext, 22, DQLParser.RULE_rangeValue); + this.enterRule(localContext, 24, DQLParser.RULE_rangeValue); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 97; + this.state = 106; _la = this.tokenStream.LA(1); if(!(_la === 11 || _la === 12)) { this.errorHandler.recoverInline(this); @@ -537,29 +592,29 @@ export class DQLParser extends antlr.Parser { } public value(): ValueContext { let localContext = new ValueContext(this.context, this.state); - this.enterRule(localContext, 24, DQLParser.RULE_value); + this.enterRule(localContext, 26, DQLParser.RULE_value); try { - this.state = 102; + this.state = 111; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: this.enterOuterAlt(localContext, 1); { - this.state = 99; + this.state = 108; this.match(DQLParser.PHRASE); } break; case DQLParser.NUMBER: this.enterOuterAlt(localContext, 2); { - this.state = 100; + this.state = 109; this.match(DQLParser.NUMBER); } break; case DQLParser.IDENTIFIER: this.enterOuterAlt(localContext, 3); { - this.state = 101; + this.state = 110; this.termSearch(); } break; @@ -582,12 +637,12 @@ export class DQLParser extends antlr.Parser { } public comparisonOperator(): ComparisonOperatorContext { let localContext = new ComparisonOperatorContext(this.context, this.state); - this.enterRule(localContext, 26, DQLParser.RULE_comparisonOperator); + this.enterRule(localContext, 28, DQLParser.RULE_comparisonOperator); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 104; + this.state = 113; _la = this.tokenStream.LA(1); if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 240) !== 0))) { this.errorHandler.recoverInline(this); @@ -613,39 +668,43 @@ export class DQLParser extends antlr.Parser { } public static readonly _serializedATN: number[] = [ - 4,1,14,107,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,1,14,116,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, - 1,0,1,0,1,1,1,1,1,1,5,1,34,8,1,10,1,12,1,37,9,1,1,2,1,2,1,2,5,2, - 42,8,2,10,2,12,2,45,9,2,1,3,1,3,1,3,3,3,50,8,3,1,4,1,4,1,4,1,4,1, - 4,1,4,1,4,3,4,59,8,4,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,3,6,69,8,6, - 1,7,1,7,5,7,73,8,7,10,7,12,7,76,9,7,1,8,1,8,1,8,1,8,3,8,82,8,8,1, - 8,5,8,85,8,8,10,8,12,8,88,9,8,1,8,1,8,1,9,1,9,3,9,94,8,9,1,10,1, - 10,1,11,1,11,1,12,1,12,1,12,3,12,103,8,12,1,13,1,13,1,13,0,0,14, - 0,2,4,6,8,10,12,14,16,18,20,22,24,26,0,3,1,0,1,2,1,0,11,12,1,0,4, - 7,105,0,28,1,0,0,0,2,30,1,0,0,0,4,38,1,0,0,0,6,49,1,0,0,0,8,58,1, - 0,0,0,10,60,1,0,0,0,12,64,1,0,0,0,14,70,1,0,0,0,16,77,1,0,0,0,18, - 93,1,0,0,0,20,95,1,0,0,0,22,97,1,0,0,0,24,102,1,0,0,0,26,104,1,0, - 0,0,28,29,3,2,1,0,29,1,1,0,0,0,30,35,3,4,2,0,31,32,5,1,0,0,32,34, - 3,4,2,0,33,31,1,0,0,0,34,37,1,0,0,0,35,33,1,0,0,0,35,36,1,0,0,0, - 36,3,1,0,0,0,37,35,1,0,0,0,38,43,3,6,3,0,39,40,5,2,0,0,40,42,3,6, - 3,0,41,39,1,0,0,0,42,45,1,0,0,0,43,41,1,0,0,0,43,44,1,0,0,0,44,5, - 1,0,0,0,45,43,1,0,0,0,46,47,5,3,0,0,47,50,3,6,3,0,48,50,3,8,4,0, - 49,46,1,0,0,0,49,48,1,0,0,0,50,7,1,0,0,0,51,52,5,9,0,0,52,53,3,0, - 0,0,53,54,5,10,0,0,54,59,1,0,0,0,55,59,3,10,5,0,56,59,3,12,6,0,57, - 59,3,14,7,0,58,51,1,0,0,0,58,55,1,0,0,0,58,56,1,0,0,0,58,57,1,0, - 0,0,59,9,1,0,0,0,60,61,3,20,10,0,61,62,3,26,13,0,62,63,3,22,11,0, - 63,11,1,0,0,0,64,65,3,20,10,0,65,68,5,8,0,0,66,69,3,24,12,0,67,69, - 3,16,8,0,68,66,1,0,0,0,68,67,1,0,0,0,69,13,1,0,0,0,70,74,5,13,0, - 0,71,73,5,13,0,0,72,71,1,0,0,0,73,76,1,0,0,0,74,72,1,0,0,0,74,75, - 1,0,0,0,75,15,1,0,0,0,76,74,1,0,0,0,77,78,5,9,0,0,78,86,3,18,9,0, - 79,81,7,0,0,0,80,82,5,3,0,0,81,80,1,0,0,0,81,82,1,0,0,0,82,83,1, - 0,0,0,83,85,3,18,9,0,84,79,1,0,0,0,85,88,1,0,0,0,86,84,1,0,0,0,86, - 87,1,0,0,0,87,89,1,0,0,0,88,86,1,0,0,0,89,90,5,10,0,0,90,17,1,0, - 0,0,91,94,3,16,8,0,92,94,3,24,12,0,93,91,1,0,0,0,93,92,1,0,0,0,94, - 19,1,0,0,0,95,96,5,13,0,0,96,21,1,0,0,0,97,98,7,1,0,0,98,23,1,0, - 0,0,99,103,5,11,0,0,100,103,5,12,0,0,101,103,3,14,7,0,102,99,1,0, - 0,0,102,100,1,0,0,0,102,101,1,0,0,0,103,25,1,0,0,0,104,105,7,2,0, - 0,105,27,1,0,0,0,10,35,43,49,58,68,74,81,86,93,102 + 2,14,7,14,1,0,1,0,3,0,33,8,0,1,1,1,1,3,1,37,8,1,1,2,1,2,1,2,5,2, + 42,8,2,10,2,12,2,45,9,2,1,3,1,3,3,3,49,8,3,1,4,1,4,1,4,5,4,54,8, + 4,10,4,12,4,57,9,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,3,5,68,8, + 5,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,3,7,78,8,7,1,8,1,8,5,8,82,8,8, + 10,8,12,8,85,9,8,1,9,1,9,1,9,1,9,3,9,91,8,9,1,9,5,9,94,8,9,10,9, + 12,9,97,9,9,1,9,1,9,1,10,1,10,3,10,103,8,10,1,11,1,11,1,12,1,12, + 1,13,1,13,1,13,3,13,112,8,13,1,14,1,14,1,14,0,0,15,0,2,4,6,8,10, + 12,14,16,18,20,22,24,26,28,0,3,1,0,1,2,1,0,11,12,1,0,4,7,116,0,32, + 1,0,0,0,2,36,1,0,0,0,4,38,1,0,0,0,6,48,1,0,0,0,8,50,1,0,0,0,10,67, + 1,0,0,0,12,69,1,0,0,0,14,73,1,0,0,0,16,79,1,0,0,0,18,86,1,0,0,0, + 20,102,1,0,0,0,22,104,1,0,0,0,24,106,1,0,0,0,26,111,1,0,0,0,28,113, + 1,0,0,0,30,33,3,10,5,0,31,33,3,2,1,0,32,30,1,0,0,0,32,31,1,0,0,0, + 33,1,1,0,0,0,34,37,3,8,4,0,35,37,3,4,2,0,36,34,1,0,0,0,36,35,1,0, + 0,0,37,3,1,0,0,0,38,43,3,6,3,0,39,40,5,1,0,0,40,42,3,6,3,0,41,39, + 1,0,0,0,42,45,1,0,0,0,43,41,1,0,0,0,43,44,1,0,0,0,44,5,1,0,0,0,45, + 43,1,0,0,0,46,49,3,10,5,0,47,49,3,8,4,0,48,46,1,0,0,0,48,47,1,0, + 0,0,49,7,1,0,0,0,50,55,3,10,5,0,51,52,5,2,0,0,52,54,3,10,5,0,53, + 51,1,0,0,0,54,57,1,0,0,0,55,53,1,0,0,0,55,56,1,0,0,0,56,9,1,0,0, + 0,57,55,1,0,0,0,58,59,5,9,0,0,59,60,3,0,0,0,60,61,5,10,0,0,61,68, + 1,0,0,0,62,63,5,3,0,0,63,68,3,10,5,0,64,68,3,12,6,0,65,68,3,14,7, + 0,66,68,3,16,8,0,67,58,1,0,0,0,67,62,1,0,0,0,67,64,1,0,0,0,67,65, + 1,0,0,0,67,66,1,0,0,0,68,11,1,0,0,0,69,70,3,22,11,0,70,71,3,28,14, + 0,71,72,3,24,12,0,72,13,1,0,0,0,73,74,3,22,11,0,74,77,5,8,0,0,75, + 78,3,26,13,0,76,78,3,18,9,0,77,75,1,0,0,0,77,76,1,0,0,0,78,15,1, + 0,0,0,79,83,5,13,0,0,80,82,5,13,0,0,81,80,1,0,0,0,82,85,1,0,0,0, + 83,81,1,0,0,0,83,84,1,0,0,0,84,17,1,0,0,0,85,83,1,0,0,0,86,87,5, + 9,0,0,87,95,3,20,10,0,88,90,7,0,0,0,89,91,5,3,0,0,90,89,1,0,0,0, + 90,91,1,0,0,0,91,92,1,0,0,0,92,94,3,20,10,0,93,88,1,0,0,0,94,97, + 1,0,0,0,95,93,1,0,0,0,95,96,1,0,0,0,96,98,1,0,0,0,97,95,1,0,0,0, + 98,99,5,10,0,0,99,19,1,0,0,0,100,103,3,18,9,0,101,103,3,26,13,0, + 102,100,1,0,0,0,102,101,1,0,0,0,103,21,1,0,0,0,104,105,5,13,0,0, + 105,23,1,0,0,0,106,107,7,1,0,0,107,25,1,0,0,0,108,112,5,11,0,0,109, + 112,5,12,0,0,110,112,3,16,8,0,111,108,1,0,0,0,111,109,1,0,0,0,111, + 110,1,0,0,0,112,27,1,0,0,0,113,114,7,2,0,0,114,29,1,0,0,0,12,32, + 36,43,48,55,67,77,83,90,95,102,111 ]; private static __ATN: antlr.ATN; @@ -671,8 +730,11 @@ export class QueryContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public orExpression(): OrExpressionContext { - return this.getRuleContext(0, OrExpressionContext)!; + public primaryExpression(): PrimaryExpressionContext | null { + return this.getRuleContext(0, PrimaryExpressionContext); + } + public operatorExpression(): OperatorExpressionContext | null { + return this.getRuleContext(0, OperatorExpressionContext); } public override get ruleIndex(): number { return DQLParser.RULE_query; @@ -697,18 +759,51 @@ export class QueryContext extends antlr.ParserRuleContext { } +export class OperatorExpressionContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public andExpression(): AndExpressionContext | null { + return this.getRuleContext(0, AndExpressionContext); + } + public orExpression(): OrExpressionContext | null { + return this.getRuleContext(0, OrExpressionContext); + } + public override get ruleIndex(): number { + return DQLParser.RULE_operatorExpression; + } + public override enterRule(listener: DQLParserListener): void { + if(listener.enterOperatorExpression) { + listener.enterOperatorExpression(this); + } + } + public override exitRule(listener: DQLParserListener): void { + if(listener.exitOperatorExpression) { + listener.exitOperatorExpression(this); + } + } + public override accept(visitor: DQLParserVisitor): Result | null { + if (visitor.visitOperatorExpression) { + return visitor.visitOperatorExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + + export class OrExpressionContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public andExpression(): AndExpressionContext[]; - public andExpression(i: number): AndExpressionContext | null; - public andExpression(i?: number): AndExpressionContext[] | AndExpressionContext | null { + public orTerm(): OrTermContext[]; + public orTerm(i: number): OrTermContext | null; + public orTerm(i?: number): OrTermContext[] | OrTermContext | null { if (i === undefined) { - return this.getRuleContexts(AndExpressionContext); + return this.getRuleContexts(OrTermContext); } - return this.getRuleContext(i, AndExpressionContext); + return this.getRuleContext(i, OrTermContext); } public OR(): antlr.TerminalNode[]; public OR(i: number): antlr.TerminalNode | null; @@ -742,44 +837,32 @@ export class OrExpressionContext extends antlr.ParserRuleContext { } -export class AndExpressionContext extends antlr.ParserRuleContext { +export class OrTermContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public notExpression(): NotExpressionContext[]; - public notExpression(i: number): NotExpressionContext | null; - public notExpression(i?: number): NotExpressionContext[] | NotExpressionContext | null { - if (i === undefined) { - return this.getRuleContexts(NotExpressionContext); - } - - return this.getRuleContext(i, NotExpressionContext); + public primaryExpression(): PrimaryExpressionContext | null { + return this.getRuleContext(0, PrimaryExpressionContext); } - public AND(): antlr.TerminalNode[]; - public AND(i: number): antlr.TerminalNode | null; - public AND(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { - if (i === undefined) { - return this.getTokens(DQLParser.AND); - } else { - return this.getToken(DQLParser.AND, i); - } + public andExpression(): AndExpressionContext | null { + return this.getRuleContext(0, AndExpressionContext); } public override get ruleIndex(): number { - return DQLParser.RULE_andExpression; + return DQLParser.RULE_orTerm; } public override enterRule(listener: DQLParserListener): void { - if(listener.enterAndExpression) { - listener.enterAndExpression(this); + if(listener.enterOrTerm) { + listener.enterOrTerm(this); } } public override exitRule(listener: DQLParserListener): void { - if(listener.exitAndExpression) { - listener.exitAndExpression(this); + if(listener.exitOrTerm) { + listener.exitOrTerm(this); } } public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitAndExpression) { - return visitor.visitAndExpression(this); + if (visitor.visitOrTerm) { + return visitor.visitOrTerm(this); } else { return visitor.visitChildren(this); } @@ -787,35 +870,44 @@ export class AndExpressionContext extends antlr.ParserRuleContext { } -export class NotExpressionContext extends antlr.ParserRuleContext { +export class AndExpressionContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public NOT(): antlr.TerminalNode | null { - return this.getToken(DQLParser.NOT, 0); - } - public notExpression(): NotExpressionContext | null { - return this.getRuleContext(0, NotExpressionContext); + public primaryExpression(): PrimaryExpressionContext[]; + public primaryExpression(i: number): PrimaryExpressionContext | null; + public primaryExpression(i?: number): PrimaryExpressionContext[] | PrimaryExpressionContext | null { + if (i === undefined) { + return this.getRuleContexts(PrimaryExpressionContext); + } + + return this.getRuleContext(i, PrimaryExpressionContext); } - public primaryExpression(): PrimaryExpressionContext | null { - return this.getRuleContext(0, PrimaryExpressionContext); + public AND(): antlr.TerminalNode[]; + public AND(i: number): antlr.TerminalNode | null; + public AND(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(DQLParser.AND); + } else { + return this.getToken(DQLParser.AND, i); + } } public override get ruleIndex(): number { - return DQLParser.RULE_notExpression; + return DQLParser.RULE_andExpression; } public override enterRule(listener: DQLParserListener): void { - if(listener.enterNotExpression) { - listener.enterNotExpression(this); + if(listener.enterAndExpression) { + listener.enterAndExpression(this); } } public override exitRule(listener: DQLParserListener): void { - if(listener.exitNotExpression) { - listener.exitNotExpression(this); + if(listener.exitAndExpression) { + listener.exitAndExpression(this); } } public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitNotExpression) { - return visitor.visitNotExpression(this); + if (visitor.visitAndExpression) { + return visitor.visitAndExpression(this); } else { return visitor.visitChildren(this); } @@ -836,6 +928,12 @@ export class PrimaryExpressionContext extends antlr.ParserRuleContext { public RPAREN(): antlr.TerminalNode | null { return this.getToken(DQLParser.RPAREN, 0); } + public NOT(): antlr.TerminalNode | null { + return this.getToken(DQLParser.NOT, 0); + } + public primaryExpression(): PrimaryExpressionContext | null { + return this.getRuleContext(0, PrimaryExpressionContext); + } public comparisonExpression(): ComparisonExpressionContext | null { return this.getRuleContext(0, ComparisonExpressionContext); } diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts index cb830937af95..c5fd09d9fc7c 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts @@ -4,9 +4,10 @@ import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "a import { QueryContext } from "./DQLParser.js"; +import { OperatorExpressionContext } from "./DQLParser.js"; import { OrExpressionContext } from "./DQLParser.js"; +import { OrTermContext } from "./DQLParser.js"; import { AndExpressionContext } from "./DQLParser.js"; -import { NotExpressionContext } from "./DQLParser.js"; import { PrimaryExpressionContext } from "./DQLParser.js"; import { ComparisonExpressionContext } from "./DQLParser.js"; import { FieldExpressionContext } from "./DQLParser.js"; @@ -34,6 +35,16 @@ export class DQLParserListener implements ParseTreeListener { * @param ctx the parse tree */ exitQuery?: (ctx: QueryContext) => void; + /** + * Enter a parse tree produced by `DQLParser.operatorExpression`. + * @param ctx the parse tree + */ + enterOperatorExpression?: (ctx: OperatorExpressionContext) => void; + /** + * Exit a parse tree produced by `DQLParser.operatorExpression`. + * @param ctx the parse tree + */ + exitOperatorExpression?: (ctx: OperatorExpressionContext) => void; /** * Enter a parse tree produced by `DQLParser.orExpression`. * @param ctx the parse tree @@ -45,25 +56,25 @@ export class DQLParserListener implements ParseTreeListener { */ exitOrExpression?: (ctx: OrExpressionContext) => void; /** - * Enter a parse tree produced by `DQLParser.andExpression`. + * Enter a parse tree produced by `DQLParser.orTerm`. * @param ctx the parse tree */ - enterAndExpression?: (ctx: AndExpressionContext) => void; + enterOrTerm?: (ctx: OrTermContext) => void; /** - * Exit a parse tree produced by `DQLParser.andExpression`. + * Exit a parse tree produced by `DQLParser.orTerm`. * @param ctx the parse tree */ - exitAndExpression?: (ctx: AndExpressionContext) => void; + exitOrTerm?: (ctx: OrTermContext) => void; /** - * Enter a parse tree produced by `DQLParser.notExpression`. + * Enter a parse tree produced by `DQLParser.andExpression`. * @param ctx the parse tree */ - enterNotExpression?: (ctx: NotExpressionContext) => void; + enterAndExpression?: (ctx: AndExpressionContext) => void; /** - * Exit a parse tree produced by `DQLParser.notExpression`. + * Exit a parse tree produced by `DQLParser.andExpression`. * @param ctx the parse tree */ - exitNotExpression?: (ctx: NotExpressionContext) => void; + exitAndExpression?: (ctx: AndExpressionContext) => void; /** * Enter a parse tree produced by `DQLParser.primaryExpression`. * @param ctx the parse tree diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts index 759e316f84da..3c4e944287f2 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts @@ -4,9 +4,10 @@ import { AbstractParseTreeVisitor } from "antlr4ng"; import { QueryContext } from "./DQLParser.js"; +import { OperatorExpressionContext } from "./DQLParser.js"; import { OrExpressionContext } from "./DQLParser.js"; +import { OrTermContext } from "./DQLParser.js"; import { AndExpressionContext } from "./DQLParser.js"; -import { NotExpressionContext } from "./DQLParser.js"; import { PrimaryExpressionContext } from "./DQLParser.js"; import { ComparisonExpressionContext } from "./DQLParser.js"; import { FieldExpressionContext } from "./DQLParser.js"; @@ -33,6 +34,12 @@ export class DQLParserVisitor extends AbstractParseTreeVisitor { * @return the visitor result */ visitQuery?: (ctx: QueryContext) => Result; + /** + * Visit a parse tree produced by `DQLParser.operatorExpression`. + * @param ctx the parse tree + * @return the visitor result + */ + visitOperatorExpression?: (ctx: OperatorExpressionContext) => Result; /** * Visit a parse tree produced by `DQLParser.orExpression`. * @param ctx the parse tree @@ -40,17 +47,17 @@ export class DQLParserVisitor extends AbstractParseTreeVisitor { */ visitOrExpression?: (ctx: OrExpressionContext) => Result; /** - * Visit a parse tree produced by `DQLParser.andExpression`. + * Visit a parse tree produced by `DQLParser.orTerm`. * @param ctx the parse tree * @return the visitor result */ - visitAndExpression?: (ctx: AndExpressionContext) => Result; + visitOrTerm?: (ctx: OrTermContext) => Result; /** - * Visit a parse tree produced by `DQLParser.notExpression`. + * Visit a parse tree produced by `DQLParser.andExpression`. * @param ctx the parse tree * @return the visitor result */ - visitNotExpression?: (ctx: NotExpressionContext) => Result; + visitAndExpression?: (ctx: AndExpressionContext) => Result; /** * Visit a parse tree produced by `DQLParser.primaryExpression`. * @param ctx the parse tree diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp index 1d85f870d100..69f5027272c3 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -10,7 +10,6 @@ null ':' '(' ')' -'.' null null null @@ -28,7 +27,6 @@ LE EQ LPAREN RPAREN -DOT PHRASE NUMBER IDENTIFIER @@ -36,9 +34,10 @@ WS rule names: query +operatorExpression orExpression +orTerm andExpression -notExpression primaryExpression comparisonExpression fieldExpression @@ -52,4 +51,4 @@ comparisonOperator atn: -[4, 1, 15, 107, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 5, 1, 34, 8, 1, 10, 1, 12, 1, 37, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 1, 3, 3, 3, 50, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 59, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 69, 8, 6, 1, 7, 1, 7, 5, 7, 73, 8, 7, 10, 7, 12, 7, 76, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 82, 8, 8, 1, 8, 5, 8, 85, 8, 8, 10, 8, 12, 8, 88, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 94, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 103, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 12, 13, 1, 0, 4, 7, 105, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 49, 1, 0, 0, 0, 8, 58, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 64, 1, 0, 0, 0, 14, 70, 1, 0, 0, 0, 16, 77, 1, 0, 0, 0, 18, 93, 1, 0, 0, 0, 20, 95, 1, 0, 0, 0, 22, 97, 1, 0, 0, 0, 24, 102, 1, 0, 0, 0, 26, 104, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 35, 3, 4, 2, 0, 31, 32, 5, 1, 0, 0, 32, 34, 3, 4, 2, 0, 33, 31, 1, 0, 0, 0, 34, 37, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 3, 1, 0, 0, 0, 37, 35, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 2, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 47, 5, 3, 0, 0, 47, 50, 3, 6, 3, 0, 48, 50, 3, 8, 4, 0, 49, 46, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 7, 1, 0, 0, 0, 51, 52, 5, 9, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 10, 0, 0, 54, 59, 1, 0, 0, 0, 55, 59, 3, 10, 5, 0, 56, 59, 3, 12, 6, 0, 57, 59, 3, 14, 7, 0, 58, 51, 1, 0, 0, 0, 58, 55, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 57, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 3, 20, 10, 0, 61, 62, 3, 26, 13, 0, 62, 63, 3, 22, 11, 0, 63, 11, 1, 0, 0, 0, 64, 65, 3, 20, 10, 0, 65, 68, 5, 8, 0, 0, 66, 69, 3, 24, 12, 0, 67, 69, 3, 16, 8, 0, 68, 66, 1, 0, 0, 0, 68, 67, 1, 0, 0, 0, 69, 13, 1, 0, 0, 0, 70, 74, 5, 14, 0, 0, 71, 73, 5, 14, 0, 0, 72, 71, 1, 0, 0, 0, 73, 76, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 15, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 77, 78, 5, 9, 0, 0, 78, 86, 3, 18, 9, 0, 79, 81, 7, 0, 0, 0, 80, 82, 5, 3, 0, 0, 81, 80, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 85, 3, 18, 9, 0, 84, 79, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 89, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 90, 5, 10, 0, 0, 90, 17, 1, 0, 0, 0, 91, 94, 3, 16, 8, 0, 92, 94, 3, 24, 12, 0, 93, 91, 1, 0, 0, 0, 93, 92, 1, 0, 0, 0, 94, 19, 1, 0, 0, 0, 95, 96, 5, 14, 0, 0, 96, 21, 1, 0, 0, 0, 97, 98, 7, 1, 0, 0, 98, 23, 1, 0, 0, 0, 99, 103, 5, 12, 0, 0, 100, 103, 5, 13, 0, 0, 101, 103, 3, 14, 7, 0, 102, 99, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 25, 1, 0, 0, 0, 104, 105, 7, 2, 0, 0, 105, 27, 1, 0, 0, 0, 10, 35, 43, 49, 58, 68, 74, 81, 86, 93, 102] \ No newline at end of file +[4, 1, 14, 116, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 1, 0, 3, 0, 33, 8, 0, 1, 1, 1, 1, 3, 1, 37, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 3, 3, 49, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 54, 8, 4, 10, 4, 12, 4, 57, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 68, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 78, 8, 7, 1, 8, 1, 8, 5, 8, 82, 8, 8, 10, 8, 12, 8, 85, 9, 8, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 91, 8, 9, 1, 9, 5, 9, 94, 8, 9, 10, 9, 12, 9, 97, 9, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 103, 8, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 112, 8, 13, 1, 14, 1, 14, 1, 14, 0, 0, 15, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 116, 0, 32, 1, 0, 0, 0, 2, 36, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 48, 1, 0, 0, 0, 8, 50, 1, 0, 0, 0, 10, 67, 1, 0, 0, 0, 12, 69, 1, 0, 0, 0, 14, 73, 1, 0, 0, 0, 16, 79, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 102, 1, 0, 0, 0, 22, 104, 1, 0, 0, 0, 24, 106, 1, 0, 0, 0, 26, 111, 1, 0, 0, 0, 28, 113, 1, 0, 0, 0, 30, 33, 3, 10, 5, 0, 31, 33, 3, 2, 1, 0, 32, 30, 1, 0, 0, 0, 32, 31, 1, 0, 0, 0, 33, 1, 1, 0, 0, 0, 34, 37, 3, 8, 4, 0, 35, 37, 3, 4, 2, 0, 36, 34, 1, 0, 0, 0, 36, 35, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 1, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 49, 3, 10, 5, 0, 47, 49, 3, 8, 4, 0, 48, 46, 1, 0, 0, 0, 48, 47, 1, 0, 0, 0, 49, 7, 1, 0, 0, 0, 50, 55, 3, 10, 5, 0, 51, 52, 5, 2, 0, 0, 52, 54, 3, 10, 5, 0, 53, 51, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 9, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 9, 0, 0, 59, 60, 3, 0, 0, 0, 60, 61, 5, 10, 0, 0, 61, 68, 1, 0, 0, 0, 62, 63, 5, 3, 0, 0, 63, 68, 3, 10, 5, 0, 64, 68, 3, 12, 6, 0, 65, 68, 3, 14, 7, 0, 66, 68, 3, 16, 8, 0, 67, 58, 1, 0, 0, 0, 67, 62, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 11, 1, 0, 0, 0, 69, 70, 3, 22, 11, 0, 70, 71, 3, 28, 14, 0, 71, 72, 3, 24, 12, 0, 72, 13, 1, 0, 0, 0, 73, 74, 3, 22, 11, 0, 74, 77, 5, 8, 0, 0, 75, 78, 3, 26, 13, 0, 76, 78, 3, 18, 9, 0, 77, 75, 1, 0, 0, 0, 77, 76, 1, 0, 0, 0, 78, 15, 1, 0, 0, 0, 79, 83, 5, 13, 0, 0, 80, 82, 5, 13, 0, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 17, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 9, 0, 0, 87, 95, 3, 20, 10, 0, 88, 90, 7, 0, 0, 0, 89, 91, 5, 3, 0, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 94, 3, 20, 10, 0, 93, 88, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 10, 0, 0, 99, 19, 1, 0, 0, 0, 100, 103, 3, 18, 9, 0, 101, 103, 3, 26, 13, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 21, 1, 0, 0, 0, 104, 105, 5, 13, 0, 0, 105, 23, 1, 0, 0, 0, 106, 107, 7, 1, 0, 0, 107, 25, 1, 0, 0, 0, 108, 112, 5, 11, 0, 0, 109, 112, 5, 12, 0, 0, 110, 112, 3, 16, 8, 0, 111, 108, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 110, 1, 0, 0, 0, 112, 27, 1, 0, 0, 0, 113, 114, 7, 2, 0, 0, 114, 29, 1, 0, 0, 0, 12, 32, 36, 43, 48, 55, 67, 77, 83, 90, 95, 102, 111] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index 97a606df9811..979ef226b8fd 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -17,32 +17,32 @@ public class DQLParser extends Parser { new PredictionContextCache(); public static final int OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, - DOT=11, PHRASE=12, NUMBER=13, IDENTIFIER=14, WS=15; + PHRASE=11, NUMBER=12, IDENTIFIER=13, WS=14; public static final int - RULE_query = 0, RULE_orExpression = 1, RULE_andExpression = 2, RULE_notExpression = 3, - RULE_primaryExpression = 4, RULE_comparisonExpression = 5, RULE_fieldExpression = 6, - RULE_termSearch = 7, RULE_groupExpression = 8, RULE_groupContent = 9, - RULE_field = 10, RULE_rangeValue = 11, RULE_value = 12, RULE_comparisonOperator = 13; + RULE_query = 0, RULE_operatorExpression = 1, RULE_orExpression = 2, RULE_orTerm = 3, + RULE_andExpression = 4, RULE_primaryExpression = 5, RULE_comparisonExpression = 6, + RULE_fieldExpression = 7, RULE_termSearch = 8, RULE_groupExpression = 9, + RULE_groupContent = 10, RULE_field = 11, RULE_rangeValue = 12, RULE_value = 13, + RULE_comparisonOperator = 14; private static String[] makeRuleNames() { return new String[] { - "query", "orExpression", "andExpression", "notExpression", "primaryExpression", - "comparisonExpression", "fieldExpression", "termSearch", "groupExpression", - "groupContent", "field", "rangeValue", "value", "comparisonOperator" + "query", "operatorExpression", "orExpression", "orTerm", "andExpression", + "primaryExpression", "comparisonExpression", "fieldExpression", "termSearch", + "groupExpression", "groupContent", "field", "rangeValue", "value", "comparisonOperator" }; } public static final String[] ruleNames = makeRuleNames(); private static String[] makeLiteralNames() { return new String[] { - null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", "')'", - "'.'" + null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", "')'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "DOT", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "PHRASE", "NUMBER", "IDENTIFIER", "WS" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); @@ -98,8 +98,11 @@ public DQLParser(TokenStream input) { @SuppressWarnings("CheckReturnValue") public static class QueryContext extends ParserRuleContext { - public OrExpressionContext orExpression() { - return getRuleContext(OrExpressionContext.class,0); + public PrimaryExpressionContext primaryExpression() { + return getRuleContext(PrimaryExpressionContext.class,0); + } + public OperatorExpressionContext operatorExpression() { + return getRuleContext(OperatorExpressionContext.class,0); } public QueryContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); @@ -111,10 +114,23 @@ public final QueryContext query() throws RecognitionException { QueryContext _localctx = new QueryContext(_ctx, getState()); enterRule(_localctx, 0, RULE_query); try { - enterOuterAlt(_localctx, 1); - { - setState(28); - orExpression(); + setState(32); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(30); + primaryExpression(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(31); + operatorExpression(); + } + break; } } catch (RecognitionException re) { @@ -129,48 +145,40 @@ public final QueryContext query() throws RecognitionException { } @SuppressWarnings("CheckReturnValue") - public static class OrExpressionContext extends ParserRuleContext { - public List andExpression() { - return getRuleContexts(AndExpressionContext.class); + public static class OperatorExpressionContext extends ParserRuleContext { + public AndExpressionContext andExpression() { + return getRuleContext(AndExpressionContext.class,0); } - public AndExpressionContext andExpression(int i) { - return getRuleContext(AndExpressionContext.class,i); - } - public List OR() { return getTokens(DQLParser.OR); } - public TerminalNode OR(int i) { - return getToken(DQLParser.OR, i); + public OrExpressionContext orExpression() { + return getRuleContext(OrExpressionContext.class,0); } - public OrExpressionContext(ParserRuleContext parent, int invokingState) { + public OperatorExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - @Override public int getRuleIndex() { return RULE_orExpression; } + @Override public int getRuleIndex() { return RULE_operatorExpression; } } - public final OrExpressionContext orExpression() throws RecognitionException { - OrExpressionContext _localctx = new OrExpressionContext(_ctx, getState()); - enterRule(_localctx, 2, RULE_orExpression); - int _la; + public final OperatorExpressionContext operatorExpression() throws RecognitionException { + OperatorExpressionContext _localctx = new OperatorExpressionContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_operatorExpression); try { - enterOuterAlt(_localctx, 1); - { - setState(30); - andExpression(); - setState(35); + setState(36); _errHandler.sync(this); - _la = _input.LA(1); - while (_la==OR) { - { + switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); { - setState(31); - match(OR); - setState(32); + setState(34); andExpression(); } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(35); + orExpression(); } - setState(37); - _errHandler.sync(this); - _la = _input.LA(1); - } + break; } } catch (RecognitionException re) { @@ -185,42 +193,42 @@ public final OrExpressionContext orExpression() throws RecognitionException { } @SuppressWarnings("CheckReturnValue") - public static class AndExpressionContext extends ParserRuleContext { - public List notExpression() { - return getRuleContexts(NotExpressionContext.class); + public static class OrExpressionContext extends ParserRuleContext { + public List orTerm() { + return getRuleContexts(OrTermContext.class); } - public NotExpressionContext notExpression(int i) { - return getRuleContext(NotExpressionContext.class,i); + public OrTermContext orTerm(int i) { + return getRuleContext(OrTermContext.class,i); } - public List AND() { return getTokens(DQLParser.AND); } - public TerminalNode AND(int i) { - return getToken(DQLParser.AND, i); + public List OR() { return getTokens(DQLParser.OR); } + public TerminalNode OR(int i) { + return getToken(DQLParser.OR, i); } - public AndExpressionContext(ParserRuleContext parent, int invokingState) { + public OrExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - @Override public int getRuleIndex() { return RULE_andExpression; } + @Override public int getRuleIndex() { return RULE_orExpression; } } - public final AndExpressionContext andExpression() throws RecognitionException { - AndExpressionContext _localctx = new AndExpressionContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_andExpression); + public final OrExpressionContext orExpression() throws RecognitionException { + OrExpressionContext _localctx = new OrExpressionContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_orExpression); int _la; try { enterOuterAlt(_localctx, 1); { setState(38); - notExpression(); + orTerm(); setState(43); _errHandler.sync(this); _la = _input.LA(1); - while (_la==AND) { + while (_la==OR) { { { setState(39); - match(AND); + match(OR); setState(40); - notExpression(); + orTerm(); } } setState(45); @@ -241,46 +249,96 @@ public final AndExpressionContext andExpression() throws RecognitionException { } @SuppressWarnings("CheckReturnValue") - public static class NotExpressionContext extends ParserRuleContext { - public TerminalNode NOT() { return getToken(DQLParser.NOT, 0); } - public NotExpressionContext notExpression() { - return getRuleContext(NotExpressionContext.class,0); - } + public static class OrTermContext extends ParserRuleContext { public PrimaryExpressionContext primaryExpression() { return getRuleContext(PrimaryExpressionContext.class,0); } - public NotExpressionContext(ParserRuleContext parent, int invokingState) { + public AndExpressionContext andExpression() { + return getRuleContext(AndExpressionContext.class,0); + } + public OrTermContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - @Override public int getRuleIndex() { return RULE_notExpression; } + @Override public int getRuleIndex() { return RULE_orTerm; } } - public final NotExpressionContext notExpression() throws RecognitionException { - NotExpressionContext _localctx = new NotExpressionContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_notExpression); + public final OrTermContext orTerm() throws RecognitionException { + OrTermContext _localctx = new OrTermContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_orTerm); try { - setState(49); + setState(48); _errHandler.sync(this); - switch (_input.LA(1)) { - case NOT: + switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + case 1: enterOuterAlt(_localctx, 1); { setState(46); - match(NOT); - setState(47); - notExpression(); + primaryExpression(); } break; - case LPAREN: - case IDENTIFIER: + case 2: enterOuterAlt(_localctx, 2); { - setState(48); - primaryExpression(); + setState(47); + andExpression(); } break; - default: - throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class AndExpressionContext extends ParserRuleContext { + public List primaryExpression() { + return getRuleContexts(PrimaryExpressionContext.class); + } + public PrimaryExpressionContext primaryExpression(int i) { + return getRuleContext(PrimaryExpressionContext.class,i); + } + public List AND() { return getTokens(DQLParser.AND); } + public TerminalNode AND(int i) { + return getToken(DQLParser.AND, i); + } + public AndExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_andExpression; } + } + + public final AndExpressionContext andExpression() throws RecognitionException { + AndExpressionContext _localctx = new AndExpressionContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_andExpression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(50); + primaryExpression(); + setState(55); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==AND) { + { + { + setState(51); + match(AND); + setState(52); + primaryExpression(); + } + } + setState(57); + _errHandler.sync(this); + _la = _input.LA(1); + } } } catch (RecognitionException re) { @@ -301,6 +359,10 @@ public QueryContext query() { return getRuleContext(QueryContext.class,0); } public TerminalNode RPAREN() { return getToken(DQLParser.RPAREN, 0); } + public TerminalNode NOT() { return getToken(DQLParser.NOT, 0); } + public PrimaryExpressionContext primaryExpression() { + return getRuleContext(PrimaryExpressionContext.class,0); + } public ComparisonExpressionContext comparisonExpression() { return getRuleContext(ComparisonExpressionContext.class,0); } @@ -318,40 +380,49 @@ public PrimaryExpressionContext(ParserRuleContext parent, int invokingState) { public final PrimaryExpressionContext primaryExpression() throws RecognitionException { PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_primaryExpression); + enterRule(_localctx, 10, RULE_primaryExpression); try { - setState(58); + setState(67); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(51); + setState(58); match(LPAREN); - setState(52); + setState(59); query(); - setState(53); + setState(60); match(RPAREN); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(55); - comparisonExpression(); + setState(62); + match(NOT); + setState(63); + primaryExpression(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(56); - fieldExpression(); + setState(64); + comparisonExpression(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(57); + setState(65); + fieldExpression(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(66); termSearch(); } break; @@ -387,15 +458,15 @@ public ComparisonExpressionContext(ParserRuleContext parent, int invokingState) public final ComparisonExpressionContext comparisonExpression() throws RecognitionException { ComparisonExpressionContext _localctx = new ComparisonExpressionContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_comparisonExpression); + enterRule(_localctx, 12, RULE_comparisonExpression); try { enterOuterAlt(_localctx, 1); { - setState(60); + setState(69); field(); - setState(61); + setState(70); comparisonOperator(); - setState(62); + setState(71); rangeValue(); } } @@ -430,28 +501,28 @@ public FieldExpressionContext(ParserRuleContext parent, int invokingState) { public final FieldExpressionContext fieldExpression() throws RecognitionException { FieldExpressionContext _localctx = new FieldExpressionContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_fieldExpression); + enterRule(_localctx, 14, RULE_fieldExpression); try { enterOuterAlt(_localctx, 1); { - setState(64); + setState(73); field(); - setState(65); + setState(74); match(EQ); - setState(68); + setState(77); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: case NUMBER: case IDENTIFIER: { - setState(66); + setState(75); value(); } break; case LPAREN: { - setState(67); + setState(76); groupExpression(); } break; @@ -485,24 +556,24 @@ public TermSearchContext(ParserRuleContext parent, int invokingState) { public final TermSearchContext termSearch() throws RecognitionException { TermSearchContext _localctx = new TermSearchContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_termSearch); + enterRule(_localctx, 16, RULE_termSearch); int _la; try { enterOuterAlt(_localctx, 1); { - setState(70); + setState(79); match(IDENTIFIER); - setState(74); + setState(83); _errHandler.sync(this); _la = _input.LA(1); while (_la==IDENTIFIER) { { { - setState(71); + setState(80); match(IDENTIFIER); } } - setState(76); + setState(85); _errHandler.sync(this); _la = _input.LA(1); } @@ -549,22 +620,22 @@ public GroupExpressionContext(ParserRuleContext parent, int invokingState) { public final GroupExpressionContext groupExpression() throws RecognitionException { GroupExpressionContext _localctx = new GroupExpressionContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_groupExpression); + enterRule(_localctx, 18, RULE_groupExpression); int _la; try { enterOuterAlt(_localctx, 1); { - setState(77); + setState(86); match(LPAREN); - setState(78); + setState(87); groupContent(); - setState(86); + setState(95); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR || _la==AND) { { { - setState(79); + setState(88); _la = _input.LA(1); if ( !(_la==OR || _la==AND) ) { _errHandler.recoverInline(this); @@ -575,26 +646,26 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio consume(); } { - setState(81); + setState(90); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(80); + setState(89); match(NOT); } } } - setState(83); + setState(92); groupContent(); } } - setState(88); + setState(97); _errHandler.sync(this); _la = _input.LA(1); } - setState(89); + setState(98); match(RPAREN); } } @@ -625,15 +696,15 @@ public GroupContentContext(ParserRuleContext parent, int invokingState) { public final GroupContentContext groupContent() throws RecognitionException { GroupContentContext _localctx = new GroupContentContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_groupContent); + enterRule(_localctx, 20, RULE_groupContent); try { - setState(93); + setState(102); _errHandler.sync(this); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(91); + setState(100); groupExpression(); } break; @@ -642,7 +713,7 @@ public final GroupContentContext groupContent() throws RecognitionException { case IDENTIFIER: enterOuterAlt(_localctx, 2); { - setState(92); + setState(101); value(); } break; @@ -672,11 +743,11 @@ public FieldContext(ParserRuleContext parent, int invokingState) { public final FieldContext field() throws RecognitionException { FieldContext _localctx = new FieldContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_field); + enterRule(_localctx, 22, RULE_field); try { enterOuterAlt(_localctx, 1); { - setState(95); + setState(104); match(IDENTIFIER); } } @@ -703,12 +774,12 @@ public RangeValueContext(ParserRuleContext parent, int invokingState) { public final RangeValueContext rangeValue() throws RecognitionException { RangeValueContext _localctx = new RangeValueContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_rangeValue); + enterRule(_localctx, 24, RULE_rangeValue); int _la; try { enterOuterAlt(_localctx, 1); { - setState(97); + setState(106); _la = _input.LA(1); if ( !(_la==PHRASE || _la==NUMBER) ) { _errHandler.recoverInline(this); @@ -746,29 +817,29 @@ public ValueContext(ParserRuleContext parent, int invokingState) { public final ValueContext value() throws RecognitionException { ValueContext _localctx = new ValueContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_value); + enterRule(_localctx, 26, RULE_value); try { - setState(102); + setState(111); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: enterOuterAlt(_localctx, 1); { - setState(99); + setState(108); match(PHRASE); } break; case NUMBER: enterOuterAlt(_localctx, 2); { - setState(100); + setState(109); match(NUMBER); } break; case IDENTIFIER: enterOuterAlt(_localctx, 3); { - setState(101); + setState(110); termSearch(); } break; @@ -801,12 +872,12 @@ public ComparisonOperatorContext(ParserRuleContext parent, int invokingState) { public final ComparisonOperatorContext comparisonOperator() throws RecognitionException { ComparisonOperatorContext _localctx = new ComparisonOperatorContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_comparisonOperator); + enterRule(_localctx, 28, RULE_comparisonOperator); int _la; try { enterOuterAlt(_localctx, 1); { - setState(104); + setState(113); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 240L) != 0)) ) { _errHandler.recoverInline(this); @@ -830,64 +901,68 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx } public static final String _serializedATN = - "\u0004\u0001\u000fk\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u0001\u000et\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ - "\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001"+ - "\u0001\u0001\u0005\u0001\"\b\u0001\n\u0001\f\u0001%\t\u0001\u0001\u0002"+ - "\u0001\u0002\u0001\u0002\u0005\u0002*\b\u0002\n\u0002\f\u0002-\t\u0002"+ - "\u0001\u0003\u0001\u0003\u0001\u0003\u0003\u00032\b\u0003\u0001\u0004"+ - "\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+ - "\u0003\u0004;\b\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0003\u0006E\b\u0006"+ - "\u0001\u0007\u0001\u0007\u0005\u0007I\b\u0007\n\u0007\f\u0007L\t\u0007"+ - "\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bR\b\b\u0001\b\u0005\bU\b\b\n\b"+ - "\f\bX\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\t^\b\t\u0001\n\u0001\n"+ - "\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0003\fg\b\f\u0001\r"+ - "\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002\u0004\u0006\b\n\f\u000e"+ - "\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003\u0001\u0000\u0001\u0002"+ - "\u0001\u0000\f\r\u0001\u0000\u0004\u0007i\u0000\u001c\u0001\u0000\u0000"+ - "\u0000\u0002\u001e\u0001\u0000\u0000\u0000\u0004&\u0001\u0000\u0000\u0000"+ - "\u00061\u0001\u0000\u0000\u0000\b:\u0001\u0000\u0000\u0000\n<\u0001\u0000"+ - "\u0000\u0000\f@\u0001\u0000\u0000\u0000\u000eF\u0001\u0000\u0000\u0000"+ - "\u0010M\u0001\u0000\u0000\u0000\u0012]\u0001\u0000\u0000\u0000\u0014_"+ - "\u0001\u0000\u0000\u0000\u0016a\u0001\u0000\u0000\u0000\u0018f\u0001\u0000"+ - "\u0000\u0000\u001ah\u0001\u0000\u0000\u0000\u001c\u001d\u0003\u0002\u0001"+ - "\u0000\u001d\u0001\u0001\u0000\u0000\u0000\u001e#\u0003\u0004\u0002\u0000"+ - "\u001f \u0005\u0001\u0000\u0000 \"\u0003\u0004\u0002\u0000!\u001f\u0001"+ - "\u0000\u0000\u0000\"%\u0001\u0000\u0000\u0000#!\u0001\u0000\u0000\u0000"+ - "#$\u0001\u0000\u0000\u0000$\u0003\u0001\u0000\u0000\u0000%#\u0001\u0000"+ - "\u0000\u0000&+\u0003\u0006\u0003\u0000\'(\u0005\u0002\u0000\u0000(*\u0003"+ - "\u0006\u0003\u0000)\'\u0001\u0000\u0000\u0000*-\u0001\u0000\u0000\u0000"+ - "+)\u0001\u0000\u0000\u0000+,\u0001\u0000\u0000\u0000,\u0005\u0001\u0000"+ - "\u0000\u0000-+\u0001\u0000\u0000\u0000./\u0005\u0003\u0000\u0000/2\u0003"+ - "\u0006\u0003\u000002\u0003\b\u0004\u00001.\u0001\u0000\u0000\u000010\u0001"+ - "\u0000\u0000\u00002\u0007\u0001\u0000\u0000\u000034\u0005\t\u0000\u0000"+ - "45\u0003\u0000\u0000\u000056\u0005\n\u0000\u00006;\u0001\u0000\u0000\u0000"+ - "7;\u0003\n\u0005\u00008;\u0003\f\u0006\u00009;\u0003\u000e\u0007\u0000"+ - ":3\u0001\u0000\u0000\u0000:7\u0001\u0000\u0000\u0000:8\u0001\u0000\u0000"+ - "\u0000:9\u0001\u0000\u0000\u0000;\t\u0001\u0000\u0000\u0000<=\u0003\u0014"+ - "\n\u0000=>\u0003\u001a\r\u0000>?\u0003\u0016\u000b\u0000?\u000b\u0001"+ - "\u0000\u0000\u0000@A\u0003\u0014\n\u0000AD\u0005\b\u0000\u0000BE\u0003"+ - "\u0018\f\u0000CE\u0003\u0010\b\u0000DB\u0001\u0000\u0000\u0000DC\u0001"+ - "\u0000\u0000\u0000E\r\u0001\u0000\u0000\u0000FJ\u0005\u000e\u0000\u0000"+ - "GI\u0005\u000e\u0000\u0000HG\u0001\u0000\u0000\u0000IL\u0001\u0000\u0000"+ - "\u0000JH\u0001\u0000\u0000\u0000JK\u0001\u0000\u0000\u0000K\u000f\u0001"+ - "\u0000\u0000\u0000LJ\u0001\u0000\u0000\u0000MN\u0005\t\u0000\u0000NV\u0003"+ - "\u0012\t\u0000OQ\u0007\u0000\u0000\u0000PR\u0005\u0003\u0000\u0000QP\u0001"+ - "\u0000\u0000\u0000QR\u0001\u0000\u0000\u0000RS\u0001\u0000\u0000\u0000"+ - "SU\u0003\u0012\t\u0000TO\u0001\u0000\u0000\u0000UX\u0001\u0000\u0000\u0000"+ - "VT\u0001\u0000\u0000\u0000VW\u0001\u0000\u0000\u0000WY\u0001\u0000\u0000"+ - "\u0000XV\u0001\u0000\u0000\u0000YZ\u0005\n\u0000\u0000Z\u0011\u0001\u0000"+ - "\u0000\u0000[^\u0003\u0010\b\u0000\\^\u0003\u0018\f\u0000][\u0001\u0000"+ - "\u0000\u0000]\\\u0001\u0000\u0000\u0000^\u0013\u0001\u0000\u0000\u0000"+ - "_`\u0005\u000e\u0000\u0000`\u0015\u0001\u0000\u0000\u0000ab\u0007\u0001"+ - "\u0000\u0000b\u0017\u0001\u0000\u0000\u0000cg\u0005\f\u0000\u0000dg\u0005"+ - "\r\u0000\u0000eg\u0003\u000e\u0007\u0000fc\u0001\u0000\u0000\u0000fd\u0001"+ - "\u0000\u0000\u0000fe\u0001\u0000\u0000\u0000g\u0019\u0001\u0000\u0000"+ - "\u0000hi\u0007\u0002\u0000\u0000i\u001b\u0001\u0000\u0000\u0000\n#+1:"+ - "DJQV]f"; + "\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0001\u0000\u0001\u0000"+ + "\u0003\u0000!\b\u0000\u0001\u0001\u0001\u0001\u0003\u0001%\b\u0001\u0001"+ + "\u0002\u0001\u0002\u0001\u0002\u0005\u0002*\b\u0002\n\u0002\f\u0002-\t"+ + "\u0002\u0001\u0003\u0001\u0003\u0003\u00031\b\u0003\u0001\u0004\u0001"+ + "\u0004\u0001\u0004\u0005\u00046\b\u0004\n\u0004\f\u00049\t\u0004\u0001"+ + "\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+ + "\u0005\u0001\u0005\u0001\u0005\u0003\u0005D\b\u0005\u0001\u0006\u0001"+ + "\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001"+ + "\u0007\u0003\u0007N\b\u0007\u0001\b\u0001\b\u0005\bR\b\b\n\b\f\bU\t\b"+ + "\u0001\t\u0001\t\u0001\t\u0001\t\u0003\t[\b\t\u0001\t\u0005\t^\b\t\n\t"+ + "\f\ta\t\t\u0001\t\u0001\t\u0001\n\u0001\n\u0003\ng\b\n\u0001\u000b\u0001"+ + "\u000b\u0001\f\u0001\f\u0001\r\u0001\r\u0001\r\u0003\rp\b\r\u0001\u000e"+ + "\u0001\u000e\u0001\u000e\u0000\u0000\u000f\u0000\u0002\u0004\u0006\b\n"+ + "\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u001c\u0000\u0003\u0001\u0000"+ + "\u0001\u0002\u0001\u0000\u000b\f\u0001\u0000\u0004\u0007t\u0000 \u0001"+ + "\u0000\u0000\u0000\u0002$\u0001\u0000\u0000\u0000\u0004&\u0001\u0000\u0000"+ + "\u0000\u00060\u0001\u0000\u0000\u0000\b2\u0001\u0000\u0000\u0000\nC\u0001"+ + "\u0000\u0000\u0000\fE\u0001\u0000\u0000\u0000\u000eI\u0001\u0000\u0000"+ + "\u0000\u0010O\u0001\u0000\u0000\u0000\u0012V\u0001\u0000\u0000\u0000\u0014"+ + "f\u0001\u0000\u0000\u0000\u0016h\u0001\u0000\u0000\u0000\u0018j\u0001"+ + "\u0000\u0000\u0000\u001ao\u0001\u0000\u0000\u0000\u001cq\u0001\u0000\u0000"+ + "\u0000\u001e!\u0003\n\u0005\u0000\u001f!\u0003\u0002\u0001\u0000 \u001e"+ + "\u0001\u0000\u0000\u0000 \u001f\u0001\u0000\u0000\u0000!\u0001\u0001\u0000"+ + "\u0000\u0000\"%\u0003\b\u0004\u0000#%\u0003\u0004\u0002\u0000$\"\u0001"+ + "\u0000\u0000\u0000$#\u0001\u0000\u0000\u0000%\u0003\u0001\u0000\u0000"+ + "\u0000&+\u0003\u0006\u0003\u0000\'(\u0005\u0001\u0000\u0000(*\u0003\u0006"+ + "\u0003\u0000)\'\u0001\u0000\u0000\u0000*-\u0001\u0000\u0000\u0000+)\u0001"+ + "\u0000\u0000\u0000+,\u0001\u0000\u0000\u0000,\u0005\u0001\u0000\u0000"+ + "\u0000-+\u0001\u0000\u0000\u0000.1\u0003\n\u0005\u0000/1\u0003\b\u0004"+ + "\u00000.\u0001\u0000\u0000\u00000/\u0001\u0000\u0000\u00001\u0007\u0001"+ + "\u0000\u0000\u000027\u0003\n\u0005\u000034\u0005\u0002\u0000\u000046\u0003"+ + "\n\u0005\u000053\u0001\u0000\u0000\u000069\u0001\u0000\u0000\u000075\u0001"+ + "\u0000\u0000\u000078\u0001\u0000\u0000\u00008\t\u0001\u0000\u0000\u0000"+ + "97\u0001\u0000\u0000\u0000:;\u0005\t\u0000\u0000;<\u0003\u0000\u0000\u0000"+ + "<=\u0005\n\u0000\u0000=D\u0001\u0000\u0000\u0000>?\u0005\u0003\u0000\u0000"+ + "?D\u0003\n\u0005\u0000@D\u0003\f\u0006\u0000AD\u0003\u000e\u0007\u0000"+ + "BD\u0003\u0010\b\u0000C:\u0001\u0000\u0000\u0000C>\u0001\u0000\u0000\u0000"+ + "C@\u0001\u0000\u0000\u0000CA\u0001\u0000\u0000\u0000CB\u0001\u0000\u0000"+ + "\u0000D\u000b\u0001\u0000\u0000\u0000EF\u0003\u0016\u000b\u0000FG\u0003"+ + "\u001c\u000e\u0000GH\u0003\u0018\f\u0000H\r\u0001\u0000\u0000\u0000IJ"+ + "\u0003\u0016\u000b\u0000JM\u0005\b\u0000\u0000KN\u0003\u001a\r\u0000L"+ + "N\u0003\u0012\t\u0000MK\u0001\u0000\u0000\u0000ML\u0001\u0000\u0000\u0000"+ + "N\u000f\u0001\u0000\u0000\u0000OS\u0005\r\u0000\u0000PR\u0005\r\u0000"+ + "\u0000QP\u0001\u0000\u0000\u0000RU\u0001\u0000\u0000\u0000SQ\u0001\u0000"+ + "\u0000\u0000ST\u0001\u0000\u0000\u0000T\u0011\u0001\u0000\u0000\u0000"+ + "US\u0001\u0000\u0000\u0000VW\u0005\t\u0000\u0000W_\u0003\u0014\n\u0000"+ + "XZ\u0007\u0000\u0000\u0000Y[\u0005\u0003\u0000\u0000ZY\u0001\u0000\u0000"+ + "\u0000Z[\u0001\u0000\u0000\u0000[\\\u0001\u0000\u0000\u0000\\^\u0003\u0014"+ + "\n\u0000]X\u0001\u0000\u0000\u0000^a\u0001\u0000\u0000\u0000_]\u0001\u0000"+ + "\u0000\u0000_`\u0001\u0000\u0000\u0000`b\u0001\u0000\u0000\u0000a_\u0001"+ + "\u0000\u0000\u0000bc\u0005\n\u0000\u0000c\u0013\u0001\u0000\u0000\u0000"+ + "dg\u0003\u0012\t\u0000eg\u0003\u001a\r\u0000fd\u0001\u0000\u0000\u0000"+ + "fe\u0001\u0000\u0000\u0000g\u0015\u0001\u0000\u0000\u0000hi\u0005\r\u0000"+ + "\u0000i\u0017\u0001\u0000\u0000\u0000jk\u0007\u0001\u0000\u0000k\u0019"+ + "\u0001\u0000\u0000\u0000lp\u0005\u000b\u0000\u0000mp\u0005\f\u0000\u0000"+ + "np\u0003\u0010\b\u0000ol\u0001\u0000\u0000\u0000om\u0001\u0000\u0000\u0000"+ + "on\u0001\u0000\u0000\u0000p\u001b\u0001\u0000\u0000\u0000qr\u0007\u0002"+ + "\u0000\u0000r\u001d\u0001\u0000\u0000\u0000\f $+07CMSZ_fo"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens index 3210060bf7d1..ac6c6fa0231b 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens @@ -8,11 +8,10 @@ LE=7 EQ=8 LPAREN=9 RPAREN=10 -DOT=11 -PHRASE=12 -NUMBER=13 -IDENTIFIER=14 -WS=15 +PHRASE=11 +NUMBER=12 +IDENTIFIER=13 +WS=14 '>'=4 '<'=5 '>='=6 @@ -20,4 +19,3 @@ WS=15 ':'=8 '('=9 ')'=10 -'.'=11 diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index a936c36df267..8a75ade72661 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -4,22 +4,76 @@ options { tokenVocab = DQLLexer; } -query: orExpression; -orExpression: andExpression (OR andExpression)*; -andExpression: notExpression (AND notExpression)*; -notExpression: NOT notExpression | primaryExpression; -primaryExpression: - LPAREN query RPAREN +query + : primaryExpression + | operatorExpression + ; + +operatorExpression + : andExpression + | orExpression + ; + +orExpression + : orTerm (OR orTerm)* + ; + +orTerm + : primaryExpression + | andExpression + ; + +andExpression + : primaryExpression (AND primaryExpression)* + ; + +primaryExpression + : LPAREN query RPAREN + | NOT primaryExpression | comparisonExpression | fieldExpression - | termSearch; -comparisonExpression: field comparisonOperator rangeValue; -fieldExpression: field EQ (value | groupExpression); -termSearch: IDENTIFIER (IDENTIFIER)*; -groupExpression: - LPAREN groupContent ((OR | AND) (NOT?) groupContent)* RPAREN; -groupContent: groupExpression | value; -field: IDENTIFIER; -rangeValue: NUMBER | PHRASE; -value: PHRASE | NUMBER | termSearch; -comparisonOperator: GT | LT | GE | LE; \ No newline at end of file + | termSearch + ; + +comparisonExpression + : field comparisonOperator rangeValue + ; + +fieldExpression + : field EQ (value | groupExpression) + ; + +termSearch + : IDENTIFIER (IDENTIFIER)* + ; + +groupExpression + : LPAREN groupContent ((OR | AND) (NOT?) groupContent)* RPAREN + ; + +groupContent + : groupExpression + | value + ; + +field + : IDENTIFIER + ; + +rangeValue + : NUMBER + | PHRASE + ; + +value + : PHRASE + | NUMBER + | termSearch + ; + +comparisonOperator + : GT + | LT + | GE + | LE + ; \ No newline at end of file From 008f35217fdb9e4a7c4c6899b1c3c96c7f05094c Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Thu, 18 Jul 2024 14:19:15 -0700 Subject: [PATCH 14/34] rename grammar parser rules Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 14 +- .../antlr/dql/generated/DQLLexer.interp | 4 +- .../antlr/dql/generated/DQLLexer.tokens | 2 +- .../public/antlr/dql/generated/DQLLexer.ts | 6 +- .../antlr/dql/generated/DQLParser.interp | 8 +- .../antlr/dql/generated/DQLParser.tokens | 2 +- .../public/antlr/dql/generated/DQLParser.ts | 140 +++++++++--------- .../antlr/dql/generated/DQLParserListener.ts | 30 ++-- .../antlr/dql/generated/DQLParserVisitor.ts | 18 +-- .../antlr/dql/grammar/.antlr/DQLLexer.interp | 4 +- .../antlr/dql/grammar/.antlr/DQLLexer.java | 6 +- .../antlr/dql/grammar/.antlr/DQLLexer.tokens | 2 +- .../antlr/dql/grammar/.antlr/DQLParser.interp | 8 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 100 ++++++------- .../antlr/dql/grammar/.antlr/DQLParser.tokens | 2 +- .../data/public/antlr/dql/grammar/DQLLexer.g4 | 2 +- .../public/antlr/dql/grammar/DQLParser.g4 | 20 +-- 17 files changed, 181 insertions(+), 187 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 1a98d10332bc..49809cac186e 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,17 +1,11 @@ import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; import { DQLLexer } from './generated/DQLLexer'; -import { - DQLParser, - FieldContext, - ValueContext, - FieldExpressionContext, -} from './generated/DQLParser'; +import { DQLParser, KeyValueExpressionContext } from './generated/DQLParser'; import { CodeCompletionCore } from 'antlr4-c3'; import { getTokenPosition } from '../opensearch_sql/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; import { CursorPosition } from '../opensearch_sql/types'; import { getHttp } from '../../services'; -import { DQLParserListener } from './generated/DQLParserListener'; import { QuerySuggestionGetFnArgs } from '../../autocomplete'; import { DQLParserVisitor } from './generated/DQLParserVisitor'; @@ -95,7 +89,7 @@ const findValueSuggestions = async (index: IndexPattern, field: string, value: s // visitor for parsing the current query class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { - public visitFieldExpression = (ctx: FieldExpressionContext) => { + public visitKeyValueExpression = (ctx: KeyValueExpressionContext) => { let foundValue = ''; if (ctx.value()?.PHRASE()) { @@ -106,7 +100,7 @@ class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { .replace(/^["']|["']$/g, ''); if (strippedPhrase) foundValue = strippedPhrase; } - if (ctx.value()?.termSearch() || ctx.value()?.NUMBER()) { + if (ctx.value()?.tokenSearch() || ctx.value()?.NUMBER()) { const valueText = ctx.value()?.getText(); if (valueText) foundValue = valueText; } @@ -181,7 +175,7 @@ export const getSuggestions = async ({ // suggest other candidates, mainly keywords [...candidates.tokens.keys()].forEach((token: number) => { // ignore identifier, already handled with field rule - if (token === DQLParser.IDENTIFIER || token === DQLParser.PHRASE) { + if (token === DQLParser.ID || token === DQLParser.PHRASE) { return; } diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp index 79935719e1a4..16a3cddba4eb 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp @@ -29,7 +29,7 @@ LPAREN RPAREN PHRASE NUMBER -IDENTIFIER +ID WS rule names: @@ -45,7 +45,7 @@ LPAREN RPAREN PHRASE NUMBER -IDENTIFIER +ID WS channel names: diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens b/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens index ac6c6fa0231b..24439db0066c 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens @@ -10,7 +10,7 @@ LPAREN=9 RPAREN=10 PHRASE=11 NUMBER=12 -IDENTIFIER=13 +ID=13 WS=14 '>'=4 '<'=5 diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts index 0ef46b1db22b..5600e8f0b190 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts @@ -17,7 +17,7 @@ export class DQLLexer extends antlr.Lexer { public static readonly RPAREN = 10; public static readonly PHRASE = 11; public static readonly NUMBER = 12; - public static readonly IDENTIFIER = 13; + public static readonly ID = 13; public static readonly WS = 14; public static readonly channelNames = [ @@ -31,7 +31,7 @@ export class DQLLexer extends antlr.Lexer { public static readonly symbolicNames = [ null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", - "RPAREN", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "RPAREN", "PHRASE", "NUMBER", "ID", "WS" ]; public static readonly modeNames = [ @@ -40,7 +40,7 @@ export class DQLLexer extends antlr.Lexer { public static readonly ruleNames = [ "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "PHRASE", "NUMBER", "IDENTIFIER", "WS", + "PHRASE", "NUMBER", "ID", "WS", ]; diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp index 69f5027272c3..908cde3da249 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp @@ -29,19 +29,19 @@ LPAREN RPAREN PHRASE NUMBER -IDENTIFIER +ID WS rule names: query operatorExpression orExpression -orTerm +term andExpression primaryExpression comparisonExpression -fieldExpression -termSearch +keyValueExpression +tokenSearch groupExpression groupContent field diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens b/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens index ac6c6fa0231b..24439db0066c 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens @@ -10,7 +10,7 @@ LPAREN=9 RPAREN=10 PHRASE=11 NUMBER=12 -IDENTIFIER=13 +ID=13 WS=14 '>'=4 '<'=5 diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts index 2f2cf47ad111..e1e0c5006bda 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts @@ -24,17 +24,17 @@ export class DQLParser extends antlr.Parser { public static readonly RPAREN = 10; public static readonly PHRASE = 11; public static readonly NUMBER = 12; - public static readonly IDENTIFIER = 13; + public static readonly ID = 13; public static readonly WS = 14; public static readonly RULE_query = 0; public static readonly RULE_operatorExpression = 1; public static readonly RULE_orExpression = 2; - public static readonly RULE_orTerm = 3; + public static readonly RULE_term = 3; public static readonly RULE_andExpression = 4; public static readonly RULE_primaryExpression = 5; public static readonly RULE_comparisonExpression = 6; - public static readonly RULE_fieldExpression = 7; - public static readonly RULE_termSearch = 8; + public static readonly RULE_keyValueExpression = 7; + public static readonly RULE_tokenSearch = 8; public static readonly RULE_groupExpression = 9; public static readonly RULE_groupContent = 10; public static readonly RULE_field = 11; @@ -49,12 +49,12 @@ export class DQLParser extends antlr.Parser { public static readonly symbolicNames = [ null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", - "RPAREN", "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "RPAREN", "PHRASE", "NUMBER", "ID", "WS" ]; public static readonly ruleNames = [ - "query", "operatorExpression", "orExpression", "orTerm", "andExpression", - "primaryExpression", "comparisonExpression", "fieldExpression", - "termSearch", "groupExpression", "groupContent", "field", "rangeValue", + "query", "operatorExpression", "orExpression", "term", "andExpression", + "primaryExpression", "comparisonExpression", "keyValueExpression", + "tokenSearch", "groupExpression", "groupContent", "field", "rangeValue", "value", "comparisonOperator", ]; @@ -152,7 +152,7 @@ export class DQLParser extends antlr.Parser { this.enterOuterAlt(localContext, 1); { this.state = 38; - this.orTerm(); + this.term(); this.state = 43; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); @@ -162,7 +162,7 @@ export class DQLParser extends antlr.Parser { this.state = 39; this.match(DQLParser.OR); this.state = 40; - this.orTerm(); + this.term(); } } this.state = 45; @@ -184,9 +184,9 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public orTerm(): OrTermContext { - let localContext = new OrTermContext(this.context, this.state); - this.enterRule(localContext, 6, DQLParser.RULE_orTerm); + public term(): TermContext { + let localContext = new TermContext(this.context, this.state); + this.enterRule(localContext, 6, DQLParser.RULE_term); try { this.state = 48; this.errorHandler.sync(this); @@ -298,14 +298,14 @@ export class DQLParser extends antlr.Parser { this.enterOuterAlt(localContext, 4); { this.state = 65; - this.fieldExpression(); + this.keyValueExpression(); } break; case 5: this.enterOuterAlt(localContext, 5); { this.state = 66; - this.termSearch(); + this.tokenSearch(); } break; } @@ -350,9 +350,9 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public fieldExpression(): FieldExpressionContext { - let localContext = new FieldExpressionContext(this.context, this.state); - this.enterRule(localContext, 14, DQLParser.RULE_fieldExpression); + public keyValueExpression(): KeyValueExpressionContext { + let localContext = new KeyValueExpressionContext(this.context, this.state); + this.enterRule(localContext, 14, DQLParser.RULE_keyValueExpression); try { this.enterOuterAlt(localContext, 1); { @@ -365,7 +365,7 @@ export class DQLParser extends antlr.Parser { switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: case DQLParser.NUMBER: - case DQLParser.IDENTIFIER: + case DQLParser.ID: { this.state = 75; this.value(); @@ -395,15 +395,15 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public termSearch(): TermSearchContext { - let localContext = new TermSearchContext(this.context, this.state); - this.enterRule(localContext, 16, DQLParser.RULE_termSearch); + public tokenSearch(): TokenSearchContext { + let localContext = new TokenSearchContext(this.context, this.state); + this.enterRule(localContext, 16, DQLParser.RULE_tokenSearch); let _la: number; try { this.enterOuterAlt(localContext, 1); { this.state = 79; - this.match(DQLParser.IDENTIFIER); + this.match(DQLParser.ID); this.state = 83; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); @@ -411,7 +411,7 @@ export class DQLParser extends antlr.Parser { { { this.state = 80; - this.match(DQLParser.IDENTIFIER); + this.match(DQLParser.ID); } } this.state = 85; @@ -512,7 +512,7 @@ export class DQLParser extends antlr.Parser { break; case DQLParser.PHRASE: case DQLParser.NUMBER: - case DQLParser.IDENTIFIER: + case DQLParser.ID: this.enterOuterAlt(localContext, 2); { this.state = 101; @@ -543,7 +543,7 @@ export class DQLParser extends antlr.Parser { this.enterOuterAlt(localContext, 1); { this.state = 104; - this.match(DQLParser.IDENTIFIER); + this.match(DQLParser.ID); } } catch (re) { @@ -611,11 +611,11 @@ export class DQLParser extends antlr.Parser { this.match(DQLParser.NUMBER); } break; - case DQLParser.IDENTIFIER: + case DQLParser.ID: this.enterOuterAlt(localContext, 3); { this.state = 110; - this.termSearch(); + this.tokenSearch(); } break; default: @@ -796,14 +796,14 @@ export class OrExpressionContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public orTerm(): OrTermContext[]; - public orTerm(i: number): OrTermContext | null; - public orTerm(i?: number): OrTermContext[] | OrTermContext | null { + public term(): TermContext[]; + public term(i: number): TermContext | null; + public term(i?: number): TermContext[] | TermContext | null { if (i === undefined) { - return this.getRuleContexts(OrTermContext); + return this.getRuleContexts(TermContext); } - return this.getRuleContext(i, OrTermContext); + return this.getRuleContext(i, TermContext); } public OR(): antlr.TerminalNode[]; public OR(i: number): antlr.TerminalNode | null; @@ -837,7 +837,7 @@ export class OrExpressionContext extends antlr.ParserRuleContext { } -export class OrTermContext extends antlr.ParserRuleContext { +export class TermContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } @@ -848,21 +848,21 @@ export class OrTermContext extends antlr.ParserRuleContext { return this.getRuleContext(0, AndExpressionContext); } public override get ruleIndex(): number { - return DQLParser.RULE_orTerm; + return DQLParser.RULE_term; } public override enterRule(listener: DQLParserListener): void { - if(listener.enterOrTerm) { - listener.enterOrTerm(this); + if(listener.enterTerm) { + listener.enterTerm(this); } } public override exitRule(listener: DQLParserListener): void { - if(listener.exitOrTerm) { - listener.exitOrTerm(this); + if(listener.exitTerm) { + listener.exitTerm(this); } } public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitOrTerm) { - return visitor.visitOrTerm(this); + if (visitor.visitTerm) { + return visitor.visitTerm(this); } else { return visitor.visitChildren(this); } @@ -937,11 +937,11 @@ export class PrimaryExpressionContext extends antlr.ParserRuleContext { public comparisonExpression(): ComparisonExpressionContext | null { return this.getRuleContext(0, ComparisonExpressionContext); } - public fieldExpression(): FieldExpressionContext | null { - return this.getRuleContext(0, FieldExpressionContext); + public keyValueExpression(): KeyValueExpressionContext | null { + return this.getRuleContext(0, KeyValueExpressionContext); } - public termSearch(): TermSearchContext | null { - return this.getRuleContext(0, TermSearchContext); + public tokenSearch(): TokenSearchContext | null { + return this.getRuleContext(0, TokenSearchContext); } public override get ruleIndex(): number { return DQLParser.RULE_primaryExpression; @@ -1002,7 +1002,7 @@ export class ComparisonExpressionContext extends antlr.ParserRuleContext { } -export class FieldExpressionContext extends antlr.ParserRuleContext { +export class KeyValueExpressionContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } @@ -1019,21 +1019,21 @@ export class FieldExpressionContext extends antlr.ParserRuleContext { return this.getRuleContext(0, GroupExpressionContext); } public override get ruleIndex(): number { - return DQLParser.RULE_fieldExpression; + return DQLParser.RULE_keyValueExpression; } public override enterRule(listener: DQLParserListener): void { - if(listener.enterFieldExpression) { - listener.enterFieldExpression(this); + if(listener.enterKeyValueExpression) { + listener.enterKeyValueExpression(this); } } public override exitRule(listener: DQLParserListener): void { - if(listener.exitFieldExpression) { - listener.exitFieldExpression(this); + if(listener.exitKeyValueExpression) { + listener.exitKeyValueExpression(this); } } public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitFieldExpression) { - return visitor.visitFieldExpression(this); + if (visitor.visitKeyValueExpression) { + return visitor.visitKeyValueExpression(this); } else { return visitor.visitChildren(this); } @@ -1041,35 +1041,35 @@ export class FieldExpressionContext extends antlr.ParserRuleContext { } -export class TermSearchContext extends antlr.ParserRuleContext { +export class TokenSearchContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public IDENTIFIER(): antlr.TerminalNode[]; - public IDENTIFIER(i: number): antlr.TerminalNode | null; - public IDENTIFIER(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + public ID(): antlr.TerminalNode[]; + public ID(i: number): antlr.TerminalNode | null; + public ID(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { if (i === undefined) { - return this.getTokens(DQLParser.IDENTIFIER); + return this.getTokens(DQLParser.ID); } else { - return this.getToken(DQLParser.IDENTIFIER, i); + return this.getToken(DQLParser.ID, i); } } public override get ruleIndex(): number { - return DQLParser.RULE_termSearch; + return DQLParser.RULE_tokenSearch; } public override enterRule(listener: DQLParserListener): void { - if(listener.enterTermSearch) { - listener.enterTermSearch(this); + if(listener.enterTokenSearch) { + listener.enterTokenSearch(this); } } public override exitRule(listener: DQLParserListener): void { - if(listener.exitTermSearch) { - listener.exitTermSearch(this); + if(listener.exitTokenSearch) { + listener.exitTokenSearch(this); } } public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitTermSearch) { - return visitor.visitTermSearch(this); + if (visitor.visitTokenSearch) { + return visitor.visitTokenSearch(this); } else { return visitor.visitChildren(this); } @@ -1183,8 +1183,8 @@ export class FieldContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public IDENTIFIER(): antlr.TerminalNode { - return this.getToken(DQLParser.IDENTIFIER, 0)!; + public ID(): antlr.TerminalNode { + return this.getToken(DQLParser.ID, 0)!; } public override get ruleIndex(): number { return DQLParser.RULE_field; @@ -1252,8 +1252,8 @@ export class ValueContext extends antlr.ParserRuleContext { public NUMBER(): antlr.TerminalNode | null { return this.getToken(DQLParser.NUMBER, 0); } - public termSearch(): TermSearchContext | null { - return this.getRuleContext(0, TermSearchContext); + public tokenSearch(): TokenSearchContext | null { + return this.getRuleContext(0, TokenSearchContext); } public override get ruleIndex(): number { return DQLParser.RULE_value; diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts index c5fd09d9fc7c..a0c17a256e22 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts @@ -6,12 +6,12 @@ import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "a import { QueryContext } from "./DQLParser.js"; import { OperatorExpressionContext } from "./DQLParser.js"; import { OrExpressionContext } from "./DQLParser.js"; -import { OrTermContext } from "./DQLParser.js"; +import { TermContext } from "./DQLParser.js"; import { AndExpressionContext } from "./DQLParser.js"; import { PrimaryExpressionContext } from "./DQLParser.js"; import { ComparisonExpressionContext } from "./DQLParser.js"; -import { FieldExpressionContext } from "./DQLParser.js"; -import { TermSearchContext } from "./DQLParser.js"; +import { KeyValueExpressionContext } from "./DQLParser.js"; +import { TokenSearchContext } from "./DQLParser.js"; import { GroupExpressionContext } from "./DQLParser.js"; import { GroupContentContext } from "./DQLParser.js"; import { FieldContext } from "./DQLParser.js"; @@ -56,15 +56,15 @@ export class DQLParserListener implements ParseTreeListener { */ exitOrExpression?: (ctx: OrExpressionContext) => void; /** - * Enter a parse tree produced by `DQLParser.orTerm`. + * Enter a parse tree produced by `DQLParser.term`. * @param ctx the parse tree */ - enterOrTerm?: (ctx: OrTermContext) => void; + enterTerm?: (ctx: TermContext) => void; /** - * Exit a parse tree produced by `DQLParser.orTerm`. + * Exit a parse tree produced by `DQLParser.term`. * @param ctx the parse tree */ - exitOrTerm?: (ctx: OrTermContext) => void; + exitTerm?: (ctx: TermContext) => void; /** * Enter a parse tree produced by `DQLParser.andExpression`. * @param ctx the parse tree @@ -96,25 +96,25 @@ export class DQLParserListener implements ParseTreeListener { */ exitComparisonExpression?: (ctx: ComparisonExpressionContext) => void; /** - * Enter a parse tree produced by `DQLParser.fieldExpression`. + * Enter a parse tree produced by `DQLParser.keyValueExpression`. * @param ctx the parse tree */ - enterFieldExpression?: (ctx: FieldExpressionContext) => void; + enterKeyValueExpression?: (ctx: KeyValueExpressionContext) => void; /** - * Exit a parse tree produced by `DQLParser.fieldExpression`. + * Exit a parse tree produced by `DQLParser.keyValueExpression`. * @param ctx the parse tree */ - exitFieldExpression?: (ctx: FieldExpressionContext) => void; + exitKeyValueExpression?: (ctx: KeyValueExpressionContext) => void; /** - * Enter a parse tree produced by `DQLParser.termSearch`. + * Enter a parse tree produced by `DQLParser.tokenSearch`. * @param ctx the parse tree */ - enterTermSearch?: (ctx: TermSearchContext) => void; + enterTokenSearch?: (ctx: TokenSearchContext) => void; /** - * Exit a parse tree produced by `DQLParser.termSearch`. + * Exit a parse tree produced by `DQLParser.tokenSearch`. * @param ctx the parse tree */ - exitTermSearch?: (ctx: TermSearchContext) => void; + exitTokenSearch?: (ctx: TokenSearchContext) => void; /** * Enter a parse tree produced by `DQLParser.groupExpression`. * @param ctx the parse tree diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts index 3c4e944287f2..75534a289a7f 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts @@ -6,12 +6,12 @@ import { AbstractParseTreeVisitor } from "antlr4ng"; import { QueryContext } from "./DQLParser.js"; import { OperatorExpressionContext } from "./DQLParser.js"; import { OrExpressionContext } from "./DQLParser.js"; -import { OrTermContext } from "./DQLParser.js"; +import { TermContext } from "./DQLParser.js"; import { AndExpressionContext } from "./DQLParser.js"; import { PrimaryExpressionContext } from "./DQLParser.js"; import { ComparisonExpressionContext } from "./DQLParser.js"; -import { FieldExpressionContext } from "./DQLParser.js"; -import { TermSearchContext } from "./DQLParser.js"; +import { KeyValueExpressionContext } from "./DQLParser.js"; +import { TokenSearchContext } from "./DQLParser.js"; import { GroupExpressionContext } from "./DQLParser.js"; import { GroupContentContext } from "./DQLParser.js"; import { FieldContext } from "./DQLParser.js"; @@ -47,11 +47,11 @@ export class DQLParserVisitor extends AbstractParseTreeVisitor { */ visitOrExpression?: (ctx: OrExpressionContext) => Result; /** - * Visit a parse tree produced by `DQLParser.orTerm`. + * Visit a parse tree produced by `DQLParser.term`. * @param ctx the parse tree * @return the visitor result */ - visitOrTerm?: (ctx: OrTermContext) => Result; + visitTerm?: (ctx: TermContext) => Result; /** * Visit a parse tree produced by `DQLParser.andExpression`. * @param ctx the parse tree @@ -71,17 +71,17 @@ export class DQLParserVisitor extends AbstractParseTreeVisitor { */ visitComparisonExpression?: (ctx: ComparisonExpressionContext) => Result; /** - * Visit a parse tree produced by `DQLParser.fieldExpression`. + * Visit a parse tree produced by `DQLParser.keyValueExpression`. * @param ctx the parse tree * @return the visitor result */ - visitFieldExpression?: (ctx: FieldExpressionContext) => Result; + visitKeyValueExpression?: (ctx: KeyValueExpressionContext) => Result; /** - * Visit a parse tree produced by `DQLParser.termSearch`. + * Visit a parse tree produced by `DQLParser.tokenSearch`. * @param ctx the parse tree * @return the visitor result */ - visitTermSearch?: (ctx: TermSearchContext) => Result; + visitTokenSearch?: (ctx: TokenSearchContext) => Result; /** * Visit a parse tree produced by `DQLParser.groupExpression`. * @param ctx the parse tree diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp index 79935719e1a4..16a3cddba4eb 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp @@ -29,7 +29,7 @@ LPAREN RPAREN PHRASE NUMBER -IDENTIFIER +ID WS rule names: @@ -45,7 +45,7 @@ LPAREN RPAREN PHRASE NUMBER -IDENTIFIER +ID WS channel names: diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java index b807821ab04e..5dc52ceba5e5 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java @@ -17,7 +17,7 @@ public class DQLLexer extends Lexer { new PredictionContextCache(); public static final int OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, - PHRASE=11, NUMBER=12, IDENTIFIER=13, WS=14; + PHRASE=11, NUMBER=12, ID=13, WS=14; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; @@ -29,7 +29,7 @@ public class DQLLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "PHRASE", "NUMBER", "ID", "WS" }; } public static final String[] ruleNames = makeRuleNames(); @@ -43,7 +43,7 @@ private static String[] makeLiteralNames() { private static String[] makeSymbolicNames() { return new String[] { null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "PHRASE", "NUMBER", "ID", "WS" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens index ac6c6fa0231b..24439db0066c 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens @@ -10,7 +10,7 @@ LPAREN=9 RPAREN=10 PHRASE=11 NUMBER=12 -IDENTIFIER=13 +ID=13 WS=14 '>'=4 '<'=5 diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp index 69f5027272c3..908cde3da249 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -29,19 +29,19 @@ LPAREN RPAREN PHRASE NUMBER -IDENTIFIER +ID WS rule names: query operatorExpression orExpression -orTerm +term andExpression primaryExpression comparisonExpression -fieldExpression -termSearch +keyValueExpression +tokenSearch groupExpression groupContent field diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index 979ef226b8fd..a97c9136c537 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -17,17 +17,17 @@ public class DQLParser extends Parser { new PredictionContextCache(); public static final int OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, - PHRASE=11, NUMBER=12, IDENTIFIER=13, WS=14; + PHRASE=11, NUMBER=12, ID=13, WS=14; public static final int - RULE_query = 0, RULE_operatorExpression = 1, RULE_orExpression = 2, RULE_orTerm = 3, + RULE_query = 0, RULE_operatorExpression = 1, RULE_orExpression = 2, RULE_term = 3, RULE_andExpression = 4, RULE_primaryExpression = 5, RULE_comparisonExpression = 6, - RULE_fieldExpression = 7, RULE_termSearch = 8, RULE_groupExpression = 9, + RULE_keyValueExpression = 7, RULE_tokenSearch = 8, RULE_groupExpression = 9, RULE_groupContent = 10, RULE_field = 11, RULE_rangeValue = 12, RULE_value = 13, RULE_comparisonOperator = 14; private static String[] makeRuleNames() { return new String[] { - "query", "operatorExpression", "orExpression", "orTerm", "andExpression", - "primaryExpression", "comparisonExpression", "fieldExpression", "termSearch", + "query", "operatorExpression", "orExpression", "term", "andExpression", + "primaryExpression", "comparisonExpression", "keyValueExpression", "tokenSearch", "groupExpression", "groupContent", "field", "rangeValue", "value", "comparisonOperator" }; } @@ -42,7 +42,7 @@ private static String[] makeLiteralNames() { private static String[] makeSymbolicNames() { return new String[] { null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "PHRASE", "NUMBER", "IDENTIFIER", "WS" + "PHRASE", "NUMBER", "ID", "WS" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); @@ -194,11 +194,11 @@ public final OperatorExpressionContext operatorExpression() throws RecognitionEx @SuppressWarnings("CheckReturnValue") public static class OrExpressionContext extends ParserRuleContext { - public List orTerm() { - return getRuleContexts(OrTermContext.class); + public List term() { + return getRuleContexts(TermContext.class); } - public OrTermContext orTerm(int i) { - return getRuleContext(OrTermContext.class,i); + public TermContext term(int i) { + return getRuleContext(TermContext.class,i); } public List OR() { return getTokens(DQLParser.OR); } public TerminalNode OR(int i) { @@ -218,7 +218,7 @@ public final OrExpressionContext orExpression() throws RecognitionException { enterOuterAlt(_localctx, 1); { setState(38); - orTerm(); + term(); setState(43); _errHandler.sync(this); _la = _input.LA(1); @@ -228,7 +228,7 @@ public final OrExpressionContext orExpression() throws RecognitionException { setState(39); match(OR); setState(40); - orTerm(); + term(); } } setState(45); @@ -249,22 +249,22 @@ public final OrExpressionContext orExpression() throws RecognitionException { } @SuppressWarnings("CheckReturnValue") - public static class OrTermContext extends ParserRuleContext { + public static class TermContext extends ParserRuleContext { public PrimaryExpressionContext primaryExpression() { return getRuleContext(PrimaryExpressionContext.class,0); } public AndExpressionContext andExpression() { return getRuleContext(AndExpressionContext.class,0); } - public OrTermContext(ParserRuleContext parent, int invokingState) { + public TermContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - @Override public int getRuleIndex() { return RULE_orTerm; } + @Override public int getRuleIndex() { return RULE_term; } } - public final OrTermContext orTerm() throws RecognitionException { - OrTermContext _localctx = new OrTermContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_orTerm); + public final TermContext term() throws RecognitionException { + TermContext _localctx = new TermContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_term); try { setState(48); _errHandler.sync(this); @@ -366,11 +366,11 @@ public PrimaryExpressionContext primaryExpression() { public ComparisonExpressionContext comparisonExpression() { return getRuleContext(ComparisonExpressionContext.class,0); } - public FieldExpressionContext fieldExpression() { - return getRuleContext(FieldExpressionContext.class,0); + public KeyValueExpressionContext keyValueExpression() { + return getRuleContext(KeyValueExpressionContext.class,0); } - public TermSearchContext termSearch() { - return getRuleContext(TermSearchContext.class,0); + public TokenSearchContext tokenSearch() { + return getRuleContext(TokenSearchContext.class,0); } public PrimaryExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); @@ -416,14 +416,14 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce enterOuterAlt(_localctx, 4); { setState(65); - fieldExpression(); + keyValueExpression(); } break; case 5: enterOuterAlt(_localctx, 5); { setState(66); - termSearch(); + tokenSearch(); } break; } @@ -482,7 +482,7 @@ public final ComparisonExpressionContext comparisonExpression() throws Recogniti } @SuppressWarnings("CheckReturnValue") - public static class FieldExpressionContext extends ParserRuleContext { + public static class KeyValueExpressionContext extends ParserRuleContext { public FieldContext field() { return getRuleContext(FieldContext.class,0); } @@ -493,15 +493,15 @@ public ValueContext value() { public GroupExpressionContext groupExpression() { return getRuleContext(GroupExpressionContext.class,0); } - public FieldExpressionContext(ParserRuleContext parent, int invokingState) { + public KeyValueExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - @Override public int getRuleIndex() { return RULE_fieldExpression; } + @Override public int getRuleIndex() { return RULE_keyValueExpression; } } - public final FieldExpressionContext fieldExpression() throws RecognitionException { - FieldExpressionContext _localctx = new FieldExpressionContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_fieldExpression); + public final KeyValueExpressionContext keyValueExpression() throws RecognitionException { + KeyValueExpressionContext _localctx = new KeyValueExpressionContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_keyValueExpression); try { enterOuterAlt(_localctx, 1); { @@ -514,7 +514,7 @@ public final FieldExpressionContext fieldExpression() throws RecognitionExceptio switch (_input.LA(1)) { case PHRASE: case NUMBER: - case IDENTIFIER: + case ID: { setState(75); value(); @@ -543,34 +543,34 @@ public final FieldExpressionContext fieldExpression() throws RecognitionExceptio } @SuppressWarnings("CheckReturnValue") - public static class TermSearchContext extends ParserRuleContext { - public List IDENTIFIER() { return getTokens(DQLParser.IDENTIFIER); } - public TerminalNode IDENTIFIER(int i) { - return getToken(DQLParser.IDENTIFIER, i); + public static class TokenSearchContext extends ParserRuleContext { + public List ID() { return getTokens(DQLParser.ID); } + public TerminalNode ID(int i) { + return getToken(DQLParser.ID, i); } - public TermSearchContext(ParserRuleContext parent, int invokingState) { + public TokenSearchContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - @Override public int getRuleIndex() { return RULE_termSearch; } + @Override public int getRuleIndex() { return RULE_tokenSearch; } } - public final TermSearchContext termSearch() throws RecognitionException { - TermSearchContext _localctx = new TermSearchContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_termSearch); + public final TokenSearchContext tokenSearch() throws RecognitionException { + TokenSearchContext _localctx = new TokenSearchContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_tokenSearch); int _la; try { enterOuterAlt(_localctx, 1); { setState(79); - match(IDENTIFIER); + match(ID); setState(83); _errHandler.sync(this); _la = _input.LA(1); - while (_la==IDENTIFIER) { + while (_la==ID) { { { setState(80); - match(IDENTIFIER); + match(ID); } } setState(85); @@ -710,7 +710,7 @@ public final GroupContentContext groupContent() throws RecognitionException { break; case PHRASE: case NUMBER: - case IDENTIFIER: + case ID: enterOuterAlt(_localctx, 2); { setState(101); @@ -734,7 +734,7 @@ public final GroupContentContext groupContent() throws RecognitionException { @SuppressWarnings("CheckReturnValue") public static class FieldContext extends ParserRuleContext { - public TerminalNode IDENTIFIER() { return getToken(DQLParser.IDENTIFIER, 0); } + public TerminalNode ID() { return getToken(DQLParser.ID, 0); } public FieldContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -748,7 +748,7 @@ public final FieldContext field() throws RecognitionException { enterOuterAlt(_localctx, 1); { setState(104); - match(IDENTIFIER); + match(ID); } } catch (RecognitionException re) { @@ -806,8 +806,8 @@ public final RangeValueContext rangeValue() throws RecognitionException { public static class ValueContext extends ParserRuleContext { public TerminalNode PHRASE() { return getToken(DQLParser.PHRASE, 0); } public TerminalNode NUMBER() { return getToken(DQLParser.NUMBER, 0); } - public TermSearchContext termSearch() { - return getRuleContext(TermSearchContext.class,0); + public TokenSearchContext tokenSearch() { + return getRuleContext(TokenSearchContext.class,0); } public ValueContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); @@ -836,11 +836,11 @@ public final ValueContext value() throws RecognitionException { match(NUMBER); } break; - case IDENTIFIER: + case ID: enterOuterAlt(_localctx, 3); { setState(110); - termSearch(); + tokenSearch(); } break; default: diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens index ac6c6fa0231b..24439db0066c 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens @@ -10,7 +10,7 @@ LPAREN=9 RPAREN=10 PHRASE=11 NUMBER=12 -IDENTIFIER=13 +ID=13 WS=14 '>'=4 '<'=5 diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 index 8efdd3c73540..be4b9b99d7d0 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 @@ -19,7 +19,7 @@ RPAREN: ')'; // Literals PHRASE: '"' (~["\\])* '"'?; NUMBER: '-'? [0-9]+ ('.' [0-9]+)?; -IDENTIFIER: [a-zA-Z_*][a-zA-Z0-9_.*]*; +ID: [a-zA-Z_*][a-zA-Z0-9_.*]*; // SKIP WS: [ \t\r\n]+ -> channel(HIDDEN); \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index 8a75ade72661..ea2f29ee08da 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -15,10 +15,10 @@ operatorExpression ; orExpression - : orTerm (OR orTerm)* + : term (OR term)* ; - -orTerm + +term : primaryExpression | andExpression ; @@ -31,20 +31,20 @@ primaryExpression : LPAREN query RPAREN | NOT primaryExpression | comparisonExpression - | fieldExpression - | termSearch + | keyValueExpression + | tokenSearch ; comparisonExpression : field comparisonOperator rangeValue ; -fieldExpression +keyValueExpression : field EQ (value | groupExpression) ; -termSearch - : IDENTIFIER (IDENTIFIER)* +tokenSearch + : ID (ID)* ; groupExpression @@ -57,7 +57,7 @@ groupContent ; field - : IDENTIFIER + : ID ; rangeValue @@ -68,7 +68,7 @@ rangeValue value : PHRASE | NUMBER - | termSearch + | tokenSearch ; comparisonOperator From fd1f43647b5e46d4246894faaf8f1f3adf288305 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Thu, 18 Jul 2024 16:13:34 -0700 Subject: [PATCH 15/34] bring back minimal autocomplete optimized grammar Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 11 +- .../antlr/dql/generated/DQLParser.interp | 7 +- .../public/antlr/dql/generated/DQLParser.ts | 478 +++++++----------- .../antlr/dql/generated/DQLParserListener.ts | 31 +- .../antlr/dql/generated/DQLParserVisitor.ts | 19 +- .../antlr/dql/grammar/.antlr/DQLParser.interp | 7 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 444 +++++++--------- .../public/antlr/dql/grammar/DQLParser.g4 | 99 ++-- 8 files changed, 419 insertions(+), 677 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 49809cac186e..4f87ae77e243 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -104,9 +104,9 @@ class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { const valueText = ctx.value()?.getText(); if (valueText) foundValue = valueText; } - // if (ctx.groupExpression()) { - // console.log('in a group'); - // } + if (ctx.groupExpression()) { + console.log('in a group'); + } return { field: ctx.field().getText(), value: foundValue }; }; } @@ -124,6 +124,7 @@ export const getSuggestions = async ({ const lexer = new DQLLexer(inputStream); const tokenStream = new CommonTokenStream(lexer); const parser = new DQLParser(tokenStream); + // parser.removeErrorListeners(); const tree = parser.query(); const visitor = new QueryVisitor(); @@ -161,8 +162,8 @@ export const getSuggestions = async ({ // find suggested values for the last found field const { field: lastField = '', value: lastValue = '' } = visitor.visit(tree) ?? {}; - // console.log('lastField: ', lastField); - console.log('lastValue: ', lastValue); + console.log('lastField: ', lastField); + // console.log('lastValue: ', lastValue); if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { const values = await findValueSuggestions(currentIndexPattern, lastField, lastValue ?? ''); completions.push( diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp index 908cde3da249..191f54c819d9 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp @@ -35,9 +35,8 @@ WS rule names: query operatorExpression -orExpression -term -andExpression +booleanOperator +notExpression primaryExpression comparisonExpression keyValueExpression @@ -51,4 +50,4 @@ comparisonOperator atn: -[4, 1, 14, 116, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 1, 0, 3, 0, 33, 8, 0, 1, 1, 1, 1, 3, 1, 37, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 3, 3, 49, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 54, 8, 4, 10, 4, 12, 4, 57, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 68, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 78, 8, 7, 1, 8, 1, 8, 5, 8, 82, 8, 8, 10, 8, 12, 8, 85, 9, 8, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 91, 8, 9, 1, 9, 5, 9, 94, 8, 9, 10, 9, 12, 9, 97, 9, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 103, 8, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 112, 8, 13, 1, 14, 1, 14, 1, 14, 0, 0, 15, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 116, 0, 32, 1, 0, 0, 0, 2, 36, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 48, 1, 0, 0, 0, 8, 50, 1, 0, 0, 0, 10, 67, 1, 0, 0, 0, 12, 69, 1, 0, 0, 0, 14, 73, 1, 0, 0, 0, 16, 79, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 102, 1, 0, 0, 0, 22, 104, 1, 0, 0, 0, 24, 106, 1, 0, 0, 0, 26, 111, 1, 0, 0, 0, 28, 113, 1, 0, 0, 0, 30, 33, 3, 10, 5, 0, 31, 33, 3, 2, 1, 0, 32, 30, 1, 0, 0, 0, 32, 31, 1, 0, 0, 0, 33, 1, 1, 0, 0, 0, 34, 37, 3, 8, 4, 0, 35, 37, 3, 4, 2, 0, 36, 34, 1, 0, 0, 0, 36, 35, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 1, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 49, 3, 10, 5, 0, 47, 49, 3, 8, 4, 0, 48, 46, 1, 0, 0, 0, 48, 47, 1, 0, 0, 0, 49, 7, 1, 0, 0, 0, 50, 55, 3, 10, 5, 0, 51, 52, 5, 2, 0, 0, 52, 54, 3, 10, 5, 0, 53, 51, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 9, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 9, 0, 0, 59, 60, 3, 0, 0, 0, 60, 61, 5, 10, 0, 0, 61, 68, 1, 0, 0, 0, 62, 63, 5, 3, 0, 0, 63, 68, 3, 10, 5, 0, 64, 68, 3, 12, 6, 0, 65, 68, 3, 14, 7, 0, 66, 68, 3, 16, 8, 0, 67, 58, 1, 0, 0, 0, 67, 62, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 11, 1, 0, 0, 0, 69, 70, 3, 22, 11, 0, 70, 71, 3, 28, 14, 0, 71, 72, 3, 24, 12, 0, 72, 13, 1, 0, 0, 0, 73, 74, 3, 22, 11, 0, 74, 77, 5, 8, 0, 0, 75, 78, 3, 26, 13, 0, 76, 78, 3, 18, 9, 0, 77, 75, 1, 0, 0, 0, 77, 76, 1, 0, 0, 0, 78, 15, 1, 0, 0, 0, 79, 83, 5, 13, 0, 0, 80, 82, 5, 13, 0, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 17, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 9, 0, 0, 87, 95, 3, 20, 10, 0, 88, 90, 7, 0, 0, 0, 89, 91, 5, 3, 0, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 94, 3, 20, 10, 0, 93, 88, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 10, 0, 0, 99, 19, 1, 0, 0, 0, 100, 103, 3, 18, 9, 0, 101, 103, 3, 26, 13, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 21, 1, 0, 0, 0, 104, 105, 5, 13, 0, 0, 105, 23, 1, 0, 0, 0, 106, 107, 7, 1, 0, 0, 107, 25, 1, 0, 0, 0, 108, 112, 5, 11, 0, 0, 109, 112, 5, 12, 0, 0, 110, 112, 3, 16, 8, 0, 111, 108, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 110, 1, 0, 0, 0, 112, 27, 1, 0, 0, 0, 113, 114, 7, 2, 0, 0, 114, 29, 1, 0, 0, 0, 12, 32, 36, 43, 48, 55, 67, 77, 83, 90, 95, 102, 111] \ No newline at end of file +[4, 1, 14, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 35, 8, 1, 10, 1, 12, 1, 38, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 43, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 54, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 64, 8, 6, 1, 7, 1, 7, 5, 7, 68, 8, 7, 10, 7, 12, 7, 71, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 77, 8, 8, 1, 8, 5, 8, 80, 8, 8, 10, 8, 12, 8, 83, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 89, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 39, 1, 0, 0, 0, 6, 42, 1, 0, 0, 0, 8, 53, 1, 0, 0, 0, 10, 55, 1, 0, 0, 0, 12, 59, 1, 0, 0, 0, 14, 65, 1, 0, 0, 0, 16, 72, 1, 0, 0, 0, 18, 88, 1, 0, 0, 0, 20, 90, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 36, 3, 6, 3, 0, 31, 32, 3, 4, 2, 0, 32, 33, 3, 6, 3, 0, 33, 35, 1, 0, 0, 0, 34, 31, 1, 0, 0, 0, 35, 38, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 36, 1, 0, 0, 0, 39, 40, 7, 0, 0, 0, 40, 5, 1, 0, 0, 0, 41, 43, 5, 3, 0, 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 45, 3, 8, 4, 0, 45, 7, 1, 0, 0, 0, 46, 47, 5, 9, 0, 0, 47, 48, 3, 0, 0, 0, 48, 49, 5, 10, 0, 0, 49, 54, 1, 0, 0, 0, 50, 54, 3, 10, 5, 0, 51, 54, 3, 12, 6, 0, 52, 54, 3, 14, 7, 0, 53, 46, 1, 0, 0, 0, 53, 50, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 52, 1, 0, 0, 0, 54, 9, 1, 0, 0, 0, 55, 56, 3, 20, 10, 0, 56, 57, 3, 26, 13, 0, 57, 58, 3, 22, 11, 0, 58, 11, 1, 0, 0, 0, 59, 60, 3, 20, 10, 0, 60, 63, 5, 8, 0, 0, 61, 64, 3, 24, 12, 0, 62, 64, 3, 16, 8, 0, 63, 61, 1, 0, 0, 0, 63, 62, 1, 0, 0, 0, 64, 13, 1, 0, 0, 0, 65, 69, 5, 13, 0, 0, 66, 68, 5, 13, 0, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 15, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 9, 0, 0, 73, 81, 3, 18, 9, 0, 74, 76, 7, 0, 0, 0, 75, 77, 5, 3, 0, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 3, 18, 9, 0, 79, 74, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 85, 5, 10, 0, 0, 85, 17, 1, 0, 0, 0, 86, 89, 3, 16, 8, 0, 87, 89, 3, 24, 12, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 19, 1, 0, 0, 0, 90, 91, 5, 13, 0, 0, 91, 21, 1, 0, 0, 0, 92, 93, 7, 1, 0, 0, 93, 23, 1, 0, 0, 0, 94, 98, 5, 11, 0, 0, 95, 98, 5, 12, 0, 0, 96, 98, 3, 14, 7, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 9, 36, 42, 53, 63, 69, 76, 81, 88, 97] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts index e1e0c5006bda..57fad74d37a8 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts @@ -28,19 +28,18 @@ export class DQLParser extends antlr.Parser { public static readonly WS = 14; public static readonly RULE_query = 0; public static readonly RULE_operatorExpression = 1; - public static readonly RULE_orExpression = 2; - public static readonly RULE_term = 3; - public static readonly RULE_andExpression = 4; - public static readonly RULE_primaryExpression = 5; - public static readonly RULE_comparisonExpression = 6; - public static readonly RULE_keyValueExpression = 7; - public static readonly RULE_tokenSearch = 8; - public static readonly RULE_groupExpression = 9; - public static readonly RULE_groupContent = 10; - public static readonly RULE_field = 11; - public static readonly RULE_rangeValue = 12; - public static readonly RULE_value = 13; - public static readonly RULE_comparisonOperator = 14; + public static readonly RULE_booleanOperator = 2; + public static readonly RULE_notExpression = 3; + public static readonly RULE_primaryExpression = 4; + public static readonly RULE_comparisonExpression = 5; + public static readonly RULE_keyValueExpression = 6; + public static readonly RULE_tokenSearch = 7; + public static readonly RULE_groupExpression = 8; + public static readonly RULE_groupContent = 9; + public static readonly RULE_field = 10; + public static readonly RULE_rangeValue = 11; + public static readonly RULE_value = 12; + public static readonly RULE_comparisonOperator = 13; public static readonly literalNames = [ null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", @@ -52,7 +51,7 @@ export class DQLParser extends antlr.Parser { "RPAREN", "PHRASE", "NUMBER", "ID", "WS" ]; public static readonly ruleNames = [ - "query", "operatorExpression", "orExpression", "term", "andExpression", + "query", "operatorExpression", "booleanOperator", "notExpression", "primaryExpression", "comparisonExpression", "keyValueExpression", "tokenSearch", "groupExpression", "groupContent", "field", "rangeValue", "value", "comparisonOperator", @@ -76,23 +75,10 @@ export class DQLParser extends antlr.Parser { let localContext = new QueryContext(this.context, this.state); this.enterRule(localContext, 0, DQLParser.RULE_query); try { - this.state = 32; - this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 0, this.context) ) { - case 1: - this.enterOuterAlt(localContext, 1); - { - this.state = 30; - this.primaryExpression(); - } - break; - case 2: - this.enterOuterAlt(localContext, 2); - { - this.state = 31; - this.operatorExpression(); - } - break; + this.enterOuterAlt(localContext, 1); + { + this.state = 28; + this.operatorExpression(); } } catch (re) { @@ -111,61 +97,25 @@ export class DQLParser extends antlr.Parser { public operatorExpression(): OperatorExpressionContext { let localContext = new OperatorExpressionContext(this.context, this.state); this.enterRule(localContext, 2, DQLParser.RULE_operatorExpression); - try { - this.state = 36; - this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 1, this.context) ) { - case 1: - this.enterOuterAlt(localContext, 1); - { - this.state = 34; - this.andExpression(); - } - break; - case 2: - this.enterOuterAlt(localContext, 2); - { - this.state = 35; - this.orExpression(); - } - break; - } - } - catch (re) { - if (re instanceof antlr.RecognitionException) { - this.errorHandler.reportError(this, re); - this.errorHandler.recover(this, re); - } else { - throw re; - } - } - finally { - this.exitRule(); - } - return localContext; - } - public orExpression(): OrExpressionContext { - let localContext = new OrExpressionContext(this.context, this.state); - this.enterRule(localContext, 4, DQLParser.RULE_orExpression); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 38; - this.term(); - this.state = 43; + this.state = 30; + this.notExpression(); + this.state = 36; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); - while (_la === 1) { + while (_la === 1 || _la === 2) { { { - this.state = 39; - this.match(DQLParser.OR); - this.state = 40; - this.term(); + this.state = 31; + this.booleanOperator(); + this.state = 32; + this.notExpression(); } } - this.state = 45; + this.state = 38; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -184,27 +134,22 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public term(): TermContext { - let localContext = new TermContext(this.context, this.state); - this.enterRule(localContext, 6, DQLParser.RULE_term); + public booleanOperator(): BooleanOperatorContext { + let localContext = new BooleanOperatorContext(this.context, this.state); + this.enterRule(localContext, 4, DQLParser.RULE_booleanOperator); + let _la: number; try { - this.state = 48; - this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context) ) { - case 1: - this.enterOuterAlt(localContext, 1); - { - this.state = 46; - this.primaryExpression(); - } - break; - case 2: - this.enterOuterAlt(localContext, 2); - { - this.state = 47; - this.andExpression(); - } - break; + this.enterOuterAlt(localContext, 1); + { + this.state = 39; + _la = this.tokenStream.LA(1); + if(!(_la === 1 || _la === 2)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } } } catch (re) { @@ -220,31 +165,25 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public andExpression(): AndExpressionContext { - let localContext = new AndExpressionContext(this.context, this.state); - this.enterRule(localContext, 8, DQLParser.RULE_andExpression); + public notExpression(): NotExpressionContext { + let localContext = new NotExpressionContext(this.context, this.state); + this.enterRule(localContext, 6, DQLParser.RULE_notExpression); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 50; - this.primaryExpression(); - this.state = 55; + this.state = 42; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); - while (_la === 2) { + if (_la === 3) { { - { - this.state = 51; - this.match(DQLParser.AND); - this.state = 52; - this.primaryExpression(); - } + this.state = 41; + this.match(DQLParser.NOT); } - this.state = 57; - this.errorHandler.sync(this); - _la = this.tokenStream.LA(1); } + + this.state = 44; + this.primaryExpression(); } } catch (re) { @@ -262,49 +201,40 @@ export class DQLParser extends antlr.Parser { } public primaryExpression(): PrimaryExpressionContext { let localContext = new PrimaryExpressionContext(this.context, this.state); - this.enterRule(localContext, 10, DQLParser.RULE_primaryExpression); + this.enterRule(localContext, 8, DQLParser.RULE_primaryExpression); try { - this.state = 67; + this.state = 53; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 5, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 2, this.context) ) { case 1: this.enterOuterAlt(localContext, 1); { - this.state = 58; + this.state = 46; this.match(DQLParser.LPAREN); - this.state = 59; + this.state = 47; this.query(); - this.state = 60; + this.state = 48; this.match(DQLParser.RPAREN); } break; case 2: this.enterOuterAlt(localContext, 2); { - this.state = 62; - this.match(DQLParser.NOT); - this.state = 63; - this.primaryExpression(); + this.state = 50; + this.comparisonExpression(); } break; case 3: this.enterOuterAlt(localContext, 3); { - this.state = 64; - this.comparisonExpression(); + this.state = 51; + this.keyValueExpression(); } break; case 4: this.enterOuterAlt(localContext, 4); { - this.state = 65; - this.keyValueExpression(); - } - break; - case 5: - this.enterOuterAlt(localContext, 5); - { - this.state = 66; + this.state = 52; this.tokenSearch(); } break; @@ -325,15 +255,15 @@ export class DQLParser extends antlr.Parser { } public comparisonExpression(): ComparisonExpressionContext { let localContext = new ComparisonExpressionContext(this.context, this.state); - this.enterRule(localContext, 12, DQLParser.RULE_comparisonExpression); + this.enterRule(localContext, 10, DQLParser.RULE_comparisonExpression); try { this.enterOuterAlt(localContext, 1); { - this.state = 69; + this.state = 55; this.field(); - this.state = 70; + this.state = 56; this.comparisonOperator(); - this.state = 71; + this.state = 57; this.rangeValue(); } } @@ -352,28 +282,28 @@ export class DQLParser extends antlr.Parser { } public keyValueExpression(): KeyValueExpressionContext { let localContext = new KeyValueExpressionContext(this.context, this.state); - this.enterRule(localContext, 14, DQLParser.RULE_keyValueExpression); + this.enterRule(localContext, 12, DQLParser.RULE_keyValueExpression); try { this.enterOuterAlt(localContext, 1); { - this.state = 73; + this.state = 59; this.field(); - this.state = 74; + this.state = 60; this.match(DQLParser.EQ); - this.state = 77; + this.state = 63; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: case DQLParser.NUMBER: case DQLParser.ID: { - this.state = 75; + this.state = 61; this.value(); } break; case DQLParser.LPAREN: { - this.state = 76; + this.state = 62; this.groupExpression(); } break; @@ -397,24 +327,24 @@ export class DQLParser extends antlr.Parser { } public tokenSearch(): TokenSearchContext { let localContext = new TokenSearchContext(this.context, this.state); - this.enterRule(localContext, 16, DQLParser.RULE_tokenSearch); + this.enterRule(localContext, 14, DQLParser.RULE_tokenSearch); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 79; + this.state = 65; this.match(DQLParser.ID); - this.state = 83; + this.state = 69; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 13) { { { - this.state = 80; + this.state = 66; this.match(DQLParser.ID); } } - this.state = 85; + this.state = 71; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -435,22 +365,22 @@ export class DQLParser extends antlr.Parser { } public groupExpression(): GroupExpressionContext { let localContext = new GroupExpressionContext(this.context, this.state); - this.enterRule(localContext, 18, DQLParser.RULE_groupExpression); + this.enterRule(localContext, 16, DQLParser.RULE_groupExpression); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 86; + this.state = 72; this.match(DQLParser.LPAREN); - this.state = 87; + this.state = 73; this.groupContent(); - this.state = 95; + this.state = 81; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1 || _la === 2) { { { - this.state = 88; + this.state = 74; _la = this.tokenStream.LA(1); if(!(_la === 1 || _la === 2)) { this.errorHandler.recoverInline(this); @@ -460,26 +390,26 @@ export class DQLParser extends antlr.Parser { this.consume(); } { - this.state = 90; + this.state = 76; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 3) { { - this.state = 89; + this.state = 75; this.match(DQLParser.NOT); } } } - this.state = 92; + this.state = 78; this.groupContent(); } } - this.state = 97; + this.state = 83; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 98; + this.state = 84; this.match(DQLParser.RPAREN); } } @@ -498,15 +428,15 @@ export class DQLParser extends antlr.Parser { } public groupContent(): GroupContentContext { let localContext = new GroupContentContext(this.context, this.state); - this.enterRule(localContext, 20, DQLParser.RULE_groupContent); + this.enterRule(localContext, 18, DQLParser.RULE_groupContent); try { - this.state = 102; + this.state = 88; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.LPAREN: this.enterOuterAlt(localContext, 1); { - this.state = 100; + this.state = 86; this.groupExpression(); } break; @@ -515,7 +445,7 @@ export class DQLParser extends antlr.Parser { case DQLParser.ID: this.enterOuterAlt(localContext, 2); { - this.state = 101; + this.state = 87; this.value(); } break; @@ -538,11 +468,11 @@ export class DQLParser extends antlr.Parser { } public field(): FieldContext { let localContext = new FieldContext(this.context, this.state); - this.enterRule(localContext, 22, DQLParser.RULE_field); + this.enterRule(localContext, 20, DQLParser.RULE_field); try { this.enterOuterAlt(localContext, 1); { - this.state = 104; + this.state = 90; this.match(DQLParser.ID); } } @@ -561,12 +491,12 @@ export class DQLParser extends antlr.Parser { } public rangeValue(): RangeValueContext { let localContext = new RangeValueContext(this.context, this.state); - this.enterRule(localContext, 24, DQLParser.RULE_rangeValue); + this.enterRule(localContext, 22, DQLParser.RULE_rangeValue); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 106; + this.state = 92; _la = this.tokenStream.LA(1); if(!(_la === 11 || _la === 12)) { this.errorHandler.recoverInline(this); @@ -592,29 +522,29 @@ export class DQLParser extends antlr.Parser { } public value(): ValueContext { let localContext = new ValueContext(this.context, this.state); - this.enterRule(localContext, 26, DQLParser.RULE_value); + this.enterRule(localContext, 24, DQLParser.RULE_value); try { - this.state = 111; + this.state = 97; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: this.enterOuterAlt(localContext, 1); { - this.state = 108; + this.state = 94; this.match(DQLParser.PHRASE); } break; case DQLParser.NUMBER: this.enterOuterAlt(localContext, 2); { - this.state = 109; + this.state = 95; this.match(DQLParser.NUMBER); } break; case DQLParser.ID: this.enterOuterAlt(localContext, 3); { - this.state = 110; + this.state = 96; this.tokenSearch(); } break; @@ -637,12 +567,12 @@ export class DQLParser extends antlr.Parser { } public comparisonOperator(): ComparisonOperatorContext { let localContext = new ComparisonOperatorContext(this.context, this.state); - this.enterRule(localContext, 28, DQLParser.RULE_comparisonOperator); + this.enterRule(localContext, 26, DQLParser.RULE_comparisonOperator); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 113; + this.state = 99; _la = this.tokenStream.LA(1); if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 240) !== 0))) { this.errorHandler.recoverInline(this); @@ -668,43 +598,37 @@ export class DQLParser extends antlr.Parser { } public static readonly _serializedATN: number[] = [ - 4,1,14,116,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,1,14,102,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, - 2,14,7,14,1,0,1,0,3,0,33,8,0,1,1,1,1,3,1,37,8,1,1,2,1,2,1,2,5,2, - 42,8,2,10,2,12,2,45,9,2,1,3,1,3,3,3,49,8,3,1,4,1,4,1,4,5,4,54,8, - 4,10,4,12,4,57,9,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,3,5,68,8, - 5,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,3,7,78,8,7,1,8,1,8,5,8,82,8,8, - 10,8,12,8,85,9,8,1,9,1,9,1,9,1,9,3,9,91,8,9,1,9,5,9,94,8,9,10,9, - 12,9,97,9,9,1,9,1,9,1,10,1,10,3,10,103,8,10,1,11,1,11,1,12,1,12, - 1,13,1,13,1,13,3,13,112,8,13,1,14,1,14,1,14,0,0,15,0,2,4,6,8,10, - 12,14,16,18,20,22,24,26,28,0,3,1,0,1,2,1,0,11,12,1,0,4,7,116,0,32, - 1,0,0,0,2,36,1,0,0,0,4,38,1,0,0,0,6,48,1,0,0,0,8,50,1,0,0,0,10,67, - 1,0,0,0,12,69,1,0,0,0,14,73,1,0,0,0,16,79,1,0,0,0,18,86,1,0,0,0, - 20,102,1,0,0,0,22,104,1,0,0,0,24,106,1,0,0,0,26,111,1,0,0,0,28,113, - 1,0,0,0,30,33,3,10,5,0,31,33,3,2,1,0,32,30,1,0,0,0,32,31,1,0,0,0, - 33,1,1,0,0,0,34,37,3,8,4,0,35,37,3,4,2,0,36,34,1,0,0,0,36,35,1,0, - 0,0,37,3,1,0,0,0,38,43,3,6,3,0,39,40,5,1,0,0,40,42,3,6,3,0,41,39, - 1,0,0,0,42,45,1,0,0,0,43,41,1,0,0,0,43,44,1,0,0,0,44,5,1,0,0,0,45, - 43,1,0,0,0,46,49,3,10,5,0,47,49,3,8,4,0,48,46,1,0,0,0,48,47,1,0, - 0,0,49,7,1,0,0,0,50,55,3,10,5,0,51,52,5,2,0,0,52,54,3,10,5,0,53, - 51,1,0,0,0,54,57,1,0,0,0,55,53,1,0,0,0,55,56,1,0,0,0,56,9,1,0,0, - 0,57,55,1,0,0,0,58,59,5,9,0,0,59,60,3,0,0,0,60,61,5,10,0,0,61,68, - 1,0,0,0,62,63,5,3,0,0,63,68,3,10,5,0,64,68,3,12,6,0,65,68,3,14,7, - 0,66,68,3,16,8,0,67,58,1,0,0,0,67,62,1,0,0,0,67,64,1,0,0,0,67,65, - 1,0,0,0,67,66,1,0,0,0,68,11,1,0,0,0,69,70,3,22,11,0,70,71,3,28,14, - 0,71,72,3,24,12,0,72,13,1,0,0,0,73,74,3,22,11,0,74,77,5,8,0,0,75, - 78,3,26,13,0,76,78,3,18,9,0,77,75,1,0,0,0,77,76,1,0,0,0,78,15,1, - 0,0,0,79,83,5,13,0,0,80,82,5,13,0,0,81,80,1,0,0,0,82,85,1,0,0,0, - 83,81,1,0,0,0,83,84,1,0,0,0,84,17,1,0,0,0,85,83,1,0,0,0,86,87,5, - 9,0,0,87,95,3,20,10,0,88,90,7,0,0,0,89,91,5,3,0,0,90,89,1,0,0,0, - 90,91,1,0,0,0,91,92,1,0,0,0,92,94,3,20,10,0,93,88,1,0,0,0,94,97, - 1,0,0,0,95,93,1,0,0,0,95,96,1,0,0,0,96,98,1,0,0,0,97,95,1,0,0,0, - 98,99,5,10,0,0,99,19,1,0,0,0,100,103,3,18,9,0,101,103,3,26,13,0, - 102,100,1,0,0,0,102,101,1,0,0,0,103,21,1,0,0,0,104,105,5,13,0,0, - 105,23,1,0,0,0,106,107,7,1,0,0,107,25,1,0,0,0,108,112,5,11,0,0,109, - 112,5,12,0,0,110,112,3,16,8,0,111,108,1,0,0,0,111,109,1,0,0,0,111, - 110,1,0,0,0,112,27,1,0,0,0,113,114,7,2,0,0,114,29,1,0,0,0,12,32, - 36,43,48,55,67,77,83,90,95,102,111 + 1,0,1,0,1,1,1,1,1,1,1,1,5,1,35,8,1,10,1,12,1,38,9,1,1,2,1,2,1,3, + 3,3,43,8,3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,54,8,4,1,5,1, + 5,1,5,1,5,1,6,1,6,1,6,1,6,3,6,64,8,6,1,7,1,7,5,7,68,8,7,10,7,12, + 7,71,9,7,1,8,1,8,1,8,1,8,3,8,77,8,8,1,8,5,8,80,8,8,10,8,12,8,83, + 9,8,1,8,1,8,1,9,1,9,3,9,89,8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12, + 3,12,98,8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,14,16,18,20,22, + 24,26,0,3,1,0,1,2,1,0,11,12,1,0,4,7,99,0,28,1,0,0,0,2,30,1,0,0,0, + 4,39,1,0,0,0,6,42,1,0,0,0,8,53,1,0,0,0,10,55,1,0,0,0,12,59,1,0,0, + 0,14,65,1,0,0,0,16,72,1,0,0,0,18,88,1,0,0,0,20,90,1,0,0,0,22,92, + 1,0,0,0,24,97,1,0,0,0,26,99,1,0,0,0,28,29,3,2,1,0,29,1,1,0,0,0,30, + 36,3,6,3,0,31,32,3,4,2,0,32,33,3,6,3,0,33,35,1,0,0,0,34,31,1,0,0, + 0,35,38,1,0,0,0,36,34,1,0,0,0,36,37,1,0,0,0,37,3,1,0,0,0,38,36,1, + 0,0,0,39,40,7,0,0,0,40,5,1,0,0,0,41,43,5,3,0,0,42,41,1,0,0,0,42, + 43,1,0,0,0,43,44,1,0,0,0,44,45,3,8,4,0,45,7,1,0,0,0,46,47,5,9,0, + 0,47,48,3,0,0,0,48,49,5,10,0,0,49,54,1,0,0,0,50,54,3,10,5,0,51,54, + 3,12,6,0,52,54,3,14,7,0,53,46,1,0,0,0,53,50,1,0,0,0,53,51,1,0,0, + 0,53,52,1,0,0,0,54,9,1,0,0,0,55,56,3,20,10,0,56,57,3,26,13,0,57, + 58,3,22,11,0,58,11,1,0,0,0,59,60,3,20,10,0,60,63,5,8,0,0,61,64,3, + 24,12,0,62,64,3,16,8,0,63,61,1,0,0,0,63,62,1,0,0,0,64,13,1,0,0,0, + 65,69,5,13,0,0,66,68,5,13,0,0,67,66,1,0,0,0,68,71,1,0,0,0,69,67, + 1,0,0,0,69,70,1,0,0,0,70,15,1,0,0,0,71,69,1,0,0,0,72,73,5,9,0,0, + 73,81,3,18,9,0,74,76,7,0,0,0,75,77,5,3,0,0,76,75,1,0,0,0,76,77,1, + 0,0,0,77,78,1,0,0,0,78,80,3,18,9,0,79,74,1,0,0,0,80,83,1,0,0,0,81, + 79,1,0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,81,1,0,0,0,84,85,5,10, + 0,0,85,17,1,0,0,0,86,89,3,16,8,0,87,89,3,24,12,0,88,86,1,0,0,0,88, + 87,1,0,0,0,89,19,1,0,0,0,90,91,5,13,0,0,91,21,1,0,0,0,92,93,7,1, + 0,0,93,23,1,0,0,0,94,98,5,11,0,0,95,98,5,12,0,0,96,98,3,14,7,0,97, + 94,1,0,0,0,97,95,1,0,0,0,97,96,1,0,0,0,98,25,1,0,0,0,99,100,7,2, + 0,0,100,27,1,0,0,0,9,36,42,53,63,69,76,81,88,97 ]; private static __ATN: antlr.ATN; @@ -730,11 +654,8 @@ export class QueryContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public primaryExpression(): PrimaryExpressionContext | null { - return this.getRuleContext(0, PrimaryExpressionContext); - } - public operatorExpression(): OperatorExpressionContext | null { - return this.getRuleContext(0, OperatorExpressionContext); + public operatorExpression(): OperatorExpressionContext { + return this.getRuleContext(0, OperatorExpressionContext)!; } public override get ruleIndex(): number { return DQLParser.RULE_query; @@ -763,11 +684,23 @@ export class OperatorExpressionContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public andExpression(): AndExpressionContext | null { - return this.getRuleContext(0, AndExpressionContext); + public notExpression(): NotExpressionContext[]; + public notExpression(i: number): NotExpressionContext | null; + public notExpression(i?: number): NotExpressionContext[] | NotExpressionContext | null { + if (i === undefined) { + return this.getRuleContexts(NotExpressionContext); + } + + return this.getRuleContext(i, NotExpressionContext); } - public orExpression(): OrExpressionContext | null { - return this.getRuleContext(0, OrExpressionContext); + public booleanOperator(): BooleanOperatorContext[]; + public booleanOperator(i: number): BooleanOperatorContext | null; + public booleanOperator(i?: number): BooleanOperatorContext[] | BooleanOperatorContext | null { + if (i === undefined) { + return this.getRuleContexts(BooleanOperatorContext); + } + + return this.getRuleContext(i, BooleanOperatorContext); } public override get ruleIndex(): number { return DQLParser.RULE_operatorExpression; @@ -792,77 +725,32 @@ export class OperatorExpressionContext extends antlr.ParserRuleContext { } -export class OrExpressionContext extends antlr.ParserRuleContext { - public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { - super(parent, invokingState); - } - public term(): TermContext[]; - public term(i: number): TermContext | null; - public term(i?: number): TermContext[] | TermContext | null { - if (i === undefined) { - return this.getRuleContexts(TermContext); - } - - return this.getRuleContext(i, TermContext); - } - public OR(): antlr.TerminalNode[]; - public OR(i: number): antlr.TerminalNode | null; - public OR(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { - if (i === undefined) { - return this.getTokens(DQLParser.OR); - } else { - return this.getToken(DQLParser.OR, i); - } - } - public override get ruleIndex(): number { - return DQLParser.RULE_orExpression; - } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterOrExpression) { - listener.enterOrExpression(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitOrExpression) { - listener.exitOrExpression(this); - } - } - public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitOrExpression) { - return visitor.visitOrExpression(this); - } else { - return visitor.visitChildren(this); - } - } -} - - -export class TermContext extends antlr.ParserRuleContext { +export class BooleanOperatorContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public primaryExpression(): PrimaryExpressionContext | null { - return this.getRuleContext(0, PrimaryExpressionContext); + public OR(): antlr.TerminalNode | null { + return this.getToken(DQLParser.OR, 0); } - public andExpression(): AndExpressionContext | null { - return this.getRuleContext(0, AndExpressionContext); + public AND(): antlr.TerminalNode | null { + return this.getToken(DQLParser.AND, 0); } public override get ruleIndex(): number { - return DQLParser.RULE_term; + return DQLParser.RULE_booleanOperator; } public override enterRule(listener: DQLParserListener): void { - if(listener.enterTerm) { - listener.enterTerm(this); + if(listener.enterBooleanOperator) { + listener.enterBooleanOperator(this); } } public override exitRule(listener: DQLParserListener): void { - if(listener.exitTerm) { - listener.exitTerm(this); + if(listener.exitBooleanOperator) { + listener.exitBooleanOperator(this); } } public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitTerm) { - return visitor.visitTerm(this); + if (visitor.visitBooleanOperator) { + return visitor.visitBooleanOperator(this); } else { return visitor.visitChildren(this); } @@ -870,44 +758,32 @@ export class TermContext extends antlr.ParserRuleContext { } -export class AndExpressionContext extends antlr.ParserRuleContext { +export class NotExpressionContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public primaryExpression(): PrimaryExpressionContext[]; - public primaryExpression(i: number): PrimaryExpressionContext | null; - public primaryExpression(i?: number): PrimaryExpressionContext[] | PrimaryExpressionContext | null { - if (i === undefined) { - return this.getRuleContexts(PrimaryExpressionContext); - } - - return this.getRuleContext(i, PrimaryExpressionContext); + public primaryExpression(): PrimaryExpressionContext { + return this.getRuleContext(0, PrimaryExpressionContext)!; } - public AND(): antlr.TerminalNode[]; - public AND(i: number): antlr.TerminalNode | null; - public AND(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { - if (i === undefined) { - return this.getTokens(DQLParser.AND); - } else { - return this.getToken(DQLParser.AND, i); - } + public NOT(): antlr.TerminalNode | null { + return this.getToken(DQLParser.NOT, 0); } public override get ruleIndex(): number { - return DQLParser.RULE_andExpression; + return DQLParser.RULE_notExpression; } public override enterRule(listener: DQLParserListener): void { - if(listener.enterAndExpression) { - listener.enterAndExpression(this); + if(listener.enterNotExpression) { + listener.enterNotExpression(this); } } public override exitRule(listener: DQLParserListener): void { - if(listener.exitAndExpression) { - listener.exitAndExpression(this); + if(listener.exitNotExpression) { + listener.exitNotExpression(this); } } public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitAndExpression) { - return visitor.visitAndExpression(this); + if (visitor.visitNotExpression) { + return visitor.visitNotExpression(this); } else { return visitor.visitChildren(this); } @@ -928,12 +804,6 @@ export class PrimaryExpressionContext extends antlr.ParserRuleContext { public RPAREN(): antlr.TerminalNode | null { return this.getToken(DQLParser.RPAREN, 0); } - public NOT(): antlr.TerminalNode | null { - return this.getToken(DQLParser.NOT, 0); - } - public primaryExpression(): PrimaryExpressionContext | null { - return this.getRuleContext(0, PrimaryExpressionContext); - } public comparisonExpression(): ComparisonExpressionContext | null { return this.getRuleContext(0, ComparisonExpressionContext); } diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts index a0c17a256e22..eafa62056765 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts @@ -5,9 +5,8 @@ import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "a import { QueryContext } from "./DQLParser.js"; import { OperatorExpressionContext } from "./DQLParser.js"; -import { OrExpressionContext } from "./DQLParser.js"; -import { TermContext } from "./DQLParser.js"; -import { AndExpressionContext } from "./DQLParser.js"; +import { BooleanOperatorContext } from "./DQLParser.js"; +import { NotExpressionContext } from "./DQLParser.js"; import { PrimaryExpressionContext } from "./DQLParser.js"; import { ComparisonExpressionContext } from "./DQLParser.js"; import { KeyValueExpressionContext } from "./DQLParser.js"; @@ -46,35 +45,25 @@ export class DQLParserListener implements ParseTreeListener { */ exitOperatorExpression?: (ctx: OperatorExpressionContext) => void; /** - * Enter a parse tree produced by `DQLParser.orExpression`. + * Enter a parse tree produced by `DQLParser.booleanOperator`. * @param ctx the parse tree */ - enterOrExpression?: (ctx: OrExpressionContext) => void; + enterBooleanOperator?: (ctx: BooleanOperatorContext) => void; /** - * Exit a parse tree produced by `DQLParser.orExpression`. + * Exit a parse tree produced by `DQLParser.booleanOperator`. * @param ctx the parse tree */ - exitOrExpression?: (ctx: OrExpressionContext) => void; + exitBooleanOperator?: (ctx: BooleanOperatorContext) => void; /** - * Enter a parse tree produced by `DQLParser.term`. + * Enter a parse tree produced by `DQLParser.notExpression`. * @param ctx the parse tree */ - enterTerm?: (ctx: TermContext) => void; + enterNotExpression?: (ctx: NotExpressionContext) => void; /** - * Exit a parse tree produced by `DQLParser.term`. + * Exit a parse tree produced by `DQLParser.notExpression`. * @param ctx the parse tree */ - exitTerm?: (ctx: TermContext) => void; - /** - * Enter a parse tree produced by `DQLParser.andExpression`. - * @param ctx the parse tree - */ - enterAndExpression?: (ctx: AndExpressionContext) => void; - /** - * Exit a parse tree produced by `DQLParser.andExpression`. - * @param ctx the parse tree - */ - exitAndExpression?: (ctx: AndExpressionContext) => void; + exitNotExpression?: (ctx: NotExpressionContext) => void; /** * Enter a parse tree produced by `DQLParser.primaryExpression`. * @param ctx the parse tree diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts index 75534a289a7f..7ac3ea538c5a 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts @@ -5,9 +5,8 @@ import { AbstractParseTreeVisitor } from "antlr4ng"; import { QueryContext } from "./DQLParser.js"; import { OperatorExpressionContext } from "./DQLParser.js"; -import { OrExpressionContext } from "./DQLParser.js"; -import { TermContext } from "./DQLParser.js"; -import { AndExpressionContext } from "./DQLParser.js"; +import { BooleanOperatorContext } from "./DQLParser.js"; +import { NotExpressionContext } from "./DQLParser.js"; import { PrimaryExpressionContext } from "./DQLParser.js"; import { ComparisonExpressionContext } from "./DQLParser.js"; import { KeyValueExpressionContext } from "./DQLParser.js"; @@ -41,23 +40,17 @@ export class DQLParserVisitor extends AbstractParseTreeVisitor { */ visitOperatorExpression?: (ctx: OperatorExpressionContext) => Result; /** - * Visit a parse tree produced by `DQLParser.orExpression`. + * Visit a parse tree produced by `DQLParser.booleanOperator`. * @param ctx the parse tree * @return the visitor result */ - visitOrExpression?: (ctx: OrExpressionContext) => Result; + visitBooleanOperator?: (ctx: BooleanOperatorContext) => Result; /** - * Visit a parse tree produced by `DQLParser.term`. + * Visit a parse tree produced by `DQLParser.notExpression`. * @param ctx the parse tree * @return the visitor result */ - visitTerm?: (ctx: TermContext) => Result; - /** - * Visit a parse tree produced by `DQLParser.andExpression`. - * @param ctx the parse tree - * @return the visitor result - */ - visitAndExpression?: (ctx: AndExpressionContext) => Result; + visitNotExpression?: (ctx: NotExpressionContext) => Result; /** * Visit a parse tree produced by `DQLParser.primaryExpression`. * @param ctx the parse tree diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp index 908cde3da249..191f54c819d9 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -35,9 +35,8 @@ WS rule names: query operatorExpression -orExpression -term -andExpression +booleanOperator +notExpression primaryExpression comparisonExpression keyValueExpression @@ -51,4 +50,4 @@ comparisonOperator atn: -[4, 1, 14, 116, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 1, 0, 1, 0, 3, 0, 33, 8, 0, 1, 1, 1, 1, 3, 1, 37, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 42, 8, 2, 10, 2, 12, 2, 45, 9, 2, 1, 3, 1, 3, 3, 3, 49, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 54, 8, 4, 10, 4, 12, 4, 57, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 68, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 78, 8, 7, 1, 8, 1, 8, 5, 8, 82, 8, 8, 10, 8, 12, 8, 85, 9, 8, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 91, 8, 9, 1, 9, 5, 9, 94, 8, 9, 10, 9, 12, 9, 97, 9, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 103, 8, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 3, 13, 112, 8, 13, 1, 14, 1, 14, 1, 14, 0, 0, 15, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 116, 0, 32, 1, 0, 0, 0, 2, 36, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 48, 1, 0, 0, 0, 8, 50, 1, 0, 0, 0, 10, 67, 1, 0, 0, 0, 12, 69, 1, 0, 0, 0, 14, 73, 1, 0, 0, 0, 16, 79, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 102, 1, 0, 0, 0, 22, 104, 1, 0, 0, 0, 24, 106, 1, 0, 0, 0, 26, 111, 1, 0, 0, 0, 28, 113, 1, 0, 0, 0, 30, 33, 3, 10, 5, 0, 31, 33, 3, 2, 1, 0, 32, 30, 1, 0, 0, 0, 32, 31, 1, 0, 0, 0, 33, 1, 1, 0, 0, 0, 34, 37, 3, 8, 4, 0, 35, 37, 3, 4, 2, 0, 36, 34, 1, 0, 0, 0, 36, 35, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 43, 3, 6, 3, 0, 39, 40, 5, 1, 0, 0, 40, 42, 3, 6, 3, 0, 41, 39, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 5, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 49, 3, 10, 5, 0, 47, 49, 3, 8, 4, 0, 48, 46, 1, 0, 0, 0, 48, 47, 1, 0, 0, 0, 49, 7, 1, 0, 0, 0, 50, 55, 3, 10, 5, 0, 51, 52, 5, 2, 0, 0, 52, 54, 3, 10, 5, 0, 53, 51, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 9, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 59, 5, 9, 0, 0, 59, 60, 3, 0, 0, 0, 60, 61, 5, 10, 0, 0, 61, 68, 1, 0, 0, 0, 62, 63, 5, 3, 0, 0, 63, 68, 3, 10, 5, 0, 64, 68, 3, 12, 6, 0, 65, 68, 3, 14, 7, 0, 66, 68, 3, 16, 8, 0, 67, 58, 1, 0, 0, 0, 67, 62, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 11, 1, 0, 0, 0, 69, 70, 3, 22, 11, 0, 70, 71, 3, 28, 14, 0, 71, 72, 3, 24, 12, 0, 72, 13, 1, 0, 0, 0, 73, 74, 3, 22, 11, 0, 74, 77, 5, 8, 0, 0, 75, 78, 3, 26, 13, 0, 76, 78, 3, 18, 9, 0, 77, 75, 1, 0, 0, 0, 77, 76, 1, 0, 0, 0, 78, 15, 1, 0, 0, 0, 79, 83, 5, 13, 0, 0, 80, 82, 5, 13, 0, 0, 81, 80, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 17, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 87, 5, 9, 0, 0, 87, 95, 3, 20, 10, 0, 88, 90, 7, 0, 0, 0, 89, 91, 5, 3, 0, 0, 90, 89, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 94, 3, 20, 10, 0, 93, 88, 1, 0, 0, 0, 94, 97, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 98, 99, 5, 10, 0, 0, 99, 19, 1, 0, 0, 0, 100, 103, 3, 18, 9, 0, 101, 103, 3, 26, 13, 0, 102, 100, 1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 21, 1, 0, 0, 0, 104, 105, 5, 13, 0, 0, 105, 23, 1, 0, 0, 0, 106, 107, 7, 1, 0, 0, 107, 25, 1, 0, 0, 0, 108, 112, 5, 11, 0, 0, 109, 112, 5, 12, 0, 0, 110, 112, 3, 16, 8, 0, 111, 108, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 111, 110, 1, 0, 0, 0, 112, 27, 1, 0, 0, 0, 113, 114, 7, 2, 0, 0, 114, 29, 1, 0, 0, 0, 12, 32, 36, 43, 48, 55, 67, 77, 83, 90, 95, 102, 111] \ No newline at end of file +[4, 1, 14, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 35, 8, 1, 10, 1, 12, 1, 38, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 43, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 54, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 64, 8, 6, 1, 7, 1, 7, 5, 7, 68, 8, 7, 10, 7, 12, 7, 71, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 77, 8, 8, 1, 8, 5, 8, 80, 8, 8, 10, 8, 12, 8, 83, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 89, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 39, 1, 0, 0, 0, 6, 42, 1, 0, 0, 0, 8, 53, 1, 0, 0, 0, 10, 55, 1, 0, 0, 0, 12, 59, 1, 0, 0, 0, 14, 65, 1, 0, 0, 0, 16, 72, 1, 0, 0, 0, 18, 88, 1, 0, 0, 0, 20, 90, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 36, 3, 6, 3, 0, 31, 32, 3, 4, 2, 0, 32, 33, 3, 6, 3, 0, 33, 35, 1, 0, 0, 0, 34, 31, 1, 0, 0, 0, 35, 38, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 36, 1, 0, 0, 0, 39, 40, 7, 0, 0, 0, 40, 5, 1, 0, 0, 0, 41, 43, 5, 3, 0, 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 45, 3, 8, 4, 0, 45, 7, 1, 0, 0, 0, 46, 47, 5, 9, 0, 0, 47, 48, 3, 0, 0, 0, 48, 49, 5, 10, 0, 0, 49, 54, 1, 0, 0, 0, 50, 54, 3, 10, 5, 0, 51, 54, 3, 12, 6, 0, 52, 54, 3, 14, 7, 0, 53, 46, 1, 0, 0, 0, 53, 50, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 52, 1, 0, 0, 0, 54, 9, 1, 0, 0, 0, 55, 56, 3, 20, 10, 0, 56, 57, 3, 26, 13, 0, 57, 58, 3, 22, 11, 0, 58, 11, 1, 0, 0, 0, 59, 60, 3, 20, 10, 0, 60, 63, 5, 8, 0, 0, 61, 64, 3, 24, 12, 0, 62, 64, 3, 16, 8, 0, 63, 61, 1, 0, 0, 0, 63, 62, 1, 0, 0, 0, 64, 13, 1, 0, 0, 0, 65, 69, 5, 13, 0, 0, 66, 68, 5, 13, 0, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 15, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 9, 0, 0, 73, 81, 3, 18, 9, 0, 74, 76, 7, 0, 0, 0, 75, 77, 5, 3, 0, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 3, 18, 9, 0, 79, 74, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 85, 5, 10, 0, 0, 85, 17, 1, 0, 0, 0, 86, 89, 3, 16, 8, 0, 87, 89, 3, 24, 12, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 19, 1, 0, 0, 0, 90, 91, 5, 13, 0, 0, 91, 21, 1, 0, 0, 0, 92, 93, 7, 1, 0, 0, 93, 23, 1, 0, 0, 0, 94, 98, 5, 11, 0, 0, 95, 98, 5, 12, 0, 0, 96, 98, 3, 14, 7, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 9, 36, 42, 53, 63, 69, 76, 81, 88, 97] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index a97c9136c537..25b7e00df050 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -19,16 +19,16 @@ public class DQLParser extends Parser { OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, PHRASE=11, NUMBER=12, ID=13, WS=14; public static final int - RULE_query = 0, RULE_operatorExpression = 1, RULE_orExpression = 2, RULE_term = 3, - RULE_andExpression = 4, RULE_primaryExpression = 5, RULE_comparisonExpression = 6, - RULE_keyValueExpression = 7, RULE_tokenSearch = 8, RULE_groupExpression = 9, - RULE_groupContent = 10, RULE_field = 11, RULE_rangeValue = 12, RULE_value = 13, - RULE_comparisonOperator = 14; + RULE_query = 0, RULE_operatorExpression = 1, RULE_booleanOperator = 2, + RULE_notExpression = 3, RULE_primaryExpression = 4, RULE_comparisonExpression = 5, + RULE_keyValueExpression = 6, RULE_tokenSearch = 7, RULE_groupExpression = 8, + RULE_groupContent = 9, RULE_field = 10, RULE_rangeValue = 11, RULE_value = 12, + RULE_comparisonOperator = 13; private static String[] makeRuleNames() { return new String[] { - "query", "operatorExpression", "orExpression", "term", "andExpression", - "primaryExpression", "comparisonExpression", "keyValueExpression", "tokenSearch", - "groupExpression", "groupContent", "field", "rangeValue", "value", "comparisonOperator" + "query", "operatorExpression", "booleanOperator", "notExpression", "primaryExpression", + "comparisonExpression", "keyValueExpression", "tokenSearch", "groupExpression", + "groupContent", "field", "rangeValue", "value", "comparisonOperator" }; } public static final String[] ruleNames = makeRuleNames(); @@ -98,9 +98,6 @@ public DQLParser(TokenStream input) { @SuppressWarnings("CheckReturnValue") public static class QueryContext extends ParserRuleContext { - public PrimaryExpressionContext primaryExpression() { - return getRuleContext(PrimaryExpressionContext.class,0); - } public OperatorExpressionContext operatorExpression() { return getRuleContext(OperatorExpressionContext.class,0); } @@ -114,23 +111,10 @@ public final QueryContext query() throws RecognitionException { QueryContext _localctx = new QueryContext(_ctx, getState()); enterRule(_localctx, 0, RULE_query); try { - setState(32); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(30); - primaryExpression(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(31); - operatorExpression(); - } - break; + enterOuterAlt(_localctx, 1); + { + setState(28); + operatorExpression(); } } catch (RecognitionException re) { @@ -146,11 +130,17 @@ public final QueryContext query() throws RecognitionException { @SuppressWarnings("CheckReturnValue") public static class OperatorExpressionContext extends ParserRuleContext { - public AndExpressionContext andExpression() { - return getRuleContext(AndExpressionContext.class,0); + public List notExpression() { + return getRuleContexts(NotExpressionContext.class); } - public OrExpressionContext orExpression() { - return getRuleContext(OrExpressionContext.class,0); + public NotExpressionContext notExpression(int i) { + return getRuleContext(NotExpressionContext.class,i); + } + public List booleanOperator() { + return getRuleContexts(BooleanOperatorContext.class); + } + public BooleanOperatorContext booleanOperator(int i) { + return getRuleContext(BooleanOperatorContext.class,i); } public OperatorExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); @@ -161,77 +151,25 @@ public OperatorExpressionContext(ParserRuleContext parent, int invokingState) { public final OperatorExpressionContext operatorExpression() throws RecognitionException { OperatorExpressionContext _localctx = new OperatorExpressionContext(_ctx, getState()); enterRule(_localctx, 2, RULE_operatorExpression); - try { - setState(36); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(34); - andExpression(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(35); - orExpression(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class OrExpressionContext extends ParserRuleContext { - public List term() { - return getRuleContexts(TermContext.class); - } - public TermContext term(int i) { - return getRuleContext(TermContext.class,i); - } - public List OR() { return getTokens(DQLParser.OR); } - public TerminalNode OR(int i) { - return getToken(DQLParser.OR, i); - } - public OrExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_orExpression; } - } - - public final OrExpressionContext orExpression() throws RecognitionException { - OrExpressionContext _localctx = new OrExpressionContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_orExpression); int _la; try { enterOuterAlt(_localctx, 1); { - setState(38); - term(); - setState(43); + setState(30); + notExpression(); + setState(36); _errHandler.sync(this); _la = _input.LA(1); - while (_la==OR) { + while (_la==OR || _la==AND) { { { - setState(39); - match(OR); - setState(40); - term(); + setState(31); + booleanOperator(); + setState(32); + notExpression(); } } - setState(45); + setState(38); _errHandler.sync(this); _la = _input.LA(1); } @@ -249,40 +187,32 @@ public final OrExpressionContext orExpression() throws RecognitionException { } @SuppressWarnings("CheckReturnValue") - public static class TermContext extends ParserRuleContext { - public PrimaryExpressionContext primaryExpression() { - return getRuleContext(PrimaryExpressionContext.class,0); - } - public AndExpressionContext andExpression() { - return getRuleContext(AndExpressionContext.class,0); - } - public TermContext(ParserRuleContext parent, int invokingState) { + public static class BooleanOperatorContext extends ParserRuleContext { + public TerminalNode OR() { return getToken(DQLParser.OR, 0); } + public TerminalNode AND() { return getToken(DQLParser.AND, 0); } + public BooleanOperatorContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - @Override public int getRuleIndex() { return RULE_term; } + @Override public int getRuleIndex() { return RULE_booleanOperator; } } - public final TermContext term() throws RecognitionException { - TermContext _localctx = new TermContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_term); + public final BooleanOperatorContext booleanOperator() throws RecognitionException { + BooleanOperatorContext _localctx = new BooleanOperatorContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_booleanOperator); + int _la; try { - setState(48); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(46); - primaryExpression(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(47); - andExpression(); - } - break; + enterOuterAlt(_localctx, 1); + { + setState(39); + _la = _input.LA(1); + if ( !(_la==OR || _la==AND) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } } } catch (RecognitionException re) { @@ -297,48 +227,36 @@ public final TermContext term() throws RecognitionException { } @SuppressWarnings("CheckReturnValue") - public static class AndExpressionContext extends ParserRuleContext { - public List primaryExpression() { - return getRuleContexts(PrimaryExpressionContext.class); - } - public PrimaryExpressionContext primaryExpression(int i) { - return getRuleContext(PrimaryExpressionContext.class,i); - } - public List AND() { return getTokens(DQLParser.AND); } - public TerminalNode AND(int i) { - return getToken(DQLParser.AND, i); + public static class NotExpressionContext extends ParserRuleContext { + public PrimaryExpressionContext primaryExpression() { + return getRuleContext(PrimaryExpressionContext.class,0); } - public AndExpressionContext(ParserRuleContext parent, int invokingState) { + public TerminalNode NOT() { return getToken(DQLParser.NOT, 0); } + public NotExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } - @Override public int getRuleIndex() { return RULE_andExpression; } + @Override public int getRuleIndex() { return RULE_notExpression; } } - public final AndExpressionContext andExpression() throws RecognitionException { - AndExpressionContext _localctx = new AndExpressionContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_andExpression); + public final NotExpressionContext notExpression() throws RecognitionException { + NotExpressionContext _localctx = new NotExpressionContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_notExpression); int _la; try { enterOuterAlt(_localctx, 1); { - setState(50); - primaryExpression(); - setState(55); + setState(42); _errHandler.sync(this); _la = _input.LA(1); - while (_la==AND) { - { + if (_la==NOT) { { - setState(51); - match(AND); - setState(52); - primaryExpression(); - } + setState(41); + match(NOT); } - setState(57); - _errHandler.sync(this); - _la = _input.LA(1); } + + setState(44); + primaryExpression(); } } catch (RecognitionException re) { @@ -359,10 +277,6 @@ public QueryContext query() { return getRuleContext(QueryContext.class,0); } public TerminalNode RPAREN() { return getToken(DQLParser.RPAREN, 0); } - public TerminalNode NOT() { return getToken(DQLParser.NOT, 0); } - public PrimaryExpressionContext primaryExpression() { - return getRuleContext(PrimaryExpressionContext.class,0); - } public ComparisonExpressionContext comparisonExpression() { return getRuleContext(ComparisonExpressionContext.class,0); } @@ -380,49 +294,40 @@ public PrimaryExpressionContext(ParserRuleContext parent, int invokingState) { public final PrimaryExpressionContext primaryExpression() throws RecognitionException { PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_primaryExpression); + enterRule(_localctx, 8, RULE_primaryExpression); try { - setState(67); + setState(53); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(58); + setState(46); match(LPAREN); - setState(59); + setState(47); query(); - setState(60); + setState(48); match(RPAREN); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(62); - match(NOT); - setState(63); - primaryExpression(); + setState(50); + comparisonExpression(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(64); - comparisonExpression(); + setState(51); + keyValueExpression(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(65); - keyValueExpression(); - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(66); + setState(52); tokenSearch(); } break; @@ -458,15 +363,15 @@ public ComparisonExpressionContext(ParserRuleContext parent, int invokingState) public final ComparisonExpressionContext comparisonExpression() throws RecognitionException { ComparisonExpressionContext _localctx = new ComparisonExpressionContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_comparisonExpression); + enterRule(_localctx, 10, RULE_comparisonExpression); try { enterOuterAlt(_localctx, 1); { - setState(69); + setState(55); field(); - setState(70); + setState(56); comparisonOperator(); - setState(71); + setState(57); rangeValue(); } } @@ -501,28 +406,28 @@ public KeyValueExpressionContext(ParserRuleContext parent, int invokingState) { public final KeyValueExpressionContext keyValueExpression() throws RecognitionException { KeyValueExpressionContext _localctx = new KeyValueExpressionContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_keyValueExpression); + enterRule(_localctx, 12, RULE_keyValueExpression); try { enterOuterAlt(_localctx, 1); { - setState(73); + setState(59); field(); - setState(74); + setState(60); match(EQ); - setState(77); + setState(63); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: case NUMBER: case ID: { - setState(75); + setState(61); value(); } break; case LPAREN: { - setState(76); + setState(62); groupExpression(); } break; @@ -556,24 +461,24 @@ public TokenSearchContext(ParserRuleContext parent, int invokingState) { public final TokenSearchContext tokenSearch() throws RecognitionException { TokenSearchContext _localctx = new TokenSearchContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_tokenSearch); + enterRule(_localctx, 14, RULE_tokenSearch); int _la; try { enterOuterAlt(_localctx, 1); { - setState(79); + setState(65); match(ID); - setState(83); + setState(69); _errHandler.sync(this); _la = _input.LA(1); while (_la==ID) { { { - setState(80); + setState(66); match(ID); } } - setState(85); + setState(71); _errHandler.sync(this); _la = _input.LA(1); } @@ -620,22 +525,22 @@ public GroupExpressionContext(ParserRuleContext parent, int invokingState) { public final GroupExpressionContext groupExpression() throws RecognitionException { GroupExpressionContext _localctx = new GroupExpressionContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_groupExpression); + enterRule(_localctx, 16, RULE_groupExpression); int _la; try { enterOuterAlt(_localctx, 1); { - setState(86); + setState(72); match(LPAREN); - setState(87); + setState(73); groupContent(); - setState(95); + setState(81); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR || _la==AND) { { { - setState(88); + setState(74); _la = _input.LA(1); if ( !(_la==OR || _la==AND) ) { _errHandler.recoverInline(this); @@ -646,26 +551,26 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio consume(); } { - setState(90); + setState(76); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(89); + setState(75); match(NOT); } } } - setState(92); + setState(78); groupContent(); } } - setState(97); + setState(83); _errHandler.sync(this); _la = _input.LA(1); } - setState(98); + setState(84); match(RPAREN); } } @@ -696,15 +601,15 @@ public GroupContentContext(ParserRuleContext parent, int invokingState) { public final GroupContentContext groupContent() throws RecognitionException { GroupContentContext _localctx = new GroupContentContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_groupContent); + enterRule(_localctx, 18, RULE_groupContent); try { - setState(102); + setState(88); _errHandler.sync(this); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(100); + setState(86); groupExpression(); } break; @@ -713,7 +618,7 @@ public final GroupContentContext groupContent() throws RecognitionException { case ID: enterOuterAlt(_localctx, 2); { - setState(101); + setState(87); value(); } break; @@ -743,11 +648,11 @@ public FieldContext(ParserRuleContext parent, int invokingState) { public final FieldContext field() throws RecognitionException { FieldContext _localctx = new FieldContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_field); + enterRule(_localctx, 20, RULE_field); try { enterOuterAlt(_localctx, 1); { - setState(104); + setState(90); match(ID); } } @@ -774,12 +679,12 @@ public RangeValueContext(ParserRuleContext parent, int invokingState) { public final RangeValueContext rangeValue() throws RecognitionException { RangeValueContext _localctx = new RangeValueContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_rangeValue); + enterRule(_localctx, 22, RULE_rangeValue); int _la; try { enterOuterAlt(_localctx, 1); { - setState(106); + setState(92); _la = _input.LA(1); if ( !(_la==PHRASE || _la==NUMBER) ) { _errHandler.recoverInline(this); @@ -817,29 +722,29 @@ public ValueContext(ParserRuleContext parent, int invokingState) { public final ValueContext value() throws RecognitionException { ValueContext _localctx = new ValueContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_value); + enterRule(_localctx, 24, RULE_value); try { - setState(111); + setState(97); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: enterOuterAlt(_localctx, 1); { - setState(108); + setState(94); match(PHRASE); } break; case NUMBER: enterOuterAlt(_localctx, 2); { - setState(109); + setState(95); match(NUMBER); } break; case ID: enterOuterAlt(_localctx, 3); { - setState(110); + setState(96); tokenSearch(); } break; @@ -872,12 +777,12 @@ public ComparisonOperatorContext(ParserRuleContext parent, int invokingState) { public final ComparisonOperatorContext comparisonOperator() throws RecognitionException { ComparisonOperatorContext _localctx = new ComparisonOperatorContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_comparisonOperator); + enterRule(_localctx, 26, RULE_comparisonOperator); int _la; try { enterOuterAlt(_localctx, 1); { - setState(113); + setState(99); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 240L) != 0)) ) { _errHandler.recoverInline(this); @@ -901,68 +806,61 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx } public static final String _serializedATN = - "\u0004\u0001\u000et\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u0001\u000ef\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ - "\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0001\u0000\u0001\u0000"+ - "\u0003\u0000!\b\u0000\u0001\u0001\u0001\u0001\u0003\u0001%\b\u0001\u0001"+ - "\u0002\u0001\u0002\u0001\u0002\u0005\u0002*\b\u0002\n\u0002\f\u0002-\t"+ - "\u0002\u0001\u0003\u0001\u0003\u0003\u00031\b\u0003\u0001\u0004\u0001"+ - "\u0004\u0001\u0004\u0005\u00046\b\u0004\n\u0004\f\u00049\t\u0004\u0001"+ - "\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+ - "\u0005\u0001\u0005\u0001\u0005\u0003\u0005D\b\u0005\u0001\u0006\u0001"+ - "\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001"+ - "\u0007\u0003\u0007N\b\u0007\u0001\b\u0001\b\u0005\bR\b\b\n\b\f\bU\t\b"+ - "\u0001\t\u0001\t\u0001\t\u0001\t\u0003\t[\b\t\u0001\t\u0005\t^\b\t\n\t"+ - "\f\ta\t\t\u0001\t\u0001\t\u0001\n\u0001\n\u0003\ng\b\n\u0001\u000b\u0001"+ - "\u000b\u0001\f\u0001\f\u0001\r\u0001\r\u0001\r\u0003\rp\b\r\u0001\u000e"+ - "\u0001\u000e\u0001\u000e\u0000\u0000\u000f\u0000\u0002\u0004\u0006\b\n"+ - "\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u001c\u0000\u0003\u0001\u0000"+ - "\u0001\u0002\u0001\u0000\u000b\f\u0001\u0000\u0004\u0007t\u0000 \u0001"+ - "\u0000\u0000\u0000\u0002$\u0001\u0000\u0000\u0000\u0004&\u0001\u0000\u0000"+ - "\u0000\u00060\u0001\u0000\u0000\u0000\b2\u0001\u0000\u0000\u0000\nC\u0001"+ - "\u0000\u0000\u0000\fE\u0001\u0000\u0000\u0000\u000eI\u0001\u0000\u0000"+ - "\u0000\u0010O\u0001\u0000\u0000\u0000\u0012V\u0001\u0000\u0000\u0000\u0014"+ - "f\u0001\u0000\u0000\u0000\u0016h\u0001\u0000\u0000\u0000\u0018j\u0001"+ - "\u0000\u0000\u0000\u001ao\u0001\u0000\u0000\u0000\u001cq\u0001\u0000\u0000"+ - "\u0000\u001e!\u0003\n\u0005\u0000\u001f!\u0003\u0002\u0001\u0000 \u001e"+ - "\u0001\u0000\u0000\u0000 \u001f\u0001\u0000\u0000\u0000!\u0001\u0001\u0000"+ - "\u0000\u0000\"%\u0003\b\u0004\u0000#%\u0003\u0004\u0002\u0000$\"\u0001"+ - "\u0000\u0000\u0000$#\u0001\u0000\u0000\u0000%\u0003\u0001\u0000\u0000"+ - "\u0000&+\u0003\u0006\u0003\u0000\'(\u0005\u0001\u0000\u0000(*\u0003\u0006"+ - "\u0003\u0000)\'\u0001\u0000\u0000\u0000*-\u0001\u0000\u0000\u0000+)\u0001"+ - "\u0000\u0000\u0000+,\u0001\u0000\u0000\u0000,\u0005\u0001\u0000\u0000"+ - "\u0000-+\u0001\u0000\u0000\u0000.1\u0003\n\u0005\u0000/1\u0003\b\u0004"+ - "\u00000.\u0001\u0000\u0000\u00000/\u0001\u0000\u0000\u00001\u0007\u0001"+ - "\u0000\u0000\u000027\u0003\n\u0005\u000034\u0005\u0002\u0000\u000046\u0003"+ - "\n\u0005\u000053\u0001\u0000\u0000\u000069\u0001\u0000\u0000\u000075\u0001"+ - "\u0000\u0000\u000078\u0001\u0000\u0000\u00008\t\u0001\u0000\u0000\u0000"+ - "97\u0001\u0000\u0000\u0000:;\u0005\t\u0000\u0000;<\u0003\u0000\u0000\u0000"+ - "<=\u0005\n\u0000\u0000=D\u0001\u0000\u0000\u0000>?\u0005\u0003\u0000\u0000"+ - "?D\u0003\n\u0005\u0000@D\u0003\f\u0006\u0000AD\u0003\u000e\u0007\u0000"+ - "BD\u0003\u0010\b\u0000C:\u0001\u0000\u0000\u0000C>\u0001\u0000\u0000\u0000"+ - "C@\u0001\u0000\u0000\u0000CA\u0001\u0000\u0000\u0000CB\u0001\u0000\u0000"+ - "\u0000D\u000b\u0001\u0000\u0000\u0000EF\u0003\u0016\u000b\u0000FG\u0003"+ - "\u001c\u000e\u0000GH\u0003\u0018\f\u0000H\r\u0001\u0000\u0000\u0000IJ"+ - "\u0003\u0016\u000b\u0000JM\u0005\b\u0000\u0000KN\u0003\u001a\r\u0000L"+ - "N\u0003\u0012\t\u0000MK\u0001\u0000\u0000\u0000ML\u0001\u0000\u0000\u0000"+ - "N\u000f\u0001\u0000\u0000\u0000OS\u0005\r\u0000\u0000PR\u0005\r\u0000"+ - "\u0000QP\u0001\u0000\u0000\u0000RU\u0001\u0000\u0000\u0000SQ\u0001\u0000"+ - "\u0000\u0000ST\u0001\u0000\u0000\u0000T\u0011\u0001\u0000\u0000\u0000"+ - "US\u0001\u0000\u0000\u0000VW\u0005\t\u0000\u0000W_\u0003\u0014\n\u0000"+ - "XZ\u0007\u0000\u0000\u0000Y[\u0005\u0003\u0000\u0000ZY\u0001\u0000\u0000"+ - "\u0000Z[\u0001\u0000\u0000\u0000[\\\u0001\u0000\u0000\u0000\\^\u0003\u0014"+ - "\n\u0000]X\u0001\u0000\u0000\u0000^a\u0001\u0000\u0000\u0000_]\u0001\u0000"+ - "\u0000\u0000_`\u0001\u0000\u0000\u0000`b\u0001\u0000\u0000\u0000a_\u0001"+ - "\u0000\u0000\u0000bc\u0005\n\u0000\u0000c\u0013\u0001\u0000\u0000\u0000"+ - "dg\u0003\u0012\t\u0000eg\u0003\u001a\r\u0000fd\u0001\u0000\u0000\u0000"+ - "fe\u0001\u0000\u0000\u0000g\u0015\u0001\u0000\u0000\u0000hi\u0005\r\u0000"+ - "\u0000i\u0017\u0001\u0000\u0000\u0000jk\u0007\u0001\u0000\u0000k\u0019"+ - "\u0001\u0000\u0000\u0000lp\u0005\u000b\u0000\u0000mp\u0005\f\u0000\u0000"+ - "np\u0003\u0010\b\u0000ol\u0001\u0000\u0000\u0000om\u0001\u0000\u0000\u0000"+ - "on\u0001\u0000\u0000\u0000p\u001b\u0001\u0000\u0000\u0000qr\u0007\u0002"+ - "\u0000\u0000r\u001d\u0001\u0000\u0000\u0000\f $+07CMSZ_fo"; + "\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001"+ + "\u0001\u0001\u0001\u0001\u0005\u0001#\b\u0001\n\u0001\f\u0001&\t\u0001"+ + "\u0001\u0002\u0001\u0002\u0001\u0003\u0003\u0003+\b\u0003\u0001\u0003"+ + "\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+ + "\u0001\u0004\u0001\u0004\u0003\u00046\b\u0004\u0001\u0005\u0001\u0005"+ + "\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ + "\u0003\u0006@\b\u0006\u0001\u0007\u0001\u0007\u0005\u0007D\b\u0007\n\u0007"+ + "\f\u0007G\t\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bM\b\b\u0001\b"+ + "\u0005\bP\b\b\n\b\f\bS\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\tY\b"+ + "\t\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0003"+ + "\fb\b\f\u0001\r\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002\u0004\u0006"+ + "\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003\u0001\u0000"+ + "\u0001\u0002\u0001\u0000\u000b\f\u0001\u0000\u0004\u0007c\u0000\u001c"+ + "\u0001\u0000\u0000\u0000\u0002\u001e\u0001\u0000\u0000\u0000\u0004\'\u0001"+ + "\u0000\u0000\u0000\u0006*\u0001\u0000\u0000\u0000\b5\u0001\u0000\u0000"+ + "\u0000\n7\u0001\u0000\u0000\u0000\f;\u0001\u0000\u0000\u0000\u000eA\u0001"+ + "\u0000\u0000\u0000\u0010H\u0001\u0000\u0000\u0000\u0012X\u0001\u0000\u0000"+ + "\u0000\u0014Z\u0001\u0000\u0000\u0000\u0016\\\u0001\u0000\u0000\u0000"+ + "\u0018a\u0001\u0000\u0000\u0000\u001ac\u0001\u0000\u0000\u0000\u001c\u001d"+ + "\u0003\u0002\u0001\u0000\u001d\u0001\u0001\u0000\u0000\u0000\u001e$\u0003"+ + "\u0006\u0003\u0000\u001f \u0003\u0004\u0002\u0000 !\u0003\u0006\u0003"+ + "\u0000!#\u0001\u0000\u0000\u0000\"\u001f\u0001\u0000\u0000\u0000#&\u0001"+ + "\u0000\u0000\u0000$\"\u0001\u0000\u0000\u0000$%\u0001\u0000\u0000\u0000"+ + "%\u0003\u0001\u0000\u0000\u0000&$\u0001\u0000\u0000\u0000\'(\u0007\u0000"+ + "\u0000\u0000(\u0005\u0001\u0000\u0000\u0000)+\u0005\u0003\u0000\u0000"+ + "*)\u0001\u0000\u0000\u0000*+\u0001\u0000\u0000\u0000+,\u0001\u0000\u0000"+ + "\u0000,-\u0003\b\u0004\u0000-\u0007\u0001\u0000\u0000\u0000./\u0005\t"+ + "\u0000\u0000/0\u0003\u0000\u0000\u000001\u0005\n\u0000\u000016\u0001\u0000"+ + "\u0000\u000026\u0003\n\u0005\u000036\u0003\f\u0006\u000046\u0003\u000e"+ + "\u0007\u00005.\u0001\u0000\u0000\u000052\u0001\u0000\u0000\u000053\u0001"+ + "\u0000\u0000\u000054\u0001\u0000\u0000\u00006\t\u0001\u0000\u0000\u0000"+ + "78\u0003\u0014\n\u000089\u0003\u001a\r\u00009:\u0003\u0016\u000b\u0000"+ + ":\u000b\u0001\u0000\u0000\u0000;<\u0003\u0014\n\u0000@\u0003\u0010\b\u0000?=\u0001\u0000\u0000"+ + "\u0000?>\u0001\u0000\u0000\u0000@\r\u0001\u0000\u0000\u0000AE\u0005\r"+ + "\u0000\u0000BD\u0005\r\u0000\u0000CB\u0001\u0000\u0000\u0000DG\u0001\u0000"+ + "\u0000\u0000EC\u0001\u0000\u0000\u0000EF\u0001\u0000\u0000\u0000F\u000f"+ + "\u0001\u0000\u0000\u0000GE\u0001\u0000\u0000\u0000HI\u0005\t\u0000\u0000"+ + "IQ\u0003\u0012\t\u0000JL\u0007\u0000\u0000\u0000KM\u0005\u0003\u0000\u0000"+ + "LK\u0001\u0000\u0000\u0000LM\u0001\u0000\u0000\u0000MN\u0001\u0000\u0000"+ + "\u0000NP\u0003\u0012\t\u0000OJ\u0001\u0000\u0000\u0000PS\u0001\u0000\u0000"+ + "\u0000QO\u0001\u0000\u0000\u0000QR\u0001\u0000\u0000\u0000RT\u0001\u0000"+ + "\u0000\u0000SQ\u0001\u0000\u0000\u0000TU\u0005\n\u0000\u0000U\u0011\u0001"+ + "\u0000\u0000\u0000VY\u0003\u0010\b\u0000WY\u0003\u0018\f\u0000XV\u0001"+ + "\u0000\u0000\u0000XW\u0001\u0000\u0000\u0000Y\u0013\u0001\u0000\u0000"+ + "\u0000Z[\u0005\r\u0000\u0000[\u0015\u0001\u0000\u0000\u0000\\]\u0007\u0001"+ + "\u0000\u0000]\u0017\u0001\u0000\u0000\u0000^b\u0005\u000b\u0000\u0000"+ + "_b\u0005\f\u0000\u0000`b\u0003\u000e\u0007\u0000a^\u0001\u0000\u0000\u0000"+ + "a_\u0001\u0000\u0000\u0000a`\u0001\u0000\u0000\u0000b\u0019\u0001\u0000"+ + "\u0000\u0000cd\u0007\u0002\u0000\u0000d\u001b\u0001\u0000\u0000\u0000"+ + "\t$*5?ELQXa"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index ea2f29ee08da..024c22c04764 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -1,79 +1,72 @@ parser grammar DQLParser; options { - tokenVocab = DQLLexer; + tokenVocab = DQLLexer; } query - : primaryExpression - | operatorExpression - ; + : operatorExpression + ; operatorExpression - : andExpression - | orExpression - ; - -orExpression - : term (OR term)* - ; - -term - : primaryExpression - | andExpression - ; - -andExpression - : primaryExpression (AND primaryExpression)* - ; + : notExpression (booleanOperator notExpression)* + ; + +booleanOperator + : OR + | AND + ; + +notExpression + : NOT? primaryExpression + ; primaryExpression - : LPAREN query RPAREN - | NOT primaryExpression - | comparisonExpression - | keyValueExpression - | tokenSearch - ; + : LPAREN query RPAREN + | comparisonExpression + | keyValueExpression + | tokenSearch + ; comparisonExpression - : field comparisonOperator rangeValue - ; + : field comparisonOperator rangeValue + ; keyValueExpression - : field EQ (value | groupExpression) - ; + : field EQ (value | groupExpression) + ; tokenSearch - : ID (ID)* - ; - + : ID (ID)* + ; + groupExpression - : LPAREN groupContent ((OR | AND) (NOT?) groupContent)* RPAREN - ; + : LPAREN groupContent ((OR | AND) (NOT?) groupContent)* RPAREN + ; groupContent - : groupExpression - | value - ; + : groupExpression + | value + ; field - : ID - ; + : ID + ; rangeValue - : NUMBER - | PHRASE - ; + : NUMBER + | PHRASE + ; value - : PHRASE - | NUMBER - | tokenSearch - ; - + : PHRASE + | NUMBER + | tokenSearch + ; + comparisonOperator - : GT - | LT - | GE - | LE - ; \ No newline at end of file + : GT + | LT + | GE + | LE + ; \ No newline at end of file From dd6bae032e3bcc9ca0cc8d057a69518c4539d7c6 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Thu, 18 Jul 2024 16:33:16 -0700 Subject: [PATCH 16/34] enable partially complete value suggestion for value groups Signed-off-by: Paul Sebastian --- src/plugins/data/public/antlr/dql/code_completion.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 4f87ae77e243..049d6a6d8908 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -105,7 +105,13 @@ class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { if (valueText) foundValue = valueText; } if (ctx.groupExpression()) { - console.log('in a group'); + const lastGroupContent = ctx + .groupExpression() + ?.groupContent() + .at(-1) + ?.getText() + .replace(/^["']|["']$/g, ''); + if (lastGroupContent) foundValue = lastGroupContent; } return { field: ctx.field().getText(), value: foundValue }; }; @@ -124,7 +130,7 @@ export const getSuggestions = async ({ const lexer = new DQLLexer(inputStream); const tokenStream = new CommonTokenStream(lexer); const parser = new DQLParser(tokenStream); - // parser.removeErrorListeners(); + parser.removeErrorListeners(); const tree = parser.query(); const visitor = new QueryVisitor(); @@ -163,7 +169,7 @@ export const getSuggestions = async ({ // find suggested values for the last found field const { field: lastField = '', value: lastValue = '' } = visitor.visit(tree) ?? {}; console.log('lastField: ', lastField); - // console.log('lastValue: ', lastValue); + console.log('lastValue: ', lastValue); if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { const values = await findValueSuggestions(currentIndexPattern, lastField, lastValue ?? ''); completions.push( From f288b2ef2e48b6bb36cfbe03f9343737efcc37b7 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Thu, 18 Jul 2024 17:29:33 -0700 Subject: [PATCH 17/34] remove number as lexer rule Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 3 +- .../antlr/dql/generated/DQLLexer.interp | 5 +- .../antlr/dql/generated/DQLLexer.tokens | 5 +- .../public/antlr/dql/generated/DQLLexer.ts | 73 +++-- .../antlr/dql/generated/DQLParser.interp | 5 +- .../antlr/dql/generated/DQLParser.tokens | 5 +- .../public/antlr/dql/generated/DQLParser.ts | 259 ++++++----------- .../antlr/dql/generated/DQLParserListener.ts | 11 - .../antlr/dql/generated/DQLParserVisitor.ts | 7 - .../antlr/dql/grammar/.antlr/DQLLexer.interp | 5 +- .../antlr/dql/grammar/.antlr/DQLLexer.java | 110 ++++---- .../antlr/dql/grammar/.antlr/DQLLexer.tokens | 5 +- .../antlr/dql/grammar/.antlr/DQLParser.interp | 5 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 264 +++++++----------- .../antlr/dql/grammar/.antlr/DQLParser.tokens | 5 +- .../data/public/antlr/dql/grammar/DQLLexer.g4 | 3 +- .../public/antlr/dql/grammar/DQLParser.g4 | 8 +- 17 files changed, 293 insertions(+), 485 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 049d6a6d8908..d1fa6a2ed500 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -100,7 +100,7 @@ class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { .replace(/^["']|["']$/g, ''); if (strippedPhrase) foundValue = strippedPhrase; } - if (ctx.value()?.tokenSearch() || ctx.value()?.NUMBER()) { + if (ctx.value()?.tokenSearch()) { const valueText = ctx.value()?.getText(); if (valueText) foundValue = valueText; } @@ -153,7 +153,6 @@ export const getSuggestions = async ({ DQLParser.GT, DQLParser.LE, DQLParser.LT, - DQLParser.NUMBER, ]); // gets candidates at specified token index diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp index 16a3cddba4eb..2a27c7a74895 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp @@ -13,7 +13,6 @@ null null null null -null token symbolic names: null @@ -28,7 +27,6 @@ EQ LPAREN RPAREN PHRASE -NUMBER ID WS @@ -44,7 +42,6 @@ EQ LPAREN RPAREN PHRASE -NUMBER ID WS @@ -56,4 +53,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 14, 96, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 59, 8, 10, 10, 10, 12, 10, 62, 9, 10, 1, 10, 3, 10, 65, 8, 10, 1, 11, 3, 11, 68, 8, 11, 1, 11, 4, 11, 71, 8, 11, 11, 11, 12, 11, 72, 1, 11, 1, 11, 4, 11, 77, 8, 11, 11, 11, 12, 11, 78, 3, 11, 81, 8, 11, 1, 12, 1, 12, 5, 12, 85, 8, 12, 10, 12, 12, 12, 88, 9, 12, 1, 13, 4, 13, 91, 8, 13, 11, 13, 12, 13, 92, 1, 13, 1, 13, 0, 0, 14, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 103, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 1, 29, 1, 0, 0, 0, 3, 32, 1, 0, 0, 0, 5, 36, 1, 0, 0, 0, 7, 40, 1, 0, 0, 0, 9, 42, 1, 0, 0, 0, 11, 44, 1, 0, 0, 0, 13, 47, 1, 0, 0, 0, 15, 50, 1, 0, 0, 0, 17, 52, 1, 0, 0, 0, 19, 54, 1, 0, 0, 0, 21, 56, 1, 0, 0, 0, 23, 67, 1, 0, 0, 0, 25, 82, 1, 0, 0, 0, 27, 90, 1, 0, 0, 0, 29, 30, 7, 0, 0, 0, 30, 31, 7, 1, 0, 0, 31, 2, 1, 0, 0, 0, 32, 33, 7, 2, 0, 0, 33, 34, 7, 3, 0, 0, 34, 35, 7, 4, 0, 0, 35, 4, 1, 0, 0, 0, 36, 37, 7, 3, 0, 0, 37, 38, 7, 0, 0, 0, 38, 39, 7, 5, 0, 0, 39, 6, 1, 0, 0, 0, 40, 41, 5, 62, 0, 0, 41, 8, 1, 0, 0, 0, 42, 43, 5, 60, 0, 0, 43, 10, 1, 0, 0, 0, 44, 45, 5, 62, 0, 0, 45, 46, 5, 61, 0, 0, 46, 12, 1, 0, 0, 0, 47, 48, 5, 60, 0, 0, 48, 49, 5, 61, 0, 0, 49, 14, 1, 0, 0, 0, 50, 51, 5, 58, 0, 0, 51, 16, 1, 0, 0, 0, 52, 53, 5, 40, 0, 0, 53, 18, 1, 0, 0, 0, 54, 55, 5, 41, 0, 0, 55, 20, 1, 0, 0, 0, 56, 60, 5, 34, 0, 0, 57, 59, 8, 6, 0, 0, 58, 57, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 63, 65, 5, 34, 0, 0, 64, 63, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 22, 1, 0, 0, 0, 66, 68, 5, 45, 0, 0, 67, 66, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 71, 7, 7, 0, 0, 70, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 80, 1, 0, 0, 0, 74, 76, 5, 46, 0, 0, 75, 77, 7, 7, 0, 0, 76, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 81, 1, 0, 0, 0, 80, 74, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 24, 1, 0, 0, 0, 82, 86, 7, 8, 0, 0, 83, 85, 7, 9, 0, 0, 84, 83, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 26, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 91, 7, 10, 0, 0, 90, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 6, 13, 0, 0, 95, 28, 1, 0, 0, 0, 9, 0, 60, 64, 67, 72, 78, 80, 86, 92, 1, 0, 1, 0] \ No newline at end of file +[4, 0, 13, 78, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 57, 8, 10, 10, 10, 12, 10, 60, 9, 10, 1, 10, 3, 10, 63, 8, 10, 1, 11, 1, 11, 5, 11, 67, 8, 11, 10, 11, 12, 11, 70, 9, 11, 1, 12, 4, 12, 73, 8, 12, 11, 12, 12, 12, 74, 1, 12, 1, 12, 0, 0, 13, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 1, 0, 10, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 5, 0, 42, 42, 48, 57, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 81, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 1, 27, 1, 0, 0, 0, 3, 30, 1, 0, 0, 0, 5, 34, 1, 0, 0, 0, 7, 38, 1, 0, 0, 0, 9, 40, 1, 0, 0, 0, 11, 42, 1, 0, 0, 0, 13, 45, 1, 0, 0, 0, 15, 48, 1, 0, 0, 0, 17, 50, 1, 0, 0, 0, 19, 52, 1, 0, 0, 0, 21, 54, 1, 0, 0, 0, 23, 64, 1, 0, 0, 0, 25, 72, 1, 0, 0, 0, 27, 28, 7, 0, 0, 0, 28, 29, 7, 1, 0, 0, 29, 2, 1, 0, 0, 0, 30, 31, 7, 2, 0, 0, 31, 32, 7, 3, 0, 0, 32, 33, 7, 4, 0, 0, 33, 4, 1, 0, 0, 0, 34, 35, 7, 3, 0, 0, 35, 36, 7, 0, 0, 0, 36, 37, 7, 5, 0, 0, 37, 6, 1, 0, 0, 0, 38, 39, 5, 62, 0, 0, 39, 8, 1, 0, 0, 0, 40, 41, 5, 60, 0, 0, 41, 10, 1, 0, 0, 0, 42, 43, 5, 62, 0, 0, 43, 44, 5, 61, 0, 0, 44, 12, 1, 0, 0, 0, 45, 46, 5, 60, 0, 0, 46, 47, 5, 61, 0, 0, 47, 14, 1, 0, 0, 0, 48, 49, 5, 58, 0, 0, 49, 16, 1, 0, 0, 0, 50, 51, 5, 40, 0, 0, 51, 18, 1, 0, 0, 0, 52, 53, 5, 41, 0, 0, 53, 20, 1, 0, 0, 0, 54, 58, 5, 34, 0, 0, 55, 57, 8, 6, 0, 0, 56, 55, 1, 0, 0, 0, 57, 60, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 61, 63, 5, 34, 0, 0, 62, 61, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 22, 1, 0, 0, 0, 64, 68, 7, 7, 0, 0, 65, 67, 7, 8, 0, 0, 66, 65, 1, 0, 0, 0, 67, 70, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 24, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 71, 73, 7, 9, 0, 0, 72, 71, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 6, 12, 0, 0, 77, 26, 1, 0, 0, 0, 5, 0, 58, 62, 68, 74, 1, 0, 1, 0] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens b/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens index 24439db0066c..d9da629fcca1 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens @@ -9,9 +9,8 @@ EQ=8 LPAREN=9 RPAREN=10 PHRASE=11 -NUMBER=12 -ID=13 -WS=14 +ID=12 +WS=13 '>'=4 '<'=5 '>='=6 diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts index 5600e8f0b190..50516006fec0 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts @@ -16,9 +16,8 @@ export class DQLLexer extends antlr.Lexer { public static readonly LPAREN = 9; public static readonly RPAREN = 10; public static readonly PHRASE = 11; - public static readonly NUMBER = 12; - public static readonly ID = 13; - public static readonly WS = 14; + public static readonly ID = 12; + public static readonly WS = 13; public static readonly channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" @@ -31,7 +30,7 @@ export class DQLLexer extends antlr.Lexer { public static readonly symbolicNames = [ null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", - "RPAREN", "PHRASE", "NUMBER", "ID", "WS" + "RPAREN", "PHRASE", "ID", "WS" ]; public static readonly modeNames = [ @@ -40,7 +39,7 @@ export class DQLLexer extends antlr.Lexer { public static readonly ruleNames = [ "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "PHRASE", "NUMBER", "ID", "WS", + "PHRASE", "ID", "WS", ]; @@ -62,41 +61,35 @@ export class DQLLexer extends antlr.Lexer { public get modeNames(): string[] { return DQLLexer.modeNames; } public static readonly _serializedATN: number[] = [ - 4,0,14,96,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2, - 6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13, - 7,13,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1,3,1,4,1,4, - 1,5,1,5,1,5,1,6,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,5,10,59, - 8,10,10,10,12,10,62,9,10,1,10,3,10,65,8,10,1,11,3,11,68,8,11,1,11, - 4,11,71,8,11,11,11,12,11,72,1,11,1,11,4,11,77,8,11,11,11,12,11,78, - 3,11,81,8,11,1,12,1,12,5,12,85,8,12,10,12,12,12,88,9,12,1,13,4,13, - 91,8,13,11,13,12,13,92,1,13,1,13,0,0,14,1,1,3,2,5,3,7,4,9,5,11,6, - 13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,1,0,11,2,0,79,79,111, - 111,2,0,82,82,114,114,2,0,65,65,97,97,2,0,78,78,110,110,2,0,68,68, - 100,100,2,0,84,84,116,116,2,0,34,34,92,92,1,0,48,57,4,0,42,42,65, - 90,95,95,97,122,6,0,42,42,46,46,48,57,65,90,95,95,97,122,3,0,9,10, - 13,13,32,32,103,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0, - 0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0, - 0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0, - 1,29,1,0,0,0,3,32,1,0,0,0,5,36,1,0,0,0,7,40,1,0,0,0,9,42,1,0,0,0, - 11,44,1,0,0,0,13,47,1,0,0,0,15,50,1,0,0,0,17,52,1,0,0,0,19,54,1, - 0,0,0,21,56,1,0,0,0,23,67,1,0,0,0,25,82,1,0,0,0,27,90,1,0,0,0,29, - 30,7,0,0,0,30,31,7,1,0,0,31,2,1,0,0,0,32,33,7,2,0,0,33,34,7,3,0, - 0,34,35,7,4,0,0,35,4,1,0,0,0,36,37,7,3,0,0,37,38,7,0,0,0,38,39,7, - 5,0,0,39,6,1,0,0,0,40,41,5,62,0,0,41,8,1,0,0,0,42,43,5,60,0,0,43, - 10,1,0,0,0,44,45,5,62,0,0,45,46,5,61,0,0,46,12,1,0,0,0,47,48,5,60, - 0,0,48,49,5,61,0,0,49,14,1,0,0,0,50,51,5,58,0,0,51,16,1,0,0,0,52, - 53,5,40,0,0,53,18,1,0,0,0,54,55,5,41,0,0,55,20,1,0,0,0,56,60,5,34, - 0,0,57,59,8,6,0,0,58,57,1,0,0,0,59,62,1,0,0,0,60,58,1,0,0,0,60,61, - 1,0,0,0,61,64,1,0,0,0,62,60,1,0,0,0,63,65,5,34,0,0,64,63,1,0,0,0, - 64,65,1,0,0,0,65,22,1,0,0,0,66,68,5,45,0,0,67,66,1,0,0,0,67,68,1, - 0,0,0,68,70,1,0,0,0,69,71,7,7,0,0,70,69,1,0,0,0,71,72,1,0,0,0,72, - 70,1,0,0,0,72,73,1,0,0,0,73,80,1,0,0,0,74,76,5,46,0,0,75,77,7,7, - 0,0,76,75,1,0,0,0,77,78,1,0,0,0,78,76,1,0,0,0,78,79,1,0,0,0,79,81, - 1,0,0,0,80,74,1,0,0,0,80,81,1,0,0,0,81,24,1,0,0,0,82,86,7,8,0,0, - 83,85,7,9,0,0,84,83,1,0,0,0,85,88,1,0,0,0,86,84,1,0,0,0,86,87,1, - 0,0,0,87,26,1,0,0,0,88,86,1,0,0,0,89,91,7,10,0,0,90,89,1,0,0,0,91, - 92,1,0,0,0,92,90,1,0,0,0,92,93,1,0,0,0,93,94,1,0,0,0,94,95,6,13, - 0,0,95,28,1,0,0,0,9,0,60,64,67,72,78,80,86,92,1,0,1,0 + 4,0,13,78,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2, + 6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,1,0, + 1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5, + 1,5,1,6,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,5,10,57,8,10,10, + 10,12,10,60,9,10,1,10,3,10,63,8,10,1,11,1,11,5,11,67,8,11,10,11, + 12,11,70,9,11,1,12,4,12,73,8,12,11,12,12,12,74,1,12,1,12,0,0,13, + 1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13, + 1,0,10,2,0,79,79,111,111,2,0,82,82,114,114,2,0,65,65,97,97,2,0,78, + 78,110,110,2,0,68,68,100,100,2,0,84,84,116,116,2,0,34,34,92,92,5, + 0,42,42,48,57,65,90,95,95,97,122,6,0,42,42,46,46,48,57,65,90,95, + 95,97,122,3,0,9,10,13,13,32,32,81,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1, + 0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0, + 0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0, + 0,0,1,27,1,0,0,0,3,30,1,0,0,0,5,34,1,0,0,0,7,38,1,0,0,0,9,40,1,0, + 0,0,11,42,1,0,0,0,13,45,1,0,0,0,15,48,1,0,0,0,17,50,1,0,0,0,19,52, + 1,0,0,0,21,54,1,0,0,0,23,64,1,0,0,0,25,72,1,0,0,0,27,28,7,0,0,0, + 28,29,7,1,0,0,29,2,1,0,0,0,30,31,7,2,0,0,31,32,7,3,0,0,32,33,7,4, + 0,0,33,4,1,0,0,0,34,35,7,3,0,0,35,36,7,0,0,0,36,37,7,5,0,0,37,6, + 1,0,0,0,38,39,5,62,0,0,39,8,1,0,0,0,40,41,5,60,0,0,41,10,1,0,0,0, + 42,43,5,62,0,0,43,44,5,61,0,0,44,12,1,0,0,0,45,46,5,60,0,0,46,47, + 5,61,0,0,47,14,1,0,0,0,48,49,5,58,0,0,49,16,1,0,0,0,50,51,5,40,0, + 0,51,18,1,0,0,0,52,53,5,41,0,0,53,20,1,0,0,0,54,58,5,34,0,0,55,57, + 8,6,0,0,56,55,1,0,0,0,57,60,1,0,0,0,58,56,1,0,0,0,58,59,1,0,0,0, + 59,62,1,0,0,0,60,58,1,0,0,0,61,63,5,34,0,0,62,61,1,0,0,0,62,63,1, + 0,0,0,63,22,1,0,0,0,64,68,7,7,0,0,65,67,7,8,0,0,66,65,1,0,0,0,67, + 70,1,0,0,0,68,66,1,0,0,0,68,69,1,0,0,0,69,24,1,0,0,0,70,68,1,0,0, + 0,71,73,7,9,0,0,72,71,1,0,0,0,73,74,1,0,0,0,74,72,1,0,0,0,74,75, + 1,0,0,0,75,76,1,0,0,0,76,77,6,12,0,0,77,26,1,0,0,0,5,0,58,62,68, + 74,1,0,1,0 ]; private static __ATN: antlr.ATN; diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp index 191f54c819d9..c8ac375c4e21 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.interp @@ -13,7 +13,6 @@ null null null null -null token symbolic names: null @@ -28,7 +27,6 @@ EQ LPAREN RPAREN PHRASE -NUMBER ID WS @@ -44,10 +42,9 @@ tokenSearch groupExpression groupContent field -rangeValue value comparisonOperator atn: -[4, 1, 14, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 35, 8, 1, 10, 1, 12, 1, 38, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 43, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 54, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 64, 8, 6, 1, 7, 1, 7, 5, 7, 68, 8, 7, 10, 7, 12, 7, 71, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 77, 8, 8, 1, 8, 5, 8, 80, 8, 8, 10, 8, 12, 8, 83, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 89, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 39, 1, 0, 0, 0, 6, 42, 1, 0, 0, 0, 8, 53, 1, 0, 0, 0, 10, 55, 1, 0, 0, 0, 12, 59, 1, 0, 0, 0, 14, 65, 1, 0, 0, 0, 16, 72, 1, 0, 0, 0, 18, 88, 1, 0, 0, 0, 20, 90, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 36, 3, 6, 3, 0, 31, 32, 3, 4, 2, 0, 32, 33, 3, 6, 3, 0, 33, 35, 1, 0, 0, 0, 34, 31, 1, 0, 0, 0, 35, 38, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 36, 1, 0, 0, 0, 39, 40, 7, 0, 0, 0, 40, 5, 1, 0, 0, 0, 41, 43, 5, 3, 0, 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 45, 3, 8, 4, 0, 45, 7, 1, 0, 0, 0, 46, 47, 5, 9, 0, 0, 47, 48, 3, 0, 0, 0, 48, 49, 5, 10, 0, 0, 49, 54, 1, 0, 0, 0, 50, 54, 3, 10, 5, 0, 51, 54, 3, 12, 6, 0, 52, 54, 3, 14, 7, 0, 53, 46, 1, 0, 0, 0, 53, 50, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 52, 1, 0, 0, 0, 54, 9, 1, 0, 0, 0, 55, 56, 3, 20, 10, 0, 56, 57, 3, 26, 13, 0, 57, 58, 3, 22, 11, 0, 58, 11, 1, 0, 0, 0, 59, 60, 3, 20, 10, 0, 60, 63, 5, 8, 0, 0, 61, 64, 3, 24, 12, 0, 62, 64, 3, 16, 8, 0, 63, 61, 1, 0, 0, 0, 63, 62, 1, 0, 0, 0, 64, 13, 1, 0, 0, 0, 65, 69, 5, 13, 0, 0, 66, 68, 5, 13, 0, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 15, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 9, 0, 0, 73, 81, 3, 18, 9, 0, 74, 76, 7, 0, 0, 0, 75, 77, 5, 3, 0, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 3, 18, 9, 0, 79, 74, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 85, 5, 10, 0, 0, 85, 17, 1, 0, 0, 0, 86, 89, 3, 16, 8, 0, 87, 89, 3, 24, 12, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 19, 1, 0, 0, 0, 90, 91, 5, 13, 0, 0, 91, 21, 1, 0, 0, 0, 92, 93, 7, 1, 0, 0, 93, 23, 1, 0, 0, 0, 94, 98, 5, 11, 0, 0, 95, 98, 5, 12, 0, 0, 96, 98, 3, 14, 7, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 9, 36, 42, 53, 63, 69, 76, 81, 88, 97] \ No newline at end of file +[4, 1, 13, 97, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 33, 8, 1, 10, 1, 12, 1, 36, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 41, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 52, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 62, 8, 6, 1, 7, 1, 7, 5, 7, 66, 8, 7, 10, 7, 12, 7, 69, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 75, 8, 8, 1, 8, 5, 8, 78, 8, 8, 10, 8, 12, 8, 81, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 87, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 93, 8, 11, 1, 12, 1, 12, 1, 12, 0, 0, 13, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 0, 2, 1, 0, 1, 2, 1, 0, 4, 7, 94, 0, 26, 1, 0, 0, 0, 2, 28, 1, 0, 0, 0, 4, 37, 1, 0, 0, 0, 6, 40, 1, 0, 0, 0, 8, 51, 1, 0, 0, 0, 10, 53, 1, 0, 0, 0, 12, 57, 1, 0, 0, 0, 14, 63, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 94, 1, 0, 0, 0, 26, 27, 3, 2, 1, 0, 27, 1, 1, 0, 0, 0, 28, 34, 3, 6, 3, 0, 29, 30, 3, 4, 2, 0, 30, 31, 3, 6, 3, 0, 31, 33, 1, 0, 0, 0, 32, 29, 1, 0, 0, 0, 33, 36, 1, 0, 0, 0, 34, 32, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 3, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 37, 38, 7, 0, 0, 0, 38, 5, 1, 0, 0, 0, 39, 41, 5, 3, 0, 0, 40, 39, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 43, 3, 8, 4, 0, 43, 7, 1, 0, 0, 0, 44, 45, 5, 9, 0, 0, 45, 46, 3, 0, 0, 0, 46, 47, 5, 10, 0, 0, 47, 52, 1, 0, 0, 0, 48, 52, 3, 10, 5, 0, 49, 52, 3, 12, 6, 0, 50, 52, 3, 14, 7, 0, 51, 44, 1, 0, 0, 0, 51, 48, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 50, 1, 0, 0, 0, 52, 9, 1, 0, 0, 0, 53, 54, 3, 20, 10, 0, 54, 55, 3, 24, 12, 0, 55, 56, 3, 22, 11, 0, 56, 11, 1, 0, 0, 0, 57, 58, 3, 20, 10, 0, 58, 61, 5, 8, 0, 0, 59, 62, 3, 22, 11, 0, 60, 62, 3, 16, 8, 0, 61, 59, 1, 0, 0, 0, 61, 60, 1, 0, 0, 0, 62, 13, 1, 0, 0, 0, 63, 67, 5, 12, 0, 0, 64, 66, 5, 12, 0, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 15, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 9, 0, 0, 71, 79, 3, 18, 9, 0, 72, 74, 7, 0, 0, 0, 73, 75, 5, 3, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 3, 18, 9, 0, 77, 72, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 10, 0, 0, 83, 17, 1, 0, 0, 0, 84, 87, 3, 16, 8, 0, 85, 87, 3, 22, 11, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 19, 1, 0, 0, 0, 88, 89, 5, 12, 0, 0, 89, 21, 1, 0, 0, 0, 90, 93, 5, 11, 0, 0, 91, 93, 3, 14, 7, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 23, 1, 0, 0, 0, 94, 95, 7, 1, 0, 0, 95, 25, 1, 0, 0, 0, 9, 34, 40, 51, 61, 67, 74, 79, 86, 92] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens b/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens index 24439db0066c..d9da629fcca1 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens @@ -9,9 +9,8 @@ EQ=8 LPAREN=9 RPAREN=10 PHRASE=11 -NUMBER=12 -ID=13 -WS=14 +ID=12 +WS=13 '>'=4 '<'=5 '>='=6 diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts index 57fad74d37a8..49cd693c0791 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParser.ts @@ -23,9 +23,8 @@ export class DQLParser extends antlr.Parser { public static readonly LPAREN = 9; public static readonly RPAREN = 10; public static readonly PHRASE = 11; - public static readonly NUMBER = 12; - public static readonly ID = 13; - public static readonly WS = 14; + public static readonly ID = 12; + public static readonly WS = 13; public static readonly RULE_query = 0; public static readonly RULE_operatorExpression = 1; public static readonly RULE_booleanOperator = 2; @@ -37,9 +36,8 @@ export class DQLParser extends antlr.Parser { public static readonly RULE_groupExpression = 8; public static readonly RULE_groupContent = 9; public static readonly RULE_field = 10; - public static readonly RULE_rangeValue = 11; - public static readonly RULE_value = 12; - public static readonly RULE_comparisonOperator = 13; + public static readonly RULE_value = 11; + public static readonly RULE_comparisonOperator = 12; public static readonly literalNames = [ null, null, null, null, "'>'", "'<'", "'>='", "'<='", "':'", "'('", @@ -48,13 +46,13 @@ export class DQLParser extends antlr.Parser { public static readonly symbolicNames = [ null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", - "RPAREN", "PHRASE", "NUMBER", "ID", "WS" + "RPAREN", "PHRASE", "ID", "WS" ]; public static readonly ruleNames = [ "query", "operatorExpression", "booleanOperator", "notExpression", "primaryExpression", "comparisonExpression", "keyValueExpression", - "tokenSearch", "groupExpression", "groupContent", "field", "rangeValue", - "value", "comparisonOperator", + "tokenSearch", "groupExpression", "groupContent", "field", "value", + "comparisonOperator", ]; public get grammarFileName(): string { return "DQLParser.g4"; } @@ -77,7 +75,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 28; + this.state = 26; this.operatorExpression(); } } @@ -101,21 +99,21 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 30; + this.state = 28; this.notExpression(); - this.state = 36; + this.state = 34; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1 || _la === 2) { { { - this.state = 31; + this.state = 29; this.booleanOperator(); - this.state = 32; + this.state = 30; this.notExpression(); } } - this.state = 38; + this.state = 36; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -141,7 +139,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 39; + this.state = 37; _la = this.tokenStream.LA(1); if(!(_la === 1 || _la === 2)) { this.errorHandler.recoverInline(this); @@ -172,17 +170,17 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 42; + this.state = 40; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 3) { { - this.state = 41; + this.state = 39; this.match(DQLParser.NOT); } } - this.state = 44; + this.state = 42; this.primaryExpression(); } } @@ -203,38 +201,38 @@ export class DQLParser extends antlr.Parser { let localContext = new PrimaryExpressionContext(this.context, this.state); this.enterRule(localContext, 8, DQLParser.RULE_primaryExpression); try { - this.state = 53; + this.state = 51; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 2, this.context) ) { case 1: this.enterOuterAlt(localContext, 1); { - this.state = 46; + this.state = 44; this.match(DQLParser.LPAREN); - this.state = 47; + this.state = 45; this.query(); - this.state = 48; + this.state = 46; this.match(DQLParser.RPAREN); } break; case 2: this.enterOuterAlt(localContext, 2); { - this.state = 50; + this.state = 48; this.comparisonExpression(); } break; case 3: this.enterOuterAlt(localContext, 3); { - this.state = 51; + this.state = 49; this.keyValueExpression(); } break; case 4: this.enterOuterAlt(localContext, 4); { - this.state = 52; + this.state = 50; this.tokenSearch(); } break; @@ -259,12 +257,12 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 55; + this.state = 53; this.field(); - this.state = 56; + this.state = 54; this.comparisonOperator(); - this.state = 57; - this.rangeValue(); + this.state = 55; + this.value(); } } catch (re) { @@ -286,24 +284,23 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 59; + this.state = 57; this.field(); - this.state = 60; + this.state = 58; this.match(DQLParser.EQ); - this.state = 63; + this.state = 61; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: - case DQLParser.NUMBER: case DQLParser.ID: { - this.state = 61; + this.state = 59; this.value(); } break; case DQLParser.LPAREN: { - this.state = 62; + this.state = 60; this.groupExpression(); } break; @@ -332,19 +329,19 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 65; + this.state = 63; this.match(DQLParser.ID); - this.state = 69; + this.state = 67; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); - while (_la === 13) { + while (_la === 12) { { { - this.state = 66; + this.state = 64; this.match(DQLParser.ID); } } - this.state = 71; + this.state = 69; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -370,17 +367,17 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 72; + this.state = 70; this.match(DQLParser.LPAREN); - this.state = 73; + this.state = 71; this.groupContent(); - this.state = 81; + this.state = 79; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1 || _la === 2) { { { - this.state = 74; + this.state = 72; _la = this.tokenStream.LA(1); if(!(_la === 1 || _la === 2)) { this.errorHandler.recoverInline(this); @@ -390,26 +387,26 @@ export class DQLParser extends antlr.Parser { this.consume(); } { - this.state = 76; + this.state = 74; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 3) { { - this.state = 75; + this.state = 73; this.match(DQLParser.NOT); } } } - this.state = 78; + this.state = 76; this.groupContent(); } } - this.state = 83; + this.state = 81; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 84; + this.state = 82; this.match(DQLParser.RPAREN); } } @@ -430,22 +427,21 @@ export class DQLParser extends antlr.Parser { let localContext = new GroupContentContext(this.context, this.state); this.enterRule(localContext, 18, DQLParser.RULE_groupContent); try { - this.state = 88; + this.state = 86; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.LPAREN: this.enterOuterAlt(localContext, 1); { - this.state = 86; + this.state = 84; this.groupExpression(); } break; case DQLParser.PHRASE: - case DQLParser.NUMBER: case DQLParser.ID: this.enterOuterAlt(localContext, 2); { - this.state = 87; + this.state = 85; this.value(); } break; @@ -472,7 +468,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 90; + this.state = 88; this.match(DQLParser.ID); } } @@ -489,62 +485,24 @@ export class DQLParser extends antlr.Parser { } return localContext; } - public rangeValue(): RangeValueContext { - let localContext = new RangeValueContext(this.context, this.state); - this.enterRule(localContext, 22, DQLParser.RULE_rangeValue); - let _la: number; - try { - this.enterOuterAlt(localContext, 1); - { - this.state = 92; - _la = this.tokenStream.LA(1); - if(!(_la === 11 || _la === 12)) { - this.errorHandler.recoverInline(this); - } - else { - this.errorHandler.reportMatch(this); - this.consume(); - } - } - } - catch (re) { - if (re instanceof antlr.RecognitionException) { - this.errorHandler.reportError(this, re); - this.errorHandler.recover(this, re); - } else { - throw re; - } - } - finally { - this.exitRule(); - } - return localContext; - } public value(): ValueContext { let localContext = new ValueContext(this.context, this.state); - this.enterRule(localContext, 24, DQLParser.RULE_value); + this.enterRule(localContext, 22, DQLParser.RULE_value); try { - this.state = 97; + this.state = 92; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: this.enterOuterAlt(localContext, 1); { - this.state = 94; + this.state = 90; this.match(DQLParser.PHRASE); } break; - case DQLParser.NUMBER: - this.enterOuterAlt(localContext, 2); - { - this.state = 95; - this.match(DQLParser.NUMBER); - } - break; case DQLParser.ID: - this.enterOuterAlt(localContext, 3); + this.enterOuterAlt(localContext, 2); { - this.state = 96; + this.state = 91; this.tokenSearch(); } break; @@ -567,12 +525,12 @@ export class DQLParser extends antlr.Parser { } public comparisonOperator(): ComparisonOperatorContext { let localContext = new ComparisonOperatorContext(this.context, this.state); - this.enterRule(localContext, 26, DQLParser.RULE_comparisonOperator); + this.enterRule(localContext, 24, DQLParser.RULE_comparisonOperator); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 99; + this.state = 94; _la = this.tokenStream.LA(1); if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 240) !== 0))) { this.errorHandler.recoverInline(this); @@ -598,37 +556,36 @@ export class DQLParser extends antlr.Parser { } public static readonly _serializedATN: number[] = [ - 4,1,14,102,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, - 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, - 1,0,1,0,1,1,1,1,1,1,1,1,5,1,35,8,1,10,1,12,1,38,9,1,1,2,1,2,1,3, - 3,3,43,8,3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,54,8,4,1,5,1, - 5,1,5,1,5,1,6,1,6,1,6,1,6,3,6,64,8,6,1,7,1,7,5,7,68,8,7,10,7,12, - 7,71,9,7,1,8,1,8,1,8,1,8,3,8,77,8,8,1,8,5,8,80,8,8,10,8,12,8,83, - 9,8,1,8,1,8,1,9,1,9,3,9,89,8,9,1,10,1,10,1,11,1,11,1,12,1,12,1,12, - 3,12,98,8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,14,16,18,20,22, - 24,26,0,3,1,0,1,2,1,0,11,12,1,0,4,7,99,0,28,1,0,0,0,2,30,1,0,0,0, - 4,39,1,0,0,0,6,42,1,0,0,0,8,53,1,0,0,0,10,55,1,0,0,0,12,59,1,0,0, - 0,14,65,1,0,0,0,16,72,1,0,0,0,18,88,1,0,0,0,20,90,1,0,0,0,22,92, - 1,0,0,0,24,97,1,0,0,0,26,99,1,0,0,0,28,29,3,2,1,0,29,1,1,0,0,0,30, - 36,3,6,3,0,31,32,3,4,2,0,32,33,3,6,3,0,33,35,1,0,0,0,34,31,1,0,0, - 0,35,38,1,0,0,0,36,34,1,0,0,0,36,37,1,0,0,0,37,3,1,0,0,0,38,36,1, - 0,0,0,39,40,7,0,0,0,40,5,1,0,0,0,41,43,5,3,0,0,42,41,1,0,0,0,42, - 43,1,0,0,0,43,44,1,0,0,0,44,45,3,8,4,0,45,7,1,0,0,0,46,47,5,9,0, - 0,47,48,3,0,0,0,48,49,5,10,0,0,49,54,1,0,0,0,50,54,3,10,5,0,51,54, - 3,12,6,0,52,54,3,14,7,0,53,46,1,0,0,0,53,50,1,0,0,0,53,51,1,0,0, - 0,53,52,1,0,0,0,54,9,1,0,0,0,55,56,3,20,10,0,56,57,3,26,13,0,57, - 58,3,22,11,0,58,11,1,0,0,0,59,60,3,20,10,0,60,63,5,8,0,0,61,64,3, - 24,12,0,62,64,3,16,8,0,63,61,1,0,0,0,63,62,1,0,0,0,64,13,1,0,0,0, - 65,69,5,13,0,0,66,68,5,13,0,0,67,66,1,0,0,0,68,71,1,0,0,0,69,67, - 1,0,0,0,69,70,1,0,0,0,70,15,1,0,0,0,71,69,1,0,0,0,72,73,5,9,0,0, - 73,81,3,18,9,0,74,76,7,0,0,0,75,77,5,3,0,0,76,75,1,0,0,0,76,77,1, - 0,0,0,77,78,1,0,0,0,78,80,3,18,9,0,79,74,1,0,0,0,80,83,1,0,0,0,81, - 79,1,0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,81,1,0,0,0,84,85,5,10, - 0,0,85,17,1,0,0,0,86,89,3,16,8,0,87,89,3,24,12,0,88,86,1,0,0,0,88, - 87,1,0,0,0,89,19,1,0,0,0,90,91,5,13,0,0,91,21,1,0,0,0,92,93,7,1, - 0,0,93,23,1,0,0,0,94,98,5,11,0,0,95,98,5,12,0,0,96,98,3,14,7,0,97, - 94,1,0,0,0,97,95,1,0,0,0,97,96,1,0,0,0,98,25,1,0,0,0,99,100,7,2, - 0,0,100,27,1,0,0,0,9,36,42,53,63,69,76,81,88,97 + 4,1,13,97,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,1,0,1,0, + 1,1,1,1,1,1,1,1,5,1,33,8,1,10,1,12,1,36,9,1,1,2,1,2,1,3,3,3,41,8, + 3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,52,8,4,1,5,1,5,1,5,1,5, + 1,6,1,6,1,6,1,6,3,6,62,8,6,1,7,1,7,5,7,66,8,7,10,7,12,7,69,9,7,1, + 8,1,8,1,8,1,8,3,8,75,8,8,1,8,5,8,78,8,8,10,8,12,8,81,9,8,1,8,1,8, + 1,9,1,9,3,9,87,8,9,1,10,1,10,1,11,1,11,3,11,93,8,11,1,12,1,12,1, + 12,0,0,13,0,2,4,6,8,10,12,14,16,18,20,22,24,0,2,1,0,1,2,1,0,4,7, + 94,0,26,1,0,0,0,2,28,1,0,0,0,4,37,1,0,0,0,6,40,1,0,0,0,8,51,1,0, + 0,0,10,53,1,0,0,0,12,57,1,0,0,0,14,63,1,0,0,0,16,70,1,0,0,0,18,86, + 1,0,0,0,20,88,1,0,0,0,22,92,1,0,0,0,24,94,1,0,0,0,26,27,3,2,1,0, + 27,1,1,0,0,0,28,34,3,6,3,0,29,30,3,4,2,0,30,31,3,6,3,0,31,33,1,0, + 0,0,32,29,1,0,0,0,33,36,1,0,0,0,34,32,1,0,0,0,34,35,1,0,0,0,35,3, + 1,0,0,0,36,34,1,0,0,0,37,38,7,0,0,0,38,5,1,0,0,0,39,41,5,3,0,0,40, + 39,1,0,0,0,40,41,1,0,0,0,41,42,1,0,0,0,42,43,3,8,4,0,43,7,1,0,0, + 0,44,45,5,9,0,0,45,46,3,0,0,0,46,47,5,10,0,0,47,52,1,0,0,0,48,52, + 3,10,5,0,49,52,3,12,6,0,50,52,3,14,7,0,51,44,1,0,0,0,51,48,1,0,0, + 0,51,49,1,0,0,0,51,50,1,0,0,0,52,9,1,0,0,0,53,54,3,20,10,0,54,55, + 3,24,12,0,55,56,3,22,11,0,56,11,1,0,0,0,57,58,3,20,10,0,58,61,5, + 8,0,0,59,62,3,22,11,0,60,62,3,16,8,0,61,59,1,0,0,0,61,60,1,0,0,0, + 62,13,1,0,0,0,63,67,5,12,0,0,64,66,5,12,0,0,65,64,1,0,0,0,66,69, + 1,0,0,0,67,65,1,0,0,0,67,68,1,0,0,0,68,15,1,0,0,0,69,67,1,0,0,0, + 70,71,5,9,0,0,71,79,3,18,9,0,72,74,7,0,0,0,73,75,5,3,0,0,74,73,1, + 0,0,0,74,75,1,0,0,0,75,76,1,0,0,0,76,78,3,18,9,0,77,72,1,0,0,0,78, + 81,1,0,0,0,79,77,1,0,0,0,79,80,1,0,0,0,80,82,1,0,0,0,81,79,1,0,0, + 0,82,83,5,10,0,0,83,17,1,0,0,0,84,87,3,16,8,0,85,87,3,22,11,0,86, + 84,1,0,0,0,86,85,1,0,0,0,87,19,1,0,0,0,88,89,5,12,0,0,89,21,1,0, + 0,0,90,93,5,11,0,0,91,93,3,14,7,0,92,90,1,0,0,0,92,91,1,0,0,0,93, + 23,1,0,0,0,94,95,7,1,0,0,95,25,1,0,0,0,9,34,40,51,61,67,74,79,86, + 92 ]; private static __ATN: antlr.ATN; @@ -846,8 +803,8 @@ export class ComparisonExpressionContext extends antlr.ParserRuleContext { public comparisonOperator(): ComparisonOperatorContext { return this.getRuleContext(0, ComparisonOperatorContext)!; } - public rangeValue(): RangeValueContext { - return this.getRuleContext(0, RangeValueContext)!; + public value(): ValueContext { + return this.getRuleContext(0, ValueContext)!; } public override get ruleIndex(): number { return DQLParser.RULE_comparisonExpression; @@ -1079,39 +1036,6 @@ export class FieldContext extends antlr.ParserRuleContext { } -export class RangeValueContext extends antlr.ParserRuleContext { - public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { - super(parent, invokingState); - } - public NUMBER(): antlr.TerminalNode | null { - return this.getToken(DQLParser.NUMBER, 0); - } - public PHRASE(): antlr.TerminalNode | null { - return this.getToken(DQLParser.PHRASE, 0); - } - public override get ruleIndex(): number { - return DQLParser.RULE_rangeValue; - } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterRangeValue) { - listener.enterRangeValue(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitRangeValue) { - listener.exitRangeValue(this); - } - } - public override accept(visitor: DQLParserVisitor): Result | null { - if (visitor.visitRangeValue) { - return visitor.visitRangeValue(this); - } else { - return visitor.visitChildren(this); - } - } -} - - export class ValueContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); @@ -1119,9 +1043,6 @@ export class ValueContext extends antlr.ParserRuleContext { public PHRASE(): antlr.TerminalNode | null { return this.getToken(DQLParser.PHRASE, 0); } - public NUMBER(): antlr.TerminalNode | null { - return this.getToken(DQLParser.NUMBER, 0); - } public tokenSearch(): TokenSearchContext | null { return this.getRuleContext(0, TokenSearchContext); } diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts index eafa62056765..265d5e1958d9 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts @@ -14,7 +14,6 @@ import { TokenSearchContext } from "./DQLParser.js"; import { GroupExpressionContext } from "./DQLParser.js"; import { GroupContentContext } from "./DQLParser.js"; import { FieldContext } from "./DQLParser.js"; -import { RangeValueContext } from "./DQLParser.js"; import { ValueContext } from "./DQLParser.js"; import { ComparisonOperatorContext } from "./DQLParser.js"; @@ -134,16 +133,6 @@ export class DQLParserListener implements ParseTreeListener { * @param ctx the parse tree */ exitField?: (ctx: FieldContext) => void; - /** - * Enter a parse tree produced by `DQLParser.rangeValue`. - * @param ctx the parse tree - */ - enterRangeValue?: (ctx: RangeValueContext) => void; - /** - * Exit a parse tree produced by `DQLParser.rangeValue`. - * @param ctx the parse tree - */ - exitRangeValue?: (ctx: RangeValueContext) => void; /** * Enter a parse tree produced by `DQLParser.value`. * @param ctx the parse tree diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts index 7ac3ea538c5a..82a440ece047 100644 --- a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts +++ b/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts @@ -14,7 +14,6 @@ import { TokenSearchContext } from "./DQLParser.js"; import { GroupExpressionContext } from "./DQLParser.js"; import { GroupContentContext } from "./DQLParser.js"; import { FieldContext } from "./DQLParser.js"; -import { RangeValueContext } from "./DQLParser.js"; import { ValueContext } from "./DQLParser.js"; import { ComparisonOperatorContext } from "./DQLParser.js"; @@ -93,12 +92,6 @@ export class DQLParserVisitor extends AbstractParseTreeVisitor { * @return the visitor result */ visitField?: (ctx: FieldContext) => Result; - /** - * Visit a parse tree produced by `DQLParser.rangeValue`. - * @param ctx the parse tree - * @return the visitor result - */ - visitRangeValue?: (ctx: RangeValueContext) => Result; /** * Visit a parse tree produced by `DQLParser.value`. * @param ctx the parse tree diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp index 16a3cddba4eb..2a27c7a74895 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.interp @@ -13,7 +13,6 @@ null null null null -null token symbolic names: null @@ -28,7 +27,6 @@ EQ LPAREN RPAREN PHRASE -NUMBER ID WS @@ -44,7 +42,6 @@ EQ LPAREN RPAREN PHRASE -NUMBER ID WS @@ -56,4 +53,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 14, 96, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 59, 8, 10, 10, 10, 12, 10, 62, 9, 10, 1, 10, 3, 10, 65, 8, 10, 1, 11, 3, 11, 68, 8, 11, 1, 11, 4, 11, 71, 8, 11, 11, 11, 12, 11, 72, 1, 11, 1, 11, 4, 11, 77, 8, 11, 11, 11, 12, 11, 78, 3, 11, 81, 8, 11, 1, 12, 1, 12, 5, 12, 85, 8, 12, 10, 12, 12, 12, 88, 9, 12, 1, 13, 4, 13, 91, 8, 13, 11, 13, 12, 13, 92, 1, 13, 1, 13, 0, 0, 14, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 1, 0, 11, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 1, 0, 48, 57, 4, 0, 42, 42, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 103, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 1, 29, 1, 0, 0, 0, 3, 32, 1, 0, 0, 0, 5, 36, 1, 0, 0, 0, 7, 40, 1, 0, 0, 0, 9, 42, 1, 0, 0, 0, 11, 44, 1, 0, 0, 0, 13, 47, 1, 0, 0, 0, 15, 50, 1, 0, 0, 0, 17, 52, 1, 0, 0, 0, 19, 54, 1, 0, 0, 0, 21, 56, 1, 0, 0, 0, 23, 67, 1, 0, 0, 0, 25, 82, 1, 0, 0, 0, 27, 90, 1, 0, 0, 0, 29, 30, 7, 0, 0, 0, 30, 31, 7, 1, 0, 0, 31, 2, 1, 0, 0, 0, 32, 33, 7, 2, 0, 0, 33, 34, 7, 3, 0, 0, 34, 35, 7, 4, 0, 0, 35, 4, 1, 0, 0, 0, 36, 37, 7, 3, 0, 0, 37, 38, 7, 0, 0, 0, 38, 39, 7, 5, 0, 0, 39, 6, 1, 0, 0, 0, 40, 41, 5, 62, 0, 0, 41, 8, 1, 0, 0, 0, 42, 43, 5, 60, 0, 0, 43, 10, 1, 0, 0, 0, 44, 45, 5, 62, 0, 0, 45, 46, 5, 61, 0, 0, 46, 12, 1, 0, 0, 0, 47, 48, 5, 60, 0, 0, 48, 49, 5, 61, 0, 0, 49, 14, 1, 0, 0, 0, 50, 51, 5, 58, 0, 0, 51, 16, 1, 0, 0, 0, 52, 53, 5, 40, 0, 0, 53, 18, 1, 0, 0, 0, 54, 55, 5, 41, 0, 0, 55, 20, 1, 0, 0, 0, 56, 60, 5, 34, 0, 0, 57, 59, 8, 6, 0, 0, 58, 57, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 64, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 63, 65, 5, 34, 0, 0, 64, 63, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 22, 1, 0, 0, 0, 66, 68, 5, 45, 0, 0, 67, 66, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 71, 7, 7, 0, 0, 70, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 80, 1, 0, 0, 0, 74, 76, 5, 46, 0, 0, 75, 77, 7, 7, 0, 0, 76, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 81, 1, 0, 0, 0, 80, 74, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 24, 1, 0, 0, 0, 82, 86, 7, 8, 0, 0, 83, 85, 7, 9, 0, 0, 84, 83, 1, 0, 0, 0, 85, 88, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 26, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 89, 91, 7, 10, 0, 0, 90, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 6, 13, 0, 0, 95, 28, 1, 0, 0, 0, 9, 0, 60, 64, 67, 72, 78, 80, 86, 92, 1, 0, 1, 0] \ No newline at end of file +[4, 0, 13, 78, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 5, 10, 57, 8, 10, 10, 10, 12, 10, 60, 9, 10, 1, 10, 3, 10, 63, 8, 10, 1, 11, 1, 11, 5, 11, 67, 8, 11, 10, 11, 12, 11, 70, 9, 11, 1, 12, 4, 12, 73, 8, 12, 11, 12, 12, 12, 74, 1, 12, 1, 12, 0, 0, 13, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 1, 0, 10, 2, 0, 79, 79, 111, 111, 2, 0, 82, 82, 114, 114, 2, 0, 65, 65, 97, 97, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 84, 84, 116, 116, 2, 0, 34, 34, 92, 92, 5, 0, 42, 42, 48, 57, 65, 90, 95, 95, 97, 122, 6, 0, 42, 42, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 81, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 1, 27, 1, 0, 0, 0, 3, 30, 1, 0, 0, 0, 5, 34, 1, 0, 0, 0, 7, 38, 1, 0, 0, 0, 9, 40, 1, 0, 0, 0, 11, 42, 1, 0, 0, 0, 13, 45, 1, 0, 0, 0, 15, 48, 1, 0, 0, 0, 17, 50, 1, 0, 0, 0, 19, 52, 1, 0, 0, 0, 21, 54, 1, 0, 0, 0, 23, 64, 1, 0, 0, 0, 25, 72, 1, 0, 0, 0, 27, 28, 7, 0, 0, 0, 28, 29, 7, 1, 0, 0, 29, 2, 1, 0, 0, 0, 30, 31, 7, 2, 0, 0, 31, 32, 7, 3, 0, 0, 32, 33, 7, 4, 0, 0, 33, 4, 1, 0, 0, 0, 34, 35, 7, 3, 0, 0, 35, 36, 7, 0, 0, 0, 36, 37, 7, 5, 0, 0, 37, 6, 1, 0, 0, 0, 38, 39, 5, 62, 0, 0, 39, 8, 1, 0, 0, 0, 40, 41, 5, 60, 0, 0, 41, 10, 1, 0, 0, 0, 42, 43, 5, 62, 0, 0, 43, 44, 5, 61, 0, 0, 44, 12, 1, 0, 0, 0, 45, 46, 5, 60, 0, 0, 46, 47, 5, 61, 0, 0, 47, 14, 1, 0, 0, 0, 48, 49, 5, 58, 0, 0, 49, 16, 1, 0, 0, 0, 50, 51, 5, 40, 0, 0, 51, 18, 1, 0, 0, 0, 52, 53, 5, 41, 0, 0, 53, 20, 1, 0, 0, 0, 54, 58, 5, 34, 0, 0, 55, 57, 8, 6, 0, 0, 56, 55, 1, 0, 0, 0, 57, 60, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 62, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 61, 63, 5, 34, 0, 0, 62, 61, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 22, 1, 0, 0, 0, 64, 68, 7, 7, 0, 0, 65, 67, 7, 8, 0, 0, 66, 65, 1, 0, 0, 0, 67, 70, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 24, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 71, 73, 7, 9, 0, 0, 72, 71, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 6, 12, 0, 0, 77, 26, 1, 0, 0, 0, 5, 0, 58, 62, 68, 74, 1, 0, 1, 0] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java index 5dc52ceba5e5..82d84ce79e61 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.java @@ -17,7 +17,7 @@ public class DQLLexer extends Lexer { new PredictionContextCache(); public static final int OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, - PHRASE=11, NUMBER=12, ID=13, WS=14; + PHRASE=11, ID=12, WS=13; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; @@ -29,7 +29,7 @@ public class DQLLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "PHRASE", "NUMBER", "ID", "WS" + "PHRASE", "ID", "WS" }; } public static final String[] ruleNames = makeRuleNames(); @@ -43,7 +43,7 @@ private static String[] makeLiteralNames() { private static String[] makeSymbolicNames() { return new String[] { null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "PHRASE", "NUMBER", "ID", "WS" + "PHRASE", "ID", "WS" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); @@ -105,66 +105,56 @@ public DQLLexer(CharStream input) { public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\u0004\u0000\u000e`\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ + "\u0004\u0000\rN\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+ "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+ "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+ - "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001"+ - "\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0002\u0001"+ - "\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0004\u0001"+ - "\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001"+ - "\u0006\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001\t\u0001\t\u0001\n"+ - "\u0001\n\u0005\n;\b\n\n\n\f\n>\t\n\u0001\n\u0003\nA\b\n\u0001\u000b\u0003"+ - "\u000bD\b\u000b\u0001\u000b\u0004\u000bG\b\u000b\u000b\u000b\f\u000bH"+ - "\u0001\u000b\u0001\u000b\u0004\u000bM\b\u000b\u000b\u000b\f\u000bN\u0003"+ - "\u000bQ\b\u000b\u0001\f\u0001\f\u0005\fU\b\f\n\f\f\fX\t\f\u0001\r\u0004"+ - "\r[\b\r\u000b\r\f\r\\\u0001\r\u0001\r\u0000\u0000\u000e\u0001\u0001\u0003"+ - "\u0002\u0005\u0003\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f\b\u0011"+ - "\t\u0013\n\u0015\u000b\u0017\f\u0019\r\u001b\u000e\u0001\u0000\u000b\u0002"+ - "\u0000OOoo\u0002\u0000RRrr\u0002\u0000AAaa\u0002\u0000NNnn\u0002\u0000"+ - "DDdd\u0002\u0000TTtt\u0002\u0000\"\"\\\\\u0001\u000009\u0004\u0000**A"+ - "Z__az\u0006\u0000**..09AZ__az\u0003\u0000\t\n\r\r g\u0000\u0001\u0001"+ - "\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001"+ - "\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000"+ - "\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000"+ - "\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000"+ - "\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000"+ - "\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000"+ - "\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000"+ - "\u0000\u0003 \u0001\u0000\u0000\u0000\u0005$\u0001\u0000\u0000\u0000\u0007"+ - "(\u0001\u0000\u0000\u0000\t*\u0001\u0000\u0000\u0000\u000b,\u0001\u0000"+ - "\u0000\u0000\r/\u0001\u0000\u0000\u0000\u000f2\u0001\u0000\u0000\u0000"+ - "\u00114\u0001\u0000\u0000\u0000\u00136\u0001\u0000\u0000\u0000\u00158"+ - "\u0001\u0000\u0000\u0000\u0017C\u0001\u0000\u0000\u0000\u0019R\u0001\u0000"+ - "\u0000\u0000\u001bZ\u0001\u0000\u0000\u0000\u001d\u001e\u0007\u0000\u0000"+ - "\u0000\u001e\u001f\u0007\u0001\u0000\u0000\u001f\u0002\u0001\u0000\u0000"+ - "\u0000 !\u0007\u0002\u0000\u0000!\"\u0007\u0003\u0000\u0000\"#\u0007\u0004"+ - "\u0000\u0000#\u0004\u0001\u0000\u0000\u0000$%\u0007\u0003\u0000\u0000"+ - "%&\u0007\u0000\u0000\u0000&\'\u0007\u0005\u0000\u0000\'\u0006\u0001\u0000"+ - "\u0000\u0000()\u0005>\u0000\u0000)\b\u0001\u0000\u0000\u0000*+\u0005<"+ - "\u0000\u0000+\n\u0001\u0000\u0000\u0000,-\u0005>\u0000\u0000-.\u0005="+ - "\u0000\u0000.\f\u0001\u0000\u0000\u0000/0\u0005<\u0000\u000001\u0005="+ - "\u0000\u00001\u000e\u0001\u0000\u0000\u000023\u0005:\u0000\u00003\u0010"+ - "\u0001\u0000\u0000\u000045\u0005(\u0000\u00005\u0012\u0001\u0000\u0000"+ - "\u000067\u0005)\u0000\u00007\u0014\u0001\u0000\u0000\u00008<\u0005\"\u0000"+ - "\u00009;\b\u0006\u0000\u0000:9\u0001\u0000\u0000\u0000;>\u0001\u0000\u0000"+ - "\u0000<:\u0001\u0000\u0000\u0000<=\u0001\u0000\u0000\u0000=@\u0001\u0000"+ - "\u0000\u0000><\u0001\u0000\u0000\u0000?A\u0005\"\u0000\u0000@?\u0001\u0000"+ - "\u0000\u0000@A\u0001\u0000\u0000\u0000A\u0016\u0001\u0000\u0000\u0000"+ - "BD\u0005-\u0000\u0000CB\u0001\u0000\u0000\u0000CD\u0001\u0000\u0000\u0000"+ - "DF\u0001\u0000\u0000\u0000EG\u0007\u0007\u0000\u0000FE\u0001\u0000\u0000"+ - "\u0000GH\u0001\u0000\u0000\u0000HF\u0001\u0000\u0000\u0000HI\u0001\u0000"+ - "\u0000\u0000IP\u0001\u0000\u0000\u0000JL\u0005.\u0000\u0000KM\u0007\u0007"+ - "\u0000\u0000LK\u0001\u0000\u0000\u0000MN\u0001\u0000\u0000\u0000NL\u0001"+ - "\u0000\u0000\u0000NO\u0001\u0000\u0000\u0000OQ\u0001\u0000\u0000\u0000"+ - "PJ\u0001\u0000\u0000\u0000PQ\u0001\u0000\u0000\u0000Q\u0018\u0001\u0000"+ - "\u0000\u0000RV\u0007\b\u0000\u0000SU\u0007\t\u0000\u0000TS\u0001\u0000"+ - "\u0000\u0000UX\u0001\u0000\u0000\u0000VT\u0001\u0000\u0000\u0000VW\u0001"+ - "\u0000\u0000\u0000W\u001a\u0001\u0000\u0000\u0000XV\u0001\u0000\u0000"+ - "\u0000Y[\u0007\n\u0000\u0000ZY\u0001\u0000\u0000\u0000[\\\u0001\u0000"+ - "\u0000\u0000\\Z\u0001\u0000\u0000\u0000\\]\u0001\u0000\u0000\u0000]^\u0001"+ - "\u0000\u0000\u0000^_\u0006\r\u0000\u0000_\u001c\u0001\u0000\u0000\u0000"+ - "\t\u0000<@CHNPV\\\u0001\u0000\u0001\u0000"; + "\u0007\u000b\u0002\f\u0007\f\u0001\u0000\u0001\u0000\u0001\u0000\u0001"+ + "\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0002\u0001\u0002\u0001"+ + "\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001"+ + "\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001"+ + "\u0007\u0001\u0007\u0001\b\u0001\b\u0001\t\u0001\t\u0001\n\u0001\n\u0005"+ + "\n9\b\n\n\n\f\n<\t\n\u0001\n\u0003\n?\b\n\u0001\u000b\u0001\u000b\u0005"+ + "\u000bC\b\u000b\n\u000b\f\u000bF\t\u000b\u0001\f\u0004\fI\b\f\u000b\f"+ + "\f\fJ\u0001\f\u0001\f\u0000\u0000\r\u0001\u0001\u0003\u0002\u0005\u0003"+ + "\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015"+ + "\u000b\u0017\f\u0019\r\u0001\u0000\n\u0002\u0000OOoo\u0002\u0000RRrr\u0002"+ + "\u0000AAaa\u0002\u0000NNnn\u0002\u0000DDdd\u0002\u0000TTtt\u0002\u0000"+ + "\"\"\\\\\u0005\u0000**09AZ__az\u0006\u0000**..09AZ__az\u0003\u0000\t\n"+ + "\r\r Q\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000"+ + "\u0000\u0000\u0005\u0001\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000"+ + "\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000"+ + "\u0000\r\u0001\u0000\u0000\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000"+ + "\u0011\u0001\u0000\u0000\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000"+ + "\u0015\u0001\u0000\u0000\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000"+ + "\u0019\u0001\u0000\u0000\u0000\u0001\u001b\u0001\u0000\u0000\u0000\u0003"+ + "\u001e\u0001\u0000\u0000\u0000\u0005\"\u0001\u0000\u0000\u0000\u0007&"+ + "\u0001\u0000\u0000\u0000\t(\u0001\u0000\u0000\u0000\u000b*\u0001\u0000"+ + "\u0000\u0000\r-\u0001\u0000\u0000\u0000\u000f0\u0001\u0000\u0000\u0000"+ + "\u00112\u0001\u0000\u0000\u0000\u00134\u0001\u0000\u0000\u0000\u00156"+ + "\u0001\u0000\u0000\u0000\u0017@\u0001\u0000\u0000\u0000\u0019H\u0001\u0000"+ + "\u0000\u0000\u001b\u001c\u0007\u0000\u0000\u0000\u001c\u001d\u0007\u0001"+ + "\u0000\u0000\u001d\u0002\u0001\u0000\u0000\u0000\u001e\u001f\u0007\u0002"+ + "\u0000\u0000\u001f \u0007\u0003\u0000\u0000 !\u0007\u0004\u0000\u0000"+ + "!\u0004\u0001\u0000\u0000\u0000\"#\u0007\u0003\u0000\u0000#$\u0007\u0000"+ + "\u0000\u0000$%\u0007\u0005\u0000\u0000%\u0006\u0001\u0000\u0000\u0000"+ + "&\'\u0005>\u0000\u0000\'\b\u0001\u0000\u0000\u0000()\u0005<\u0000\u0000"+ + ")\n\u0001\u0000\u0000\u0000*+\u0005>\u0000\u0000+,\u0005=\u0000\u0000"+ + ",\f\u0001\u0000\u0000\u0000-.\u0005<\u0000\u0000./\u0005=\u0000\u0000"+ + "/\u000e\u0001\u0000\u0000\u000001\u0005:\u0000\u00001\u0010\u0001\u0000"+ + "\u0000\u000023\u0005(\u0000\u00003\u0012\u0001\u0000\u0000\u000045\u0005"+ + ")\u0000\u00005\u0014\u0001\u0000\u0000\u00006:\u0005\"\u0000\u000079\b"+ + "\u0006\u0000\u000087\u0001\u0000\u0000\u00009<\u0001\u0000\u0000\u0000"+ + ":8\u0001\u0000\u0000\u0000:;\u0001\u0000\u0000\u0000;>\u0001\u0000\u0000"+ + "\u0000<:\u0001\u0000\u0000\u0000=?\u0005\"\u0000\u0000>=\u0001\u0000\u0000"+ + "\u0000>?\u0001\u0000\u0000\u0000?\u0016\u0001\u0000\u0000\u0000@D\u0007"+ + "\u0007\u0000\u0000AC\u0007\b\u0000\u0000BA\u0001\u0000\u0000\u0000CF\u0001"+ + "\u0000\u0000\u0000DB\u0001\u0000\u0000\u0000DE\u0001\u0000\u0000\u0000"+ + "E\u0018\u0001\u0000\u0000\u0000FD\u0001\u0000\u0000\u0000GI\u0007\t\u0000"+ + "\u0000HG\u0001\u0000\u0000\u0000IJ\u0001\u0000\u0000\u0000JH\u0001\u0000"+ + "\u0000\u0000JK\u0001\u0000\u0000\u0000KL\u0001\u0000\u0000\u0000LM\u0006"+ + "\f\u0000\u0000M\u001a\u0001\u0000\u0000\u0000\u0005\u0000:>DJ\u0001\u0000"+ + "\u0001\u0000"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens index 24439db0066c..d9da629fcca1 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLLexer.tokens @@ -9,9 +9,8 @@ EQ=8 LPAREN=9 RPAREN=10 PHRASE=11 -NUMBER=12 -ID=13 -WS=14 +ID=12 +WS=13 '>'=4 '<'=5 '>='=6 diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp index 191f54c819d9..c8ac375c4e21 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -13,7 +13,6 @@ null null null null -null token symbolic names: null @@ -28,7 +27,6 @@ EQ LPAREN RPAREN PHRASE -NUMBER ID WS @@ -44,10 +42,9 @@ tokenSearch groupExpression groupContent field -rangeValue value comparisonOperator atn: -[4, 1, 14, 102, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 35, 8, 1, 10, 1, 12, 1, 38, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 43, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 54, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 64, 8, 6, 1, 7, 1, 7, 5, 7, 68, 8, 7, 10, 7, 12, 7, 71, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 77, 8, 8, 1, 8, 5, 8, 80, 8, 8, 10, 8, 12, 8, 83, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 89, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 3, 12, 98, 8, 12, 1, 13, 1, 13, 1, 13, 0, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 3, 1, 0, 1, 2, 1, 0, 11, 12, 1, 0, 4, 7, 99, 0, 28, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 39, 1, 0, 0, 0, 6, 42, 1, 0, 0, 0, 8, 53, 1, 0, 0, 0, 10, 55, 1, 0, 0, 0, 12, 59, 1, 0, 0, 0, 14, 65, 1, 0, 0, 0, 16, 72, 1, 0, 0, 0, 18, 88, 1, 0, 0, 0, 20, 90, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 99, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 1, 1, 0, 0, 0, 30, 36, 3, 6, 3, 0, 31, 32, 3, 4, 2, 0, 32, 33, 3, 6, 3, 0, 33, 35, 1, 0, 0, 0, 34, 31, 1, 0, 0, 0, 35, 38, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 3, 1, 0, 0, 0, 38, 36, 1, 0, 0, 0, 39, 40, 7, 0, 0, 0, 40, 5, 1, 0, 0, 0, 41, 43, 5, 3, 0, 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 45, 3, 8, 4, 0, 45, 7, 1, 0, 0, 0, 46, 47, 5, 9, 0, 0, 47, 48, 3, 0, 0, 0, 48, 49, 5, 10, 0, 0, 49, 54, 1, 0, 0, 0, 50, 54, 3, 10, 5, 0, 51, 54, 3, 12, 6, 0, 52, 54, 3, 14, 7, 0, 53, 46, 1, 0, 0, 0, 53, 50, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 52, 1, 0, 0, 0, 54, 9, 1, 0, 0, 0, 55, 56, 3, 20, 10, 0, 56, 57, 3, 26, 13, 0, 57, 58, 3, 22, 11, 0, 58, 11, 1, 0, 0, 0, 59, 60, 3, 20, 10, 0, 60, 63, 5, 8, 0, 0, 61, 64, 3, 24, 12, 0, 62, 64, 3, 16, 8, 0, 63, 61, 1, 0, 0, 0, 63, 62, 1, 0, 0, 0, 64, 13, 1, 0, 0, 0, 65, 69, 5, 13, 0, 0, 66, 68, 5, 13, 0, 0, 67, 66, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 15, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 5, 9, 0, 0, 73, 81, 3, 18, 9, 0, 74, 76, 7, 0, 0, 0, 75, 77, 5, 3, 0, 0, 76, 75, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 80, 3, 18, 9, 0, 79, 74, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 85, 5, 10, 0, 0, 85, 17, 1, 0, 0, 0, 86, 89, 3, 16, 8, 0, 87, 89, 3, 24, 12, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 19, 1, 0, 0, 0, 90, 91, 5, 13, 0, 0, 91, 21, 1, 0, 0, 0, 92, 93, 7, 1, 0, 0, 93, 23, 1, 0, 0, 0, 94, 98, 5, 11, 0, 0, 95, 98, 5, 12, 0, 0, 96, 98, 3, 14, 7, 0, 97, 94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 25, 1, 0, 0, 0, 99, 100, 7, 2, 0, 0, 100, 27, 1, 0, 0, 0, 9, 36, 42, 53, 63, 69, 76, 81, 88, 97] \ No newline at end of file +[4, 1, 13, 97, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 33, 8, 1, 10, 1, 12, 1, 36, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 41, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 52, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 62, 8, 6, 1, 7, 1, 7, 5, 7, 66, 8, 7, 10, 7, 12, 7, 69, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 75, 8, 8, 1, 8, 5, 8, 78, 8, 8, 10, 8, 12, 8, 81, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 87, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 93, 8, 11, 1, 12, 1, 12, 1, 12, 0, 0, 13, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 0, 2, 1, 0, 1, 2, 1, 0, 4, 7, 94, 0, 26, 1, 0, 0, 0, 2, 28, 1, 0, 0, 0, 4, 37, 1, 0, 0, 0, 6, 40, 1, 0, 0, 0, 8, 51, 1, 0, 0, 0, 10, 53, 1, 0, 0, 0, 12, 57, 1, 0, 0, 0, 14, 63, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 94, 1, 0, 0, 0, 26, 27, 3, 2, 1, 0, 27, 1, 1, 0, 0, 0, 28, 34, 3, 6, 3, 0, 29, 30, 3, 4, 2, 0, 30, 31, 3, 6, 3, 0, 31, 33, 1, 0, 0, 0, 32, 29, 1, 0, 0, 0, 33, 36, 1, 0, 0, 0, 34, 32, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 3, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 37, 38, 7, 0, 0, 0, 38, 5, 1, 0, 0, 0, 39, 41, 5, 3, 0, 0, 40, 39, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 43, 3, 8, 4, 0, 43, 7, 1, 0, 0, 0, 44, 45, 5, 9, 0, 0, 45, 46, 3, 0, 0, 0, 46, 47, 5, 10, 0, 0, 47, 52, 1, 0, 0, 0, 48, 52, 3, 10, 5, 0, 49, 52, 3, 12, 6, 0, 50, 52, 3, 14, 7, 0, 51, 44, 1, 0, 0, 0, 51, 48, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 50, 1, 0, 0, 0, 52, 9, 1, 0, 0, 0, 53, 54, 3, 20, 10, 0, 54, 55, 3, 24, 12, 0, 55, 56, 3, 22, 11, 0, 56, 11, 1, 0, 0, 0, 57, 58, 3, 20, 10, 0, 58, 61, 5, 8, 0, 0, 59, 62, 3, 22, 11, 0, 60, 62, 3, 16, 8, 0, 61, 59, 1, 0, 0, 0, 61, 60, 1, 0, 0, 0, 62, 13, 1, 0, 0, 0, 63, 67, 5, 12, 0, 0, 64, 66, 5, 12, 0, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 15, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 9, 0, 0, 71, 79, 3, 18, 9, 0, 72, 74, 7, 0, 0, 0, 73, 75, 5, 3, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 3, 18, 9, 0, 77, 72, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 10, 0, 0, 83, 17, 1, 0, 0, 0, 84, 87, 3, 16, 8, 0, 85, 87, 3, 22, 11, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 19, 1, 0, 0, 0, 88, 89, 5, 12, 0, 0, 89, 21, 1, 0, 0, 0, 90, 93, 5, 11, 0, 0, 91, 93, 3, 14, 7, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 23, 1, 0, 0, 0, 94, 95, 7, 1, 0, 0, 95, 25, 1, 0, 0, 0, 9, 34, 40, 51, 61, 67, 74, 79, 86, 92] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index 25b7e00df050..a9aa25b468c5 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -17,18 +17,17 @@ public class DQLParser extends Parser { new PredictionContextCache(); public static final int OR=1, AND=2, NOT=3, GT=4, LT=5, GE=6, LE=7, EQ=8, LPAREN=9, RPAREN=10, - PHRASE=11, NUMBER=12, ID=13, WS=14; + PHRASE=11, ID=12, WS=13; public static final int RULE_query = 0, RULE_operatorExpression = 1, RULE_booleanOperator = 2, RULE_notExpression = 3, RULE_primaryExpression = 4, RULE_comparisonExpression = 5, RULE_keyValueExpression = 6, RULE_tokenSearch = 7, RULE_groupExpression = 8, - RULE_groupContent = 9, RULE_field = 10, RULE_rangeValue = 11, RULE_value = 12, - RULE_comparisonOperator = 13; + RULE_groupContent = 9, RULE_field = 10, RULE_value = 11, RULE_comparisonOperator = 12; private static String[] makeRuleNames() { return new String[] { "query", "operatorExpression", "booleanOperator", "notExpression", "primaryExpression", "comparisonExpression", "keyValueExpression", "tokenSearch", "groupExpression", - "groupContent", "field", "rangeValue", "value", "comparisonOperator" + "groupContent", "field", "value", "comparisonOperator" }; } public static final String[] ruleNames = makeRuleNames(); @@ -42,7 +41,7 @@ private static String[] makeLiteralNames() { private static String[] makeSymbolicNames() { return new String[] { null, "OR", "AND", "NOT", "GT", "LT", "GE", "LE", "EQ", "LPAREN", "RPAREN", - "PHRASE", "NUMBER", "ID", "WS" + "PHRASE", "ID", "WS" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); @@ -113,7 +112,7 @@ public final QueryContext query() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(28); + setState(26); operatorExpression(); } } @@ -155,21 +154,21 @@ public final OperatorExpressionContext operatorExpression() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(30); + setState(28); notExpression(); - setState(36); + setState(34); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR || _la==AND) { { { - setState(31); + setState(29); booleanOperator(); - setState(32); + setState(30); notExpression(); } } - setState(38); + setState(36); _errHandler.sync(this); _la = _input.LA(1); } @@ -203,7 +202,7 @@ public final BooleanOperatorContext booleanOperator() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(39); + setState(37); _la = _input.LA(1); if ( !(_la==OR || _la==AND) ) { _errHandler.recoverInline(this); @@ -245,17 +244,17 @@ public final NotExpressionContext notExpression() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(42); + setState(40); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(41); + setState(39); match(NOT); } } - setState(44); + setState(42); primaryExpression(); } } @@ -296,38 +295,38 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState()); enterRule(_localctx, 8, RULE_primaryExpression); try { - setState(53); + setState(51); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(46); + setState(44); match(LPAREN); - setState(47); + setState(45); query(); - setState(48); + setState(46); match(RPAREN); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(50); + setState(48); comparisonExpression(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(51); + setState(49); keyValueExpression(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(52); + setState(50); tokenSearch(); } break; @@ -352,8 +351,8 @@ public FieldContext field() { public ComparisonOperatorContext comparisonOperator() { return getRuleContext(ComparisonOperatorContext.class,0); } - public RangeValueContext rangeValue() { - return getRuleContext(RangeValueContext.class,0); + public ValueContext value() { + return getRuleContext(ValueContext.class,0); } public ComparisonExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); @@ -367,12 +366,12 @@ public final ComparisonExpressionContext comparisonExpression() throws Recogniti try { enterOuterAlt(_localctx, 1); { - setState(55); + setState(53); field(); - setState(56); + setState(54); comparisonOperator(); - setState(57); - rangeValue(); + setState(55); + value(); } } catch (RecognitionException re) { @@ -410,24 +409,23 @@ public final KeyValueExpressionContext keyValueExpression() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(59); + setState(57); field(); - setState(60); + setState(58); match(EQ); - setState(63); + setState(61); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: - case NUMBER: case ID: { - setState(61); + setState(59); value(); } break; case LPAREN: { - setState(62); + setState(60); groupExpression(); } break; @@ -466,19 +464,19 @@ public final TokenSearchContext tokenSearch() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(65); + setState(63); match(ID); - setState(69); + setState(67); _errHandler.sync(this); _la = _input.LA(1); while (_la==ID) { { { - setState(66); + setState(64); match(ID); } } - setState(71); + setState(69); _errHandler.sync(this); _la = _input.LA(1); } @@ -530,17 +528,17 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(72); + setState(70); match(LPAREN); - setState(73); + setState(71); groupContent(); - setState(81); + setState(79); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR || _la==AND) { { { - setState(74); + setState(72); _la = _input.LA(1); if ( !(_la==OR || _la==AND) ) { _errHandler.recoverInline(this); @@ -551,26 +549,26 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio consume(); } { - setState(76); + setState(74); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(75); + setState(73); match(NOT); } } } - setState(78); + setState(76); groupContent(); } } - setState(83); + setState(81); _errHandler.sync(this); _la = _input.LA(1); } - setState(84); + setState(82); match(RPAREN); } } @@ -603,22 +601,21 @@ public final GroupContentContext groupContent() throws RecognitionException { GroupContentContext _localctx = new GroupContentContext(_ctx, getState()); enterRule(_localctx, 18, RULE_groupContent); try { - setState(88); + setState(86); _errHandler.sync(this); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(86); + setState(84); groupExpression(); } break; case PHRASE: - case NUMBER: case ID: enterOuterAlt(_localctx, 2); { - setState(87); + setState(85); value(); } break; @@ -652,7 +649,7 @@ public final FieldContext field() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(90); + setState(88); match(ID); } } @@ -667,50 +664,9 @@ public final FieldContext field() throws RecognitionException { return _localctx; } - @SuppressWarnings("CheckReturnValue") - public static class RangeValueContext extends ParserRuleContext { - public TerminalNode NUMBER() { return getToken(DQLParser.NUMBER, 0); } - public TerminalNode PHRASE() { return getToken(DQLParser.PHRASE, 0); } - public RangeValueContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_rangeValue; } - } - - public final RangeValueContext rangeValue() throws RecognitionException { - RangeValueContext _localctx = new RangeValueContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_rangeValue); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(92); - _la = _input.LA(1); - if ( !(_la==PHRASE || _la==NUMBER) ) { - _errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - @SuppressWarnings("CheckReturnValue") public static class ValueContext extends ParserRuleContext { public TerminalNode PHRASE() { return getToken(DQLParser.PHRASE, 0); } - public TerminalNode NUMBER() { return getToken(DQLParser.NUMBER, 0); } public TokenSearchContext tokenSearch() { return getRuleContext(TokenSearchContext.class,0); } @@ -722,29 +678,22 @@ public ValueContext(ParserRuleContext parent, int invokingState) { public final ValueContext value() throws RecognitionException { ValueContext _localctx = new ValueContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_value); + enterRule(_localctx, 22, RULE_value); try { - setState(97); + setState(92); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: enterOuterAlt(_localctx, 1); { - setState(94); + setState(90); match(PHRASE); } break; - case NUMBER: - enterOuterAlt(_localctx, 2); - { - setState(95); - match(NUMBER); - } - break; case ID: - enterOuterAlt(_localctx, 3); + enterOuterAlt(_localctx, 2); { - setState(96); + setState(91); tokenSearch(); } break; @@ -777,12 +726,12 @@ public ComparisonOperatorContext(ParserRuleContext parent, int invokingState) { public final ComparisonOperatorContext comparisonOperator() throws RecognitionException { ComparisonOperatorContext _localctx = new ComparisonOperatorContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_comparisonOperator); + enterRule(_localctx, 24, RULE_comparisonOperator); int _la; try { enterOuterAlt(_localctx, 1); { - setState(99); + setState(94); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 240L) != 0)) ) { _errHandler.recoverInline(this); @@ -806,61 +755,58 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx } public static final String _serializedATN = - "\u0004\u0001\u000ef\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u0001\ra\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ - "\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001"+ - "\u0001\u0001\u0001\u0001\u0005\u0001#\b\u0001\n\u0001\f\u0001&\t\u0001"+ - "\u0001\u0002\u0001\u0002\u0001\u0003\u0003\u0003+\b\u0003\u0001\u0003"+ - "\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+ - "\u0001\u0004\u0001\u0004\u0003\u00046\b\u0004\u0001\u0005\u0001\u0005"+ - "\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ - "\u0003\u0006@\b\u0006\u0001\u0007\u0001\u0007\u0005\u0007D\b\u0007\n\u0007"+ - "\f\u0007G\t\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bM\b\b\u0001\b"+ - "\u0005\bP\b\b\n\b\f\bS\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\tY\b"+ - "\t\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0003"+ - "\fb\b\f\u0001\r\u0001\r\u0001\r\u0000\u0000\u000e\u0000\u0002\u0004\u0006"+ - "\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u0000\u0003\u0001\u0000"+ - "\u0001\u0002\u0001\u0000\u000b\f\u0001\u0000\u0004\u0007c\u0000\u001c"+ - "\u0001\u0000\u0000\u0000\u0002\u001e\u0001\u0000\u0000\u0000\u0004\'\u0001"+ - "\u0000\u0000\u0000\u0006*\u0001\u0000\u0000\u0000\b5\u0001\u0000\u0000"+ - "\u0000\n7\u0001\u0000\u0000\u0000\f;\u0001\u0000\u0000\u0000\u000eA\u0001"+ - "\u0000\u0000\u0000\u0010H\u0001\u0000\u0000\u0000\u0012X\u0001\u0000\u0000"+ - "\u0000\u0014Z\u0001\u0000\u0000\u0000\u0016\\\u0001\u0000\u0000\u0000"+ - "\u0018a\u0001\u0000\u0000\u0000\u001ac\u0001\u0000\u0000\u0000\u001c\u001d"+ - "\u0003\u0002\u0001\u0000\u001d\u0001\u0001\u0000\u0000\u0000\u001e$\u0003"+ - "\u0006\u0003\u0000\u001f \u0003\u0004\u0002\u0000 !\u0003\u0006\u0003"+ - "\u0000!#\u0001\u0000\u0000\u0000\"\u001f\u0001\u0000\u0000\u0000#&\u0001"+ - "\u0000\u0000\u0000$\"\u0001\u0000\u0000\u0000$%\u0001\u0000\u0000\u0000"+ - "%\u0003\u0001\u0000\u0000\u0000&$\u0001\u0000\u0000\u0000\'(\u0007\u0000"+ - "\u0000\u0000(\u0005\u0001\u0000\u0000\u0000)+\u0005\u0003\u0000\u0000"+ - "*)\u0001\u0000\u0000\u0000*+\u0001\u0000\u0000\u0000+,\u0001\u0000\u0000"+ - "\u0000,-\u0003\b\u0004\u0000-\u0007\u0001\u0000\u0000\u0000./\u0005\t"+ - "\u0000\u0000/0\u0003\u0000\u0000\u000001\u0005\n\u0000\u000016\u0001\u0000"+ - "\u0000\u000026\u0003\n\u0005\u000036\u0003\f\u0006\u000046\u0003\u000e"+ - "\u0007\u00005.\u0001\u0000\u0000\u000052\u0001\u0000\u0000\u000053\u0001"+ - "\u0000\u0000\u000054\u0001\u0000\u0000\u00006\t\u0001\u0000\u0000\u0000"+ - "78\u0003\u0014\n\u000089\u0003\u001a\r\u00009:\u0003\u0016\u000b\u0000"+ - ":\u000b\u0001\u0000\u0000\u0000;<\u0003\u0014\n\u0000@\u0003\u0010\b\u0000?=\u0001\u0000\u0000"+ - "\u0000?>\u0001\u0000\u0000\u0000@\r\u0001\u0000\u0000\u0000AE\u0005\r"+ - "\u0000\u0000BD\u0005\r\u0000\u0000CB\u0001\u0000\u0000\u0000DG\u0001\u0000"+ - "\u0000\u0000EC\u0001\u0000\u0000\u0000EF\u0001\u0000\u0000\u0000F\u000f"+ - "\u0001\u0000\u0000\u0000GE\u0001\u0000\u0000\u0000HI\u0005\t\u0000\u0000"+ - "IQ\u0003\u0012\t\u0000JL\u0007\u0000\u0000\u0000KM\u0005\u0003\u0000\u0000"+ - "LK\u0001\u0000\u0000\u0000LM\u0001\u0000\u0000\u0000MN\u0001\u0000\u0000"+ - "\u0000NP\u0003\u0012\t\u0000OJ\u0001\u0000\u0000\u0000PS\u0001\u0000\u0000"+ - "\u0000QO\u0001\u0000\u0000\u0000QR\u0001\u0000\u0000\u0000RT\u0001\u0000"+ - "\u0000\u0000SQ\u0001\u0000\u0000\u0000TU\u0005\n\u0000\u0000U\u0011\u0001"+ - "\u0000\u0000\u0000VY\u0003\u0010\b\u0000WY\u0003\u0018\f\u0000XV\u0001"+ - "\u0000\u0000\u0000XW\u0001\u0000\u0000\u0000Y\u0013\u0001\u0000\u0000"+ - "\u0000Z[\u0005\r\u0000\u0000[\u0015\u0001\u0000\u0000\u0000\\]\u0007\u0001"+ - "\u0000\u0000]\u0017\u0001\u0000\u0000\u0000^b\u0005\u000b\u0000\u0000"+ - "_b\u0005\f\u0000\u0000`b\u0003\u000e\u0007\u0000a^\u0001\u0000\u0000\u0000"+ - "a_\u0001\u0000\u0000\u0000a`\u0001\u0000\u0000\u0000b\u0019\u0001\u0000"+ - "\u0000\u0000cd\u0007\u0002\u0000\u0000d\u001b\u0001\u0000\u0000\u0000"+ - "\t$*5?ELQXa"; + "\f\u0007\f\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001"+ + "\u0001\u0001\u0005\u0001!\b\u0001\n\u0001\f\u0001$\t\u0001\u0001\u0002"+ + "\u0001\u0002\u0001\u0003\u0003\u0003)\b\u0003\u0001\u0003\u0001\u0003"+ + "\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+ + "\u0001\u0004\u0003\u00044\b\u0004\u0001\u0005\u0001\u0005\u0001\u0005"+ + "\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0003\u0006"+ + ">\b\u0006\u0001\u0007\u0001\u0007\u0005\u0007B\b\u0007\n\u0007\f\u0007"+ + "E\t\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bK\b\b\u0001\b\u0005\b"+ + "N\b\b\n\b\f\bQ\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\tW\b\t\u0001"+ + "\n\u0001\n\u0001\u000b\u0001\u000b\u0003\u000b]\b\u000b\u0001\f\u0001"+ + "\f\u0001\f\u0000\u0000\r\u0000\u0002\u0004\u0006\b\n\f\u000e\u0010\u0012"+ + "\u0014\u0016\u0018\u0000\u0002\u0001\u0000\u0001\u0002\u0001\u0000\u0004"+ + "\u0007^\u0000\u001a\u0001\u0000\u0000\u0000\u0002\u001c\u0001\u0000\u0000"+ + "\u0000\u0004%\u0001\u0000\u0000\u0000\u0006(\u0001\u0000\u0000\u0000\b"+ + "3\u0001\u0000\u0000\u0000\n5\u0001\u0000\u0000\u0000\f9\u0001\u0000\u0000"+ + "\u0000\u000e?\u0001\u0000\u0000\u0000\u0010F\u0001\u0000\u0000\u0000\u0012"+ + "V\u0001\u0000\u0000\u0000\u0014X\u0001\u0000\u0000\u0000\u0016\\\u0001"+ + "\u0000\u0000\u0000\u0018^\u0001\u0000\u0000\u0000\u001a\u001b\u0003\u0002"+ + "\u0001\u0000\u001b\u0001\u0001\u0000\u0000\u0000\u001c\"\u0003\u0006\u0003"+ + "\u0000\u001d\u001e\u0003\u0004\u0002\u0000\u001e\u001f\u0003\u0006\u0003"+ + "\u0000\u001f!\u0001\u0000\u0000\u0000 \u001d\u0001\u0000\u0000\u0000!"+ + "$\u0001\u0000\u0000\u0000\" \u0001\u0000\u0000\u0000\"#\u0001\u0000\u0000"+ + "\u0000#\u0003\u0001\u0000\u0000\u0000$\"\u0001\u0000\u0000\u0000%&\u0007"+ + "\u0000\u0000\u0000&\u0005\u0001\u0000\u0000\u0000\')\u0005\u0003\u0000"+ + "\u0000(\'\u0001\u0000\u0000\u0000()\u0001\u0000\u0000\u0000)*\u0001\u0000"+ + "\u0000\u0000*+\u0003\b\u0004\u0000+\u0007\u0001\u0000\u0000\u0000,-\u0005"+ + "\t\u0000\u0000-.\u0003\u0000\u0000\u0000./\u0005\n\u0000\u0000/4\u0001"+ + "\u0000\u0000\u000004\u0003\n\u0005\u000014\u0003\f\u0006\u000024\u0003"+ + "\u000e\u0007\u00003,\u0001\u0000\u0000\u000030\u0001\u0000\u0000\u0000"+ + "31\u0001\u0000\u0000\u000032\u0001\u0000\u0000\u00004\t\u0001\u0000\u0000"+ + "\u000056\u0003\u0014\n\u000067\u0003\u0018\f\u000078\u0003\u0016\u000b"+ + "\u00008\u000b\u0001\u0000\u0000\u00009:\u0003\u0014\n\u0000:=\u0005\b"+ + "\u0000\u0000;>\u0003\u0016\u000b\u0000<>\u0003\u0010\b\u0000=;\u0001\u0000"+ + "\u0000\u0000=<\u0001\u0000\u0000\u0000>\r\u0001\u0000\u0000\u0000?C\u0005"+ + "\f\u0000\u0000@B\u0005\f\u0000\u0000A@\u0001\u0000\u0000\u0000BE\u0001"+ + "\u0000\u0000\u0000CA\u0001\u0000\u0000\u0000CD\u0001\u0000\u0000\u0000"+ + "D\u000f\u0001\u0000\u0000\u0000EC\u0001\u0000\u0000\u0000FG\u0005\t\u0000"+ + "\u0000GO\u0003\u0012\t\u0000HJ\u0007\u0000\u0000\u0000IK\u0005\u0003\u0000"+ + "\u0000JI\u0001\u0000\u0000\u0000JK\u0001\u0000\u0000\u0000KL\u0001\u0000"+ + "\u0000\u0000LN\u0003\u0012\t\u0000MH\u0001\u0000\u0000\u0000NQ\u0001\u0000"+ + "\u0000\u0000OM\u0001\u0000\u0000\u0000OP\u0001\u0000\u0000\u0000PR\u0001"+ + "\u0000\u0000\u0000QO\u0001\u0000\u0000\u0000RS\u0005\n\u0000\u0000S\u0011"+ + "\u0001\u0000\u0000\u0000TW\u0003\u0010\b\u0000UW\u0003\u0016\u000b\u0000"+ + "VT\u0001\u0000\u0000\u0000VU\u0001\u0000\u0000\u0000W\u0013\u0001\u0000"+ + "\u0000\u0000XY\u0005\f\u0000\u0000Y\u0015\u0001\u0000\u0000\u0000Z]\u0005"+ + "\u000b\u0000\u0000[]\u0003\u000e\u0007\u0000\\Z\u0001\u0000\u0000\u0000"+ + "\\[\u0001\u0000\u0000\u0000]\u0017\u0001\u0000\u0000\u0000^_\u0007\u0001"+ + "\u0000\u0000_\u0019\u0001\u0000\u0000\u0000\t\"(3=CJOV\\"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens index 24439db0066c..d9da629fcca1 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.tokens @@ -9,9 +9,8 @@ EQ=8 LPAREN=9 RPAREN=10 PHRASE=11 -NUMBER=12 -ID=13 -WS=14 +ID=12 +WS=13 '>'=4 '<'=5 '>='=6 diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 index be4b9b99d7d0..1ff71a3e6dd5 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLLexer.g4 @@ -18,8 +18,7 @@ RPAREN: ')'; // Literals PHRASE: '"' (~["\\])* '"'?; -NUMBER: '-'? [0-9]+ ('.' [0-9]+)?; -ID: [a-zA-Z_*][a-zA-Z0-9_.*]*; +ID: [a-zA-Z0-9_*][a-zA-Z0-9_*.]*; // SKIP WS: [ \t\r\n]+ -> channel(HIDDEN); \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index 024c22c04764..eb01f42eacf6 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -29,7 +29,7 @@ primaryExpression ; comparisonExpression - : field comparisonOperator rangeValue + : field comparisonOperator value ; keyValueExpression @@ -53,14 +53,8 @@ field : ID ; -rangeValue - : NUMBER - | PHRASE - ; - value : PHRASE - | NUMBER | tokenSearch ; From 0654f07fc864bb55df361b7ce34f2a4fe3d7b391 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Fri, 19 Jul 2024 13:44:29 -0700 Subject: [PATCH 18/34] fix cursor import and clean up Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 35 +++++++------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index d1fa6a2ed500..bd67b163628a 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,10 +1,10 @@ import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; import { DQLLexer } from './generated/DQLLexer'; -import { DQLParser, KeyValueExpressionContext } from './generated/DQLParser'; +import { DQLParser, GroupContentContext, KeyValueExpressionContext } from './generated/DQLParser'; import { CodeCompletionCore } from 'antlr4-c3'; -import { getTokenPosition } from '../opensearch_sql/cursor'; +import { getTokenPosition } from '../shared/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; -import { CursorPosition } from '../opensearch_sql/types'; +import { CursorPosition } from '../shared/types'; import { getHttp } from '../../services'; import { QuerySuggestionGetFnArgs } from '../../autocomplete'; import { DQLParserVisitor } from './generated/DQLParserVisitor'; @@ -21,7 +21,6 @@ const findCursorIndex = ( const token = tokenStream.get(i); const { startLine, endColumn, endLine } = getTokenPosition(token, whitespaceToken); - // endColumn makes sense only if startLine === endLine if (endLine > cursor.line || (startLine === cursor.line && endColumn > cursorCol)) { if (actualIndex) { return i; @@ -91,26 +90,18 @@ const findValueSuggestions = async (index: IndexPattern, field: string, value: s class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { public visitKeyValueExpression = (ctx: KeyValueExpressionContext) => { let foundValue = ''; + const getTextWithoutQuotes = (text: string | undefined) => text?.replace(/^["']|["']$/g, ''); if (ctx.value()?.PHRASE()) { - const strippedPhrase = ctx - .value() - ?.PHRASE() - ?.getText() - .replace(/^["']|["']$/g, ''); - if (strippedPhrase) foundValue = strippedPhrase; - } - if (ctx.value()?.tokenSearch()) { + const phraseText = getTextWithoutQuotes(ctx.value()?.PHRASE()?.getText()); + if (phraseText) foundValue = phraseText; + } else if (ctx.value()?.tokenSearch()) { const valueText = ctx.value()?.getText(); if (valueText) foundValue = valueText; - } - if (ctx.groupExpression()) { - const lastGroupContent = ctx - .groupExpression() - ?.groupContent() - .at(-1) - ?.getText() - .replace(/^["']|["']$/g, ''); + } else if (ctx.groupExpression()) { + const lastGroupContent = getTextWithoutQuotes( + ctx.groupExpression()?.groupContent().at(-1)?.getText() + ); if (lastGroupContent) foundValue = lastGroupContent; } return { field: ctx.field().getText(), value: foundValue }; @@ -165,10 +156,8 @@ export const getSuggestions = async ({ completions.push(...findFieldSuggestions(currentIndexPattern)); } - // find suggested values for the last found field + // find suggested values for the last found field (only for kvexpression rule) const { field: lastField = '', value: lastValue = '' } = visitor.visit(tree) ?? {}; - console.log('lastField: ', lastField); - console.log('lastValue: ', lastValue); if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { const values = await findValueSuggestions(currentIndexPattern, lastField, lastValue ?? ''); completions.push( From b2c7b5af573ded63edba7ebc6ac5a2325c59f132 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Fri, 19 Jul 2024 14:21:38 -0700 Subject: [PATCH 19/34] fix completion item range to be current word Signed-off-by: Paul Sebastian --- src/plugins/data/public/plugin.ts | 2 -- .../data/public/ui/query_editor/query_editor.tsx | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index c1adc7df9f37..74b2c3d104cb 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -95,7 +95,6 @@ import { registerDefaultDataSource } from './data_sources/register_default_datas import { DefaultDslDataSource } from './data_sources/default_datasource'; import { DEFAULT_DATA_SOURCE_TYPE } from './data_sources/constants'; import { getSuggestions as getSQLSuggestions } from './antlr/opensearch_sql/code_completion'; -import { getSuggestions as getPPLSuggestions } from './antlr/opensearch_ppl/code_completion'; import { getSuggestions as getDQLSuggestions } from './antlr/dql/code_completion'; declare module '../../ui_actions/public' { @@ -170,7 +169,6 @@ export class DataPublicPlugin const uiService = this.uiService.setup(core, {}); const ac = this.autocomplete.setup(core); - ac.addQuerySuggestionProvider('PPL', getPPLSuggestions); ac.addQuerySuggestionProvider('SQL', getSQLSuggestions); ac.addQuerySuggestionProvider('kuery', getDQLSuggestions); diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index adccf7a1f46b..a2c7f3214b7e 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -328,6 +328,15 @@ export default class QueryEditorUI extends Component { connectionService, }); + // current completion item range being given as last 'word' at pos + const wordUntil = model.getWordUntilPosition(position); + const range = new monaco.Range( + position.lineNumber, + wordUntil.startColumn, + position.lineNumber, + wordUntil.endColumn + ); + return { suggestions: suggestions && suggestions.length > 0 @@ -335,7 +344,7 @@ export default class QueryEditorUI extends Component { label: s.text, kind: this.getCodeEditorSuggestionsType(s.type), insertText: s.text, - range: wordRange, + range, })) : [], incomplete: false, From 345d679a04d3a53269b013fcea4c300b47657339 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Fri, 19 Jul 2024 17:18:23 -0700 Subject: [PATCH 20/34] update cursor to use monaco position Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 47 ++++++++++++++----- .../public/ui/query_editor/query_editor.tsx | 7 --- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index bd67b163628a..b1fce6c6bc07 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -12,20 +12,26 @@ import { DQLParserVisitor } from './generated/DQLParserVisitor'; const findCursorIndex = ( tokenStream: TokenStream, cursor: CursorPosition, - whitespaceToken: number, - actualIndex?: boolean + whitespaceToken: number ): number | undefined => { + console.clear(); + + console.log('cursor:', cursor); + const cursorCol = cursor.column - 1; for (let i = 0; i < tokenStream.size; i++) { const token = tokenStream.get(i); + console.log('======================================================'); + console.log('token:', token); + console.log('tokenIndex:', token.tokenIndex); + console.log('token:', token.text); + console.log('start:', token.start); + console.log('stop:', token.stop); const { startLine, endColumn, endLine } = getTokenPosition(token, whitespaceToken); + console.log('token position:', getTokenPosition(token, whitespaceToken)); - if (endLine > cursor.line || (startLine === cursor.line && endColumn > cursorCol)) { - if (actualIndex) { - return i; - } - + if (endLine > cursor.line || (startLine === cursor.line && endColumn >= cursorCol)) { if (tokenStream.get(i).type === whitespaceToken) { return i + 1; } @@ -109,11 +115,10 @@ class QueryVisitor extends DQLParserVisitor<{ field: string; value: string }> { } export const getSuggestions = async ({ - selectionStart, - selectionEnd, query, - language, indexPatterns, + position, + selectionStart, }: QuerySuggestionGetFnArgs) => { const currentIndexPattern = indexPatterns[0] as IndexPattern; @@ -128,7 +133,27 @@ export const getSuggestions = async ({ // find token index const cursorIndex = - findCursorIndex(tokenStream, { line: 1, column: selectionStart }, DQLParser.WS) ?? 0; + findCursorIndex( + tokenStream, + { + line: position.lineNumber, + column: position.column, + }, + DQLParser.WS + ) ?? 0; + + // const cursorIndex = + // findCursorIndex( + // tokenStream, + // { + // line: 1, + // column: selectionStart, + // }, + // DQLParser.WS + // ) ?? 0; + + console.log('================================'); + console.log('final cursor index:', cursorIndex); const core = new CodeCompletionCore(parser); diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index a2c7f3214b7e..48d490fa21fb 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -309,13 +309,6 @@ export default class QueryEditorUI extends Component { model: monaco.editor.ITextModel, position: monaco.Position ): Promise => { - const wordUntil = model.getWordUntilPosition(position); - const wordRange = new monaco.Range( - position.lineNumber, - wordUntil.startColumn, - position.lineNumber, - wordUntil.endColumn - ); const enhancements = this.props.settings.getQueryEnhancements(this.props.query.language); const connectionService = enhancements?.connectionService; const suggestions = await this.services.data.autocomplete.getQuerySuggestions({ From 229f43201cba8411a03b06b809a7fc467f697729 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Fri, 19 Jul 2024 17:21:55 -0700 Subject: [PATCH 21/34] cursor index to use position directly Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 46 ++++--------------- 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index b1fce6c6bc07..546eab2b1a5a 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,37 +1,29 @@ import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; import { DQLLexer } from './generated/DQLLexer'; -import { DQLParser, GroupContentContext, KeyValueExpressionContext } from './generated/DQLParser'; +import { DQLParser, KeyValueExpressionContext } from './generated/DQLParser'; import { CodeCompletionCore } from 'antlr4-c3'; import { getTokenPosition } from '../shared/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; -import { CursorPosition } from '../shared/types'; import { getHttp } from '../../services'; import { QuerySuggestionGetFnArgs } from '../../autocomplete'; import { DQLParserVisitor } from './generated/DQLParserVisitor'; +import { monaco } from 'packages/osd-monaco/target'; const findCursorIndex = ( tokenStream: TokenStream, - cursor: CursorPosition, + cursor: monaco.Position, whitespaceToken: number ): number | undefined => { - console.clear(); - - console.log('cursor:', cursor); - const cursorCol = cursor.column - 1; for (let i = 0; i < tokenStream.size; i++) { const token = tokenStream.get(i); - console.log('======================================================'); - console.log('token:', token); - console.log('tokenIndex:', token.tokenIndex); - console.log('token:', token.text); - console.log('start:', token.start); - console.log('stop:', token.stop); const { startLine, endColumn, endLine } = getTokenPosition(token, whitespaceToken); - console.log('token position:', getTokenPosition(token, whitespaceToken)); - if (endLine > cursor.line || (startLine === cursor.line && endColumn >= cursorCol)) { + if ( + endLine > cursor.lineNumber || + (startLine === cursor.lineNumber && endColumn >= cursorCol) + ) { if (tokenStream.get(i).type === whitespaceToken) { return i + 1; } @@ -118,7 +110,6 @@ export const getSuggestions = async ({ query, indexPatterns, position, - selectionStart, }: QuerySuggestionGetFnArgs) => { const currentIndexPattern = indexPatterns[0] as IndexPattern; @@ -132,28 +123,7 @@ export const getSuggestions = async ({ const visitor = new QueryVisitor(); // find token index - const cursorIndex = - findCursorIndex( - tokenStream, - { - line: position.lineNumber, - column: position.column, - }, - DQLParser.WS - ) ?? 0; - - // const cursorIndex = - // findCursorIndex( - // tokenStream, - // { - // line: 1, - // column: selectionStart, - // }, - // DQLParser.WS - // ) ?? 0; - - console.log('================================'); - console.log('final cursor index:', cursorIndex); + const cursorIndex = findCursorIndex(tokenStream, position, DQLParser.WS) ?? 0; const core = new CodeCompletionCore(parser); From bb61057fa042681965b571586db0e673163c79bd Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Mon, 22 Jul 2024 13:36:43 -0700 Subject: [PATCH 22/34] move language registration into render function to handle new languages Signed-off-by: Paul Sebastian --- .../public/code_editor/code_editor.tsx | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx b/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx index 26ab5b482a48..cbad0842d9b6 100644 --- a/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx +++ b/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx @@ -127,33 +127,6 @@ export class CodeEditor extends React.Component { this.props.editorWillMount(); } - // TEMPORARY fix for suggestion providor not appear for more than one language - ['SQL', 'kuery'].forEach((language) => { - monaco.languages.onLanguage(language, () => { - if (this.props.suggestionProvider) { - monaco.languages.registerCompletionItemProvider(language, this.props.suggestionProvider); - } - - if (this.props.signatureProvider) { - monaco.languages.registerSignatureHelpProvider( - this.props.languageId, - this.props.signatureProvider - ); - } - - if (this.props.hoverProvider) { - monaco.languages.registerHoverProvider(this.props.languageId, this.props.hoverProvider); - } - - if (this.props.languageConfiguration) { - monaco.languages.setLanguageConfiguration( - this.props.languageId, - this.props.languageConfiguration - ); - } - }); - }); - // Register the theme monaco.editor.defineTheme('euiColors', this.props.useDarkTheme ? DARK_THEME : LIGHT_THEME); }; @@ -173,6 +146,27 @@ export class CodeEditor extends React.Component { render() { const { languageId, value, onChange, width, height, options } = this.props; + monaco.languages.onLanguage(languageId, () => { + if (this.props.suggestionProvider) { + monaco.languages.registerCompletionItemProvider(languageId, this.props.suggestionProvider); + } + + if (this.props.signatureProvider) { + monaco.languages.registerSignatureHelpProvider(languageId, this.props.signatureProvider); + } + + if (this.props.hoverProvider) { + monaco.languages.registerHoverProvider(languageId, this.props.hoverProvider); + } + + if (this.props.languageConfiguration) { + monaco.languages.setLanguageConfiguration( + this.props.languageId, + this.props.languageConfiguration + ); + } + }); + return ( Date: Mon, 22 Jul 2024 13:58:04 -0700 Subject: [PATCH 23/34] include auto closing quotes and parenthesis for dql Signed-off-by: Paul Sebastian --- .../public/ui/query_editor/query_editor.tsx | 13 ++++++++++ .../public/code_editor/code_editor.tsx | 25 +++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index 48d490fa21fb..fa7dd36e445e 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -513,6 +513,19 @@ export default class QueryEditorUI extends Component { suggestionProvider={{ provideCompletionItems: this.provideCompletionItems, }} + languageConfiguration={{ + language: LANGUAGE_ID_KUERY, + autoClosingPairs: [ + { + open: '(', + close: ')', + }, + { + open: '"', + close: '"', + }, + ], + }} /> )} diff --git a/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx b/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx index cbad0842d9b6..bc3a330c6081 100644 --- a/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx +++ b/src/plugins/opensearch_dashboards_react/public/code_editor/code_editor.tsx @@ -38,6 +38,14 @@ import { LIGHT_THEME, DARK_THEME } from './editor_theme'; import './editor.scss'; +export interface LanguageSpecifiedConfiguration extends monaco.languages.LanguageConfiguration { + /** + * The language ID, meant to restrict the specified configuration for only this language. When + * not provided, will apply the language configuration for every language. + */ + language?: string; +} + export interface Props { /** Width of editor. Defaults to 100%. */ width?: string | number; @@ -87,7 +95,7 @@ export interface Props { * Documentation for the provider can be found here: * https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.languageconfiguration.html */ - languageConfiguration?: monaco.languages.LanguageConfiguration; + languageConfiguration?: LanguageSpecifiedConfiguration; /** * Function called before the editor is mounted in the view @@ -160,10 +168,17 @@ export class CodeEditor extends React.Component { } if (this.props.languageConfiguration) { - monaco.languages.setLanguageConfiguration( - this.props.languageId, - this.props.languageConfiguration - ); + // if the language isn't specified or the language configuration specified language + // matches, use the configuration + if ( + !this.props.languageConfiguration.language || + this.props.languageConfiguration.language === languageId + ) { + monaco.languages.setLanguageConfiguration( + this.props.languageId, + this.props.languageConfiguration + ); + } } }); From 9b17c9641a2446795679455dd81fcf23da0a4dbd Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Mon, 22 Jul 2024 14:03:40 -0700 Subject: [PATCH 24/34] rename generated file Signed-off-by: Paul Sebastian --- .../antlr/dql/{generated => .generated}/DQLLexer.interp | 0 .../antlr/dql/{generated => .generated}/DQLLexer.tokens | 0 .../public/antlr/dql/{generated => .generated}/DQLLexer.ts | 0 .../antlr/dql/{generated => .generated}/DQLParser.interp | 0 .../antlr/dql/{generated => .generated}/DQLParser.tokens | 0 .../public/antlr/dql/{generated => .generated}/DQLParser.ts | 0 .../dql/{generated => .generated}/DQLParserListener.ts | 0 .../antlr/dql/{generated => .generated}/DQLParserVisitor.ts | 0 src/plugins/data/public/antlr/dql/code_completion.ts | 6 +++--- 9 files changed, 3 insertions(+), 3 deletions(-) rename src/plugins/data/public/antlr/dql/{generated => .generated}/DQLLexer.interp (100%) rename src/plugins/data/public/antlr/dql/{generated => .generated}/DQLLexer.tokens (100%) rename src/plugins/data/public/antlr/dql/{generated => .generated}/DQLLexer.ts (100%) rename src/plugins/data/public/antlr/dql/{generated => .generated}/DQLParser.interp (100%) rename src/plugins/data/public/antlr/dql/{generated => .generated}/DQLParser.tokens (100%) rename src/plugins/data/public/antlr/dql/{generated => .generated}/DQLParser.ts (100%) rename src/plugins/data/public/antlr/dql/{generated => .generated}/DQLParserListener.ts (100%) rename src/plugins/data/public/antlr/dql/{generated => .generated}/DQLParserVisitor.ts (100%) diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.interp b/src/plugins/data/public/antlr/dql/.generated/DQLLexer.interp similarity index 100% rename from src/plugins/data/public/antlr/dql/generated/DQLLexer.interp rename to src/plugins/data/public/antlr/dql/.generated/DQLLexer.interp diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens b/src/plugins/data/public/antlr/dql/.generated/DQLLexer.tokens similarity index 100% rename from src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens rename to src/plugins/data/public/antlr/dql/.generated/DQLLexer.tokens diff --git a/src/plugins/data/public/antlr/dql/generated/DQLLexer.ts b/src/plugins/data/public/antlr/dql/.generated/DQLLexer.ts similarity index 100% rename from src/plugins/data/public/antlr/dql/generated/DQLLexer.ts rename to src/plugins/data/public/antlr/dql/.generated/DQLLexer.ts diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/.generated/DQLParser.interp similarity index 100% rename from src/plugins/data/public/antlr/dql/generated/DQLParser.interp rename to src/plugins/data/public/antlr/dql/.generated/DQLParser.interp diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.tokens b/src/plugins/data/public/antlr/dql/.generated/DQLParser.tokens similarity index 100% rename from src/plugins/data/public/antlr/dql/generated/DQLParser.tokens rename to src/plugins/data/public/antlr/dql/.generated/DQLParser.tokens diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts similarity index 100% rename from src/plugins/data/public/antlr/dql/generated/DQLParser.ts rename to src/plugins/data/public/antlr/dql/.generated/DQLParser.ts diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts b/src/plugins/data/public/antlr/dql/.generated/DQLParserListener.ts similarity index 100% rename from src/plugins/data/public/antlr/dql/generated/DQLParserListener.ts rename to src/plugins/data/public/antlr/dql/.generated/DQLParserListener.ts diff --git a/src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts b/src/plugins/data/public/antlr/dql/.generated/DQLParserVisitor.ts similarity index 100% rename from src/plugins/data/public/antlr/dql/generated/DQLParserVisitor.ts rename to src/plugins/data/public/antlr/dql/.generated/DQLParserVisitor.ts diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 546eab2b1a5a..db9e0c2513ee 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,12 +1,12 @@ import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; -import { DQLLexer } from './generated/DQLLexer'; -import { DQLParser, KeyValueExpressionContext } from './generated/DQLParser'; +import { DQLLexer } from './.generated/DQLLexer'; +import { DQLParser, KeyValueExpressionContext } from './.generated/DQLParser'; import { CodeCompletionCore } from 'antlr4-c3'; import { getTokenPosition } from '../shared/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; import { getHttp } from '../../services'; import { QuerySuggestionGetFnArgs } from '../../autocomplete'; -import { DQLParserVisitor } from './generated/DQLParserVisitor'; +import { DQLParserVisitor } from './.generated/DQLParserVisitor'; import { monaco } from 'packages/osd-monaco/target'; const findCursorIndex = ( From 4ad78390067ba5fcffc97a5b5b94907a780498f6 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Mon, 22 Jul 2024 20:15:29 -0700 Subject: [PATCH 25/34] include single line editor closing pairs Signed-off-by: Paul Sebastian --- .../providers/query_suggestion_provider.ts | 2 +- .../data/public/ui/query_editor/query_editor.tsx | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts index a1a7aef8a5e0..9eb180ce231b 100644 --- a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts +++ b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts @@ -52,7 +52,7 @@ export interface QuerySuggestionGetFnArgs { selectionEnd: number; signal?: AbortSignal; boolFilter?: any; - position?: monaco.Position; + position: monaco.Position; connectionService?: any; // will need to add type when ConnectionService is properly exposed from queryEnhancements } diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index fa7dd36e445e..9db89004d8ae 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -464,6 +464,19 @@ export default class QueryEditorUI extends Component { suggestionProvider={{ provideCompletionItems: this.provideCompletionItems, }} + languageConfiguration={{ + language: LANGUAGE_ID_KUERY, + autoClosingPairs: [ + { + open: '(', + close: ')', + }, + { + open: '"', + close: '"', + }, + ], + }} /> From a69b9e8040be50baa756f23c6f69b9f164a23a8b Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 03:24:01 +0000 Subject: [PATCH 26/34] Changeset file for PR #7391 created/updated --- changelogs/fragments/7391.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/7391.yml diff --git a/changelogs/fragments/7391.yml b/changelogs/fragments/7391.yml new file mode 100644 index 000000000000..7be3d1f7eaa9 --- /dev/null +++ b/changelogs/fragments/7391.yml @@ -0,0 +1,2 @@ +feat: +- DQL Autocomplete ([#7391](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7391)) \ No newline at end of file From b24ae8f0439ef0ef8ed5c6784b66a1596ec4d78c Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Mon, 22 Jul 2024 20:45:12 -0700 Subject: [PATCH 27/34] add license and fix linting Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index db9e0c2513ee..f0af21be54e7 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -1,13 +1,18 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; +import { CodeCompletionCore } from 'antlr4-c3'; +import { monaco } from '@osd/monaco'; import { DQLLexer } from './.generated/DQLLexer'; import { DQLParser, KeyValueExpressionContext } from './.generated/DQLParser'; -import { CodeCompletionCore } from 'antlr4-c3'; import { getTokenPosition } from '../shared/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; import { getHttp } from '../../services'; import { QuerySuggestionGetFnArgs } from '../../autocomplete'; import { DQLParserVisitor } from './.generated/DQLParserVisitor'; -import { monaco } from 'packages/osd-monaco/target'; const findCursorIndex = ( tokenStream: TokenStream, @@ -42,9 +47,11 @@ const findFieldSuggestions = (indexPattern: IndexPattern) => { return idxField.displayName; }); - const fieldSuggestions: { text: string; type: string }[] = fieldNames.map((field: string) => { - return { text: field, type: 'field' }; - }); + const fieldSuggestions: Array<{ text: string; type: string }> = fieldNames.map( + (field: string) => { + return { text: field, type: 'field' }; + } + ); return fieldSuggestions; }; @@ -144,7 +151,7 @@ export const getSuggestions = async ({ // gets candidates at specified token index const candidates = core.collectCandidates(cursorIndex); - let completions = []; + const completions = []; // check to see if field rule is a candidate. if so, suggest field names if (candidates.rules.has(DQLParser.RULE_field)) { From 39460ad3508645a939a8967d5868d43b46a50b38 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Tue, 23 Jul 2024 05:51:41 -0700 Subject: [PATCH 28/34] modify grammar Signed-off-by: Paul Sebastian --- .../antlr/dql/.generated/DQLParser.interp | 2 +- .../public/antlr/dql/.generated/DQLParser.ts | 228 +++++------------- .../antlr/dql/.generated/DQLParserListener.ts | 162 ------------- .../antlr/dql/grammar/.antlr/DQLParser.interp | 2 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 130 +++++----- .../public/antlr/dql/grammar/DQLParser.g4 | 2 +- 6 files changed, 130 insertions(+), 396 deletions(-) delete mode 100644 src/plugins/data/public/antlr/dql/.generated/DQLParserListener.ts diff --git a/src/plugins/data/public/antlr/dql/.generated/DQLParser.interp b/src/plugins/data/public/antlr/dql/.generated/DQLParser.interp index c8ac375c4e21..041e2baeae19 100644 --- a/src/plugins/data/public/antlr/dql/.generated/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/.generated/DQLParser.interp @@ -47,4 +47,4 @@ comparisonOperator atn: -[4, 1, 13, 97, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 33, 8, 1, 10, 1, 12, 1, 36, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 41, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 52, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 62, 8, 6, 1, 7, 1, 7, 5, 7, 66, 8, 7, 10, 7, 12, 7, 69, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 75, 8, 8, 1, 8, 5, 8, 78, 8, 8, 10, 8, 12, 8, 81, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 87, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 93, 8, 11, 1, 12, 1, 12, 1, 12, 0, 0, 13, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 0, 2, 1, 0, 1, 2, 1, 0, 4, 7, 94, 0, 26, 1, 0, 0, 0, 2, 28, 1, 0, 0, 0, 4, 37, 1, 0, 0, 0, 6, 40, 1, 0, 0, 0, 8, 51, 1, 0, 0, 0, 10, 53, 1, 0, 0, 0, 12, 57, 1, 0, 0, 0, 14, 63, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 94, 1, 0, 0, 0, 26, 27, 3, 2, 1, 0, 27, 1, 1, 0, 0, 0, 28, 34, 3, 6, 3, 0, 29, 30, 3, 4, 2, 0, 30, 31, 3, 6, 3, 0, 31, 33, 1, 0, 0, 0, 32, 29, 1, 0, 0, 0, 33, 36, 1, 0, 0, 0, 34, 32, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 3, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 37, 38, 7, 0, 0, 0, 38, 5, 1, 0, 0, 0, 39, 41, 5, 3, 0, 0, 40, 39, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 43, 3, 8, 4, 0, 43, 7, 1, 0, 0, 0, 44, 45, 5, 9, 0, 0, 45, 46, 3, 0, 0, 0, 46, 47, 5, 10, 0, 0, 47, 52, 1, 0, 0, 0, 48, 52, 3, 10, 5, 0, 49, 52, 3, 12, 6, 0, 50, 52, 3, 14, 7, 0, 51, 44, 1, 0, 0, 0, 51, 48, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 50, 1, 0, 0, 0, 52, 9, 1, 0, 0, 0, 53, 54, 3, 20, 10, 0, 54, 55, 3, 24, 12, 0, 55, 56, 3, 22, 11, 0, 56, 11, 1, 0, 0, 0, 57, 58, 3, 20, 10, 0, 58, 61, 5, 8, 0, 0, 59, 62, 3, 22, 11, 0, 60, 62, 3, 16, 8, 0, 61, 59, 1, 0, 0, 0, 61, 60, 1, 0, 0, 0, 62, 13, 1, 0, 0, 0, 63, 67, 5, 12, 0, 0, 64, 66, 5, 12, 0, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 15, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 9, 0, 0, 71, 79, 3, 18, 9, 0, 72, 74, 7, 0, 0, 0, 73, 75, 5, 3, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 3, 18, 9, 0, 77, 72, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 10, 0, 0, 83, 17, 1, 0, 0, 0, 84, 87, 3, 16, 8, 0, 85, 87, 3, 22, 11, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 19, 1, 0, 0, 0, 88, 89, 5, 12, 0, 0, 89, 21, 1, 0, 0, 0, 90, 93, 5, 11, 0, 0, 91, 93, 3, 14, 7, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 23, 1, 0, 0, 0, 94, 95, 7, 1, 0, 0, 95, 25, 1, 0, 0, 0, 9, 34, 40, 51, 61, 67, 74, 79, 86, 92] \ No newline at end of file +[4, 1, 13, 100, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 33, 8, 1, 10, 1, 12, 1, 36, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 41, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 52, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 62, 8, 6, 1, 7, 1, 7, 5, 7, 66, 8, 7, 10, 7, 12, 7, 69, 9, 7, 1, 8, 1, 8, 3, 8, 73, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 78, 8, 8, 1, 8, 5, 8, 81, 8, 8, 10, 8, 12, 8, 84, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 90, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 96, 8, 11, 1, 12, 1, 12, 1, 12, 0, 0, 13, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 0, 2, 1, 0, 1, 2, 1, 0, 4, 7, 98, 0, 26, 1, 0, 0, 0, 2, 28, 1, 0, 0, 0, 4, 37, 1, 0, 0, 0, 6, 40, 1, 0, 0, 0, 8, 51, 1, 0, 0, 0, 10, 53, 1, 0, 0, 0, 12, 57, 1, 0, 0, 0, 14, 63, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 89, 1, 0, 0, 0, 20, 91, 1, 0, 0, 0, 22, 95, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 27, 3, 2, 1, 0, 27, 1, 1, 0, 0, 0, 28, 34, 3, 6, 3, 0, 29, 30, 3, 4, 2, 0, 30, 31, 3, 6, 3, 0, 31, 33, 1, 0, 0, 0, 32, 29, 1, 0, 0, 0, 33, 36, 1, 0, 0, 0, 34, 32, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 3, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 37, 38, 7, 0, 0, 0, 38, 5, 1, 0, 0, 0, 39, 41, 5, 3, 0, 0, 40, 39, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 43, 3, 8, 4, 0, 43, 7, 1, 0, 0, 0, 44, 45, 5, 9, 0, 0, 45, 46, 3, 0, 0, 0, 46, 47, 5, 10, 0, 0, 47, 52, 1, 0, 0, 0, 48, 52, 3, 10, 5, 0, 49, 52, 3, 12, 6, 0, 50, 52, 3, 14, 7, 0, 51, 44, 1, 0, 0, 0, 51, 48, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 50, 1, 0, 0, 0, 52, 9, 1, 0, 0, 0, 53, 54, 3, 20, 10, 0, 54, 55, 3, 24, 12, 0, 55, 56, 3, 22, 11, 0, 56, 11, 1, 0, 0, 0, 57, 58, 3, 20, 10, 0, 58, 61, 5, 8, 0, 0, 59, 62, 3, 22, 11, 0, 60, 62, 3, 16, 8, 0, 61, 59, 1, 0, 0, 0, 61, 60, 1, 0, 0, 0, 62, 13, 1, 0, 0, 0, 63, 67, 5, 12, 0, 0, 64, 66, 5, 12, 0, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 15, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 72, 5, 9, 0, 0, 71, 73, 5, 3, 0, 0, 72, 71, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 82, 3, 18, 9, 0, 75, 77, 7, 0, 0, 0, 76, 78, 5, 3, 0, 0, 77, 76, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 81, 3, 18, 9, 0, 80, 75, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 85, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 86, 5, 10, 0, 0, 86, 17, 1, 0, 0, 0, 87, 90, 3, 16, 8, 0, 88, 90, 3, 22, 11, 0, 89, 87, 1, 0, 0, 0, 89, 88, 1, 0, 0, 0, 90, 19, 1, 0, 0, 0, 91, 92, 5, 12, 0, 0, 92, 21, 1, 0, 0, 0, 93, 96, 5, 11, 0, 0, 94, 96, 3, 14, 7, 0, 95, 93, 1, 0, 0, 0, 95, 94, 1, 0, 0, 0, 96, 23, 1, 0, 0, 0, 97, 98, 7, 1, 0, 0, 98, 25, 1, 0, 0, 0, 10, 34, 40, 51, 61, 67, 72, 77, 82, 89, 95] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts index 49cd693c0791..1cb741fc11ae 100644 --- a/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts @@ -3,7 +3,6 @@ import * as antlr from "antlr4ng"; import { Token } from "antlr4ng"; -import { DQLParserListener } from "./DQLParserListener.js"; import { DQLParserVisitor } from "./DQLParserVisitor.js"; // for running tests with parameters, TODO: discuss strategy for typed parameters in CI @@ -369,15 +368,27 @@ export class DQLParser extends antlr.Parser { { this.state = 70; this.match(DQLParser.LPAREN); - this.state = 71; + { + this.state = 72; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 3) { + { + this.state = 71; + this.match(DQLParser.NOT); + } + } + + } + this.state = 74; this.groupContent(); - this.state = 79; + this.state = 82; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1 || _la === 2) { { { - this.state = 72; + this.state = 75; _la = this.tokenStream.LA(1); if(!(_la === 1 || _la === 2)) { this.errorHandler.recoverInline(this); @@ -387,26 +398,26 @@ export class DQLParser extends antlr.Parser { this.consume(); } { - this.state = 74; + this.state = 77; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 3) { { - this.state = 73; + this.state = 76; this.match(DQLParser.NOT); } } } - this.state = 76; + this.state = 79; this.groupContent(); } } - this.state = 81; + this.state = 84; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 82; + this.state = 85; this.match(DQLParser.RPAREN); } } @@ -427,13 +438,13 @@ export class DQLParser extends antlr.Parser { let localContext = new GroupContentContext(this.context, this.state); this.enterRule(localContext, 18, DQLParser.RULE_groupContent); try { - this.state = 86; + this.state = 89; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.LPAREN: this.enterOuterAlt(localContext, 1); { - this.state = 84; + this.state = 87; this.groupExpression(); } break; @@ -441,7 +452,7 @@ export class DQLParser extends antlr.Parser { case DQLParser.ID: this.enterOuterAlt(localContext, 2); { - this.state = 85; + this.state = 88; this.value(); } break; @@ -468,7 +479,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 88; + this.state = 91; this.match(DQLParser.ID); } } @@ -489,20 +500,20 @@ export class DQLParser extends antlr.Parser { let localContext = new ValueContext(this.context, this.state); this.enterRule(localContext, 22, DQLParser.RULE_value); try { - this.state = 92; + this.state = 95; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case DQLParser.PHRASE: this.enterOuterAlt(localContext, 1); { - this.state = 90; + this.state = 93; this.match(DQLParser.PHRASE); } break; case DQLParser.ID: this.enterOuterAlt(localContext, 2); { - this.state = 91; + this.state = 94; this.tokenSearch(); } break; @@ -530,7 +541,7 @@ export class DQLParser extends antlr.Parser { try { this.enterOuterAlt(localContext, 1); { - this.state = 94; + this.state = 97; _la = this.tokenStream.LA(1); if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 240) !== 0))) { this.errorHandler.recoverInline(this); @@ -556,36 +567,37 @@ export class DQLParser extends antlr.Parser { } public static readonly _serializedATN: number[] = [ - 4,1,13,97,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,1,13,100,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,1,0,1,0, 1,1,1,1,1,1,1,1,5,1,33,8,1,10,1,12,1,36,9,1,1,2,1,2,1,3,3,3,41,8, 3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,52,8,4,1,5,1,5,1,5,1,5, 1,6,1,6,1,6,1,6,3,6,62,8,6,1,7,1,7,5,7,66,8,7,10,7,12,7,69,9,7,1, - 8,1,8,1,8,1,8,3,8,75,8,8,1,8,5,8,78,8,8,10,8,12,8,81,9,8,1,8,1,8, - 1,9,1,9,3,9,87,8,9,1,10,1,10,1,11,1,11,3,11,93,8,11,1,12,1,12,1, - 12,0,0,13,0,2,4,6,8,10,12,14,16,18,20,22,24,0,2,1,0,1,2,1,0,4,7, - 94,0,26,1,0,0,0,2,28,1,0,0,0,4,37,1,0,0,0,6,40,1,0,0,0,8,51,1,0, - 0,0,10,53,1,0,0,0,12,57,1,0,0,0,14,63,1,0,0,0,16,70,1,0,0,0,18,86, - 1,0,0,0,20,88,1,0,0,0,22,92,1,0,0,0,24,94,1,0,0,0,26,27,3,2,1,0, - 27,1,1,0,0,0,28,34,3,6,3,0,29,30,3,4,2,0,30,31,3,6,3,0,31,33,1,0, - 0,0,32,29,1,0,0,0,33,36,1,0,0,0,34,32,1,0,0,0,34,35,1,0,0,0,35,3, - 1,0,0,0,36,34,1,0,0,0,37,38,7,0,0,0,38,5,1,0,0,0,39,41,5,3,0,0,40, - 39,1,0,0,0,40,41,1,0,0,0,41,42,1,0,0,0,42,43,3,8,4,0,43,7,1,0,0, - 0,44,45,5,9,0,0,45,46,3,0,0,0,46,47,5,10,0,0,47,52,1,0,0,0,48,52, - 3,10,5,0,49,52,3,12,6,0,50,52,3,14,7,0,51,44,1,0,0,0,51,48,1,0,0, - 0,51,49,1,0,0,0,51,50,1,0,0,0,52,9,1,0,0,0,53,54,3,20,10,0,54,55, - 3,24,12,0,55,56,3,22,11,0,56,11,1,0,0,0,57,58,3,20,10,0,58,61,5, - 8,0,0,59,62,3,22,11,0,60,62,3,16,8,0,61,59,1,0,0,0,61,60,1,0,0,0, - 62,13,1,0,0,0,63,67,5,12,0,0,64,66,5,12,0,0,65,64,1,0,0,0,66,69, - 1,0,0,0,67,65,1,0,0,0,67,68,1,0,0,0,68,15,1,0,0,0,69,67,1,0,0,0, - 70,71,5,9,0,0,71,79,3,18,9,0,72,74,7,0,0,0,73,75,5,3,0,0,74,73,1, - 0,0,0,74,75,1,0,0,0,75,76,1,0,0,0,76,78,3,18,9,0,77,72,1,0,0,0,78, - 81,1,0,0,0,79,77,1,0,0,0,79,80,1,0,0,0,80,82,1,0,0,0,81,79,1,0,0, - 0,82,83,5,10,0,0,83,17,1,0,0,0,84,87,3,16,8,0,85,87,3,22,11,0,86, - 84,1,0,0,0,86,85,1,0,0,0,87,19,1,0,0,0,88,89,5,12,0,0,89,21,1,0, - 0,0,90,93,5,11,0,0,91,93,3,14,7,0,92,90,1,0,0,0,92,91,1,0,0,0,93, - 23,1,0,0,0,94,95,7,1,0,0,95,25,1,0,0,0,9,34,40,51,61,67,74,79,86, - 92 + 8,1,8,3,8,73,8,8,1,8,1,8,1,8,3,8,78,8,8,1,8,5,8,81,8,8,10,8,12,8, + 84,9,8,1,8,1,8,1,9,1,9,3,9,90,8,9,1,10,1,10,1,11,1,11,3,11,96,8, + 11,1,12,1,12,1,12,0,0,13,0,2,4,6,8,10,12,14,16,18,20,22,24,0,2,1, + 0,1,2,1,0,4,7,98,0,26,1,0,0,0,2,28,1,0,0,0,4,37,1,0,0,0,6,40,1,0, + 0,0,8,51,1,0,0,0,10,53,1,0,0,0,12,57,1,0,0,0,14,63,1,0,0,0,16,70, + 1,0,0,0,18,89,1,0,0,0,20,91,1,0,0,0,22,95,1,0,0,0,24,97,1,0,0,0, + 26,27,3,2,1,0,27,1,1,0,0,0,28,34,3,6,3,0,29,30,3,4,2,0,30,31,3,6, + 3,0,31,33,1,0,0,0,32,29,1,0,0,0,33,36,1,0,0,0,34,32,1,0,0,0,34,35, + 1,0,0,0,35,3,1,0,0,0,36,34,1,0,0,0,37,38,7,0,0,0,38,5,1,0,0,0,39, + 41,5,3,0,0,40,39,1,0,0,0,40,41,1,0,0,0,41,42,1,0,0,0,42,43,3,8,4, + 0,43,7,1,0,0,0,44,45,5,9,0,0,45,46,3,0,0,0,46,47,5,10,0,0,47,52, + 1,0,0,0,48,52,3,10,5,0,49,52,3,12,6,0,50,52,3,14,7,0,51,44,1,0,0, + 0,51,48,1,0,0,0,51,49,1,0,0,0,51,50,1,0,0,0,52,9,1,0,0,0,53,54,3, + 20,10,0,54,55,3,24,12,0,55,56,3,22,11,0,56,11,1,0,0,0,57,58,3,20, + 10,0,58,61,5,8,0,0,59,62,3,22,11,0,60,62,3,16,8,0,61,59,1,0,0,0, + 61,60,1,0,0,0,62,13,1,0,0,0,63,67,5,12,0,0,64,66,5,12,0,0,65,64, + 1,0,0,0,66,69,1,0,0,0,67,65,1,0,0,0,67,68,1,0,0,0,68,15,1,0,0,0, + 69,67,1,0,0,0,70,72,5,9,0,0,71,73,5,3,0,0,72,71,1,0,0,0,72,73,1, + 0,0,0,73,74,1,0,0,0,74,82,3,18,9,0,75,77,7,0,0,0,76,78,5,3,0,0,77, + 76,1,0,0,0,77,78,1,0,0,0,78,79,1,0,0,0,79,81,3,18,9,0,80,75,1,0, + 0,0,81,84,1,0,0,0,82,80,1,0,0,0,82,83,1,0,0,0,83,85,1,0,0,0,84,82, + 1,0,0,0,85,86,5,10,0,0,86,17,1,0,0,0,87,90,3,16,8,0,88,90,3,22,11, + 0,89,87,1,0,0,0,89,88,1,0,0,0,90,19,1,0,0,0,91,92,5,12,0,0,92,21, + 1,0,0,0,93,96,5,11,0,0,94,96,3,14,7,0,95,93,1,0,0,0,95,94,1,0,0, + 0,96,23,1,0,0,0,97,98,7,1,0,0,98,25,1,0,0,0,10,34,40,51,61,67,72, + 77,82,89,95 ]; private static __ATN: antlr.ATN; @@ -617,16 +629,6 @@ export class QueryContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_query; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterQuery) { - listener.enterQuery(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitQuery) { - listener.exitQuery(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitQuery) { return visitor.visitQuery(this); @@ -662,16 +664,6 @@ export class OperatorExpressionContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_operatorExpression; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterOperatorExpression) { - listener.enterOperatorExpression(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitOperatorExpression) { - listener.exitOperatorExpression(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitOperatorExpression) { return visitor.visitOperatorExpression(this); @@ -695,16 +687,6 @@ export class BooleanOperatorContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_booleanOperator; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterBooleanOperator) { - listener.enterBooleanOperator(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitBooleanOperator) { - listener.exitBooleanOperator(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitBooleanOperator) { return visitor.visitBooleanOperator(this); @@ -728,16 +710,6 @@ export class NotExpressionContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_notExpression; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterNotExpression) { - listener.enterNotExpression(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitNotExpression) { - listener.exitNotExpression(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitNotExpression) { return visitor.visitNotExpression(this); @@ -773,16 +745,6 @@ export class PrimaryExpressionContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_primaryExpression; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterPrimaryExpression) { - listener.enterPrimaryExpression(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitPrimaryExpression) { - listener.exitPrimaryExpression(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitPrimaryExpression) { return visitor.visitPrimaryExpression(this); @@ -809,16 +771,6 @@ export class ComparisonExpressionContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_comparisonExpression; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterComparisonExpression) { - listener.enterComparisonExpression(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitComparisonExpression) { - listener.exitComparisonExpression(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitComparisonExpression) { return visitor.visitComparisonExpression(this); @@ -848,16 +800,6 @@ export class KeyValueExpressionContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_keyValueExpression; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterKeyValueExpression) { - listener.enterKeyValueExpression(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitKeyValueExpression) { - listener.exitKeyValueExpression(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitKeyValueExpression) { return visitor.visitKeyValueExpression(this); @@ -884,16 +826,6 @@ export class TokenSearchContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_tokenSearch; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterTokenSearch) { - listener.enterTokenSearch(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitTokenSearch) { - listener.exitTokenSearch(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitTokenSearch) { return visitor.visitTokenSearch(this); @@ -953,16 +885,6 @@ export class GroupExpressionContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_groupExpression; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterGroupExpression) { - listener.enterGroupExpression(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitGroupExpression) { - listener.exitGroupExpression(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitGroupExpression) { return visitor.visitGroupExpression(this); @@ -986,16 +908,6 @@ export class GroupContentContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_groupContent; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterGroupContent) { - listener.enterGroupContent(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitGroupContent) { - listener.exitGroupContent(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitGroupContent) { return visitor.visitGroupContent(this); @@ -1016,16 +928,6 @@ export class FieldContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_field; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterField) { - listener.enterField(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitField) { - listener.exitField(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitField) { return visitor.visitField(this); @@ -1049,16 +951,6 @@ export class ValueContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_value; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterValue) { - listener.enterValue(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitValue) { - listener.exitValue(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitValue) { return visitor.visitValue(this); @@ -1088,16 +980,6 @@ export class ComparisonOperatorContext extends antlr.ParserRuleContext { public override get ruleIndex(): number { return DQLParser.RULE_comparisonOperator; } - public override enterRule(listener: DQLParserListener): void { - if(listener.enterComparisonOperator) { - listener.enterComparisonOperator(this); - } - } - public override exitRule(listener: DQLParserListener): void { - if(listener.exitComparisonOperator) { - listener.exitComparisonOperator(this); - } - } public override accept(visitor: DQLParserVisitor): Result | null { if (visitor.visitComparisonOperator) { return visitor.visitComparisonOperator(this); diff --git a/src/plugins/data/public/antlr/dql/.generated/DQLParserListener.ts b/src/plugins/data/public/antlr/dql/.generated/DQLParserListener.ts deleted file mode 100644 index 265d5e1958d9..000000000000 --- a/src/plugins/data/public/antlr/dql/.generated/DQLParserListener.ts +++ /dev/null @@ -1,162 +0,0 @@ -// Generated from grammar/DQLParser.g4 by ANTLR 4.13.1 - -import { ErrorNode, ParseTreeListener, ParserRuleContext, TerminalNode } from "antlr4ng"; - - -import { QueryContext } from "./DQLParser.js"; -import { OperatorExpressionContext } from "./DQLParser.js"; -import { BooleanOperatorContext } from "./DQLParser.js"; -import { NotExpressionContext } from "./DQLParser.js"; -import { PrimaryExpressionContext } from "./DQLParser.js"; -import { ComparisonExpressionContext } from "./DQLParser.js"; -import { KeyValueExpressionContext } from "./DQLParser.js"; -import { TokenSearchContext } from "./DQLParser.js"; -import { GroupExpressionContext } from "./DQLParser.js"; -import { GroupContentContext } from "./DQLParser.js"; -import { FieldContext } from "./DQLParser.js"; -import { ValueContext } from "./DQLParser.js"; -import { ComparisonOperatorContext } from "./DQLParser.js"; - - -/** - * This interface defines a complete listener for a parse tree produced by - * `DQLParser`. - */ -export class DQLParserListener implements ParseTreeListener { - /** - * Enter a parse tree produced by `DQLParser.query`. - * @param ctx the parse tree - */ - enterQuery?: (ctx: QueryContext) => void; - /** - * Exit a parse tree produced by `DQLParser.query`. - * @param ctx the parse tree - */ - exitQuery?: (ctx: QueryContext) => void; - /** - * Enter a parse tree produced by `DQLParser.operatorExpression`. - * @param ctx the parse tree - */ - enterOperatorExpression?: (ctx: OperatorExpressionContext) => void; - /** - * Exit a parse tree produced by `DQLParser.operatorExpression`. - * @param ctx the parse tree - */ - exitOperatorExpression?: (ctx: OperatorExpressionContext) => void; - /** - * Enter a parse tree produced by `DQLParser.booleanOperator`. - * @param ctx the parse tree - */ - enterBooleanOperator?: (ctx: BooleanOperatorContext) => void; - /** - * Exit a parse tree produced by `DQLParser.booleanOperator`. - * @param ctx the parse tree - */ - exitBooleanOperator?: (ctx: BooleanOperatorContext) => void; - /** - * Enter a parse tree produced by `DQLParser.notExpression`. - * @param ctx the parse tree - */ - enterNotExpression?: (ctx: NotExpressionContext) => void; - /** - * Exit a parse tree produced by `DQLParser.notExpression`. - * @param ctx the parse tree - */ - exitNotExpression?: (ctx: NotExpressionContext) => void; - /** - * Enter a parse tree produced by `DQLParser.primaryExpression`. - * @param ctx the parse tree - */ - enterPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; - /** - * Exit a parse tree produced by `DQLParser.primaryExpression`. - * @param ctx the parse tree - */ - exitPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; - /** - * Enter a parse tree produced by `DQLParser.comparisonExpression`. - * @param ctx the parse tree - */ - enterComparisonExpression?: (ctx: ComparisonExpressionContext) => void; - /** - * Exit a parse tree produced by `DQLParser.comparisonExpression`. - * @param ctx the parse tree - */ - exitComparisonExpression?: (ctx: ComparisonExpressionContext) => void; - /** - * Enter a parse tree produced by `DQLParser.keyValueExpression`. - * @param ctx the parse tree - */ - enterKeyValueExpression?: (ctx: KeyValueExpressionContext) => void; - /** - * Exit a parse tree produced by `DQLParser.keyValueExpression`. - * @param ctx the parse tree - */ - exitKeyValueExpression?: (ctx: KeyValueExpressionContext) => void; - /** - * Enter a parse tree produced by `DQLParser.tokenSearch`. - * @param ctx the parse tree - */ - enterTokenSearch?: (ctx: TokenSearchContext) => void; - /** - * Exit a parse tree produced by `DQLParser.tokenSearch`. - * @param ctx the parse tree - */ - exitTokenSearch?: (ctx: TokenSearchContext) => void; - /** - * Enter a parse tree produced by `DQLParser.groupExpression`. - * @param ctx the parse tree - */ - enterGroupExpression?: (ctx: GroupExpressionContext) => void; - /** - * Exit a parse tree produced by `DQLParser.groupExpression`. - * @param ctx the parse tree - */ - exitGroupExpression?: (ctx: GroupExpressionContext) => void; - /** - * Enter a parse tree produced by `DQLParser.groupContent`. - * @param ctx the parse tree - */ - enterGroupContent?: (ctx: GroupContentContext) => void; - /** - * Exit a parse tree produced by `DQLParser.groupContent`. - * @param ctx the parse tree - */ - exitGroupContent?: (ctx: GroupContentContext) => void; - /** - * Enter a parse tree produced by `DQLParser.field`. - * @param ctx the parse tree - */ - enterField?: (ctx: FieldContext) => void; - /** - * Exit a parse tree produced by `DQLParser.field`. - * @param ctx the parse tree - */ - exitField?: (ctx: FieldContext) => void; - /** - * Enter a parse tree produced by `DQLParser.value`. - * @param ctx the parse tree - */ - enterValue?: (ctx: ValueContext) => void; - /** - * Exit a parse tree produced by `DQLParser.value`. - * @param ctx the parse tree - */ - exitValue?: (ctx: ValueContext) => void; - /** - * Enter a parse tree produced by `DQLParser.comparisonOperator`. - * @param ctx the parse tree - */ - enterComparisonOperator?: (ctx: ComparisonOperatorContext) => void; - /** - * Exit a parse tree produced by `DQLParser.comparisonOperator`. - * @param ctx the parse tree - */ - exitComparisonOperator?: (ctx: ComparisonOperatorContext) => void; - - visitTerminal(node: TerminalNode): void {} - visitErrorNode(node: ErrorNode): void {} - enterEveryRule(node: ParserRuleContext): void {} - exitEveryRule(node: ParserRuleContext): void {} -} - diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp index c8ac375c4e21..041e2baeae19 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.interp @@ -47,4 +47,4 @@ comparisonOperator atn: -[4, 1, 13, 97, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 33, 8, 1, 10, 1, 12, 1, 36, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 41, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 52, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 62, 8, 6, 1, 7, 1, 7, 5, 7, 66, 8, 7, 10, 7, 12, 7, 69, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 75, 8, 8, 1, 8, 5, 8, 78, 8, 8, 10, 8, 12, 8, 81, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 87, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 93, 8, 11, 1, 12, 1, 12, 1, 12, 0, 0, 13, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 0, 2, 1, 0, 1, 2, 1, 0, 4, 7, 94, 0, 26, 1, 0, 0, 0, 2, 28, 1, 0, 0, 0, 4, 37, 1, 0, 0, 0, 6, 40, 1, 0, 0, 0, 8, 51, 1, 0, 0, 0, 10, 53, 1, 0, 0, 0, 12, 57, 1, 0, 0, 0, 14, 63, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 86, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 22, 92, 1, 0, 0, 0, 24, 94, 1, 0, 0, 0, 26, 27, 3, 2, 1, 0, 27, 1, 1, 0, 0, 0, 28, 34, 3, 6, 3, 0, 29, 30, 3, 4, 2, 0, 30, 31, 3, 6, 3, 0, 31, 33, 1, 0, 0, 0, 32, 29, 1, 0, 0, 0, 33, 36, 1, 0, 0, 0, 34, 32, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 3, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 37, 38, 7, 0, 0, 0, 38, 5, 1, 0, 0, 0, 39, 41, 5, 3, 0, 0, 40, 39, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 43, 3, 8, 4, 0, 43, 7, 1, 0, 0, 0, 44, 45, 5, 9, 0, 0, 45, 46, 3, 0, 0, 0, 46, 47, 5, 10, 0, 0, 47, 52, 1, 0, 0, 0, 48, 52, 3, 10, 5, 0, 49, 52, 3, 12, 6, 0, 50, 52, 3, 14, 7, 0, 51, 44, 1, 0, 0, 0, 51, 48, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 50, 1, 0, 0, 0, 52, 9, 1, 0, 0, 0, 53, 54, 3, 20, 10, 0, 54, 55, 3, 24, 12, 0, 55, 56, 3, 22, 11, 0, 56, 11, 1, 0, 0, 0, 57, 58, 3, 20, 10, 0, 58, 61, 5, 8, 0, 0, 59, 62, 3, 22, 11, 0, 60, 62, 3, 16, 8, 0, 61, 59, 1, 0, 0, 0, 61, 60, 1, 0, 0, 0, 62, 13, 1, 0, 0, 0, 63, 67, 5, 12, 0, 0, 64, 66, 5, 12, 0, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 15, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 5, 9, 0, 0, 71, 79, 3, 18, 9, 0, 72, 74, 7, 0, 0, 0, 73, 75, 5, 3, 0, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 3, 18, 9, 0, 77, 72, 1, 0, 0, 0, 78, 81, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 82, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 82, 83, 5, 10, 0, 0, 83, 17, 1, 0, 0, 0, 84, 87, 3, 16, 8, 0, 85, 87, 3, 22, 11, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 19, 1, 0, 0, 0, 88, 89, 5, 12, 0, 0, 89, 21, 1, 0, 0, 0, 90, 93, 5, 11, 0, 0, 91, 93, 3, 14, 7, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 23, 1, 0, 0, 0, 94, 95, 7, 1, 0, 0, 95, 25, 1, 0, 0, 0, 9, 34, 40, 51, 61, 67, 74, 79, 86, 92] \ No newline at end of file +[4, 1, 13, 100, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 33, 8, 1, 10, 1, 12, 1, 36, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 41, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 52, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 62, 8, 6, 1, 7, 1, 7, 5, 7, 66, 8, 7, 10, 7, 12, 7, 69, 9, 7, 1, 8, 1, 8, 3, 8, 73, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 78, 8, 8, 1, 8, 5, 8, 81, 8, 8, 10, 8, 12, 8, 84, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 90, 8, 9, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 96, 8, 11, 1, 12, 1, 12, 1, 12, 0, 0, 13, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 0, 2, 1, 0, 1, 2, 1, 0, 4, 7, 98, 0, 26, 1, 0, 0, 0, 2, 28, 1, 0, 0, 0, 4, 37, 1, 0, 0, 0, 6, 40, 1, 0, 0, 0, 8, 51, 1, 0, 0, 0, 10, 53, 1, 0, 0, 0, 12, 57, 1, 0, 0, 0, 14, 63, 1, 0, 0, 0, 16, 70, 1, 0, 0, 0, 18, 89, 1, 0, 0, 0, 20, 91, 1, 0, 0, 0, 22, 95, 1, 0, 0, 0, 24, 97, 1, 0, 0, 0, 26, 27, 3, 2, 1, 0, 27, 1, 1, 0, 0, 0, 28, 34, 3, 6, 3, 0, 29, 30, 3, 4, 2, 0, 30, 31, 3, 6, 3, 0, 31, 33, 1, 0, 0, 0, 32, 29, 1, 0, 0, 0, 33, 36, 1, 0, 0, 0, 34, 32, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 35, 3, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 37, 38, 7, 0, 0, 0, 38, 5, 1, 0, 0, 0, 39, 41, 5, 3, 0, 0, 40, 39, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 43, 3, 8, 4, 0, 43, 7, 1, 0, 0, 0, 44, 45, 5, 9, 0, 0, 45, 46, 3, 0, 0, 0, 46, 47, 5, 10, 0, 0, 47, 52, 1, 0, 0, 0, 48, 52, 3, 10, 5, 0, 49, 52, 3, 12, 6, 0, 50, 52, 3, 14, 7, 0, 51, 44, 1, 0, 0, 0, 51, 48, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 51, 50, 1, 0, 0, 0, 52, 9, 1, 0, 0, 0, 53, 54, 3, 20, 10, 0, 54, 55, 3, 24, 12, 0, 55, 56, 3, 22, 11, 0, 56, 11, 1, 0, 0, 0, 57, 58, 3, 20, 10, 0, 58, 61, 5, 8, 0, 0, 59, 62, 3, 22, 11, 0, 60, 62, 3, 16, 8, 0, 61, 59, 1, 0, 0, 0, 61, 60, 1, 0, 0, 0, 62, 13, 1, 0, 0, 0, 63, 67, 5, 12, 0, 0, 64, 66, 5, 12, 0, 0, 65, 64, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 15, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 72, 5, 9, 0, 0, 71, 73, 5, 3, 0, 0, 72, 71, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 82, 3, 18, 9, 0, 75, 77, 7, 0, 0, 0, 76, 78, 5, 3, 0, 0, 77, 76, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 81, 3, 18, 9, 0, 80, 75, 1, 0, 0, 0, 81, 84, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 85, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 86, 5, 10, 0, 0, 86, 17, 1, 0, 0, 0, 87, 90, 3, 16, 8, 0, 88, 90, 3, 22, 11, 0, 89, 87, 1, 0, 0, 0, 89, 88, 1, 0, 0, 0, 90, 19, 1, 0, 0, 0, 91, 92, 5, 12, 0, 0, 92, 21, 1, 0, 0, 0, 93, 96, 5, 11, 0, 0, 94, 96, 3, 14, 7, 0, 95, 93, 1, 0, 0, 0, 95, 94, 1, 0, 0, 0, 96, 23, 1, 0, 0, 0, 97, 98, 7, 1, 0, 0, 98, 25, 1, 0, 0, 0, 10, 34, 40, 51, 61, 67, 72, 77, 82, 89, 95] \ No newline at end of file diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index a9aa25b468c5..39fd0fb4a0f9 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -530,15 +530,27 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio { setState(70); match(LPAREN); - setState(71); + { + setState(72); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==NOT) { + { + setState(71); + match(NOT); + } + } + + } + setState(74); groupContent(); - setState(79); + setState(82); _errHandler.sync(this); _la = _input.LA(1); while (_la==OR || _la==AND) { { { - setState(72); + setState(75); _la = _input.LA(1); if ( !(_la==OR || _la==AND) ) { _errHandler.recoverInline(this); @@ -549,26 +561,26 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio consume(); } { - setState(74); + setState(77); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(73); + setState(76); match(NOT); } } } - setState(76); + setState(79); groupContent(); } } - setState(81); + setState(84); _errHandler.sync(this); _la = _input.LA(1); } - setState(82); + setState(85); match(RPAREN); } } @@ -601,13 +613,13 @@ public final GroupContentContext groupContent() throws RecognitionException { GroupContentContext _localctx = new GroupContentContext(_ctx, getState()); enterRule(_localctx, 18, RULE_groupContent); try { - setState(86); + setState(89); _errHandler.sync(this); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(84); + setState(87); groupExpression(); } break; @@ -615,7 +627,7 @@ public final GroupContentContext groupContent() throws RecognitionException { case ID: enterOuterAlt(_localctx, 2); { - setState(85); + setState(88); value(); } break; @@ -649,7 +661,7 @@ public final FieldContext field() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(88); + setState(91); match(ID); } } @@ -680,20 +692,20 @@ public final ValueContext value() throws RecognitionException { ValueContext _localctx = new ValueContext(_ctx, getState()); enterRule(_localctx, 22, RULE_value); try { - setState(92); + setState(95); _errHandler.sync(this); switch (_input.LA(1)) { case PHRASE: enterOuterAlt(_localctx, 1); { - setState(90); + setState(93); match(PHRASE); } break; case ID: enterOuterAlt(_localctx, 2); { - setState(91); + setState(94); tokenSearch(); } break; @@ -731,7 +743,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(94); + setState(97); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 240L) != 0)) ) { _errHandler.recoverInline(this); @@ -755,7 +767,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx } public static final String _serializedATN = - "\u0004\u0001\ra\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u0001\rd\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ @@ -766,47 +778,49 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx "\u0001\u0004\u0003\u00044\b\u0004\u0001\u0005\u0001\u0005\u0001\u0005"+ "\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0003\u0006"+ ">\b\u0006\u0001\u0007\u0001\u0007\u0005\u0007B\b\u0007\n\u0007\f\u0007"+ - "E\t\u0007\u0001\b\u0001\b\u0001\b\u0001\b\u0003\bK\b\b\u0001\b\u0005\b"+ - "N\b\b\n\b\f\bQ\t\b\u0001\b\u0001\b\u0001\t\u0001\t\u0003\tW\b\t\u0001"+ - "\n\u0001\n\u0001\u000b\u0001\u000b\u0003\u000b]\b\u000b\u0001\f\u0001"+ - "\f\u0001\f\u0000\u0000\r\u0000\u0002\u0004\u0006\b\n\f\u000e\u0010\u0012"+ - "\u0014\u0016\u0018\u0000\u0002\u0001\u0000\u0001\u0002\u0001\u0000\u0004"+ - "\u0007^\u0000\u001a\u0001\u0000\u0000\u0000\u0002\u001c\u0001\u0000\u0000"+ - "\u0000\u0004%\u0001\u0000\u0000\u0000\u0006(\u0001\u0000\u0000\u0000\b"+ - "3\u0001\u0000\u0000\u0000\n5\u0001\u0000\u0000\u0000\f9\u0001\u0000\u0000"+ - "\u0000\u000e?\u0001\u0000\u0000\u0000\u0010F\u0001\u0000\u0000\u0000\u0012"+ - "V\u0001\u0000\u0000\u0000\u0014X\u0001\u0000\u0000\u0000\u0016\\\u0001"+ - "\u0000\u0000\u0000\u0018^\u0001\u0000\u0000\u0000\u001a\u001b\u0003\u0002"+ - "\u0001\u0000\u001b\u0001\u0001\u0000\u0000\u0000\u001c\"\u0003\u0006\u0003"+ - "\u0000\u001d\u001e\u0003\u0004\u0002\u0000\u001e\u001f\u0003\u0006\u0003"+ - "\u0000\u001f!\u0001\u0000\u0000\u0000 \u001d\u0001\u0000\u0000\u0000!"+ - "$\u0001\u0000\u0000\u0000\" \u0001\u0000\u0000\u0000\"#\u0001\u0000\u0000"+ - "\u0000#\u0003\u0001\u0000\u0000\u0000$\"\u0001\u0000\u0000\u0000%&\u0007"+ - "\u0000\u0000\u0000&\u0005\u0001\u0000\u0000\u0000\')\u0005\u0003\u0000"+ - "\u0000(\'\u0001\u0000\u0000\u0000()\u0001\u0000\u0000\u0000)*\u0001\u0000"+ - "\u0000\u0000*+\u0003\b\u0004\u0000+\u0007\u0001\u0000\u0000\u0000,-\u0005"+ - "\t\u0000\u0000-.\u0003\u0000\u0000\u0000./\u0005\n\u0000\u0000/4\u0001"+ - "\u0000\u0000\u000004\u0003\n\u0005\u000014\u0003\f\u0006\u000024\u0003"+ - "\u000e\u0007\u00003,\u0001\u0000\u0000\u000030\u0001\u0000\u0000\u0000"+ - "31\u0001\u0000\u0000\u000032\u0001\u0000\u0000\u00004\t\u0001\u0000\u0000"+ - "\u000056\u0003\u0014\n\u000067\u0003\u0018\f\u000078\u0003\u0016\u000b"+ - "\u00008\u000b\u0001\u0000\u0000\u00009:\u0003\u0014\n\u0000:=\u0005\b"+ - "\u0000\u0000;>\u0003\u0016\u000b\u0000<>\u0003\u0010\b\u0000=;\u0001\u0000"+ - "\u0000\u0000=<\u0001\u0000\u0000\u0000>\r\u0001\u0000\u0000\u0000?C\u0005"+ - "\f\u0000\u0000@B\u0005\f\u0000\u0000A@\u0001\u0000\u0000\u0000BE\u0001"+ - "\u0000\u0000\u0000CA\u0001\u0000\u0000\u0000CD\u0001\u0000\u0000\u0000"+ - "D\u000f\u0001\u0000\u0000\u0000EC\u0001\u0000\u0000\u0000FG\u0005\t\u0000"+ - "\u0000GO\u0003\u0012\t\u0000HJ\u0007\u0000\u0000\u0000IK\u0005\u0003\u0000"+ - "\u0000JI\u0001\u0000\u0000\u0000JK\u0001\u0000\u0000\u0000KL\u0001\u0000"+ - "\u0000\u0000LN\u0003\u0012\t\u0000MH\u0001\u0000\u0000\u0000NQ\u0001\u0000"+ - "\u0000\u0000OM\u0001\u0000\u0000\u0000OP\u0001\u0000\u0000\u0000PR\u0001"+ - "\u0000\u0000\u0000QO\u0001\u0000\u0000\u0000RS\u0005\n\u0000\u0000S\u0011"+ - "\u0001\u0000\u0000\u0000TW\u0003\u0010\b\u0000UW\u0003\u0016\u000b\u0000"+ - "VT\u0001\u0000\u0000\u0000VU\u0001\u0000\u0000\u0000W\u0013\u0001\u0000"+ - "\u0000\u0000XY\u0005\f\u0000\u0000Y\u0015\u0001\u0000\u0000\u0000Z]\u0005"+ - "\u000b\u0000\u0000[]\u0003\u000e\u0007\u0000\\Z\u0001\u0000\u0000\u0000"+ - "\\[\u0001\u0000\u0000\u0000]\u0017\u0001\u0000\u0000\u0000^_\u0007\u0001"+ - "\u0000\u0000_\u0019\u0001\u0000\u0000\u0000\t\"(3=CJOV\\"; + "E\t\u0007\u0001\b\u0001\b\u0003\bI\b\b\u0001\b\u0001\b\u0001\b\u0003\b"+ + "N\b\b\u0001\b\u0005\bQ\b\b\n\b\f\bT\t\b\u0001\b\u0001\b\u0001\t\u0001"+ + "\t\u0003\tZ\b\t\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0003\u000b`\b"+ + "\u000b\u0001\f\u0001\f\u0001\f\u0000\u0000\r\u0000\u0002\u0004\u0006\b"+ + "\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u0000\u0002\u0001\u0000\u0001"+ + "\u0002\u0001\u0000\u0004\u0007b\u0000\u001a\u0001\u0000\u0000\u0000\u0002"+ + "\u001c\u0001\u0000\u0000\u0000\u0004%\u0001\u0000\u0000\u0000\u0006(\u0001"+ + "\u0000\u0000\u0000\b3\u0001\u0000\u0000\u0000\n5\u0001\u0000\u0000\u0000"+ + "\f9\u0001\u0000\u0000\u0000\u000e?\u0001\u0000\u0000\u0000\u0010F\u0001"+ + "\u0000\u0000\u0000\u0012Y\u0001\u0000\u0000\u0000\u0014[\u0001\u0000\u0000"+ + "\u0000\u0016_\u0001\u0000\u0000\u0000\u0018a\u0001\u0000\u0000\u0000\u001a"+ + "\u001b\u0003\u0002\u0001\u0000\u001b\u0001\u0001\u0000\u0000\u0000\u001c"+ + "\"\u0003\u0006\u0003\u0000\u001d\u001e\u0003\u0004\u0002\u0000\u001e\u001f"+ + "\u0003\u0006\u0003\u0000\u001f!\u0001\u0000\u0000\u0000 \u001d\u0001\u0000"+ + "\u0000\u0000!$\u0001\u0000\u0000\u0000\" \u0001\u0000\u0000\u0000\"#\u0001"+ + "\u0000\u0000\u0000#\u0003\u0001\u0000\u0000\u0000$\"\u0001\u0000\u0000"+ + "\u0000%&\u0007\u0000\u0000\u0000&\u0005\u0001\u0000\u0000\u0000\')\u0005"+ + "\u0003\u0000\u0000(\'\u0001\u0000\u0000\u0000()\u0001\u0000\u0000\u0000"+ + ")*\u0001\u0000\u0000\u0000*+\u0003\b\u0004\u0000+\u0007\u0001\u0000\u0000"+ + "\u0000,-\u0005\t\u0000\u0000-.\u0003\u0000\u0000\u0000./\u0005\n\u0000"+ + "\u0000/4\u0001\u0000\u0000\u000004\u0003\n\u0005\u000014\u0003\f\u0006"+ + "\u000024\u0003\u000e\u0007\u00003,\u0001\u0000\u0000\u000030\u0001\u0000"+ + "\u0000\u000031\u0001\u0000\u0000\u000032\u0001\u0000\u0000\u00004\t\u0001"+ + "\u0000\u0000\u000056\u0003\u0014\n\u000067\u0003\u0018\f\u000078\u0003"+ + "\u0016\u000b\u00008\u000b\u0001\u0000\u0000\u00009:\u0003\u0014\n\u0000"+ + ":=\u0005\b\u0000\u0000;>\u0003\u0016\u000b\u0000<>\u0003\u0010\b\u0000"+ + "=;\u0001\u0000\u0000\u0000=<\u0001\u0000\u0000\u0000>\r\u0001\u0000\u0000"+ + "\u0000?C\u0005\f\u0000\u0000@B\u0005\f\u0000\u0000A@\u0001\u0000\u0000"+ + "\u0000BE\u0001\u0000\u0000\u0000CA\u0001\u0000\u0000\u0000CD\u0001\u0000"+ + "\u0000\u0000D\u000f\u0001\u0000\u0000\u0000EC\u0001\u0000\u0000\u0000"+ + "FH\u0005\t\u0000\u0000GI\u0005\u0003\u0000\u0000HG\u0001\u0000\u0000\u0000"+ + "HI\u0001\u0000\u0000\u0000IJ\u0001\u0000\u0000\u0000JR\u0003\u0012\t\u0000"+ + "KM\u0007\u0000\u0000\u0000LN\u0005\u0003\u0000\u0000ML\u0001\u0000\u0000"+ + "\u0000MN\u0001\u0000\u0000\u0000NO\u0001\u0000\u0000\u0000OQ\u0003\u0012"+ + "\t\u0000PK\u0001\u0000\u0000\u0000QT\u0001\u0000\u0000\u0000RP\u0001\u0000"+ + "\u0000\u0000RS\u0001\u0000\u0000\u0000SU\u0001\u0000\u0000\u0000TR\u0001"+ + "\u0000\u0000\u0000UV\u0005\n\u0000\u0000V\u0011\u0001\u0000\u0000\u0000"+ + "WZ\u0003\u0010\b\u0000XZ\u0003\u0016\u000b\u0000YW\u0001\u0000\u0000\u0000"+ + "YX\u0001\u0000\u0000\u0000Z\u0013\u0001\u0000\u0000\u0000[\\\u0005\f\u0000"+ + "\u0000\\\u0015\u0001\u0000\u0000\u0000]`\u0005\u000b\u0000\u0000^`\u0003"+ + "\u000e\u0007\u0000_]\u0001\u0000\u0000\u0000_^\u0001\u0000\u0000\u0000"+ + "`\u0017\u0001\u0000\u0000\u0000ab\u0007\u0001\u0000\u0000b\u0019\u0001"+ + "\u0000\u0000\u0000\n\"(3=CHMRY_"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index eb01f42eacf6..433ef903ae89 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -41,7 +41,7 @@ tokenSearch ; groupExpression - : LPAREN groupContent ((OR | AND) (NOT?) groupContent)* RPAREN + : LPAREN (NOT?) groupContent ((OR | AND) (NOT?) groupContent)* RPAREN ; groupContent From e483ab19eb8d5667b9aadc18c027b2bba7d75d87 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Tue, 23 Jul 2024 06:53:52 -0700 Subject: [PATCH 29/34] add tests for fields and keywords Signed-off-by: Paul Sebastian --- .../public/antlr/dql/.generated/DQLParser.ts | 22 +- .../public/antlr/dql/code_completion.test.ts | 281 ++++++++++++++++++ .../data/public/antlr/dql/code_completion.ts | 17 +- .../antlr/dql/grammar/.antlr/DQLParser.java | 12 +- .../public/antlr/dql/grammar/DQLParser.g4 | 2 +- 5 files changed, 304 insertions(+), 30 deletions(-) create mode 100644 src/plugins/data/public/antlr/dql/code_completion.test.ts diff --git a/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts b/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts index 1cb741fc11ae..d666dc2089cb 100644 --- a/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts +++ b/src/plugins/data/public/antlr/dql/.generated/DQLParser.ts @@ -368,7 +368,6 @@ export class DQLParser extends antlr.Parser { { this.state = 70; this.match(DQLParser.LPAREN); - { this.state = 72; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); @@ -379,7 +378,6 @@ export class DQLParser extends antlr.Parser { } } - } this.state = 74; this.groupContent(); this.state = 82; @@ -397,7 +395,6 @@ export class DQLParser extends antlr.Parser { this.errorHandler.reportMatch(this); this.consume(); } - { this.state = 77; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); @@ -408,7 +405,6 @@ export class DQLParser extends antlr.Parser { } } - } this.state = 79; this.groupContent(); } @@ -855,6 +851,15 @@ export class GroupExpressionContext extends antlr.ParserRuleContext { public RPAREN(): antlr.TerminalNode { return this.getToken(DQLParser.RPAREN, 0)!; } + public NOT(): antlr.TerminalNode[]; + public NOT(i: number): antlr.TerminalNode | null; + public NOT(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { + if (i === undefined) { + return this.getTokens(DQLParser.NOT); + } else { + return this.getToken(DQLParser.NOT, i); + } + } public OR(): antlr.TerminalNode[]; public OR(i: number): antlr.TerminalNode | null; public OR(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { @@ -873,15 +878,6 @@ export class GroupExpressionContext extends antlr.ParserRuleContext { return this.getToken(DQLParser.AND, i); } } - public NOT(): antlr.TerminalNode[]; - public NOT(i: number): antlr.TerminalNode | null; - public NOT(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] { - if (i === undefined) { - return this.getTokens(DQLParser.NOT); - } else { - return this.getToken(DQLParser.NOT, i); - } - } public override get ruleIndex(): number { return DQLParser.RULE_groupExpression; } diff --git a/src/plugins/data/public/antlr/dql/code_completion.test.ts b/src/plugins/data/public/antlr/dql/code_completion.test.ts new file mode 100644 index 000000000000..ff566dfd3347 --- /dev/null +++ b/src/plugins/data/public/antlr/dql/code_completion.test.ts @@ -0,0 +1,281 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { monaco } from '@osd/monaco'; +import { getSuggestions } from './code_completion'; +import { IIndexPattern } from '../..'; + +const testingIndex = ({ + title: 'opensearch_dashboards_sample_data_flights', + fields: [ + { + count: 0, + name: 'Carrier', + displayName: 'Carrier', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 2, + name: 'DestCityName', + displayName: 'DestCityName', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'DestCountry', + displayName: 'DestCountry', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'DestWeather', + displayName: 'DestWeather', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'DistanceMiles', + displayName: 'DistanceMiles', + type: 'number', + esTypes: ['float'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'FlightDelay', + displayName: 'FlightDelay', + type: 'boolean', + esTypes: ['boolean'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'FlightNum', + displayName: 'FlightNum', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'OriginWeather', + displayName: 'OriginWeather', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: '_id', + displayName: '_id', + type: 'string', + esTypes: ['_id'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + subType: undefined, + }, + { + count: 0, + name: '_index', + displayName: '_index', + type: 'string', + esTypes: ['_index'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + subType: undefined, + }, + { + count: 0, + name: '_score', + displayName: '_score', + type: 'number', + scripted: false, + searchable: false, + aggregatable: false, + readFromDocValues: false, + subType: undefined, + }, + { + count: 0, + name: '_source', + displayName: '_source', + type: '_source', + esTypes: ['_source'], + scripted: false, + searchable: false, + aggregatable: false, + readFromDocValues: false, + subType: undefined, + }, + { + count: 0, + name: '_type', + displayName: '_type', + type: 'string', + esTypes: ['_type'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + subType: undefined, + }, + ], +} as unknown) as IIndexPattern; + +const booleanOperatorSuggestions = [ + { text: 'or', type: 'keyword' }, + { text: 'and', type: 'keyword' }, +]; + +const notOperatorSuggestion = { text: 'not', type: 'keyword' }; + +const fieldNameSuggestions = [ + { text: 'Carrier', type: 'field' }, + { text: 'DestCityName', type: 'field' }, + { text: 'DestCountry', type: 'field' }, + { text: 'DestWeather', type: 'field' }, + { text: 'DistanceMiles', type: 'field' }, + { text: 'FlightDelay', type: 'field' }, + { text: 'FlightNum', type: 'field' }, + { text: 'OriginWeather', type: 'field' }, + { text: '_id', type: 'field' }, + { text: '_index', type: 'field' }, + { text: '_score', type: 'field' }, + { text: '_source', type: 'field' }, + { text: '_type', type: 'field' }, +]; + +const fieldNameWithNotSuggestions = fieldNameSuggestions.concat(notOperatorSuggestion); + +const getSuggestionsAtPos = async (query: string, endPos: number) => { + return await getSuggestions({ + query, + indexPatterns: [testingIndex], + position: new monaco.Position(1, endPos), + language: '', // not relevant + selectionEnd: 0, // not relevant + selectionStart: 0, // not relevant + }); +}; + +const getSuggestionAtEnd = async (query: string) => { + return await getSuggestionsAtPos(query, query.length + 1); +}; + +describe('Test Boolean Operators', () => { + it('should suggest AND and OR after expression', async () => { + expect(await getSuggestionAtEnd('field: value ')).toStrictEqual(booleanOperatorSuggestions); + }); + + it('should suggest NOT initially', async () => { + expect(await getSuggestionAtEnd('')).toContainEqual(notOperatorSuggestion); + }); + + it('should suggest NOT after expression', async () => { + expect(await getSuggestionAtEnd('field: value and ')).toContainEqual(notOperatorSuggestion); + }); + + it('should not suggest NOT twice', async () => { + expect(await getSuggestionAtEnd('not ')).not.toContainEqual(notOperatorSuggestion); + }); + + it('should suggest after multiple token search', async () => { + expect(await getSuggestionAtEnd('field: one two three ')).toStrictEqual( + booleanOperatorSuggestions + ); + }); + + it('should suggest after phrase value', async () => { + expect(await getSuggestionAtEnd('field: "value" ')).toStrictEqual(booleanOperatorSuggestions); + }); + + it('should suggest after number', async () => { + expect(await getSuggestionAtEnd('field: 123 ')).toStrictEqual(booleanOperatorSuggestions); + }); + + it('should not suggest after incomplete quote', async () => { + expect(await getSuggestionAtEnd('field: "value ')).not.toStrictEqual( + booleanOperatorSuggestions + ); + }); +}); + +describe('Test Boolean Operators within groups', () => { + it('should suggest AND and OR', async () => { + expect(await getSuggestionAtEnd('field: (value ')).toStrictEqual(booleanOperatorSuggestions); + }); + + it('should suggest NOT after expression', async () => { + expect(await getSuggestionAtEnd('field: (value and ')).toContainEqual(notOperatorSuggestion); + }); + + it('should suggest operator within nested group', async () => { + expect(await getSuggestionAtEnd('field: ("one" and ("two" ')).toStrictEqual( + booleanOperatorSuggestions + ); + }); +}); + +describe('Test field suggestions', () => { + it('basic field suggestion', async () => { + expect(await getSuggestionAtEnd('')).toStrictEqual(fieldNameWithNotSuggestions); + }); + + it('field suggestion after one term', async () => { + expect(await getSuggestionAtEnd('field: value and ')).toStrictEqual( + fieldNameWithNotSuggestions + ); + }); + + it('field suggestion within group', async () => { + expect(await getSuggestionAtEnd('field: value and (one: "two" or ')).toStrictEqual( + fieldNameWithNotSuggestions + ); + }); +}); diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index f0af21be54e7..5831969a3ce2 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -41,7 +41,6 @@ const findCursorIndex = ( const findFieldSuggestions = (indexPattern: IndexPattern) => { const fieldNames: string[] = indexPattern.fields - .getAll() .filter((idxField: IndexPatternField) => !idxField.subType) // filter removed .keyword fields .map((idxField: { displayName: string }) => { return idxField.displayName; @@ -72,11 +71,11 @@ const findValueSuggestions = async (index: IndexPattern, field: string, value: s // check to see if last field is within index and if it can suggest values, first check // if .keyword appended field exists because that has values const matchedField = - index.fields.getAll().find((idxField: IndexPatternField) => { + index.fields.find((idxField: IndexPatternField) => { // check to see if the field matches another field with .keyword appended if (idxField.displayName === `${field}.keyword`) return idxField; }) || - index.fields.getAll().find((idxField: IndexPatternField) => { + index.fields.find((idxField: IndexPatternField) => { // if the display name matches, return if (idxField.displayName === field) return idxField; }); @@ -162,11 +161,13 @@ export const getSuggestions = async ({ const { field: lastField = '', value: lastValue = '' } = visitor.visit(tree) ?? {}; if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { const values = await findValueSuggestions(currentIndexPattern, lastField, lastValue ?? ''); - completions.push( - ...values.map((val: any) => { - return { text: val, type: 'value' }; - }) - ); + if (!!values) { + completions.push( + ...values?.map((val: any) => { + return { text: val, type: 'value' }; + }) + ); + } } // suggest other candidates, mainly keywords diff --git a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java index 39fd0fb4a0f9..c55b54ae7a0f 100644 --- a/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java +++ b/src/plugins/data/public/antlr/dql/grammar/.antlr/DQLParser.java @@ -503,6 +503,10 @@ public GroupContentContext groupContent(int i) { return getRuleContext(GroupContentContext.class,i); } public TerminalNode RPAREN() { return getToken(DQLParser.RPAREN, 0); } + public List NOT() { return getTokens(DQLParser.NOT); } + public TerminalNode NOT(int i) { + return getToken(DQLParser.NOT, i); + } public List OR() { return getTokens(DQLParser.OR); } public TerminalNode OR(int i) { return getToken(DQLParser.OR, i); @@ -511,10 +515,6 @@ public TerminalNode OR(int i) { public TerminalNode AND(int i) { return getToken(DQLParser.AND, i); } - public List NOT() { return getTokens(DQLParser.NOT); } - public TerminalNode NOT(int i) { - return getToken(DQLParser.NOT, i); - } public GroupExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -530,7 +530,6 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio { setState(70); match(LPAREN); - { setState(72); _errHandler.sync(this); _la = _input.LA(1); @@ -541,7 +540,6 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio } } - } setState(74); groupContent(); setState(82); @@ -560,7 +558,6 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio _errHandler.reportMatch(this); consume(); } - { setState(77); _errHandler.sync(this); _la = _input.LA(1); @@ -571,7 +568,6 @@ public final GroupExpressionContext groupExpression() throws RecognitionExceptio } } - } setState(79); groupContent(); } diff --git a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 index 433ef903ae89..d10cee485848 100644 --- a/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 +++ b/src/plugins/data/public/antlr/dql/grammar/DQLParser.g4 @@ -41,7 +41,7 @@ tokenSearch ; groupExpression - : LPAREN (NOT?) groupContent ((OR | AND) (NOT?) groupContent)* RPAREN + : LPAREN NOT? groupContent ((OR | AND) NOT? groupContent)* RPAREN ; groupContent From d0b27dc5773f82a0a692b68375515d07b2420c6a Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Tue, 23 Jul 2024 13:54:07 -0700 Subject: [PATCH 30/34] move dql test constants to separate file Signed-off-by: Paul Sebastian --- .../public/antlr/dql/code_completion.test.ts | 193 +----------------- .../data/public/antlr/shared/constants.ts | 192 +++++++++++++++++ 2 files changed, 198 insertions(+), 187 deletions(-) create mode 100644 src/plugins/data/public/antlr/shared/constants.ts diff --git a/src/plugins/data/public/antlr/dql/code_completion.test.ts b/src/plugins/data/public/antlr/dql/code_completion.test.ts index ff566dfd3347..0263a044152c 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.test.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.test.ts @@ -5,193 +5,12 @@ import { monaco } from '@osd/monaco'; import { getSuggestions } from './code_completion'; -import { IIndexPattern } from '../..'; - -const testingIndex = ({ - title: 'opensearch_dashboards_sample_data_flights', - fields: [ - { - count: 0, - name: 'Carrier', - displayName: 'Carrier', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: undefined, - }, - { - count: 2, - name: 'DestCityName', - displayName: 'DestCityName', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: undefined, - }, - { - count: 0, - name: 'DestCountry', - displayName: 'DestCountry', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: undefined, - }, - { - count: 0, - name: 'DestWeather', - displayName: 'DestWeather', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: undefined, - }, - { - count: 0, - name: 'DistanceMiles', - displayName: 'DistanceMiles', - type: 'number', - esTypes: ['float'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: undefined, - }, - { - count: 0, - name: 'FlightDelay', - displayName: 'FlightDelay', - type: 'boolean', - esTypes: ['boolean'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: undefined, - }, - { - count: 0, - name: 'FlightNum', - displayName: 'FlightNum', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: undefined, - }, - { - count: 0, - name: 'OriginWeather', - displayName: 'OriginWeather', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: undefined, - }, - { - count: 0, - name: '_id', - displayName: '_id', - type: 'string', - esTypes: ['_id'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - subType: undefined, - }, - { - count: 0, - name: '_index', - displayName: '_index', - type: 'string', - esTypes: ['_index'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - subType: undefined, - }, - { - count: 0, - name: '_score', - displayName: '_score', - type: 'number', - scripted: false, - searchable: false, - aggregatable: false, - readFromDocValues: false, - subType: undefined, - }, - { - count: 0, - name: '_source', - displayName: '_source', - type: '_source', - esTypes: ['_source'], - scripted: false, - searchable: false, - aggregatable: false, - readFromDocValues: false, - subType: undefined, - }, - { - count: 0, - name: '_type', - displayName: '_type', - type: 'string', - esTypes: ['_type'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - subType: undefined, - }, - ], -} as unknown) as IIndexPattern; - -const booleanOperatorSuggestions = [ - { text: 'or', type: 'keyword' }, - { text: 'and', type: 'keyword' }, -]; - -const notOperatorSuggestion = { text: 'not', type: 'keyword' }; - -const fieldNameSuggestions = [ - { text: 'Carrier', type: 'field' }, - { text: 'DestCityName', type: 'field' }, - { text: 'DestCountry', type: 'field' }, - { text: 'DestWeather', type: 'field' }, - { text: 'DistanceMiles', type: 'field' }, - { text: 'FlightDelay', type: 'field' }, - { text: 'FlightNum', type: 'field' }, - { text: 'OriginWeather', type: 'field' }, - { text: '_id', type: 'field' }, - { text: '_index', type: 'field' }, - { text: '_score', type: 'field' }, - { text: '_source', type: 'field' }, - { text: '_type', type: 'field' }, -]; - -const fieldNameWithNotSuggestions = fieldNameSuggestions.concat(notOperatorSuggestion); +import { + booleanOperatorSuggestions, + fieldNameWithNotSuggestions, + notOperatorSuggestion, + testingIndex, +} from '../shared/constants'; const getSuggestionsAtPos = async (query: string, endPos: number) => { return await getSuggestions({ diff --git a/src/plugins/data/public/antlr/shared/constants.ts b/src/plugins/data/public/antlr/shared/constants.ts new file mode 100644 index 000000000000..f90d4a423767 --- /dev/null +++ b/src/plugins/data/public/antlr/shared/constants.ts @@ -0,0 +1,192 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { IIndexPattern } from '../..'; + +export const testingIndex = ({ + title: 'opensearch_dashboards_sample_data_flights', + fields: [ + { + count: 0, + name: 'Carrier', + displayName: 'Carrier', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 2, + name: 'DestCityName', + displayName: 'DestCityName', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'DestCountry', + displayName: 'DestCountry', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'DestWeather', + displayName: 'DestWeather', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'DistanceMiles', + displayName: 'DistanceMiles', + type: 'number', + esTypes: ['float'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'FlightDelay', + displayName: 'FlightDelay', + type: 'boolean', + esTypes: ['boolean'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'FlightNum', + displayName: 'FlightNum', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: 'OriginWeather', + displayName: 'OriginWeather', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: undefined, + }, + { + count: 0, + name: '_id', + displayName: '_id', + type: 'string', + esTypes: ['_id'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + subType: undefined, + }, + { + count: 0, + name: '_index', + displayName: '_index', + type: 'string', + esTypes: ['_index'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + subType: undefined, + }, + { + count: 0, + name: '_score', + displayName: '_score', + type: 'number', + scripted: false, + searchable: false, + aggregatable: false, + readFromDocValues: false, + subType: undefined, + }, + { + count: 0, + name: '_source', + displayName: '_source', + type: '_source', + esTypes: ['_source'], + scripted: false, + searchable: false, + aggregatable: false, + readFromDocValues: false, + subType: undefined, + }, + { + count: 0, + name: '_type', + displayName: '_type', + type: 'string', + esTypes: ['_type'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + subType: undefined, + }, + ], +} as unknown) as IIndexPattern; + +export const booleanOperatorSuggestions = [ + { text: 'or', type: 'keyword' }, + { text: 'and', type: 'keyword' }, +]; + +export const notOperatorSuggestion = { text: 'not', type: 'keyword' }; + +export const fieldNameSuggestions = [ + { text: 'Carrier', type: 'field' }, + { text: 'DestCityName', type: 'field' }, + { text: 'DestCountry', type: 'field' }, + { text: 'DestWeather', type: 'field' }, + { text: 'DistanceMiles', type: 'field' }, + { text: 'FlightDelay', type: 'field' }, + { text: 'FlightNum', type: 'field' }, + { text: 'OriginWeather', type: 'field' }, + { text: '_id', type: 'field' }, + { text: '_index', type: 'field' }, + { text: '_score', type: 'field' }, + { text: '_source', type: 'field' }, + { text: '_type', type: 'field' }, +]; + +export const fieldNameWithNotSuggestions = fieldNameSuggestions.concat(notOperatorSuggestion); From 052fa4c0a99a86b75376a5617779a5d0a60ddd4f Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Tue, 23 Jul 2024 15:14:38 -0700 Subject: [PATCH 31/34] pass core setup from autocomplete constructor to query sugg provider and utilize selectionEnd if no position Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 42 ++++++++++++------- .../autocomplete/autocomplete_service.ts | 6 ++- .../providers/query_suggestion_provider.ts | 4 +- src/plugins/data/public/plugin.ts | 2 - src/plugins/data/public/services.ts | 2 - 5 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index 5831969a3ce2..f5632625dffc 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -5,30 +5,27 @@ import { CharStream, CommonTokenStream, TokenStream } from 'antlr4ng'; import { CodeCompletionCore } from 'antlr4-c3'; -import { monaco } from '@osd/monaco'; +import { HttpSetup } from 'opensearch-dashboards/public'; import { DQLLexer } from './.generated/DQLLexer'; import { DQLParser, KeyValueExpressionContext } from './.generated/DQLParser'; import { getTokenPosition } from '../shared/cursor'; import { IndexPattern, IndexPatternField } from '../../index_patterns'; -import { getHttp } from '../../services'; import { QuerySuggestionGetFnArgs } from '../../autocomplete'; import { DQLParserVisitor } from './.generated/DQLParserVisitor'; const findCursorIndex = ( tokenStream: TokenStream, - cursor: monaco.Position, + cursorColumn: number, + cursorLine: number, whitespaceToken: number ): number | undefined => { - const cursorCol = cursor.column - 1; + const actualCursorCol = cursorColumn - 1; for (let i = 0; i < tokenStream.size; i++) { const token = tokenStream.get(i); const { startLine, endColumn, endLine } = getTokenPosition(token, whitespaceToken); - if ( - endLine > cursor.lineNumber || - (startLine === cursor.lineNumber && endColumn >= cursorCol) - ) { + if (endLine > cursorLine || (startLine === cursorLine && endColumn >= actualCursorCol)) { if (tokenStream.get(i).type === whitespaceToken) { return i + 1; } @@ -58,16 +55,22 @@ const findFieldSuggestions = (indexPattern: IndexPattern) => { const getFieldSuggestedValues = async ( indexTitle: string, fieldName: string, - currentValue: string + currentValue: string, + http?: HttpSetup ) => { - const http = getHttp(); + if (!http) return []; return await http.fetch(`/api/opensearch-dashboards/suggestions/values/${indexTitle}`, { method: 'POST', body: JSON.stringify({ query: currentValue, field: fieldName, boolFilter: [] }), }); }; -const findValueSuggestions = async (index: IndexPattern, field: string, value: string) => { +const findValueSuggestions = async ( + index: IndexPattern, + field: string, + value: string, + http?: HttpSetup +) => { // check to see if last field is within index and if it can suggest values, first check // if .keyword appended field exists because that has values const matchedField = @@ -87,7 +90,7 @@ const findValueSuggestions = async (index: IndexPattern, field: string, value: s if (!matchedField || !matchedField.aggregatable || matchedField.type !== 'string') return; // ask api for suggestions - return await getFieldSuggestedValues(index.title, matchedField.displayName, value); + return await getFieldSuggestedValues(index.title, matchedField.displayName, value, http); }; // visitor for parsing the current query @@ -116,7 +119,10 @@ export const getSuggestions = async ({ query, indexPatterns, position, + selectionEnd, + core: coreSetup, }: QuerySuggestionGetFnArgs) => { + const http = coreSetup?.http; const currentIndexPattern = indexPatterns[0] as IndexPattern; const inputStream = CharStream.fromString(query); @@ -129,7 +135,10 @@ export const getSuggestions = async ({ const visitor = new QueryVisitor(); // find token index - const cursorIndex = findCursorIndex(tokenStream, position, DQLParser.WS) ?? 0; + const cursorColumn = position?.column ?? selectionEnd; + const cursorLine = position?.lineNumber ?? 1; + + const cursorIndex = findCursorIndex(tokenStream, cursorColumn, cursorLine, DQLParser.WS) ?? 0; const core = new CodeCompletionCore(parser); @@ -160,7 +169,12 @@ export const getSuggestions = async ({ // find suggested values for the last found field (only for kvexpression rule) const { field: lastField = '', value: lastValue = '' } = visitor.visit(tree) ?? {}; if (!!lastField && candidates.tokens.has(DQLParser.PHRASE)) { - const values = await findValueSuggestions(currentIndexPattern, lastField, lastValue ?? ''); + const values = await findValueSuggestions( + currentIndexPattern, + lastField, + lastValue ?? '', + http + ); if (!!values) { completions.push( ...values?.map((val: any) => { diff --git a/src/plugins/data/public/autocomplete/autocomplete_service.ts b/src/plugins/data/public/autocomplete/autocomplete_service.ts index 44e414581575..4eec6f48079d 100644 --- a/src/plugins/data/public/autocomplete/autocomplete_service.ts +++ b/src/plugins/data/public/autocomplete/autocomplete_service.ts @@ -47,6 +47,8 @@ export class AutocompleteService { this.autocompleteConfig = autocomplete; } + private core: CoreSetup | undefined; + private readonly querySuggestionProviders: Map = new Map(); private getValueSuggestions?: ValueSuggestionsGetFn; @@ -61,7 +63,7 @@ export class AutocompleteService { const provider = this.querySuggestionProviders.get(language); if (provider) { - return provider(args); + return provider({ core: this.core, ...args }); } }; @@ -73,6 +75,8 @@ export class AutocompleteService { ? setupValueSuggestionProvider(core) : getEmptyValueSuggestions; + this.core = core; + return { addQuerySuggestionProvider: this.addQuerySuggestionProvider, diff --git a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts index 9eb180ce231b..96d15b1a922b 100644 --- a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts +++ b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts @@ -29,6 +29,7 @@ */ import { monaco } from 'packages/osd-monaco/target'; +import { CoreSetup } from 'opensearch-dashboards/public'; import { IFieldType, IIndexPattern } from '../../../common/index_patterns'; export enum QuerySuggestionTypes { @@ -52,8 +53,9 @@ export interface QuerySuggestionGetFnArgs { selectionEnd: number; signal?: AbortSignal; boolFilter?: any; - position: monaco.Position; + position?: monaco.Position; connectionService?: any; // will need to add type when ConnectionService is properly exposed from queryEnhancements + core?: CoreSetup; } /** @public **/ diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 74b2c3d104cb..2b4cfdded172 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -58,7 +58,6 @@ import { } from './index_patterns'; import { setFieldFormats, - setHttp, setIndexPatterns, setNotifications, setOverlays, @@ -190,7 +189,6 @@ export class DataPublicPlugin setNotifications(notifications); setOverlays(overlays); setUiSettings(uiSettings); - setHttp(http); const fieldFormats = this.fieldFormatsService.start(); setFieldFormats(fieldFormats); diff --git a/src/plugins/data/public/services.ts b/src/plugins/data/public/services.ts index 8cf42862c4d4..d75dab2986ca 100644 --- a/src/plugins/data/public/services.ts +++ b/src/plugins/data/public/services.ts @@ -42,8 +42,6 @@ export const [getUiSettings, setUiSettings] = createGetterSetter('Http'); - export const [getFieldFormats, setFieldFormats] = createGetterSetter( 'FieldFormats' ); From 792da0b3a0d223fc007dab7f95d03d32dba38e18 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Wed, 24 Jul 2024 10:43:53 -0700 Subject: [PATCH 32/34] update an import Signed-off-by: Paul Sebastian --- .../public/autocomplete/providers/query_suggestion_provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts index 96d15b1a922b..c08bc3369f2e 100644 --- a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts +++ b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts @@ -28,7 +28,7 @@ * under the License. */ -import { monaco } from 'packages/osd-monaco/target'; +import { monaco } from '@osd/monaco'; import { CoreSetup } from 'opensearch-dashboards/public'; import { IFieldType, IIndexPattern } from '../../../common/index_patterns'; From 7678f9b8dee65303432b31e12c48d5b542e6d276 Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Wed, 24 Jul 2024 17:06:21 -0700 Subject: [PATCH 33/34] use updated dataset for index pattern Signed-off-by: Paul Sebastian --- .../data/public/antlr/dql/code_completion.ts | 26 +++++----- .../public/ui/query_editor/query_editor.tsx | 52 +++++++++++-------- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index f5632625dffc..b26b2295f129 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -36,11 +36,11 @@ const findCursorIndex = ( return undefined; }; -const findFieldSuggestions = (indexPattern: IndexPattern) => { +const findFieldSuggestions = (indexPattern: any) => { const fieldNames: string[] = indexPattern.fields - .filter((idxField: IndexPatternField) => !idxField.subType) // filter removed .keyword fields - .map((idxField: { displayName: string }) => { - return idxField.displayName; + .filter((idxField: IndexPatternField) => !idxField?.subType) // filter removed .keyword fields + .map((idxField: { name: string }) => { + return idxField.name; }); const fieldSuggestions: Array<{ text: string; type: string }> = fieldNames.map( @@ -65,22 +65,17 @@ const getFieldSuggestedValues = async ( }); }; -const findValueSuggestions = async ( - index: IndexPattern, - field: string, - value: string, - http?: HttpSetup -) => { +const findValueSuggestions = async (index: any, field: string, value: string, http?: HttpSetup) => { // check to see if last field is within index and if it can suggest values, first check // if .keyword appended field exists because that has values const matchedField = index.fields.find((idxField: IndexPatternField) => { // check to see if the field matches another field with .keyword appended - if (idxField.displayName === `${field}.keyword`) return idxField; + if (idxField.name === `${field}.keyword`) return idxField; }) || index.fields.find((idxField: IndexPatternField) => { // if the display name matches, return - if (idxField.displayName === field) return idxField; + if (idxField.name === field) return idxField; }); if (matchedField?.type === 'boolean') { @@ -90,7 +85,7 @@ const findValueSuggestions = async ( if (!matchedField || !matchedField.aggregatable || matchedField.type !== 'string') return; // ask api for suggestions - return await getFieldSuggestedValues(index.title, matchedField.displayName, value, http); + return await getFieldSuggestedValues(index.title, matchedField.name, value, http); }; // visitor for parsing the current query @@ -122,8 +117,11 @@ export const getSuggestions = async ({ selectionEnd, core: coreSetup, }: QuerySuggestionGetFnArgs) => { + console.log('indexpa', indexPatterns); + const http = coreSetup?.http; - const currentIndexPattern = indexPatterns[0] as IndexPattern; + const currentIndexPattern = indexPatterns[0]; + console.log('curr', currentIndexPattern); const inputStream = CharStream.fromString(query); const lexer = new DQLLexer(inputStream); diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index 9db89004d8ae..0bd722cd496a 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -25,10 +25,11 @@ import { QuerySuggestion } from '../../autocomplete'; import { fromUser, getQueryLog, PersistedLog, toUser } from '../../query'; import { SuggestionsListSize } from '../typeahead/suggestions_component'; import { DataSettings } from '../types'; -import { fetchIndexPatterns } from './fetch_index_patterns'; import { QueryLanguageSelector } from './language_selector'; import { QueryEditorExtensions } from './query_editor_extensions'; import { QueryEditorBtnCollapse } from './query_editor_btn_collapse'; +import { getQueryService } from '../../services'; +import { SIMPLE_DATA_SET_TYPES } from '../../../common'; const LANGUAGE_ID_SQL = 'SQL'; monaco.languages.register({ id: LANGUAGE_ID_SQL }); @@ -107,6 +108,8 @@ export default class QueryEditorUI extends Component { public inputRef: monaco.editor.IStandaloneCodeEditor | null = null; + private queryService = getQueryService(); + private persistedLog: PersistedLog | undefined; private abortController?: AbortController; private services = this.props.opensearchDashboards.services; @@ -121,26 +124,6 @@ export default class QueryEditorUI extends Component { return toUser(this.props.query.query); }; - // TODO: MQL don't do this here? || Fetch data sources - private fetchIndexPatterns = async () => { - const stringPatterns = this.props.indexPatterns.filter( - (indexPattern) => typeof indexPattern === 'string' - ) as string[]; - const objectPatterns = this.props.indexPatterns.filter( - (indexPattern) => typeof indexPattern !== 'string' - ) as IIndexPattern[]; - - const objectPatternsFromStrings = (await fetchIndexPatterns( - this.services.savedObjects!.client, - stringPatterns, - this.services.uiSettings! - )) as IIndexPattern[]; - - this.setState({ - indexPatterns: [...objectPatterns, ...objectPatternsFromStrings], - }); - }; - private renderQueryEditorExtensions() { if ( !( @@ -305,18 +288,43 @@ export default class QueryEditorUI extends Component { } }; + private fetchIndexPatterns = async () => { + const client = this.services.savedObjects.client; + const dataSet = this.queryService.dataSet.getDataSet(); + const title = dataSet?.title; + + const resp = await client.find({ + type: 'index-pattern', + fields: ['title', 'timeFieldName', 'fields'], + search: `${title}*`, + searchFields: ['title'], + perPage: 100, + }); + + return resp.savedObjects.map((savedObject: any) => ({ + id: savedObject.id, + title: savedObject.attributes?.title, + timeFieldName: savedObject.attributes?.timeFieldName, + fields: JSON.parse(savedObject.attributes?.fields), + type: SIMPLE_DATA_SET_TYPES.INDEX_PATTERN, + })); + }; + provideCompletionItems = async ( model: monaco.editor.ITextModel, position: monaco.Position ): Promise => { const enhancements = this.props.settings.getQueryEnhancements(this.props.query.language); const connectionService = enhancements?.connectionService; + + const indexPatterns = await this.fetchIndexPatterns(); + const suggestions = await this.services.data.autocomplete.getQuerySuggestions({ query: this.getQueryString(), selectionStart: model.getOffsetAt(position), selectionEnd: model.getOffsetAt(position), language: this.props.query.language, - indexPatterns: this.state.indexPatterns, + indexPatterns, position, connectionService, }); From cde949988f857f0b234593a33606b525294bf6be Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Thu, 25 Jul 2024 10:59:04 -0700 Subject: [PATCH 34/34] remove console log Signed-off-by: Paul Sebastian --- src/plugins/data/public/antlr/dql/code_completion.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/plugins/data/public/antlr/dql/code_completion.ts b/src/plugins/data/public/antlr/dql/code_completion.ts index b26b2295f129..37ff62e2fdca 100644 --- a/src/plugins/data/public/antlr/dql/code_completion.ts +++ b/src/plugins/data/public/antlr/dql/code_completion.ts @@ -117,11 +117,8 @@ export const getSuggestions = async ({ selectionEnd, core: coreSetup, }: QuerySuggestionGetFnArgs) => { - console.log('indexpa', indexPatterns); - const http = coreSetup?.http; const currentIndexPattern = indexPatterns[0]; - console.log('curr', currentIndexPattern); const inputStream = CharStream.fromString(query); const lexer = new DQLLexer(inputStream);