diff --git a/js_modules/dagster-ui/.gitattributes b/js_modules/dagster-ui/.gitattributes index 5f2520c20b743..bf95c09ab463e 100644 --- a/js_modules/dagster-ui/.gitattributes +++ b/js_modules/dagster-ui/.gitattributes @@ -8,4 +8,5 @@ packages/ui-core/src/graphql/* linguist-generated=true packages/ui-core/src/**/types/* linguist-generated=true packages/ui-core/client.json linguist-generated=true packages/ui-core/src/asset-selection/generated/* linguist-generated=true +packages/ui-core/src/selection/generated/* linguist-generated=true packages/ui-core/src/run-selection/generated/* linguist-generated=true diff --git a/js_modules/dagster-ui/packages/ui-core/package.json b/js_modules/dagster-ui/packages/ui-core/package.json index a17017e2ce43d..af7ba534148f7 100644 --- a/js_modules/dagster-ui/packages/ui-core/package.json +++ b/js_modules/dagster-ui/packages/ui-core/package.json @@ -15,6 +15,7 @@ "generate-graphql": "ts-node -O '{\"module\": \"commonjs\"}' ./src/scripts/generateGraphQLTypes.ts", "generate-perms": "ts-node -O '{\"module\": \"commonjs\"}' ./src/scripts/generatePermissions.ts", "generate-asset-selection": "ts-node -O '{\"module\": \"commonjs\"}' ./src/scripts/generateAssetSelection.ts && eslint src/asset-selection/generated/ --fix -c .eslintrc.js", + "generate-selection-autocomplete": "ts-node -O '{\"module\": \"commonjs\"}' ./src/scripts/generateSelection.ts && eslint src/selection/generated/ --fix -c .eslintrc.js", "generate-run-selection": "ts-node -O '{\"module\": \"commonjs\"}' ./src/scripts/generateRunSelection.ts && eslint src/run-selection/generated/ --fix -c .eslintrc.js", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build" diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionAutoComplete.ts b/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionAutoComplete.ts deleted file mode 100644 index 6ef3c0dfd86a3..0000000000000 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionAutoComplete.ts +++ /dev/null @@ -1,246 +0,0 @@ -import CodeMirror, {HintFunction, Hints} from 'codemirror'; - -import {assertUnreachable} from '../../app/Util'; -import {AssetGraphQueryItem} from '../../asset-graph/useAssetGraphData'; -import {buildRepoPathForHuman} from '../../workspace/buildRepoAddress'; - -export const possibleKeywords = [ - 'key:', - 'key_substring:', - 'tag:', - 'owner:', - 'group:', - 'kind:', - 'code_location:', - 'sinks()', - 'roots()', - 'not', - '*', - '+', -]; - -const logicalOperators = ['and', 'or', '*', '+']; - -export const createAssetSelectionHint = (assets: AssetGraphQueryItem[]): HintFunction => { - const assetNamesSet: Set = new Set(); - const tagNamesSet: Set = new Set(); - const ownersSet: Set = new Set(); - const groupsSet: Set = new Set(); - const kindsSet: Set = new Set(); - const codeLocationSet: Set = new Set(); - - assets.forEach((asset) => { - assetNamesSet.add(asset.name); - asset.node.tags.forEach((tag) => { - if (tag.key && tag.value) { - tagNamesSet.add(`${tag.key}=${tag.value}`); - } else { - tagNamesSet.add(tag.key); - } - }); - asset.node.owners.forEach((owner) => { - switch (owner.__typename) { - case 'TeamAssetOwner': - ownersSet.add(owner.team); - break; - case 'UserAssetOwner': - ownersSet.add(owner.email); - break; - default: - assertUnreachable(owner); - } - }); - if (asset.node.groupName) { - groupsSet.add(asset.node.groupName); - } - asset.node.kinds.forEach((kind) => { - kindsSet.add(kind); - }); - const location = buildRepoPathForHuman( - asset.node.repository.name, - asset.node.repository.location.name, - ); - codeLocationSet.add(location); - }); - - const assetNames = Array.from(assetNamesSet).map(addQuotesToString); - const tagNames = Array.from(tagNamesSet).map(addQuotesToString); - const owners = Array.from(ownersSet).map(addQuotesToString); - const groups = Array.from(groupsSet).map(addQuotesToString); - const kinds = Array.from(kindsSet).map(addQuotesToString); - const codeLocations = Array.from(codeLocationSet).map(addQuotesToString); - - return (cm: CodeMirror.Editor): Hints | undefined => { - const cursor = cm.getCursor(); - const token = cm.getTokenAt(cursor); - - const indexOfToken: number = token.state.tokenIndex - 1; - const allTokens = token.state.tokens; - - const previous2Tokens = - token.string.trim() === '' - ? [allTokens[indexOfToken - 1]?.text, allTokens[indexOfToken]?.text] - : [allTokens[indexOfToken - 2]?.text, allTokens[indexOfToken - 1]?.text]; - - let start = token.start; - const end = token.end; - const tokenString = token.string.trim(); - const tokenUpToCursor = cm.getRange(CodeMirror.Pos(cursor.line, start), cursor).trim(); - const unquotedTokenString = removeQuotesFromString(tokenString); - - const isAfterAttributeValue = previous2Tokens[0] === ':' && previous2Tokens[1] !== undefined; - - const isAfterParenthesizedExpressions = - // if tokenUpToCursor === '' and tokenString ===') then the cursor is to the left of the parenthesis - previous2Tokens[1] === ')' || (tokenString === ')' && tokenUpToCursor !== ''); - - const isInKeyValue = - (previous2Tokens[1] === ':' && token.string.trim() !== '') || tokenString === ':'; - - const isTraversal = /^[*+]+$/.test(tokenString); - - const tokensBefore = allTokens - .slice(0, indexOfToken + 1) - .map((token: any) => token.text?.trim()); - const preTraversal = isTraversal && isPreTraversal(tokensBefore); - const isPostTraversal = isTraversal && !preTraversal; - - const isEndOfKeyValueExpression = - isInKeyValue && - tokenString.endsWith('"') && - tokenString.length > 2 && - tokenUpToCursor.endsWith('"'); - - const isAfterTraversal = ['+', '*'].includes(previous2Tokens[1]); - - function getSuggestions() { - if (isEndOfKeyValueExpression) { - start = end; - } - - if ( - isPostTraversal || - isAfterAttributeValue || - isAfterParenthesizedExpressions || - isEndOfKeyValueExpression || - isAfterTraversal - ) { - return logicalOperators; - } - - if (isInKeyValue) { - let type = previous2Tokens[0]; - if (tokenString === ':') { - type = previous2Tokens[1]; - } - switch (type) { - case 'key_substring': - case 'key': - return assetNames; - case 'tag': - return tagNames; - case 'owner': - return owners; - case 'group': - return groups; - case 'kind': - return kinds; - case 'code_location': - return codeLocations; - } - } - - if (tokenString === '' || tokenString === '(' || tokenString === ')' || preTraversal) { - return possibleKeywords; - } - return [ - `key_substring:"${unquotedTokenString}"`, - `key:"${unquotedTokenString}"`, - ...possibleKeywords, - ]; - } - - let suggestions = getSuggestions(); - - if (!(isTraversal || isEndOfKeyValueExpression || ['', ':', '(', ')'].includes(tokenString))) { - suggestions = suggestions.filter( - (item) => - item.startsWith(tokenString) || - item.startsWith(unquotedTokenString) || - item.includes(`:"${unquotedTokenString}`) || - item.startsWith(`"${unquotedTokenString}`), - ); - } - - const list = suggestions.map((item) => { - let text = item; - if (token.string[0] === ' ') { - text = ' ' + item; - } - if (tokenString === ':') { - text = `:${item}`; - } - - if (tokenString === '(') { - text = `(${text}`; - } - if (tokenString === ')') { - if (isAfterParenthesizedExpressions) { - text = `) ${text}`; - } else { - text = `${text})`; - } - } - - const trimmedText = text.trim(); - - if (isTraversal) { - if (text === '+' || text === '*') { - text = `${tokenString}${text}`; - } else if (trimmedText === 'and' || trimmedText === 'or' || trimmedText === 'not') { - text = `${tokenString} ${text}`; - } - } else if (trimmedText === 'and' || trimmedText === 'or' || trimmedText === 'not') { - text = ` ${trimmedText} `; // Insert spaces around the logical operator - } - - return { - text: text.replaceAll(/(\s)+/g, ' ').replaceAll(/(")+/g, '"'), - displayText: removeQuotesFromString(item), - }; - }); - - return { - list, - from: CodeMirror.Pos(cursor.line, start), - to: CodeMirror.Pos(cursor.line, end), - }; - }; -}; - -const removeQuotesFromString = (value: string) => { - if (value.length > 1 && value[0] === '"' && value[value.length - 1] === '"') { - return value.slice(1, value.length - 1); - } - return value; -}; - -const addQuotesToString = (value: string) => `"${value}"`; - -const isPreTraversal = (tokensBefore: string[]) => { - // If there are no tokens before, it's the start of the line - if (tokensBefore.length === 0) { - return true; - } - - const previousToken = tokensBefore[tokensBefore.length - 1]; - - // Check if the previous token is 'and', 'or', or '(' - return ( - previousToken === 'and' || - previousToken === 'or' || - previousToken === '(' || - !previousToken || - tokensBefore.every((token) => ['*', '+'].includes(token)) - ); -}; diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionInput.oss.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionInput.oss.tsx index ef85abc7f3120..f3060d7f460f8 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionInput.oss.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionInput.oss.tsx @@ -1,14 +1,19 @@ -import {Colors, Icon, TextInputStyles} from '@dagster-io/ui-components'; +import {Colors, Icon, Icons} from '@dagster-io/ui-components'; import CodeMirror, {Editor, HintFunction} from 'codemirror'; import {useLayoutEffect, useMemo, useRef} from 'react'; -import styled, {createGlobalStyle} from 'styled-components'; +import styled, {createGlobalStyle, css} from 'styled-components'; -import {createAssetSelectionHint} from './AssetSelectionAutoComplete'; import {lintAssetSelection} from './AssetSelectionLinter'; -import {assetSelectionMode} from './AssetSelectionMode'; +import {assertUnreachable} from '../../app/Util'; import {AssetGraphQueryItem} from '../../asset-graph/useAssetGraphData'; import {useUpdatingRef} from '../../hooks/useUpdatingRef'; +import {createSelectionHint} from '../../selection/SelectionAutoComplete'; +import { + SelectionAutoCompleteInputCSS, + applyStaticSyntaxHighlighting, +} from '../../selection/SelectionAutoCompleteHighlighter'; import {placeholderTextForItems} from '../../ui/GraphQueryInput'; +import {buildRepoPathForHuman} from '../../workspace/buildRepoAddress'; import 'codemirror/addon/edit/closebrackets'; import 'codemirror/lib/codemirror.css'; @@ -24,18 +29,81 @@ interface AssetSelectionInputProps { onChange: (value: string) => void; } +const FUNCTIONS = ['sinks', 'roots']; + export const AssetSelectionInput = ({value, onChange, assets}: AssetSelectionInputProps) => { const editorRef = useRef(null); const cmInstance = useRef(null); const currentValueRef = useRef(value); - const hintRef = useUpdatingRef(useMemo(() => createAssetSelectionHint(assets), [assets])); + const hintRef = useUpdatingRef( + useMemo(() => { + const assetNamesSet: Set = new Set(); + const tagNamesSet: Set = new Set(); + const ownersSet: Set = new Set(); + const groupsSet: Set = new Set(); + const kindsSet: Set = new Set(); + const codeLocationSet: Set = new Set(); + + assets.forEach((asset) => { + assetNamesSet.add(asset.name); + asset.node.tags.forEach((tag) => { + if (tag.key && tag.value) { + tagNamesSet.add(`${tag.key}=${tag.value}`); + } else { + tagNamesSet.add(tag.key); + } + }); + asset.node.owners.forEach((owner) => { + switch (owner.__typename) { + case 'TeamAssetOwner': + ownersSet.add(owner.team); + break; + case 'UserAssetOwner': + ownersSet.add(owner.email); + break; + default: + assertUnreachable(owner); + } + }); + if (asset.node.groupName) { + groupsSet.add(asset.node.groupName); + } + asset.node.kinds.forEach((kind) => { + kindsSet.add(kind); + }); + const location = buildRepoPathForHuman( + asset.node.repository.name, + asset.node.repository.location.name, + ); + codeLocationSet.add(location); + }); + + const assetNames = Array.from(assetNamesSet); + const tagNames = Array.from(tagNamesSet); + const owners = Array.from(ownersSet); + const groups = Array.from(groupsSet); + const kinds = Array.from(kindsSet); + const codeLocations = Array.from(codeLocationSet); + + return createSelectionHint( + 'key', + { + key: assetNames, + tag: tagNames, + owner: owners, + group: groups, + kind: kinds, + code_location: codeLocations, + }, + FUNCTIONS, + ); + }, [assets]), + ); useLayoutEffect(() => { if (editorRef.current && !cmInstance.current) { - CodeMirror.defineMode('assetSelection', assetSelectionMode); - cmInstance.current = CodeMirror(editorRef.current, { value, mode: 'assetSelection', @@ -66,11 +134,11 @@ export const AssetSelectionInput = ({value, onChange, assets}: AssetSelectionInp }); cmInstance.current.on('change', (instance: Editor, change) => { - const newValue = instance.getValue(); + const newValue = instance.getValue().replace(/\s+/g, ' '); currentValueRef.current = newValue; onChange(newValue); - if (change.origin === 'complete' && change.text[0]?.endsWith(')')) { + if (change.origin === 'complete' && change.text[0]?.endsWith('()')) { // Set cursor inside the right parenthesis const cursor = instance.getCursor(); instance.setCursor({...cursor, ch: cursor.ch - 1}); @@ -82,8 +150,17 @@ export const AssetSelectionInput = ({value, onChange, assets}: AssetSelectionInp }); cmInstance.current.on('cursorActivity', (instance: Editor) => { + applyStaticSyntaxHighlighting(instance); showHint(instance, hintRef.current); }); + + requestAnimationFrame(() => { + if (!cmInstance.current) { + return; + } + + applyStaticSyntaxHighlighting(cmInstance.current); + }); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -117,65 +194,24 @@ export const AssetSelectionInput = ({value, onChange, assets}: AssetSelectionInp ); }; - -const InputDiv = styled.div` - height: 32px; - width: 100%; - ${TextInputStyles} - flex-shrink: 1; - overflow: auto; - - .CodeMirror-placeholder.CodeMirror-placeholder.CodeMirror-placeholder { - color: ${Colors.textLighter()}; - } - - .CodeMirror-vscrollbar, - .CodeMirror-hscrollbar { - display: none !important; - } - - .CodeMirror-sizer, - .CodeMirror-lines { - height: 20px !important; - padding: 0; - } - - .CodeMirror-cursor.CodeMirror-cursor { - border-color: ${Colors.textLight()}; - } - - .CodeMirror { - background: transparent; - color: ${Colors.textDefault()}; - } - - .cm-attribute { - color: ${Colors.textCyan()}; - font-weight: bold; - } - - .cm-operator { - color: ${Colors.textRed()}; - font-weight: bold; - } - - .cm-string { - color: ${Colors.textGreen()}; - } - - .cm-function { - color: ${Colors.textYellow()}; - font-style: italic; +const iconStyle = (img: string) => css` + &:before { + content: ' '; + width: 14px; + mask-size: contain; + mask-repeat: no-repeat; + mask-position: center; + mask-image: url(${img}); + background: ${Colors.accentPrimary()}; + display: inline-block; } +`; - .cm-punctuation { - color: ${Colors.textDefault()}; - } +const InputDiv = styled.div` + ${SelectionAutoCompleteInputCSS} - .cm-error { - text-decoration-line: underline; - text-decoration-style: wavy; - text-decoration-color: ${Colors.accentRed()}; + .attribute-owner { + ${iconStyle(Icons.owner.src)} } `; @@ -200,6 +236,11 @@ const GlobalHintStyles = createGlobalStyle` function showHint(instance: Editor, hint: HintFunction) { requestAnimationFrame(() => { - instance.showHint({hint, completeSingle: false, moveOnOverlap: true}); + instance.showHint({ + hint, + completeSingle: false, + moveOnOverlap: true, + updateOnCursorActivity: true, + }); }); } diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionLinter.ts b/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionLinter.ts index 52bbb00b1b305..f1f1eb059c23e 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionLinter.ts +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionLinter.ts @@ -1,22 +1,26 @@ import {CharStreams, CommonTokenStream} from 'antlr4ts'; import CodeMirror from 'codemirror'; -import {SyntaxErrorListener} from './AssetSelectionSyntaxErrorListener'; +import {AssetSelectionSyntaxErrorListener} from './AssetSelectionSyntaxErrorListener'; import {AssetSelectionLexer} from '../generated/AssetSelectionLexer'; import {AssetSelectionParser} from '../generated/AssetSelectionParser'; export const lintAssetSelection = (text: string) => { + const errorListener = new AssetSelectionSyntaxErrorListener(); + const inputStream = CharStreams.fromString(text); const lexer = new AssetSelectionLexer(inputStream); + + lexer.removeErrorListeners(); + lexer.addErrorListener(errorListener); + const tokens = new CommonTokenStream(lexer); const parser = new AssetSelectionParser(tokens); - const errorListener = new SyntaxErrorListener(); parser.removeErrorListeners(); // Remove default console error listener parser.addErrorListener(errorListener); - // Attempt to parse the input - parser.start(); // Assuming 'start' is the entry point of your grammar + parser.start(); // Map syntax errors to CodeMirror's lint format const lintErrors = errorListener.errors.map((error) => ({ diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionMode.ts b/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionMode.ts deleted file mode 100644 index dfcaaa0013cec..0000000000000 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionMode.ts +++ /dev/null @@ -1,128 +0,0 @@ -import {CharStreams, Token, Vocabulary} from 'antlr4ts'; -import {Mode} from 'codemirror'; - -import {AssetSelectionLexer} from '../generated/AssetSelectionLexer'; - -// Define an interface for the state to keep track of tokens and errors -interface AssetSelectionState { - tokens: Token[]; - tokenIndex: number; - errors: {start: number; end: number; message: string}[]; -} - -export function assetSelectionMode(): Mode { - return { - startState(): AssetSelectionState { - return { - tokens: [], - tokenIndex: 0, - errors: [], - }; - }, - token(stream, state) { - // Consume any whitespace at the current stream position - while (/\s/.test(stream.peek() ?? '')) { - stream.next(); - } - - // If all tokens have been processed, lex the rest of the line - if (state.tokenIndex >= state.tokens.length) { - // Read the rest of the line from the current position - const currentLine = stream.string.slice(stream.pos); - - if (currentLine.length === 0) { - // No more input to process - return null; - } - - try { - // Create a CharStream from the current line - const inputStream = CharStreams.fromString(currentLine); - - // Initialize the lexer with the input stream - const lexer = new AssetSelectionLexer(inputStream); - - // Collect all tokens from the lexer - const tokens: Token[] = []; - let token = lexer.nextToken(); - while (token.type !== Token.EOF) { - tokens.push(token); - token = lexer.nextToken(); - } - - // Update the state with the new tokens - state.tokens = tokens; - state.tokenIndex = 0; - } catch { - // Advance the stream to the end, marking as error - stream.skipToEnd(); - - // Return the 'error' style - return 'error'; - } - } - - if (state.tokenIndex < state.tokens.length) { - const token = state.tokens[state.tokenIndex++]!; - const tokenText = token.text!; - - // Consume any whitespace before matching the token - while (/\s/.test(stream.peek() ?? '')) { - stream.next(); - } - - // Match the token text from the stream - if (stream.match(tokenText)) { - // Map the token type to a CodeMirror style - const style = tokenTypeToStyle(token.type, AssetSelectionLexer.VOCABULARY); - return style; - } else { - // If there's a mismatch, consume the rest of the line and mark as error - stream.skipToEnd(); - return 'error'; - } - } else { - // No more tokens; skip to the end of the line - stream.skipToEnd(); - return null; - } - }, - }; -} - -function tokenTypeToStyle(tokenType: number, vocabulary: Vocabulary): string | null { - const tokenName = vocabulary.getSymbolicName(tokenType); - switch (tokenName) { - case 'KEY': - case 'KEY_SUBSTRING': - case 'TAG': - case 'OWNER': - case 'GROUP': - case 'KIND': - case 'CODE_LOCATION': - return 'attribute'; - case 'AND': - case 'OR': - case 'NOT': - return 'operator'; - case 'QUOTED_STRING': - case 'UNQUOTED_STRING': - return 'string'; - case 'SINKS': - case 'ROOTS': - return 'function'; - case 'STAR': - case 'PLUS': - return 'operator'; - case 'COLON': - case 'EQUAL': - case 'LPAREN': - case 'RPAREN': - case 'COMMA': - return 'punctuation'; - case 'WS': - return null; - default: - return 'error'; // Map any unknown tokens to 'error' style - } -} diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionSyntaxErrorListener.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionSyntaxErrorListener.tsx index c2bba4c13a072..89d87f2dbf09e 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionSyntaxErrorListener.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-selection/input/AssetSelectionSyntaxErrorListener.tsx @@ -6,7 +6,7 @@ interface SyntaxError { column: number; } -export class SyntaxErrorListener implements ANTLRErrorListener { +export class AssetSelectionSyntaxErrorListener implements ANTLRErrorListener { public errors: SyntaxError[] = []; syntaxError( @@ -15,7 +15,7 @@ export class SyntaxErrorListener implements ANTLRErrorListener { line: number, charPositionInLine: number, msg: string, - e: RecognitionException | undefined, + _e: RecognitionException | undefined, ): void { this.errors.push({ message: msg, diff --git a/js_modules/dagster-ui/packages/ui-core/src/pipelines/Description.tsx b/js_modules/dagster-ui/packages/ui-core/src/pipelines/Description.tsx index ba9834a38808c..d44e41b7178ed 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/pipelines/Description.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/pipelines/Description.tsx @@ -91,7 +91,7 @@ export const Description = ({maxHeight, description, fontSize}: IDescriptionProp )}
- {removeLeadingSpaces(description)} + {removeLeadingSpaces(description.replace('```', '```sql'))}
); diff --git a/js_modules/dagster-ui/packages/ui-core/src/scripts/generateSelection.ts b/js_modules/dagster-ui/packages/ui-core/src/scripts/generateSelection.ts new file mode 100644 index 0000000000000..8867ab86d630e --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/scripts/generateSelection.ts @@ -0,0 +1,16 @@ +import {execSync} from 'child_process'; +import path from 'path'; + +const SELECTION_GRAMMAR_FILE_PATH = path.resolve('./src/selection/SelectionAutoComplete.g4'); +execSync(`antlr4ts -visitor -o ./src/selection/generated ${SELECTION_GRAMMAR_FILE_PATH}`); + +const files = [ + 'SelectionAutoCompleteLexer.ts', + 'SelectionAutoCompleteListener.ts', + 'SelectionAutoCompleteParser.ts', + 'SelectionAutoCompleteVisitor.ts', +]; + +files.forEach((file) => { + execSync(`yarn prettier ./src/selection/generated/${file} --write`); +}); diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/CustomErrorListener.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/CustomErrorListener.ts new file mode 100644 index 0000000000000..39b40f9dcc68e --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/CustomErrorListener.ts @@ -0,0 +1,37 @@ +import {ANTLRErrorListener, RecognitionException, Recognizer} from 'antlr4ts'; +import {Token} from 'antlr4ts/Token'; + +export interface SyntaxError { + message: string; + line: number; + column: number; + offendingSymbol: Token | null; +} + +export class CustomErrorListener implements ANTLRErrorListener { + private errors: SyntaxError[]; + + constructor() { + this.errors = []; + } + + syntaxError( + _recognizer: Recognizer, + offendingSymbol: any, + line: number, + charPositionInLine: number, + msg: string, + _e: RecognitionException | undefined, + ): void { + this.errors.push({ + message: msg, + line, + column: charPositionInLine, + offendingSymbol, + }); + } + + getErrors(): SyntaxError[] { + return this.errors; + } +} diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.g4 b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.g4 new file mode 100644 index 0000000000000..0c0e290cb6c0b --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.g4 @@ -0,0 +1,126 @@ +grammar SelectionAutoComplete; + +start: expr EOF; + +/* + * Apply a specific whitespace parser rule (e.g., afterLogicalOperatorWhitespace, + * afterExpressionWhitespace) after every leaf node. This strategy prevents multiple parser rules + * from conflicting over the same whitespace. Add more whitespace types to adjust autocomplete + * boundary behavior within and after tokens. + */ +expr: + traversalAllowedExpr # TraversalAllowedExpression + | upTraversalExpr traversalAllowedExpr downTraversalExpr # UpAndDownTraversalExpression + | upTraversalExpr traversalAllowedExpr # UpTraversalExpression + | traversalAllowedExpr downTraversalExpr # DownTraversalExpression + | notToken postNotOperatorWhitespace expr # NotExpression + | expr andToken postLogicalOperatorWhitespace expr # AndExpression + | expr orToken postLogicalOperatorWhitespace expr # OrExpression + | expr andToken postLogicalOperatorWhitespace # IncompleteAndExpression + | expr orToken postLogicalOperatorWhitespace # IncompleteOrExpression + | notToken postNotOperatorWhitespace # IncompleteNotExpression + | STAR postExpressionWhitespace # AllExpression + | value postExpressionWhitespace # UnmatchedValue; + +// Allowed expressions within traversal contexts +traversalAllowedExpr: + attributeName colonToken attributeValue postAttributeValueWhitespace # AttributeExpression + | functionName parenthesizedExpr # FunctionCallExpression + | parenthesizedExpr # TraversalAllowedParenthesizedExpression + | incompleteExpr # IncompleteExpression; + +parenthesizedExpr: + leftParenToken postLogicalOperatorWhitespace expr rightParenToken postExpressionWhitespace # + ParenthesizedExpression; + +incompleteExpr: + attributeName colonToken attributeValueWhitespace # IncompleteAttributeExpressionMissingValue + | functionName expressionLessParenthesizedExpr # ExpressionlessFunctionExpression + | functionName leftParenToken postLogicalOperatorWhitespace # + UnclosedExpressionlessFunctionExpression + | functionName leftParenToken expr # UnclosedFunctionExpression + | leftParenToken postLogicalOperatorWhitespace expr # UnclosedParenthesizedExpression + | expressionLessParenthesizedExpr # ExpressionlessParenthesizedExpressionWrapper + | leftParenToken postLogicalOperatorWhitespace # UnclosedExpressionlessParenthesizedExpression + | PLUS+ postNeighborTraversalWhitespace # IncompletePlusTraversalExpression + | colonToken attributeValue postExpressionWhitespace # IncompleteAttributeExpressionMissingKey; + +expressionLessParenthesizedExpr: + leftParenToken postLogicalOperatorWhitespace rightParenToken postExpressionWhitespace # + ExpressionlessParenthesizedExpression; + +upTraversalExpr: + traversal postUpwardTraversalWhitespace # UpTraversal; + +downTraversalExpr: + traversal postDownwardTraversalWhitespace # DownTraversal; + +traversal: STAR | PLUS+; + +// Attribute and function names (to be validated externally) +attributeName: IDENTIFIER; + +attributeValue: value; + +functionName: IDENTIFIER; + +orToken: OR; + +andToken: AND; + +notToken: NOT; + +colonToken: COLON; + +leftParenToken: LPAREN; + +rightParenToken: RPAREN; + +attributeValueWhitespace: WS*; + +postAttributeValueWhitespace: WS*; + +postExpressionWhitespace: WS*; + +postNotOperatorWhitespace: WS*; + +postLogicalOperatorWhitespace: WS*; + +postNeighborTraversalWhitespace: WS*; + +postUpwardTraversalWhitespace: WS*; + +postDownwardTraversalWhitespace: WS*; + +// Value can be a quoted string, unquoted string, or identifier +value: + QUOTED_STRING # QuotedStringValue + | INCOMPLETE_LEFT_QUOTED_STRING # IncompleteLeftQuotedStringValue + | INCOMPLETE_RIGHT_QUOTED_STRING # IncompleteRightQuotedStringValue + | IDENTIFIER # UnquotedStringValue; + +// Tokens for operators and keywords +AND: 'and'; +OR: 'or'; +NOT: 'not'; + +STAR: '*'; +PLUS: '+'; + +COLON: ':'; + +LPAREN: '('; +RPAREN: ')'; + +EQUAL: '='; + +// Tokens for strings +QUOTED_STRING: '"' (~["\\\r\n])* '"'; +INCOMPLETE_LEFT_QUOTED_STRING: '"' (~["\\\r\n():])*; +INCOMPLETE_RIGHT_QUOTED_STRING: (~["\\\r\n:()])* '"'; + +// Identifiers (attributes and functions) +IDENTIFIER: [a-zA-Z_][a-zA-Z0-9_]*; + +// Whitespace +WS: [ \t\r\n]+; \ No newline at end of file diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.ts new file mode 100644 index 0000000000000..8603de6447fe8 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.ts @@ -0,0 +1,584 @@ +import {ParserRuleContext} from 'antlr4ts'; +import {AbstractParseTreeVisitor} from 'antlr4ts/tree/AbstractParseTreeVisitor'; +import {ParseTree} from 'antlr4ts/tree/ParseTree'; +import {RuleNode} from 'antlr4ts/tree/RuleNode'; +import CodeMirror from 'codemirror'; + +import {parseInput} from './SelectionAutoCompleteInputParser'; +import { + isInsideExpressionlessParenthesizedExpression, + removeQuotesFromString, +} from './SelectionAutoCompleteUtil'; +import { + AllExpressionContext, + AndTokenContext, + AttributeNameContext, + AttributeValueContext, + ColonTokenContext, + DownTraversalContext, + FunctionNameContext, + IncompleteAttributeExpressionMissingValueContext, + IncompletePlusTraversalExpressionContext, + LeftParenTokenContext, + OrTokenContext, + ParenthesizedExpressionContext, + PostAttributeValueWhitespaceContext, + PostDownwardTraversalWhitespaceContext, + PostLogicalOperatorWhitespaceContext, + PostNeighborTraversalWhitespaceContext, + PostNotOperatorWhitespaceContext, + PostUpwardTraversalWhitespaceContext, + UnmatchedValueContext, + UpTraversalContext, +} from './generated/SelectionAutoCompleteParser'; +import {SelectionAutoCompleteVisitor as _SelectionAutoCompleteVisitor} from './generated/SelectionAutoCompleteVisitor'; + +type Suggestion = {text: string; displayText?: string}; +type TextCallback = (value: string) => string; +const DEFAULT_TEXT_CALLBACK = (value: string) => value; + +// set to true for useful debug output. +const DEBUG = true; + +export class SelectionAutoCompleteVisitor + extends AbstractParseTreeVisitor + implements _SelectionAutoCompleteVisitor +{ + private cursorIndex: number; + private line: string; + private attributesMap: Record; + private functions: string[]; + private nameBase: string; + private attributesWithNameBase: string[]; + private allAttributes: {key: string; value: string}[]; + public list: Suggestion[] = []; + public _startReplacementIndex: number = 0; + public _stopReplacementIndex: number = 0; + private forceVisitCtx = new WeakSet(); + + set startReplacementIndex(newValue: number) { + if (DEBUG) { + console.log('Autocomplete suggestions being set by stack:', new Error()); + } + this._startReplacementIndex = newValue; + } + set stopReplacementIndex(newValue: number) { + this._stopReplacementIndex = newValue; + } + get startReplacementIndex() { + return this._startReplacementIndex; + } + get stopReplacementIndex() { + return this._stopReplacementIndex; + } + + constructor({ + attributesMap, + functions, + nameBase, + line, + cursorIndex, + }: { + attributesMap: Record; + functions: string[]; + nameBase: string; + line: string; + cursorIndex: number; + }) { + super(); + this.cursorIndex = cursorIndex; + this.line = line; + this.attributesMap = attributesMap; + this.functions = functions; + this.nameBase = nameBase; + this.attributesWithNameBase = [ + `${this.nameBase}_substring`, + this.nameBase, + ...Object.keys(attributesMap).filter((name) => name !== this.nameBase), + ]; + this.allAttributes = Object.keys(attributesMap).flatMap((key) => { + return ( + attributesMap[key]?.sort((a, b) => a.localeCompare(b)).map((value) => ({key, value})) ?? [] + ); + }); + this._startReplacementIndex = cursorIndex; + this._stopReplacementIndex = cursorIndex; + } + + forceVisit(ctx: ParserRuleContext) { + this.forceVisitCtx.add(ctx); + ctx.accept(this); + } + + visit(tree: ParseTree) { + const _tree = tree as ParserRuleContext; + if ( + _tree.start.startIndex !== undefined && + _tree.stop?.stopIndex !== undefined && + !this.nodeIncludesCursor(_tree) && + !this.forceVisitCtx.has(_tree) + ) { + if (!tree.parent) { + // If we're at the root but not within the expression then we're at the whitespace before any expression. + this.addUnmatchedValueResults(''); + this.startReplacementIndex = this.cursorIndex; + this.stopReplacementIndex = this.cursorIndex; + } + return; + } + return super.visit(tree); + } + + visitChildren(node: RuleNode): void { + let result = this.defaultResult(); + const n = node.childCount; + for (let i = 0; i < n; i++) { + if (!this.shouldVisitNextChild(node, result)) { + break; + } + const c = node.getChild(i) as any; + if (c.start && c.stop) { + const isWhitespace = c.constructor.name.endsWith('WhitespaceContext'); + if ( + !this.nodeIncludesCursor(c) && + (!isWhitespace || c.start.startIndex !== this.cursorIndex) && + !this.forceVisitCtx.has(c) + ) { + continue; + } + const nextChild = node.childCount - 1 > i ? (node.getChild(i + 1) as any) : null; + if ( + !this.nodeIncludesCursor(c, 0) && + nextChild?.constructor.name.endsWith('WhitespaceContext') && + !this.forceVisitCtx.has(c) + ) { + // Let the whitespace handle the suggestion + continue; + } + } + if (DEBUG) { + console.log('visiting child', c.constructor.name, c.text); + } + const childResult = c.accept(this); + result = this.aggregateResult(result, childResult); + } + return result; + } + + protected defaultResult() {} + + private nodeIncludesCursor( + ctx: Pick, + modifier: number = -1, + ): boolean { + const start = ctx.start.startIndex; + const stop = ctx.stop ? ctx.stop.stopIndex : ctx.start.startIndex; + + return Math.max(0, this.cursorIndex + modifier) >= start && this.cursorIndex + modifier <= stop; + } + + private addAttributeResults(value: string, textCallback: TextCallback = DEFAULT_TEXT_CALLBACK) { + this.list.push( + ...this.attributesWithNameBase + .filter((attr) => attr.startsWith(value.trim())) + .map((val) => { + const suggestionValue = `${val}:`; + return {text: textCallback(suggestionValue), displayText: suggestionValue}; + }), + ); + } + + private addFunctionResults( + value: string, + textCallback: TextCallback = DEFAULT_TEXT_CALLBACK, + includeParenthesis: boolean = false, + ) { + this.list.push( + ...this.functions + .filter((fn) => fn.startsWith(value.trim())) + .map((val) => { + const suggestionValue = `${val}${includeParenthesis ? '()' : ''}`; + return { + text: textCallback(suggestionValue), + displayText: suggestionValue, + }; + }), + ); + } + + public addUnmatchedValueResults( + _value: string, + textCallback: TextCallback = DEFAULT_TEXT_CALLBACK, + options: {excludeNot?: boolean; excludeStar?: boolean; excludePlus?: boolean} = {}, + ) { + const value = _value.trim(); + if (value) { + const substringMatchDisplayText = `${this.nameBase}_substring:${removeQuotesFromString( + value, + )}`; + const substringMatchText = `${this.nameBase}_substring:"${removeQuotesFromString(value)}"`; + this.list.push({ + text: textCallback(substringMatchText), + displayText: substringMatchDisplayText, + }); + } + this.addAttributeResults(value, textCallback); + this.addFunctionResults(value, textCallback, true); + + if (value) { + this.allAttributes.forEach((attribute) => { + if (attribute.value.includes(value.toLowerCase())) { + this.list.push({ + text: textCallback(`${attribute.key}:"${attribute.value}"`), + displayText: `${attribute.key}:${attribute.value}`, + }); + } + }); + } + + if (!options.excludeNot && 'not'.startsWith(value)) { + this.list.push({text: textCallback('not '), displayText: 'not'}); + } + if (value === '') { + if (!options.excludeStar) { + this.list.push({text: textCallback('*'), displayText: '*'}); + } + if (!options.excludePlus) { + this.list.push({text: textCallback('+'), displayText: '+'}); + } + this.list.push({text: textCallback('()'), displayText: '('}); + } + } + + private addAttributeValueResults( + attributeKey: string, + value: string, + textCallback: TextCallback = DEFAULT_TEXT_CALLBACK, + ) { + let possibleValues = this.attributesMap[attributeKey] ?? []; + if (attributeKey === `${this.nameBase}_substring`) { + possibleValues = this.attributesMap[this.nameBase]!; + } + const unquotedValue = removeQuotesFromString(value); + possibleValues.forEach((attributeValue) => { + if (attributeValue.includes(unquotedValue)) { + this.list.push({ + text: textCallback(`"${attributeValue}"`), + displayText: attributeValue, + }); + } + }); + } + + private addAfterExpressionResults( + ctx: ParserRuleContext, + options: { + excludeStar?: boolean; + excludePlus?: boolean; + } = {}, + ) { + this.list.push({text: ' and ', displayText: 'and'}, {text: ' or ', displayText: 'or'}); + + if (!options.excludeStar) { + this.list.push({text: '*', displayText: '*'}); + } + if (!options.excludePlus) { + this.list.push({text: '+', displayText: '+'}); + } + + if (isInsideExpressionlessParenthesizedExpression(ctx)) { + this.list.push({text: ')', displayText: ')'}); + } + } + + visitAllExpression(ctx: AllExpressionContext) { + if (this.nodeIncludesCursor(ctx.postExpressionWhitespace())) { + this.visit(ctx.postExpressionWhitespace()); + } else { + this.startReplacementIndex = this.cursorIndex; + this.stopReplacementIndex = this.cursorIndex; + this.addUnmatchedValueResults('', DEFAULT_TEXT_CALLBACK, { + excludeStar: true, + excludePlus: true, + }); + if (isInsideExpressionlessParenthesizedExpression(ctx)) { + this.list.push({text: ')', displayText: ')'}); + } + } + } + + visitUpTraversal(ctx: UpTraversalContext) { + if (ctx.text.includes('+')) { + this.list.push({text: '+', displayText: '+'}); + } + this.list.push({text: '()', displayText: '('}); + } + + visitDownTraversal(ctx: DownTraversalContext) { + this.list.push({text: ' and ', displayText: 'and'}); + this.list.push({text: ' or ', displayText: 'or'}); + if (ctx.text.includes('+')) { + this.list.push({text: '+', displayText: '+'}); + } + if (isInsideExpressionlessParenthesizedExpression(ctx)) { + this.list.push({text: ')', displayText: ')'}); + } + } + + visitParenthesizedExpression(ctx: ParenthesizedExpressionContext) { + if (this.nodeIncludesCursor(ctx.leftParenToken())) { + // Move the cursor to the right and visit that expression. + this.cursorIndex += 1; + } + this.visitChildren(ctx); + } + + visitFunctionName(ctx: FunctionNameContext) { + if (this.nodeIncludesCursor(ctx)) { + this.startReplacementIndex = ctx.start.startIndex; + this.stopReplacementIndex = ctx.stop!.stopIndex + 1; + this.addFunctionResults(ctx.text); + } + } + + visitAttributeValue(ctx: AttributeValueContext) { + const stopIndex = ctx.stop!.stopIndex; + if ( + this.cursorIndex >= stopIndex && + this.line[this.cursorIndex - 1] === '"' && + this.line[this.cursorIndex] !== '"' + ) { + this.addAfterExpressionResults(ctx); + return; + } + this.startReplacementIndex = ctx.start!.startIndex; + this.stopReplacementIndex = ctx.stop!.stopIndex + 1; + const parentChildren = ctx.parent?.children ?? []; + if (parentChildren[0]?.constructor.name === 'AttributeNameContext') { + this.addAttributeValueResults(parentChildren[0].text, getValue(ctx.value())); + } + } + + visitColonToken(ctx: ColonTokenContext) { + if (this.nodeIncludesCursor(ctx)) { + let attributeName: any; + + let valueNode: ParserRuleContext | null = null; + const parentChildren = ctx.parent?.children ?? []; + if (parentChildren[0]?.constructor.name === 'AttributeNameContext') { + attributeName = parentChildren[0]; + } + if (parentChildren[1]?.constructor.name === 'AttributeValueContext') { + valueNode = parentChildren[1] as any; + } else if (parentChildren[2]?.constructor.name === 'AttributeValueContext') { + valueNode = parentChildren[2] as any; + } + if (attributeName?.stop && this.cursorIndex >= attributeName.stop?.stopIndex) { + this.addAttributeValueResults(attributeName, getValue(valueNode)); + } else { + this.startReplacementIndex = ctx.start.startIndex - 1; + this.stopReplacementIndex = this.startReplacementIndex; + this.addAttributeResults(attributeName); + } + } + } + + visitAttributeName(ctx: AttributeNameContext) { + this.startReplacementIndex = ctx.start.startIndex; + this.stopReplacementIndex = ctx.stop!.stopIndex + 2; + this.addAttributeResults(ctx.text); + } + + visitOrToken(ctx: OrTokenContext) { + if (this.cursorIndex > ctx.stop!.stopIndex) { + // Let whitespace token handle this + } else { + this.startReplacementIndex = ctx.start.startIndex; + this.stopReplacementIndex = ctx.stop!.stopIndex + 1; + this.list.push({text: 'or', displayText: 'or'}, {text: 'and', displayText: 'and'}); + } + } + + visitAndToken(ctx: AndTokenContext) { + if (this.cursorIndex > ctx.stop!.stopIndex) { + // Let whitespace token handle this + } else { + this.startReplacementIndex = ctx.start.startIndex; + this.stopReplacementIndex = ctx.stop!.stopIndex + 1; + this.list.push({text: 'and', displayText: 'and'}, {text: 'or', displayText: 'or'}); + } + } + + visitUnmatchedValue(ctx: UnmatchedValueContext) { + if (this.nodeIncludesCursor(ctx)) { + this.startReplacementIndex = ctx.start.startIndex; + this.stopReplacementIndex = ctx.stop!.stopIndex + 1; + this.addUnmatchedValueResults(ctx.text); + } + } + + visitIncompletePlusTraversalExpression(ctx: IncompletePlusTraversalExpressionContext) { + if ( + this.nodeIncludesCursor(ctx.postNeighborTraversalWhitespace()) && + ctx.postNeighborTraversalWhitespace().text.length + ) { + return this.visit(ctx.postNeighborTraversalWhitespace()); + } + this.addUnmatchedValueResults('', DEFAULT_TEXT_CALLBACK, { + excludeStar: true, + excludeNot: true, + }); + } + + visitIncompleteAttributeExpressionMissingValue( + ctx: IncompleteAttributeExpressionMissingValueContext, + ) { + if (this.nodeIncludesCursor(ctx.attributeName())) { + this.visit(ctx.attributeName()); + } else { + this.startReplacementIndex = ctx.attributeValueWhitespace().start.startIndex; + this.stopReplacementIndex = this.startReplacementIndex; + this.addAttributeValueResults(ctx.attributeName().text, ''); + } + } + + visitPostNotOperatorWhitespace(ctx: PostNotOperatorWhitespaceContext) { + const needsWhitespace = this.cursorIndex === ctx.start.startIndex; + this.addUnmatchedValueResults('', (value) => `${needsWhitespace ? ' ' : ''}${value}`, { + excludeNot: true, + }); + } + + visitPostNeighborTraversalWhitespace(ctx: PostNeighborTraversalWhitespaceContext) { + const isAtStart = this.cursorIndex === ctx.start.startIndex; + this.addUnmatchedValueResults('', DEFAULT_TEXT_CALLBACK, { + excludeStar: isAtStart, + }); + } + + visitPostUpwardTraversalWhitespace(ctx: PostUpwardTraversalWhitespaceContext) { + this.addUnmatchedValueResults('', DEFAULT_TEXT_CALLBACK, { + excludeStar: true, + excludePlus: ctx.parent?.children?.[0]?.text.includes('+'), + }); + } + + visitPostDownwardTraversalWhitespace(ctx: PostDownwardTraversalWhitespaceContext) { + this.addAfterExpressionResults(ctx, { + excludeStar: true, + excludePlus: ctx.parent?.children?.[0]?.text.includes('+'), + }); + } + + visitPostExpressionWhitespace(ctx: ParserRuleContext) { + if (!this.list.length) { + this.addAfterExpressionResults(ctx); + } + } + + // This is visited even if the whitespace has length 0. + visitPostLogicalOperatorWhitespace(ctx: PostLogicalOperatorWhitespaceContext) { + // Check if anything before us already made suggestions + // Since we get called even if the previous token handled it + if (!this.list.length) { + const isAfterNot = this.line.slice(0, this.cursorIndex).trim().toLowerCase().endsWith('not'); + + const isAfterLeftParen = this.line[this.cursorIndex - 1] === '('; + + // If the cursor is at the start then we need a space before... + const needsWhitespace = !isAfterLeftParen && this.cursorIndex === ctx.start.startIndex; + this.addUnmatchedValueResults('', (text) => `${needsWhitespace ? ' ' : ''}${text}`, { + excludeNot: isAfterNot, + }); + } + } + + visitPostAttributeValueWhitespace(ctx: PostAttributeValueWhitespaceContext) { + const attributeValue = ctx.parent!.getChild(2) as any; + if (this.cursorIndex === attributeValue?.stop?.stopIndex + 1) { + this.forceVisit(attributeValue); + } else { + this.visitPostExpressionWhitespace(ctx); + } + } + + visitLeftParenToken(_ctx: LeftParenTokenContext) { + this.addUnmatchedValueResults(''); + } +} + +export function createSelectionHint, N extends keyof T>( + _nameBase: N, + attributesMap: T, + functions: string[], +): CodeMirror.HintFunction { + const nameBase = _nameBase as string; + + return function (cm: CodeMirror.Editor, _options: CodeMirror.ShowHintOptions): any { + const line = cm.getLine(0); + const {parseTrees} = parseInput(line); + + let start = 0; + const actualCursorIndex = cm.getCursor().ch; + + let visitorWithAutoComplete; + if (!parseTrees.length) { + // Special case empty string to add unmatched value results + visitorWithAutoComplete = new SelectionAutoCompleteVisitor({ + attributesMap, + functions, + nameBase, + line, + cursorIndex: actualCursorIndex, + }); + start = actualCursorIndex; + visitorWithAutoComplete.addUnmatchedValueResults(''); + } else { + for (const {tree, line} of parseTrees) { + const cursorIndex = actualCursorIndex - start; + const visitor = new SelectionAutoCompleteVisitor({ + attributesMap, + functions, + nameBase, + line, + cursorIndex, + }); + visitor.visit(tree); + const length = line.length; + if (cursorIndex <= length) { + visitorWithAutoComplete = visitor; + break; + } + start += length; + } + } + if (visitorWithAutoComplete) { + return { + list: visitorWithAutoComplete.list, + from: cm.posFromIndex(start + visitorWithAutoComplete.startReplacementIndex), + to: cm.posFromIndex(start + visitorWithAutoComplete.stopReplacementIndex), + }; + } + }; +} + +function getValue(ctx: ParserRuleContext | null) { + switch (ctx?.constructor.name) { + case 'UnquotedStringValueContext': { + return ctx.text; + } + case 'IncompleteLeftQuotedStringValueContext': { + return ctx.text.slice(1); + } + case 'IncompleteRightQuotedStringValueContext': { + return ctx.text.slice(0, -1); + } + case 'QuotedStringValueContext': { + return ctx.text.slice(1, -1); + } + case 'AttributeValueContext': { + return getValue((ctx as AttributeValueContext).value()); + } + } + return ctx?.text ?? ''; +} diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteHighlighter.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteHighlighter.ts new file mode 100644 index 0000000000000..62babfbe5198e --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteHighlighter.ts @@ -0,0 +1,292 @@ +import {Colors, TextInputStyles} from '@dagster-io/ui-components'; +import {ParserRuleContext} from 'antlr4ts'; +import {AbstractParseTreeVisitor} from 'antlr4ts/tree/AbstractParseTreeVisitor'; +import CodeMirror from 'codemirror'; +import {css} from 'styled-components'; + +import {parseInput} from './SelectionAutoCompleteInputParser'; +import { + AllExpressionContext, + AttributeExpressionContext, + AttributeNameContext, + AttributeValueContext, + FunctionNameContext, + IncompleteAttributeExpressionMissingKeyContext, + IncompleteAttributeExpressionMissingValueContext, + ParenthesizedExpressionContext, + PostAttributeValueWhitespaceContext, + QuotedStringValueContext, + StartContext, + UnquotedStringValueContext, +} from './generated/SelectionAutoCompleteParser'; +import {SelectionAutoCompleteVisitor} from './generated/SelectionAutoCompleteVisitor'; + +export class SyntaxHighlightingVisitor + extends AbstractParseTreeVisitor + implements SelectionAutoCompleteVisitor +{ + private cm: CodeMirror.Editor; + private startOffset: number; + private cursorIndex: number; + + constructor(cm: CodeMirror.Editor, startOffSet: number, cursorIndex: number) { + super(); + this.cm = cm; + this.startOffset = startOffSet; + this.cursorIndex = cursorIndex; + } + + protected defaultResult() {} + + private addClass(ctx: ParserRuleContext, klass: string) { + const from = this.cm.posFromIndex(this.startOffset + ctx.start.startIndex); + const to = this.cm.posFromIndex(this.startOffset + ctx.stop!.stopIndex + 1); + this.cm.markText(from, to, {className: klass}); + } + + private addClassPos(fromIndex: number, toIndex: number, klass: string) { + const from = this.cm.posFromIndex(this.startOffset + fromIndex); + const to = this.cm.posFromIndex(this.startOffset + toIndex + 1); + this.cm.markText(from, to, {className: klass}); + } + + private addActiveClass(ctx: ParserRuleContext, klass: string = 'active') { + if (ctx.start.startIndex < this.cursorIndex && (ctx.stop?.stopIndex ?? 0) < this.cursorIndex) { + this.addClass(ctx, klass); + } + } + + // Visit methods + visitStart(ctx: StartContext) { + this.visit(ctx.expr()); + } + + visitIncompleteAttributeExpressionMissingValue( + ctx: IncompleteAttributeExpressionMissingValueContext, + ) { + this.addClass(ctx, 'expression attribute-expression'); + this.visitChildren(ctx); + } + visitIncompleteAttributeExpressionMissingKey( + ctx: IncompleteAttributeExpressionMissingKeyContext, + ) { + const start = ctx.start.startIndex; + let end = ctx.stop!.stopIndex; + if (ctx.postExpressionWhitespace()) { + end = ctx.postExpressionWhitespace().start.startIndex; + } + this.addClassPos(start, end, 'expression attribute-expression'); + this.visitChildren(ctx); + } + + visitAttributeExpression(ctx: AttributeExpressionContext) { + const start = ctx.start.startIndex; + let end = ctx.stop!.stopIndex; + if (ctx.postAttributeValueWhitespace()) { + end = ctx.postAttributeValueWhitespace().start.startIndex; + } + this.addClassPos(start, end, 'expression attribute-expression'); + this.visitChildren(ctx); + } + + visitAttributeName(ctx: AttributeNameContext) { + this.addClass(ctx, `attribute-name attribute-${ctx.text}`); + this.visitChildren(ctx); + } + + visitAttributeValue(ctx: AttributeValueContext) { + this.addClass(ctx, `attribute-value`); + this.visitChildren(ctx); + } + + visitFunctionName(ctx: FunctionNameContext) { + this.addClass(ctx, `function-name function-${ctx.text}`); + this.visitChildren(ctx); + } + + visitQuotedStringValue(ctx: QuotedStringValueContext) { + this.addClass(ctx, 'value'); + this.visitChildren(ctx); + } + + visitUnquotedStringValue(ctx: UnquotedStringValueContext) { + this.addClass(ctx, 'value'); + this.visitChildren(ctx); + } + + visitAllExpression(ctx: AllExpressionContext) { + this.addClass(ctx, 'expression value'); + this.visitChildren(ctx); + } + visitIncompleteLeftQuotedStringValue(ctx: ParserRuleContext) { + this.addClass(ctx, 'value'); + this.visitChildren(ctx); + } + visitIncompleteRightQuotedStringValue(ctx: ParserRuleContext) { + this.addClass(ctx, 'value'); + this.visitChildren(ctx); + } + visitTraversalAllowedExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitUpAndDownTraversalExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitUpTraversalExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitDownTraversalExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitNotExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitOrExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitAndExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitIncompleteNotExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitIncompleteOrExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitIncompleteAndExpression(ctx: ParserRuleContext) { + this.addClass(ctx, 'expression'); + this.visitChildren(ctx); + } + visitParenthesizedExpression(ctx: ParenthesizedExpressionContext) { + this.addActiveClass(ctx, 'active-parenthesis'); + this.visitChildren(ctx); + } + visitPostAttributeValueWhitespace(ctx: PostAttributeValueWhitespaceContext) { + this.addClass(ctx, 'attribute-value-ws'); + } +} + +export function applyStaticSyntaxHighlighting(cm: CodeMirror.Editor): void { + const value = cm.getValue(); + + // Clear existing marks to avoid duplication + cm.getAllMarks().forEach((mark) => { + // Don't clear error marks coming from the linter which uses the real grammar's parser + if ((mark as any)?.__annotation?.severity !== 'error') { + mark.clear(); + } + }); + + const cursorIndex = cm.getCursor().ch; + const {parseTrees} = parseInput(value); + let start = 0; + + for (const {tree} of parseTrees) { + const visitor = new SyntaxHighlightingVisitor(cm, start, cursorIndex - start); + visitor.visit(tree); + start += tree.text.length; + } + cm.markText(cm.posFromIndex(0), cm.posFromIndex(value.length), {className: 'selection'}); + + requestAnimationFrame(() => { + // Force CodeMirror to re-measure widths after applying CSS changes + cm.refresh(); + }); +} + +const lastElementInTokenStyle = css` + padding-right: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +`; + +export const SelectionAutoCompleteInputCSS = css` + height: 32px; + width: 100%; + ${TextInputStyles} + flex-shrink: 1; + overflow: auto; + + .CodeMirror-placeholder.CodeMirror-placeholder.CodeMirror-placeholder { + color: ${Colors.textLighter()}; + } + .CodeMirror-line > span { + align-items: center; + } + + .CodeMirror-scrollbar-filler, + .CodeMirror-vscrollbar, + .CodeMirror-hscrollbar { + display: none !important; + } + + .CodeMirror-sizer, + .CodeMirror-lines { + height: 20px !important; + padding: 0; + } + + .CodeMirror-cursor.CodeMirror-cursor { + border-color: ${Colors.textLight()}; + } + + .CodeMirror { + background: transparent; + color: ${Colors.textDefault()}; + } + + .CodeMirror-line .selection:not(.expression):not(.value), + .CodeMirror-lint-mark-error { + background: unset; + text-decoration-line: underline; + text-decoration-style: wavy; + text-decoration-color: ${Colors.accentRed()}; + } + + .expression { + color: ${Colors.textRed()}; + font-weight: bold; + } + + .attribute-expression { + color: ${Colors.textDefault()}; + } + + .attribute-expression:not(.attribute-expression + .attribute-expression) { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + } + + .attribute-name { + color: ${Colors.textCyan()}; + font-weight: bold; + padding-left: 4px; + } + + .attribute-expression:not(.attribute-value-ws) { + background: ${Colors.backgroundYellow()}; + } + + .attribute-expression:has(+ .attribute-value-ws), + .attribute-expression:not(:has(+ .attribute-expression)) { + ${lastElementInTokenStyle} + } + + .value { + color: ${Colors.textGreen()}; + } + + .function-name { + color: ${Colors.textYellow()}; + font-style: italic; + } +`; diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteInputParser.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteInputParser.ts new file mode 100644 index 0000000000000..233563a0c4cf8 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteInputParser.ts @@ -0,0 +1,109 @@ +// parser.ts + +import {BailErrorStrategy, CharStreams, CommonTokenStream} from 'antlr4ts'; +import {ParseTree} from 'antlr4ts/tree/ParseTree'; +import memoize from 'lodash/memoize'; + +import {CustomErrorListener, SyntaxError} from './CustomErrorListener'; +import {SelectionAutoCompleteLexer} from './generated/SelectionAutoCompleteLexer'; +import {SelectionAutoCompleteParser} from './generated/SelectionAutoCompleteParser'; + +/** + * Represents the result of parsing, including the array of parse trees and any syntax errors. + */ +interface ParseResult { + parseTrees: ParseTreeResult[]; + errors: SyntaxError[]; +} + +interface ParseTreeResult { + tree: ParseTree; + line: string; +} + +/** + * Parses the input and constructs an array of parse trees along with any syntax errors. + * @param input - The input string to parse. + * @returns The parse result containing the array of parse trees and syntax errors. + */ +export const parseInput = memoize((input: string): ParseResult => { + const parseTrees: ParseTreeResult[] = []; + const errors: SyntaxError[] = []; + + let currentPosition = 0; + const inputLength = input.length; + + while (currentPosition < inputLength) { + // Create a substring from the current position + const substring = input.substring(currentPosition); + + // Initialize ANTLR input stream, lexer, and parser + const inputStream = CharStreams.fromString(substring); + const lexer = new SelectionAutoCompleteLexer(inputStream); + const tokenStream = new CommonTokenStream(lexer); + const parser = new SelectionAutoCompleteParser(tokenStream); + + // Attach custom error listener + const errorListener = new CustomErrorListener(); + parser.removeErrorListeners(); + parser.addErrorListener(errorListener); + + // Set the error handler to bail on error to prevent infinite loops + parser.errorHandler = new BailErrorStrategy(); + + let tree: ParseTree | null = null; + try { + // Parse using the 'expr' rule instead of 'start' to allow partial parsing + tree = parser.expr(); + parseTrees.push({tree, line: tree.text}); + + // Advance currentPosition to the end of the parsed input + const lastToken = tokenStream.get(tokenStream.index - 1); + currentPosition += lastToken.stopIndex + 1; + } catch (e) { + // Parsing error occurred + const currentErrors = errorListener.getErrors(); + + if (currentErrors.length > 0) { + const error = currentErrors[0]!; + const errorCharPos = error.column; + const errorIndex = currentPosition + errorCharPos; + + // Parse up to the error + const validInput = input.substring(currentPosition, errorIndex); + if (validInput.trim().length > 0) { + const validInputStream = CharStreams.fromString(validInput); + const validLexer = new SelectionAutoCompleteLexer(validInputStream); + const validTokenStream = new CommonTokenStream(validLexer); + const validParser = new SelectionAutoCompleteParser(validTokenStream); + + // Remove error listeners for the valid parser + validParser.removeErrorListeners(); + + try { + const validTree = validParser.expr(); + parseTrees.push({tree: validTree, line: validInput}); + } catch { + // Ignore errors here since we already have an error in currentErrors + } + } + + // Add the error to the errors array + errors.push({ + message: error.message, + line: error.line, + column: error.column + currentPosition, + offendingSymbol: error.offendingSymbol, + }); + + // Advance currentPosition beyond the error + currentPosition = errorIndex + 1; + } else { + // Critical parsing error, break the loop + break; + } + } + } + + return {parseTrees, errors}; +}); diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteUtil.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteUtil.ts new file mode 100644 index 0000000000000..3383632a52b3d --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoCompleteUtil.ts @@ -0,0 +1,32 @@ +import {ParserRuleContext} from 'antlr4ts'; + +export const removeQuotesFromString = (value: string) => { + if (value.length > 1 && value[0] === '"' && value[value.length - 1] === '"') { + return value.slice(1, -1); + } + return value; +}; + +export function getValueNodeValue(ctx: ParserRuleContext) { + let nodeValue = ctx.text; + const nodeType = ctx.constructor.name; + if (nodeType === 'QuotedStringValueContext') { + nodeValue = nodeValue.slice(1, -1); + } else if (nodeType === 'IncompleteLeftQuotedStringValueContext') { + nodeValue = nodeValue.slice(1); + } else if (nodeType === 'IncompleteRightQuotedStringValueContext') { + nodeValue = nodeValue.slice(0, -1); + } + return nodeValue.trim(); +} + +export function isInsideExpressionlessParenthesizedExpression(context: ParserRuleContext) { + if (context.parent) { + const nodeType = context.parent.constructor.name; + if (nodeType.startsWith('Unclosed')) { + return true; + } + return isInsideExpressionlessParenthesizedExpression(context.parent); + } + return false; +} diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/__tests__/SelectionAutoComplete.test.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/__tests__/SelectionAutoComplete.test.ts new file mode 100644 index 0000000000000..9e63b325f6d1a --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/__tests__/SelectionAutoComplete.test.ts @@ -0,0 +1,821 @@ +import {Hint, Hints, Position} from 'codemirror'; + +import {createSelectionHint} from '../SelectionAutoComplete'; + +describe('createAssetSelectionHint', () => { + const selectionHint = createSelectionHint( + 'key', + { + key: ['asset1', 'asset2', 'asset3'], + tag: ['tag1', 'tag2', 'tag3'], + owner: ['marco@dagsterlabs.com', 'team:frontend'], + group: ['group1', 'group2'], + kind: ['kind1', 'kind2'], + code_location: ['repo1@location1', 'repo2@location2'], + }, + ['sinks', 'roots'], + ); + + type HintsModified = Omit & { + list: Array; + }; + + function testAutocomplete(testString: string) { + const cursorIndex = testString.indexOf('|'); + const string = testString.split('|').join(''); + + mockEditor.getCursor.mockReturnValue({ch: cursorIndex}); + mockEditor.getLine.mockReturnValue(string); + + const hints = selectionHint(mockEditor, {}) as HintsModified; + + return { + list: hints.list, + from: hints.from.ch, + to: hints.to.ch, + }; + } + + const mockEditor = { + getCursor: jest.fn(), + getLine: jest.fn(), + posFromIndex: (index: number) => + ({ + ch: index, + line: 0, + }) as Position, + } as any; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should suggest asset names after typing key_substring:', () => { + // cursorIndex 14 + expect(testAutocomplete('key_substring:|')).toEqual({ + list: [ + {text: '"asset1"', displayText: 'asset1'}, + {text: '"asset2"', displayText: 'asset2'}, + {text: '"asset3"', displayText: 'asset3'}, + ], + from: 14, // cursor location + to: 14, // cursor location + }); + }); + + it('should suggest owners after typing owner:', () => { + expect(testAutocomplete('owner:|')).toEqual({ + list: [ + { + text: '"marco@dagsterlabs.com"', + displayText: 'marco@dagsterlabs.com', + }, + { + text: '"team:frontend"', + displayText: 'team:frontend', + }, + ], + from: 6, // cursor location + to: 6, // cursor location + }); + }); + + it('should suggest tag names after typing tag:', () => { + expect(testAutocomplete('tag:|')).toEqual({ + list: [ + {text: '"tag1"', displayText: 'tag1'}, + {text: '"tag2"', displayText: 'tag2'}, + {text: '"tag3"', displayText: 'tag3'}, + ], + from: 4, // cursor location + to: 4, // cursor location + }); + + expect(testAutocomplete('tag:"|"')).toEqual({ + list: [ + {text: '"tag1"', displayText: 'tag1'}, + {text: '"tag2"', displayText: 'tag2'}, + {text: '"tag3"', displayText: 'tag3'}, + ], + from: 4, // cursor location + to: 6, // cursor location + }); + }); + + it('should suggest logical operators after an expression', () => { + expect(testAutocomplete('key:"asset1" |')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + ], + from: 13, // cursor location + to: 13, // cursor location + }); + + expect(testAutocomplete('key:"asset1"|')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + ], + from: 12, // cursor location + to: 12, // cursor location + }); + }); + + it('should filter suggestions based on partial input', () => { + expect(testAutocomplete('owner:marco|')).toEqual({ + list: [ + { + text: '"marco@dagsterlabs.com"', + displayText: 'marco@dagsterlabs.com', + }, + ], + from: 6, // start of value "marco" + to: 11, // end of value + }); + }); + + it('should suggest possible keywords', () => { + // empty case + expect(testAutocomplete('|')).toEqual({ + list: [ + {displayText: 'key_substring:', text: 'key_substring:'}, + {displayText: 'key:', text: 'key:'}, + {displayText: 'tag:', text: 'tag:'}, + {displayText: 'owner:', text: 'owner:'}, + {displayText: 'group:', text: 'group:'}, + {displayText: 'kind:', text: 'kind:'}, + {displayText: 'code_location:', text: 'code_location:'}, + {displayText: 'sinks()', text: 'sinks()'}, + {displayText: 'roots()', text: 'roots()'}, + {displayText: 'not', text: 'not '}, + {displayText: '*', text: '*'}, + {displayText: '+', text: '+'}, + {displayText: '(', text: '()'}, + ], + from: 0, // cursor location + to: 0, // cursor location + }); + + // filtered case + expect(testAutocomplete('o|')).toEqual({ + list: [ + {displayText: 'key_substring:o', text: 'key_substring:"o"'}, + {displayText: 'owner:', text: 'owner:'}, + {displayText: 'owner:marco@dagsterlabs.com', text: 'owner:"marco@dagsterlabs.com"'}, + {displayText: 'owner:team:frontend', text: 'owner:"team:frontend"'}, + {displayText: 'group:group1', text: 'group:"group1"'}, + {displayText: 'group:group2', text: 'group:"group2"'}, + {displayText: 'code_location:repo1@location1', text: 'code_location:"repo1@location1"'}, + {displayText: 'code_location:repo2@location2', text: 'code_location:"repo2@location2"'}, + ], + from: 0, // start of input + to: 1, // cursor location + }); + }); + + it('should handle traversal operators correctly', () => { + expect(testAutocomplete('*|')).toEqual({ + list: [ + {displayText: 'key_substring:', text: 'key_substring:'}, + {displayText: 'key:', text: 'key:'}, + {displayText: 'tag:', text: 'tag:'}, + {displayText: 'owner:', text: 'owner:'}, + {displayText: 'group:', text: 'group:'}, + {displayText: 'kind:', text: 'kind:'}, + {displayText: 'code_location:', text: 'code_location:'}, + {displayText: 'sinks()', text: 'sinks()'}, + {displayText: 'roots()', text: 'roots()'}, + {displayText: 'not', text: 'not '}, + {displayText: '(', text: '()'}, + ], + from: 1, // cursor location + to: 1, // cursor location + }); + + expect(testAutocomplete('* |')).toEqual({ + from: 2, + list: [ + {displayText: 'and', text: ' and '}, + {displayText: 'or', text: ' or '}, + {displayText: '*', text: '*'}, + {displayText: '+', text: '+'}, + ], + to: 2, + }); + + expect(testAutocomplete('+ |')).toEqual({ + from: 2, + list: [ + {displayText: 'key_substring:', text: 'key_substring:'}, + {displayText: 'key:', text: 'key:'}, + {displayText: 'tag:', text: 'tag:'}, + {displayText: 'owner:', text: 'owner:'}, + {displayText: 'group:', text: 'group:'}, + {displayText: 'kind:', text: 'kind:'}, + {displayText: 'code_location:', text: 'code_location:'}, + {displayText: 'sinks()', text: 'sinks()'}, + {displayText: 'roots()', text: 'roots()'}, + {displayText: 'not', text: 'not '}, + {displayText: '*', text: '*'}, + {displayText: '+', text: '+'}, + {displayText: '(', text: '()'}, + ], + to: 2, + }); + + expect(testAutocomplete('+|')).toEqual({ + from: 1, + list: [ + {displayText: 'key_substring:', text: 'key_substring:'}, + {displayText: 'key:', text: 'key:'}, + {displayText: 'tag:', text: 'tag:'}, + {displayText: 'owner:', text: 'owner:'}, + {displayText: 'group:', text: 'group:'}, + {displayText: 'kind:', text: 'kind:'}, + {displayText: 'code_location:', text: 'code_location:'}, + {displayText: 'sinks()', text: 'sinks()'}, + {displayText: 'roots()', text: 'roots()'}, + {displayText: '+', text: '+'}, + {displayText: '(', text: '()'}, + ], + to: 1, + }); + }); + + it('should suggest code locations after typing code_location:', () => { + expect(testAutocomplete('code_location:|')).toEqual({ + list: [ + {text: '"repo1@location1"', displayText: 'repo1@location1'}, + {text: '"repo2@location2"', displayText: 'repo2@location2'}, + ], + from: 14, + to: 14, + }); + }); + + it('should handle incomplete "not" expressions', () => { + expect(testAutocomplete('not|')).toEqual({ + list: [ + {text: ' key_substring:', displayText: 'key_substring:'}, + {text: ' key:', displayText: 'key:'}, + {text: ' tag:', displayText: 'tag:'}, + {text: ' owner:', displayText: 'owner:'}, + {text: ' group:', displayText: 'group:'}, + {text: ' kind:', displayText: 'kind:'}, + {text: ' code_location:', displayText: 'code_location:'}, + {text: ' sinks()', displayText: 'sinks()'}, + {text: ' roots()', displayText: 'roots()'}, + {text: ' *', displayText: '*'}, + {text: ' +', displayText: '+'}, + {text: ' ()', displayText: '('}, + ], + from: 3, // cursor location + to: 3, // cursor location + }); + + expect(testAutocomplete('not |')).toEqual({ + list: [ + {text: 'key_substring:', displayText: 'key_substring:'}, + {text: 'key:', displayText: 'key:'}, + {text: 'tag:', displayText: 'tag:'}, + {text: 'owner:', displayText: 'owner:'}, + {text: 'group:', displayText: 'group:'}, + {text: 'kind:', displayText: 'kind:'}, + {text: 'code_location:', displayText: 'code_location:'}, + {text: 'sinks()', displayText: 'sinks()'}, + {text: 'roots()', displayText: 'roots()'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 4, // cursor location + to: 4, // cursor location + }); + }); + + it('should handle incomplete and expressions', () => { + expect(testAutocomplete('key:"asset1" and |')).toEqual({ + list: [ + {text: 'key_substring:', displayText: 'key_substring:'}, + {text: 'key:', displayText: 'key:'}, + {text: 'tag:', displayText: 'tag:'}, + {text: 'owner:', displayText: 'owner:'}, + {text: 'group:', displayText: 'group:'}, + {text: 'kind:', displayText: 'kind:'}, + {text: 'code_location:', displayText: 'code_location:'}, + {text: 'sinks()', displayText: 'sinks()'}, + {text: 'roots()', displayText: 'roots()'}, + {text: 'not ', displayText: 'not'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 17, // cursor location + to: 17, // cursor location + }); + }); + + it('should handle incomplete or expressions', () => { + expect(testAutocomplete('key:"asset1" or |')).toEqual({ + list: [ + {text: 'key_substring:', displayText: 'key_substring:'}, + {text: 'key:', displayText: 'key:'}, + {text: 'tag:', displayText: 'tag:'}, + {text: 'owner:', displayText: 'owner:'}, + {text: 'group:', displayText: 'group:'}, + {text: 'kind:', displayText: 'kind:'}, + {text: 'code_location:', displayText: 'code_location:'}, + {text: 'sinks()', displayText: 'sinks()'}, + {text: 'roots()', displayText: 'roots()'}, + {text: 'not ', displayText: 'not'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 16, // cursor location + to: 16, // cursor location + }); + }); + + it('should handle incomplete quoted strings gracefully', () => { + expect(testAutocomplete('key:"asse|')).toEqual({ + list: [ + {displayText: 'asset1', text: '"asset1"'}, + {displayText: 'asset2', text: '"asset2"'}, + {displayText: 'asset3', text: '"asset3"'}, + ], + from: 4, // start of value + to: 9, // end of value + }); + }); + + it('should handle incomplete or expression within function', () => { + expect( + testAutocomplete('sinks(key_substring:"FIVETRAN/google_ads/ad_group_history" or |)'), + ).toEqual({ + list: [ + {text: 'key_substring:', displayText: 'key_substring:'}, + {text: 'key:', displayText: 'key:'}, + {text: 'tag:', displayText: 'tag:'}, + {text: 'owner:', displayText: 'owner:'}, + {text: 'group:', displayText: 'group:'}, + {text: 'kind:', displayText: 'kind:'}, + {text: 'code_location:', displayText: 'code_location:'}, + {text: 'sinks()', displayText: 'sinks()'}, + {text: 'roots()', displayText: 'roots()'}, + {text: 'not ', displayText: 'not'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 62, // cursor location + to: 62, // cursor location + }); + }); + + it('should handle incomplete or expression within function with cursor right after the "or"', () => { + expect( + testAutocomplete('sinks(key_substring:"FIVETRAN/google_ads/ad_group_history" or|)'), + ).toEqual({ + list: [ + // Inserts a space before the string + {text: ' key_substring:', displayText: 'key_substring:'}, + {text: ' key:', displayText: 'key:'}, + {text: ' tag:', displayText: 'tag:'}, + {text: ' owner:', displayText: 'owner:'}, + {text: ' group:', displayText: 'group:'}, + {text: ' kind:', displayText: 'kind:'}, + {text: ' code_location:', displayText: 'code_location:'}, + {text: ' sinks()', displayText: 'sinks()'}, + {text: ' roots()', displayText: 'roots()'}, + {text: ' not ', displayText: 'not'}, + {text: ' *', displayText: '*'}, + {text: ' +', displayText: '+'}, + {text: ' ()', displayText: '('}, + ], + from: 61, // cursor location + to: 61, // cursor location + }); + }); + + it('should suggest tag values to the right of colon of an attribute expression inside of an IncompleteAttributeExpression, OrExpression, and ParenthesizedExpression', () => { + expect( + testAutocomplete( + 'sinks(key_substring:"FIVETRAN/google_ads/ad_group_history" or key_substring:|)', + ), + ).toEqual({ + list: [ + { + text: '"asset1"', + displayText: 'asset1', + }, + { + text: '"asset2"', + displayText: 'asset2', + }, + { + text: '"asset3"', + displayText: 'asset3', + }, + ], + from: 76, // cursor location + to: 76, // cursor location + }); + }); + + it('suggestions after downtraversal "+"', () => { + expect(testAutocomplete('key:"value"+|')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '+', displayText: '+'}, + ], + from: 12, // cursor location + to: 12, // cursor location + }); + + // UpAndDownTraversal + expect(testAutocomplete('*key:"value"|+')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + ], + from: 12, // cursor location + to: 12, // cursor location + }); + + // DownTraversal + expect(testAutocomplete('key:"value"|+')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + ], + from: 11, // cursor location + to: 11, // cursor location + }); + }); + + it('suggestions after IncompleteOrExpression chain', () => { + expect( + testAutocomplete('key:"test" or key_substring:"FIVETRAN/google_ads/ad_group_history"+ or |'), + ).toEqual({ + list: [ + // Inserts a space before the string + {text: 'key_substring:', displayText: 'key_substring:'}, + {text: 'key:', displayText: 'key:'}, + {text: 'tag:', displayText: 'tag:'}, + {text: 'owner:', displayText: 'owner:'}, + {text: 'group:', displayText: 'group:'}, + {text: 'kind:', displayText: 'kind:'}, + {text: 'code_location:', displayText: 'code_location:'}, + {text: 'sinks()', displayText: 'sinks()'}, + {text: 'roots()', displayText: 'roots()'}, + {text: 'not ', displayText: 'not'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 71, // cursor position + to: 71, // cursor position + }); + }); + + it('suggestions inside parenthesized expression', () => { + expect(testAutocomplete('(|)')).toEqual({ + list: [ + // Inserts a space before the string + {text: 'key_substring:', displayText: 'key_substring:'}, + {text: 'key:', displayText: 'key:'}, + {text: 'tag:', displayText: 'tag:'}, + {text: 'owner:', displayText: 'owner:'}, + {text: 'group:', displayText: 'group:'}, + {text: 'kind:', displayText: 'kind:'}, + {text: 'code_location:', displayText: 'code_location:'}, + {text: 'sinks()', displayText: 'sinks()'}, + {text: 'roots()', displayText: 'roots()'}, + {text: 'not ', displayText: 'not'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 1, // cursor location + to: 1, // cursor location + }); + }); + + it('suggestions outside parenthesized expression before', () => { + expect(testAutocomplete('|()')).toEqual({ + list: [ + {text: 'key_substring:', displayText: 'key_substring:'}, + {text: 'key:', displayText: 'key:'}, + {text: 'tag:', displayText: 'tag:'}, + {text: 'owner:', displayText: 'owner:'}, + {text: 'group:', displayText: 'group:'}, + {text: 'kind:', displayText: 'kind:'}, + {text: 'code_location:', displayText: 'code_location:'}, + {text: 'sinks()', displayText: 'sinks()'}, + {text: 'roots()', displayText: 'roots()'}, + {text: 'not ', displayText: 'not'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 0, // cursor position + to: 0, // cursor position + }); + }); + + it('suggestions outside parenthesized expression after', () => { + expect(testAutocomplete('()|')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + ], + from: 2, // cursor position + to: 2, // cursor position + }); + }); + + it('suggestions within parenthesized expression', () => { + expect(testAutocomplete('(tag:"dagster/kind/dlt"|)')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + ], + from: 23, // cursor position + to: 23, // cursor position + }); + + expect(testAutocomplete('sinks(key_substring:"set" or key_substring:"asset"|)')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + ], + from: 50, // cursor position + to: 50, // cursor position + }); + + expect(testAutocomplete('sinks(key_substring:"asset" or key_substring:"s|et2")')).toEqual({ + list: [{text: '"asset2"', displayText: 'asset2'}], + from: 45, // start of value + to: 51, // end of value + }); + + expect(testAutocomplete('sinks(key_substring:"sset1"| or key_substring:"set")')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '*', displayText: '*'}, + {text: '+', displayText: '+'}, + ], + from: 27, // cursor position + to: 27, // cursor position + }); + }); + + it('makes suggestions around traversals', () => { + expect(testAutocomplete('sinks()++|')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '+', displayText: '+'}, + ], + from: 9, // start of value + to: 9, // end of value + }); + + expect(testAutocomplete('sinks()+|+')).toEqual({ + list: [ + {text: ' and ', displayText: 'and'}, + {text: ' or ', displayText: 'or'}, + {text: '+', displayText: '+'}, + ], + from: 8, // start of value + to: 8, // end of value + }); + + expect(testAutocomplete('|++sinks()++')).toEqual({ + list: [ + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 0, // start of value + to: 0, // end of value + }); + + expect(testAutocomplete('+|+sinks()++')).toEqual({ + list: [ + {text: '+', displayText: '+'}, + {text: '()', displayText: '('}, + ], + from: 1, // start of value + to: 1, // end of value + }); + }); + + it('makes suggestions for IncompleteExpression inside of the ParenthesizedExpression', () => { + expect(testAutocomplete('(key:tag and |)')).toEqual({ + list: [ + {displayText: 'key_substring:', text: 'key_substring:'}, + {displayText: 'key:', text: 'key:'}, + {displayText: 'tag:', text: 'tag:'}, + {displayText: 'owner:', text: 'owner:'}, + {displayText: 'group:', text: 'group:'}, + {displayText: 'kind:', text: 'kind:'}, + {displayText: 'code_location:', text: 'code_location:'}, + {displayText: 'sinks()', text: 'sinks()'}, + {displayText: 'roots()', text: 'roots()'}, + {displayText: 'not', text: 'not '}, + {displayText: '*', text: '*'}, + {displayText: '+', text: '+'}, + {displayText: '(', text: '()'}, + ], + from: 13, + to: 13, + }); + + expect(testAutocomplete('(key:tag and|)')).toEqual({ + list: [ + {displayText: 'key_substring:', text: ' key_substring:'}, + {displayText: 'key:', text: ' key:'}, + {displayText: 'tag:', text: ' tag:'}, + {displayText: 'owner:', text: ' owner:'}, + {displayText: 'group:', text: ' group:'}, + {displayText: 'kind:', text: ' kind:'}, + {displayText: 'code_location:', text: ' code_location:'}, + {displayText: 'sinks()', text: ' sinks()'}, + {displayText: 'roots()', text: ' roots()'}, + {displayText: 'not', text: ' not '}, + {displayText: '*', text: ' *'}, + {displayText: '+', text: ' +'}, + {displayText: '(', text: ' ()'}, + ], + from: 12, + to: 12, + }); + + expect(testAutocomplete('(key:tag and| )')).toEqual({ + list: [ + {displayText: 'key_substring:', text: ' key_substring:'}, + {displayText: 'key:', text: ' key:'}, + {displayText: 'tag:', text: ' tag:'}, + {displayText: 'owner:', text: ' owner:'}, + {displayText: 'group:', text: ' group:'}, + {displayText: 'kind:', text: ' kind:'}, + {displayText: 'code_location:', text: ' code_location:'}, + {displayText: 'sinks()', text: ' sinks()'}, + {displayText: 'roots()', text: ' roots()'}, + {displayText: 'not', text: ' not '}, + {displayText: '*', text: ' *'}, + {displayText: '+', text: ' +'}, + {displayText: '(', text: ' ()'}, + ], + from: 12, + to: 12, + }); + }); + + it('suggestions within incomplete function call expression', () => { + expect( + testAutocomplete('(sinks(key:"value"++ or (key_substring:"aws_cost_report"++)|'), + ).toEqual({ + from: 59, + list: [ + {displayText: 'and', text: ' and '}, + {displayText: 'or', text: ' or '}, + {displayText: '*', text: '*'}, + {displayText: '+', text: '+'}, + {displayText: ')', text: ')'}, + ], + to: 59, + }); + }); + + it('makes suggestion in whitespace after or token in between two incomplete or expressions', () => { + expect( + testAutocomplete('key_substring:"aws_cost_report" or |or key_substring:"aws_cost_report"'), + ).toEqual({ + from: 35, + list: [ + {displayText: 'key_substring:', text: 'key_substring:'}, + {displayText: 'key:', text: 'key:'}, + {displayText: 'tag:', text: 'tag:'}, + {displayText: 'owner:', text: 'owner:'}, + {displayText: 'group:', text: 'group:'}, + {displayText: 'kind:', text: 'kind:'}, + {displayText: 'code_location:', text: 'code_location:'}, + {displayText: 'sinks()', text: 'sinks()'}, + {displayText: 'roots()', text: 'roots()'}, + {displayText: 'not', text: 'not '}, + {displayText: '*', text: '*'}, + {displayText: '+', text: '+'}, + {displayText: '(', text: '()'}, + ], + to: 35, + }); + }); + + it('suggests and/or logical operators', () => { + expect( + testAutocomplete('key_substring:"aws_cost_report" o|r and key_substring:"aws_cost_report"'), + ).toEqual({ + from: 32, + list: [ + { + displayText: 'or', + text: 'or', + }, + { + displayText: 'and', + text: 'and', + }, + ], + to: 34, + }); + + expect( + testAutocomplete('key_substring:"aws_cost_report" a|nd and key_substring:"aws_cost_report"'), + ).toEqual({ + from: 32, + list: [ + { + displayText: 'and', + text: 'and', + }, + { + displayText: 'or', + text: 'or', + }, + ], + to: 35, + }); + }); + + it('suggests attribute names when cursor left of the colon', () => { + expect(testAutocomplete('tag:"dagster/kind/fivetran" or t|:"a"')).toEqual({ + from: 31, + list: [{displayText: 'tag:', text: 'tag:'}], + to: 33, + }); + }); + + it('suggests attribute values when cursor left of the double quote', () => { + expect(testAutocomplete('tag:"tag|"')).toEqual({ + from: 4, + list: [ + {text: '"tag1"', displayText: 'tag1'}, + {text: '"tag2"', displayText: 'tag2'}, + {text: '"tag3"', displayText: 'tag3'}, + ], + to: 9, + }); + }); + + it('handles malformed input in the middle of the selection', () => { + expect( + testAutocomplete( + 'owner:"marco@dagsterlabs.com" or aiufhaifuhaguihaiugh k|ey:"column_schema_asset_2"', + ), + ).toEqual({ + from: 54, + list: [ + { + displayText: 'key_substring:', + text: 'key_substring:', + }, + { + displayText: 'key:', + text: 'key:', + }, + ], + to: 58, + }); + + expect( + testAutocomplete('owner:"marco@dagsterlabs.com" or aiufhaifuhaguihaiugh key:"|"'), + ).toEqual({ + from: 58, + list: [ + {text: '"asset1"', displayText: 'asset1'}, + {text: '"asset2"', displayText: 'asset2'}, + {text: '"asset3"', displayText: 'asset3'}, + ], + to: 60, + }); + }); +}); diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoComplete.interp b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoComplete.interp new file mode 100644 index 0000000000000..23fd814032751 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoComplete.interp @@ -0,0 +1,66 @@ +token literal names: +null +'and' +'or' +'not' +'*' +'+' +':' +'(' +')' +'=' +null +null +null +null +null + +token symbolic names: +null +AND +OR +NOT +STAR +PLUS +COLON +LPAREN +RPAREN +EQUAL +QUOTED_STRING +INCOMPLETE_LEFT_QUOTED_STRING +INCOMPLETE_RIGHT_QUOTED_STRING +IDENTIFIER +WS + +rule names: +start +expr +traversalAllowedExpr +parenthesizedExpr +incompleteExpr +expressionLessParenthesizedExpr +upTraversalExpr +downTraversalExpr +traversal +attributeName +attributeValue +functionName +orToken +andToken +notToken +colonToken +leftParenToken +rightParenToken +attributeValueWhitespace +postAttributeValueWhitespace +postExpressionWhitespace +postNotOperatorWhitespace +postLogicalOperatorWhitespace +postNeighborTraversalWhitespace +postUpwardTraversalWhitespace +postDownwardTraversalWhitespace +value + + +atn: +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 16, 253, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 84, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 104, 10, 3, 12, 3, 14, 3, 107, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 119, 10, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 6, 6, 151, 10, 6, 13, 6, 14, 6, 152, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 160, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 6, 10, 175, 10, 10, 13, 10, 14, 10, 176, 5, 10, 179, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 7, 20, 200, 10, 20, 12, 20, 14, 20, 203, 11, 20, 3, 21, 7, 21, 206, 10, 21, 12, 21, 14, 21, 209, 11, 21, 3, 22, 7, 22, 212, 10, 22, 12, 22, 14, 22, 215, 11, 22, 3, 23, 7, 23, 218, 10, 23, 12, 23, 14, 23, 221, 11, 23, 3, 24, 7, 24, 224, 10, 24, 12, 24, 14, 24, 227, 11, 24, 3, 25, 7, 25, 230, 10, 25, 12, 25, 14, 25, 233, 11, 25, 3, 26, 7, 26, 236, 10, 26, 12, 26, 14, 26, 239, 11, 26, 3, 27, 7, 27, 242, 10, 27, 12, 27, 14, 27, 245, 11, 27, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 251, 10, 28, 3, 28, 2, 2, 3, 4, 29, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 2, 2, 2, 261, 2, 56, 3, 2, 2, 2, 4, 83, 3, 2, 2, 2, 6, 118, 3, 2, 2, 2, 8, 120, 3, 2, 2, 2, 10, 159, 3, 2, 2, 2, 12, 161, 3, 2, 2, 2, 14, 166, 3, 2, 2, 2, 16, 169, 3, 2, 2, 2, 18, 178, 3, 2, 2, 2, 20, 180, 3, 2, 2, 2, 22, 182, 3, 2, 2, 2, 24, 184, 3, 2, 2, 2, 26, 186, 3, 2, 2, 2, 28, 188, 3, 2, 2, 2, 30, 190, 3, 2, 2, 2, 32, 192, 3, 2, 2, 2, 34, 194, 3, 2, 2, 2, 36, 196, 3, 2, 2, 2, 38, 201, 3, 2, 2, 2, 40, 207, 3, 2, 2, 2, 42, 213, 3, 2, 2, 2, 44, 219, 3, 2, 2, 2, 46, 225, 3, 2, 2, 2, 48, 231, 3, 2, 2, 2, 50, 237, 3, 2, 2, 2, 52, 243, 3, 2, 2, 2, 54, 250, 3, 2, 2, 2, 56, 57, 5, 4, 3, 2, 57, 58, 7, 2, 2, 3, 58, 3, 3, 2, 2, 2, 59, 60, 8, 3, 1, 2, 60, 84, 5, 6, 4, 2, 61, 62, 5, 14, 8, 2, 62, 63, 5, 6, 4, 2, 63, 64, 5, 16, 9, 2, 64, 84, 3, 2, 2, 2, 65, 66, 5, 14, 8, 2, 66, 67, 5, 6, 4, 2, 67, 84, 3, 2, 2, 2, 68, 69, 5, 6, 4, 2, 69, 70, 5, 16, 9, 2, 70, 84, 3, 2, 2, 2, 71, 72, 5, 30, 16, 2, 72, 73, 5, 44, 23, 2, 73, 74, 5, 4, 3, 10, 74, 84, 3, 2, 2, 2, 75, 76, 5, 30, 16, 2, 76, 77, 5, 44, 23, 2, 77, 84, 3, 2, 2, 2, 78, 79, 7, 6, 2, 2, 79, 84, 5, 42, 22, 2, 80, 81, 5, 54, 28, 2, 81, 82, 5, 42, 22, 2, 82, 84, 3, 2, 2, 2, 83, 59, 3, 2, 2, 2, 83, 61, 3, 2, 2, 2, 83, 65, 3, 2, 2, 2, 83, 68, 3, 2, 2, 2, 83, 71, 3, 2, 2, 2, 83, 75, 3, 2, 2, 2, 83, 78, 3, 2, 2, 2, 83, 80, 3, 2, 2, 2, 84, 105, 3, 2, 2, 2, 85, 86, 12, 9, 2, 2, 86, 87, 5, 28, 15, 2, 87, 88, 5, 46, 24, 2, 88, 89, 5, 4, 3, 10, 89, 104, 3, 2, 2, 2, 90, 91, 12, 8, 2, 2, 91, 92, 5, 26, 14, 2, 92, 93, 5, 46, 24, 2, 93, 94, 5, 4, 3, 9, 94, 104, 3, 2, 2, 2, 95, 96, 12, 7, 2, 2, 96, 97, 5, 28, 15, 2, 97, 98, 5, 46, 24, 2, 98, 104, 3, 2, 2, 2, 99, 100, 12, 6, 2, 2, 100, 101, 5, 26, 14, 2, 101, 102, 5, 46, 24, 2, 102, 104, 3, 2, 2, 2, 103, 85, 3, 2, 2, 2, 103, 90, 3, 2, 2, 2, 103, 95, 3, 2, 2, 2, 103, 99, 3, 2, 2, 2, 104, 107, 3, 2, 2, 2, 105, 103, 3, 2, 2, 2, 105, 106, 3, 2, 2, 2, 106, 5, 3, 2, 2, 2, 107, 105, 3, 2, 2, 2, 108, 109, 5, 20, 11, 2, 109, 110, 5, 32, 17, 2, 110, 111, 5, 22, 12, 2, 111, 112, 5, 40, 21, 2, 112, 119, 3, 2, 2, 2, 113, 114, 5, 24, 13, 2, 114, 115, 5, 8, 5, 2, 115, 119, 3, 2, 2, 2, 116, 119, 5, 8, 5, 2, 117, 119, 5, 10, 6, 2, 118, 108, 3, 2, 2, 2, 118, 113, 3, 2, 2, 2, 118, 116, 3, 2, 2, 2, 118, 117, 3, 2, 2, 2, 119, 7, 3, 2, 2, 2, 120, 121, 5, 34, 18, 2, 121, 122, 5, 46, 24, 2, 122, 123, 5, 4, 3, 2, 123, 124, 5, 36, 19, 2, 124, 125, 5, 42, 22, 2, 125, 9, 3, 2, 2, 2, 126, 127, 5, 20, 11, 2, 127, 128, 5, 32, 17, 2, 128, 129, 5, 38, 20, 2, 129, 160, 3, 2, 2, 2, 130, 131, 5, 24, 13, 2, 131, 132, 5, 12, 7, 2, 132, 160, 3, 2, 2, 2, 133, 134, 5, 24, 13, 2, 134, 135, 5, 34, 18, 2, 135, 136, 5, 46, 24, 2, 136, 160, 3, 2, 2, 2, 137, 138, 5, 24, 13, 2, 138, 139, 5, 34, 18, 2, 139, 140, 5, 4, 3, 2, 140, 160, 3, 2, 2, 2, 141, 142, 5, 34, 18, 2, 142, 143, 5, 46, 24, 2, 143, 144, 5, 4, 3, 2, 144, 160, 3, 2, 2, 2, 145, 160, 5, 12, 7, 2, 146, 147, 5, 34, 18, 2, 147, 148, 5, 46, 24, 2, 148, 160, 3, 2, 2, 2, 149, 151, 7, 7, 2, 2, 150, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 154, 160, 5, 48, 25, 2, 155, 156, 5, 32, 17, 2, 156, 157, 5, 22, 12, 2, 157, 158, 5, 42, 22, 2, 158, 160, 3, 2, 2, 2, 159, 126, 3, 2, 2, 2, 159, 130, 3, 2, 2, 2, 159, 133, 3, 2, 2, 2, 159, 137, 3, 2, 2, 2, 159, 141, 3, 2, 2, 2, 159, 145, 3, 2, 2, 2, 159, 146, 3, 2, 2, 2, 159, 150, 3, 2, 2, 2, 159, 155, 3, 2, 2, 2, 160, 11, 3, 2, 2, 2, 161, 162, 5, 34, 18, 2, 162, 163, 5, 46, 24, 2, 163, 164, 5, 36, 19, 2, 164, 165, 5, 42, 22, 2, 165, 13, 3, 2, 2, 2, 166, 167, 5, 18, 10, 2, 167, 168, 5, 50, 26, 2, 168, 15, 3, 2, 2, 2, 169, 170, 5, 18, 10, 2, 170, 171, 5, 52, 27, 2, 171, 17, 3, 2, 2, 2, 172, 179, 7, 6, 2, 2, 173, 175, 7, 7, 2, 2, 174, 173, 3, 2, 2, 2, 175, 176, 3, 2, 2, 2, 176, 174, 3, 2, 2, 2, 176, 177, 3, 2, 2, 2, 177, 179, 3, 2, 2, 2, 178, 172, 3, 2, 2, 2, 178, 174, 3, 2, 2, 2, 179, 19, 3, 2, 2, 2, 180, 181, 7, 15, 2, 2, 181, 21, 3, 2, 2, 2, 182, 183, 5, 54, 28, 2, 183, 23, 3, 2, 2, 2, 184, 185, 7, 15, 2, 2, 185, 25, 3, 2, 2, 2, 186, 187, 7, 4, 2, 2, 187, 27, 3, 2, 2, 2, 188, 189, 7, 3, 2, 2, 189, 29, 3, 2, 2, 2, 190, 191, 7, 5, 2, 2, 191, 31, 3, 2, 2, 2, 192, 193, 7, 8, 2, 2, 193, 33, 3, 2, 2, 2, 194, 195, 7, 9, 2, 2, 195, 35, 3, 2, 2, 2, 196, 197, 7, 10, 2, 2, 197, 37, 3, 2, 2, 2, 198, 200, 7, 16, 2, 2, 199, 198, 3, 2, 2, 2, 200, 203, 3, 2, 2, 2, 201, 199, 3, 2, 2, 2, 201, 202, 3, 2, 2, 2, 202, 39, 3, 2, 2, 2, 203, 201, 3, 2, 2, 2, 204, 206, 7, 16, 2, 2, 205, 204, 3, 2, 2, 2, 206, 209, 3, 2, 2, 2, 207, 205, 3, 2, 2, 2, 207, 208, 3, 2, 2, 2, 208, 41, 3, 2, 2, 2, 209, 207, 3, 2, 2, 2, 210, 212, 7, 16, 2, 2, 211, 210, 3, 2, 2, 2, 212, 215, 3, 2, 2, 2, 213, 211, 3, 2, 2, 2, 213, 214, 3, 2, 2, 2, 214, 43, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 216, 218, 7, 16, 2, 2, 217, 216, 3, 2, 2, 2, 218, 221, 3, 2, 2, 2, 219, 217, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 45, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 222, 224, 7, 16, 2, 2, 223, 222, 3, 2, 2, 2, 224, 227, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 226, 47, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 228, 230, 7, 16, 2, 2, 229, 228, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 49, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 236, 7, 16, 2, 2, 235, 234, 3, 2, 2, 2, 236, 239, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 51, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 240, 242, 7, 16, 2, 2, 241, 240, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 53, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 246, 251, 7, 12, 2, 2, 247, 251, 7, 13, 2, 2, 248, 251, 7, 14, 2, 2, 249, 251, 7, 15, 2, 2, 250, 246, 3, 2, 2, 2, 250, 247, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 55, 3, 2, 2, 2, 19, 83, 103, 105, 118, 152, 159, 176, 178, 201, 207, 213, 219, 225, 231, 237, 243, 250] \ No newline at end of file diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoComplete.tokens b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoComplete.tokens new file mode 100644 index 0000000000000..f995c7bb6ea28 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoComplete.tokens @@ -0,0 +1,23 @@ +AND=1 +OR=2 +NOT=3 +STAR=4 +PLUS=5 +COLON=6 +LPAREN=7 +RPAREN=8 +EQUAL=9 +QUOTED_STRING=10 +INCOMPLETE_LEFT_QUOTED_STRING=11 +INCOMPLETE_RIGHT_QUOTED_STRING=12 +IDENTIFIER=13 +WS=14 +'and'=1 +'or'=2 +'not'=3 +'*'=4 +'+'=5 +':'=6 +'('=7 +')'=8 +'='=9 diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.interp b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.interp new file mode 100644 index 0000000000000..bbfc87f6345d0 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.interp @@ -0,0 +1,59 @@ +token literal names: +null +'and' +'or' +'not' +'*' +'+' +':' +'(' +')' +'=' +null +null +null +null +null + +token symbolic names: +null +AND +OR +NOT +STAR +PLUS +COLON +LPAREN +RPAREN +EQUAL +QUOTED_STRING +INCOMPLETE_LEFT_QUOTED_STRING +INCOMPLETE_RIGHT_QUOTED_STRING +IDENTIFIER +WS + +rule names: +AND +OR +NOT +STAR +PLUS +COLON +LPAREN +RPAREN +EQUAL +QUOTED_STRING +INCOMPLETE_LEFT_QUOTED_STRING +INCOMPLETE_RIGHT_QUOTED_STRING +IDENTIFIER +WS + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 16, 90, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 7, 11, 57, 10, 11, 12, 11, 14, 11, 60, 11, 11, 3, 11, 3, 11, 3, 12, 3, 12, 7, 12, 66, 10, 12, 12, 12, 14, 12, 69, 11, 12, 3, 13, 7, 13, 72, 10, 13, 12, 13, 14, 13, 75, 11, 13, 3, 13, 3, 13, 3, 14, 3, 14, 7, 14, 81, 10, 14, 12, 14, 14, 14, 84, 11, 14, 3, 15, 6, 15, 87, 10, 15, 13, 15, 14, 15, 88, 2, 2, 2, 16, 3, 2, 3, 5, 2, 4, 7, 2, 5, 9, 2, 6, 11, 2, 7, 13, 2, 8, 15, 2, 9, 17, 2, 10, 19, 2, 11, 21, 2, 12, 23, 2, 13, 25, 2, 14, 27, 2, 15, 29, 2, 16, 3, 2, 7, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 8, 2, 12, 12, 15, 15, 36, 36, 42, 43, 60, 60, 94, 94, 5, 2, 67, 92, 97, 97, 99, 124, 6, 2, 50, 59, 67, 92, 97, 97, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 94, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 3, 31, 3, 2, 2, 2, 5, 35, 3, 2, 2, 2, 7, 38, 3, 2, 2, 2, 9, 42, 3, 2, 2, 2, 11, 44, 3, 2, 2, 2, 13, 46, 3, 2, 2, 2, 15, 48, 3, 2, 2, 2, 17, 50, 3, 2, 2, 2, 19, 52, 3, 2, 2, 2, 21, 54, 3, 2, 2, 2, 23, 63, 3, 2, 2, 2, 25, 73, 3, 2, 2, 2, 27, 78, 3, 2, 2, 2, 29, 86, 3, 2, 2, 2, 31, 32, 7, 99, 2, 2, 32, 33, 7, 112, 2, 2, 33, 34, 7, 102, 2, 2, 34, 4, 3, 2, 2, 2, 35, 36, 7, 113, 2, 2, 36, 37, 7, 116, 2, 2, 37, 6, 3, 2, 2, 2, 38, 39, 7, 112, 2, 2, 39, 40, 7, 113, 2, 2, 40, 41, 7, 118, 2, 2, 41, 8, 3, 2, 2, 2, 42, 43, 7, 44, 2, 2, 43, 10, 3, 2, 2, 2, 44, 45, 7, 45, 2, 2, 45, 12, 3, 2, 2, 2, 46, 47, 7, 60, 2, 2, 47, 14, 3, 2, 2, 2, 48, 49, 7, 42, 2, 2, 49, 16, 3, 2, 2, 2, 50, 51, 7, 43, 2, 2, 51, 18, 3, 2, 2, 2, 52, 53, 7, 63, 2, 2, 53, 20, 3, 2, 2, 2, 54, 58, 7, 36, 2, 2, 55, 57, 10, 2, 2, 2, 56, 55, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 61, 3, 2, 2, 2, 60, 58, 3, 2, 2, 2, 61, 62, 7, 36, 2, 2, 62, 22, 3, 2, 2, 2, 63, 67, 7, 36, 2, 2, 64, 66, 10, 3, 2, 2, 65, 64, 3, 2, 2, 2, 66, 69, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 67, 68, 3, 2, 2, 2, 68, 24, 3, 2, 2, 2, 69, 67, 3, 2, 2, 2, 70, 72, 10, 3, 2, 2, 71, 70, 3, 2, 2, 2, 72, 75, 3, 2, 2, 2, 73, 71, 3, 2, 2, 2, 73, 74, 3, 2, 2, 2, 74, 76, 3, 2, 2, 2, 75, 73, 3, 2, 2, 2, 76, 77, 7, 36, 2, 2, 77, 26, 3, 2, 2, 2, 78, 82, 9, 4, 2, 2, 79, 81, 9, 5, 2, 2, 80, 79, 3, 2, 2, 2, 81, 84, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 28, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 85, 87, 9, 6, 2, 2, 86, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 89, 3, 2, 2, 2, 89, 30, 3, 2, 2, 2, 8, 2, 58, 67, 73, 82, 88, 2] \ No newline at end of file diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.tokens b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.tokens new file mode 100644 index 0000000000000..f995c7bb6ea28 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.tokens @@ -0,0 +1,23 @@ +AND=1 +OR=2 +NOT=3 +STAR=4 +PLUS=5 +COLON=6 +LPAREN=7 +RPAREN=8 +EQUAL=9 +QUOTED_STRING=10 +INCOMPLETE_LEFT_QUOTED_STRING=11 +INCOMPLETE_RIGHT_QUOTED_STRING=12 +IDENTIFIER=13 +WS=14 +'and'=1 +'or'=2 +'not'=3 +'*'=4 +'+'=5 +':'=6 +'('=7 +')'=8 +'='=9 diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.ts new file mode 100644 index 0000000000000..4d8a9a5165066 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteLexer.ts @@ -0,0 +1,172 @@ +// Generated from /Users/marcosalazar/code/dagster/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.g4 by ANTLR 4.9.0-SNAPSHOT + +import {CharStream} from 'antlr4ts/CharStream'; +import {Lexer} from 'antlr4ts/Lexer'; +import {Vocabulary} from 'antlr4ts/Vocabulary'; +import {VocabularyImpl} from 'antlr4ts/VocabularyImpl'; +import {ATN} from 'antlr4ts/atn/ATN'; +import {ATNDeserializer} from 'antlr4ts/atn/ATNDeserializer'; +import {LexerATNSimulator} from 'antlr4ts/atn/LexerATNSimulator'; +import * as Utils from 'antlr4ts/misc/Utils'; + +export class SelectionAutoCompleteLexer extends Lexer { + public static readonly AND = 1; + public static readonly OR = 2; + public static readonly NOT = 3; + public static readonly STAR = 4; + public static readonly PLUS = 5; + public static readonly COLON = 6; + public static readonly LPAREN = 7; + public static readonly RPAREN = 8; + public static readonly EQUAL = 9; + public static readonly QUOTED_STRING = 10; + public static readonly INCOMPLETE_LEFT_QUOTED_STRING = 11; + public static readonly INCOMPLETE_RIGHT_QUOTED_STRING = 12; + public static readonly IDENTIFIER = 13; + public static readonly WS = 14; + + // tslint:disable:no-trailing-whitespace + public static readonly channelNames: string[] = ['DEFAULT_TOKEN_CHANNEL', 'HIDDEN']; + + // tslint:disable:no-trailing-whitespace + public static readonly modeNames: string[] = ['DEFAULT_MODE']; + + public static readonly ruleNames: string[] = [ + 'AND', + 'OR', + 'NOT', + 'STAR', + 'PLUS', + 'COLON', + 'LPAREN', + 'RPAREN', + 'EQUAL', + 'QUOTED_STRING', + 'INCOMPLETE_LEFT_QUOTED_STRING', + 'INCOMPLETE_RIGHT_QUOTED_STRING', + 'IDENTIFIER', + 'WS', + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, + "'and'", + "'or'", + "'not'", + "'*'", + "'+'", + "':'", + "'('", + "')'", + "'='", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, + 'AND', + 'OR', + 'NOT', + 'STAR', + 'PLUS', + 'COLON', + 'LPAREN', + 'RPAREN', + 'EQUAL', + 'QUOTED_STRING', + 'INCOMPLETE_LEFT_QUOTED_STRING', + 'INCOMPLETE_RIGHT_QUOTED_STRING', + 'IDENTIFIER', + 'WS', + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( + SelectionAutoCompleteLexer._LITERAL_NAMES, + SelectionAutoCompleteLexer._SYMBOLIC_NAMES, + [], + ); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return SelectionAutoCompleteLexer.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + constructor(input: CharStream) { + super(input); + this._interp = new LexerATNSimulator(SelectionAutoCompleteLexer._ATN, this); + } + + // @Override + public get grammarFileName(): string { + return 'SelectionAutoComplete.g4'; + } + + // @Override + public get ruleNames(): string[] { + return SelectionAutoCompleteLexer.ruleNames; + } + + // @Override + public get serializedATN(): string { + return SelectionAutoCompleteLexer._serializedATN; + } + + // @Override + public get channelNames(): string[] { + return SelectionAutoCompleteLexer.channelNames; + } + + // @Override + public get modeNames(): string[] { + return SelectionAutoCompleteLexer.modeNames; + } + + public static readonly _serializedATN: string = + '\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02\x10Z\b\x01\x04' + + '\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04' + + '\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r' + + '\x04\x0E\t\x0E\x04\x0F\t\x0F\x03\x02\x03\x02\x03\x02\x03\x02\x03\x03\x03' + + '\x03\x03\x03\x03\x04\x03\x04\x03\x04\x03\x04\x03\x05\x03\x05\x03\x06\x03' + + '\x06\x03\x07\x03\x07\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\v\x03\v\x07' + + '\v9\n\v\f\v\x0E\v<\v\v\x03\v\x03\v\x03\f\x03\f\x07\fB\n\f\f\f\x0E\fE\v' + + '\f\x03\r\x07\rH\n\r\f\r\x0E\rK\v\r\x03\r\x03\r\x03\x0E\x03\x0E\x07\x0E' + + 'Q\n\x0E\f\x0E\x0E\x0ET\v\x0E\x03\x0F\x06\x0FW\n\x0F\r\x0F\x0E\x0FX\x02' + + '\x02\x02\x10\x03\x02\x03\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x07\r' + + '\x02\b\x0F\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17\x02\r\x19\x02\x0E\x1B' + + '\x02\x0F\x1D\x02\x10\x03\x02\x07\x06\x02\f\f\x0F\x0F$$^^\b\x02\f\f\x0F' + + '\x0F$$*+<<^^\x05\x02C\\aac|\x06\x022;C\\aac|\x05\x02\v\f\x0F\x0F""\x02' + + '^\x02\x03\x03\x02\x02\x02\x02\x05\x03\x02\x02\x02\x02\x07\x03\x02\x02' + + '\x02\x02\t\x03\x02\x02\x02\x02\v\x03\x02\x02\x02\x02\r\x03\x02\x02\x02' + + '\x02\x0F\x03\x02\x02\x02\x02\x11\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02' + + '\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02\x02\x02' + + '\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02\x02\x03\x1F\x03\x02\x02\x02' + + '\x05#\x03\x02\x02\x02\x07&\x03\x02\x02\x02\t*\x03\x02\x02\x02\v,\x03\x02' + + '\x02\x02\r.\x03\x02\x02\x02\x0F0\x03\x02\x02\x02\x112\x03\x02\x02\x02' + + '\x134\x03\x02\x02\x02\x156\x03\x02\x02\x02\x17?\x03\x02\x02\x02\x19I\x03' + + '\x02\x02\x02\x1BN\x03\x02\x02\x02\x1DV\x03\x02\x02\x02\x1F \x07c\x02\x02' + + ' !\x07p\x02\x02!"\x07f\x02\x02"\x04\x03\x02\x02\x02#$\x07q\x02\x02$' + + "%\x07t\x02\x02%\x06\x03\x02\x02\x02&'\x07p\x02\x02'(\x07q\x02\x02()" + + '\x07v\x02\x02)\b\x03\x02\x02\x02*+\x07,\x02\x02+\n\x03\x02\x02\x02,-\x07' + + '-\x02\x02-\f\x03\x02\x02\x02./\x07<\x02\x02/\x0E\x03\x02\x02\x0201\x07' + + '*\x02\x021\x10\x03\x02\x02\x0223\x07+\x02\x023\x12\x03\x02\x02\x0245\x07' + + '?\x02\x025\x14\x03\x02\x02\x026:\x07$\x02\x0279\n\x02\x02\x0287\x03\x02' + + '\x02\x029<\x03\x02\x02\x02:8\x03\x02\x02\x02:;\x03\x02\x02\x02;=\x03\x02' + + '\x02\x02<:\x03\x02\x02\x02=>\x07$\x02\x02>\x16\x03\x02\x02\x02?C\x07$' + + '\x02\x02@B\n\x03\x02\x02A@\x03\x02\x02\x02BE\x03\x02\x02\x02CA\x03\x02' + + '\x02\x02CD\x03\x02\x02\x02D\x18\x03\x02\x02\x02EC\x03\x02\x02\x02FH\n' + + '\x03\x02\x02GF\x03\x02\x02\x02HK\x03\x02\x02\x02IG\x03\x02\x02\x02IJ\x03' + + '\x02\x02\x02JL\x03\x02\x02\x02KI\x03\x02\x02\x02LM\x07$\x02\x02M\x1A\x03' + + '\x02\x02\x02NR\t\x04\x02\x02OQ\t\x05\x02\x02PO\x03\x02\x02\x02QT\x03\x02' + + '\x02\x02RP\x03\x02\x02\x02RS\x03\x02\x02\x02S\x1C\x03\x02\x02\x02TR\x03' + + '\x02\x02\x02UW\t\x06\x02\x02VU\x03\x02\x02\x02WX\x03\x02\x02\x02XV\x03' + + '\x02\x02\x02XY\x03\x02\x02\x02Y\x1E\x03\x02\x02\x02\b\x02:CIRX\x02'; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!SelectionAutoCompleteLexer.__ATN) { + SelectionAutoCompleteLexer.__ATN = new ATNDeserializer().deserialize( + Utils.toCharArray(SelectionAutoCompleteLexer._serializedATN), + ); + } + + return SelectionAutoCompleteLexer.__ATN; + } +} diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteListener.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteListener.ts new file mode 100644 index 0000000000000..746e48bc423f2 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteListener.ts @@ -0,0 +1,826 @@ +// Generated from /Users/marcosalazar/code/dagster/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.g4 by ANTLR 4.9.0-SNAPSHOT + +import {ParseTreeListener} from 'antlr4ts/tree/ParseTreeListener'; + +import { + AllExpressionContext, + AndExpressionContext, + AndTokenContext, + AttributeExpressionContext, + AttributeNameContext, + AttributeValueContext, + AttributeValueWhitespaceContext, + ColonTokenContext, + DownTraversalContext, + DownTraversalExprContext, + DownTraversalExpressionContext, + ExprContext, + ExpressionLessParenthesizedExprContext, + ExpressionlessFunctionExpressionContext, + ExpressionlessParenthesizedExpressionContext, + ExpressionlessParenthesizedExpressionWrapperContext, + FunctionCallExpressionContext, + FunctionNameContext, + IncompleteAndExpressionContext, + IncompleteAttributeExpressionMissingKeyContext, + IncompleteAttributeExpressionMissingValueContext, + IncompleteExprContext, + IncompleteExpressionContext, + IncompleteLeftQuotedStringValueContext, + IncompleteNotExpressionContext, + IncompleteOrExpressionContext, + IncompletePlusTraversalExpressionContext, + IncompleteRightQuotedStringValueContext, + LeftParenTokenContext, + NotExpressionContext, + NotTokenContext, + OrExpressionContext, + OrTokenContext, + ParenthesizedExprContext, + ParenthesizedExpressionContext, + PostAttributeValueWhitespaceContext, + PostDownwardTraversalWhitespaceContext, + PostExpressionWhitespaceContext, + PostLogicalOperatorWhitespaceContext, + PostNeighborTraversalWhitespaceContext, + PostNotOperatorWhitespaceContext, + PostUpwardTraversalWhitespaceContext, + QuotedStringValueContext, + RightParenTokenContext, + StartContext, + TraversalAllowedExprContext, + TraversalAllowedExpressionContext, + TraversalAllowedParenthesizedExpressionContext, + TraversalContext, + UnclosedExpressionlessFunctionExpressionContext, + UnclosedExpressionlessParenthesizedExpressionContext, + UnclosedFunctionExpressionContext, + UnclosedParenthesizedExpressionContext, + UnmatchedValueContext, + UnquotedStringValueContext, + UpAndDownTraversalExpressionContext, + UpTraversalContext, + UpTraversalExprContext, + UpTraversalExpressionContext, + ValueContext, +} from './SelectionAutoCompleteParser'; + +/** + * This interface defines a complete listener for a parse tree produced by + * `SelectionAutoCompleteParser`. + */ +export interface SelectionAutoCompleteListener extends ParseTreeListener { + /** + * Enter a parse tree produced by the `AttributeExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + enterAttributeExpression?: (ctx: AttributeExpressionContext) => void; + /** + * Exit a parse tree produced by the `AttributeExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + exitAttributeExpression?: (ctx: AttributeExpressionContext) => void; + + /** + * Enter a parse tree produced by the `FunctionCallExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + enterFunctionCallExpression?: (ctx: FunctionCallExpressionContext) => void; + /** + * Exit a parse tree produced by the `FunctionCallExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + exitFunctionCallExpression?: (ctx: FunctionCallExpressionContext) => void; + + /** + * Enter a parse tree produced by the `TraversalAllowedParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + enterTraversalAllowedParenthesizedExpression?: ( + ctx: TraversalAllowedParenthesizedExpressionContext, + ) => void; + /** + * Exit a parse tree produced by the `TraversalAllowedParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + exitTraversalAllowedParenthesizedExpression?: ( + ctx: TraversalAllowedParenthesizedExpressionContext, + ) => void; + + /** + * Enter a parse tree produced by the `IncompleteExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + enterIncompleteExpression?: (ctx: IncompleteExpressionContext) => void; + /** + * Exit a parse tree produced by the `IncompleteExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + exitIncompleteExpression?: (ctx: IncompleteExpressionContext) => void; + + /** + * Enter a parse tree produced by the `UpTraversal` + * labeled alternative in `SelectionAutoCompleteParser.upTraversalExpr`. + * @param ctx the parse tree + */ + enterUpTraversal?: (ctx: UpTraversalContext) => void; + /** + * Exit a parse tree produced by the `UpTraversal` + * labeled alternative in `SelectionAutoCompleteParser.upTraversalExpr`. + * @param ctx the parse tree + */ + exitUpTraversal?: (ctx: UpTraversalContext) => void; + + /** + * Enter a parse tree produced by the `ParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.parenthesizedExpr`. + * @param ctx the parse tree + */ + enterParenthesizedExpression?: (ctx: ParenthesizedExpressionContext) => void; + /** + * Exit a parse tree produced by the `ParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.parenthesizedExpr`. + * @param ctx the parse tree + */ + exitParenthesizedExpression?: (ctx: ParenthesizedExpressionContext) => void; + + /** + * Enter a parse tree produced by the `TraversalAllowedExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterTraversalAllowedExpression?: (ctx: TraversalAllowedExpressionContext) => void; + /** + * Exit a parse tree produced by the `TraversalAllowedExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitTraversalAllowedExpression?: (ctx: TraversalAllowedExpressionContext) => void; + + /** + * Enter a parse tree produced by the `UpAndDownTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterUpAndDownTraversalExpression?: (ctx: UpAndDownTraversalExpressionContext) => void; + /** + * Exit a parse tree produced by the `UpAndDownTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitUpAndDownTraversalExpression?: (ctx: UpAndDownTraversalExpressionContext) => void; + + /** + * Enter a parse tree produced by the `UpTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterUpTraversalExpression?: (ctx: UpTraversalExpressionContext) => void; + /** + * Exit a parse tree produced by the `UpTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitUpTraversalExpression?: (ctx: UpTraversalExpressionContext) => void; + + /** + * Enter a parse tree produced by the `DownTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterDownTraversalExpression?: (ctx: DownTraversalExpressionContext) => void; + /** + * Exit a parse tree produced by the `DownTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitDownTraversalExpression?: (ctx: DownTraversalExpressionContext) => void; + + /** + * Enter a parse tree produced by the `NotExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterNotExpression?: (ctx: NotExpressionContext) => void; + /** + * Exit a parse tree produced by the `NotExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitNotExpression?: (ctx: NotExpressionContext) => void; + + /** + * Enter a parse tree produced by the `AndExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterAndExpression?: (ctx: AndExpressionContext) => void; + /** + * Exit a parse tree produced by the `AndExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitAndExpression?: (ctx: AndExpressionContext) => void; + + /** + * Enter a parse tree produced by the `OrExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterOrExpression?: (ctx: OrExpressionContext) => void; + /** + * Exit a parse tree produced by the `OrExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitOrExpression?: (ctx: OrExpressionContext) => void; + + /** + * Enter a parse tree produced by the `IncompleteAndExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterIncompleteAndExpression?: (ctx: IncompleteAndExpressionContext) => void; + /** + * Exit a parse tree produced by the `IncompleteAndExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitIncompleteAndExpression?: (ctx: IncompleteAndExpressionContext) => void; + + /** + * Enter a parse tree produced by the `IncompleteOrExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterIncompleteOrExpression?: (ctx: IncompleteOrExpressionContext) => void; + /** + * Exit a parse tree produced by the `IncompleteOrExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitIncompleteOrExpression?: (ctx: IncompleteOrExpressionContext) => void; + + /** + * Enter a parse tree produced by the `IncompleteNotExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterIncompleteNotExpression?: (ctx: IncompleteNotExpressionContext) => void; + /** + * Exit a parse tree produced by the `IncompleteNotExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitIncompleteNotExpression?: (ctx: IncompleteNotExpressionContext) => void; + + /** + * Enter a parse tree produced by the `AllExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterAllExpression?: (ctx: AllExpressionContext) => void; + /** + * Exit a parse tree produced by the `AllExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitAllExpression?: (ctx: AllExpressionContext) => void; + + /** + * Enter a parse tree produced by the `UnmatchedValue` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterUnmatchedValue?: (ctx: UnmatchedValueContext) => void; + /** + * Exit a parse tree produced by the `UnmatchedValue` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitUnmatchedValue?: (ctx: UnmatchedValueContext) => void; + + /** + * Enter a parse tree produced by the `ExpressionlessParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.expressionLessParenthesizedExpr`. + * @param ctx the parse tree + */ + enterExpressionlessParenthesizedExpression?: ( + ctx: ExpressionlessParenthesizedExpressionContext, + ) => void; + /** + * Exit a parse tree produced by the `ExpressionlessParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.expressionLessParenthesizedExpr`. + * @param ctx the parse tree + */ + exitExpressionlessParenthesizedExpression?: ( + ctx: ExpressionlessParenthesizedExpressionContext, + ) => void; + + /** + * Enter a parse tree produced by the `DownTraversal` + * labeled alternative in `SelectionAutoCompleteParser.downTraversalExpr`. + * @param ctx the parse tree + */ + enterDownTraversal?: (ctx: DownTraversalContext) => void; + /** + * Exit a parse tree produced by the `DownTraversal` + * labeled alternative in `SelectionAutoCompleteParser.downTraversalExpr`. + * @param ctx the parse tree + */ + exitDownTraversal?: (ctx: DownTraversalContext) => void; + + /** + * Enter a parse tree produced by the `QuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + enterQuotedStringValue?: (ctx: QuotedStringValueContext) => void; + /** + * Exit a parse tree produced by the `QuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + exitQuotedStringValue?: (ctx: QuotedStringValueContext) => void; + + /** + * Enter a parse tree produced by the `IncompleteLeftQuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + enterIncompleteLeftQuotedStringValue?: (ctx: IncompleteLeftQuotedStringValueContext) => void; + /** + * Exit a parse tree produced by the `IncompleteLeftQuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + exitIncompleteLeftQuotedStringValue?: (ctx: IncompleteLeftQuotedStringValueContext) => void; + + /** + * Enter a parse tree produced by the `IncompleteRightQuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + enterIncompleteRightQuotedStringValue?: (ctx: IncompleteRightQuotedStringValueContext) => void; + /** + * Exit a parse tree produced by the `IncompleteRightQuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + exitIncompleteRightQuotedStringValue?: (ctx: IncompleteRightQuotedStringValueContext) => void; + + /** + * Enter a parse tree produced by the `UnquotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + enterUnquotedStringValue?: (ctx: UnquotedStringValueContext) => void; + /** + * Exit a parse tree produced by the `UnquotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + exitUnquotedStringValue?: (ctx: UnquotedStringValueContext) => void; + + /** + * Enter a parse tree produced by the `IncompleteAttributeExpressionMissingValue` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterIncompleteAttributeExpressionMissingValue?: ( + ctx: IncompleteAttributeExpressionMissingValueContext, + ) => void; + /** + * Exit a parse tree produced by the `IncompleteAttributeExpressionMissingValue` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitIncompleteAttributeExpressionMissingValue?: ( + ctx: IncompleteAttributeExpressionMissingValueContext, + ) => void; + + /** + * Enter a parse tree produced by the `ExpressionlessFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterExpressionlessFunctionExpression?: (ctx: ExpressionlessFunctionExpressionContext) => void; + /** + * Exit a parse tree produced by the `ExpressionlessFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitExpressionlessFunctionExpression?: (ctx: ExpressionlessFunctionExpressionContext) => void; + + /** + * Enter a parse tree produced by the `UnclosedExpressionlessFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterUnclosedExpressionlessFunctionExpression?: ( + ctx: UnclosedExpressionlessFunctionExpressionContext, + ) => void; + /** + * Exit a parse tree produced by the `UnclosedExpressionlessFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitUnclosedExpressionlessFunctionExpression?: ( + ctx: UnclosedExpressionlessFunctionExpressionContext, + ) => void; + + /** + * Enter a parse tree produced by the `UnclosedFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterUnclosedFunctionExpression?: (ctx: UnclosedFunctionExpressionContext) => void; + /** + * Exit a parse tree produced by the `UnclosedFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitUnclosedFunctionExpression?: (ctx: UnclosedFunctionExpressionContext) => void; + + /** + * Enter a parse tree produced by the `UnclosedParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterUnclosedParenthesizedExpression?: (ctx: UnclosedParenthesizedExpressionContext) => void; + /** + * Exit a parse tree produced by the `UnclosedParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitUnclosedParenthesizedExpression?: (ctx: UnclosedParenthesizedExpressionContext) => void; + + /** + * Enter a parse tree produced by the `ExpressionlessParenthesizedExpressionWrapper` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterExpressionlessParenthesizedExpressionWrapper?: ( + ctx: ExpressionlessParenthesizedExpressionWrapperContext, + ) => void; + /** + * Exit a parse tree produced by the `ExpressionlessParenthesizedExpressionWrapper` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitExpressionlessParenthesizedExpressionWrapper?: ( + ctx: ExpressionlessParenthesizedExpressionWrapperContext, + ) => void; + + /** + * Enter a parse tree produced by the `UnclosedExpressionlessParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterUnclosedExpressionlessParenthesizedExpression?: ( + ctx: UnclosedExpressionlessParenthesizedExpressionContext, + ) => void; + /** + * Exit a parse tree produced by the `UnclosedExpressionlessParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitUnclosedExpressionlessParenthesizedExpression?: ( + ctx: UnclosedExpressionlessParenthesizedExpressionContext, + ) => void; + + /** + * Enter a parse tree produced by the `IncompletePlusTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterIncompletePlusTraversalExpression?: (ctx: IncompletePlusTraversalExpressionContext) => void; + /** + * Exit a parse tree produced by the `IncompletePlusTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitIncompletePlusTraversalExpression?: (ctx: IncompletePlusTraversalExpressionContext) => void; + + /** + * Enter a parse tree produced by the `IncompleteAttributeExpressionMissingKey` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterIncompleteAttributeExpressionMissingKey?: ( + ctx: IncompleteAttributeExpressionMissingKeyContext, + ) => void; + /** + * Exit a parse tree produced by the `IncompleteAttributeExpressionMissingKey` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitIncompleteAttributeExpressionMissingKey?: ( + ctx: IncompleteAttributeExpressionMissingKeyContext, + ) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.start`. + * @param ctx the parse tree + */ + enterStart?: (ctx: StartContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.start`. + * @param ctx the parse tree + */ + exitStart?: (ctx: StartContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + enterExpr?: (ctx: ExprContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + */ + exitExpr?: (ctx: ExprContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + enterTraversalAllowedExpr?: (ctx: TraversalAllowedExprContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + */ + exitTraversalAllowedExpr?: (ctx: TraversalAllowedExprContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.parenthesizedExpr`. + * @param ctx the parse tree + */ + enterParenthesizedExpr?: (ctx: ParenthesizedExprContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.parenthesizedExpr`. + * @param ctx the parse tree + */ + exitParenthesizedExpr?: (ctx: ParenthesizedExprContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + enterIncompleteExpr?: (ctx: IncompleteExprContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + */ + exitIncompleteExpr?: (ctx: IncompleteExprContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.expressionLessParenthesizedExpr`. + * @param ctx the parse tree + */ + enterExpressionLessParenthesizedExpr?: (ctx: ExpressionLessParenthesizedExprContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.expressionLessParenthesizedExpr`. + * @param ctx the parse tree + */ + exitExpressionLessParenthesizedExpr?: (ctx: ExpressionLessParenthesizedExprContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.upTraversalExpr`. + * @param ctx the parse tree + */ + enterUpTraversalExpr?: (ctx: UpTraversalExprContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.upTraversalExpr`. + * @param ctx the parse tree + */ + exitUpTraversalExpr?: (ctx: UpTraversalExprContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.downTraversalExpr`. + * @param ctx the parse tree + */ + enterDownTraversalExpr?: (ctx: DownTraversalExprContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.downTraversalExpr`. + * @param ctx the parse tree + */ + exitDownTraversalExpr?: (ctx: DownTraversalExprContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.traversal`. + * @param ctx the parse tree + */ + enterTraversal?: (ctx: TraversalContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.traversal`. + * @param ctx the parse tree + */ + exitTraversal?: (ctx: TraversalContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.attributeName`. + * @param ctx the parse tree + */ + enterAttributeName?: (ctx: AttributeNameContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.attributeName`. + * @param ctx the parse tree + */ + exitAttributeName?: (ctx: AttributeNameContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.attributeValue`. + * @param ctx the parse tree + */ + enterAttributeValue?: (ctx: AttributeValueContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.attributeValue`. + * @param ctx the parse tree + */ + exitAttributeValue?: (ctx: AttributeValueContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.functionName`. + * @param ctx the parse tree + */ + enterFunctionName?: (ctx: FunctionNameContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.functionName`. + * @param ctx the parse tree + */ + exitFunctionName?: (ctx: FunctionNameContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.orToken`. + * @param ctx the parse tree + */ + enterOrToken?: (ctx: OrTokenContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.orToken`. + * @param ctx the parse tree + */ + exitOrToken?: (ctx: OrTokenContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.andToken`. + * @param ctx the parse tree + */ + enterAndToken?: (ctx: AndTokenContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.andToken`. + * @param ctx the parse tree + */ + exitAndToken?: (ctx: AndTokenContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.notToken`. + * @param ctx the parse tree + */ + enterNotToken?: (ctx: NotTokenContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.notToken`. + * @param ctx the parse tree + */ + exitNotToken?: (ctx: NotTokenContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.colonToken`. + * @param ctx the parse tree + */ + enterColonToken?: (ctx: ColonTokenContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.colonToken`. + * @param ctx the parse tree + */ + exitColonToken?: (ctx: ColonTokenContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.leftParenToken`. + * @param ctx the parse tree + */ + enterLeftParenToken?: (ctx: LeftParenTokenContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.leftParenToken`. + * @param ctx the parse tree + */ + exitLeftParenToken?: (ctx: LeftParenTokenContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.rightParenToken`. + * @param ctx the parse tree + */ + enterRightParenToken?: (ctx: RightParenTokenContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.rightParenToken`. + * @param ctx the parse tree + */ + exitRightParenToken?: (ctx: RightParenTokenContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.attributeValueWhitespace`. + * @param ctx the parse tree + */ + enterAttributeValueWhitespace?: (ctx: AttributeValueWhitespaceContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.attributeValueWhitespace`. + * @param ctx the parse tree + */ + exitAttributeValueWhitespace?: (ctx: AttributeValueWhitespaceContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.postAttributeValueWhitespace`. + * @param ctx the parse tree + */ + enterPostAttributeValueWhitespace?: (ctx: PostAttributeValueWhitespaceContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.postAttributeValueWhitespace`. + * @param ctx the parse tree + */ + exitPostAttributeValueWhitespace?: (ctx: PostAttributeValueWhitespaceContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.postExpressionWhitespace`. + * @param ctx the parse tree + */ + enterPostExpressionWhitespace?: (ctx: PostExpressionWhitespaceContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.postExpressionWhitespace`. + * @param ctx the parse tree + */ + exitPostExpressionWhitespace?: (ctx: PostExpressionWhitespaceContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.postNotOperatorWhitespace`. + * @param ctx the parse tree + */ + enterPostNotOperatorWhitespace?: (ctx: PostNotOperatorWhitespaceContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.postNotOperatorWhitespace`. + * @param ctx the parse tree + */ + exitPostNotOperatorWhitespace?: (ctx: PostNotOperatorWhitespaceContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.postLogicalOperatorWhitespace`. + * @param ctx the parse tree + */ + enterPostLogicalOperatorWhitespace?: (ctx: PostLogicalOperatorWhitespaceContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.postLogicalOperatorWhitespace`. + * @param ctx the parse tree + */ + exitPostLogicalOperatorWhitespace?: (ctx: PostLogicalOperatorWhitespaceContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.postNeighborTraversalWhitespace`. + * @param ctx the parse tree + */ + enterPostNeighborTraversalWhitespace?: (ctx: PostNeighborTraversalWhitespaceContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.postNeighborTraversalWhitespace`. + * @param ctx the parse tree + */ + exitPostNeighborTraversalWhitespace?: (ctx: PostNeighborTraversalWhitespaceContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.postUpwardTraversalWhitespace`. + * @param ctx the parse tree + */ + enterPostUpwardTraversalWhitespace?: (ctx: PostUpwardTraversalWhitespaceContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.postUpwardTraversalWhitespace`. + * @param ctx the parse tree + */ + exitPostUpwardTraversalWhitespace?: (ctx: PostUpwardTraversalWhitespaceContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.postDownwardTraversalWhitespace`. + * @param ctx the parse tree + */ + enterPostDownwardTraversalWhitespace?: (ctx: PostDownwardTraversalWhitespaceContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.postDownwardTraversalWhitespace`. + * @param ctx the parse tree + */ + exitPostDownwardTraversalWhitespace?: (ctx: PostDownwardTraversalWhitespaceContext) => void; + + /** + * Enter a parse tree produced by `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + enterValue?: (ctx: ValueContext) => void; + /** + * Exit a parse tree produced by `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + */ + exitValue?: (ctx: ValueContext) => void; +} diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteParser.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteParser.ts new file mode 100644 index 0000000000000..ae3c95659c73e --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteParser.ts @@ -0,0 +1,3435 @@ +// Generated from /Users/marcosalazar/code/dagster/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.g4 by ANTLR 4.9.0-SNAPSHOT + +import {FailedPredicateException} from 'antlr4ts/FailedPredicateException'; +import {NoViableAltException} from 'antlr4ts/NoViableAltException'; +import {Parser} from 'antlr4ts/Parser'; +import {ParserRuleContext} from 'antlr4ts/ParserRuleContext'; +import {RecognitionException} from 'antlr4ts/RecognitionException'; +import {RuleContext} from 'antlr4ts/RuleContext'; +//import { RuleVersion } from "antlr4ts/RuleVersion"; +import {TokenStream} from 'antlr4ts/TokenStream'; +import {Vocabulary} from 'antlr4ts/Vocabulary'; +import {VocabularyImpl} from 'antlr4ts/VocabularyImpl'; +import {ATN} from 'antlr4ts/atn/ATN'; +import {ATNDeserializer} from 'antlr4ts/atn/ATNDeserializer'; +import {ParserATNSimulator} from 'antlr4ts/atn/ParserATNSimulator'; +import * as Utils from 'antlr4ts/misc/Utils'; +import {TerminalNode} from 'antlr4ts/tree/TerminalNode'; + +import {SelectionAutoCompleteListener} from './SelectionAutoCompleteListener'; +import {SelectionAutoCompleteVisitor} from './SelectionAutoCompleteVisitor'; + +export class SelectionAutoCompleteParser extends Parser { + public static readonly AND = 1; + public static readonly OR = 2; + public static readonly NOT = 3; + public static readonly STAR = 4; + public static readonly PLUS = 5; + public static readonly COLON = 6; + public static readonly LPAREN = 7; + public static readonly RPAREN = 8; + public static readonly EQUAL = 9; + public static readonly QUOTED_STRING = 10; + public static readonly INCOMPLETE_LEFT_QUOTED_STRING = 11; + public static readonly INCOMPLETE_RIGHT_QUOTED_STRING = 12; + public static readonly IDENTIFIER = 13; + public static readonly WS = 14; + public static readonly RULE_start = 0; + public static readonly RULE_expr = 1; + public static readonly RULE_traversalAllowedExpr = 2; + public static readonly RULE_parenthesizedExpr = 3; + public static readonly RULE_incompleteExpr = 4; + public static readonly RULE_expressionLessParenthesizedExpr = 5; + public static readonly RULE_upTraversalExpr = 6; + public static readonly RULE_downTraversalExpr = 7; + public static readonly RULE_traversal = 8; + public static readonly RULE_attributeName = 9; + public static readonly RULE_attributeValue = 10; + public static readonly RULE_functionName = 11; + public static readonly RULE_orToken = 12; + public static readonly RULE_andToken = 13; + public static readonly RULE_notToken = 14; + public static readonly RULE_colonToken = 15; + public static readonly RULE_leftParenToken = 16; + public static readonly RULE_rightParenToken = 17; + public static readonly RULE_attributeValueWhitespace = 18; + public static readonly RULE_postAttributeValueWhitespace = 19; + public static readonly RULE_postExpressionWhitespace = 20; + public static readonly RULE_postNotOperatorWhitespace = 21; + public static readonly RULE_postLogicalOperatorWhitespace = 22; + public static readonly RULE_postNeighborTraversalWhitespace = 23; + public static readonly RULE_postUpwardTraversalWhitespace = 24; + public static readonly RULE_postDownwardTraversalWhitespace = 25; + public static readonly RULE_value = 26; + // tslint:disable:no-trailing-whitespace + public static readonly ruleNames: string[] = [ + 'start', + 'expr', + 'traversalAllowedExpr', + 'parenthesizedExpr', + 'incompleteExpr', + 'expressionLessParenthesizedExpr', + 'upTraversalExpr', + 'downTraversalExpr', + 'traversal', + 'attributeName', + 'attributeValue', + 'functionName', + 'orToken', + 'andToken', + 'notToken', + 'colonToken', + 'leftParenToken', + 'rightParenToken', + 'attributeValueWhitespace', + 'postAttributeValueWhitespace', + 'postExpressionWhitespace', + 'postNotOperatorWhitespace', + 'postLogicalOperatorWhitespace', + 'postNeighborTraversalWhitespace', + 'postUpwardTraversalWhitespace', + 'postDownwardTraversalWhitespace', + 'value', + ]; + + private static readonly _LITERAL_NAMES: Array = [ + undefined, + "'and'", + "'or'", + "'not'", + "'*'", + "'+'", + "':'", + "'('", + "')'", + "'='", + ]; + private static readonly _SYMBOLIC_NAMES: Array = [ + undefined, + 'AND', + 'OR', + 'NOT', + 'STAR', + 'PLUS', + 'COLON', + 'LPAREN', + 'RPAREN', + 'EQUAL', + 'QUOTED_STRING', + 'INCOMPLETE_LEFT_QUOTED_STRING', + 'INCOMPLETE_RIGHT_QUOTED_STRING', + 'IDENTIFIER', + 'WS', + ]; + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( + SelectionAutoCompleteParser._LITERAL_NAMES, + SelectionAutoCompleteParser._SYMBOLIC_NAMES, + [], + ); + + // @Override + // @NotNull + public get vocabulary(): Vocabulary { + return SelectionAutoCompleteParser.VOCABULARY; + } + // tslint:enable:no-trailing-whitespace + + // @Override + public get grammarFileName(): string { + return 'SelectionAutoComplete.g4'; + } + + // @Override + public get ruleNames(): string[] { + return SelectionAutoCompleteParser.ruleNames; + } + + // @Override + public get serializedATN(): string { + return SelectionAutoCompleteParser._serializedATN; + } + + protected createFailedPredicateException( + predicate?: string, + message?: string, + ): FailedPredicateException { + return new FailedPredicateException(this, predicate, message); + } + + constructor(input: TokenStream) { + super(input); + this._interp = new ParserATNSimulator(SelectionAutoCompleteParser._ATN, this); + } + // @RuleVersion(0) + public start(): StartContext { + const _localctx: StartContext = new StartContext(this._ctx, this.state); + this.enterRule(_localctx, 0, SelectionAutoCompleteParser.RULE_start); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 54; + this.expr(0); + this.state = 55; + this.match(SelectionAutoCompleteParser.EOF); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + + public expr(): ExprContext; + public expr(_p: number): ExprContext; + // @RuleVersion(0) + public expr(_p?: number): ExprContext { + if (_p === undefined) { + _p = 0; + } + + const _parentctx: ParserRuleContext = this._ctx; + const _parentState: number = this.state; + let _localctx: ExprContext = new ExprContext(this._ctx, _parentState); + let _prevctx: ExprContext = _localctx; + const _startState: number = 2; + this.enterRecursionRule(_localctx, 2, SelectionAutoCompleteParser.RULE_expr, _p); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 81; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) { + case 1: + { + _localctx = new TraversalAllowedExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 58; + this.traversalAllowedExpr(); + } + break; + + case 2: + { + _localctx = new UpAndDownTraversalExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 59; + this.upTraversalExpr(); + this.state = 60; + this.traversalAllowedExpr(); + this.state = 61; + this.downTraversalExpr(); + } + break; + + case 3: + { + _localctx = new UpTraversalExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 63; + this.upTraversalExpr(); + this.state = 64; + this.traversalAllowedExpr(); + } + break; + + case 4: + { + _localctx = new DownTraversalExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 66; + this.traversalAllowedExpr(); + this.state = 67; + this.downTraversalExpr(); + } + break; + + case 5: + { + _localctx = new NotExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 69; + this.notToken(); + this.state = 70; + this.postNotOperatorWhitespace(); + this.state = 71; + this.expr(8); + } + break; + + case 6: + { + _localctx = new IncompleteNotExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 73; + this.notToken(); + this.state = 74; + this.postNotOperatorWhitespace(); + } + break; + + case 7: + { + _localctx = new AllExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 76; + this.match(SelectionAutoCompleteParser.STAR); + this.state = 77; + this.postExpressionWhitespace(); + } + break; + + case 8: + { + _localctx = new UnmatchedValueContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 78; + this.value(); + this.state = 79; + this.postExpressionWhitespace(); + } + break; + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 103; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + this.state = 101; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 1, this._ctx)) { + case 1: + { + _localctx = new AndExpressionContext(new ExprContext(_parentctx, _parentState)); + this.pushNewRecursionContext( + _localctx, + _startState, + SelectionAutoCompleteParser.RULE_expr, + ); + this.state = 83; + if (!this.precpred(this._ctx, 7)) { + throw this.createFailedPredicateException('this.precpred(this._ctx, 7)'); + } + this.state = 84; + this.andToken(); + this.state = 85; + this.postLogicalOperatorWhitespace(); + this.state = 86; + this.expr(8); + } + break; + + case 2: + { + _localctx = new OrExpressionContext(new ExprContext(_parentctx, _parentState)); + this.pushNewRecursionContext( + _localctx, + _startState, + SelectionAutoCompleteParser.RULE_expr, + ); + this.state = 88; + if (!this.precpred(this._ctx, 6)) { + throw this.createFailedPredicateException('this.precpred(this._ctx, 6)'); + } + this.state = 89; + this.orToken(); + this.state = 90; + this.postLogicalOperatorWhitespace(); + this.state = 91; + this.expr(7); + } + break; + + case 3: + { + _localctx = new IncompleteAndExpressionContext( + new ExprContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext( + _localctx, + _startState, + SelectionAutoCompleteParser.RULE_expr, + ); + this.state = 93; + if (!this.precpred(this._ctx, 5)) { + throw this.createFailedPredicateException('this.precpred(this._ctx, 5)'); + } + this.state = 94; + this.andToken(); + this.state = 95; + this.postLogicalOperatorWhitespace(); + } + break; + + case 4: + { + _localctx = new IncompleteOrExpressionContext( + new ExprContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext( + _localctx, + _startState, + SelectionAutoCompleteParser.RULE_expr, + ); + this.state = 97; + if (!this.precpred(this._ctx, 4)) { + throw this.createFailedPredicateException('this.precpred(this._ctx, 4)'); + } + this.state = 98; + this.orToken(); + this.state = 99; + this.postLogicalOperatorWhitespace(); + } + break; + } + } + } + this.state = 105; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.unrollRecursionContexts(_parentctx); + } + return _localctx; + } + // @RuleVersion(0) + public traversalAllowedExpr(): TraversalAllowedExprContext { + let _localctx: TraversalAllowedExprContext = new TraversalAllowedExprContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 4, SelectionAutoCompleteParser.RULE_traversalAllowedExpr); + try { + this.state = 116; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 3, this._ctx)) { + case 1: + _localctx = new AttributeExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 106; + this.attributeName(); + this.state = 107; + this.colonToken(); + this.state = 108; + this.attributeValue(); + this.state = 109; + this.postAttributeValueWhitespace(); + } + break; + + case 2: + _localctx = new FunctionCallExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 111; + this.functionName(); + this.state = 112; + this.parenthesizedExpr(); + } + break; + + case 3: + _localctx = new TraversalAllowedParenthesizedExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 3); + { + this.state = 114; + this.parenthesizedExpr(); + } + break; + + case 4: + _localctx = new IncompleteExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 4); + { + this.state = 115; + this.incompleteExpr(); + } + break; + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public parenthesizedExpr(): ParenthesizedExprContext { + let _localctx: ParenthesizedExprContext = new ParenthesizedExprContext(this._ctx, this.state); + this.enterRule(_localctx, 6, SelectionAutoCompleteParser.RULE_parenthesizedExpr); + try { + _localctx = new ParenthesizedExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 118; + this.leftParenToken(); + this.state = 119; + this.postLogicalOperatorWhitespace(); + this.state = 120; + this.expr(0); + this.state = 121; + this.rightParenToken(); + this.state = 122; + this.postExpressionWhitespace(); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public incompleteExpr(): IncompleteExprContext { + let _localctx: IncompleteExprContext = new IncompleteExprContext(this._ctx, this.state); + this.enterRule(_localctx, 8, SelectionAutoCompleteParser.RULE_incompleteExpr); + try { + let _alt: number; + this.state = 157; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 5, this._ctx)) { + case 1: + _localctx = new IncompleteAttributeExpressionMissingValueContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 124; + this.attributeName(); + this.state = 125; + this.colonToken(); + this.state = 126; + this.attributeValueWhitespace(); + } + break; + + case 2: + _localctx = new ExpressionlessFunctionExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 128; + this.functionName(); + this.state = 129; + this.expressionLessParenthesizedExpr(); + } + break; + + case 3: + _localctx = new UnclosedExpressionlessFunctionExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 3); + { + this.state = 131; + this.functionName(); + this.state = 132; + this.leftParenToken(); + this.state = 133; + this.postLogicalOperatorWhitespace(); + } + break; + + case 4: + _localctx = new UnclosedFunctionExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 4); + { + this.state = 135; + this.functionName(); + this.state = 136; + this.leftParenToken(); + this.state = 137; + this.expr(0); + } + break; + + case 5: + _localctx = new UnclosedParenthesizedExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 5); + { + this.state = 139; + this.leftParenToken(); + this.state = 140; + this.postLogicalOperatorWhitespace(); + this.state = 141; + this.expr(0); + } + break; + + case 6: + _localctx = new ExpressionlessParenthesizedExpressionWrapperContext(_localctx); + this.enterOuterAlt(_localctx, 6); + { + this.state = 143; + this.expressionLessParenthesizedExpr(); + } + break; + + case 7: + _localctx = new UnclosedExpressionlessParenthesizedExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 7); + { + this.state = 144; + this.leftParenToken(); + this.state = 145; + this.postLogicalOperatorWhitespace(); + } + break; + + case 8: + _localctx = new IncompletePlusTraversalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 8); + { + this.state = 148; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 147; + this.match(SelectionAutoCompleteParser.PLUS); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 150; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 4, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + this.state = 152; + this.postNeighborTraversalWhitespace(); + } + break; + + case 9: + _localctx = new IncompleteAttributeExpressionMissingKeyContext(_localctx); + this.enterOuterAlt(_localctx, 9); + { + this.state = 153; + this.colonToken(); + this.state = 154; + this.attributeValue(); + this.state = 155; + this.postExpressionWhitespace(); + } + break; + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public expressionLessParenthesizedExpr(): ExpressionLessParenthesizedExprContext { + let _localctx: ExpressionLessParenthesizedExprContext = + new ExpressionLessParenthesizedExprContext(this._ctx, this.state); + this.enterRule(_localctx, 10, SelectionAutoCompleteParser.RULE_expressionLessParenthesizedExpr); + try { + _localctx = new ExpressionlessParenthesizedExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 159; + this.leftParenToken(); + this.state = 160; + this.postLogicalOperatorWhitespace(); + this.state = 161; + this.rightParenToken(); + this.state = 162; + this.postExpressionWhitespace(); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public upTraversalExpr(): UpTraversalExprContext { + let _localctx: UpTraversalExprContext = new UpTraversalExprContext(this._ctx, this.state); + this.enterRule(_localctx, 12, SelectionAutoCompleteParser.RULE_upTraversalExpr); + try { + _localctx = new UpTraversalContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 164; + this.traversal(); + this.state = 165; + this.postUpwardTraversalWhitespace(); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public downTraversalExpr(): DownTraversalExprContext { + let _localctx: DownTraversalExprContext = new DownTraversalExprContext(this._ctx, this.state); + this.enterRule(_localctx, 14, SelectionAutoCompleteParser.RULE_downTraversalExpr); + try { + _localctx = new DownTraversalContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 167; + this.traversal(); + this.state = 168; + this.postDownwardTraversalWhitespace(); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public traversal(): TraversalContext { + const _localctx: TraversalContext = new TraversalContext(this._ctx, this.state); + this.enterRule(_localctx, 16, SelectionAutoCompleteParser.RULE_traversal); + try { + let _alt: number; + this.state = 176; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case SelectionAutoCompleteParser.STAR: + this.enterOuterAlt(_localctx, 1); + { + this.state = 170; + this.match(SelectionAutoCompleteParser.STAR); + } + break; + case SelectionAutoCompleteParser.PLUS: + this.enterOuterAlt(_localctx, 2); + { + this.state = 172; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 171; + this.match(SelectionAutoCompleteParser.PLUS); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 174; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + break; + default: + throw new NoViableAltException(this); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public attributeName(): AttributeNameContext { + const _localctx: AttributeNameContext = new AttributeNameContext(this._ctx, this.state); + this.enterRule(_localctx, 18, SelectionAutoCompleteParser.RULE_attributeName); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 178; + this.match(SelectionAutoCompleteParser.IDENTIFIER); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public attributeValue(): AttributeValueContext { + const _localctx: AttributeValueContext = new AttributeValueContext(this._ctx, this.state); + this.enterRule(_localctx, 20, SelectionAutoCompleteParser.RULE_attributeValue); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 180; + this.value(); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public functionName(): FunctionNameContext { + const _localctx: FunctionNameContext = new FunctionNameContext(this._ctx, this.state); + this.enterRule(_localctx, 22, SelectionAutoCompleteParser.RULE_functionName); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 182; + this.match(SelectionAutoCompleteParser.IDENTIFIER); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public orToken(): OrTokenContext { + const _localctx: OrTokenContext = new OrTokenContext(this._ctx, this.state); + this.enterRule(_localctx, 24, SelectionAutoCompleteParser.RULE_orToken); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 184; + this.match(SelectionAutoCompleteParser.OR); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public andToken(): AndTokenContext { + const _localctx: AndTokenContext = new AndTokenContext(this._ctx, this.state); + this.enterRule(_localctx, 26, SelectionAutoCompleteParser.RULE_andToken); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 186; + this.match(SelectionAutoCompleteParser.AND); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public notToken(): NotTokenContext { + const _localctx: NotTokenContext = new NotTokenContext(this._ctx, this.state); + this.enterRule(_localctx, 28, SelectionAutoCompleteParser.RULE_notToken); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 188; + this.match(SelectionAutoCompleteParser.NOT); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public colonToken(): ColonTokenContext { + const _localctx: ColonTokenContext = new ColonTokenContext(this._ctx, this.state); + this.enterRule(_localctx, 30, SelectionAutoCompleteParser.RULE_colonToken); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 190; + this.match(SelectionAutoCompleteParser.COLON); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public leftParenToken(): LeftParenTokenContext { + const _localctx: LeftParenTokenContext = new LeftParenTokenContext(this._ctx, this.state); + this.enterRule(_localctx, 32, SelectionAutoCompleteParser.RULE_leftParenToken); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 192; + this.match(SelectionAutoCompleteParser.LPAREN); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public rightParenToken(): RightParenTokenContext { + const _localctx: RightParenTokenContext = new RightParenTokenContext(this._ctx, this.state); + this.enterRule(_localctx, 34, SelectionAutoCompleteParser.RULE_rightParenToken); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 194; + this.match(SelectionAutoCompleteParser.RPAREN); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public attributeValueWhitespace(): AttributeValueWhitespaceContext { + const _localctx: AttributeValueWhitespaceContext = new AttributeValueWhitespaceContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 36, SelectionAutoCompleteParser.RULE_attributeValueWhitespace); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 199; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 8, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 196; + this.match(SelectionAutoCompleteParser.WS); + } + } + } + this.state = 201; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 8, this._ctx); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public postAttributeValueWhitespace(): PostAttributeValueWhitespaceContext { + const _localctx: PostAttributeValueWhitespaceContext = new PostAttributeValueWhitespaceContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 38, SelectionAutoCompleteParser.RULE_postAttributeValueWhitespace); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 205; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 202; + this.match(SelectionAutoCompleteParser.WS); + } + } + } + this.state = 207; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public postExpressionWhitespace(): PostExpressionWhitespaceContext { + const _localctx: PostExpressionWhitespaceContext = new PostExpressionWhitespaceContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 40, SelectionAutoCompleteParser.RULE_postExpressionWhitespace); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 211; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 10, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 208; + this.match(SelectionAutoCompleteParser.WS); + } + } + } + this.state = 213; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 10, this._ctx); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public postNotOperatorWhitespace(): PostNotOperatorWhitespaceContext { + const _localctx: PostNotOperatorWhitespaceContext = new PostNotOperatorWhitespaceContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 42, SelectionAutoCompleteParser.RULE_postNotOperatorWhitespace); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 217; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 214; + this.match(SelectionAutoCompleteParser.WS); + } + } + } + this.state = 219; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + const _localctx: PostLogicalOperatorWhitespaceContext = + new PostLogicalOperatorWhitespaceContext(this._ctx, this.state); + this.enterRule(_localctx, 44, SelectionAutoCompleteParser.RULE_postLogicalOperatorWhitespace); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 223; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 220; + this.match(SelectionAutoCompleteParser.WS); + } + } + } + this.state = 225; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public postNeighborTraversalWhitespace(): PostNeighborTraversalWhitespaceContext { + const _localctx: PostNeighborTraversalWhitespaceContext = + new PostNeighborTraversalWhitespaceContext(this._ctx, this.state); + this.enterRule(_localctx, 46, SelectionAutoCompleteParser.RULE_postNeighborTraversalWhitespace); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 229; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 13, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 226; + this.match(SelectionAutoCompleteParser.WS); + } + } + } + this.state = 231; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 13, this._ctx); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public postUpwardTraversalWhitespace(): PostUpwardTraversalWhitespaceContext { + const _localctx: PostUpwardTraversalWhitespaceContext = + new PostUpwardTraversalWhitespaceContext(this._ctx, this.state); + this.enterRule(_localctx, 48, SelectionAutoCompleteParser.RULE_postUpwardTraversalWhitespace); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 235; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === SelectionAutoCompleteParser.WS) { + { + { + this.state = 232; + this.match(SelectionAutoCompleteParser.WS); + } + } + this.state = 237; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public postDownwardTraversalWhitespace(): PostDownwardTraversalWhitespaceContext { + const _localctx: PostDownwardTraversalWhitespaceContext = + new PostDownwardTraversalWhitespaceContext(this._ctx, this.state); + this.enterRule(_localctx, 50, SelectionAutoCompleteParser.RULE_postDownwardTraversalWhitespace); + try { + let _alt: number; + this.enterOuterAlt(_localctx, 1); + { + this.state = 241; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 15, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 238; + this.match(SelectionAutoCompleteParser.WS); + } + } + } + this.state = 243; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 15, this._ctx); + } + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public value(): ValueContext { + let _localctx: ValueContext = new ValueContext(this._ctx, this.state); + this.enterRule(_localctx, 52, SelectionAutoCompleteParser.RULE_value); + try { + this.state = 248; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case SelectionAutoCompleteParser.QUOTED_STRING: + _localctx = new QuotedStringValueContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 244; + this.match(SelectionAutoCompleteParser.QUOTED_STRING); + } + break; + case SelectionAutoCompleteParser.INCOMPLETE_LEFT_QUOTED_STRING: + _localctx = new IncompleteLeftQuotedStringValueContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 245; + this.match(SelectionAutoCompleteParser.INCOMPLETE_LEFT_QUOTED_STRING); + } + break; + case SelectionAutoCompleteParser.INCOMPLETE_RIGHT_QUOTED_STRING: + _localctx = new IncompleteRightQuotedStringValueContext(_localctx); + this.enterOuterAlt(_localctx, 3); + { + this.state = 246; + this.match(SelectionAutoCompleteParser.INCOMPLETE_RIGHT_QUOTED_STRING); + } + break; + case SelectionAutoCompleteParser.IDENTIFIER: + _localctx = new UnquotedStringValueContext(_localctx); + this.enterOuterAlt(_localctx, 4); + { + this.state = 247; + this.match(SelectionAutoCompleteParser.IDENTIFIER); + } + break; + default: + throw new NoViableAltException(this); + } + } catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } finally { + this.exitRule(); + } + return _localctx; + } + + public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { + switch (ruleIndex) { + case 1: + return this.expr_sempred(_localctx as ExprContext, predIndex); + } + return true; + } + private expr_sempred(_localctx: ExprContext, predIndex: number): boolean { + switch (predIndex) { + case 0: + return this.precpred(this._ctx, 7); + + case 1: + return this.precpred(this._ctx, 6); + + case 2: + return this.precpred(this._ctx, 5); + + case 3: + return this.precpred(this._ctx, 4); + } + return true; + } + + public static readonly _serializedATN: string = + '\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\x10\xFD\x04\x02' + + '\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07' + + '\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04' + + '\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04' + + '\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04' + + '\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x03' + + '\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03' + + '\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03' + + '\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x05' + + '\x03T\n\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03' + + '\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03' + + '\x03\x03\x03\x07\x03h\n\x03\f\x03\x0E\x03k\v\x03\x03\x04\x03\x04\x03\x04' + + '\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x05\x04w\n\x04' + + '\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x06' + + '\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06' + + '\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06' + + '\x03\x06\x03\x06\x03\x06\x06\x06\x97\n\x06\r\x06\x0E\x06\x98\x03\x06\x03' + + '\x06\x03\x06\x03\x06\x03\x06\x05\x06\xA0\n\x06\x03\x07\x03\x07\x03\x07' + + '\x03\x07\x03\x07\x03\b\x03\b\x03\b\x03\t\x03\t\x03\t\x03\n\x03\n\x06\n' + + '\xAF\n\n\r\n\x0E\n\xB0\x05\n\xB3\n\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03' + + '\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x11\x03\x11\x03' + + '\x12\x03\x12\x03\x13\x03\x13\x03\x14\x07\x14\xC8\n\x14\f\x14\x0E\x14\xCB' + + '\v\x14\x03\x15\x07\x15\xCE\n\x15\f\x15\x0E\x15\xD1\v\x15\x03\x16\x07\x16' + + '\xD4\n\x16\f\x16\x0E\x16\xD7\v\x16\x03\x17\x07\x17\xDA\n\x17\f\x17\x0E' + + '\x17\xDD\v\x17\x03\x18\x07\x18\xE0\n\x18\f\x18\x0E\x18\xE3\v\x18\x03\x19' + + '\x07\x19\xE6\n\x19\f\x19\x0E\x19\xE9\v\x19\x03\x1A\x07\x1A\xEC\n\x1A\f' + + '\x1A\x0E\x1A\xEF\v\x1A\x03\x1B\x07\x1B\xF2\n\x1B\f\x1B\x0E\x1B\xF5\v\x1B' + + '\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x05\x1C\xFB\n\x1C\x03\x1C\x02\x02\x03' + + '\x04\x1D\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12' + + '\x02\x14\x02\x16\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02 \x02"\x02$\x02&' + + '\x02(\x02*\x02,\x02.\x020\x022\x024\x026\x02\x02\x02\x02\u0105\x028\x03' + + '\x02\x02\x02\x04S\x03\x02\x02\x02\x06v\x03\x02\x02\x02\bx\x03\x02\x02' + + '\x02\n\x9F\x03\x02\x02\x02\f\xA1\x03\x02\x02\x02\x0E\xA6\x03\x02\x02\x02' + + '\x10\xA9\x03\x02\x02\x02\x12\xB2\x03\x02\x02\x02\x14\xB4\x03\x02\x02\x02' + + '\x16\xB6\x03\x02\x02\x02\x18\xB8\x03\x02\x02\x02\x1A\xBA\x03\x02\x02\x02' + + '\x1C\xBC\x03\x02\x02\x02\x1E\xBE\x03\x02\x02\x02 \xC0\x03\x02\x02\x02' + + '"\xC2\x03\x02\x02\x02$\xC4\x03\x02\x02\x02&\xC9\x03\x02\x02\x02(\xCF' + + '\x03\x02\x02\x02*\xD5\x03\x02\x02\x02,\xDB\x03\x02\x02\x02.\xE1\x03\x02' + + '\x02\x020\xE7\x03\x02\x02\x022\xED\x03\x02\x02\x024\xF3\x03\x02\x02\x02' + + '6\xFA\x03\x02\x02\x0289\x05\x04\x03\x029:\x07\x02\x02\x03:\x03\x03\x02' + + '\x02\x02;<\b\x03\x01\x02\x05\x0E\b\x02>?\x05\x06\x04' + + '\x02?@\x05\x10\t\x02@T\x03\x02\x02\x02AB\x05\x0E\b\x02BC\x05\x06\x04\x02' + + 'CT\x03\x02\x02\x02DE\x05\x06\x04\x02EF\x05\x10\t\x02FT\x03\x02\x02\x02' + + 'GH\x05\x1E\x10\x02HI\x05,\x17\x02IJ\x05\x04\x03\nJT\x03\x02\x02\x02KL' + + '\x05\x1E\x10\x02LM\x05,\x17\x02MT\x03\x02\x02\x02NO\x07\x06\x02\x02OT' + + '\x05*\x16\x02PQ\x056\x1C\x02QR\x05*\x16\x02RT\x03\x02\x02\x02S;\x03\x02' + + '\x02\x02S=\x03\x02\x02\x02SA\x03\x02\x02\x02SD\x03\x02\x02\x02SG\x03\x02' + + '\x02\x02SK\x03\x02\x02\x02SN\x03\x02\x02\x02SP\x03\x02\x02\x02Ti\x03\x02' + + '\x02\x02UV\f\t\x02\x02VW\x05\x1C\x0F\x02WX\x05.\x18\x02XY\x05\x04\x03' + + '\nYh\x03\x02\x02\x02Z[\f\b\x02\x02[\\\x05\x1A\x0E\x02\\]\x05.\x18\x02' + + ']^\x05\x04\x03\t^h\x03\x02\x02\x02_`\f\x07\x02\x02`a\x05\x1C\x0F\x02a' + + 'b\x05.\x18\x02bh\x03\x02\x02\x02cd\f\x06\x02\x02de\x05\x1A\x0E\x02ef\x05' + + '.\x18\x02fh\x03\x02\x02\x02gU\x03\x02\x02\x02gZ\x03\x02\x02\x02g_\x03' + + '\x02\x02\x02gc\x03\x02\x02\x02hk\x03\x02\x02\x02ig\x03\x02\x02\x02ij\x03' + + '\x02\x02\x02j\x05\x03\x02\x02\x02ki\x03\x02\x02\x02lm\x05\x14\v\x02mn' + + '\x05 \x11\x02no\x05\x16\f\x02op\x05(\x15\x02pw\x03\x02\x02\x02qr\x05\x18' + + '\r\x02rs\x05\b\x05\x02sw\x03\x02\x02\x02tw\x05\b\x05\x02uw\x05\n\x06\x02' + + 'vl\x03\x02\x02\x02vq\x03\x02\x02\x02vt\x03\x02\x02\x02vu\x03\x02\x02\x02' + + 'w\x07\x03\x02\x02\x02xy\x05"\x12\x02yz\x05.\x18\x02z{\x05\x04\x03\x02' + + '{|\x05$\x13\x02|}\x05*\x16\x02}\t\x03\x02\x02\x02~\x7F\x05\x14\v\x02\x7F' + + '\x80\x05 \x11\x02\x80\x81\x05&\x14\x02\x81\xA0\x03\x02\x02\x02\x82\x83' + + '\x05\x18\r\x02\x83\x84\x05\f\x07\x02\x84\xA0\x03\x02\x02\x02\x85\x86\x05' + + '\x18\r\x02\x86\x87\x05"\x12\x02\x87\x88\x05.\x18\x02\x88\xA0\x03\x02' + + '\x02\x02\x89\x8A\x05\x18\r\x02\x8A\x8B\x05"\x12\x02\x8B\x8C\x05\x04\x03' + + '\x02\x8C\xA0\x03\x02\x02\x02\x8D\x8E\x05"\x12\x02\x8E\x8F\x05.\x18\x02' + + '\x8F\x90\x05\x04\x03\x02\x90\xA0\x03\x02\x02\x02\x91\xA0\x05\f\x07\x02' + + '\x92\x93\x05"\x12\x02\x93\x94\x05.\x18\x02\x94\xA0\x03\x02\x02\x02\x95' + + '\x97\x07\x07\x02\x02\x96\x95\x03\x02\x02\x02\x97\x98\x03\x02\x02\x02\x98' + + '\x96\x03\x02\x02\x02\x98\x99\x03\x02\x02\x02\x99\x9A\x03\x02\x02\x02\x9A' + + '\xA0\x050\x19\x02\x9B\x9C\x05 \x11\x02\x9C\x9D\x05\x16\f\x02\x9D\x9E\x05' + + '*\x16\x02\x9E\xA0\x03\x02\x02\x02\x9F~\x03\x02\x02\x02\x9F\x82\x03\x02' + + '\x02\x02\x9F\x85\x03\x02\x02\x02\x9F\x89\x03\x02\x02\x02\x9F\x8D\x03\x02' + + '\x02\x02\x9F\x91\x03\x02\x02\x02\x9F\x92\x03\x02\x02\x02\x9F\x96\x03\x02' + + '\x02\x02\x9F\x9B\x03\x02\x02\x02\xA0\v\x03\x02\x02\x02\xA1\xA2\x05"\x12' + + '\x02\xA2\xA3\x05.\x18\x02\xA3\xA4\x05$\x13\x02\xA4\xA5\x05*\x16\x02\xA5' + + '\r\x03\x02\x02\x02\xA6\xA7\x05\x12\n\x02\xA7\xA8\x052\x1A\x02\xA8\x0F' + + '\x03\x02\x02\x02\xA9\xAA\x05\x12\n\x02\xAA\xAB\x054\x1B\x02\xAB\x11\x03' + + '\x02\x02\x02\xAC\xB3\x07\x06\x02\x02\xAD\xAF\x07\x07\x02\x02\xAE\xAD\x03' + + '\x02\x02\x02\xAF\xB0\x03\x02\x02\x02\xB0\xAE\x03\x02\x02\x02\xB0\xB1\x03' + + '\x02\x02\x02\xB1\xB3\x03\x02\x02\x02\xB2\xAC\x03\x02\x02\x02\xB2\xAE\x03' + + '\x02\x02\x02\xB3\x13\x03\x02\x02\x02\xB4\xB5\x07\x0F\x02\x02\xB5\x15\x03' + + '\x02\x02\x02\xB6\xB7\x056\x1C\x02\xB7\x17\x03\x02\x02\x02\xB8\xB9\x07' + + '\x0F\x02\x02\xB9\x19\x03\x02\x02\x02\xBA\xBB\x07\x04\x02\x02\xBB\x1B\x03' + + '\x02\x02\x02\xBC\xBD\x07\x03\x02\x02\xBD\x1D\x03\x02\x02\x02\xBE\xBF\x07' + + '\x05\x02\x02\xBF\x1F\x03\x02\x02\x02\xC0\xC1\x07\b\x02\x02\xC1!\x03\x02' + + '\x02\x02\xC2\xC3\x07\t\x02\x02\xC3#\x03\x02\x02\x02\xC4\xC5\x07\n\x02' + + '\x02\xC5%\x03\x02\x02\x02\xC6\xC8\x07\x10\x02\x02\xC7\xC6\x03\x02\x02' + + '\x02\xC8\xCB\x03\x02\x02\x02\xC9\xC7\x03\x02\x02\x02\xC9\xCA\x03\x02\x02' + + "\x02\xCA'\x03\x02\x02\x02\xCB\xC9\x03\x02\x02\x02\xCC\xCE\x07\x10\x02" + + '\x02\xCD\xCC\x03\x02\x02\x02\xCE\xD1\x03\x02\x02\x02\xCF\xCD\x03\x02\x02' + + '\x02\xCF\xD0\x03\x02\x02\x02\xD0)\x03\x02\x02\x02\xD1\xCF\x03\x02\x02' + + '\x02\xD2\xD4\x07\x10\x02\x02\xD3\xD2\x03\x02\x02\x02\xD4\xD7\x03\x02\x02' + + '\x02\xD5\xD3\x03\x02\x02\x02\xD5\xD6\x03\x02\x02\x02\xD6+\x03\x02\x02' + + '\x02\xD7\xD5\x03\x02\x02\x02\xD8\xDA\x07\x10\x02\x02\xD9\xD8\x03\x02\x02' + + '\x02\xDA\xDD\x03\x02\x02\x02\xDB\xD9\x03\x02\x02\x02\xDB\xDC\x03\x02\x02' + + '\x02\xDC-\x03\x02\x02\x02\xDD\xDB\x03\x02\x02\x02\xDE\xE0\x07\x10\x02' + + '\x02\xDF\xDE\x03\x02\x02\x02\xE0\xE3\x03\x02\x02\x02\xE1\xDF\x03\x02\x02' + + '\x02\xE1\xE2\x03\x02\x02\x02\xE2/\x03\x02\x02\x02\xE3\xE1\x03\x02\x02' + + '\x02\xE4\xE6\x07\x10\x02\x02\xE5\xE4\x03\x02\x02\x02\xE6\xE9\x03\x02\x02' + + '\x02\xE7\xE5\x03\x02\x02\x02\xE7\xE8\x03\x02\x02\x02\xE81\x03\x02\x02' + + '\x02\xE9\xE7\x03\x02\x02\x02\xEA\xEC\x07\x10\x02\x02\xEB\xEA\x03\x02\x02' + + '\x02\xEC\xEF\x03\x02\x02\x02\xED\xEB\x03\x02\x02\x02\xED\xEE\x03\x02\x02' + + '\x02\xEE3\x03\x02\x02\x02\xEF\xED\x03\x02\x02\x02\xF0\xF2\x07\x10\x02' + + '\x02\xF1\xF0\x03\x02\x02\x02\xF2\xF5\x03\x02\x02\x02\xF3\xF1\x03\x02\x02' + + '\x02\xF3\xF4\x03\x02\x02\x02\xF45\x03\x02\x02\x02\xF5\xF3\x03\x02\x02' + + '\x02\xF6\xFB\x07\f\x02\x02\xF7\xFB\x07\r\x02\x02\xF8\xFB\x07\x0E\x02\x02' + + '\xF9\xFB\x07\x0F\x02\x02\xFA\xF6\x03\x02\x02\x02\xFA\xF7\x03\x02\x02\x02' + + '\xFA\xF8\x03\x02\x02\x02\xFA\xF9\x03\x02\x02\x02\xFB7\x03\x02\x02\x02' + + '\x13Sgiv\x98\x9F\xB0\xB2\xC9\xCF\xD5\xDB\xE1\xE7\xED\xF3\xFA'; + public static __ATN: ATN; + public static get _ATN(): ATN { + if (!SelectionAutoCompleteParser.__ATN) { + SelectionAutoCompleteParser.__ATN = new ATNDeserializer().deserialize( + Utils.toCharArray(SelectionAutoCompleteParser._serializedATN), + ); + } + + return SelectionAutoCompleteParser.__ATN; + } +} + +export class StartContext extends ParserRuleContext { + public expr(): ExprContext { + return this.getRuleContext(0, ExprContext); + } + public EOF(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.EOF, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_start; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterStart) { + listener.enterStart(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitStart) { + listener.exitStart(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitStart) { + return visitor.visitStart(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class ExprContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_expr; + } + public copyFrom(ctx: ExprContext): void { + super.copyFrom(ctx); + } +} +export class TraversalAllowedExpressionContext extends ExprContext { + public traversalAllowedExpr(): TraversalAllowedExprContext { + return this.getRuleContext(0, TraversalAllowedExprContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterTraversalAllowedExpression) { + listener.enterTraversalAllowedExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitTraversalAllowedExpression) { + listener.exitTraversalAllowedExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitTraversalAllowedExpression) { + return visitor.visitTraversalAllowedExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UpAndDownTraversalExpressionContext extends ExprContext { + public upTraversalExpr(): UpTraversalExprContext { + return this.getRuleContext(0, UpTraversalExprContext); + } + public traversalAllowedExpr(): TraversalAllowedExprContext { + return this.getRuleContext(0, TraversalAllowedExprContext); + } + public downTraversalExpr(): DownTraversalExprContext { + return this.getRuleContext(0, DownTraversalExprContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUpAndDownTraversalExpression) { + listener.enterUpAndDownTraversalExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUpAndDownTraversalExpression) { + listener.exitUpAndDownTraversalExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUpAndDownTraversalExpression) { + return visitor.visitUpAndDownTraversalExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UpTraversalExpressionContext extends ExprContext { + public upTraversalExpr(): UpTraversalExprContext { + return this.getRuleContext(0, UpTraversalExprContext); + } + public traversalAllowedExpr(): TraversalAllowedExprContext { + return this.getRuleContext(0, TraversalAllowedExprContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUpTraversalExpression) { + listener.enterUpTraversalExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUpTraversalExpression) { + listener.exitUpTraversalExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUpTraversalExpression) { + return visitor.visitUpTraversalExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class DownTraversalExpressionContext extends ExprContext { + public traversalAllowedExpr(): TraversalAllowedExprContext { + return this.getRuleContext(0, TraversalAllowedExprContext); + } + public downTraversalExpr(): DownTraversalExprContext { + return this.getRuleContext(0, DownTraversalExprContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterDownTraversalExpression) { + listener.enterDownTraversalExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitDownTraversalExpression) { + listener.exitDownTraversalExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitDownTraversalExpression) { + return visitor.visitDownTraversalExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class NotExpressionContext extends ExprContext { + public notToken(): NotTokenContext { + return this.getRuleContext(0, NotTokenContext); + } + public postNotOperatorWhitespace(): PostNotOperatorWhitespaceContext { + return this.getRuleContext(0, PostNotOperatorWhitespaceContext); + } + public expr(): ExprContext { + return this.getRuleContext(0, ExprContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterNotExpression) { + listener.enterNotExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitNotExpression) { + listener.exitNotExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitNotExpression) { + return visitor.visitNotExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class AndExpressionContext extends ExprContext { + public expr(): ExprContext[]; + public expr(i: number): ExprContext; + public expr(i?: number): ExprContext | ExprContext[] { + if (i === undefined) { + return this.getRuleContexts(ExprContext); + } else { + return this.getRuleContext(i, ExprContext); + } + } + public andToken(): AndTokenContext { + return this.getRuleContext(0, AndTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterAndExpression) { + listener.enterAndExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitAndExpression) { + listener.exitAndExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitAndExpression) { + return visitor.visitAndExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class OrExpressionContext extends ExprContext { + public expr(): ExprContext[]; + public expr(i: number): ExprContext; + public expr(i?: number): ExprContext | ExprContext[] { + if (i === undefined) { + return this.getRuleContexts(ExprContext); + } else { + return this.getRuleContext(i, ExprContext); + } + } + public orToken(): OrTokenContext { + return this.getRuleContext(0, OrTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterOrExpression) { + listener.enterOrExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitOrExpression) { + listener.exitOrExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitOrExpression) { + return visitor.visitOrExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IncompleteAndExpressionContext extends ExprContext { + public expr(): ExprContext { + return this.getRuleContext(0, ExprContext); + } + public andToken(): AndTokenContext { + return this.getRuleContext(0, AndTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompleteAndExpression) { + listener.enterIncompleteAndExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompleteAndExpression) { + listener.exitIncompleteAndExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompleteAndExpression) { + return visitor.visitIncompleteAndExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IncompleteOrExpressionContext extends ExprContext { + public expr(): ExprContext { + return this.getRuleContext(0, ExprContext); + } + public orToken(): OrTokenContext { + return this.getRuleContext(0, OrTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompleteOrExpression) { + listener.enterIncompleteOrExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompleteOrExpression) { + listener.exitIncompleteOrExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompleteOrExpression) { + return visitor.visitIncompleteOrExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IncompleteNotExpressionContext extends ExprContext { + public notToken(): NotTokenContext { + return this.getRuleContext(0, NotTokenContext); + } + public postNotOperatorWhitespace(): PostNotOperatorWhitespaceContext { + return this.getRuleContext(0, PostNotOperatorWhitespaceContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompleteNotExpression) { + listener.enterIncompleteNotExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompleteNotExpression) { + listener.exitIncompleteNotExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompleteNotExpression) { + return visitor.visitIncompleteNotExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class AllExpressionContext extends ExprContext { + public STAR(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.STAR, 0); + } + public postExpressionWhitespace(): PostExpressionWhitespaceContext { + return this.getRuleContext(0, PostExpressionWhitespaceContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterAllExpression) { + listener.enterAllExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitAllExpression) { + listener.exitAllExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitAllExpression) { + return visitor.visitAllExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UnmatchedValueContext extends ExprContext { + public value(): ValueContext { + return this.getRuleContext(0, ValueContext); + } + public postExpressionWhitespace(): PostExpressionWhitespaceContext { + return this.getRuleContext(0, PostExpressionWhitespaceContext); + } + constructor(ctx: ExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUnmatchedValue) { + listener.enterUnmatchedValue(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUnmatchedValue) { + listener.exitUnmatchedValue(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUnmatchedValue) { + return visitor.visitUnmatchedValue(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class TraversalAllowedExprContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_traversalAllowedExpr; + } + public copyFrom(ctx: TraversalAllowedExprContext): void { + super.copyFrom(ctx); + } +} +export class AttributeExpressionContext extends TraversalAllowedExprContext { + public attributeName(): AttributeNameContext { + return this.getRuleContext(0, AttributeNameContext); + } + public colonToken(): ColonTokenContext { + return this.getRuleContext(0, ColonTokenContext); + } + public attributeValue(): AttributeValueContext { + return this.getRuleContext(0, AttributeValueContext); + } + public postAttributeValueWhitespace(): PostAttributeValueWhitespaceContext { + return this.getRuleContext(0, PostAttributeValueWhitespaceContext); + } + constructor(ctx: TraversalAllowedExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterAttributeExpression) { + listener.enterAttributeExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitAttributeExpression) { + listener.exitAttributeExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitAttributeExpression) { + return visitor.visitAttributeExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class FunctionCallExpressionContext extends TraversalAllowedExprContext { + public functionName(): FunctionNameContext { + return this.getRuleContext(0, FunctionNameContext); + } + public parenthesizedExpr(): ParenthesizedExprContext { + return this.getRuleContext(0, ParenthesizedExprContext); + } + constructor(ctx: TraversalAllowedExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterFunctionCallExpression) { + listener.enterFunctionCallExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitFunctionCallExpression) { + listener.exitFunctionCallExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitFunctionCallExpression) { + return visitor.visitFunctionCallExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class TraversalAllowedParenthesizedExpressionContext extends TraversalAllowedExprContext { + public parenthesizedExpr(): ParenthesizedExprContext { + return this.getRuleContext(0, ParenthesizedExprContext); + } + constructor(ctx: TraversalAllowedExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterTraversalAllowedParenthesizedExpression) { + listener.enterTraversalAllowedParenthesizedExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitTraversalAllowedParenthesizedExpression) { + listener.exitTraversalAllowedParenthesizedExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitTraversalAllowedParenthesizedExpression) { + return visitor.visitTraversalAllowedParenthesizedExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IncompleteExpressionContext extends TraversalAllowedExprContext { + public incompleteExpr(): IncompleteExprContext { + return this.getRuleContext(0, IncompleteExprContext); + } + constructor(ctx: TraversalAllowedExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompleteExpression) { + listener.enterIncompleteExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompleteExpression) { + listener.exitIncompleteExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompleteExpression) { + return visitor.visitIncompleteExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class ParenthesizedExprContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_parenthesizedExpr; + } + public copyFrom(ctx: ParenthesizedExprContext): void { + super.copyFrom(ctx); + } +} +export class ParenthesizedExpressionContext extends ParenthesizedExprContext { + public leftParenToken(): LeftParenTokenContext { + return this.getRuleContext(0, LeftParenTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + public expr(): ExprContext { + return this.getRuleContext(0, ExprContext); + } + public rightParenToken(): RightParenTokenContext { + return this.getRuleContext(0, RightParenTokenContext); + } + public postExpressionWhitespace(): PostExpressionWhitespaceContext { + return this.getRuleContext(0, PostExpressionWhitespaceContext); + } + constructor(ctx: ParenthesizedExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterParenthesizedExpression) { + listener.enterParenthesizedExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitParenthesizedExpression) { + listener.exitParenthesizedExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitParenthesizedExpression) { + return visitor.visitParenthesizedExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class IncompleteExprContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_incompleteExpr; + } + public copyFrom(ctx: IncompleteExprContext): void { + super.copyFrom(ctx); + } +} +export class IncompleteAttributeExpressionMissingValueContext extends IncompleteExprContext { + public attributeName(): AttributeNameContext { + return this.getRuleContext(0, AttributeNameContext); + } + public colonToken(): ColonTokenContext { + return this.getRuleContext(0, ColonTokenContext); + } + public attributeValueWhitespace(): AttributeValueWhitespaceContext { + return this.getRuleContext(0, AttributeValueWhitespaceContext); + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompleteAttributeExpressionMissingValue) { + listener.enterIncompleteAttributeExpressionMissingValue(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompleteAttributeExpressionMissingValue) { + listener.exitIncompleteAttributeExpressionMissingValue(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompleteAttributeExpressionMissingValue) { + return visitor.visitIncompleteAttributeExpressionMissingValue(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ExpressionlessFunctionExpressionContext extends IncompleteExprContext { + public functionName(): FunctionNameContext { + return this.getRuleContext(0, FunctionNameContext); + } + public expressionLessParenthesizedExpr(): ExpressionLessParenthesizedExprContext { + return this.getRuleContext(0, ExpressionLessParenthesizedExprContext); + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterExpressionlessFunctionExpression) { + listener.enterExpressionlessFunctionExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitExpressionlessFunctionExpression) { + listener.exitExpressionlessFunctionExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitExpressionlessFunctionExpression) { + return visitor.visitExpressionlessFunctionExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UnclosedExpressionlessFunctionExpressionContext extends IncompleteExprContext { + public functionName(): FunctionNameContext { + return this.getRuleContext(0, FunctionNameContext); + } + public leftParenToken(): LeftParenTokenContext { + return this.getRuleContext(0, LeftParenTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUnclosedExpressionlessFunctionExpression) { + listener.enterUnclosedExpressionlessFunctionExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUnclosedExpressionlessFunctionExpression) { + listener.exitUnclosedExpressionlessFunctionExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUnclosedExpressionlessFunctionExpression) { + return visitor.visitUnclosedExpressionlessFunctionExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UnclosedFunctionExpressionContext extends IncompleteExprContext { + public functionName(): FunctionNameContext { + return this.getRuleContext(0, FunctionNameContext); + } + public leftParenToken(): LeftParenTokenContext { + return this.getRuleContext(0, LeftParenTokenContext); + } + public expr(): ExprContext { + return this.getRuleContext(0, ExprContext); + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUnclosedFunctionExpression) { + listener.enterUnclosedFunctionExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUnclosedFunctionExpression) { + listener.exitUnclosedFunctionExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUnclosedFunctionExpression) { + return visitor.visitUnclosedFunctionExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UnclosedParenthesizedExpressionContext extends IncompleteExprContext { + public leftParenToken(): LeftParenTokenContext { + return this.getRuleContext(0, LeftParenTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + public expr(): ExprContext { + return this.getRuleContext(0, ExprContext); + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUnclosedParenthesizedExpression) { + listener.enterUnclosedParenthesizedExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUnclosedParenthesizedExpression) { + listener.exitUnclosedParenthesizedExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUnclosedParenthesizedExpression) { + return visitor.visitUnclosedParenthesizedExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ExpressionlessParenthesizedExpressionWrapperContext extends IncompleteExprContext { + public expressionLessParenthesizedExpr(): ExpressionLessParenthesizedExprContext { + return this.getRuleContext(0, ExpressionLessParenthesizedExprContext); + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterExpressionlessParenthesizedExpressionWrapper) { + listener.enterExpressionlessParenthesizedExpressionWrapper(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitExpressionlessParenthesizedExpressionWrapper) { + listener.exitExpressionlessParenthesizedExpressionWrapper(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitExpressionlessParenthesizedExpressionWrapper) { + return visitor.visitExpressionlessParenthesizedExpressionWrapper(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UnclosedExpressionlessParenthesizedExpressionContext extends IncompleteExprContext { + public leftParenToken(): LeftParenTokenContext { + return this.getRuleContext(0, LeftParenTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUnclosedExpressionlessParenthesizedExpression) { + listener.enterUnclosedExpressionlessParenthesizedExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUnclosedExpressionlessParenthesizedExpression) { + listener.exitUnclosedExpressionlessParenthesizedExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUnclosedExpressionlessParenthesizedExpression) { + return visitor.visitUnclosedExpressionlessParenthesizedExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IncompletePlusTraversalExpressionContext extends IncompleteExprContext { + public postNeighborTraversalWhitespace(): PostNeighborTraversalWhitespaceContext { + return this.getRuleContext(0, PostNeighborTraversalWhitespaceContext); + } + public PLUS(): TerminalNode[]; + public PLUS(i: number): TerminalNode; + public PLUS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.PLUS); + } else { + return this.getToken(SelectionAutoCompleteParser.PLUS, i); + } + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompletePlusTraversalExpression) { + listener.enterIncompletePlusTraversalExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompletePlusTraversalExpression) { + listener.exitIncompletePlusTraversalExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompletePlusTraversalExpression) { + return visitor.visitIncompletePlusTraversalExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IncompleteAttributeExpressionMissingKeyContext extends IncompleteExprContext { + public colonToken(): ColonTokenContext { + return this.getRuleContext(0, ColonTokenContext); + } + public attributeValue(): AttributeValueContext { + return this.getRuleContext(0, AttributeValueContext); + } + public postExpressionWhitespace(): PostExpressionWhitespaceContext { + return this.getRuleContext(0, PostExpressionWhitespaceContext); + } + constructor(ctx: IncompleteExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompleteAttributeExpressionMissingKey) { + listener.enterIncompleteAttributeExpressionMissingKey(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompleteAttributeExpressionMissingKey) { + listener.exitIncompleteAttributeExpressionMissingKey(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompleteAttributeExpressionMissingKey) { + return visitor.visitIncompleteAttributeExpressionMissingKey(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class ExpressionLessParenthesizedExprContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_expressionLessParenthesizedExpr; + } + public copyFrom(ctx: ExpressionLessParenthesizedExprContext): void { + super.copyFrom(ctx); + } +} +export class ExpressionlessParenthesizedExpressionContext extends ExpressionLessParenthesizedExprContext { + public leftParenToken(): LeftParenTokenContext { + return this.getRuleContext(0, LeftParenTokenContext); + } + public postLogicalOperatorWhitespace(): PostLogicalOperatorWhitespaceContext { + return this.getRuleContext(0, PostLogicalOperatorWhitespaceContext); + } + public rightParenToken(): RightParenTokenContext { + return this.getRuleContext(0, RightParenTokenContext); + } + public postExpressionWhitespace(): PostExpressionWhitespaceContext { + return this.getRuleContext(0, PostExpressionWhitespaceContext); + } + constructor(ctx: ExpressionLessParenthesizedExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterExpressionlessParenthesizedExpression) { + listener.enterExpressionlessParenthesizedExpression(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitExpressionlessParenthesizedExpression) { + listener.exitExpressionlessParenthesizedExpression(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitExpressionlessParenthesizedExpression) { + return visitor.visitExpressionlessParenthesizedExpression(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class UpTraversalExprContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_upTraversalExpr; + } + public copyFrom(ctx: UpTraversalExprContext): void { + super.copyFrom(ctx); + } +} +export class UpTraversalContext extends UpTraversalExprContext { + public traversal(): TraversalContext { + return this.getRuleContext(0, TraversalContext); + } + public postUpwardTraversalWhitespace(): PostUpwardTraversalWhitespaceContext { + return this.getRuleContext(0, PostUpwardTraversalWhitespaceContext); + } + constructor(ctx: UpTraversalExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUpTraversal) { + listener.enterUpTraversal(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUpTraversal) { + listener.exitUpTraversal(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUpTraversal) { + return visitor.visitUpTraversal(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class DownTraversalExprContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_downTraversalExpr; + } + public copyFrom(ctx: DownTraversalExprContext): void { + super.copyFrom(ctx); + } +} +export class DownTraversalContext extends DownTraversalExprContext { + public traversal(): TraversalContext { + return this.getRuleContext(0, TraversalContext); + } + public postDownwardTraversalWhitespace(): PostDownwardTraversalWhitespaceContext { + return this.getRuleContext(0, PostDownwardTraversalWhitespaceContext); + } + constructor(ctx: DownTraversalExprContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterDownTraversal) { + listener.enterDownTraversal(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitDownTraversal) { + listener.exitDownTraversal(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitDownTraversal) { + return visitor.visitDownTraversal(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class TraversalContext extends ParserRuleContext { + public STAR(): TerminalNode | undefined { + return this.tryGetToken(SelectionAutoCompleteParser.STAR, 0); + } + public PLUS(): TerminalNode[]; + public PLUS(i: number): TerminalNode; + public PLUS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.PLUS); + } else { + return this.getToken(SelectionAutoCompleteParser.PLUS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_traversal; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterTraversal) { + listener.enterTraversal(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitTraversal) { + listener.exitTraversal(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitTraversal) { + return visitor.visitTraversal(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class AttributeNameContext extends ParserRuleContext { + public IDENTIFIER(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.IDENTIFIER, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_attributeName; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterAttributeName) { + listener.enterAttributeName(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitAttributeName) { + listener.exitAttributeName(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitAttributeName) { + return visitor.visitAttributeName(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class AttributeValueContext extends ParserRuleContext { + public value(): ValueContext { + return this.getRuleContext(0, ValueContext); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_attributeValue; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterAttributeValue) { + listener.enterAttributeValue(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitAttributeValue) { + listener.exitAttributeValue(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitAttributeValue) { + return visitor.visitAttributeValue(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class FunctionNameContext extends ParserRuleContext { + public IDENTIFIER(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.IDENTIFIER, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_functionName; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterFunctionName) { + listener.enterFunctionName(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitFunctionName) { + listener.exitFunctionName(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitFunctionName) { + return visitor.visitFunctionName(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class OrTokenContext extends ParserRuleContext { + public OR(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.OR, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_orToken; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterOrToken) { + listener.enterOrToken(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitOrToken) { + listener.exitOrToken(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitOrToken) { + return visitor.visitOrToken(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class AndTokenContext extends ParserRuleContext { + public AND(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.AND, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_andToken; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterAndToken) { + listener.enterAndToken(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitAndToken) { + listener.exitAndToken(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitAndToken) { + return visitor.visitAndToken(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class NotTokenContext extends ParserRuleContext { + public NOT(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.NOT, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_notToken; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterNotToken) { + listener.enterNotToken(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitNotToken) { + listener.exitNotToken(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitNotToken) { + return visitor.visitNotToken(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class ColonTokenContext extends ParserRuleContext { + public COLON(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.COLON, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_colonToken; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterColonToken) { + listener.enterColonToken(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitColonToken) { + listener.exitColonToken(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitColonToken) { + return visitor.visitColonToken(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class LeftParenTokenContext extends ParserRuleContext { + public LPAREN(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.LPAREN, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_leftParenToken; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterLeftParenToken) { + listener.enterLeftParenToken(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitLeftParenToken) { + listener.exitLeftParenToken(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitLeftParenToken) { + return visitor.visitLeftParenToken(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class RightParenTokenContext extends ParserRuleContext { + public RPAREN(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.RPAREN, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_rightParenToken; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterRightParenToken) { + listener.enterRightParenToken(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitRightParenToken) { + listener.exitRightParenToken(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitRightParenToken) { + return visitor.visitRightParenToken(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class AttributeValueWhitespaceContext extends ParserRuleContext { + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.WS); + } else { + return this.getToken(SelectionAutoCompleteParser.WS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_attributeValueWhitespace; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterAttributeValueWhitespace) { + listener.enterAttributeValueWhitespace(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitAttributeValueWhitespace) { + listener.exitAttributeValueWhitespace(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitAttributeValueWhitespace) { + return visitor.visitAttributeValueWhitespace(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class PostAttributeValueWhitespaceContext extends ParserRuleContext { + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.WS); + } else { + return this.getToken(SelectionAutoCompleteParser.WS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_postAttributeValueWhitespace; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterPostAttributeValueWhitespace) { + listener.enterPostAttributeValueWhitespace(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitPostAttributeValueWhitespace) { + listener.exitPostAttributeValueWhitespace(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitPostAttributeValueWhitespace) { + return visitor.visitPostAttributeValueWhitespace(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class PostExpressionWhitespaceContext extends ParserRuleContext { + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.WS); + } else { + return this.getToken(SelectionAutoCompleteParser.WS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_postExpressionWhitespace; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterPostExpressionWhitespace) { + listener.enterPostExpressionWhitespace(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitPostExpressionWhitespace) { + listener.exitPostExpressionWhitespace(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitPostExpressionWhitespace) { + return visitor.visitPostExpressionWhitespace(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class PostNotOperatorWhitespaceContext extends ParserRuleContext { + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.WS); + } else { + return this.getToken(SelectionAutoCompleteParser.WS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_postNotOperatorWhitespace; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterPostNotOperatorWhitespace) { + listener.enterPostNotOperatorWhitespace(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitPostNotOperatorWhitespace) { + listener.exitPostNotOperatorWhitespace(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitPostNotOperatorWhitespace) { + return visitor.visitPostNotOperatorWhitespace(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class PostLogicalOperatorWhitespaceContext extends ParserRuleContext { + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.WS); + } else { + return this.getToken(SelectionAutoCompleteParser.WS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_postLogicalOperatorWhitespace; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterPostLogicalOperatorWhitespace) { + listener.enterPostLogicalOperatorWhitespace(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitPostLogicalOperatorWhitespace) { + listener.exitPostLogicalOperatorWhitespace(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitPostLogicalOperatorWhitespace) { + return visitor.visitPostLogicalOperatorWhitespace(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class PostNeighborTraversalWhitespaceContext extends ParserRuleContext { + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.WS); + } else { + return this.getToken(SelectionAutoCompleteParser.WS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_postNeighborTraversalWhitespace; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterPostNeighborTraversalWhitespace) { + listener.enterPostNeighborTraversalWhitespace(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitPostNeighborTraversalWhitespace) { + listener.exitPostNeighborTraversalWhitespace(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitPostNeighborTraversalWhitespace) { + return visitor.visitPostNeighborTraversalWhitespace(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class PostUpwardTraversalWhitespaceContext extends ParserRuleContext { + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.WS); + } else { + return this.getToken(SelectionAutoCompleteParser.WS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_postUpwardTraversalWhitespace; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterPostUpwardTraversalWhitespace) { + listener.enterPostUpwardTraversalWhitespace(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitPostUpwardTraversalWhitespace) { + listener.exitPostUpwardTraversalWhitespace(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitPostUpwardTraversalWhitespace) { + return visitor.visitPostUpwardTraversalWhitespace(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class PostDownwardTraversalWhitespaceContext extends ParserRuleContext { + public WS(): TerminalNode[]; + public WS(i: number): TerminalNode; + public WS(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(SelectionAutoCompleteParser.WS); + } else { + return this.getToken(SelectionAutoCompleteParser.WS, i); + } + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_postDownwardTraversalWhitespace; + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterPostDownwardTraversalWhitespace) { + listener.enterPostDownwardTraversalWhitespace(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitPostDownwardTraversalWhitespace) { + listener.exitPostDownwardTraversalWhitespace(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitPostDownwardTraversalWhitespace) { + return visitor.visitPostDownwardTraversalWhitespace(this); + } else { + return visitor.visitChildren(this); + } + } +} + +export class ValueContext extends ParserRuleContext { + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return SelectionAutoCompleteParser.RULE_value; + } + public copyFrom(ctx: ValueContext): void { + super.copyFrom(ctx); + } +} +export class QuotedStringValueContext extends ValueContext { + public QUOTED_STRING(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.QUOTED_STRING, 0); + } + constructor(ctx: ValueContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterQuotedStringValue) { + listener.enterQuotedStringValue(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitQuotedStringValue) { + listener.exitQuotedStringValue(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitQuotedStringValue) { + return visitor.visitQuotedStringValue(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IncompleteLeftQuotedStringValueContext extends ValueContext { + public INCOMPLETE_LEFT_QUOTED_STRING(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.INCOMPLETE_LEFT_QUOTED_STRING, 0); + } + constructor(ctx: ValueContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompleteLeftQuotedStringValue) { + listener.enterIncompleteLeftQuotedStringValue(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompleteLeftQuotedStringValue) { + listener.exitIncompleteLeftQuotedStringValue(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompleteLeftQuotedStringValue) { + return visitor.visitIncompleteLeftQuotedStringValue(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class IncompleteRightQuotedStringValueContext extends ValueContext { + public INCOMPLETE_RIGHT_QUOTED_STRING(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.INCOMPLETE_RIGHT_QUOTED_STRING, 0); + } + constructor(ctx: ValueContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterIncompleteRightQuotedStringValue) { + listener.enterIncompleteRightQuotedStringValue(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitIncompleteRightQuotedStringValue) { + listener.exitIncompleteRightQuotedStringValue(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitIncompleteRightQuotedStringValue) { + return visitor.visitIncompleteRightQuotedStringValue(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class UnquotedStringValueContext extends ValueContext { + public IDENTIFIER(): TerminalNode { + return this.getToken(SelectionAutoCompleteParser.IDENTIFIER, 0); + } + constructor(ctx: ValueContext) { + super(ctx.parent, ctx.invokingState); + this.copyFrom(ctx); + } + // @Override + public enterRule(listener: SelectionAutoCompleteListener): void { + if (listener.enterUnquotedStringValue) { + listener.enterUnquotedStringValue(this); + } + } + // @Override + public exitRule(listener: SelectionAutoCompleteListener): void { + if (listener.exitUnquotedStringValue) { + listener.exitUnquotedStringValue(this); + } + } + // @Override + public accept(visitor: SelectionAutoCompleteVisitor): Result { + if (visitor.visitUnquotedStringValue) { + return visitor.visitUnquotedStringValue(this); + } else { + return visitor.visitChildren(this); + } + } +} diff --git a/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteVisitor.ts b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteVisitor.ts new file mode 100644 index 0000000000000..10446be0694df --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/selection/generated/SelectionAutoCompleteVisitor.ts @@ -0,0 +1,544 @@ +// Generated from /Users/marcosalazar/code/dagster/js_modules/dagster-ui/packages/ui-core/src/selection/SelectionAutoComplete.g4 by ANTLR 4.9.0-SNAPSHOT + +import {ParseTreeVisitor} from 'antlr4ts/tree/ParseTreeVisitor'; + +import { + AllExpressionContext, + AndExpressionContext, + AndTokenContext, + AttributeExpressionContext, + AttributeNameContext, + AttributeValueContext, + AttributeValueWhitespaceContext, + ColonTokenContext, + DownTraversalContext, + DownTraversalExprContext, + DownTraversalExpressionContext, + ExprContext, + ExpressionLessParenthesizedExprContext, + ExpressionlessFunctionExpressionContext, + ExpressionlessParenthesizedExpressionContext, + ExpressionlessParenthesizedExpressionWrapperContext, + FunctionCallExpressionContext, + FunctionNameContext, + IncompleteAndExpressionContext, + IncompleteAttributeExpressionMissingKeyContext, + IncompleteAttributeExpressionMissingValueContext, + IncompleteExprContext, + IncompleteExpressionContext, + IncompleteLeftQuotedStringValueContext, + IncompleteNotExpressionContext, + IncompleteOrExpressionContext, + IncompletePlusTraversalExpressionContext, + IncompleteRightQuotedStringValueContext, + LeftParenTokenContext, + NotExpressionContext, + NotTokenContext, + OrExpressionContext, + OrTokenContext, + ParenthesizedExprContext, + ParenthesizedExpressionContext, + PostAttributeValueWhitespaceContext, + PostDownwardTraversalWhitespaceContext, + PostExpressionWhitespaceContext, + PostLogicalOperatorWhitespaceContext, + PostNeighborTraversalWhitespaceContext, + PostNotOperatorWhitespaceContext, + PostUpwardTraversalWhitespaceContext, + QuotedStringValueContext, + RightParenTokenContext, + StartContext, + TraversalAllowedExprContext, + TraversalAllowedExpressionContext, + TraversalAllowedParenthesizedExpressionContext, + TraversalContext, + UnclosedExpressionlessFunctionExpressionContext, + UnclosedExpressionlessParenthesizedExpressionContext, + UnclosedFunctionExpressionContext, + UnclosedParenthesizedExpressionContext, + UnmatchedValueContext, + UnquotedStringValueContext, + UpAndDownTraversalExpressionContext, + UpTraversalContext, + UpTraversalExprContext, + UpTraversalExpressionContext, + ValueContext, +} from './SelectionAutoCompleteParser'; + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by `SelectionAutoCompleteParser`. + * + * @param The return type of the visit operation. Use `void` for + * operations with no return type. + */ +export interface SelectionAutoCompleteVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by the `AttributeExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAttributeExpression?: (ctx: AttributeExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `FunctionCallExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFunctionCallExpression?: (ctx: FunctionCallExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `TraversalAllowedParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTraversalAllowedParenthesizedExpression?: ( + ctx: TraversalAllowedParenthesizedExpressionContext, + ) => Result; + + /** + * Visit a parse tree produced by the `IncompleteExpression` + * labeled alternative in `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteExpression?: (ctx: IncompleteExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `UpTraversal` + * labeled alternative in `SelectionAutoCompleteParser.upTraversalExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUpTraversal?: (ctx: UpTraversalContext) => Result; + + /** + * Visit a parse tree produced by the `ParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.parenthesizedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitParenthesizedExpression?: (ctx: ParenthesizedExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `TraversalAllowedExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTraversalAllowedExpression?: (ctx: TraversalAllowedExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `UpAndDownTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUpAndDownTraversalExpression?: (ctx: UpAndDownTraversalExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `UpTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUpTraversalExpression?: (ctx: UpTraversalExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `DownTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitDownTraversalExpression?: (ctx: DownTraversalExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `NotExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitNotExpression?: (ctx: NotExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `AndExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAndExpression?: (ctx: AndExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `OrExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitOrExpression?: (ctx: OrExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `IncompleteAndExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteAndExpression?: (ctx: IncompleteAndExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `IncompleteOrExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteOrExpression?: (ctx: IncompleteOrExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `IncompleteNotExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteNotExpression?: (ctx: IncompleteNotExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `AllExpression` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAllExpression?: (ctx: AllExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `UnmatchedValue` + * labeled alternative in `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnmatchedValue?: (ctx: UnmatchedValueContext) => Result; + + /** + * Visit a parse tree produced by the `ExpressionlessParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.expressionLessParenthesizedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitExpressionlessParenthesizedExpression?: ( + ctx: ExpressionlessParenthesizedExpressionContext, + ) => Result; + + /** + * Visit a parse tree produced by the `DownTraversal` + * labeled alternative in `SelectionAutoCompleteParser.downTraversalExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitDownTraversal?: (ctx: DownTraversalContext) => Result; + + /** + * Visit a parse tree produced by the `QuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + * @return the visitor result + */ + visitQuotedStringValue?: (ctx: QuotedStringValueContext) => Result; + + /** + * Visit a parse tree produced by the `IncompleteLeftQuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteLeftQuotedStringValue?: (ctx: IncompleteLeftQuotedStringValueContext) => Result; + + /** + * Visit a parse tree produced by the `IncompleteRightQuotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteRightQuotedStringValue?: (ctx: IncompleteRightQuotedStringValueContext) => Result; + + /** + * Visit a parse tree produced by the `UnquotedStringValue` + * labeled alternative in `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnquotedStringValue?: (ctx: UnquotedStringValueContext) => Result; + + /** + * Visit a parse tree produced by the `IncompleteAttributeExpressionMissingValue` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteAttributeExpressionMissingValue?: ( + ctx: IncompleteAttributeExpressionMissingValueContext, + ) => Result; + + /** + * Visit a parse tree produced by the `ExpressionlessFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitExpressionlessFunctionExpression?: (ctx: ExpressionlessFunctionExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `UnclosedExpressionlessFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnclosedExpressionlessFunctionExpression?: ( + ctx: UnclosedExpressionlessFunctionExpressionContext, + ) => Result; + + /** + * Visit a parse tree produced by the `UnclosedFunctionExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnclosedFunctionExpression?: (ctx: UnclosedFunctionExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `UnclosedParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnclosedParenthesizedExpression?: (ctx: UnclosedParenthesizedExpressionContext) => Result; + + /** + * Visit a parse tree produced by the `ExpressionlessParenthesizedExpressionWrapper` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitExpressionlessParenthesizedExpressionWrapper?: ( + ctx: ExpressionlessParenthesizedExpressionWrapperContext, + ) => Result; + + /** + * Visit a parse tree produced by the `UnclosedExpressionlessParenthesizedExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUnclosedExpressionlessParenthesizedExpression?: ( + ctx: UnclosedExpressionlessParenthesizedExpressionContext, + ) => Result; + + /** + * Visit a parse tree produced by the `IncompletePlusTraversalExpression` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompletePlusTraversalExpression?: ( + ctx: IncompletePlusTraversalExpressionContext, + ) => Result; + + /** + * Visit a parse tree produced by the `IncompleteAttributeExpressionMissingKey` + * labeled alternative in `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteAttributeExpressionMissingKey?: ( + ctx: IncompleteAttributeExpressionMissingKeyContext, + ) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.start`. + * @param ctx the parse tree + * @return the visitor result + */ + visitStart?: (ctx: StartContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.expr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitExpr?: (ctx: ExprContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.traversalAllowedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTraversalAllowedExpr?: (ctx: TraversalAllowedExprContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.parenthesizedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitParenthesizedExpr?: (ctx: ParenthesizedExprContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.incompleteExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitIncompleteExpr?: (ctx: IncompleteExprContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.expressionLessParenthesizedExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitExpressionLessParenthesizedExpr?: (ctx: ExpressionLessParenthesizedExprContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.upTraversalExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitUpTraversalExpr?: (ctx: UpTraversalExprContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.downTraversalExpr`. + * @param ctx the parse tree + * @return the visitor result + */ + visitDownTraversalExpr?: (ctx: DownTraversalExprContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.traversal`. + * @param ctx the parse tree + * @return the visitor result + */ + visitTraversal?: (ctx: TraversalContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.attributeName`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAttributeName?: (ctx: AttributeNameContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.attributeValue`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAttributeValue?: (ctx: AttributeValueContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.functionName`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFunctionName?: (ctx: FunctionNameContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.orToken`. + * @param ctx the parse tree + * @return the visitor result + */ + visitOrToken?: (ctx: OrTokenContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.andToken`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAndToken?: (ctx: AndTokenContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.notToken`. + * @param ctx the parse tree + * @return the visitor result + */ + visitNotToken?: (ctx: NotTokenContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.colonToken`. + * @param ctx the parse tree + * @return the visitor result + */ + visitColonToken?: (ctx: ColonTokenContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.leftParenToken`. + * @param ctx the parse tree + * @return the visitor result + */ + visitLeftParenToken?: (ctx: LeftParenTokenContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.rightParenToken`. + * @param ctx the parse tree + * @return the visitor result + */ + visitRightParenToken?: (ctx: RightParenTokenContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.attributeValueWhitespace`. + * @param ctx the parse tree + * @return the visitor result + */ + visitAttributeValueWhitespace?: (ctx: AttributeValueWhitespaceContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.postAttributeValueWhitespace`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPostAttributeValueWhitespace?: (ctx: PostAttributeValueWhitespaceContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.postExpressionWhitespace`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPostExpressionWhitespace?: (ctx: PostExpressionWhitespaceContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.postNotOperatorWhitespace`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPostNotOperatorWhitespace?: (ctx: PostNotOperatorWhitespaceContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.postLogicalOperatorWhitespace`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPostLogicalOperatorWhitespace?: (ctx: PostLogicalOperatorWhitespaceContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.postNeighborTraversalWhitespace`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPostNeighborTraversalWhitespace?: (ctx: PostNeighborTraversalWhitespaceContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.postUpwardTraversalWhitespace`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPostUpwardTraversalWhitespace?: (ctx: PostUpwardTraversalWhitespaceContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.postDownwardTraversalWhitespace`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPostDownwardTraversalWhitespace?: (ctx: PostDownwardTraversalWhitespaceContext) => Result; + + /** + * Visit a parse tree produced by `SelectionAutoCompleteParser.value`. + * @param ctx the parse tree + * @return the visitor result + */ + visitValue?: (ctx: ValueContext) => Result; +}