forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Antlr autocomplete (opensearch-project#7159)
* dql grammar with rudamentary testing parser Signed-off-by: Paul Sebastian <paulstn@amazon.com> * show suggestion of fields depending on current index pattern Signed-off-by: Paul Sebastian <paulstn@amazon.com> * basic code completion with fields populated Signed-off-by: Paul Sebastian <paulstn@amazon.com> * updated grammar and generated for better group handling Signed-off-by: Paul Sebastian <paulstn@amazon.com> * add ignored tokens Signed-off-by: Paul Sebastian <paulstn@amazon.com> * remove console logs Signed-off-by: Paul Sebastian <paulstn@amazon.com> --------- Signed-off-by: Paul Sebastian <paulstn@amazon.com>
- Loading branch information
Showing
19 changed files
with
3,112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}; |
62 changes: 62 additions & 0 deletions
62
src/plugins/data/public/antlr/dql/generated/DQLLexer.interp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
23 changes: 23 additions & 0 deletions
23
src/plugins/data/public/antlr/dql/generated/DQLLexer.tokens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
121 changes: 121 additions & 0 deletions
121
src/plugins/data/public/antlr/dql/generated/DQLLexer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) ); | ||
} |
55 changes: 55 additions & 0 deletions
55
src/plugins/data/public/antlr/dql/generated/DQLParser.interp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
23 changes: 23 additions & 0 deletions
23
src/plugins/data/public/antlr/dql/generated/DQLParser.tokens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.