From f4fb8a3f0bebc864922fb2e343d0b35d54a50031 Mon Sep 17 00:00:00 2001 From: ecmel Date: Fri, 19 Apr 2024 14:38:49 +0300 Subject: [PATCH 01/25] fixes KXI-34828 --- package.json | 6 +- server/src/linter/assign.ts | 101 - server/src/linter/index.ts | 51 - server/src/linter/limit.ts | 146 - server/src/linter/other.ts | 57 - server/src/linter/rules.ts | 542 - server/src/parser/lexer.ts | 2 +- server/src/parser/tokens.ts | 11 +- server/src/qLangServer.ts | 458 +- server/src/server.ts | 35 +- server/src/utils/analyzer.ts | 426 - server/src/utils/antlrGrammars/q.interp | 520 - server/src/utils/antlrGrammars/q.tokens | 344 - server/src/utils/antlrGrammars/qLexer.interp | 542 - server/src/utils/antlrGrammars/qLexer.tokens | 344 - server/src/utils/antlrGrammars/qLexer.ts | 1321 -- server/src/utils/antlrGrammars/qListener.ts | 1779 --- server/src/utils/antlrGrammars/qParser.ts | 11407 ---------------- server/src/utils/cpUtils.ts | 94 - server/src/utils/parserUtils.ts | 46 - src/commands/buildToolsCommand.ts | 138 + src/extension.ts | 103 +- src/extensionVariables.ts | 5 +- .../services/completionProvider.ts | 46 +- 24 files changed, 246 insertions(+), 18278 deletions(-) delete mode 100644 server/src/linter/assign.ts delete mode 100644 server/src/linter/index.ts delete mode 100644 server/src/linter/limit.ts delete mode 100644 server/src/linter/other.ts delete mode 100644 server/src/linter/rules.ts delete mode 100644 server/src/utils/analyzer.ts delete mode 100644 server/src/utils/antlrGrammars/q.interp delete mode 100644 server/src/utils/antlrGrammars/q.tokens delete mode 100644 server/src/utils/antlrGrammars/qLexer.interp delete mode 100644 server/src/utils/antlrGrammars/qLexer.tokens delete mode 100644 server/src/utils/antlrGrammars/qLexer.ts delete mode 100644 server/src/utils/antlrGrammars/qListener.ts delete mode 100644 server/src/utils/antlrGrammars/qParser.ts delete mode 100644 server/src/utils/cpUtils.ts delete mode 100644 server/src/utils/parserUtils.ts create mode 100644 src/commands/buildToolsCommand.ts rename server/src/utils/qLangParser.ts => src/services/completionProvider.ts (97%) diff --git a/package.json b/package.json index c0031f72..a25c9b9f 100644 --- a/package.json +++ b/package.json @@ -183,7 +183,7 @@ "kdb.linting": { "type": "boolean", "description": "Enable linting for q files", - "default": true + "default": false } } }, @@ -317,6 +317,10 @@ { "command": "kdb.execute.entireFile", "title": "Execute Entire File" + }, + { + "command": "kdb.qlint", + "title": "Lint File" } ], "keybindings": [ diff --git a/server/src/linter/assign.ts b/server/src/linter/assign.ts deleted file mode 100644 index 8ae883b1..00000000 --- a/server/src/linter/assign.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import { Token, TokenType, QAst, scope } from "../parser"; - -export function assignReservedWord({ assign }: QAst): Token[] { - return assign.filter((entity) => entity.type === TokenType.KEYWORD); -} - -export function invalidAssign({ assign }: QAst): Token[] { - return assign.filter((entity) => entity.type === TokenType.LITERAL); -} - -export function unusedParam({ script, assign }: QAst): Token[] { - assign = assign.filter( - (token) => token.type === TokenType.IDENTIFIER && token.tag === "ARGUMENT" - ); - - script = script.filter( - (token) => - token.tag !== "ASSIGNED" && - token.tag !== "ARGUMENT" && - token.type === TokenType.IDENTIFIER && - assign.find((symbol) => symbol.image === token.image) - ); - - assign = assign.filter( - (token) => - !script.find( - (symbol) => - symbol.image === token.image && scope(symbol) === scope(token) - ) - ); - - return assign; -} - -export function unusedVar({ script, assign }: QAst): Token[] { - const locals = assign.filter( - (token) => token.type === TokenType.IDENTIFIER && scope(token) - ); - - assign = assign.filter( - (token) => token.type === TokenType.IDENTIFIER && token.tag === "ASSIGNED" - ); - - script = script.filter( - (token) => - token.tag !== "ASSIGNED" && - token.tag !== "ARGUMENT" && - token.type === TokenType.IDENTIFIER && - assign.find((symbol) => symbol.image === token.image) - ); - - assign = assign.filter( - (token) => - !script.find( - (symbol) => - symbol.image === token.image && - (scope(symbol) === scope(token) || - (!scope(token) && - !locals.find( - (local) => - local.image === token.image && scope(local) === scope(symbol) - ))) - ) - ); - - return assign; -} - -export function declaredAfterUse({ script, assign }: QAst): Token[] { - return assign - .filter((token) => token.tag === "ASSIGNED" && !scope(token)) - .filter((token) => { - const found = script.find( - (entity) => - entity.type === TokenType.IDENTIFIER && - entity.tag !== "ASSIGNED" && - entity.image === token.image && - !scope(entity) - ); - const reverse = !!scope(token, [TokenType.GROUP]); - return ( - found && - (reverse - ? found.statement > token.statement - : found.statement < token.statement) - ); - }); -} diff --git a/server/src/linter/index.ts b/server/src/linter/index.ts deleted file mode 100644 index 38f3ec72..00000000 --- a/server/src/linter/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import { Token, QAst } from "../parser"; -import { RuleSeverity, Rules } from "./rules"; - -const enabled = [ - "ASSIGN_RESERVED_WORD", - "DECLARED_AFTER_USE", - "DEPRECATED_DATETIME", - "FIXED_SEED", - "INVALID_ASSIGN", - "INVALID_ESCAPE", - "TOO_MANY_ARGUMENTS", - "TOO_MANY_CONSTANTS", - "TOO_MANY_GLOBALS", - "TOO_MANY_LOCALS", - "UNUSED_PARAM", - "UNUSED_VAR", -]; - -export interface LintResult { - name: string; - message: string; - severity: RuleSeverity; - problems: Token[]; -} - -export function lint(ast: QAst) { - return Rules.filter((rule) => enabled.find((name) => rule.name === name)) - .map((rule) => { - const result: LintResult = { - name: rule.name, - message: rule.message, - severity: rule.severity, - problems: rule.check(ast), - }; - return result; - }) - .filter((result) => result.problems.length > 0); -} diff --git a/server/src/linter/limit.ts b/server/src/linter/limit.ts deleted file mode 100644 index 774cfce4..00000000 --- a/server/src/linter/limit.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import { Token, TokenType, QAst, scope } from "../parser"; - -const DEFAULT_MAX_LOCALS = 110; -const DEFAULT_MAX_GLOBALS = 110; -const DEFAULT_MAX_CONSTANTS = 239; -const DEFAULT_MAX_ARGUMENTS = 8; - -export function tooManyConstants({ script }: QAst): Token[] { - const counts = new Map(); - - script - .filter((entity) => scope(entity)) - .forEach((entity) => { - if (entity.type === TokenType.IDENTIFIER) { - const scoped = scope(entity); - if (scoped) { - let count = counts.get(scoped); - if (!count) { - count = 0; - } - count++; - counts.set(scoped, count); - } - } - }); - - const problems: Token[] = []; - - for (const entry of counts.entries()) { - if (entry[1] > DEFAULT_MAX_CONSTANTS) { - problems.push(entry[0]); - } - } - - return problems; -} - -export function tooManyGlobals({ script, assign }: QAst): Token[] { - const counts = new Map(); - - const globals = assign.filter((entity) => !scope(entity)); - - script - .filter((entity) => scope(entity)) - .forEach((entity) => { - const scoped = scope(entity); - if (scoped) { - let count = counts.get(scoped); - if (!count) { - count = 0; - } - if (globals.find((symbol) => symbol.image === entity.image)) { - count++; - } - counts.set(scoped, count); - } - }); - - const problems: Token[] = []; - - for (const entry of counts.entries()) { - if (entry[1] > DEFAULT_MAX_GLOBALS) { - problems.push(entry[0]); - } - } - - return problems; -} - -export function tooManyLocals({ assign }: QAst): Token[] { - const counts = new Map(); - - assign - .filter((entity) => scope(entity)) - .forEach((entity) => { - const scoped = scope(entity); - if (scoped) { - let count = counts.get(scoped); - if (!count) { - count = 0; - } - if ( - assign.find( - (symbol) => - scope(symbol) === scoped && entity.image === symbol.image - ) - ) { - count++; - } - counts.set(scoped, count); - } - }); - - const problems: Token[] = []; - - for (const entry of counts.entries()) { - if (entry[1] > DEFAULT_MAX_LOCALS) { - problems.push(entry[0]); - } - } - - return problems; -} - -export function tooManyArguments({ assign }: QAst): Token[] { - const counts = new Map(); - - assign - .filter( - (token) => token.type === TokenType.IDENTIFIER && token.tag === "ARGUMENT" - ) - .forEach((token) => { - const scoped = scope(token); - if (scoped) { - let count = counts.get(scoped); - if (!count) { - count = 0; - } - count++; - counts.set(scoped, count); - } - }); - - const problems: Token[] = []; - - for (const entry of counts.entries()) { - if (entry[1] > DEFAULT_MAX_ARGUMENTS) { - problems.push(entry[0]); - } - } - - return problems; -} diff --git a/server/src/linter/other.ts b/server/src/linter/other.ts deleted file mode 100644 index 1a9b7c34..00000000 --- a/server/src/linter/other.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import { Token, QAst, TokenType } from "../parser"; - -export function deprecatedDatetime({ script }: QAst): Token[] { - return script.filter((entity) => entity.name === "DateTimeLiteral"); -} - -export function invalidEscape({ script }: QAst): Token[] { - return script - .filter((entity) => entity.name === "CharLiteral") - .filter((entity) => { - const image = entity.image; - let match = image.match(/(?:\\\\|\\)/g); - const count = match ? match.length : 0; - if (count > 0) { - match = image.match(/\\(?:\d{3}|[\\"rnt/])/g); - if (count !== (match ? match.length : 0)) { - return true; - } - } - return false; - }); -} - -export function fixedSeed({ script }: QAst): Token[] { - const problems: Token[] = []; - - for (let i = 0; i < script.length; i++) { - const token = script[i]; - if (token.type === TokenType.OPERATOR && token.image === "?") { - let next = script[i + 1]; - if (next && next.image === "0Ng") { - next = script[i - 1]; - if (next && next.name === "NumberLiteral") { - const val = parseInt(next.image); - if (val > 0) { - problems.push(next); - } - } - } - } - } - - return problems; -} diff --git a/server/src/linter/rules.ts b/server/src/linter/rules.ts deleted file mode 100644 index 448ccf74..00000000 --- a/server/src/linter/rules.ts +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import { Token, QAst } from "../parser"; -import { - assignReservedWord, - declaredAfterUse, - invalidAssign, - unusedParam, - unusedVar, -} from "./assign"; -import { - tooManyArguments, - tooManyConstants, - tooManyGlobals, - tooManyLocals, -} from "./limit"; -import { deprecatedDatetime, fixedSeed, invalidEscape } from "./other"; - -export enum RuleSeverity { - ERROR = "ERROR", - WARNING = "WARNING", - INFO = "INFO", - HINT = "HINT", -} - -export interface LinterRule { - name: string; - message: string; - severity: RuleSeverity; - check: (ast: QAst) => Token[]; -} - -const check = () => []; - -const AssignReservedWordRule: LinterRule = { - name: "ASSIGN_RESERVED_WORD", - message: "Assignment to a reserved word", - severity: RuleSeverity.ERROR, - check: assignReservedWord, -}; - -const CondEvenArgsRule: LinterRule = { - name: "COND_EVENARGS", - message: "Conditional $ should not be used with an even number of arguments", - severity: RuleSeverity.ERROR, - check, -}; - -const DeclaredAfterUseRule: LinterRule = { - name: "DECLARED_AFTER_USE", - message: "The variable was declared after being used", - severity: RuleSeverity.ERROR, - check: declaredAfterUse, -}; - -const GlobalPeachRule: LinterRule = { - name: "GLOBAL_PEACH", - message: "Modifying globals inside a peach statement is not allowed", - severity: RuleSeverity.ERROR, - check, -}; - -const InvalidAdverbRule: LinterRule = { - name: "INVALID_ADVERB", - message: "A binary adverb cannot be applied to a unary function", - severity: RuleSeverity.ERROR, - check, -}; - -const InvalidAssignRule: LinterRule = { - name: "INVALID_ASSIGN", - message: "Attempt to assign to a string, symbol, or number", - severity: RuleSeverity.ERROR, - check: invalidAssign, -}; - -const InvalidEscapeRule: LinterRule = { - name: "INVALID_ESCAPE", - message: - 'Invalid Escape Sequence: Valid escape sequences are: \\n,\\r,\\t,\\\\,\\/,\\" and three digit octal sequences \\377 or smaller', - severity: RuleSeverity.HINT, - check: invalidEscape, -}; - -const InvalidQukeRule: LinterRule = { - name: "INVALID_QUKE", - message: "A quke file was improperly formatted", - severity: RuleSeverity.ERROR, - check, -}; - -const OverwriteArtifactRule: LinterRule = { - name: "OVERWRITE_ARTIFACT", - message: "Variable assignment overwrites namespace or artifact", - severity: RuleSeverity.ERROR, - check, -}; - -const StatementInExprRule: LinterRule = { - name: "STATEMENT_IN_EXPR", - message: - "If, while, or do statement used in expression, possible missing semicolon", - severity: RuleSeverity.ERROR, - check, -}; - -const ReservedNameRule: LinterRule = { - name: "RESERVED_NAME", - message: "File has reserved name", - severity: RuleSeverity.ERROR, - check, -}; - -const TooManyConstantsRule: LinterRule = { - name: "TOO_MANY_CONSTANTS", - message: "Too many constants in a function", - severity: RuleSeverity.ERROR, - check: tooManyConstants, -}; - -const TooManyGlobalsRule: LinterRule = { - name: "TOO_MANY_GLOBALS", - message: "Too many globals in a function", - severity: RuleSeverity.ERROR, - check: tooManyGlobals, -}; - -const UnindentedCodeRule: LinterRule = { - name: "UNINDENTED_CODE", - message: "Any multiline expression must be indented after the first line", - severity: RuleSeverity.ERROR, - check, -}; - -const TooManyLocalsRule: LinterRule = { - name: "TOO_MANY_LOCALS", - message: "Too many locals in a function", - severity: RuleSeverity.ERROR, - check: tooManyLocals, -}; - -const TooManyArgumentsRule: LinterRule = { - name: "TOO_MANY_ARGUMENTS", - message: "Too many arguments in a function", - severity: RuleSeverity.ERROR, - check: tooManyArguments, -}; - -const BackwardCompatibilityRule: LinterRule = { - name: "BACKWARD_COMPATIBILITY", - message: - "This function has backward compatibility issues with kdb versions less than 3.6", - severity: RuleSeverity.WARNING, - check, -}; - -const CastTypeNumericalRule: LinterRule = { - name: "CAST_TYPE_NUMERICAL", - message: - "Casting using a short to indicate cast type is unnecessarily unclear. Another form is advised", - severity: RuleSeverity.WARNING, - check, -}; - -const ConditionallyDeclaredRule: LinterRule = { - name: "CONDITIONALLY_DECLARED", - message: - "This variable may be undefined at this point, as it was only declared conditionally", - severity: RuleSeverity.WARNING, - check, -}; - -const DebugFunctionRule: LinterRule = { - name: "DEBUG_FUNCTION", - message: "eval, or value when run on a string literal", - severity: RuleSeverity.WARNING, - check, -}; - -const DeprecatedDatetimeRule: LinterRule = { - name: "DEPRECATED_DATETIME", - message: "Datetime has been deprecated", - severity: RuleSeverity.WARNING, - check: deprecatedDatetime, -}; - -const DeprecatedFunctionRule: LinterRule = { - name: "DEPRECATED_FUNCTION", - message: "This file uses a deprecated function", - severity: RuleSeverity.WARNING, - check, -}; - -const EmptyIfRule: LinterRule = { - name: "EMPTY_IF", - message: "If statement lacks code to execute", - severity: RuleSeverity.WARNING, - check, -}; - -const FixedSeedRule: LinterRule = { - name: "FIXED_SEED", - message: - "Inputting a positive number into ?0Ng will result in the same sequence every run", - severity: RuleSeverity.WARNING, - check: fixedSeed, -}; - -const FunctionStartRule: LinterRule = { - name: "FUNCTION_START", - message: "Function artifact must start with a function", - severity: RuleSeverity.WARNING, - check, -}; - -const InsufficientIndentRule: LinterRule = { - name: "INSUFFICIENT_INDENT", - message: - "Indentation must be equal to or greater than the second line of the function body, and the second line must have an indentation greater than the first line", - severity: RuleSeverity.WARNING, - check, -}; - -const InternalRule: LinterRule = { - name: "INTERNAL", - message: "Reference to an internal api of another module", - severity: RuleSeverity.WARNING, - check, -}; - -const InvalidFunctionRule: LinterRule = { - name: "INVALID_FUNCTION", - message: - "Function artifacts must be lambda definitions, rather than projections, immediately invoked functions, or functions in expressions", - severity: RuleSeverity.WARNING, - check, -}; - -const MalformedSuppressionRule: LinterRule = { - name: "MALFORMED_SUPPRESSION", - message: "Malformed @qlintsuppress tag", - severity: RuleSeverity.WARNING, - check, -}; - -const MissingDependencyRule: LinterRule = { - name: "MISSING_DEPENDENCY", - message: - "Any reference to another namespace should be listed in the dependency list", - severity: RuleSeverity.WARNING, - check, -}; - -const NameCollisionRule: LinterRule = { - name: "NAME_COLLISION", - message: "Executing statement in editor could overwrite global variable", - severity: RuleSeverity.WARNING, - check, -}; - -const NeedExplicitReturnRule: LinterRule = { - name: "NEED_EXPLICIT_RETURN", - message: "Explicit return needed. Otherwise will return generic null", - severity: RuleSeverity.WARNING, - check, -}; - -const PossibleReturnRule: LinterRule = { - name: "POSSIBLE_RETURN", - message: "Assignment statement looks like return", - severity: RuleSeverity.WARNING, - check, -}; - -const UndeclaredVarRule: LinterRule = { - name: "UNDECLARED_VAR", - message: "Undeclared variable in function will be treated as global", - severity: RuleSeverity.WARNING, - check, -}; - -const UnusedInternalRule: LinterRule = { - name: "UNUSED_INTERNAL", - message: - "This function is marked as internal (is part of a sub-namespace i) but was never used within the namespace", - severity: RuleSeverity.WARNING, - check, -}; - -const UnusedParamRule: LinterRule = { - name: "UNUSED_PARAM", - message: "This param was declared then never used", - severity: RuleSeverity.HINT, - check: unusedParam, -}; - -const UnusedVarRule: LinterRule = { - name: "UNUSED_VAR", - message: "This variable was declared then never used", - severity: RuleSeverity.HINT, - check: unusedVar, -}; - -const RandomGuidsRule: LinterRule = { - name: "RANDOM_GUIDS", - message: - "Multiple calls to ?0ng in quick succession, with negative numbers, can produce the same output", - severity: RuleSeverity.WARNING, - check, -}; - -const UnreachableCodeRule: LinterRule = { - name: "UNREACHABLE_CODE", - message: "A preceding return prevents this statement from being reached", - severity: RuleSeverity.WARNING, - check, -}; - -const UnexpectedCondNewline: LinterRule = { - name: "UNEXPECTED_COND_NEWLINE", - message: "Condition should begin on same line as loop or if statement", - severity: RuleSeverity.WARNING, - check, -}; - -const UnparenthesizedJoinRule: LinterRule = { - name: "UNPARENTHESIZED_JOIN", - message: - "A potential join in this QSQL statement will be interpreted as separate statements unless wrapped in parentheses", - severity: RuleSeverity.WARNING, - check, -}; - -const VarQErrorRule: LinterRule = { - name: "VAR_Q_ERROR", - message: - "Variable name the same as q error message. This can cause ambiguous error messages", - severity: RuleSeverity.WARNING, - check, -}; - -const MissingSemicolonRule: LinterRule = { - name: "MISSING_SEMICOLON", - message: - "An apply statement spans multiple lines with the same indentation and an assignment on the second line, potentially indicating a missing semi-colon ", - severity: RuleSeverity.WARNING, - check, -}; - -const MalformedRule: LinterRule = { - name: "MALFORMED_RULE", - message: "Malformed @qlintrule tag", - severity: RuleSeverity.WARNING, - check, -}; - -const TodoRule: LinterRule = { - name: "TODO", - message: "Todo qDoc tag present", - severity: RuleSeverity.WARNING, - check, -}; - -const LineLengthRule: LinterRule = { - name: "LINE_LENGTH", - message: "Maximum line length exceeded", - severity: RuleSeverity.WARNING, - check, -}; - -const DefaultQdocRule: LinterRule = { - name: "DEFAULT_QDOC", - message: "The file has the default documentation", - severity: RuleSeverity.INFO, - check, -}; - -const InvalidKindRule: LinterRule = { - name: "INVALID_KIND", - message: "Invalid qdoc kind in tag", - severity: RuleSeverity.INFO, - check, -}; - -const InvalidTypedefRule: LinterRule = { - name: "INVALID_TYPEDEF", - message: "Invalid typedef tag", - severity: RuleSeverity.INFO, - check, -}; - -const InvalidTagRule: LinterRule = { - name: "INVALID_TAG", - message: "Tag not recognized as valid qDoc tag", - severity: RuleSeverity.INFO, - check, -}; - -const MissingOverviewRule: LinterRule = { - name: "MISSING_OVERVIEW", - message: "Missing @fileOverview tag with associated description", - severity: RuleSeverity.INFO, - check, -}; - -const MissingReturnsRule: LinterRule = { - name: "MISSING_RETURNS", - message: "Missing @returns tag", - severity: RuleSeverity.INFO, - check, -}; - -const MissingTypeRule: LinterRule = { - name: "MISSING_TYPE", - message: "Missing type in returns or param tag", - severity: RuleSeverity.INFO, - check, -}; - -const MultipleReturnsRule: LinterRule = { - name: "MULTIPLE_RETURNS", - message: "Multiple @returns tags", - severity: RuleSeverity.INFO, - check, -}; - -const OurOfOrderParamRule: LinterRule = { - name: "OUT_OF_ORDER_PARAM", - message: "Parameters out of order", - severity: RuleSeverity.INFO, - check, -}; - -const ParamNotInCodeRule: LinterRule = { - name: "PARAM_NOT_IN_CODE", - message: "This param is not in the function", - severity: RuleSeverity.INFO, - check, -}; - -const QdocTypeRule: LinterRule = { - name: "QDOC_TYPE", - message: "Invalid type in tag", - severity: RuleSeverity.INFO, - check, -}; - -const RedundantQlobalAssignRule: LinterRule = { - name: "REDUNDANT_GLOBAL_ASSIGN", - message: - "Using the global amend operator on a fully qualified name is redundant", - severity: RuleSeverity.INFO, - check, -}; - -const UndocumentedParamRule: LinterRule = { - name: "UNDOCUMENTED_PARAM", - message: "Undocumented parameter", - severity: RuleSeverity.INFO, - check, -}; - -const UnusedDependencyRule: LinterRule = { - name: "UNUSED_DEPENDENCY", - message: "Unused dependencies", - severity: RuleSeverity.INFO, - check, -}; - -export const Rules: LinterRule[] = [ - AssignReservedWordRule, - CondEvenArgsRule, - DeclaredAfterUseRule, - GlobalPeachRule, - InvalidAdverbRule, - InvalidAssignRule, - InvalidEscapeRule, - InvalidQukeRule, - OverwriteArtifactRule, - StatementInExprRule, - ReservedNameRule, - TooManyConstantsRule, - TooManyGlobalsRule, - TooManyLocalsRule, - TooManyArgumentsRule, - UnindentedCodeRule, - BackwardCompatibilityRule, - CastTypeNumericalRule, - ConditionallyDeclaredRule, - DebugFunctionRule, - DeprecatedDatetimeRule, - DeprecatedFunctionRule, - EmptyIfRule, - FixedSeedRule, - FunctionStartRule, - InsufficientIndentRule, - InternalRule, - InvalidFunctionRule, - MalformedSuppressionRule, - MissingDependencyRule, - NameCollisionRule, - NeedExplicitReturnRule, - PossibleReturnRule, - UndeclaredVarRule, - UnusedInternalRule, - UnusedParamRule, - UnusedVarRule, - RandomGuidsRule, - UnreachableCodeRule, - UnexpectedCondNewline, - UnparenthesizedJoinRule, - VarQErrorRule, - MissingSemicolonRule, - MalformedRule, - TodoRule, - LineLengthRule, - DefaultQdocRule, - InvalidKindRule, - InvalidTypedefRule, - InvalidTagRule, - MissingOverviewRule, - MissingReturnsRule, - MissingTypeRule, - MultipleReturnsRule, - OurOfOrderParamRule, - ParamNotInCodeRule, - QdocTypeRule, - RedundantQlobalAssignRule, - UndocumentedParamRule, - UnusedDependencyRule, -]; diff --git a/server/src/parser/lexer.ts b/server/src/parser/lexer.ts index 6ea9b3c9..9154a05e 100644 --- a/server/src/parser/lexer.ts +++ b/server/src/parser/lexer.ts @@ -50,6 +50,7 @@ export const QTokens = [ LastComment, LineComment, CharLiteral, + Command, SymbolLiteral, DateTimeLiteral, TimeStampLiteral, @@ -68,7 +69,6 @@ export const QTokens = [ Identifier, SemiColon, WhiteSpace, - Command, Iterator, Operator, Colon, diff --git a/server/src/parser/tokens.ts b/server/src/parser/tokens.ts index cadd09b1..e176bbce 100644 --- a/server/src/parser/tokens.ts +++ b/server/src/parser/tokens.ts @@ -34,6 +34,12 @@ export const LineComment = createToken({ group: Lexer.SKIPPED, }); +export const Command = createToken({ + name: "Command", + pattern: + /\\(?:cd|ts|[abBcCdefglopPrsStTuvwWxz12_\\])[\s\S]*?(?:(? = new TextDocuments( - TextDocument + TextDocument, ); - public defaultSettings: GlobalSettings = { maxNumberOfProblems: 1000 }; - public globalSettings: GlobalSettings = this.defaultSettings; - public documentSettings: Map> = new Map(); - public analyzer: AnalyzerContent; - private constructor(connection: Connection, analyzer: AnalyzerContent) { + constructor(connection: Connection, params: InitializeParams) { this.connection = connection; - this.analyzer = analyzer; + this.params = params; this.documents.listen(this.connection); - this.documents.onDidSave(() => { - this.analyzer.analyzeWorkspace(); - }); - this.documents.onDidClose((e) => { - this.connection.sendDiagnostics({ uri: e.document.uri, diagnostics: [] }); - this.documentSettings.delete(e.document.uri); - }); - this.documents.onDidChangeContent(async (change) => { - await this.validateTextDocument(change.document); - }); - this.connection.onNotification("analyzeSourceCode", (config) => - this.analyzer.analyzeWorkspace(config) - ); this.connection.onCompletion(this.onCompletion.bind(this)); - this.connection.onCompletionResolve(this.onCompletionResolve.bind(this)); - this.connection.onHover(this.onHover.bind(this)); - this.connection.onDocumentHighlight(this.onDocumentHighlight.bind(this)); this.connection.onDefinition(this.onDefinition.bind(this)); - this.connection.onDocumentSymbol(this.onDocumentSymbol.bind(this)); - this.connection.onReferences(this.onReferences.bind(this)); this.connection.onRenameRequest(this.onRenameRequest.bind(this)); - // Semantic Tokens - this.connection.languages.semanticTokens.on( - this.onSemanticsTokens.bind(this) - ); - // Call Hierarchy - this.connection.languages.callHierarchy.onPrepare( - this.onPrepareCallHierarchy.bind(this) - ); - this.connection.languages.callHierarchy.onIncomingCalls( - this.onIncomingCallsCallHierarchy.bind(this) - ); - this.connection.languages.callHierarchy.onOutgoingCalls( - this.onOutgoingCallsCallHierarchy.bind(this) - ); - this.connection.onDidChangeConfiguration( - this.onDidChangeConfiguration.bind(this) - ); - } - - public static async initialize( - connection: Connection, - { workspaceFolders }: InitializeParams - ): Promise { - // Get the URI of the root folder, if it exists. - const rootUri = - workspaceFolders && workspaceFolders.length > 0 - ? workspaceFolders[0].uri - : ""; - const analyzer = await AnalyzerContent.fromRoot(connection, rootUri); - const server = new QLangServer(connection, analyzer); - // Write a console message to indicate that the server is being initialized. - server.writeConsoleMsg( - "Initializing QLang Language Server for QLang VSCode extension", - "info" - ); - - return server; } public capabilities(): ServerCapabilities { return { - // The kind of text document synchronization that the server supports. textDocumentSync: TextDocumentSyncKind.Full, - // Whether the server supports resolving additional information for a completion item. - completionProvider: { resolveProvider: true }, - // Whether the server supports providing hover information for a symbol. - // hoverProvider: true, - // Whether the server supports providing document highlights for a symbol. - // documentHighlightProvider: true, - // Whether the server supports providing definitions for a symbol. + completionProvider: { resolveProvider: false }, definitionProvider: true, - // Whether the server supports providing symbols for a document. - // documentSymbolProvider: true, - // Whether the server supports finding references to a symbol. - referencesProvider: true, - // Whether the server supports renaming a symbol. renameProvider: true, - // renameProvider: { prepareProvider: true }, - // Whether the server supports providing semantic tokens for a document. - /* - semanticTokensProvider: { - documentSelector: null, - legend: { - tokenTypes: ["variable", "parameter", "type", "class"], - tokenModifiers: [], - }, - full: true, - }, - */ - // Whether the server supports providing call hierarchy information for a symbol - disabled for the moment. - callHierarchyProvider: false, }; } - public debugWithLogs( - request: string, - msg: string, - place?: string | null, - keyword?: Keyword | null - ) { - const where = place ? place : " not specified "; - const isKeyword = keyword ? `keyword=${JSON.stringify(keyword)}` : ""; - this.writeConsoleMsg( - `${request} ${isKeyword} msg=${msg} where?: ${where}`, - "warn" - ); - } - - public writeConsoleMsg(msg: string, type: string): void { - switch (type) { - case "error": - this.connection.console.error(msg); - break; - case "warn": - this.connection.console.warn(msg); - break; - case "info": - default: - this.connection.console.info(msg); - break; - } - } - - public setSettings(settings: LSPAny) { - this.settings = settings; - this.documents.all().forEach((doc) => this.validateTextDocument(doc)); - } - - private onDidChangeConfiguration(change: DidChangeConfigurationParams) { - this.setSettings(change.settings?.kdb || defaultSettings); - } - - private onCompletion(params: TextDocumentPositionParams): CompletionItem[] { - const keyword = this.getKeyword(params); - if (!keyword) { - return []; - } - return this.analyzer.getCompletionItems(keyword); - } - - private async onCompletionResolve( - item: CompletionItem - ): Promise { - return item; - } - - private async onHover( - params: TextDocumentPositionParams - ): Promise { - const keyword = this.getEntireKeyword(params); - if (!keyword) { - return null; - } - return this.analyzer.getHoverInfo(keyword); - } - - // TODO: Document highlight - private onDocumentHighlight( - params: TextDocumentPositionParams - ): DocumentHighlight[] | null { - const position = params.position; + private onCompletion(): CompletionItem[] { return []; } - private onDefinition(params: TextDocumentPositionParams): Location[] { - const document = this.documents.get(params.textDocument.uri); - if (!document) { - return []; - } - - const position = params.position; - const wordRange = this.analyzer.getWordRangeAtPosition(document, position); - if (!wordRange) { - return []; - } - - const keyword = document.getText(wordRange) + ":"; - - const definitions = this.analyzer.getDefinitions(keyword); - if (!definitions) { - return []; - } - - return definitions.map((definition) => { - return Location.create( - definition.uri, - Range.create( - Position.create( - definition.range.start.line, - definition.range.start.character - ), - Position.create( - definition.range.end.line, - definition.range.end.character - ) - ) - ); - }); - } - - private onDocumentSymbol(params: DocumentSymbolParams): SymbolInformation[] { - const document = this.documents.get(params.textDocument.uri); - if (document) { - return this.analyzer.getSymbols(document); - } + private onDefinition(): Location[] { return []; } - public onPrepareCallHierarchy({ - textDocument, - position, - }: CallHierarchyPrepareParams): CallHierarchyItem[] { - const document = this.documents.get(textDocument.uri); - if (!document) { - return []; - } - const range = this.getCurrentWordRange(position, document); - if (!range) { - return []; - } - const keyword = document.getText(range); - const symbolInformation = this.analyzer - .getSymbolsByUri(textDocument.uri) - .filter((symbol) => symbol.name === keyword); - if ( - symbolInformation.length > 0 && - symbolInformation[0].kind === SymbolKind.Function - ) { - return [ - { - name: keyword, - kind: SymbolKind.Function, - uri: textDocument.uri, - range: range, - selectionRange: range, - }, - ]; - } - return []; - } - - public onIncomingCallsCallHierarchy({ - item, - }: CallHierarchyIncomingCallsParams): CallHierarchyIncomingCall[] { - const containerName = item.name; - if (!containerName) { - return []; - } - const items = this.analyzer.getCallHierarchyItemByKeyword(containerName); - return items.map((item) => ({ from: item, fromRanges: [item.range] })); - } - - public onOutgoingCallsCallHierarchy({ - item, - }: CallHierarchyOutgoingCallsParams): CallHierarchyOutgoingCall[] { - const globalId = this.analyzer.getGlobalIdByUriContainerName( - item.uri, - item.name - ); - return globalId - .map((keyword: string) => - this.analyzer.getCallHierarchyItemByKeyword(keyword) - ) - .flat(1) - .map((el) => ({ to: el, fromRanges: [el.range] })); - } - - private onReferences(params: ReferenceParams): Location[] | null { - const document = this.documents.get(params.textDocument.uri); - if (!document) { - return []; - } - - const position = params.position; - const wordRange = this.analyzer.getWordRangeAtPosition(document, position); - if (!wordRange) { - return []; - } - - const word = document.getText(wordRange); - this.writeConsoleMsg(`onReferences: word=${word}`, "info"); - return this.analyzer.getReferences(word, document); - } - private onRenameRequest({ textDocument, position, @@ -388,7 +89,7 @@ export default class QLangServer { (entity) => entity.type === TokenType.IDENTIFIER && offset >= entity.startOffset && - offset <= entity.endOffset + offset <= entity.endOffset, ); if (!symbol) { return null; @@ -399,11 +100,11 @@ export default class QLangServer { (entity) => symbol.image === entity.image && symbolScope && - symbolScope === scope(entity) + symbolScope === scope(entity), ); if (local) { const exists = assign.find( - (entity) => entity.image === newName && symbolScope === scope(entity) + (entity) => entity.image === newName && symbolScope === scope(entity), ); if (exists) { return null; @@ -413,17 +114,17 @@ export default class QLangServer { symbol.image === entity.image && symbolScope && symbolScope === scope(entity) && - entity.type === TokenType.IDENTIFIER + entity.type === TokenType.IDENTIFIER, ); } else { const global = assign.find( - (entity) => !scope(entity) && symbol.image === entity.image + (entity) => !scope(entity) && symbol.image === entity.image, ); if (!global) { return null; } const exists = assign.find( - (entity) => !scope(entity) && entity.image === newName + (entity) => !scope(entity) && entity.image === newName, ); if (exists) { return null; @@ -438,7 +139,7 @@ export default class QLangServer { const scoped = scope(entity); const local = assign.find( (ident) => - ident.image === entity.image && scoped && scope(ident) === scoped + ident.image === entity.image && scoped && scope(ident) === scoped, ); return !local; }); @@ -458,133 +159,4 @@ export default class QLangServer { } return null; } - - private onSignatureHelp({ - textDocument, - position, - }: SignatureHelpParams): SignatureHelp | undefined { - const params: TextDocumentPositionParams = { textDocument, position }; - return undefined; - } - - private getDocumentSettings(resource: string): Thenable { - let result = this.documentSettings.get(resource); - if (!result) { - result = this.connection.workspace.getConfiguration({ - scopeUri: resource, - section: "qLanguageServer", - }); - this.documentSettings.set(resource, result); - } - return result; - } - - private onSemanticsTokens({ - textDocument, - }: SemanticTokensParams): SemanticTokens { - // Get the semantic tokens for the given document. - const tokens = this.analyzer.getSemanticTokens(textDocument?.uri); - // If there are tokens, return them. - return tokens ?? { data: [] }; - } - - private async validateTextDocument( - textDocument: TextDocument - ): Promise { - if (!textDocument.uri.toString().endsWith(".q")) { - return; - } - const text = textDocument.getText(); - const cst = QParser.parse(text); - const diagnostics: Diagnostic[] = []; - let problems = QParser.errors.length; - if (problems > 99) { - problems = 99; - } - for (let i = 0; i < problems; i++) { - const error = QParser.errors[i]; - let offset = -1; - if ("previousToken" in error) { - const token = error.previousToken as IToken; - offset = token.startOffset || -1; - } - if (offset < 0) { - offset = error.token.startOffset || 0; - } - const diagnostic: Diagnostic = { - severity: DiagnosticSeverity.Error, - range: { - start: textDocument.positionAt(offset), - end: textDocument.positionAt(offset), - }, - message: (error.message || error.name).replace(/\s+/g, " "), - source: "kdb.QParser", - }; - diagnostics.push(diagnostic); - } - if (this.settings.linting && problems === 0) { - const ast = analyze(cst); - const results = lint(ast); - for (const result of results) { - const severity = - result.severity === RuleSeverity.ERROR - ? DiagnosticSeverity.Error - : result.severity === RuleSeverity.WARNING - ? DiagnosticSeverity.Warning - : result.severity === RuleSeverity.INFO - ? DiagnosticSeverity.Information - : DiagnosticSeverity.Hint; - for (const problem of result.problems) { - const diagnostic: Diagnostic = { - severity, - range: { - start: textDocument.positionAt(problem.startOffset), - end: textDocument.positionAt(problem.endOffset), - }, - message: result.message, - source: "kdb.QLinter", - }; - diagnostics.push(diagnostic); - } - } - } - this.connection.sendDiagnostics({ uri: textDocument.uri, diagnostics }); - } - - private getKeyword(params: TextDocumentPositionParams): string | undefined { - const document = this.documents.get(params.textDocument.uri); - if (document) { - return this.analyzer.getCurrentWord(params, document); - } else return undefined; - } - - private getEntireKeyword( - params: TextDocumentPositionParams - ): string | undefined { - const document = this.documents.get(params.textDocument.uri); - if (document) { - return this.analyzer.getCurrentEntireWord(params, document); - } else return undefined; - } - - private getCurrentWordRange( - position: Position, - document: TextDocument - ): Range | undefined { - const text = document.getText(); - const wordRegex = /[\w]+(?:[^\w\s\.][\w]+)*/g; - let match; - while ((match = wordRegex.exec(text))) { - const start = match.index; - const end = start + match[0].length; - const range = Range.create( - document.positionAt(start), - document.positionAt(end) - ); - if (range) { - return range; - } - } - return undefined; - } } diff --git a/server/src/server.ts b/server/src/server.ts index bbfe0936..992047fa 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -11,40 +11,17 @@ * specific language governing permissions and limitations under the License. */ -import { - Connection, - DidChangeConfigurationNotification, - InitializeParams, - InitializeResult, - ProposedFeatures, -} from "vscode-languageserver"; +import { Connection, ProposedFeatures } from "vscode-languageserver"; import { createConnection } from "vscode-languageserver/node"; import QLangServer from "./qLangServer"; const connection: Connection = createConnection(ProposedFeatures.all); -let server: QLangServer; -connection.onInitialize( - async (params: InitializeParams): Promise => { - server = await QLangServer.initialize(connection, params); - return { - capabilities: server.capabilities(), - }; - } -); - -connection.onInitialized(() => { - connection.client.register(DidChangeConfigurationNotification.type, { - section: "kdb", - }); - - if (connection.workspace) { - connection.workspace.getConfiguration("kdb").then((settings) => { - if (server) { - server.setSettings(settings); - } - }); - } +connection.onInitialize((params) => { + const server = new QLangServer(connection, params); + return { + capabilities: server.capabilities(), + }; }); connection.listen(); diff --git a/server/src/utils/analyzer.ts b/server/src/utils/analyzer.ts deleted file mode 100644 index 99446a2e..00000000 --- a/server/src/utils/analyzer.ts +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import fs from "graceful-fs"; -import klaw from "klaw"; -import picomatch from "picomatch"; -import { DocumentUri, TextDocument } from "vscode-languageserver-textdocument"; -import { - CallHierarchyItem, - CompletionItem, - CompletionItemKind, - Connection, - Hover, - Location, - Position, - Range, - SemanticTokens, - SemanticTokensBuilder, - SignatureHelp, - SymbolInformation, - SymbolKind, - TextDocumentPositionParams, -} from "vscode-languageserver/node"; -import { URI } from "vscode-uri"; -import { qLangParserItems } from "./qLangParser"; - -export type Keyword = { - containerName: string; - text: string; - type: string; - range: Range; -}; - -export interface GlobalSettings { - maxNumberOfProblems: number; -} - -interface Definition { - uri: string; - range: Range; -} -type nameToGlobalId = Map; -type nameToSymbolInformation = Map; -type nameToCallHierarchyItem = Map; - -export class AnalyzerContent { - static matchFile: (test: string) => boolean; - private uriToTextDocument = new Map(); - private uriToGlobalId = new Map(); - private uriToDefinition = new Map(); - private uriToCallHierarchy = new Map(); - private uriToSemanticTokens = new Map(); - private uriToSymbol = new Map(); - private nameToSignatureHelp = new Map(); - private uriToFileContent = new Map(); - private uriToLoadFile = new Map(); - private connection: Connection; - private workspaceFolder?: URI; - private rootPath: string | undefined | null; - private reservedWord?: string[]; - private qLangSampleParserSrc?: string; - - public static async fromRoot( - connection: Connection, - workspaceFolder: string - ): Promise { - return new AnalyzerContent(connection, workspaceFolder); - } - - public constructor(connection: Connection, workspaceFolder: string) { - this.connection = connection; - this.workspaceFolder = URI.parse(workspaceFolder); - this.rootPath = this.workspaceFolder.fsPath; - this.reservedWord = qLangParserItems.map((item) => item.label); - // this.qLangSampleParserSrc = qLangSampleParser; - } - - // Public Getters - public getAllSymbolsFlattened(): SymbolInformation[] { - return Array.from(this.uriToDefinition.values()) - .flatMap((nameToSymInfo) => Array.from(nameToSymInfo.values())) - .flat(); - } - - public getCallHierarchyItemByKeyword(keyword: string): CallHierarchyItem[] { - const items: CallHierarchyItem[] = []; - for (const callHierarchyMap of this.uriToCallHierarchy.values()) { - for (const item of callHierarchyMap.get(keyword) ?? []) { - items.push(item); - } - } - return items; - } - - public getGlobalIdByUriContainerName( - uri: DocumentUri, - containerName: string - ): string[] { - const containerMap = this.uriToGlobalId.get(uri); - return containerMap?.get(containerName) ?? []; - } - - public async getHoverInfo(keyword: string): Promise { - const ref = qLangParserItems.find( - (item: CompletionItem) => item.label === keyword - ); - if (ref) { - const contents = { - language: "q", - value: `/ ${ref.detail}\n${ref.documentation}` ?? "", - }; - return { contents }; - } - return null; - } - - public getQLangParserRef(): CompletionItem[] { - const qLangParserItemsWithKind: CompletionItem[] = qLangParserItems.map( - (item: CompletionItem) => { - item.kind = item.kind as CompletionItemKind; - return item; - } - ); - - return qLangParserItemsWithKind; - } - - public getSymbols(document: TextDocument): SymbolInformation[] { - const text = document.getText(); - const symbols: SymbolInformation[] = []; - - // Use a regular expression to find function and variable declarations - const declarationRegex = /(function|var|let|const)\s+([a-zA-Z0-9_]+)\s*\(/g; - let match; - while ((match = declarationRegex.exec(text))) { - const start = match.index; - const end = start + match[0].length; - const name = match[2]; - const kind = - match[1] === "function" ? SymbolKind.Function : SymbolKind.Variable; - const range = Range.create( - document.positionAt(start), - document.positionAt(end) - ); - symbols.push(SymbolInformation.create(name, kind, range, document.uri)); - } - - // Use a regular expression to find class declarations - const classRegex = /class\s+([a-zA-Z0-9_]+)/g; - while ((match = classRegex.exec(text))) { - const start = match.index; - const end = start + match[0].length; - const name = match[1]; - const kind = SymbolKind.Class; - const range = Range.create( - document.positionAt(start), - document.positionAt(end) - ); - symbols.push(SymbolInformation.create(name, kind, range, document.uri)); - } - - return symbols; - } - - public getSymbolsByUri(uri: DocumentUri): SymbolInformation[] { - const nameToSymInfos = this.uriToDefinition.get(uri)?.values(); - return nameToSymInfos ? Array.from(nameToSymInfos).flat() : []; - } - - public getSemanticTokens(uri: DocumentUri): SemanticTokens { - const semanticTokensBuilder: SemanticTokensBuilder | undefined = - this.uriToSemanticTokens.get(uri); - return semanticTokensBuilder?.build() ?? { data: [] }; - } - - public getCurrentWord( - textDocumentPosition: TextDocumentPositionParams, - document: TextDocument - ): string | undefined { - if (document) { - const textBeforeCursor = document.getText({ - start: { line: textDocumentPosition.position.line, character: 0 }, - end: textDocumentPosition.position, - }); - const currentWordMatch = textBeforeCursor.match(/([a-zA-Z0-9.]+)$/); - const currentWord = currentWordMatch ? currentWordMatch[1] : ""; - - return currentWord; - } - return undefined; - } - - public getCurrentEntireWord( - textDocumentPosition: TextDocumentPositionParams, - document: TextDocument - ): string { - if (document) { - const text = document.getText(); - const wordRegex = /[\w]+(?:[^\w\s\.][\w]+)*/g; - let match; - while ((match = wordRegex.exec(text))) { - const start = match.index; - const end = start + match[0].length; - if ( - start <= document.offsetAt(textDocumentPosition.position) && - end >= document.offsetAt(textDocumentPosition.position) - ) { - return match[0]; - } - } - } - return ""; - } - - public getCompletionItems(keyword: string): CompletionItem[] { - if (keyword) { - const qLangParserItemsWithKind: CompletionItem[] = qLangParserItems.map( - (item: CompletionItem) => { - item.kind = item.kind as CompletionItemKind; - return item; - } - ); - const completion = qLangParserItemsWithKind.filter( - (item: CompletionItem) => { - return item.label?.startsWith(keyword); - } - ); - return completion; - } - return []; - } - - public getDefinitionByUriKeyword(uri: string, keyword: string): Location[] { - const symbols: SymbolInformation[] = []; - if (symbols.length === 0) { - this.uriToDefinition.forEach((nameToSymInfo) => { - symbols.push(...(nameToSymInfo.get(keyword) || [])); - }); - } - return symbols.map((s) => s.location); - } - - public getReferences(keyword: string, document: TextDocument): Location[] { - const locations = []; - for (const doc of this.uriToTextDocument.values()) { - const text = doc.getText(); - - let offset = 0; - let index = text.indexOf(keyword, offset); - - while (index !== -1) { - const position = doc.positionAt(index); - const range = this.getWordRangeAtPosition(doc, position, keyword); - if ( - range && - range.start.line === position.line && - range.start.character === position.character - ) { - locations.push({ uri: doc.uri, range }); - } - offset = index + keyword.length; - index = text.indexOf(keyword, offset); - } - } - return locations; - } - - public getDefinitions(keyword: string): Definition[] | undefined { - const definitions: Definition[] = []; - - for (const document of this.uriToTextDocument.values()) { - const text = document.getText(); - - let offset = 0; - while (true) { - const index = text.indexOf(keyword, offset); - if (index === -1) { - break; - } - - const range = this.getWordRangeAtPosition( - document, - document.positionAt(index), - keyword - ); - if (range) { - definitions.push({ - uri: document.uri, - range: range, - }); - } - - offset = index + keyword.length; - } - } - - return definitions.length > 0 ? definitions : undefined; - } - - public writeConsoleMsg(msg: string, type: string): void { - switch (type) { - case "error": - this.connection.console.error(msg); - break; - case "warn": - this.connection.console.warn(msg); - break; - case "info": - default: - this.connection.console.info(msg); - break; - } - } - - public getWordRangeAtPosition( - document: TextDocument, - position: Position, - keyword?: string - ): Range | undefined { - const offset = document.offsetAt(position); - const text = document.getText(); - - let start = offset; - while (start > 0 && this.isWordCharacter(text.charAt(start - 1))) { - start--; - } - - let end = 0; - if (keyword) { - end = start + keyword.length; - while (end < text.length && this.isWordCharacter(text.charAt(end))) { - end++; - } - if (end - start !== keyword.length) { - return undefined; - } - - const word = text.substring(start, end); - if (word !== keyword) { - return undefined; - } - if (start > 0 && text.charAt(start - 1) === ".") { - return undefined; - } - } else { - end = offset; - while (end < text.length && this.isWordCharacter(text.charAt(end))) { - end++; - } - } - - if (start === end) { - return undefined; - } - - return Range.create(document.positionAt(start), document.positionAt(end)); - } - - public isWordCharacter(ch: string): boolean { - return /[.\w]/.test(ch); - } - - public analyzeWorkspace({ - globsPattern = ["**/*.q"], - ignorePattern = ["**/tmp"], - }: { globsPattern?: string[]; ignorePattern?: string[] } = {}): void { - if ( - this.rootPath && - fs.existsSync(this.rootPath) && - this.rootPath !== "/" - ) { - this.uriToTextDocument = new Map(); - this.uriToFileContent = new Map(); - this.uriToDefinition = new Map(); - this.uriToSymbol = new Map(); - this.nameToSignatureHelp = new Map(); - - this.writeConsoleMsg(`Checking into the opened Workspace`, "info"); - - const ignoreMatch = picomatch(ignorePattern); - const includeMatch = picomatch(globsPattern); - AnalyzerContent.matchFile = (test: string) => - !ignoreMatch(test) && includeMatch(test); - const qFiles: string[] = []; - klaw(this.rootPath, { filter: (item) => !ignoreMatch(item) }) - .on("error", (err: Error) => { - this.writeConsoleMsg( - `Error when we tried to analyze the Workspace`, - "error" - ); - this.writeConsoleMsg(err.message, "error"); - }) - .on("data", (item) => { - if (includeMatch(item.path)) qFiles.push(item.path); - }) - .on("end", () => { - if (qFiles.length == 0) { - this.writeConsoleMsg("No q files found", "warn"); - } else { - this.writeConsoleMsg(`${qFiles.length} q files founded.`, "info"); - qFiles.forEach((filepath: string) => - this.analyzeDocument(filepath) - ); - } - }); - } - } - - public analyzeDocument(filepath: string): void { - const uri = URI.file(filepath).toString(); - const text = fs.readFileSync(filepath, "utf8"); - const document = TextDocument.create(uri, "q", 0, text); - this.uriToTextDocument.set(uri, document); - this.uriToFileContent.set(uri, text); - } -} diff --git a/server/src/utils/antlrGrammars/q.interp b/server/src/utils/antlrGrammars/q.interp deleted file mode 100644 index 94e38618..00000000 --- a/server/src/utils/antlrGrammars/q.interp +++ /dev/null @@ -1,520 +0,0 @@ -token literal names: -null -';' -'(' -')' -'abs' -'acos' -'all' -'any' -'asin' -'atan' -'avg' -'ceiling' -'cos' -'count' -'cross' -',' -'delete' -'deltas' -'dev' -'distinct' -'div' -'drop' -'each' -'enlist' -'eval' -'except' -'exec' -'exp' -'fby' -'fill' -'first' -'flip' -'floor' -'get' -'group' -'gtime' -'hclose' -'hcount' -'hdel' -'hopen' -'hsym' -'iasc' -'idesc' -'ij' -'in' -'insert' -'inter' -'inv' -'keys' -'last' -'like' -'list' -'lj' -'load' -'log' -'lower' -'lsq' -'ltime' -'ltrim' -'mavg' -'max' -'maxs' -'mcount' -'md5' -'mdev' -'med' -'meta' -'min' -'mins' -'mmax' -'mmin' -'mmu' -'mod' -'msum' -'neg' -'next' -'null' -'over' -'parse' -'peach' -'pj' -'plist' -'prd' -'prev' -'prior' -'rand' -'rank' -'ratios' -'raze' -'read0' -'read1' -'reciprocal' -'reverse' -'rload' -'rotate' -'rsave' -'rtrim' -'save' -'scan' -'select' -'set' -'show' -'signum' -'sin' -'sqrt' -'ssr' -'string' -'sublist' -'sum' -'sums' -'sv' -'system' -'tables' -'tan' -'til' -'trim' -'type' -'uj' -'ungroup' -'union' -'update' -'upper' -'upsert' -'value' -'var' -'view' -'vs' -'wavg' -'where' -'within' -'wj1' -'wj2' -'ww' -'xasc' -'xbar' -'xcols' -'xdesc' -'xexp' -'xgroup' -'xkey' -'xlog' -'xprev' -'xrank' -'xranked' -'xrecs' -'xrows' -'xss' -'xtype' -'yield' -'zip' -'+' -'-' -'*' -'%' -'=' -'<>' -'<' -'<=' -'>' -'>=' -'and' -'or' -'not' -'int' -'long' -'float' -'double' -'char' -'symbol' -'timestamp' -null -null -null -null -null -null - -token symbolic names: -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -PLUS -MINUS -MULTIPLY -DIVIDE -EQUALS -NOT_EQUALS -LESS_THAN -LESS_THAN_OR_EQUAL -GREATER_THAN -GREATER_THAN_OR_EQUAL -AND -OR -NOT -INT -LONG -FLOAT -DOUBLE -CHAR -SYMBOL -TIMESTAMP -ID -DIGIT -NUMBER -STRING -ESC -WS - -rule names: -variable_declaration -storage_type -variable_name -expression -or_expression -and_expression -comparison_expression -additive_expression -multiplicative_expression -unary_expression -primary_expression -abs_function -acos_function -all_function -and_function -any_function -asin_function -atan_function -avg_function -ceiling_function -cos_function -count_function -cross_function -delete_function -deltas_function -dev_function -distinct_function -div_function -drop_function -each_function -enlist_function -eval_function -except_function -exec_function -exp_function -fby_function -fill_function -first_function -flip_function -floor_function -get_function -group_function -gtime_function -hclose_function -hcount_function -hdel_function -hopen_function -hsym_function -iasc_function -idesc_function -ij_function -in_function -insert_function -inter_function -inv_function -keys_function -last_function -like_function -list_function -lj_function -load_function -log_function -lower_function -lsq_function -ltime_function -ltrim_function -mavg_function -max_function -maxs_function -mcount_function -md5_function -mdev_function -med_function -meta_function -min_function -mins_function -mmax_function -mmin_function -mmu_function -mod_function -msum_function -neg_function -next_function -not_function -null_function -or_function -over_function -parse_function -peach_function -pj_function -plist_function -prd_function -prev_function -prior_function -rand_function -rank_function -ratios_function -raze_function -read0_function -read1_function -reciprocal_function -reverse_function -rload_function -rotate_function -rsave_function -rtrim_function -save_function -scan_function -select_function -set_function -show_function -signum_function -sin_function -sqrt_function -ssr_function -string_function -sublist_function -sum_function -sums_function -sv_function -system_function -tables_function -tan_function -til_function -trim_function -type_function -uj_function -ungroup_function -union_function -update_function -upper_function -upsert_function -value_function -var_function -view_function -vs_function -wavg_function -where_function -within_function -wj1_function -wj2_function -ww_function -xasc_function -xbar_function -xcols_function -xdesc_function -xexp_function -xgroup_function -xkey_function -xlog_function -xprev_function -xrank_function -xranked_function -xrecs_function -xrows_function -xss_function -xtype_function -yield_function -zip_function - - -atn: -[4, 1, 175, 1203, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 5, 4, 334, 8, 4, 10, 4, 12, 4, 337, 9, 4, 1, 5, 1, 5, 1, 5, 5, 5, 342, 8, 5, 10, 5, 12, 5, 345, 9, 5, 1, 6, 1, 6, 1, 6, 5, 6, 350, 8, 6, 10, 6, 12, 6, 353, 9, 6, 1, 7, 1, 7, 1, 7, 5, 7, 358, 8, 7, 10, 7, 12, 7, 361, 9, 7, 1, 8, 1, 8, 1, 8, 5, 8, 366, 8, 8, 10, 8, 12, 8, 369, 9, 8, 1, 9, 1, 9, 1, 9, 3, 9, 374, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 383, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, 136, 1, 136, 1, 136, 1, 136, 1, 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 138, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, 1, 144, 1, 144, 1, 145, 1, 145, 1, 145, 1, 145, 1, 145, 1, 146, 1, 146, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 148, 1, 148, 1, 148, 1, 148, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 149, 1, 149, 1, 149, 1, 150, 1, 150, 1, 150, 1, 150, 1, 150, 1, 151, 1, 151, 1, 151, 1, 151, 1, 151, 1, 152, 1, 152, 1, 152, 1, 152, 1, 152, 1, 153, 1, 153, 1, 153, 1, 153, 1, 153, 1, 154, 1, 154, 1, 154, 1, 154, 1, 154, 1, 155, 1, 155, 1, 155, 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 0, 0, 159, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 0, 1, 1, 0, 163, 169, 1052, 0, 318, 1, 0, 0, 0, 2, 324, 1, 0, 0, 0, 4, 326, 1, 0, 0, 0, 6, 328, 1, 0, 0, 0, 8, 330, 1, 0, 0, 0, 10, 338, 1, 0, 0, 0, 12, 346, 1, 0, 0, 0, 14, 354, 1, 0, 0, 0, 16, 362, 1, 0, 0, 0, 18, 373, 1, 0, 0, 0, 20, 382, 1, 0, 0, 0, 22, 384, 1, 0, 0, 0, 24, 389, 1, 0, 0, 0, 26, 394, 1, 0, 0, 0, 28, 399, 1, 0, 0, 0, 30, 404, 1, 0, 0, 0, 32, 409, 1, 0, 0, 0, 34, 414, 1, 0, 0, 0, 36, 419, 1, 0, 0, 0, 38, 424, 1, 0, 0, 0, 40, 429, 1, 0, 0, 0, 42, 434, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 446, 1, 0, 0, 0, 48, 451, 1, 0, 0, 0, 50, 456, 1, 0, 0, 0, 52, 461, 1, 0, 0, 0, 54, 466, 1, 0, 0, 0, 56, 473, 1, 0, 0, 0, 58, 478, 1, 0, 0, 0, 60, 483, 1, 0, 0, 0, 62, 488, 1, 0, 0, 0, 64, 493, 1, 0, 0, 0, 66, 500, 1, 0, 0, 0, 68, 507, 1, 0, 0, 0, 70, 512, 1, 0, 0, 0, 72, 517, 1, 0, 0, 0, 74, 524, 1, 0, 0, 0, 76, 529, 1, 0, 0, 0, 78, 534, 1, 0, 0, 0, 80, 539, 1, 0, 0, 0, 82, 544, 1, 0, 0, 0, 84, 551, 1, 0, 0, 0, 86, 556, 1, 0, 0, 0, 88, 561, 1, 0, 0, 0, 90, 566, 1, 0, 0, 0, 92, 573, 1, 0, 0, 0, 94, 578, 1, 0, 0, 0, 96, 583, 1, 0, 0, 0, 98, 588, 1, 0, 0, 0, 100, 593, 1, 0, 0, 0, 102, 600, 1, 0, 0, 0, 104, 607, 1, 0, 0, 0, 106, 614, 1, 0, 0, 0, 108, 621, 1, 0, 0, 0, 110, 626, 1, 0, 0, 0, 112, 631, 1, 0, 0, 0, 114, 636, 1, 0, 0, 0, 116, 643, 1, 0, 0, 0, 118, 648, 1, 0, 0, 0, 120, 655, 1, 0, 0, 0, 122, 660, 1, 0, 0, 0, 124, 665, 1, 0, 0, 0, 126, 670, 1, 0, 0, 0, 128, 677, 1, 0, 0, 0, 130, 682, 1, 0, 0, 0, 132, 687, 1, 0, 0, 0, 134, 694, 1, 0, 0, 0, 136, 699, 1, 0, 0, 0, 138, 704, 1, 0, 0, 0, 140, 709, 1, 0, 0, 0, 142, 714, 1, 0, 0, 0, 144, 721, 1, 0, 0, 0, 146, 726, 1, 0, 0, 0, 148, 731, 1, 0, 0, 0, 150, 736, 1, 0, 0, 0, 152, 741, 1, 0, 0, 0, 154, 748, 1, 0, 0, 0, 156, 755, 1, 0, 0, 0, 158, 760, 1, 0, 0, 0, 160, 767, 1, 0, 0, 0, 162, 772, 1, 0, 0, 0, 164, 777, 1, 0, 0, 0, 166, 782, 1, 0, 0, 0, 168, 787, 1, 0, 0, 0, 170, 792, 1, 0, 0, 0, 172, 797, 1, 0, 0, 0, 174, 802, 1, 0, 0, 0, 176, 807, 1, 0, 0, 0, 178, 812, 1, 0, 0, 0, 180, 819, 1, 0, 0, 0, 182, 824, 1, 0, 0, 0, 184, 829, 1, 0, 0, 0, 186, 834, 1, 0, 0, 0, 188, 839, 1, 0, 0, 0, 190, 844, 1, 0, 0, 0, 192, 849, 1, 0, 0, 0, 194, 854, 1, 0, 0, 0, 196, 859, 1, 0, 0, 0, 198, 864, 1, 0, 0, 0, 200, 869, 1, 0, 0, 0, 202, 874, 1, 0, 0, 0, 204, 879, 1, 0, 0, 0, 206, 884, 1, 0, 0, 0, 208, 891, 1, 0, 0, 0, 210, 898, 1, 0, 0, 0, 212, 903, 1, 0, 0, 0, 214, 910, 1, 0, 0, 0, 216, 917, 1, 0, 0, 0, 218, 922, 1, 0, 0, 0, 220, 929, 1, 0, 0, 0, 222, 934, 1, 0, 0, 0, 224, 939, 1, 0, 0, 0, 226, 944, 1, 0, 0, 0, 228, 949, 1, 0, 0, 0, 230, 956, 1, 0, 0, 0, 232, 961, 1, 0, 0, 0, 234, 968, 1, 0, 0, 0, 236, 973, 1, 0, 0, 0, 238, 978, 1, 0, 0, 0, 240, 983, 1, 0, 0, 0, 242, 988, 1, 0, 0, 0, 244, 993, 1, 0, 0, 0, 246, 998, 1, 0, 0, 0, 248, 1003, 1, 0, 0, 0, 250, 1008, 1, 0, 0, 0, 252, 1013, 1, 0, 0, 0, 254, 1020, 1, 0, 0, 0, 256, 1025, 1, 0, 0, 0, 258, 1032, 1, 0, 0, 0, 260, 1039, 1, 0, 0, 0, 262, 1044, 1, 0, 0, 0, 264, 1051, 1, 0, 0, 0, 266, 1056, 1, 0, 0, 0, 268, 1061, 1, 0, 0, 0, 270, 1066, 1, 0, 0, 0, 272, 1071, 1, 0, 0, 0, 274, 1078, 1, 0, 0, 0, 276, 1083, 1, 0, 0, 0, 278, 1090, 1, 0, 0, 0, 280, 1097, 1, 0, 0, 0, 282, 1104, 1, 0, 0, 0, 284, 1109, 1, 0, 0, 0, 286, 1114, 1, 0, 0, 0, 288, 1121, 1, 0, 0, 0, 290, 1126, 1, 0, 0, 0, 292, 1131, 1, 0, 0, 0, 294, 1136, 1, 0, 0, 0, 296, 1143, 1, 0, 0, 0, 298, 1150, 1, 0, 0, 0, 300, 1155, 1, 0, 0, 0, 302, 1160, 1, 0, 0, 0, 304, 1165, 1, 0, 0, 0, 306, 1170, 1, 0, 0, 0, 308, 1175, 1, 0, 0, 0, 310, 1180, 1, 0, 0, 0, 312, 1185, 1, 0, 0, 0, 314, 1190, 1, 0, 0, 0, 316, 1195, 1, 0, 0, 0, 318, 319, 3, 2, 1, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 154, 0, 0, 321, 322, 3, 6, 3, 0, 322, 323, 5, 1, 0, 0, 323, 1, 1, 0, 0, 0, 324, 325, 7, 0, 0, 0, 325, 3, 1, 0, 0, 0, 326, 327, 5, 170, 0, 0, 327, 5, 1, 0, 0, 0, 328, 329, 3, 8, 4, 0, 329, 7, 1, 0, 0, 0, 330, 335, 3, 10, 5, 0, 331, 332, 5, 161, 0, 0, 332, 334, 3, 10, 5, 0, 333, 331, 1, 0, 0, 0, 334, 337, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 9, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 338, 343, 3, 12, 6, 0, 339, 340, 5, 160, 0, 0, 340, 342, 3, 12, 6, 0, 341, 339, 1, 0, 0, 0, 342, 345, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 11, 1, 0, 0, 0, 345, 343, 1, 0, 0, 0, 346, 351, 3, 14, 7, 0, 347, 348, 5, 154, 0, 0, 348, 350, 3, 14, 7, 0, 349, 347, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 13, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 359, 3, 16, 8, 0, 355, 356, 5, 150, 0, 0, 356, 358, 3, 16, 8, 0, 357, 355, 1, 0, 0, 0, 358, 361, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 15, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 362, 367, 3, 18, 9, 0, 363, 364, 5, 152, 0, 0, 364, 366, 3, 18, 9, 0, 365, 363, 1, 0, 0, 0, 366, 369, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 17, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 370, 374, 3, 20, 10, 0, 371, 372, 5, 151, 0, 0, 372, 374, 3, 20, 10, 0, 373, 370, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 19, 1, 0, 0, 0, 375, 383, 5, 172, 0, 0, 376, 383, 5, 173, 0, 0, 377, 383, 3, 4, 2, 0, 378, 379, 5, 2, 0, 0, 379, 380, 3, 6, 3, 0, 380, 381, 5, 3, 0, 0, 381, 383, 1, 0, 0, 0, 382, 375, 1, 0, 0, 0, 382, 376, 1, 0, 0, 0, 382, 377, 1, 0, 0, 0, 382, 378, 1, 0, 0, 0, 383, 21, 1, 0, 0, 0, 384, 385, 5, 4, 0, 0, 385, 386, 5, 2, 0, 0, 386, 387, 3, 6, 3, 0, 387, 388, 5, 3, 0, 0, 388, 23, 1, 0, 0, 0, 389, 390, 5, 5, 0, 0, 390, 391, 5, 2, 0, 0, 391, 392, 3, 6, 3, 0, 392, 393, 5, 3, 0, 0, 393, 25, 1, 0, 0, 0, 394, 395, 5, 6, 0, 0, 395, 396, 5, 2, 0, 0, 396, 397, 3, 6, 3, 0, 397, 398, 5, 3, 0, 0, 398, 27, 1, 0, 0, 0, 399, 400, 5, 160, 0, 0, 400, 401, 5, 2, 0, 0, 401, 402, 3, 6, 3, 0, 402, 403, 5, 3, 0, 0, 403, 29, 1, 0, 0, 0, 404, 405, 5, 7, 0, 0, 405, 406, 5, 2, 0, 0, 406, 407, 3, 6, 3, 0, 407, 408, 5, 3, 0, 0, 408, 31, 1, 0, 0, 0, 409, 410, 5, 8, 0, 0, 410, 411, 5, 2, 0, 0, 411, 412, 3, 6, 3, 0, 412, 413, 5, 3, 0, 0, 413, 33, 1, 0, 0, 0, 414, 415, 5, 9, 0, 0, 415, 416, 5, 2, 0, 0, 416, 417, 3, 6, 3, 0, 417, 418, 5, 3, 0, 0, 418, 35, 1, 0, 0, 0, 419, 420, 5, 10, 0, 0, 420, 421, 5, 2, 0, 0, 421, 422, 3, 6, 3, 0, 422, 423, 5, 3, 0, 0, 423, 37, 1, 0, 0, 0, 424, 425, 5, 11, 0, 0, 425, 426, 5, 2, 0, 0, 426, 427, 3, 6, 3, 0, 427, 428, 5, 3, 0, 0, 428, 39, 1, 0, 0, 0, 429, 430, 5, 12, 0, 0, 430, 431, 5, 2, 0, 0, 431, 432, 3, 6, 3, 0, 432, 433, 5, 3, 0, 0, 433, 41, 1, 0, 0, 0, 434, 435, 5, 13, 0, 0, 435, 436, 5, 2, 0, 0, 436, 437, 3, 6, 3, 0, 437, 438, 5, 3, 0, 0, 438, 43, 1, 0, 0, 0, 439, 440, 5, 14, 0, 0, 440, 441, 5, 2, 0, 0, 441, 442, 3, 6, 3, 0, 442, 443, 5, 15, 0, 0, 443, 444, 3, 6, 3, 0, 444, 445, 5, 3, 0, 0, 445, 45, 1, 0, 0, 0, 446, 447, 5, 16, 0, 0, 447, 448, 5, 2, 0, 0, 448, 449, 3, 6, 3, 0, 449, 450, 5, 3, 0, 0, 450, 47, 1, 0, 0, 0, 451, 452, 5, 17, 0, 0, 452, 453, 5, 2, 0, 0, 453, 454, 3, 6, 3, 0, 454, 455, 5, 3, 0, 0, 455, 49, 1, 0, 0, 0, 456, 457, 5, 18, 0, 0, 457, 458, 5, 2, 0, 0, 458, 459, 3, 6, 3, 0, 459, 460, 5, 3, 0, 0, 460, 51, 1, 0, 0, 0, 461, 462, 5, 19, 0, 0, 462, 463, 5, 2, 0, 0, 463, 464, 3, 6, 3, 0, 464, 465, 5, 3, 0, 0, 465, 53, 1, 0, 0, 0, 466, 467, 5, 20, 0, 0, 467, 468, 5, 2, 0, 0, 468, 469, 3, 6, 3, 0, 469, 470, 5, 15, 0, 0, 470, 471, 3, 6, 3, 0, 471, 472, 5, 3, 0, 0, 472, 55, 1, 0, 0, 0, 473, 474, 5, 21, 0, 0, 474, 475, 5, 2, 0, 0, 475, 476, 3, 6, 3, 0, 476, 477, 5, 3, 0, 0, 477, 57, 1, 0, 0, 0, 478, 479, 5, 22, 0, 0, 479, 480, 5, 2, 0, 0, 480, 481, 3, 6, 3, 0, 481, 482, 5, 3, 0, 0, 482, 59, 1, 0, 0, 0, 483, 484, 5, 23, 0, 0, 484, 485, 5, 2, 0, 0, 485, 486, 3, 6, 3, 0, 486, 487, 5, 3, 0, 0, 487, 61, 1, 0, 0, 0, 488, 489, 5, 24, 0, 0, 489, 490, 5, 2, 0, 0, 490, 491, 3, 6, 3, 0, 491, 492, 5, 3, 0, 0, 492, 63, 1, 0, 0, 0, 493, 494, 5, 25, 0, 0, 494, 495, 5, 2, 0, 0, 495, 496, 3, 6, 3, 0, 496, 497, 5, 15, 0, 0, 497, 498, 3, 6, 3, 0, 498, 499, 5, 3, 0, 0, 499, 65, 1, 0, 0, 0, 500, 501, 5, 26, 0, 0, 501, 502, 5, 2, 0, 0, 502, 503, 3, 6, 3, 0, 503, 504, 5, 15, 0, 0, 504, 505, 3, 6, 3, 0, 505, 506, 5, 3, 0, 0, 506, 67, 1, 0, 0, 0, 507, 508, 5, 27, 0, 0, 508, 509, 5, 2, 0, 0, 509, 510, 3, 6, 3, 0, 510, 511, 5, 3, 0, 0, 511, 69, 1, 0, 0, 0, 512, 513, 5, 28, 0, 0, 513, 514, 5, 2, 0, 0, 514, 515, 3, 6, 3, 0, 515, 516, 5, 3, 0, 0, 516, 71, 1, 0, 0, 0, 517, 518, 5, 29, 0, 0, 518, 519, 5, 2, 0, 0, 519, 520, 3, 6, 3, 0, 520, 521, 5, 15, 0, 0, 521, 522, 3, 6, 3, 0, 522, 523, 5, 3, 0, 0, 523, 73, 1, 0, 0, 0, 524, 525, 5, 30, 0, 0, 525, 526, 5, 2, 0, 0, 526, 527, 3, 6, 3, 0, 527, 528, 5, 3, 0, 0, 528, 75, 1, 0, 0, 0, 529, 530, 5, 31, 0, 0, 530, 531, 5, 2, 0, 0, 531, 532, 3, 6, 3, 0, 532, 533, 5, 3, 0, 0, 533, 77, 1, 0, 0, 0, 534, 535, 5, 32, 0, 0, 535, 536, 5, 2, 0, 0, 536, 537, 3, 6, 3, 0, 537, 538, 5, 3, 0, 0, 538, 79, 1, 0, 0, 0, 539, 540, 5, 33, 0, 0, 540, 541, 5, 2, 0, 0, 541, 542, 3, 6, 3, 0, 542, 543, 5, 3, 0, 0, 543, 81, 1, 0, 0, 0, 544, 545, 5, 34, 0, 0, 545, 546, 5, 2, 0, 0, 546, 547, 3, 6, 3, 0, 547, 548, 5, 15, 0, 0, 548, 549, 3, 6, 3, 0, 549, 550, 5, 3, 0, 0, 550, 83, 1, 0, 0, 0, 551, 552, 5, 35, 0, 0, 552, 553, 5, 2, 0, 0, 553, 554, 3, 6, 3, 0, 554, 555, 5, 3, 0, 0, 555, 85, 1, 0, 0, 0, 556, 557, 5, 36, 0, 0, 557, 558, 5, 2, 0, 0, 558, 559, 3, 6, 3, 0, 559, 560, 5, 3, 0, 0, 560, 87, 1, 0, 0, 0, 561, 562, 5, 37, 0, 0, 562, 563, 5, 2, 0, 0, 563, 564, 3, 6, 3, 0, 564, 565, 5, 3, 0, 0, 565, 89, 1, 0, 0, 0, 566, 567, 5, 38, 0, 0, 567, 568, 5, 2, 0, 0, 568, 569, 3, 6, 3, 0, 569, 570, 5, 15, 0, 0, 570, 571, 3, 6, 3, 0, 571, 572, 5, 3, 0, 0, 572, 91, 1, 0, 0, 0, 573, 574, 5, 39, 0, 0, 574, 575, 5, 2, 0, 0, 575, 576, 3, 6, 3, 0, 576, 577, 5, 3, 0, 0, 577, 93, 1, 0, 0, 0, 578, 579, 5, 40, 0, 0, 579, 580, 5, 2, 0, 0, 580, 581, 3, 6, 3, 0, 581, 582, 5, 3, 0, 0, 582, 95, 1, 0, 0, 0, 583, 584, 5, 41, 0, 0, 584, 585, 5, 2, 0, 0, 585, 586, 3, 6, 3, 0, 586, 587, 5, 3, 0, 0, 587, 97, 1, 0, 0, 0, 588, 589, 5, 42, 0, 0, 589, 590, 5, 2, 0, 0, 590, 591, 3, 6, 3, 0, 591, 592, 5, 3, 0, 0, 592, 99, 1, 0, 0, 0, 593, 594, 5, 43, 0, 0, 594, 595, 5, 2, 0, 0, 595, 596, 3, 6, 3, 0, 596, 597, 5, 15, 0, 0, 597, 598, 3, 6, 3, 0, 598, 599, 5, 3, 0, 0, 599, 101, 1, 0, 0, 0, 600, 601, 5, 44, 0, 0, 601, 602, 5, 2, 0, 0, 602, 603, 3, 6, 3, 0, 603, 604, 5, 15, 0, 0, 604, 605, 3, 6, 3, 0, 605, 606, 5, 3, 0, 0, 606, 103, 1, 0, 0, 0, 607, 608, 5, 45, 0, 0, 608, 609, 5, 2, 0, 0, 609, 610, 3, 6, 3, 0, 610, 611, 5, 15, 0, 0, 611, 612, 3, 6, 3, 0, 612, 613, 5, 3, 0, 0, 613, 105, 1, 0, 0, 0, 614, 615, 5, 46, 0, 0, 615, 616, 5, 2, 0, 0, 616, 617, 3, 6, 3, 0, 617, 618, 5, 15, 0, 0, 618, 619, 3, 6, 3, 0, 619, 620, 5, 3, 0, 0, 620, 107, 1, 0, 0, 0, 621, 622, 5, 47, 0, 0, 622, 623, 5, 2, 0, 0, 623, 624, 3, 6, 3, 0, 624, 625, 5, 3, 0, 0, 625, 109, 1, 0, 0, 0, 626, 627, 5, 48, 0, 0, 627, 628, 5, 2, 0, 0, 628, 629, 3, 6, 3, 0, 629, 630, 5, 3, 0, 0, 630, 111, 1, 0, 0, 0, 631, 632, 5, 49, 0, 0, 632, 633, 5, 2, 0, 0, 633, 634, 3, 6, 3, 0, 634, 635, 5, 3, 0, 0, 635, 113, 1, 0, 0, 0, 636, 637, 5, 50, 0, 0, 637, 638, 5, 2, 0, 0, 638, 639, 3, 6, 3, 0, 639, 640, 5, 15, 0, 0, 640, 641, 3, 6, 3, 0, 641, 642, 5, 3, 0, 0, 642, 115, 1, 0, 0, 0, 643, 644, 5, 51, 0, 0, 644, 645, 5, 2, 0, 0, 645, 646, 3, 6, 3, 0, 646, 647, 5, 3, 0, 0, 647, 117, 1, 0, 0, 0, 648, 649, 5, 52, 0, 0, 649, 650, 5, 2, 0, 0, 650, 651, 3, 6, 3, 0, 651, 652, 5, 15, 0, 0, 652, 653, 3, 6, 3, 0, 653, 654, 5, 3, 0, 0, 654, 119, 1, 0, 0, 0, 655, 656, 5, 53, 0, 0, 656, 657, 5, 2, 0, 0, 657, 658, 3, 6, 3, 0, 658, 659, 5, 3, 0, 0, 659, 121, 1, 0, 0, 0, 660, 661, 5, 54, 0, 0, 661, 662, 5, 2, 0, 0, 662, 663, 3, 6, 3, 0, 663, 664, 5, 3, 0, 0, 664, 123, 1, 0, 0, 0, 665, 666, 5, 55, 0, 0, 666, 667, 5, 2, 0, 0, 667, 668, 3, 6, 3, 0, 668, 669, 5, 3, 0, 0, 669, 125, 1, 0, 0, 0, 670, 671, 5, 56, 0, 0, 671, 672, 5, 2, 0, 0, 672, 673, 3, 6, 3, 0, 673, 674, 5, 15, 0, 0, 674, 675, 3, 6, 3, 0, 675, 676, 5, 3, 0, 0, 676, 127, 1, 0, 0, 0, 677, 678, 5, 57, 0, 0, 678, 679, 5, 2, 0, 0, 679, 680, 3, 6, 3, 0, 680, 681, 5, 3, 0, 0, 681, 129, 1, 0, 0, 0, 682, 683, 5, 58, 0, 0, 683, 684, 5, 2, 0, 0, 684, 685, 3, 6, 3, 0, 685, 686, 5, 3, 0, 0, 686, 131, 1, 0, 0, 0, 687, 688, 5, 59, 0, 0, 688, 689, 5, 2, 0, 0, 689, 690, 3, 6, 3, 0, 690, 691, 5, 15, 0, 0, 691, 692, 3, 6, 3, 0, 692, 693, 5, 3, 0, 0, 693, 133, 1, 0, 0, 0, 694, 695, 5, 60, 0, 0, 695, 696, 5, 2, 0, 0, 696, 697, 3, 6, 3, 0, 697, 698, 5, 3, 0, 0, 698, 135, 1, 0, 0, 0, 699, 700, 5, 61, 0, 0, 700, 701, 5, 2, 0, 0, 701, 702, 3, 6, 3, 0, 702, 703, 5, 3, 0, 0, 703, 137, 1, 0, 0, 0, 704, 705, 5, 62, 0, 0, 705, 706, 5, 2, 0, 0, 706, 707, 3, 6, 3, 0, 707, 708, 5, 3, 0, 0, 708, 139, 1, 0, 0, 0, 709, 710, 5, 63, 0, 0, 710, 711, 5, 2, 0, 0, 711, 712, 3, 6, 3, 0, 712, 713, 5, 3, 0, 0, 713, 141, 1, 0, 0, 0, 714, 715, 5, 64, 0, 0, 715, 716, 5, 2, 0, 0, 716, 717, 3, 6, 3, 0, 717, 718, 5, 15, 0, 0, 718, 719, 3, 6, 3, 0, 719, 720, 5, 3, 0, 0, 720, 143, 1, 0, 0, 0, 721, 722, 5, 65, 0, 0, 722, 723, 5, 2, 0, 0, 723, 724, 3, 6, 3, 0, 724, 725, 5, 3, 0, 0, 725, 145, 1, 0, 0, 0, 726, 727, 5, 66, 0, 0, 727, 728, 5, 2, 0, 0, 728, 729, 3, 6, 3, 0, 729, 730, 5, 3, 0, 0, 730, 147, 1, 0, 0, 0, 731, 732, 5, 67, 0, 0, 732, 733, 5, 2, 0, 0, 733, 734, 3, 6, 3, 0, 734, 735, 5, 3, 0, 0, 735, 149, 1, 0, 0, 0, 736, 737, 5, 68, 0, 0, 737, 738, 5, 2, 0, 0, 738, 739, 3, 6, 3, 0, 739, 740, 5, 3, 0, 0, 740, 151, 1, 0, 0, 0, 741, 742, 5, 69, 0, 0, 742, 743, 5, 2, 0, 0, 743, 744, 3, 6, 3, 0, 744, 745, 5, 15, 0, 0, 745, 746, 3, 6, 3, 0, 746, 747, 5, 3, 0, 0, 747, 153, 1, 0, 0, 0, 748, 749, 5, 70, 0, 0, 749, 750, 5, 2, 0, 0, 750, 751, 3, 6, 3, 0, 751, 752, 5, 15, 0, 0, 752, 753, 3, 6, 3, 0, 753, 754, 5, 3, 0, 0, 754, 155, 1, 0, 0, 0, 755, 756, 5, 71, 0, 0, 756, 757, 5, 2, 0, 0, 757, 758, 3, 6, 3, 0, 758, 759, 5, 3, 0, 0, 759, 157, 1, 0, 0, 0, 760, 761, 5, 72, 0, 0, 761, 762, 5, 2, 0, 0, 762, 763, 3, 6, 3, 0, 763, 764, 5, 15, 0, 0, 764, 765, 3, 6, 3, 0, 765, 766, 5, 3, 0, 0, 766, 159, 1, 0, 0, 0, 767, 768, 5, 73, 0, 0, 768, 769, 5, 2, 0, 0, 769, 770, 3, 6, 3, 0, 770, 771, 5, 3, 0, 0, 771, 161, 1, 0, 0, 0, 772, 773, 5, 74, 0, 0, 773, 774, 5, 2, 0, 0, 774, 775, 3, 6, 3, 0, 775, 776, 5, 3, 0, 0, 776, 163, 1, 0, 0, 0, 777, 778, 5, 75, 0, 0, 778, 779, 5, 2, 0, 0, 779, 780, 3, 6, 3, 0, 780, 781, 5, 3, 0, 0, 781, 165, 1, 0, 0, 0, 782, 783, 5, 162, 0, 0, 783, 784, 5, 2, 0, 0, 784, 785, 3, 6, 3, 0, 785, 786, 5, 3, 0, 0, 786, 167, 1, 0, 0, 0, 787, 788, 5, 76, 0, 0, 788, 789, 5, 2, 0, 0, 789, 790, 3, 6, 3, 0, 790, 791, 5, 3, 0, 0, 791, 169, 1, 0, 0, 0, 792, 793, 5, 161, 0, 0, 793, 794, 5, 2, 0, 0, 794, 795, 3, 6, 3, 0, 795, 796, 5, 3, 0, 0, 796, 171, 1, 0, 0, 0, 797, 798, 5, 77, 0, 0, 798, 799, 5, 2, 0, 0, 799, 800, 3, 6, 3, 0, 800, 801, 5, 3, 0, 0, 801, 173, 1, 0, 0, 0, 802, 803, 5, 78, 0, 0, 803, 804, 5, 2, 0, 0, 804, 805, 3, 6, 3, 0, 805, 806, 5, 3, 0, 0, 806, 175, 1, 0, 0, 0, 807, 808, 5, 79, 0, 0, 808, 809, 5, 2, 0, 0, 809, 810, 3, 6, 3, 0, 810, 811, 5, 3, 0, 0, 811, 177, 1, 0, 0, 0, 812, 813, 5, 80, 0, 0, 813, 814, 5, 2, 0, 0, 814, 815, 3, 6, 3, 0, 815, 816, 5, 15, 0, 0, 816, 817, 3, 6, 3, 0, 817, 818, 5, 3, 0, 0, 818, 179, 1, 0, 0, 0, 819, 820, 5, 81, 0, 0, 820, 821, 5, 2, 0, 0, 821, 822, 3, 6, 3, 0, 822, 823, 5, 3, 0, 0, 823, 181, 1, 0, 0, 0, 824, 825, 5, 82, 0, 0, 825, 826, 5, 2, 0, 0, 826, 827, 3, 6, 3, 0, 827, 828, 5, 3, 0, 0, 828, 183, 1, 0, 0, 0, 829, 830, 5, 83, 0, 0, 830, 831, 5, 2, 0, 0, 831, 832, 3, 6, 3, 0, 832, 833, 5, 3, 0, 0, 833, 185, 1, 0, 0, 0, 834, 835, 5, 84, 0, 0, 835, 836, 5, 2, 0, 0, 836, 837, 3, 6, 3, 0, 837, 838, 5, 3, 0, 0, 838, 187, 1, 0, 0, 0, 839, 840, 5, 85, 0, 0, 840, 841, 5, 2, 0, 0, 841, 842, 3, 6, 3, 0, 842, 843, 5, 3, 0, 0, 843, 189, 1, 0, 0, 0, 844, 845, 5, 86, 0, 0, 845, 846, 5, 2, 0, 0, 846, 847, 3, 6, 3, 0, 847, 848, 5, 3, 0, 0, 848, 191, 1, 0, 0, 0, 849, 850, 5, 87, 0, 0, 850, 851, 5, 2, 0, 0, 851, 852, 3, 6, 3, 0, 852, 853, 5, 3, 0, 0, 853, 193, 1, 0, 0, 0, 854, 855, 5, 88, 0, 0, 855, 856, 5, 2, 0, 0, 856, 857, 3, 6, 3, 0, 857, 858, 5, 3, 0, 0, 858, 195, 1, 0, 0, 0, 859, 860, 5, 89, 0, 0, 860, 861, 5, 2, 0, 0, 861, 862, 3, 6, 3, 0, 862, 863, 5, 3, 0, 0, 863, 197, 1, 0, 0, 0, 864, 865, 5, 90, 0, 0, 865, 866, 5, 2, 0, 0, 866, 867, 3, 6, 3, 0, 867, 868, 5, 3, 0, 0, 868, 199, 1, 0, 0, 0, 869, 870, 5, 91, 0, 0, 870, 871, 5, 2, 0, 0, 871, 872, 3, 6, 3, 0, 872, 873, 5, 3, 0, 0, 873, 201, 1, 0, 0, 0, 874, 875, 5, 92, 0, 0, 875, 876, 5, 2, 0, 0, 876, 877, 3, 6, 3, 0, 877, 878, 5, 3, 0, 0, 878, 203, 1, 0, 0, 0, 879, 880, 5, 93, 0, 0, 880, 881, 5, 2, 0, 0, 881, 882, 3, 6, 3, 0, 882, 883, 5, 3, 0, 0, 883, 205, 1, 0, 0, 0, 884, 885, 5, 94, 0, 0, 885, 886, 5, 2, 0, 0, 886, 887, 3, 6, 3, 0, 887, 888, 5, 15, 0, 0, 888, 889, 3, 6, 3, 0, 889, 890, 5, 3, 0, 0, 890, 207, 1, 0, 0, 0, 891, 892, 5, 95, 0, 0, 892, 893, 5, 2, 0, 0, 893, 894, 3, 6, 3, 0, 894, 895, 5, 15, 0, 0, 895, 896, 3, 6, 3, 0, 896, 897, 5, 3, 0, 0, 897, 209, 1, 0, 0, 0, 898, 899, 5, 96, 0, 0, 899, 900, 5, 2, 0, 0, 900, 901, 3, 6, 3, 0, 901, 902, 5, 3, 0, 0, 902, 211, 1, 0, 0, 0, 903, 904, 5, 97, 0, 0, 904, 905, 5, 2, 0, 0, 905, 906, 3, 6, 3, 0, 906, 907, 5, 15, 0, 0, 907, 908, 3, 6, 3, 0, 908, 909, 5, 3, 0, 0, 909, 213, 1, 0, 0, 0, 910, 911, 5, 98, 0, 0, 911, 912, 5, 2, 0, 0, 912, 913, 3, 6, 3, 0, 913, 914, 5, 15, 0, 0, 914, 915, 3, 6, 3, 0, 915, 916, 5, 3, 0, 0, 916, 215, 1, 0, 0, 0, 917, 918, 5, 99, 0, 0, 918, 919, 5, 2, 0, 0, 919, 920, 3, 6, 3, 0, 920, 921, 5, 3, 0, 0, 921, 217, 1, 0, 0, 0, 922, 923, 5, 100, 0, 0, 923, 924, 5, 2, 0, 0, 924, 925, 3, 6, 3, 0, 925, 926, 5, 15, 0, 0, 926, 927, 3, 6, 3, 0, 927, 928, 5, 3, 0, 0, 928, 219, 1, 0, 0, 0, 929, 930, 5, 101, 0, 0, 930, 931, 5, 2, 0, 0, 931, 932, 3, 6, 3, 0, 932, 933, 5, 3, 0, 0, 933, 221, 1, 0, 0, 0, 934, 935, 5, 102, 0, 0, 935, 936, 5, 2, 0, 0, 936, 937, 3, 6, 3, 0, 937, 938, 5, 3, 0, 0, 938, 223, 1, 0, 0, 0, 939, 940, 5, 103, 0, 0, 940, 941, 5, 2, 0, 0, 941, 942, 3, 6, 3, 0, 942, 943, 5, 3, 0, 0, 943, 225, 1, 0, 0, 0, 944, 945, 5, 104, 0, 0, 945, 946, 5, 2, 0, 0, 946, 947, 3, 6, 3, 0, 947, 948, 5, 3, 0, 0, 948, 227, 1, 0, 0, 0, 949, 950, 5, 105, 0, 0, 950, 951, 5, 2, 0, 0, 951, 952, 3, 6, 3, 0, 952, 953, 5, 15, 0, 0, 953, 954, 3, 6, 3, 0, 954, 955, 5, 3, 0, 0, 955, 229, 1, 0, 0, 0, 956, 957, 5, 106, 0, 0, 957, 958, 5, 2, 0, 0, 958, 959, 3, 6, 3, 0, 959, 960, 5, 3, 0, 0, 960, 231, 1, 0, 0, 0, 961, 962, 5, 107, 0, 0, 962, 963, 5, 2, 0, 0, 963, 964, 3, 6, 3, 0, 964, 965, 5, 15, 0, 0, 965, 966, 3, 6, 3, 0, 966, 967, 5, 3, 0, 0, 967, 233, 1, 0, 0, 0, 968, 969, 5, 108, 0, 0, 969, 970, 5, 2, 0, 0, 970, 971, 3, 6, 3, 0, 971, 972, 5, 3, 0, 0, 972, 235, 1, 0, 0, 0, 973, 974, 5, 109, 0, 0, 974, 975, 5, 2, 0, 0, 975, 976, 3, 6, 3, 0, 976, 977, 5, 3, 0, 0, 977, 237, 1, 0, 0, 0, 978, 979, 5, 110, 0, 0, 979, 980, 5, 2, 0, 0, 980, 981, 3, 6, 3, 0, 981, 982, 5, 3, 0, 0, 982, 239, 1, 0, 0, 0, 983, 984, 5, 111, 0, 0, 984, 985, 5, 2, 0, 0, 985, 986, 3, 6, 3, 0, 986, 987, 5, 3, 0, 0, 987, 241, 1, 0, 0, 0, 988, 989, 5, 112, 0, 0, 989, 990, 5, 2, 0, 0, 990, 991, 3, 6, 3, 0, 991, 992, 5, 3, 0, 0, 992, 243, 1, 0, 0, 0, 993, 994, 5, 113, 0, 0, 994, 995, 5, 2, 0, 0, 995, 996, 3, 6, 3, 0, 996, 997, 5, 3, 0, 0, 997, 245, 1, 0, 0, 0, 998, 999, 5, 114, 0, 0, 999, 1000, 5, 2, 0, 0, 1000, 1001, 3, 6, 3, 0, 1001, 1002, 5, 3, 0, 0, 1002, 247, 1, 0, 0, 0, 1003, 1004, 5, 115, 0, 0, 1004, 1005, 5, 2, 0, 0, 1005, 1006, 3, 6, 3, 0, 1006, 1007, 5, 3, 0, 0, 1007, 249, 1, 0, 0, 0, 1008, 1009, 5, 116, 0, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 6, 3, 0, 1011, 1012, 5, 3, 0, 0, 1012, 251, 1, 0, 0, 0, 1013, 1014, 5, 117, 0, 0, 1014, 1015, 5, 2, 0, 0, 1015, 1016, 3, 6, 3, 0, 1016, 1017, 5, 15, 0, 0, 1017, 1018, 3, 6, 3, 0, 1018, 1019, 5, 3, 0, 0, 1019, 253, 1, 0, 0, 0, 1020, 1021, 5, 118, 0, 0, 1021, 1022, 5, 2, 0, 0, 1022, 1023, 3, 6, 3, 0, 1023, 1024, 5, 3, 0, 0, 1024, 255, 1, 0, 0, 0, 1025, 1026, 5, 119, 0, 0, 1026, 1027, 5, 2, 0, 0, 1027, 1028, 3, 6, 3, 0, 1028, 1029, 5, 15, 0, 0, 1029, 1030, 3, 6, 3, 0, 1030, 1031, 5, 3, 0, 0, 1031, 257, 1, 0, 0, 0, 1032, 1033, 5, 120, 0, 0, 1033, 1034, 5, 2, 0, 0, 1034, 1035, 3, 6, 3, 0, 1035, 1036, 5, 15, 0, 0, 1036, 1037, 3, 6, 3, 0, 1037, 1038, 5, 3, 0, 0, 1038, 259, 1, 0, 0, 0, 1039, 1040, 5, 121, 0, 0, 1040, 1041, 5, 2, 0, 0, 1041, 1042, 3, 6, 3, 0, 1042, 1043, 5, 3, 0, 0, 1043, 261, 1, 0, 0, 0, 1044, 1045, 5, 122, 0, 0, 1045, 1046, 5, 2, 0, 0, 1046, 1047, 3, 6, 3, 0, 1047, 1048, 5, 15, 0, 0, 1048, 1049, 3, 6, 3, 0, 1049, 1050, 5, 3, 0, 0, 1050, 263, 1, 0, 0, 0, 1051, 1052, 5, 123, 0, 0, 1052, 1053, 5, 2, 0, 0, 1053, 1054, 3, 6, 3, 0, 1054, 1055, 5, 3, 0, 0, 1055, 265, 1, 0, 0, 0, 1056, 1057, 5, 124, 0, 0, 1057, 1058, 5, 2, 0, 0, 1058, 1059, 3, 6, 3, 0, 1059, 1060, 5, 3, 0, 0, 1060, 267, 1, 0, 0, 0, 1061, 1062, 5, 125, 0, 0, 1062, 1063, 5, 2, 0, 0, 1063, 1064, 3, 6, 3, 0, 1064, 1065, 5, 3, 0, 0, 1065, 269, 1, 0, 0, 0, 1066, 1067, 5, 126, 0, 0, 1067, 1068, 5, 2, 0, 0, 1068, 1069, 3, 6, 3, 0, 1069, 1070, 5, 3, 0, 0, 1070, 271, 1, 0, 0, 0, 1071, 1072, 5, 127, 0, 0, 1072, 1073, 5, 2, 0, 0, 1073, 1074, 3, 6, 3, 0, 1074, 1075, 5, 15, 0, 0, 1075, 1076, 3, 6, 3, 0, 1076, 1077, 5, 3, 0, 0, 1077, 273, 1, 0, 0, 0, 1078, 1079, 5, 128, 0, 0, 1079, 1080, 5, 2, 0, 0, 1080, 1081, 3, 6, 3, 0, 1081, 1082, 5, 3, 0, 0, 1082, 275, 1, 0, 0, 0, 1083, 1084, 5, 129, 0, 0, 1084, 1085, 5, 2, 0, 0, 1085, 1086, 3, 6, 3, 0, 1086, 1087, 5, 15, 0, 0, 1087, 1088, 3, 6, 3, 0, 1088, 1089, 5, 3, 0, 0, 1089, 277, 1, 0, 0, 0, 1090, 1091, 5, 130, 0, 0, 1091, 1092, 5, 2, 0, 0, 1092, 1093, 3, 6, 3, 0, 1093, 1094, 5, 15, 0, 0, 1094, 1095, 3, 6, 3, 0, 1095, 1096, 5, 3, 0, 0, 1096, 279, 1, 0, 0, 0, 1097, 1098, 5, 131, 0, 0, 1098, 1099, 5, 2, 0, 0, 1099, 1100, 3, 6, 3, 0, 1100, 1101, 5, 15, 0, 0, 1101, 1102, 3, 6, 3, 0, 1102, 1103, 5, 3, 0, 0, 1103, 281, 1, 0, 0, 0, 1104, 1105, 5, 132, 0, 0, 1105, 1106, 5, 2, 0, 0, 1106, 1107, 3, 6, 3, 0, 1107, 1108, 5, 3, 0, 0, 1108, 283, 1, 0, 0, 0, 1109, 1110, 5, 133, 0, 0, 1110, 1111, 5, 2, 0, 0, 1111, 1112, 3, 6, 3, 0, 1112, 1113, 5, 3, 0, 0, 1113, 285, 1, 0, 0, 0, 1114, 1115, 5, 134, 0, 0, 1115, 1116, 5, 2, 0, 0, 1116, 1117, 3, 6, 3, 0, 1117, 1118, 5, 15, 0, 0, 1118, 1119, 3, 6, 3, 0, 1119, 1120, 5, 3, 0, 0, 1120, 287, 1, 0, 0, 0, 1121, 1122, 5, 135, 0, 0, 1122, 1123, 5, 2, 0, 0, 1123, 1124, 3, 6, 3, 0, 1124, 1125, 5, 3, 0, 0, 1125, 289, 1, 0, 0, 0, 1126, 1127, 5, 136, 0, 0, 1127, 1128, 5, 2, 0, 0, 1128, 1129, 3, 6, 3, 0, 1129, 1130, 5, 3, 0, 0, 1130, 291, 1, 0, 0, 0, 1131, 1132, 5, 137, 0, 0, 1132, 1133, 5, 2, 0, 0, 1133, 1134, 3, 6, 3, 0, 1134, 1135, 5, 3, 0, 0, 1135, 293, 1, 0, 0, 0, 1136, 1137, 5, 138, 0, 0, 1137, 1138, 5, 2, 0, 0, 1138, 1139, 3, 6, 3, 0, 1139, 1140, 5, 15, 0, 0, 1140, 1141, 3, 6, 3, 0, 1141, 1142, 5, 3, 0, 0, 1142, 295, 1, 0, 0, 0, 1143, 1144, 5, 139, 0, 0, 1144, 1145, 5, 2, 0, 0, 1145, 1146, 3, 6, 3, 0, 1146, 1147, 5, 15, 0, 0, 1147, 1148, 3, 6, 3, 0, 1148, 1149, 5, 3, 0, 0, 1149, 297, 1, 0, 0, 0, 1150, 1151, 5, 140, 0, 0, 1151, 1152, 5, 2, 0, 0, 1152, 1153, 3, 6, 3, 0, 1153, 1154, 5, 3, 0, 0, 1154, 299, 1, 0, 0, 0, 1155, 1156, 5, 141, 0, 0, 1156, 1157, 5, 2, 0, 0, 1157, 1158, 3, 6, 3, 0, 1158, 1159, 5, 3, 0, 0, 1159, 301, 1, 0, 0, 0, 1160, 1161, 5, 142, 0, 0, 1161, 1162, 5, 2, 0, 0, 1162, 1163, 3, 6, 3, 0, 1163, 1164, 5, 3, 0, 0, 1164, 303, 1, 0, 0, 0, 1165, 1166, 5, 143, 0, 0, 1166, 1167, 5, 2, 0, 0, 1167, 1168, 3, 6, 3, 0, 1168, 1169, 5, 3, 0, 0, 1169, 305, 1, 0, 0, 0, 1170, 1171, 5, 144, 0, 0, 1171, 1172, 5, 2, 0, 0, 1172, 1173, 3, 6, 3, 0, 1173, 1174, 5, 3, 0, 0, 1174, 307, 1, 0, 0, 0, 1175, 1176, 5, 145, 0, 0, 1176, 1177, 5, 2, 0, 0, 1177, 1178, 3, 6, 3, 0, 1178, 1179, 5, 3, 0, 0, 1179, 309, 1, 0, 0, 0, 1180, 1181, 5, 146, 0, 0, 1181, 1182, 5, 2, 0, 0, 1182, 1183, 3, 6, 3, 0, 1183, 1184, 5, 3, 0, 0, 1184, 311, 1, 0, 0, 0, 1185, 1186, 5, 147, 0, 0, 1186, 1187, 5, 2, 0, 0, 1187, 1188, 3, 6, 3, 0, 1188, 1189, 5, 3, 0, 0, 1189, 313, 1, 0, 0, 0, 1190, 1191, 5, 148, 0, 0, 1191, 1192, 5, 2, 0, 0, 1192, 1193, 3, 6, 3, 0, 1193, 1194, 5, 3, 0, 0, 1194, 315, 1, 0, 0, 0, 1195, 1196, 5, 149, 0, 0, 1196, 1197, 5, 2, 0, 0, 1197, 1198, 3, 6, 3, 0, 1198, 1199, 5, 15, 0, 0, 1199, 1200, 3, 6, 3, 0, 1200, 1201, 5, 3, 0, 0, 1201, 317, 1, 0, 0, 0, 7, 335, 343, 351, 359, 367, 373, 382] \ No newline at end of file diff --git a/server/src/utils/antlrGrammars/q.tokens b/server/src/utils/antlrGrammars/q.tokens deleted file mode 100644 index 582f68b7..00000000 --- a/server/src/utils/antlrGrammars/q.tokens +++ /dev/null @@ -1,344 +0,0 @@ -T__0=1 -T__1=2 -T__2=3 -T__3=4 -T__4=5 -T__5=6 -T__6=7 -T__7=8 -T__8=9 -T__9=10 -T__10=11 -T__11=12 -T__12=13 -T__13=14 -T__14=15 -T__15=16 -T__16=17 -T__17=18 -T__18=19 -T__19=20 -T__20=21 -T__21=22 -T__22=23 -T__23=24 -T__24=25 -T__25=26 -T__26=27 -T__27=28 -T__28=29 -T__29=30 -T__30=31 -T__31=32 -T__32=33 -T__33=34 -T__34=35 -T__35=36 -T__36=37 -T__37=38 -T__38=39 -T__39=40 -T__40=41 -T__41=42 -T__42=43 -T__43=44 -T__44=45 -T__45=46 -T__46=47 -T__47=48 -T__48=49 -T__49=50 -T__50=51 -T__51=52 -T__52=53 -T__53=54 -T__54=55 -T__55=56 -T__56=57 -T__57=58 -T__58=59 -T__59=60 -T__60=61 -T__61=62 -T__62=63 -T__63=64 -T__64=65 -T__65=66 -T__66=67 -T__67=68 -T__68=69 -T__69=70 -T__70=71 -T__71=72 -T__72=73 -T__73=74 -T__74=75 -T__75=76 -T__76=77 -T__77=78 -T__78=79 -T__79=80 -T__80=81 -T__81=82 -T__82=83 -T__83=84 -T__84=85 -T__85=86 -T__86=87 -T__87=88 -T__88=89 -T__89=90 -T__90=91 -T__91=92 -T__92=93 -T__93=94 -T__94=95 -T__95=96 -T__96=97 -T__97=98 -T__98=99 -T__99=100 -T__100=101 -T__101=102 -T__102=103 -T__103=104 -T__104=105 -T__105=106 -T__106=107 -T__107=108 -T__108=109 -T__109=110 -T__110=111 -T__111=112 -T__112=113 -T__113=114 -T__114=115 -T__115=116 -T__116=117 -T__117=118 -T__118=119 -T__119=120 -T__120=121 -T__121=122 -T__122=123 -T__123=124 -T__124=125 -T__125=126 -T__126=127 -T__127=128 -T__128=129 -T__129=130 -T__130=131 -T__131=132 -T__132=133 -T__133=134 -T__134=135 -T__135=136 -T__136=137 -T__137=138 -T__138=139 -T__139=140 -T__140=141 -T__141=142 -T__142=143 -T__143=144 -T__144=145 -T__145=146 -T__146=147 -T__147=148 -T__148=149 -PLUS=150 -MINUS=151 -MULTIPLY=152 -DIVIDE=153 -EQUALS=154 -NOT_EQUALS=155 -LESS_THAN=156 -LESS_THAN_OR_EQUAL=157 -GREATER_THAN=158 -GREATER_THAN_OR_EQUAL=159 -AND=160 -OR=161 -NOT=162 -INT=163 -LONG=164 -FLOAT=165 -DOUBLE=166 -CHAR=167 -SYMBOL=168 -TIMESTAMP=169 -ID=170 -DIGIT=171 -NUMBER=172 -STRING=173 -ESC=174 -WS=175 -';'=1 -'('=2 -')'=3 -'abs'=4 -'acos'=5 -'all'=6 -'any'=7 -'asin'=8 -'atan'=9 -'avg'=10 -'ceiling'=11 -'cos'=12 -'count'=13 -'cross'=14 -','=15 -'delete'=16 -'deltas'=17 -'dev'=18 -'distinct'=19 -'div'=20 -'drop'=21 -'each'=22 -'enlist'=23 -'eval'=24 -'except'=25 -'exec'=26 -'exp'=27 -'fby'=28 -'fill'=29 -'first'=30 -'flip'=31 -'floor'=32 -'get'=33 -'group'=34 -'gtime'=35 -'hclose'=36 -'hcount'=37 -'hdel'=38 -'hopen'=39 -'hsym'=40 -'iasc'=41 -'idesc'=42 -'ij'=43 -'in'=44 -'insert'=45 -'inter'=46 -'inv'=47 -'keys'=48 -'last'=49 -'like'=50 -'list'=51 -'lj'=52 -'load'=53 -'log'=54 -'lower'=55 -'lsq'=56 -'ltime'=57 -'ltrim'=58 -'mavg'=59 -'max'=60 -'maxs'=61 -'mcount'=62 -'md5'=63 -'mdev'=64 -'med'=65 -'meta'=66 -'min'=67 -'mins'=68 -'mmax'=69 -'mmin'=70 -'mmu'=71 -'mod'=72 -'msum'=73 -'neg'=74 -'next'=75 -'null'=76 -'over'=77 -'parse'=78 -'peach'=79 -'pj'=80 -'plist'=81 -'prd'=82 -'prev'=83 -'prior'=84 -'rand'=85 -'rank'=86 -'ratios'=87 -'raze'=88 -'read0'=89 -'read1'=90 -'reciprocal'=91 -'reverse'=92 -'rload'=93 -'rotate'=94 -'rsave'=95 -'rtrim'=96 -'save'=97 -'scan'=98 -'select'=99 -'set'=100 -'show'=101 -'signum'=102 -'sin'=103 -'sqrt'=104 -'ssr'=105 -'string'=106 -'sublist'=107 -'sum'=108 -'sums'=109 -'sv'=110 -'system'=111 -'tables'=112 -'tan'=113 -'til'=114 -'trim'=115 -'type'=116 -'uj'=117 -'ungroup'=118 -'union'=119 -'update'=120 -'upper'=121 -'upsert'=122 -'value'=123 -'var'=124 -'view'=125 -'vs'=126 -'wavg'=127 -'where'=128 -'within'=129 -'wj1'=130 -'wj2'=131 -'ww'=132 -'xasc'=133 -'xbar'=134 -'xcols'=135 -'xdesc'=136 -'xexp'=137 -'xgroup'=138 -'xkey'=139 -'xlog'=140 -'xprev'=141 -'xrank'=142 -'xranked'=143 -'xrecs'=144 -'xrows'=145 -'xss'=146 -'xtype'=147 -'yield'=148 -'zip'=149 -'+'=150 -'-'=151 -'*'=152 -'%'=153 -'='=154 -'<>'=155 -'<'=156 -'<='=157 -'>'=158 -'>='=159 -'and'=160 -'or'=161 -'not'=162 -'int'=163 -'long'=164 -'float'=165 -'double'=166 -'char'=167 -'symbol'=168 -'timestamp'=169 diff --git a/server/src/utils/antlrGrammars/qLexer.interp b/server/src/utils/antlrGrammars/qLexer.interp deleted file mode 100644 index 0c05157a..00000000 --- a/server/src/utils/antlrGrammars/qLexer.interp +++ /dev/null @@ -1,542 +0,0 @@ -token literal names: -null -';' -'(' -')' -'abs' -'acos' -'all' -'any' -'asin' -'atan' -'avg' -'ceiling' -'cos' -'count' -'cross' -',' -'delete' -'deltas' -'dev' -'distinct' -'div' -'drop' -'each' -'enlist' -'eval' -'except' -'exec' -'exp' -'fby' -'fill' -'first' -'flip' -'floor' -'get' -'group' -'gtime' -'hclose' -'hcount' -'hdel' -'hopen' -'hsym' -'iasc' -'idesc' -'ij' -'in' -'insert' -'inter' -'inv' -'keys' -'last' -'like' -'list' -'lj' -'load' -'log' -'lower' -'lsq' -'ltime' -'ltrim' -'mavg' -'max' -'maxs' -'mcount' -'md5' -'mdev' -'med' -'meta' -'min' -'mins' -'mmax' -'mmin' -'mmu' -'mod' -'msum' -'neg' -'next' -'null' -'over' -'parse' -'peach' -'pj' -'plist' -'prd' -'prev' -'prior' -'rand' -'rank' -'ratios' -'raze' -'read0' -'read1' -'reciprocal' -'reverse' -'rload' -'rotate' -'rsave' -'rtrim' -'save' -'scan' -'select' -'set' -'show' -'signum' -'sin' -'sqrt' -'ssr' -'string' -'sublist' -'sum' -'sums' -'sv' -'system' -'tables' -'tan' -'til' -'trim' -'type' -'uj' -'ungroup' -'union' -'update' -'upper' -'upsert' -'value' -'var' -'view' -'vs' -'wavg' -'where' -'within' -'wj1' -'wj2' -'ww' -'xasc' -'xbar' -'xcols' -'xdesc' -'xexp' -'xgroup' -'xkey' -'xlog' -'xprev' -'xrank' -'xranked' -'xrecs' -'xrows' -'xss' -'xtype' -'yield' -'zip' -'+' -'-' -'*' -'%' -'=' -'<>' -'<' -'<=' -'>' -'>=' -'and' -'or' -'not' -'int' -'long' -'float' -'double' -'char' -'symbol' -'timestamp' -null -null -null -null -null -null - -token symbolic names: -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -null -PLUS -MINUS -MULTIPLY -DIVIDE -EQUALS -NOT_EQUALS -LESS_THAN -LESS_THAN_OR_EQUAL -GREATER_THAN -GREATER_THAN_OR_EQUAL -AND -OR -NOT -INT -LONG -FLOAT -DOUBLE -CHAR -SYMBOL -TIMESTAMP -ID -DIGIT -NUMBER -STRING -ESC -WS - -rule names: -T__0 -T__1 -T__2 -T__3 -T__4 -T__5 -T__6 -T__7 -T__8 -T__9 -T__10 -T__11 -T__12 -T__13 -T__14 -T__15 -T__16 -T__17 -T__18 -T__19 -T__20 -T__21 -T__22 -T__23 -T__24 -T__25 -T__26 -T__27 -T__28 -T__29 -T__30 -T__31 -T__32 -T__33 -T__34 -T__35 -T__36 -T__37 -T__38 -T__39 -T__40 -T__41 -T__42 -T__43 -T__44 -T__45 -T__46 -T__47 -T__48 -T__49 -T__50 -T__51 -T__52 -T__53 -T__54 -T__55 -T__56 -T__57 -T__58 -T__59 -T__60 -T__61 -T__62 -T__63 -T__64 -T__65 -T__66 -T__67 -T__68 -T__69 -T__70 -T__71 -T__72 -T__73 -T__74 -T__75 -T__76 -T__77 -T__78 -T__79 -T__80 -T__81 -T__82 -T__83 -T__84 -T__85 -T__86 -T__87 -T__88 -T__89 -T__90 -T__91 -T__92 -T__93 -T__94 -T__95 -T__96 -T__97 -T__98 -T__99 -T__100 -T__101 -T__102 -T__103 -T__104 -T__105 -T__106 -T__107 -T__108 -T__109 -T__110 -T__111 -T__112 -T__113 -T__114 -T__115 -T__116 -T__117 -T__118 -T__119 -T__120 -T__121 -T__122 -T__123 -T__124 -T__125 -T__126 -T__127 -T__128 -T__129 -T__130 -T__131 -T__132 -T__133 -T__134 -T__135 -T__136 -T__137 -T__138 -T__139 -T__140 -T__141 -T__142 -T__143 -T__144 -T__145 -T__146 -T__147 -T__148 -PLUS -MINUS -MULTIPLY -DIVIDE -EQUALS -NOT_EQUALS -LESS_THAN -LESS_THAN_OR_EQUAL -GREATER_THAN -GREATER_THAN_OR_EQUAL -AND -OR -NOT -INT -LONG -FLOAT -DOUBLE -CHAR -SYMBOL -TIMESTAMP -ID -DIGIT -NUMBER -STRING -ESC -WS - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN - -mode names: -DEFAULT_MODE - -atn: -[4, 0, 175, 1252, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, 136, 1, 136, 1, 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, 1, 144, 1, 144, 1, 144, 1, 145, 1, 145, 1, 145, 1, 145, 1, 146, 1, 146, 1, 146, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 148, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 150, 1, 150, 1, 151, 1, 151, 1, 152, 1, 152, 1, 153, 1, 153, 1, 154, 1, 154, 1, 154, 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 159, 1, 159, 1, 159, 1, 159, 1, 160, 1, 160, 1, 160, 1, 161, 1, 161, 1, 161, 1, 161, 1, 162, 1, 162, 1, 162, 1, 162, 1, 163, 1, 163, 1, 163, 1, 163, 1, 163, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 165, 1, 165, 1, 165, 1, 165, 1, 165, 1, 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 169, 1, 169, 5, 169, 1213, 8, 169, 10, 169, 12, 169, 1216, 9, 169, 1, 170, 1, 170, 1, 171, 4, 171, 1221, 8, 171, 11, 171, 12, 171, 1222, 1, 171, 1, 171, 4, 171, 1227, 8, 171, 11, 171, 12, 171, 1228, 3, 171, 1231, 8, 171, 1, 172, 1, 172, 1, 172, 5, 172, 1236, 8, 172, 10, 172, 12, 172, 1239, 9, 172, 1, 172, 1, 172, 1, 173, 1, 173, 1, 173, 1, 174, 4, 174, 1247, 8, 174, 11, 174, 12, 174, 1248, 1, 174, 1, 174, 0, 0, 175, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 139, 70, 141, 71, 143, 72, 145, 73, 147, 74, 149, 75, 151, 76, 153, 77, 155, 78, 157, 79, 159, 80, 161, 81, 163, 82, 165, 83, 167, 84, 169, 85, 171, 86, 173, 87, 175, 88, 177, 89, 179, 90, 181, 91, 183, 92, 185, 93, 187, 94, 189, 95, 191, 96, 193, 97, 195, 98, 197, 99, 199, 100, 201, 101, 203, 102, 205, 103, 207, 104, 209, 105, 211, 106, 213, 107, 215, 108, 217, 109, 219, 110, 221, 111, 223, 112, 225, 113, 227, 114, 229, 115, 231, 116, 233, 117, 235, 118, 237, 119, 239, 120, 241, 121, 243, 122, 245, 123, 247, 124, 249, 125, 251, 126, 253, 127, 255, 128, 257, 129, 259, 130, 261, 131, 263, 132, 265, 133, 267, 134, 269, 135, 271, 136, 273, 137, 275, 138, 277, 139, 279, 140, 281, 141, 283, 142, 285, 143, 287, 144, 289, 145, 291, 146, 293, 147, 295, 148, 297, 149, 299, 150, 301, 151, 303, 152, 305, 153, 307, 154, 309, 155, 311, 156, 313, 157, 315, 158, 317, 159, 319, 160, 321, 161, 323, 162, 325, 163, 327, 164, 329, 165, 331, 166, 333, 167, 335, 168, 337, 169, 339, 170, 341, 171, 343, 172, 345, 173, 347, 174, 349, 175, 1, 0, 6, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 34, 34, 92, 92, 8, 0, 34, 34, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 3, 0, 9, 10, 13, 13, 32, 32, 1258, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, 131, 1, 0, 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, 0, 0, 0, 139, 1, 0, 0, 0, 0, 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 0, 145, 1, 0, 0, 0, 0, 147, 1, 0, 0, 0, 0, 149, 1, 0, 0, 0, 0, 151, 1, 0, 0, 0, 0, 153, 1, 0, 0, 0, 0, 155, 1, 0, 0, 0, 0, 157, 1, 0, 0, 0, 0, 159, 1, 0, 0, 0, 0, 161, 1, 0, 0, 0, 0, 163, 1, 0, 0, 0, 0, 165, 1, 0, 0, 0, 0, 167, 1, 0, 0, 0, 0, 169, 1, 0, 0, 0, 0, 171, 1, 0, 0, 0, 0, 173, 1, 0, 0, 0, 0, 175, 1, 0, 0, 0, 0, 177, 1, 0, 0, 0, 0, 179, 1, 0, 0, 0, 0, 181, 1, 0, 0, 0, 0, 183, 1, 0, 0, 0, 0, 185, 1, 0, 0, 0, 0, 187, 1, 0, 0, 0, 0, 189, 1, 0, 0, 0, 0, 191, 1, 0, 0, 0, 0, 193, 1, 0, 0, 0, 0, 195, 1, 0, 0, 0, 0, 197, 1, 0, 0, 0, 0, 199, 1, 0, 0, 0, 0, 201, 1, 0, 0, 0, 0, 203, 1, 0, 0, 0, 0, 205, 1, 0, 0, 0, 0, 207, 1, 0, 0, 0, 0, 209, 1, 0, 0, 0, 0, 211, 1, 0, 0, 0, 0, 213, 1, 0, 0, 0, 0, 215, 1, 0, 0, 0, 0, 217, 1, 0, 0, 0, 0, 219, 1, 0, 0, 0, 0, 221, 1, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 225, 1, 0, 0, 0, 0, 227, 1, 0, 0, 0, 0, 229, 1, 0, 0, 0, 0, 231, 1, 0, 0, 0, 0, 233, 1, 0, 0, 0, 0, 235, 1, 0, 0, 0, 0, 237, 1, 0, 0, 0, 0, 239, 1, 0, 0, 0, 0, 241, 1, 0, 0, 0, 0, 243, 1, 0, 0, 0, 0, 245, 1, 0, 0, 0, 0, 247, 1, 0, 0, 0, 0, 249, 1, 0, 0, 0, 0, 251, 1, 0, 0, 0, 0, 253, 1, 0, 0, 0, 0, 255, 1, 0, 0, 0, 0, 257, 1, 0, 0, 0, 0, 259, 1, 0, 0, 0, 0, 261, 1, 0, 0, 0, 0, 263, 1, 0, 0, 0, 0, 265, 1, 0, 0, 0, 0, 267, 1, 0, 0, 0, 0, 269, 1, 0, 0, 0, 0, 271, 1, 0, 0, 0, 0, 273, 1, 0, 0, 0, 0, 275, 1, 0, 0, 0, 0, 277, 1, 0, 0, 0, 0, 279, 1, 0, 0, 0, 0, 281, 1, 0, 0, 0, 0, 283, 1, 0, 0, 0, 0, 285, 1, 0, 0, 0, 0, 287, 1, 0, 0, 0, 0, 289, 1, 0, 0, 0, 0, 291, 1, 0, 0, 0, 0, 293, 1, 0, 0, 0, 0, 295, 1, 0, 0, 0, 0, 297, 1, 0, 0, 0, 0, 299, 1, 0, 0, 0, 0, 301, 1, 0, 0, 0, 0, 303, 1, 0, 0, 0, 0, 305, 1, 0, 0, 0, 0, 307, 1, 0, 0, 0, 0, 309, 1, 0, 0, 0, 0, 311, 1, 0, 0, 0, 0, 313, 1, 0, 0, 0, 0, 315, 1, 0, 0, 0, 0, 317, 1, 0, 0, 0, 0, 319, 1, 0, 0, 0, 0, 321, 1, 0, 0, 0, 0, 323, 1, 0, 0, 0, 0, 325, 1, 0, 0, 0, 0, 327, 1, 0, 0, 0, 0, 329, 1, 0, 0, 0, 0, 331, 1, 0, 0, 0, 0, 333, 1, 0, 0, 0, 0, 335, 1, 0, 0, 0, 0, 337, 1, 0, 0, 0, 0, 339, 1, 0, 0, 0, 0, 341, 1, 0, 0, 0, 0, 343, 1, 0, 0, 0, 0, 345, 1, 0, 0, 0, 0, 347, 1, 0, 0, 0, 0, 349, 1, 0, 0, 0, 1, 351, 1, 0, 0, 0, 3, 353, 1, 0, 0, 0, 5, 355, 1, 0, 0, 0, 7, 357, 1, 0, 0, 0, 9, 361, 1, 0, 0, 0, 11, 366, 1, 0, 0, 0, 13, 370, 1, 0, 0, 0, 15, 374, 1, 0, 0, 0, 17, 379, 1, 0, 0, 0, 19, 384, 1, 0, 0, 0, 21, 388, 1, 0, 0, 0, 23, 396, 1, 0, 0, 0, 25, 400, 1, 0, 0, 0, 27, 406, 1, 0, 0, 0, 29, 412, 1, 0, 0, 0, 31, 414, 1, 0, 0, 0, 33, 421, 1, 0, 0, 0, 35, 428, 1, 0, 0, 0, 37, 432, 1, 0, 0, 0, 39, 441, 1, 0, 0, 0, 41, 445, 1, 0, 0, 0, 43, 450, 1, 0, 0, 0, 45, 455, 1, 0, 0, 0, 47, 462, 1, 0, 0, 0, 49, 467, 1, 0, 0, 0, 51, 474, 1, 0, 0, 0, 53, 479, 1, 0, 0, 0, 55, 483, 1, 0, 0, 0, 57, 487, 1, 0, 0, 0, 59, 492, 1, 0, 0, 0, 61, 498, 1, 0, 0, 0, 63, 503, 1, 0, 0, 0, 65, 509, 1, 0, 0, 0, 67, 513, 1, 0, 0, 0, 69, 519, 1, 0, 0, 0, 71, 525, 1, 0, 0, 0, 73, 532, 1, 0, 0, 0, 75, 539, 1, 0, 0, 0, 77, 544, 1, 0, 0, 0, 79, 550, 1, 0, 0, 0, 81, 555, 1, 0, 0, 0, 83, 560, 1, 0, 0, 0, 85, 566, 1, 0, 0, 0, 87, 569, 1, 0, 0, 0, 89, 572, 1, 0, 0, 0, 91, 579, 1, 0, 0, 0, 93, 585, 1, 0, 0, 0, 95, 589, 1, 0, 0, 0, 97, 594, 1, 0, 0, 0, 99, 599, 1, 0, 0, 0, 101, 604, 1, 0, 0, 0, 103, 609, 1, 0, 0, 0, 105, 612, 1, 0, 0, 0, 107, 617, 1, 0, 0, 0, 109, 621, 1, 0, 0, 0, 111, 627, 1, 0, 0, 0, 113, 631, 1, 0, 0, 0, 115, 637, 1, 0, 0, 0, 117, 643, 1, 0, 0, 0, 119, 648, 1, 0, 0, 0, 121, 652, 1, 0, 0, 0, 123, 657, 1, 0, 0, 0, 125, 664, 1, 0, 0, 0, 127, 668, 1, 0, 0, 0, 129, 673, 1, 0, 0, 0, 131, 677, 1, 0, 0, 0, 133, 682, 1, 0, 0, 0, 135, 686, 1, 0, 0, 0, 137, 691, 1, 0, 0, 0, 139, 696, 1, 0, 0, 0, 141, 701, 1, 0, 0, 0, 143, 705, 1, 0, 0, 0, 145, 709, 1, 0, 0, 0, 147, 714, 1, 0, 0, 0, 149, 718, 1, 0, 0, 0, 151, 723, 1, 0, 0, 0, 153, 728, 1, 0, 0, 0, 155, 733, 1, 0, 0, 0, 157, 739, 1, 0, 0, 0, 159, 745, 1, 0, 0, 0, 161, 748, 1, 0, 0, 0, 163, 754, 1, 0, 0, 0, 165, 758, 1, 0, 0, 0, 167, 763, 1, 0, 0, 0, 169, 769, 1, 0, 0, 0, 171, 774, 1, 0, 0, 0, 173, 779, 1, 0, 0, 0, 175, 786, 1, 0, 0, 0, 177, 791, 1, 0, 0, 0, 179, 797, 1, 0, 0, 0, 181, 803, 1, 0, 0, 0, 183, 814, 1, 0, 0, 0, 185, 822, 1, 0, 0, 0, 187, 828, 1, 0, 0, 0, 189, 835, 1, 0, 0, 0, 191, 841, 1, 0, 0, 0, 193, 847, 1, 0, 0, 0, 195, 852, 1, 0, 0, 0, 197, 857, 1, 0, 0, 0, 199, 864, 1, 0, 0, 0, 201, 868, 1, 0, 0, 0, 203, 873, 1, 0, 0, 0, 205, 880, 1, 0, 0, 0, 207, 884, 1, 0, 0, 0, 209, 889, 1, 0, 0, 0, 211, 893, 1, 0, 0, 0, 213, 900, 1, 0, 0, 0, 215, 908, 1, 0, 0, 0, 217, 912, 1, 0, 0, 0, 219, 917, 1, 0, 0, 0, 221, 920, 1, 0, 0, 0, 223, 927, 1, 0, 0, 0, 225, 934, 1, 0, 0, 0, 227, 938, 1, 0, 0, 0, 229, 942, 1, 0, 0, 0, 231, 947, 1, 0, 0, 0, 233, 952, 1, 0, 0, 0, 235, 955, 1, 0, 0, 0, 237, 963, 1, 0, 0, 0, 239, 969, 1, 0, 0, 0, 241, 976, 1, 0, 0, 0, 243, 982, 1, 0, 0, 0, 245, 989, 1, 0, 0, 0, 247, 995, 1, 0, 0, 0, 249, 999, 1, 0, 0, 0, 251, 1004, 1, 0, 0, 0, 253, 1007, 1, 0, 0, 0, 255, 1012, 1, 0, 0, 0, 257, 1018, 1, 0, 0, 0, 259, 1025, 1, 0, 0, 0, 261, 1029, 1, 0, 0, 0, 263, 1033, 1, 0, 0, 0, 265, 1036, 1, 0, 0, 0, 267, 1041, 1, 0, 0, 0, 269, 1046, 1, 0, 0, 0, 271, 1052, 1, 0, 0, 0, 273, 1058, 1, 0, 0, 0, 275, 1063, 1, 0, 0, 0, 277, 1070, 1, 0, 0, 0, 279, 1075, 1, 0, 0, 0, 281, 1080, 1, 0, 0, 0, 283, 1086, 1, 0, 0, 0, 285, 1092, 1, 0, 0, 0, 287, 1100, 1, 0, 0, 0, 289, 1106, 1, 0, 0, 0, 291, 1112, 1, 0, 0, 0, 293, 1116, 1, 0, 0, 0, 295, 1122, 1, 0, 0, 0, 297, 1128, 1, 0, 0, 0, 299, 1132, 1, 0, 0, 0, 301, 1134, 1, 0, 0, 0, 303, 1136, 1, 0, 0, 0, 305, 1138, 1, 0, 0, 0, 307, 1140, 1, 0, 0, 0, 309, 1142, 1, 0, 0, 0, 311, 1145, 1, 0, 0, 0, 313, 1147, 1, 0, 0, 0, 315, 1150, 1, 0, 0, 0, 317, 1152, 1, 0, 0, 0, 319, 1155, 1, 0, 0, 0, 321, 1159, 1, 0, 0, 0, 323, 1162, 1, 0, 0, 0, 325, 1166, 1, 0, 0, 0, 327, 1170, 1, 0, 0, 0, 329, 1175, 1, 0, 0, 0, 331, 1181, 1, 0, 0, 0, 333, 1188, 1, 0, 0, 0, 335, 1193, 1, 0, 0, 0, 337, 1200, 1, 0, 0, 0, 339, 1210, 1, 0, 0, 0, 341, 1217, 1, 0, 0, 0, 343, 1220, 1, 0, 0, 0, 345, 1232, 1, 0, 0, 0, 347, 1242, 1, 0, 0, 0, 349, 1246, 1, 0, 0, 0, 351, 352, 5, 59, 0, 0, 352, 2, 1, 0, 0, 0, 353, 354, 5, 40, 0, 0, 354, 4, 1, 0, 0, 0, 355, 356, 5, 41, 0, 0, 356, 6, 1, 0, 0, 0, 357, 358, 5, 97, 0, 0, 358, 359, 5, 98, 0, 0, 359, 360, 5, 115, 0, 0, 360, 8, 1, 0, 0, 0, 361, 362, 5, 97, 0, 0, 362, 363, 5, 99, 0, 0, 363, 364, 5, 111, 0, 0, 364, 365, 5, 115, 0, 0, 365, 10, 1, 0, 0, 0, 366, 367, 5, 97, 0, 0, 367, 368, 5, 108, 0, 0, 368, 369, 5, 108, 0, 0, 369, 12, 1, 0, 0, 0, 370, 371, 5, 97, 0, 0, 371, 372, 5, 110, 0, 0, 372, 373, 5, 121, 0, 0, 373, 14, 1, 0, 0, 0, 374, 375, 5, 97, 0, 0, 375, 376, 5, 115, 0, 0, 376, 377, 5, 105, 0, 0, 377, 378, 5, 110, 0, 0, 378, 16, 1, 0, 0, 0, 379, 380, 5, 97, 0, 0, 380, 381, 5, 116, 0, 0, 381, 382, 5, 97, 0, 0, 382, 383, 5, 110, 0, 0, 383, 18, 1, 0, 0, 0, 384, 385, 5, 97, 0, 0, 385, 386, 5, 118, 0, 0, 386, 387, 5, 103, 0, 0, 387, 20, 1, 0, 0, 0, 388, 389, 5, 99, 0, 0, 389, 390, 5, 101, 0, 0, 390, 391, 5, 105, 0, 0, 391, 392, 5, 108, 0, 0, 392, 393, 5, 105, 0, 0, 393, 394, 5, 110, 0, 0, 394, 395, 5, 103, 0, 0, 395, 22, 1, 0, 0, 0, 396, 397, 5, 99, 0, 0, 397, 398, 5, 111, 0, 0, 398, 399, 5, 115, 0, 0, 399, 24, 1, 0, 0, 0, 400, 401, 5, 99, 0, 0, 401, 402, 5, 111, 0, 0, 402, 403, 5, 117, 0, 0, 403, 404, 5, 110, 0, 0, 404, 405, 5, 116, 0, 0, 405, 26, 1, 0, 0, 0, 406, 407, 5, 99, 0, 0, 407, 408, 5, 114, 0, 0, 408, 409, 5, 111, 0, 0, 409, 410, 5, 115, 0, 0, 410, 411, 5, 115, 0, 0, 411, 28, 1, 0, 0, 0, 412, 413, 5, 44, 0, 0, 413, 30, 1, 0, 0, 0, 414, 415, 5, 100, 0, 0, 415, 416, 5, 101, 0, 0, 416, 417, 5, 108, 0, 0, 417, 418, 5, 101, 0, 0, 418, 419, 5, 116, 0, 0, 419, 420, 5, 101, 0, 0, 420, 32, 1, 0, 0, 0, 421, 422, 5, 100, 0, 0, 422, 423, 5, 101, 0, 0, 423, 424, 5, 108, 0, 0, 424, 425, 5, 116, 0, 0, 425, 426, 5, 97, 0, 0, 426, 427, 5, 115, 0, 0, 427, 34, 1, 0, 0, 0, 428, 429, 5, 100, 0, 0, 429, 430, 5, 101, 0, 0, 430, 431, 5, 118, 0, 0, 431, 36, 1, 0, 0, 0, 432, 433, 5, 100, 0, 0, 433, 434, 5, 105, 0, 0, 434, 435, 5, 115, 0, 0, 435, 436, 5, 116, 0, 0, 436, 437, 5, 105, 0, 0, 437, 438, 5, 110, 0, 0, 438, 439, 5, 99, 0, 0, 439, 440, 5, 116, 0, 0, 440, 38, 1, 0, 0, 0, 441, 442, 5, 100, 0, 0, 442, 443, 5, 105, 0, 0, 443, 444, 5, 118, 0, 0, 444, 40, 1, 0, 0, 0, 445, 446, 5, 100, 0, 0, 446, 447, 5, 114, 0, 0, 447, 448, 5, 111, 0, 0, 448, 449, 5, 112, 0, 0, 449, 42, 1, 0, 0, 0, 450, 451, 5, 101, 0, 0, 451, 452, 5, 97, 0, 0, 452, 453, 5, 99, 0, 0, 453, 454, 5, 104, 0, 0, 454, 44, 1, 0, 0, 0, 455, 456, 5, 101, 0, 0, 456, 457, 5, 110, 0, 0, 457, 458, 5, 108, 0, 0, 458, 459, 5, 105, 0, 0, 459, 460, 5, 115, 0, 0, 460, 461, 5, 116, 0, 0, 461, 46, 1, 0, 0, 0, 462, 463, 5, 101, 0, 0, 463, 464, 5, 118, 0, 0, 464, 465, 5, 97, 0, 0, 465, 466, 5, 108, 0, 0, 466, 48, 1, 0, 0, 0, 467, 468, 5, 101, 0, 0, 468, 469, 5, 120, 0, 0, 469, 470, 5, 99, 0, 0, 470, 471, 5, 101, 0, 0, 471, 472, 5, 112, 0, 0, 472, 473, 5, 116, 0, 0, 473, 50, 1, 0, 0, 0, 474, 475, 5, 101, 0, 0, 475, 476, 5, 120, 0, 0, 476, 477, 5, 101, 0, 0, 477, 478, 5, 99, 0, 0, 478, 52, 1, 0, 0, 0, 479, 480, 5, 101, 0, 0, 480, 481, 5, 120, 0, 0, 481, 482, 5, 112, 0, 0, 482, 54, 1, 0, 0, 0, 483, 484, 5, 102, 0, 0, 484, 485, 5, 98, 0, 0, 485, 486, 5, 121, 0, 0, 486, 56, 1, 0, 0, 0, 487, 488, 5, 102, 0, 0, 488, 489, 5, 105, 0, 0, 489, 490, 5, 108, 0, 0, 490, 491, 5, 108, 0, 0, 491, 58, 1, 0, 0, 0, 492, 493, 5, 102, 0, 0, 493, 494, 5, 105, 0, 0, 494, 495, 5, 114, 0, 0, 495, 496, 5, 115, 0, 0, 496, 497, 5, 116, 0, 0, 497, 60, 1, 0, 0, 0, 498, 499, 5, 102, 0, 0, 499, 500, 5, 108, 0, 0, 500, 501, 5, 105, 0, 0, 501, 502, 5, 112, 0, 0, 502, 62, 1, 0, 0, 0, 503, 504, 5, 102, 0, 0, 504, 505, 5, 108, 0, 0, 505, 506, 5, 111, 0, 0, 506, 507, 5, 111, 0, 0, 507, 508, 5, 114, 0, 0, 508, 64, 1, 0, 0, 0, 509, 510, 5, 103, 0, 0, 510, 511, 5, 101, 0, 0, 511, 512, 5, 116, 0, 0, 512, 66, 1, 0, 0, 0, 513, 514, 5, 103, 0, 0, 514, 515, 5, 114, 0, 0, 515, 516, 5, 111, 0, 0, 516, 517, 5, 117, 0, 0, 517, 518, 5, 112, 0, 0, 518, 68, 1, 0, 0, 0, 519, 520, 5, 103, 0, 0, 520, 521, 5, 116, 0, 0, 521, 522, 5, 105, 0, 0, 522, 523, 5, 109, 0, 0, 523, 524, 5, 101, 0, 0, 524, 70, 1, 0, 0, 0, 525, 526, 5, 104, 0, 0, 526, 527, 5, 99, 0, 0, 527, 528, 5, 108, 0, 0, 528, 529, 5, 111, 0, 0, 529, 530, 5, 115, 0, 0, 530, 531, 5, 101, 0, 0, 531, 72, 1, 0, 0, 0, 532, 533, 5, 104, 0, 0, 533, 534, 5, 99, 0, 0, 534, 535, 5, 111, 0, 0, 535, 536, 5, 117, 0, 0, 536, 537, 5, 110, 0, 0, 537, 538, 5, 116, 0, 0, 538, 74, 1, 0, 0, 0, 539, 540, 5, 104, 0, 0, 540, 541, 5, 100, 0, 0, 541, 542, 5, 101, 0, 0, 542, 543, 5, 108, 0, 0, 543, 76, 1, 0, 0, 0, 544, 545, 5, 104, 0, 0, 545, 546, 5, 111, 0, 0, 546, 547, 5, 112, 0, 0, 547, 548, 5, 101, 0, 0, 548, 549, 5, 110, 0, 0, 549, 78, 1, 0, 0, 0, 550, 551, 5, 104, 0, 0, 551, 552, 5, 115, 0, 0, 552, 553, 5, 121, 0, 0, 553, 554, 5, 109, 0, 0, 554, 80, 1, 0, 0, 0, 555, 556, 5, 105, 0, 0, 556, 557, 5, 97, 0, 0, 557, 558, 5, 115, 0, 0, 558, 559, 5, 99, 0, 0, 559, 82, 1, 0, 0, 0, 560, 561, 5, 105, 0, 0, 561, 562, 5, 100, 0, 0, 562, 563, 5, 101, 0, 0, 563, 564, 5, 115, 0, 0, 564, 565, 5, 99, 0, 0, 565, 84, 1, 0, 0, 0, 566, 567, 5, 105, 0, 0, 567, 568, 5, 106, 0, 0, 568, 86, 1, 0, 0, 0, 569, 570, 5, 105, 0, 0, 570, 571, 5, 110, 0, 0, 571, 88, 1, 0, 0, 0, 572, 573, 5, 105, 0, 0, 573, 574, 5, 110, 0, 0, 574, 575, 5, 115, 0, 0, 575, 576, 5, 101, 0, 0, 576, 577, 5, 114, 0, 0, 577, 578, 5, 116, 0, 0, 578, 90, 1, 0, 0, 0, 579, 580, 5, 105, 0, 0, 580, 581, 5, 110, 0, 0, 581, 582, 5, 116, 0, 0, 582, 583, 5, 101, 0, 0, 583, 584, 5, 114, 0, 0, 584, 92, 1, 0, 0, 0, 585, 586, 5, 105, 0, 0, 586, 587, 5, 110, 0, 0, 587, 588, 5, 118, 0, 0, 588, 94, 1, 0, 0, 0, 589, 590, 5, 107, 0, 0, 590, 591, 5, 101, 0, 0, 591, 592, 5, 121, 0, 0, 592, 593, 5, 115, 0, 0, 593, 96, 1, 0, 0, 0, 594, 595, 5, 108, 0, 0, 595, 596, 5, 97, 0, 0, 596, 597, 5, 115, 0, 0, 597, 598, 5, 116, 0, 0, 598, 98, 1, 0, 0, 0, 599, 600, 5, 108, 0, 0, 600, 601, 5, 105, 0, 0, 601, 602, 5, 107, 0, 0, 602, 603, 5, 101, 0, 0, 603, 100, 1, 0, 0, 0, 604, 605, 5, 108, 0, 0, 605, 606, 5, 105, 0, 0, 606, 607, 5, 115, 0, 0, 607, 608, 5, 116, 0, 0, 608, 102, 1, 0, 0, 0, 609, 610, 5, 108, 0, 0, 610, 611, 5, 106, 0, 0, 611, 104, 1, 0, 0, 0, 612, 613, 5, 108, 0, 0, 613, 614, 5, 111, 0, 0, 614, 615, 5, 97, 0, 0, 615, 616, 5, 100, 0, 0, 616, 106, 1, 0, 0, 0, 617, 618, 5, 108, 0, 0, 618, 619, 5, 111, 0, 0, 619, 620, 5, 103, 0, 0, 620, 108, 1, 0, 0, 0, 621, 622, 5, 108, 0, 0, 622, 623, 5, 111, 0, 0, 623, 624, 5, 119, 0, 0, 624, 625, 5, 101, 0, 0, 625, 626, 5, 114, 0, 0, 626, 110, 1, 0, 0, 0, 627, 628, 5, 108, 0, 0, 628, 629, 5, 115, 0, 0, 629, 630, 5, 113, 0, 0, 630, 112, 1, 0, 0, 0, 631, 632, 5, 108, 0, 0, 632, 633, 5, 116, 0, 0, 633, 634, 5, 105, 0, 0, 634, 635, 5, 109, 0, 0, 635, 636, 5, 101, 0, 0, 636, 114, 1, 0, 0, 0, 637, 638, 5, 108, 0, 0, 638, 639, 5, 116, 0, 0, 639, 640, 5, 114, 0, 0, 640, 641, 5, 105, 0, 0, 641, 642, 5, 109, 0, 0, 642, 116, 1, 0, 0, 0, 643, 644, 5, 109, 0, 0, 644, 645, 5, 97, 0, 0, 645, 646, 5, 118, 0, 0, 646, 647, 5, 103, 0, 0, 647, 118, 1, 0, 0, 0, 648, 649, 5, 109, 0, 0, 649, 650, 5, 97, 0, 0, 650, 651, 5, 120, 0, 0, 651, 120, 1, 0, 0, 0, 652, 653, 5, 109, 0, 0, 653, 654, 5, 97, 0, 0, 654, 655, 5, 120, 0, 0, 655, 656, 5, 115, 0, 0, 656, 122, 1, 0, 0, 0, 657, 658, 5, 109, 0, 0, 658, 659, 5, 99, 0, 0, 659, 660, 5, 111, 0, 0, 660, 661, 5, 117, 0, 0, 661, 662, 5, 110, 0, 0, 662, 663, 5, 116, 0, 0, 663, 124, 1, 0, 0, 0, 664, 665, 5, 109, 0, 0, 665, 666, 5, 100, 0, 0, 666, 667, 5, 53, 0, 0, 667, 126, 1, 0, 0, 0, 668, 669, 5, 109, 0, 0, 669, 670, 5, 100, 0, 0, 670, 671, 5, 101, 0, 0, 671, 672, 5, 118, 0, 0, 672, 128, 1, 0, 0, 0, 673, 674, 5, 109, 0, 0, 674, 675, 5, 101, 0, 0, 675, 676, 5, 100, 0, 0, 676, 130, 1, 0, 0, 0, 677, 678, 5, 109, 0, 0, 678, 679, 5, 101, 0, 0, 679, 680, 5, 116, 0, 0, 680, 681, 5, 97, 0, 0, 681, 132, 1, 0, 0, 0, 682, 683, 5, 109, 0, 0, 683, 684, 5, 105, 0, 0, 684, 685, 5, 110, 0, 0, 685, 134, 1, 0, 0, 0, 686, 687, 5, 109, 0, 0, 687, 688, 5, 105, 0, 0, 688, 689, 5, 110, 0, 0, 689, 690, 5, 115, 0, 0, 690, 136, 1, 0, 0, 0, 691, 692, 5, 109, 0, 0, 692, 693, 5, 109, 0, 0, 693, 694, 5, 97, 0, 0, 694, 695, 5, 120, 0, 0, 695, 138, 1, 0, 0, 0, 696, 697, 5, 109, 0, 0, 697, 698, 5, 109, 0, 0, 698, 699, 5, 105, 0, 0, 699, 700, 5, 110, 0, 0, 700, 140, 1, 0, 0, 0, 701, 702, 5, 109, 0, 0, 702, 703, 5, 109, 0, 0, 703, 704, 5, 117, 0, 0, 704, 142, 1, 0, 0, 0, 705, 706, 5, 109, 0, 0, 706, 707, 5, 111, 0, 0, 707, 708, 5, 100, 0, 0, 708, 144, 1, 0, 0, 0, 709, 710, 5, 109, 0, 0, 710, 711, 5, 115, 0, 0, 711, 712, 5, 117, 0, 0, 712, 713, 5, 109, 0, 0, 713, 146, 1, 0, 0, 0, 714, 715, 5, 110, 0, 0, 715, 716, 5, 101, 0, 0, 716, 717, 5, 103, 0, 0, 717, 148, 1, 0, 0, 0, 718, 719, 5, 110, 0, 0, 719, 720, 5, 101, 0, 0, 720, 721, 5, 120, 0, 0, 721, 722, 5, 116, 0, 0, 722, 150, 1, 0, 0, 0, 723, 724, 5, 110, 0, 0, 724, 725, 5, 117, 0, 0, 725, 726, 5, 108, 0, 0, 726, 727, 5, 108, 0, 0, 727, 152, 1, 0, 0, 0, 728, 729, 5, 111, 0, 0, 729, 730, 5, 118, 0, 0, 730, 731, 5, 101, 0, 0, 731, 732, 5, 114, 0, 0, 732, 154, 1, 0, 0, 0, 733, 734, 5, 112, 0, 0, 734, 735, 5, 97, 0, 0, 735, 736, 5, 114, 0, 0, 736, 737, 5, 115, 0, 0, 737, 738, 5, 101, 0, 0, 738, 156, 1, 0, 0, 0, 739, 740, 5, 112, 0, 0, 740, 741, 5, 101, 0, 0, 741, 742, 5, 97, 0, 0, 742, 743, 5, 99, 0, 0, 743, 744, 5, 104, 0, 0, 744, 158, 1, 0, 0, 0, 745, 746, 5, 112, 0, 0, 746, 747, 5, 106, 0, 0, 747, 160, 1, 0, 0, 0, 748, 749, 5, 112, 0, 0, 749, 750, 5, 108, 0, 0, 750, 751, 5, 105, 0, 0, 751, 752, 5, 115, 0, 0, 752, 753, 5, 116, 0, 0, 753, 162, 1, 0, 0, 0, 754, 755, 5, 112, 0, 0, 755, 756, 5, 114, 0, 0, 756, 757, 5, 100, 0, 0, 757, 164, 1, 0, 0, 0, 758, 759, 5, 112, 0, 0, 759, 760, 5, 114, 0, 0, 760, 761, 5, 101, 0, 0, 761, 762, 5, 118, 0, 0, 762, 166, 1, 0, 0, 0, 763, 764, 5, 112, 0, 0, 764, 765, 5, 114, 0, 0, 765, 766, 5, 105, 0, 0, 766, 767, 5, 111, 0, 0, 767, 768, 5, 114, 0, 0, 768, 168, 1, 0, 0, 0, 769, 770, 5, 114, 0, 0, 770, 771, 5, 97, 0, 0, 771, 772, 5, 110, 0, 0, 772, 773, 5, 100, 0, 0, 773, 170, 1, 0, 0, 0, 774, 775, 5, 114, 0, 0, 775, 776, 5, 97, 0, 0, 776, 777, 5, 110, 0, 0, 777, 778, 5, 107, 0, 0, 778, 172, 1, 0, 0, 0, 779, 780, 5, 114, 0, 0, 780, 781, 5, 97, 0, 0, 781, 782, 5, 116, 0, 0, 782, 783, 5, 105, 0, 0, 783, 784, 5, 111, 0, 0, 784, 785, 5, 115, 0, 0, 785, 174, 1, 0, 0, 0, 786, 787, 5, 114, 0, 0, 787, 788, 5, 97, 0, 0, 788, 789, 5, 122, 0, 0, 789, 790, 5, 101, 0, 0, 790, 176, 1, 0, 0, 0, 791, 792, 5, 114, 0, 0, 792, 793, 5, 101, 0, 0, 793, 794, 5, 97, 0, 0, 794, 795, 5, 100, 0, 0, 795, 796, 5, 48, 0, 0, 796, 178, 1, 0, 0, 0, 797, 798, 5, 114, 0, 0, 798, 799, 5, 101, 0, 0, 799, 800, 5, 97, 0, 0, 800, 801, 5, 100, 0, 0, 801, 802, 5, 49, 0, 0, 802, 180, 1, 0, 0, 0, 803, 804, 5, 114, 0, 0, 804, 805, 5, 101, 0, 0, 805, 806, 5, 99, 0, 0, 806, 807, 5, 105, 0, 0, 807, 808, 5, 112, 0, 0, 808, 809, 5, 114, 0, 0, 809, 810, 5, 111, 0, 0, 810, 811, 5, 99, 0, 0, 811, 812, 5, 97, 0, 0, 812, 813, 5, 108, 0, 0, 813, 182, 1, 0, 0, 0, 814, 815, 5, 114, 0, 0, 815, 816, 5, 101, 0, 0, 816, 817, 5, 118, 0, 0, 817, 818, 5, 101, 0, 0, 818, 819, 5, 114, 0, 0, 819, 820, 5, 115, 0, 0, 820, 821, 5, 101, 0, 0, 821, 184, 1, 0, 0, 0, 822, 823, 5, 114, 0, 0, 823, 824, 5, 108, 0, 0, 824, 825, 5, 111, 0, 0, 825, 826, 5, 97, 0, 0, 826, 827, 5, 100, 0, 0, 827, 186, 1, 0, 0, 0, 828, 829, 5, 114, 0, 0, 829, 830, 5, 111, 0, 0, 830, 831, 5, 116, 0, 0, 831, 832, 5, 97, 0, 0, 832, 833, 5, 116, 0, 0, 833, 834, 5, 101, 0, 0, 834, 188, 1, 0, 0, 0, 835, 836, 5, 114, 0, 0, 836, 837, 5, 115, 0, 0, 837, 838, 5, 97, 0, 0, 838, 839, 5, 118, 0, 0, 839, 840, 5, 101, 0, 0, 840, 190, 1, 0, 0, 0, 841, 842, 5, 114, 0, 0, 842, 843, 5, 116, 0, 0, 843, 844, 5, 114, 0, 0, 844, 845, 5, 105, 0, 0, 845, 846, 5, 109, 0, 0, 846, 192, 1, 0, 0, 0, 847, 848, 5, 115, 0, 0, 848, 849, 5, 97, 0, 0, 849, 850, 5, 118, 0, 0, 850, 851, 5, 101, 0, 0, 851, 194, 1, 0, 0, 0, 852, 853, 5, 115, 0, 0, 853, 854, 5, 99, 0, 0, 854, 855, 5, 97, 0, 0, 855, 856, 5, 110, 0, 0, 856, 196, 1, 0, 0, 0, 857, 858, 5, 115, 0, 0, 858, 859, 5, 101, 0, 0, 859, 860, 5, 108, 0, 0, 860, 861, 5, 101, 0, 0, 861, 862, 5, 99, 0, 0, 862, 863, 5, 116, 0, 0, 863, 198, 1, 0, 0, 0, 864, 865, 5, 115, 0, 0, 865, 866, 5, 101, 0, 0, 866, 867, 5, 116, 0, 0, 867, 200, 1, 0, 0, 0, 868, 869, 5, 115, 0, 0, 869, 870, 5, 104, 0, 0, 870, 871, 5, 111, 0, 0, 871, 872, 5, 119, 0, 0, 872, 202, 1, 0, 0, 0, 873, 874, 5, 115, 0, 0, 874, 875, 5, 105, 0, 0, 875, 876, 5, 103, 0, 0, 876, 877, 5, 110, 0, 0, 877, 878, 5, 117, 0, 0, 878, 879, 5, 109, 0, 0, 879, 204, 1, 0, 0, 0, 880, 881, 5, 115, 0, 0, 881, 882, 5, 105, 0, 0, 882, 883, 5, 110, 0, 0, 883, 206, 1, 0, 0, 0, 884, 885, 5, 115, 0, 0, 885, 886, 5, 113, 0, 0, 886, 887, 5, 114, 0, 0, 887, 888, 5, 116, 0, 0, 888, 208, 1, 0, 0, 0, 889, 890, 5, 115, 0, 0, 890, 891, 5, 115, 0, 0, 891, 892, 5, 114, 0, 0, 892, 210, 1, 0, 0, 0, 893, 894, 5, 115, 0, 0, 894, 895, 5, 116, 0, 0, 895, 896, 5, 114, 0, 0, 896, 897, 5, 105, 0, 0, 897, 898, 5, 110, 0, 0, 898, 899, 5, 103, 0, 0, 899, 212, 1, 0, 0, 0, 900, 901, 5, 115, 0, 0, 901, 902, 5, 117, 0, 0, 902, 903, 5, 98, 0, 0, 903, 904, 5, 108, 0, 0, 904, 905, 5, 105, 0, 0, 905, 906, 5, 115, 0, 0, 906, 907, 5, 116, 0, 0, 907, 214, 1, 0, 0, 0, 908, 909, 5, 115, 0, 0, 909, 910, 5, 117, 0, 0, 910, 911, 5, 109, 0, 0, 911, 216, 1, 0, 0, 0, 912, 913, 5, 115, 0, 0, 913, 914, 5, 117, 0, 0, 914, 915, 5, 109, 0, 0, 915, 916, 5, 115, 0, 0, 916, 218, 1, 0, 0, 0, 917, 918, 5, 115, 0, 0, 918, 919, 5, 118, 0, 0, 919, 220, 1, 0, 0, 0, 920, 921, 5, 115, 0, 0, 921, 922, 5, 121, 0, 0, 922, 923, 5, 115, 0, 0, 923, 924, 5, 116, 0, 0, 924, 925, 5, 101, 0, 0, 925, 926, 5, 109, 0, 0, 926, 222, 1, 0, 0, 0, 927, 928, 5, 116, 0, 0, 928, 929, 5, 97, 0, 0, 929, 930, 5, 98, 0, 0, 930, 931, 5, 108, 0, 0, 931, 932, 5, 101, 0, 0, 932, 933, 5, 115, 0, 0, 933, 224, 1, 0, 0, 0, 934, 935, 5, 116, 0, 0, 935, 936, 5, 97, 0, 0, 936, 937, 5, 110, 0, 0, 937, 226, 1, 0, 0, 0, 938, 939, 5, 116, 0, 0, 939, 940, 5, 105, 0, 0, 940, 941, 5, 108, 0, 0, 941, 228, 1, 0, 0, 0, 942, 943, 5, 116, 0, 0, 943, 944, 5, 114, 0, 0, 944, 945, 5, 105, 0, 0, 945, 946, 5, 109, 0, 0, 946, 230, 1, 0, 0, 0, 947, 948, 5, 116, 0, 0, 948, 949, 5, 121, 0, 0, 949, 950, 5, 112, 0, 0, 950, 951, 5, 101, 0, 0, 951, 232, 1, 0, 0, 0, 952, 953, 5, 117, 0, 0, 953, 954, 5, 106, 0, 0, 954, 234, 1, 0, 0, 0, 955, 956, 5, 117, 0, 0, 956, 957, 5, 110, 0, 0, 957, 958, 5, 103, 0, 0, 958, 959, 5, 114, 0, 0, 959, 960, 5, 111, 0, 0, 960, 961, 5, 117, 0, 0, 961, 962, 5, 112, 0, 0, 962, 236, 1, 0, 0, 0, 963, 964, 5, 117, 0, 0, 964, 965, 5, 110, 0, 0, 965, 966, 5, 105, 0, 0, 966, 967, 5, 111, 0, 0, 967, 968, 5, 110, 0, 0, 968, 238, 1, 0, 0, 0, 969, 970, 5, 117, 0, 0, 970, 971, 5, 112, 0, 0, 971, 972, 5, 100, 0, 0, 972, 973, 5, 97, 0, 0, 973, 974, 5, 116, 0, 0, 974, 975, 5, 101, 0, 0, 975, 240, 1, 0, 0, 0, 976, 977, 5, 117, 0, 0, 977, 978, 5, 112, 0, 0, 978, 979, 5, 112, 0, 0, 979, 980, 5, 101, 0, 0, 980, 981, 5, 114, 0, 0, 981, 242, 1, 0, 0, 0, 982, 983, 5, 117, 0, 0, 983, 984, 5, 112, 0, 0, 984, 985, 5, 115, 0, 0, 985, 986, 5, 101, 0, 0, 986, 987, 5, 114, 0, 0, 987, 988, 5, 116, 0, 0, 988, 244, 1, 0, 0, 0, 989, 990, 5, 118, 0, 0, 990, 991, 5, 97, 0, 0, 991, 992, 5, 108, 0, 0, 992, 993, 5, 117, 0, 0, 993, 994, 5, 101, 0, 0, 994, 246, 1, 0, 0, 0, 995, 996, 5, 118, 0, 0, 996, 997, 5, 97, 0, 0, 997, 998, 5, 114, 0, 0, 998, 248, 1, 0, 0, 0, 999, 1000, 5, 118, 0, 0, 1000, 1001, 5, 105, 0, 0, 1001, 1002, 5, 101, 0, 0, 1002, 1003, 5, 119, 0, 0, 1003, 250, 1, 0, 0, 0, 1004, 1005, 5, 118, 0, 0, 1005, 1006, 5, 115, 0, 0, 1006, 252, 1, 0, 0, 0, 1007, 1008, 5, 119, 0, 0, 1008, 1009, 5, 97, 0, 0, 1009, 1010, 5, 118, 0, 0, 1010, 1011, 5, 103, 0, 0, 1011, 254, 1, 0, 0, 0, 1012, 1013, 5, 119, 0, 0, 1013, 1014, 5, 104, 0, 0, 1014, 1015, 5, 101, 0, 0, 1015, 1016, 5, 114, 0, 0, 1016, 1017, 5, 101, 0, 0, 1017, 256, 1, 0, 0, 0, 1018, 1019, 5, 119, 0, 0, 1019, 1020, 5, 105, 0, 0, 1020, 1021, 5, 116, 0, 0, 1021, 1022, 5, 104, 0, 0, 1022, 1023, 5, 105, 0, 0, 1023, 1024, 5, 110, 0, 0, 1024, 258, 1, 0, 0, 0, 1025, 1026, 5, 119, 0, 0, 1026, 1027, 5, 106, 0, 0, 1027, 1028, 5, 49, 0, 0, 1028, 260, 1, 0, 0, 0, 1029, 1030, 5, 119, 0, 0, 1030, 1031, 5, 106, 0, 0, 1031, 1032, 5, 50, 0, 0, 1032, 262, 1, 0, 0, 0, 1033, 1034, 5, 119, 0, 0, 1034, 1035, 5, 119, 0, 0, 1035, 264, 1, 0, 0, 0, 1036, 1037, 5, 120, 0, 0, 1037, 1038, 5, 97, 0, 0, 1038, 1039, 5, 115, 0, 0, 1039, 1040, 5, 99, 0, 0, 1040, 266, 1, 0, 0, 0, 1041, 1042, 5, 120, 0, 0, 1042, 1043, 5, 98, 0, 0, 1043, 1044, 5, 97, 0, 0, 1044, 1045, 5, 114, 0, 0, 1045, 268, 1, 0, 0, 0, 1046, 1047, 5, 120, 0, 0, 1047, 1048, 5, 99, 0, 0, 1048, 1049, 5, 111, 0, 0, 1049, 1050, 5, 108, 0, 0, 1050, 1051, 5, 115, 0, 0, 1051, 270, 1, 0, 0, 0, 1052, 1053, 5, 120, 0, 0, 1053, 1054, 5, 100, 0, 0, 1054, 1055, 5, 101, 0, 0, 1055, 1056, 5, 115, 0, 0, 1056, 1057, 5, 99, 0, 0, 1057, 272, 1, 0, 0, 0, 1058, 1059, 5, 120, 0, 0, 1059, 1060, 5, 101, 0, 0, 1060, 1061, 5, 120, 0, 0, 1061, 1062, 5, 112, 0, 0, 1062, 274, 1, 0, 0, 0, 1063, 1064, 5, 120, 0, 0, 1064, 1065, 5, 103, 0, 0, 1065, 1066, 5, 114, 0, 0, 1066, 1067, 5, 111, 0, 0, 1067, 1068, 5, 117, 0, 0, 1068, 1069, 5, 112, 0, 0, 1069, 276, 1, 0, 0, 0, 1070, 1071, 5, 120, 0, 0, 1071, 1072, 5, 107, 0, 0, 1072, 1073, 5, 101, 0, 0, 1073, 1074, 5, 121, 0, 0, 1074, 278, 1, 0, 0, 0, 1075, 1076, 5, 120, 0, 0, 1076, 1077, 5, 108, 0, 0, 1077, 1078, 5, 111, 0, 0, 1078, 1079, 5, 103, 0, 0, 1079, 280, 1, 0, 0, 0, 1080, 1081, 5, 120, 0, 0, 1081, 1082, 5, 112, 0, 0, 1082, 1083, 5, 114, 0, 0, 1083, 1084, 5, 101, 0, 0, 1084, 1085, 5, 118, 0, 0, 1085, 282, 1, 0, 0, 0, 1086, 1087, 5, 120, 0, 0, 1087, 1088, 5, 114, 0, 0, 1088, 1089, 5, 97, 0, 0, 1089, 1090, 5, 110, 0, 0, 1090, 1091, 5, 107, 0, 0, 1091, 284, 1, 0, 0, 0, 1092, 1093, 5, 120, 0, 0, 1093, 1094, 5, 114, 0, 0, 1094, 1095, 5, 97, 0, 0, 1095, 1096, 5, 110, 0, 0, 1096, 1097, 5, 107, 0, 0, 1097, 1098, 5, 101, 0, 0, 1098, 1099, 5, 100, 0, 0, 1099, 286, 1, 0, 0, 0, 1100, 1101, 5, 120, 0, 0, 1101, 1102, 5, 114, 0, 0, 1102, 1103, 5, 101, 0, 0, 1103, 1104, 5, 99, 0, 0, 1104, 1105, 5, 115, 0, 0, 1105, 288, 1, 0, 0, 0, 1106, 1107, 5, 120, 0, 0, 1107, 1108, 5, 114, 0, 0, 1108, 1109, 5, 111, 0, 0, 1109, 1110, 5, 119, 0, 0, 1110, 1111, 5, 115, 0, 0, 1111, 290, 1, 0, 0, 0, 1112, 1113, 5, 120, 0, 0, 1113, 1114, 5, 115, 0, 0, 1114, 1115, 5, 115, 0, 0, 1115, 292, 1, 0, 0, 0, 1116, 1117, 5, 120, 0, 0, 1117, 1118, 5, 116, 0, 0, 1118, 1119, 5, 121, 0, 0, 1119, 1120, 5, 112, 0, 0, 1120, 1121, 5, 101, 0, 0, 1121, 294, 1, 0, 0, 0, 1122, 1123, 5, 121, 0, 0, 1123, 1124, 5, 105, 0, 0, 1124, 1125, 5, 101, 0, 0, 1125, 1126, 5, 108, 0, 0, 1126, 1127, 5, 100, 0, 0, 1127, 296, 1, 0, 0, 0, 1128, 1129, 5, 122, 0, 0, 1129, 1130, 5, 105, 0, 0, 1130, 1131, 5, 112, 0, 0, 1131, 298, 1, 0, 0, 0, 1132, 1133, 5, 43, 0, 0, 1133, 300, 1, 0, 0, 0, 1134, 1135, 5, 45, 0, 0, 1135, 302, 1, 0, 0, 0, 1136, 1137, 5, 42, 0, 0, 1137, 304, 1, 0, 0, 0, 1138, 1139, 5, 37, 0, 0, 1139, 306, 1, 0, 0, 0, 1140, 1141, 5, 61, 0, 0, 1141, 308, 1, 0, 0, 0, 1142, 1143, 5, 60, 0, 0, 1143, 1144, 5, 62, 0, 0, 1144, 310, 1, 0, 0, 0, 1145, 1146, 5, 60, 0, 0, 1146, 312, 1, 0, 0, 0, 1147, 1148, 5, 60, 0, 0, 1148, 1149, 5, 61, 0, 0, 1149, 314, 1, 0, 0, 0, 1150, 1151, 5, 62, 0, 0, 1151, 316, 1, 0, 0, 0, 1152, 1153, 5, 62, 0, 0, 1153, 1154, 5, 61, 0, 0, 1154, 318, 1, 0, 0, 0, 1155, 1156, 5, 97, 0, 0, 1156, 1157, 5, 110, 0, 0, 1157, 1158, 5, 100, 0, 0, 1158, 320, 1, 0, 0, 0, 1159, 1160, 5, 111, 0, 0, 1160, 1161, 5, 114, 0, 0, 1161, 322, 1, 0, 0, 0, 1162, 1163, 5, 110, 0, 0, 1163, 1164, 5, 111, 0, 0, 1164, 1165, 5, 116, 0, 0, 1165, 324, 1, 0, 0, 0, 1166, 1167, 5, 105, 0, 0, 1167, 1168, 5, 110, 0, 0, 1168, 1169, 5, 116, 0, 0, 1169, 326, 1, 0, 0, 0, 1170, 1171, 5, 108, 0, 0, 1171, 1172, 5, 111, 0, 0, 1172, 1173, 5, 110, 0, 0, 1173, 1174, 5, 103, 0, 0, 1174, 328, 1, 0, 0, 0, 1175, 1176, 5, 102, 0, 0, 1176, 1177, 5, 108, 0, 0, 1177, 1178, 5, 111, 0, 0, 1178, 1179, 5, 97, 0, 0, 1179, 1180, 5, 116, 0, 0, 1180, 330, 1, 0, 0, 0, 1181, 1182, 5, 100, 0, 0, 1182, 1183, 5, 111, 0, 0, 1183, 1184, 5, 117, 0, 0, 1184, 1185, 5, 98, 0, 0, 1185, 1186, 5, 108, 0, 0, 1186, 1187, 5, 101, 0, 0, 1187, 332, 1, 0, 0, 0, 1188, 1189, 5, 99, 0, 0, 1189, 1190, 5, 104, 0, 0, 1190, 1191, 5, 97, 0, 0, 1191, 1192, 5, 114, 0, 0, 1192, 334, 1, 0, 0, 0, 1193, 1194, 5, 115, 0, 0, 1194, 1195, 5, 121, 0, 0, 1195, 1196, 5, 109, 0, 0, 1196, 1197, 5, 98, 0, 0, 1197, 1198, 5, 111, 0, 0, 1198, 1199, 5, 108, 0, 0, 1199, 336, 1, 0, 0, 0, 1200, 1201, 5, 116, 0, 0, 1201, 1202, 5, 105, 0, 0, 1202, 1203, 5, 109, 0, 0, 1203, 1204, 5, 101, 0, 0, 1204, 1205, 5, 115, 0, 0, 1205, 1206, 5, 116, 0, 0, 1206, 1207, 5, 97, 0, 0, 1207, 1208, 5, 109, 0, 0, 1208, 1209, 5, 112, 0, 0, 1209, 338, 1, 0, 0, 0, 1210, 1214, 7, 0, 0, 0, 1211, 1213, 7, 1, 0, 0, 1212, 1211, 1, 0, 0, 0, 1213, 1216, 1, 0, 0, 0, 1214, 1212, 1, 0, 0, 0, 1214, 1215, 1, 0, 0, 0, 1215, 340, 1, 0, 0, 0, 1216, 1214, 1, 0, 0, 0, 1217, 1218, 7, 2, 0, 0, 1218, 342, 1, 0, 0, 0, 1219, 1221, 3, 341, 170, 0, 1220, 1219, 1, 0, 0, 0, 1221, 1222, 1, 0, 0, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1230, 1, 0, 0, 0, 1224, 1226, 5, 46, 0, 0, 1225, 1227, 3, 341, 170, 0, 1226, 1225, 1, 0, 0, 0, 1227, 1228, 1, 0, 0, 0, 1228, 1226, 1, 0, 0, 0, 1228, 1229, 1, 0, 0, 0, 1229, 1231, 1, 0, 0, 0, 1230, 1224, 1, 0, 0, 0, 1230, 1231, 1, 0, 0, 0, 1231, 344, 1, 0, 0, 0, 1232, 1237, 5, 34, 0, 0, 1233, 1236, 3, 347, 173, 0, 1234, 1236, 8, 3, 0, 0, 1235, 1233, 1, 0, 0, 0, 1235, 1234, 1, 0, 0, 0, 1236, 1239, 1, 0, 0, 0, 1237, 1235, 1, 0, 0, 0, 1237, 1238, 1, 0, 0, 0, 1238, 1240, 1, 0, 0, 0, 1239, 1237, 1, 0, 0, 0, 1240, 1241, 5, 34, 0, 0, 1241, 346, 1, 0, 0, 0, 1242, 1243, 5, 92, 0, 0, 1243, 1244, 7, 4, 0, 0, 1244, 348, 1, 0, 0, 0, 1245, 1247, 7, 5, 0, 0, 1246, 1245, 1, 0, 0, 0, 1247, 1248, 1, 0, 0, 0, 1248, 1246, 1, 0, 0, 0, 1248, 1249, 1, 0, 0, 0, 1249, 1250, 1, 0, 0, 0, 1250, 1251, 6, 174, 0, 0, 1251, 350, 1, 0, 0, 0, 8, 0, 1214, 1222, 1228, 1230, 1235, 1237, 1248, 1, 6, 0, 0] \ No newline at end of file diff --git a/server/src/utils/antlrGrammars/qLexer.tokens b/server/src/utils/antlrGrammars/qLexer.tokens deleted file mode 100644 index 582f68b7..00000000 --- a/server/src/utils/antlrGrammars/qLexer.tokens +++ /dev/null @@ -1,344 +0,0 @@ -T__0=1 -T__1=2 -T__2=3 -T__3=4 -T__4=5 -T__5=6 -T__6=7 -T__7=8 -T__8=9 -T__9=10 -T__10=11 -T__11=12 -T__12=13 -T__13=14 -T__14=15 -T__15=16 -T__16=17 -T__17=18 -T__18=19 -T__19=20 -T__20=21 -T__21=22 -T__22=23 -T__23=24 -T__24=25 -T__25=26 -T__26=27 -T__27=28 -T__28=29 -T__29=30 -T__30=31 -T__31=32 -T__32=33 -T__33=34 -T__34=35 -T__35=36 -T__36=37 -T__37=38 -T__38=39 -T__39=40 -T__40=41 -T__41=42 -T__42=43 -T__43=44 -T__44=45 -T__45=46 -T__46=47 -T__47=48 -T__48=49 -T__49=50 -T__50=51 -T__51=52 -T__52=53 -T__53=54 -T__54=55 -T__55=56 -T__56=57 -T__57=58 -T__58=59 -T__59=60 -T__60=61 -T__61=62 -T__62=63 -T__63=64 -T__64=65 -T__65=66 -T__66=67 -T__67=68 -T__68=69 -T__69=70 -T__70=71 -T__71=72 -T__72=73 -T__73=74 -T__74=75 -T__75=76 -T__76=77 -T__77=78 -T__78=79 -T__79=80 -T__80=81 -T__81=82 -T__82=83 -T__83=84 -T__84=85 -T__85=86 -T__86=87 -T__87=88 -T__88=89 -T__89=90 -T__90=91 -T__91=92 -T__92=93 -T__93=94 -T__94=95 -T__95=96 -T__96=97 -T__97=98 -T__98=99 -T__99=100 -T__100=101 -T__101=102 -T__102=103 -T__103=104 -T__104=105 -T__105=106 -T__106=107 -T__107=108 -T__108=109 -T__109=110 -T__110=111 -T__111=112 -T__112=113 -T__113=114 -T__114=115 -T__115=116 -T__116=117 -T__117=118 -T__118=119 -T__119=120 -T__120=121 -T__121=122 -T__122=123 -T__123=124 -T__124=125 -T__125=126 -T__126=127 -T__127=128 -T__128=129 -T__129=130 -T__130=131 -T__131=132 -T__132=133 -T__133=134 -T__134=135 -T__135=136 -T__136=137 -T__137=138 -T__138=139 -T__139=140 -T__140=141 -T__141=142 -T__142=143 -T__143=144 -T__144=145 -T__145=146 -T__146=147 -T__147=148 -T__148=149 -PLUS=150 -MINUS=151 -MULTIPLY=152 -DIVIDE=153 -EQUALS=154 -NOT_EQUALS=155 -LESS_THAN=156 -LESS_THAN_OR_EQUAL=157 -GREATER_THAN=158 -GREATER_THAN_OR_EQUAL=159 -AND=160 -OR=161 -NOT=162 -INT=163 -LONG=164 -FLOAT=165 -DOUBLE=166 -CHAR=167 -SYMBOL=168 -TIMESTAMP=169 -ID=170 -DIGIT=171 -NUMBER=172 -STRING=173 -ESC=174 -WS=175 -';'=1 -'('=2 -')'=3 -'abs'=4 -'acos'=5 -'all'=6 -'any'=7 -'asin'=8 -'atan'=9 -'avg'=10 -'ceiling'=11 -'cos'=12 -'count'=13 -'cross'=14 -','=15 -'delete'=16 -'deltas'=17 -'dev'=18 -'distinct'=19 -'div'=20 -'drop'=21 -'each'=22 -'enlist'=23 -'eval'=24 -'except'=25 -'exec'=26 -'exp'=27 -'fby'=28 -'fill'=29 -'first'=30 -'flip'=31 -'floor'=32 -'get'=33 -'group'=34 -'gtime'=35 -'hclose'=36 -'hcount'=37 -'hdel'=38 -'hopen'=39 -'hsym'=40 -'iasc'=41 -'idesc'=42 -'ij'=43 -'in'=44 -'insert'=45 -'inter'=46 -'inv'=47 -'keys'=48 -'last'=49 -'like'=50 -'list'=51 -'lj'=52 -'load'=53 -'log'=54 -'lower'=55 -'lsq'=56 -'ltime'=57 -'ltrim'=58 -'mavg'=59 -'max'=60 -'maxs'=61 -'mcount'=62 -'md5'=63 -'mdev'=64 -'med'=65 -'meta'=66 -'min'=67 -'mins'=68 -'mmax'=69 -'mmin'=70 -'mmu'=71 -'mod'=72 -'msum'=73 -'neg'=74 -'next'=75 -'null'=76 -'over'=77 -'parse'=78 -'peach'=79 -'pj'=80 -'plist'=81 -'prd'=82 -'prev'=83 -'prior'=84 -'rand'=85 -'rank'=86 -'ratios'=87 -'raze'=88 -'read0'=89 -'read1'=90 -'reciprocal'=91 -'reverse'=92 -'rload'=93 -'rotate'=94 -'rsave'=95 -'rtrim'=96 -'save'=97 -'scan'=98 -'select'=99 -'set'=100 -'show'=101 -'signum'=102 -'sin'=103 -'sqrt'=104 -'ssr'=105 -'string'=106 -'sublist'=107 -'sum'=108 -'sums'=109 -'sv'=110 -'system'=111 -'tables'=112 -'tan'=113 -'til'=114 -'trim'=115 -'type'=116 -'uj'=117 -'ungroup'=118 -'union'=119 -'update'=120 -'upper'=121 -'upsert'=122 -'value'=123 -'var'=124 -'view'=125 -'vs'=126 -'wavg'=127 -'where'=128 -'within'=129 -'wj1'=130 -'wj2'=131 -'ww'=132 -'xasc'=133 -'xbar'=134 -'xcols'=135 -'xdesc'=136 -'xexp'=137 -'xgroup'=138 -'xkey'=139 -'xlog'=140 -'xprev'=141 -'xrank'=142 -'xranked'=143 -'xrecs'=144 -'xrows'=145 -'xss'=146 -'xtype'=147 -'yield'=148 -'zip'=149 -'+'=150 -'-'=151 -'*'=152 -'%'=153 -'='=154 -'<>'=155 -'<'=156 -'<='=157 -'>'=158 -'>='=159 -'and'=160 -'or'=161 -'not'=162 -'int'=163 -'long'=164 -'float'=165 -'double'=166 -'char'=167 -'symbol'=168 -'timestamp'=169 diff --git a/server/src/utils/antlrGrammars/qLexer.ts b/server/src/utils/antlrGrammars/qLexer.ts deleted file mode 100644 index 29ca568f..00000000 --- a/server/src/utils/antlrGrammars/qLexer.ts +++ /dev/null @@ -1,1321 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -// Generated from grammars/q.g4 by ANTLR 4.13.0 -// noinspection ES6UnusedImports,JSUnusedGlobalSymbols,JSUnusedLocalSymbols -import { - ATN, - ATNDeserializer, - CharStream, - DFA, - DecisionState, - Lexer, - LexerATNSimulator, - PredictionContextCache, - Token, -} from "antlr4"; -export default class qLexer extends Lexer { - public static readonly T__0 = 1; - public static readonly T__1 = 2; - public static readonly T__2 = 3; - public static readonly T__3 = 4; - public static readonly T__4 = 5; - public static readonly T__5 = 6; - public static readonly T__6 = 7; - public static readonly T__7 = 8; - public static readonly T__8 = 9; - public static readonly T__9 = 10; - public static readonly T__10 = 11; - public static readonly T__11 = 12; - public static readonly T__12 = 13; - public static readonly T__13 = 14; - public static readonly T__14 = 15; - public static readonly T__15 = 16; - public static readonly T__16 = 17; - public static readonly T__17 = 18; - public static readonly T__18 = 19; - public static readonly T__19 = 20; - public static readonly T__20 = 21; - public static readonly T__21 = 22; - public static readonly T__22 = 23; - public static readonly T__23 = 24; - public static readonly T__24 = 25; - public static readonly T__25 = 26; - public static readonly T__26 = 27; - public static readonly T__27 = 28; - public static readonly T__28 = 29; - public static readonly T__29 = 30; - public static readonly T__30 = 31; - public static readonly T__31 = 32; - public static readonly T__32 = 33; - public static readonly T__33 = 34; - public static readonly T__34 = 35; - public static readonly T__35 = 36; - public static readonly T__36 = 37; - public static readonly T__37 = 38; - public static readonly T__38 = 39; - public static readonly T__39 = 40; - public static readonly T__40 = 41; - public static readonly T__41 = 42; - public static readonly T__42 = 43; - public static readonly T__43 = 44; - public static readonly T__44 = 45; - public static readonly T__45 = 46; - public static readonly T__46 = 47; - public static readonly T__47 = 48; - public static readonly T__48 = 49; - public static readonly T__49 = 50; - public static readonly T__50 = 51; - public static readonly T__51 = 52; - public static readonly T__52 = 53; - public static readonly T__53 = 54; - public static readonly T__54 = 55; - public static readonly T__55 = 56; - public static readonly T__56 = 57; - public static readonly T__57 = 58; - public static readonly T__58 = 59; - public static readonly T__59 = 60; - public static readonly T__60 = 61; - public static readonly T__61 = 62; - public static readonly T__62 = 63; - public static readonly T__63 = 64; - public static readonly T__64 = 65; - public static readonly T__65 = 66; - public static readonly T__66 = 67; - public static readonly T__67 = 68; - public static readonly T__68 = 69; - public static readonly T__69 = 70; - public static readonly T__70 = 71; - public static readonly T__71 = 72; - public static readonly T__72 = 73; - public static readonly T__73 = 74; - public static readonly T__74 = 75; - public static readonly T__75 = 76; - public static readonly T__76 = 77; - public static readonly T__77 = 78; - public static readonly T__78 = 79; - public static readonly T__79 = 80; - public static readonly T__80 = 81; - public static readonly T__81 = 82; - public static readonly T__82 = 83; - public static readonly T__83 = 84; - public static readonly T__84 = 85; - public static readonly T__85 = 86; - public static readonly T__86 = 87; - public static readonly T__87 = 88; - public static readonly T__88 = 89; - public static readonly T__89 = 90; - public static readonly T__90 = 91; - public static readonly T__91 = 92; - public static readonly T__92 = 93; - public static readonly T__93 = 94; - public static readonly T__94 = 95; - public static readonly T__95 = 96; - public static readonly T__96 = 97; - public static readonly T__97 = 98; - public static readonly T__98 = 99; - public static readonly T__99 = 100; - public static readonly T__100 = 101; - public static readonly T__101 = 102; - public static readonly T__102 = 103; - public static readonly T__103 = 104; - public static readonly T__104 = 105; - public static readonly T__105 = 106; - public static readonly T__106 = 107; - public static readonly T__107 = 108; - public static readonly T__108 = 109; - public static readonly T__109 = 110; - public static readonly T__110 = 111; - public static readonly T__111 = 112; - public static readonly T__112 = 113; - public static readonly T__113 = 114; - public static readonly T__114 = 115; - public static readonly T__115 = 116; - public static readonly T__116 = 117; - public static readonly T__117 = 118; - public static readonly T__118 = 119; - public static readonly T__119 = 120; - public static readonly T__120 = 121; - public static readonly T__121 = 122; - public static readonly T__122 = 123; - public static readonly T__123 = 124; - public static readonly T__124 = 125; - public static readonly T__125 = 126; - public static readonly T__126 = 127; - public static readonly T__127 = 128; - public static readonly T__128 = 129; - public static readonly T__129 = 130; - public static readonly T__130 = 131; - public static readonly T__131 = 132; - public static readonly T__132 = 133; - public static readonly T__133 = 134; - public static readonly T__134 = 135; - public static readonly T__135 = 136; - public static readonly T__136 = 137; - public static readonly T__137 = 138; - public static readonly T__138 = 139; - public static readonly T__139 = 140; - public static readonly T__140 = 141; - public static readonly T__141 = 142; - public static readonly T__142 = 143; - public static readonly T__143 = 144; - public static readonly T__144 = 145; - public static readonly T__145 = 146; - public static readonly T__146 = 147; - public static readonly T__147 = 148; - public static readonly T__148 = 149; - public static readonly PLUS = 150; - public static readonly MINUS = 151; - public static readonly MULTIPLY = 152; - public static readonly DIVIDE = 153; - public static readonly EQUALS = 154; - public static readonly NOT_EQUALS = 155; - public static readonly LESS_THAN = 156; - public static readonly LESS_THAN_OR_EQUAL = 157; - public static readonly GREATER_THAN = 158; - public static readonly GREATER_THAN_OR_EQUAL = 159; - public static readonly AND = 160; - public static readonly OR = 161; - public static readonly NOT = 162; - public static readonly INT = 163; - public static readonly LONG = 164; - public static readonly FLOAT = 165; - public static readonly DOUBLE = 166; - public static readonly CHAR = 167; - public static readonly SYMBOL = 168; - public static readonly TIMESTAMP = 169; - public static readonly ID = 170; - public static readonly DIGIT = 171; - public static readonly NUMBER = 172; - public static readonly STRING = 173; - public static readonly ESC = 174; - public static readonly WS = 175; - public static readonly EOF = Token.EOF; - - public static readonly channelNames: string[] = [ - "DEFAULT_TOKEN_CHANNEL", - "HIDDEN", - ]; - public static readonly literalNames: (string | null)[] = [ - null, - "';'", - "'('", - "')'", - "'abs'", - "'acos'", - "'all'", - "'any'", - "'asin'", - "'atan'", - "'avg'", - "'ceiling'", - "'cos'", - "'count'", - "'cross'", - "','", - "'delete'", - "'deltas'", - "'dev'", - "'distinct'", - "'div'", - "'drop'", - "'each'", - "'enlist'", - "'eval'", - "'except'", - "'exec'", - "'exp'", - "'fby'", - "'fill'", - "'first'", - "'flip'", - "'floor'", - "'get'", - "'group'", - "'gtime'", - "'hclose'", - "'hcount'", - "'hdel'", - "'hopen'", - "'hsym'", - "'iasc'", - "'idesc'", - "'ij'", - "'in'", - "'insert'", - "'inter'", - "'inv'", - "'keys'", - "'last'", - "'like'", - "'list'", - "'lj'", - "'load'", - "'log'", - "'lower'", - "'lsq'", - "'ltime'", - "'ltrim'", - "'mavg'", - "'max'", - "'maxs'", - "'mcount'", - "'md5'", - "'mdev'", - "'med'", - "'meta'", - "'min'", - "'mins'", - "'mmax'", - "'mmin'", - "'mmu'", - "'mod'", - "'msum'", - "'neg'", - "'next'", - "'null'", - "'over'", - "'parse'", - "'peach'", - "'pj'", - "'plist'", - "'prd'", - "'prev'", - "'prior'", - "'rand'", - "'rank'", - "'ratios'", - "'raze'", - "'read0'", - "'read1'", - "'reciprocal'", - "'reverse'", - "'rload'", - "'rotate'", - "'rsave'", - "'rtrim'", - "'save'", - "'scan'", - "'select'", - "'set'", - "'show'", - "'signum'", - "'sin'", - "'sqrt'", - "'ssr'", - "'string'", - "'sublist'", - "'sum'", - "'sums'", - "'sv'", - "'system'", - "'tables'", - "'tan'", - "'til'", - "'trim'", - "'type'", - "'uj'", - "'ungroup'", - "'union'", - "'update'", - "'upper'", - "'upsert'", - "'value'", - "'var'", - "'view'", - "'vs'", - "'wavg'", - "'where'", - "'within'", - "'wj1'", - "'wj2'", - "'ww'", - "'xasc'", - "'xbar'", - "'xcols'", - "'xdesc'", - "'xexp'", - "'xgroup'", - "'xkey'", - "'xlog'", - "'xprev'", - "'xrank'", - "'xranked'", - "'xrecs'", - "'xrows'", - "'xss'", - "'xtype'", - "'yield'", - "'zip'", - "'+'", - "'-'", - "'*'", - "'%'", - "'='", - "'<>'", - "'<'", - "'<='", - "'>'", - "'>='", - "'and'", - "'or'", - "'not'", - "'int'", - "'long'", - "'float'", - "'double'", - "'char'", - "'symbol'", - "'timestamp'", - ]; - public static readonly symbolicNames: (string | null)[] = [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - "PLUS", - "MINUS", - "MULTIPLY", - "DIVIDE", - "EQUALS", - "NOT_EQUALS", - "LESS_THAN", - "LESS_THAN_OR_EQUAL", - "GREATER_THAN", - "GREATER_THAN_OR_EQUAL", - "AND", - "OR", - "NOT", - "INT", - "LONG", - "FLOAT", - "DOUBLE", - "CHAR", - "SYMBOL", - "TIMESTAMP", - "ID", - "DIGIT", - "NUMBER", - "STRING", - "ESC", - "WS", - ]; - public static readonly modeNames: string[] = ["DEFAULT_MODE"]; - - public static readonly ruleNames: string[] = [ - "T__0", - "T__1", - "T__2", - "T__3", - "T__4", - "T__5", - "T__6", - "T__7", - "T__8", - "T__9", - "T__10", - "T__11", - "T__12", - "T__13", - "T__14", - "T__15", - "T__16", - "T__17", - "T__18", - "T__19", - "T__20", - "T__21", - "T__22", - "T__23", - "T__24", - "T__25", - "T__26", - "T__27", - "T__28", - "T__29", - "T__30", - "T__31", - "T__32", - "T__33", - "T__34", - "T__35", - "T__36", - "T__37", - "T__38", - "T__39", - "T__40", - "T__41", - "T__42", - "T__43", - "T__44", - "T__45", - "T__46", - "T__47", - "T__48", - "T__49", - "T__50", - "T__51", - "T__52", - "T__53", - "T__54", - "T__55", - "T__56", - "T__57", - "T__58", - "T__59", - "T__60", - "T__61", - "T__62", - "T__63", - "T__64", - "T__65", - "T__66", - "T__67", - "T__68", - "T__69", - "T__70", - "T__71", - "T__72", - "T__73", - "T__74", - "T__75", - "T__76", - "T__77", - "T__78", - "T__79", - "T__80", - "T__81", - "T__82", - "T__83", - "T__84", - "T__85", - "T__86", - "T__87", - "T__88", - "T__89", - "T__90", - "T__91", - "T__92", - "T__93", - "T__94", - "T__95", - "T__96", - "T__97", - "T__98", - "T__99", - "T__100", - "T__101", - "T__102", - "T__103", - "T__104", - "T__105", - "T__106", - "T__107", - "T__108", - "T__109", - "T__110", - "T__111", - "T__112", - "T__113", - "T__114", - "T__115", - "T__116", - "T__117", - "T__118", - "T__119", - "T__120", - "T__121", - "T__122", - "T__123", - "T__124", - "T__125", - "T__126", - "T__127", - "T__128", - "T__129", - "T__130", - "T__131", - "T__132", - "T__133", - "T__134", - "T__135", - "T__136", - "T__137", - "T__138", - "T__139", - "T__140", - "T__141", - "T__142", - "T__143", - "T__144", - "T__145", - "T__146", - "T__147", - "T__148", - "PLUS", - "MINUS", - "MULTIPLY", - "DIVIDE", - "EQUALS", - "NOT_EQUALS", - "LESS_THAN", - "LESS_THAN_OR_EQUAL", - "GREATER_THAN", - "GREATER_THAN_OR_EQUAL", - "AND", - "OR", - "NOT", - "INT", - "LONG", - "FLOAT", - "DOUBLE", - "CHAR", - "SYMBOL", - "TIMESTAMP", - "ID", - "DIGIT", - "NUMBER", - "STRING", - "ESC", - "WS", - ]; - - constructor(input: CharStream) { - super(input); - this._interp = new LexerATNSimulator( - this, - qLexer._ATN, - qLexer.DecisionsToDFA, - new PredictionContextCache() - ); - } - - public get grammarFileName(): string { - return "q.g4"; - } - - public get literalNames(): (string | null)[] { - return qLexer.literalNames; - } - public get symbolicNames(): (string | null)[] { - return qLexer.symbolicNames; - } - public get ruleNames(): string[] { - return qLexer.ruleNames; - } - - public get serializedATN(): number[] { - return qLexer._serializedATN; - } - - public get channelNames(): string[] { - return qLexer.channelNames; - } - - public get modeNames(): string[] { - return qLexer.modeNames; - } - - public static readonly _serializedATN: number[] = [ - 4, 0, 175, 1252, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, - 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, - 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, - 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, - 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, - 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, - 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, - 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, - 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, - 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, - 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, - 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, - 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, - 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, - 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, - 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, - 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, - 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, - 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, - 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, - 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, - 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, - 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, - 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, - 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, - 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, - 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, - 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, - 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, - 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, - 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, - 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, - 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, - 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, - 174, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, - 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, - 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, - 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, - 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, - 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, - 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, - 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, - 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, - 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, - 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, - 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, - 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, - 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, - 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, - 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, - 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, - 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, - 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, - 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, - 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, - 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, - 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, - 1, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, - 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, - 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, - 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, - 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, - 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, - 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, - 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, - 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, - 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, - 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, - 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, - 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, - 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, - 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, - 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, - 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, - 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, - 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, - 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, - 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, - 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, - 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, - 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, - 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, - 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, - 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, - 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, - 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, - 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, - 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, - 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, - 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, - 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, - 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, - 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, - 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, - 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, - 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, - 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, - 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, - 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, - 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, - 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, 136, 1, - 136, 1, 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, - 1, 138, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, - 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, - 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, - 142, 1, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, - 1, 144, 1, 144, 1, 144, 1, 145, 1, 145, 1, 145, 1, 145, 1, 146, 1, 146, 1, - 146, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, - 1, 148, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 150, 1, 150, 1, 151, 1, - 151, 1, 152, 1, 152, 1, 153, 1, 153, 1, 154, 1, 154, 1, 154, 1, 155, 1, 155, - 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 159, 1, - 159, 1, 159, 1, 159, 1, 160, 1, 160, 1, 160, 1, 161, 1, 161, 1, 161, 1, 161, - 1, 162, 1, 162, 1, 162, 1, 162, 1, 163, 1, 163, 1, 163, 1, 163, 1, 163, 1, - 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 165, 1, 165, 1, 165, 1, 165, - 1, 165, 1, 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 167, 1, - 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, 168, 1, 168, - 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 169, 1, 169, 5, 169, - 1213, 8, 169, 10, 169, 12, 169, 1216, 9, 169, 1, 170, 1, 170, 1, 171, 4, - 171, 1221, 8, 171, 11, 171, 12, 171, 1222, 1, 171, 1, 171, 4, 171, 1227, 8, - 171, 11, 171, 12, 171, 1228, 3, 171, 1231, 8, 171, 1, 172, 1, 172, 1, 172, - 5, 172, 1236, 8, 172, 10, 172, 12, 172, 1239, 9, 172, 1, 172, 1, 172, 1, - 173, 1, 173, 1, 173, 1, 174, 4, 174, 1247, 8, 174, 11, 174, 12, 174, 1248, - 1, 174, 1, 174, 0, 0, 175, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, - 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, - 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, - 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, - 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, - 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, - 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, - 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 139, 70, 141, 71, 143, - 72, 145, 73, 147, 74, 149, 75, 151, 76, 153, 77, 155, 78, 157, 79, 159, 80, - 161, 81, 163, 82, 165, 83, 167, 84, 169, 85, 171, 86, 173, 87, 175, 88, 177, - 89, 179, 90, 181, 91, 183, 92, 185, 93, 187, 94, 189, 95, 191, 96, 193, 97, - 195, 98, 197, 99, 199, 100, 201, 101, 203, 102, 205, 103, 207, 104, 209, - 105, 211, 106, 213, 107, 215, 108, 217, 109, 219, 110, 221, 111, 223, 112, - 225, 113, 227, 114, 229, 115, 231, 116, 233, 117, 235, 118, 237, 119, 239, - 120, 241, 121, 243, 122, 245, 123, 247, 124, 249, 125, 251, 126, 253, 127, - 255, 128, 257, 129, 259, 130, 261, 131, 263, 132, 265, 133, 267, 134, 269, - 135, 271, 136, 273, 137, 275, 138, 277, 139, 279, 140, 281, 141, 283, 142, - 285, 143, 287, 144, 289, 145, 291, 146, 293, 147, 295, 148, 297, 149, 299, - 150, 301, 151, 303, 152, 305, 153, 307, 154, 309, 155, 311, 156, 313, 157, - 315, 158, 317, 159, 319, 160, 321, 161, 323, 162, 325, 163, 327, 164, 329, - 165, 331, 166, 333, 167, 335, 168, 337, 169, 339, 170, 341, 171, 343, 172, - 345, 173, 347, 174, 349, 175, 1, 0, 6, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, - 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 34, 34, 92, 92, 8, 0, - 34, 34, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 3, - 0, 9, 10, 13, 13, 32, 32, 1258, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, - 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, - 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, - 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, - 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, - 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, - 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, - 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, - 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, - 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, - 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, - 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, - 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, - 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, - 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, - 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, - 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, 131, 1, 0, 0, 0, - 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, 0, 0, 0, 139, 1, 0, 0, - 0, 0, 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 0, 145, 1, 0, 0, 0, 0, 147, 1, 0, - 0, 0, 0, 149, 1, 0, 0, 0, 0, 151, 1, 0, 0, 0, 0, 153, 1, 0, 0, 0, 0, 155, 1, - 0, 0, 0, 0, 157, 1, 0, 0, 0, 0, 159, 1, 0, 0, 0, 0, 161, 1, 0, 0, 0, 0, 163, - 1, 0, 0, 0, 0, 165, 1, 0, 0, 0, 0, 167, 1, 0, 0, 0, 0, 169, 1, 0, 0, 0, 0, - 171, 1, 0, 0, 0, 0, 173, 1, 0, 0, 0, 0, 175, 1, 0, 0, 0, 0, 177, 1, 0, 0, 0, - 0, 179, 1, 0, 0, 0, 0, 181, 1, 0, 0, 0, 0, 183, 1, 0, 0, 0, 0, 185, 1, 0, 0, - 0, 0, 187, 1, 0, 0, 0, 0, 189, 1, 0, 0, 0, 0, 191, 1, 0, 0, 0, 0, 193, 1, 0, - 0, 0, 0, 195, 1, 0, 0, 0, 0, 197, 1, 0, 0, 0, 0, 199, 1, 0, 0, 0, 0, 201, 1, - 0, 0, 0, 0, 203, 1, 0, 0, 0, 0, 205, 1, 0, 0, 0, 0, 207, 1, 0, 0, 0, 0, 209, - 1, 0, 0, 0, 0, 211, 1, 0, 0, 0, 0, 213, 1, 0, 0, 0, 0, 215, 1, 0, 0, 0, 0, - 217, 1, 0, 0, 0, 0, 219, 1, 0, 0, 0, 0, 221, 1, 0, 0, 0, 0, 223, 1, 0, 0, 0, - 0, 225, 1, 0, 0, 0, 0, 227, 1, 0, 0, 0, 0, 229, 1, 0, 0, 0, 0, 231, 1, 0, 0, - 0, 0, 233, 1, 0, 0, 0, 0, 235, 1, 0, 0, 0, 0, 237, 1, 0, 0, 0, 0, 239, 1, 0, - 0, 0, 0, 241, 1, 0, 0, 0, 0, 243, 1, 0, 0, 0, 0, 245, 1, 0, 0, 0, 0, 247, 1, - 0, 0, 0, 0, 249, 1, 0, 0, 0, 0, 251, 1, 0, 0, 0, 0, 253, 1, 0, 0, 0, 0, 255, - 1, 0, 0, 0, 0, 257, 1, 0, 0, 0, 0, 259, 1, 0, 0, 0, 0, 261, 1, 0, 0, 0, 0, - 263, 1, 0, 0, 0, 0, 265, 1, 0, 0, 0, 0, 267, 1, 0, 0, 0, 0, 269, 1, 0, 0, 0, - 0, 271, 1, 0, 0, 0, 0, 273, 1, 0, 0, 0, 0, 275, 1, 0, 0, 0, 0, 277, 1, 0, 0, - 0, 0, 279, 1, 0, 0, 0, 0, 281, 1, 0, 0, 0, 0, 283, 1, 0, 0, 0, 0, 285, 1, 0, - 0, 0, 0, 287, 1, 0, 0, 0, 0, 289, 1, 0, 0, 0, 0, 291, 1, 0, 0, 0, 0, 293, 1, - 0, 0, 0, 0, 295, 1, 0, 0, 0, 0, 297, 1, 0, 0, 0, 0, 299, 1, 0, 0, 0, 0, 301, - 1, 0, 0, 0, 0, 303, 1, 0, 0, 0, 0, 305, 1, 0, 0, 0, 0, 307, 1, 0, 0, 0, 0, - 309, 1, 0, 0, 0, 0, 311, 1, 0, 0, 0, 0, 313, 1, 0, 0, 0, 0, 315, 1, 0, 0, 0, - 0, 317, 1, 0, 0, 0, 0, 319, 1, 0, 0, 0, 0, 321, 1, 0, 0, 0, 0, 323, 1, 0, 0, - 0, 0, 325, 1, 0, 0, 0, 0, 327, 1, 0, 0, 0, 0, 329, 1, 0, 0, 0, 0, 331, 1, 0, - 0, 0, 0, 333, 1, 0, 0, 0, 0, 335, 1, 0, 0, 0, 0, 337, 1, 0, 0, 0, 0, 339, 1, - 0, 0, 0, 0, 341, 1, 0, 0, 0, 0, 343, 1, 0, 0, 0, 0, 345, 1, 0, 0, 0, 0, 347, - 1, 0, 0, 0, 0, 349, 1, 0, 0, 0, 1, 351, 1, 0, 0, 0, 3, 353, 1, 0, 0, 0, 5, - 355, 1, 0, 0, 0, 7, 357, 1, 0, 0, 0, 9, 361, 1, 0, 0, 0, 11, 366, 1, 0, 0, - 0, 13, 370, 1, 0, 0, 0, 15, 374, 1, 0, 0, 0, 17, 379, 1, 0, 0, 0, 19, 384, - 1, 0, 0, 0, 21, 388, 1, 0, 0, 0, 23, 396, 1, 0, 0, 0, 25, 400, 1, 0, 0, 0, - 27, 406, 1, 0, 0, 0, 29, 412, 1, 0, 0, 0, 31, 414, 1, 0, 0, 0, 33, 421, 1, - 0, 0, 0, 35, 428, 1, 0, 0, 0, 37, 432, 1, 0, 0, 0, 39, 441, 1, 0, 0, 0, 41, - 445, 1, 0, 0, 0, 43, 450, 1, 0, 0, 0, 45, 455, 1, 0, 0, 0, 47, 462, 1, 0, 0, - 0, 49, 467, 1, 0, 0, 0, 51, 474, 1, 0, 0, 0, 53, 479, 1, 0, 0, 0, 55, 483, - 1, 0, 0, 0, 57, 487, 1, 0, 0, 0, 59, 492, 1, 0, 0, 0, 61, 498, 1, 0, 0, 0, - 63, 503, 1, 0, 0, 0, 65, 509, 1, 0, 0, 0, 67, 513, 1, 0, 0, 0, 69, 519, 1, - 0, 0, 0, 71, 525, 1, 0, 0, 0, 73, 532, 1, 0, 0, 0, 75, 539, 1, 0, 0, 0, 77, - 544, 1, 0, 0, 0, 79, 550, 1, 0, 0, 0, 81, 555, 1, 0, 0, 0, 83, 560, 1, 0, 0, - 0, 85, 566, 1, 0, 0, 0, 87, 569, 1, 0, 0, 0, 89, 572, 1, 0, 0, 0, 91, 579, - 1, 0, 0, 0, 93, 585, 1, 0, 0, 0, 95, 589, 1, 0, 0, 0, 97, 594, 1, 0, 0, 0, - 99, 599, 1, 0, 0, 0, 101, 604, 1, 0, 0, 0, 103, 609, 1, 0, 0, 0, 105, 612, - 1, 0, 0, 0, 107, 617, 1, 0, 0, 0, 109, 621, 1, 0, 0, 0, 111, 627, 1, 0, 0, - 0, 113, 631, 1, 0, 0, 0, 115, 637, 1, 0, 0, 0, 117, 643, 1, 0, 0, 0, 119, - 648, 1, 0, 0, 0, 121, 652, 1, 0, 0, 0, 123, 657, 1, 0, 0, 0, 125, 664, 1, 0, - 0, 0, 127, 668, 1, 0, 0, 0, 129, 673, 1, 0, 0, 0, 131, 677, 1, 0, 0, 0, 133, - 682, 1, 0, 0, 0, 135, 686, 1, 0, 0, 0, 137, 691, 1, 0, 0, 0, 139, 696, 1, 0, - 0, 0, 141, 701, 1, 0, 0, 0, 143, 705, 1, 0, 0, 0, 145, 709, 1, 0, 0, 0, 147, - 714, 1, 0, 0, 0, 149, 718, 1, 0, 0, 0, 151, 723, 1, 0, 0, 0, 153, 728, 1, 0, - 0, 0, 155, 733, 1, 0, 0, 0, 157, 739, 1, 0, 0, 0, 159, 745, 1, 0, 0, 0, 161, - 748, 1, 0, 0, 0, 163, 754, 1, 0, 0, 0, 165, 758, 1, 0, 0, 0, 167, 763, 1, 0, - 0, 0, 169, 769, 1, 0, 0, 0, 171, 774, 1, 0, 0, 0, 173, 779, 1, 0, 0, 0, 175, - 786, 1, 0, 0, 0, 177, 791, 1, 0, 0, 0, 179, 797, 1, 0, 0, 0, 181, 803, 1, 0, - 0, 0, 183, 814, 1, 0, 0, 0, 185, 822, 1, 0, 0, 0, 187, 828, 1, 0, 0, 0, 189, - 835, 1, 0, 0, 0, 191, 841, 1, 0, 0, 0, 193, 847, 1, 0, 0, 0, 195, 852, 1, 0, - 0, 0, 197, 857, 1, 0, 0, 0, 199, 864, 1, 0, 0, 0, 201, 868, 1, 0, 0, 0, 203, - 873, 1, 0, 0, 0, 205, 880, 1, 0, 0, 0, 207, 884, 1, 0, 0, 0, 209, 889, 1, 0, - 0, 0, 211, 893, 1, 0, 0, 0, 213, 900, 1, 0, 0, 0, 215, 908, 1, 0, 0, 0, 217, - 912, 1, 0, 0, 0, 219, 917, 1, 0, 0, 0, 221, 920, 1, 0, 0, 0, 223, 927, 1, 0, - 0, 0, 225, 934, 1, 0, 0, 0, 227, 938, 1, 0, 0, 0, 229, 942, 1, 0, 0, 0, 231, - 947, 1, 0, 0, 0, 233, 952, 1, 0, 0, 0, 235, 955, 1, 0, 0, 0, 237, 963, 1, 0, - 0, 0, 239, 969, 1, 0, 0, 0, 241, 976, 1, 0, 0, 0, 243, 982, 1, 0, 0, 0, 245, - 989, 1, 0, 0, 0, 247, 995, 1, 0, 0, 0, 249, 999, 1, 0, 0, 0, 251, 1004, 1, - 0, 0, 0, 253, 1007, 1, 0, 0, 0, 255, 1012, 1, 0, 0, 0, 257, 1018, 1, 0, 0, - 0, 259, 1025, 1, 0, 0, 0, 261, 1029, 1, 0, 0, 0, 263, 1033, 1, 0, 0, 0, 265, - 1036, 1, 0, 0, 0, 267, 1041, 1, 0, 0, 0, 269, 1046, 1, 0, 0, 0, 271, 1052, - 1, 0, 0, 0, 273, 1058, 1, 0, 0, 0, 275, 1063, 1, 0, 0, 0, 277, 1070, 1, 0, - 0, 0, 279, 1075, 1, 0, 0, 0, 281, 1080, 1, 0, 0, 0, 283, 1086, 1, 0, 0, 0, - 285, 1092, 1, 0, 0, 0, 287, 1100, 1, 0, 0, 0, 289, 1106, 1, 0, 0, 0, 291, - 1112, 1, 0, 0, 0, 293, 1116, 1, 0, 0, 0, 295, 1122, 1, 0, 0, 0, 297, 1128, - 1, 0, 0, 0, 299, 1132, 1, 0, 0, 0, 301, 1134, 1, 0, 0, 0, 303, 1136, 1, 0, - 0, 0, 305, 1138, 1, 0, 0, 0, 307, 1140, 1, 0, 0, 0, 309, 1142, 1, 0, 0, 0, - 311, 1145, 1, 0, 0, 0, 313, 1147, 1, 0, 0, 0, 315, 1150, 1, 0, 0, 0, 317, - 1152, 1, 0, 0, 0, 319, 1155, 1, 0, 0, 0, 321, 1159, 1, 0, 0, 0, 323, 1162, - 1, 0, 0, 0, 325, 1166, 1, 0, 0, 0, 327, 1170, 1, 0, 0, 0, 329, 1175, 1, 0, - 0, 0, 331, 1181, 1, 0, 0, 0, 333, 1188, 1, 0, 0, 0, 335, 1193, 1, 0, 0, 0, - 337, 1200, 1, 0, 0, 0, 339, 1210, 1, 0, 0, 0, 341, 1217, 1, 0, 0, 0, 343, - 1220, 1, 0, 0, 0, 345, 1232, 1, 0, 0, 0, 347, 1242, 1, 0, 0, 0, 349, 1246, - 1, 0, 0, 0, 351, 352, 5, 59, 0, 0, 352, 2, 1, 0, 0, 0, 353, 354, 5, 40, 0, - 0, 354, 4, 1, 0, 0, 0, 355, 356, 5, 41, 0, 0, 356, 6, 1, 0, 0, 0, 357, 358, - 5, 97, 0, 0, 358, 359, 5, 98, 0, 0, 359, 360, 5, 115, 0, 0, 360, 8, 1, 0, 0, - 0, 361, 362, 5, 97, 0, 0, 362, 363, 5, 99, 0, 0, 363, 364, 5, 111, 0, 0, - 364, 365, 5, 115, 0, 0, 365, 10, 1, 0, 0, 0, 366, 367, 5, 97, 0, 0, 367, - 368, 5, 108, 0, 0, 368, 369, 5, 108, 0, 0, 369, 12, 1, 0, 0, 0, 370, 371, 5, - 97, 0, 0, 371, 372, 5, 110, 0, 0, 372, 373, 5, 121, 0, 0, 373, 14, 1, 0, 0, - 0, 374, 375, 5, 97, 0, 0, 375, 376, 5, 115, 0, 0, 376, 377, 5, 105, 0, 0, - 377, 378, 5, 110, 0, 0, 378, 16, 1, 0, 0, 0, 379, 380, 5, 97, 0, 0, 380, - 381, 5, 116, 0, 0, 381, 382, 5, 97, 0, 0, 382, 383, 5, 110, 0, 0, 383, 18, - 1, 0, 0, 0, 384, 385, 5, 97, 0, 0, 385, 386, 5, 118, 0, 0, 386, 387, 5, 103, - 0, 0, 387, 20, 1, 0, 0, 0, 388, 389, 5, 99, 0, 0, 389, 390, 5, 101, 0, 0, - 390, 391, 5, 105, 0, 0, 391, 392, 5, 108, 0, 0, 392, 393, 5, 105, 0, 0, 393, - 394, 5, 110, 0, 0, 394, 395, 5, 103, 0, 0, 395, 22, 1, 0, 0, 0, 396, 397, 5, - 99, 0, 0, 397, 398, 5, 111, 0, 0, 398, 399, 5, 115, 0, 0, 399, 24, 1, 0, 0, - 0, 400, 401, 5, 99, 0, 0, 401, 402, 5, 111, 0, 0, 402, 403, 5, 117, 0, 0, - 403, 404, 5, 110, 0, 0, 404, 405, 5, 116, 0, 0, 405, 26, 1, 0, 0, 0, 406, - 407, 5, 99, 0, 0, 407, 408, 5, 114, 0, 0, 408, 409, 5, 111, 0, 0, 409, 410, - 5, 115, 0, 0, 410, 411, 5, 115, 0, 0, 411, 28, 1, 0, 0, 0, 412, 413, 5, 44, - 0, 0, 413, 30, 1, 0, 0, 0, 414, 415, 5, 100, 0, 0, 415, 416, 5, 101, 0, 0, - 416, 417, 5, 108, 0, 0, 417, 418, 5, 101, 0, 0, 418, 419, 5, 116, 0, 0, 419, - 420, 5, 101, 0, 0, 420, 32, 1, 0, 0, 0, 421, 422, 5, 100, 0, 0, 422, 423, 5, - 101, 0, 0, 423, 424, 5, 108, 0, 0, 424, 425, 5, 116, 0, 0, 425, 426, 5, 97, - 0, 0, 426, 427, 5, 115, 0, 0, 427, 34, 1, 0, 0, 0, 428, 429, 5, 100, 0, 0, - 429, 430, 5, 101, 0, 0, 430, 431, 5, 118, 0, 0, 431, 36, 1, 0, 0, 0, 432, - 433, 5, 100, 0, 0, 433, 434, 5, 105, 0, 0, 434, 435, 5, 115, 0, 0, 435, 436, - 5, 116, 0, 0, 436, 437, 5, 105, 0, 0, 437, 438, 5, 110, 0, 0, 438, 439, 5, - 99, 0, 0, 439, 440, 5, 116, 0, 0, 440, 38, 1, 0, 0, 0, 441, 442, 5, 100, 0, - 0, 442, 443, 5, 105, 0, 0, 443, 444, 5, 118, 0, 0, 444, 40, 1, 0, 0, 0, 445, - 446, 5, 100, 0, 0, 446, 447, 5, 114, 0, 0, 447, 448, 5, 111, 0, 0, 448, 449, - 5, 112, 0, 0, 449, 42, 1, 0, 0, 0, 450, 451, 5, 101, 0, 0, 451, 452, 5, 97, - 0, 0, 452, 453, 5, 99, 0, 0, 453, 454, 5, 104, 0, 0, 454, 44, 1, 0, 0, 0, - 455, 456, 5, 101, 0, 0, 456, 457, 5, 110, 0, 0, 457, 458, 5, 108, 0, 0, 458, - 459, 5, 105, 0, 0, 459, 460, 5, 115, 0, 0, 460, 461, 5, 116, 0, 0, 461, 46, - 1, 0, 0, 0, 462, 463, 5, 101, 0, 0, 463, 464, 5, 118, 0, 0, 464, 465, 5, 97, - 0, 0, 465, 466, 5, 108, 0, 0, 466, 48, 1, 0, 0, 0, 467, 468, 5, 101, 0, 0, - 468, 469, 5, 120, 0, 0, 469, 470, 5, 99, 0, 0, 470, 471, 5, 101, 0, 0, 471, - 472, 5, 112, 0, 0, 472, 473, 5, 116, 0, 0, 473, 50, 1, 0, 0, 0, 474, 475, 5, - 101, 0, 0, 475, 476, 5, 120, 0, 0, 476, 477, 5, 101, 0, 0, 477, 478, 5, 99, - 0, 0, 478, 52, 1, 0, 0, 0, 479, 480, 5, 101, 0, 0, 480, 481, 5, 120, 0, 0, - 481, 482, 5, 112, 0, 0, 482, 54, 1, 0, 0, 0, 483, 484, 5, 102, 0, 0, 484, - 485, 5, 98, 0, 0, 485, 486, 5, 121, 0, 0, 486, 56, 1, 0, 0, 0, 487, 488, 5, - 102, 0, 0, 488, 489, 5, 105, 0, 0, 489, 490, 5, 108, 0, 0, 490, 491, 5, 108, - 0, 0, 491, 58, 1, 0, 0, 0, 492, 493, 5, 102, 0, 0, 493, 494, 5, 105, 0, 0, - 494, 495, 5, 114, 0, 0, 495, 496, 5, 115, 0, 0, 496, 497, 5, 116, 0, 0, 497, - 60, 1, 0, 0, 0, 498, 499, 5, 102, 0, 0, 499, 500, 5, 108, 0, 0, 500, 501, 5, - 105, 0, 0, 501, 502, 5, 112, 0, 0, 502, 62, 1, 0, 0, 0, 503, 504, 5, 102, 0, - 0, 504, 505, 5, 108, 0, 0, 505, 506, 5, 111, 0, 0, 506, 507, 5, 111, 0, 0, - 507, 508, 5, 114, 0, 0, 508, 64, 1, 0, 0, 0, 509, 510, 5, 103, 0, 0, 510, - 511, 5, 101, 0, 0, 511, 512, 5, 116, 0, 0, 512, 66, 1, 0, 0, 0, 513, 514, 5, - 103, 0, 0, 514, 515, 5, 114, 0, 0, 515, 516, 5, 111, 0, 0, 516, 517, 5, 117, - 0, 0, 517, 518, 5, 112, 0, 0, 518, 68, 1, 0, 0, 0, 519, 520, 5, 103, 0, 0, - 520, 521, 5, 116, 0, 0, 521, 522, 5, 105, 0, 0, 522, 523, 5, 109, 0, 0, 523, - 524, 5, 101, 0, 0, 524, 70, 1, 0, 0, 0, 525, 526, 5, 104, 0, 0, 526, 527, 5, - 99, 0, 0, 527, 528, 5, 108, 0, 0, 528, 529, 5, 111, 0, 0, 529, 530, 5, 115, - 0, 0, 530, 531, 5, 101, 0, 0, 531, 72, 1, 0, 0, 0, 532, 533, 5, 104, 0, 0, - 533, 534, 5, 99, 0, 0, 534, 535, 5, 111, 0, 0, 535, 536, 5, 117, 0, 0, 536, - 537, 5, 110, 0, 0, 537, 538, 5, 116, 0, 0, 538, 74, 1, 0, 0, 0, 539, 540, 5, - 104, 0, 0, 540, 541, 5, 100, 0, 0, 541, 542, 5, 101, 0, 0, 542, 543, 5, 108, - 0, 0, 543, 76, 1, 0, 0, 0, 544, 545, 5, 104, 0, 0, 545, 546, 5, 111, 0, 0, - 546, 547, 5, 112, 0, 0, 547, 548, 5, 101, 0, 0, 548, 549, 5, 110, 0, 0, 549, - 78, 1, 0, 0, 0, 550, 551, 5, 104, 0, 0, 551, 552, 5, 115, 0, 0, 552, 553, 5, - 121, 0, 0, 553, 554, 5, 109, 0, 0, 554, 80, 1, 0, 0, 0, 555, 556, 5, 105, 0, - 0, 556, 557, 5, 97, 0, 0, 557, 558, 5, 115, 0, 0, 558, 559, 5, 99, 0, 0, - 559, 82, 1, 0, 0, 0, 560, 561, 5, 105, 0, 0, 561, 562, 5, 100, 0, 0, 562, - 563, 5, 101, 0, 0, 563, 564, 5, 115, 0, 0, 564, 565, 5, 99, 0, 0, 565, 84, - 1, 0, 0, 0, 566, 567, 5, 105, 0, 0, 567, 568, 5, 106, 0, 0, 568, 86, 1, 0, - 0, 0, 569, 570, 5, 105, 0, 0, 570, 571, 5, 110, 0, 0, 571, 88, 1, 0, 0, 0, - 572, 573, 5, 105, 0, 0, 573, 574, 5, 110, 0, 0, 574, 575, 5, 115, 0, 0, 575, - 576, 5, 101, 0, 0, 576, 577, 5, 114, 0, 0, 577, 578, 5, 116, 0, 0, 578, 90, - 1, 0, 0, 0, 579, 580, 5, 105, 0, 0, 580, 581, 5, 110, 0, 0, 581, 582, 5, - 116, 0, 0, 582, 583, 5, 101, 0, 0, 583, 584, 5, 114, 0, 0, 584, 92, 1, 0, 0, - 0, 585, 586, 5, 105, 0, 0, 586, 587, 5, 110, 0, 0, 587, 588, 5, 118, 0, 0, - 588, 94, 1, 0, 0, 0, 589, 590, 5, 107, 0, 0, 590, 591, 5, 101, 0, 0, 591, - 592, 5, 121, 0, 0, 592, 593, 5, 115, 0, 0, 593, 96, 1, 0, 0, 0, 594, 595, 5, - 108, 0, 0, 595, 596, 5, 97, 0, 0, 596, 597, 5, 115, 0, 0, 597, 598, 5, 116, - 0, 0, 598, 98, 1, 0, 0, 0, 599, 600, 5, 108, 0, 0, 600, 601, 5, 105, 0, 0, - 601, 602, 5, 107, 0, 0, 602, 603, 5, 101, 0, 0, 603, 100, 1, 0, 0, 0, 604, - 605, 5, 108, 0, 0, 605, 606, 5, 105, 0, 0, 606, 607, 5, 115, 0, 0, 607, 608, - 5, 116, 0, 0, 608, 102, 1, 0, 0, 0, 609, 610, 5, 108, 0, 0, 610, 611, 5, - 106, 0, 0, 611, 104, 1, 0, 0, 0, 612, 613, 5, 108, 0, 0, 613, 614, 5, 111, - 0, 0, 614, 615, 5, 97, 0, 0, 615, 616, 5, 100, 0, 0, 616, 106, 1, 0, 0, 0, - 617, 618, 5, 108, 0, 0, 618, 619, 5, 111, 0, 0, 619, 620, 5, 103, 0, 0, 620, - 108, 1, 0, 0, 0, 621, 622, 5, 108, 0, 0, 622, 623, 5, 111, 0, 0, 623, 624, - 5, 119, 0, 0, 624, 625, 5, 101, 0, 0, 625, 626, 5, 114, 0, 0, 626, 110, 1, - 0, 0, 0, 627, 628, 5, 108, 0, 0, 628, 629, 5, 115, 0, 0, 629, 630, 5, 113, - 0, 0, 630, 112, 1, 0, 0, 0, 631, 632, 5, 108, 0, 0, 632, 633, 5, 116, 0, 0, - 633, 634, 5, 105, 0, 0, 634, 635, 5, 109, 0, 0, 635, 636, 5, 101, 0, 0, 636, - 114, 1, 0, 0, 0, 637, 638, 5, 108, 0, 0, 638, 639, 5, 116, 0, 0, 639, 640, - 5, 114, 0, 0, 640, 641, 5, 105, 0, 0, 641, 642, 5, 109, 0, 0, 642, 116, 1, - 0, 0, 0, 643, 644, 5, 109, 0, 0, 644, 645, 5, 97, 0, 0, 645, 646, 5, 118, 0, - 0, 646, 647, 5, 103, 0, 0, 647, 118, 1, 0, 0, 0, 648, 649, 5, 109, 0, 0, - 649, 650, 5, 97, 0, 0, 650, 651, 5, 120, 0, 0, 651, 120, 1, 0, 0, 0, 652, - 653, 5, 109, 0, 0, 653, 654, 5, 97, 0, 0, 654, 655, 5, 120, 0, 0, 655, 656, - 5, 115, 0, 0, 656, 122, 1, 0, 0, 0, 657, 658, 5, 109, 0, 0, 658, 659, 5, 99, - 0, 0, 659, 660, 5, 111, 0, 0, 660, 661, 5, 117, 0, 0, 661, 662, 5, 110, 0, - 0, 662, 663, 5, 116, 0, 0, 663, 124, 1, 0, 0, 0, 664, 665, 5, 109, 0, 0, - 665, 666, 5, 100, 0, 0, 666, 667, 5, 53, 0, 0, 667, 126, 1, 0, 0, 0, 668, - 669, 5, 109, 0, 0, 669, 670, 5, 100, 0, 0, 670, 671, 5, 101, 0, 0, 671, 672, - 5, 118, 0, 0, 672, 128, 1, 0, 0, 0, 673, 674, 5, 109, 0, 0, 674, 675, 5, - 101, 0, 0, 675, 676, 5, 100, 0, 0, 676, 130, 1, 0, 0, 0, 677, 678, 5, 109, - 0, 0, 678, 679, 5, 101, 0, 0, 679, 680, 5, 116, 0, 0, 680, 681, 5, 97, 0, 0, - 681, 132, 1, 0, 0, 0, 682, 683, 5, 109, 0, 0, 683, 684, 5, 105, 0, 0, 684, - 685, 5, 110, 0, 0, 685, 134, 1, 0, 0, 0, 686, 687, 5, 109, 0, 0, 687, 688, - 5, 105, 0, 0, 688, 689, 5, 110, 0, 0, 689, 690, 5, 115, 0, 0, 690, 136, 1, - 0, 0, 0, 691, 692, 5, 109, 0, 0, 692, 693, 5, 109, 0, 0, 693, 694, 5, 97, 0, - 0, 694, 695, 5, 120, 0, 0, 695, 138, 1, 0, 0, 0, 696, 697, 5, 109, 0, 0, - 697, 698, 5, 109, 0, 0, 698, 699, 5, 105, 0, 0, 699, 700, 5, 110, 0, 0, 700, - 140, 1, 0, 0, 0, 701, 702, 5, 109, 0, 0, 702, 703, 5, 109, 0, 0, 703, 704, - 5, 117, 0, 0, 704, 142, 1, 0, 0, 0, 705, 706, 5, 109, 0, 0, 706, 707, 5, - 111, 0, 0, 707, 708, 5, 100, 0, 0, 708, 144, 1, 0, 0, 0, 709, 710, 5, 109, - 0, 0, 710, 711, 5, 115, 0, 0, 711, 712, 5, 117, 0, 0, 712, 713, 5, 109, 0, - 0, 713, 146, 1, 0, 0, 0, 714, 715, 5, 110, 0, 0, 715, 716, 5, 101, 0, 0, - 716, 717, 5, 103, 0, 0, 717, 148, 1, 0, 0, 0, 718, 719, 5, 110, 0, 0, 719, - 720, 5, 101, 0, 0, 720, 721, 5, 120, 0, 0, 721, 722, 5, 116, 0, 0, 722, 150, - 1, 0, 0, 0, 723, 724, 5, 110, 0, 0, 724, 725, 5, 117, 0, 0, 725, 726, 5, - 108, 0, 0, 726, 727, 5, 108, 0, 0, 727, 152, 1, 0, 0, 0, 728, 729, 5, 111, - 0, 0, 729, 730, 5, 118, 0, 0, 730, 731, 5, 101, 0, 0, 731, 732, 5, 114, 0, - 0, 732, 154, 1, 0, 0, 0, 733, 734, 5, 112, 0, 0, 734, 735, 5, 97, 0, 0, 735, - 736, 5, 114, 0, 0, 736, 737, 5, 115, 0, 0, 737, 738, 5, 101, 0, 0, 738, 156, - 1, 0, 0, 0, 739, 740, 5, 112, 0, 0, 740, 741, 5, 101, 0, 0, 741, 742, 5, 97, - 0, 0, 742, 743, 5, 99, 0, 0, 743, 744, 5, 104, 0, 0, 744, 158, 1, 0, 0, 0, - 745, 746, 5, 112, 0, 0, 746, 747, 5, 106, 0, 0, 747, 160, 1, 0, 0, 0, 748, - 749, 5, 112, 0, 0, 749, 750, 5, 108, 0, 0, 750, 751, 5, 105, 0, 0, 751, 752, - 5, 115, 0, 0, 752, 753, 5, 116, 0, 0, 753, 162, 1, 0, 0, 0, 754, 755, 5, - 112, 0, 0, 755, 756, 5, 114, 0, 0, 756, 757, 5, 100, 0, 0, 757, 164, 1, 0, - 0, 0, 758, 759, 5, 112, 0, 0, 759, 760, 5, 114, 0, 0, 760, 761, 5, 101, 0, - 0, 761, 762, 5, 118, 0, 0, 762, 166, 1, 0, 0, 0, 763, 764, 5, 112, 0, 0, - 764, 765, 5, 114, 0, 0, 765, 766, 5, 105, 0, 0, 766, 767, 5, 111, 0, 0, 767, - 768, 5, 114, 0, 0, 768, 168, 1, 0, 0, 0, 769, 770, 5, 114, 0, 0, 770, 771, - 5, 97, 0, 0, 771, 772, 5, 110, 0, 0, 772, 773, 5, 100, 0, 0, 773, 170, 1, 0, - 0, 0, 774, 775, 5, 114, 0, 0, 775, 776, 5, 97, 0, 0, 776, 777, 5, 110, 0, 0, - 777, 778, 5, 107, 0, 0, 778, 172, 1, 0, 0, 0, 779, 780, 5, 114, 0, 0, 780, - 781, 5, 97, 0, 0, 781, 782, 5, 116, 0, 0, 782, 783, 5, 105, 0, 0, 783, 784, - 5, 111, 0, 0, 784, 785, 5, 115, 0, 0, 785, 174, 1, 0, 0, 0, 786, 787, 5, - 114, 0, 0, 787, 788, 5, 97, 0, 0, 788, 789, 5, 122, 0, 0, 789, 790, 5, 101, - 0, 0, 790, 176, 1, 0, 0, 0, 791, 792, 5, 114, 0, 0, 792, 793, 5, 101, 0, 0, - 793, 794, 5, 97, 0, 0, 794, 795, 5, 100, 0, 0, 795, 796, 5, 48, 0, 0, 796, - 178, 1, 0, 0, 0, 797, 798, 5, 114, 0, 0, 798, 799, 5, 101, 0, 0, 799, 800, - 5, 97, 0, 0, 800, 801, 5, 100, 0, 0, 801, 802, 5, 49, 0, 0, 802, 180, 1, 0, - 0, 0, 803, 804, 5, 114, 0, 0, 804, 805, 5, 101, 0, 0, 805, 806, 5, 99, 0, 0, - 806, 807, 5, 105, 0, 0, 807, 808, 5, 112, 0, 0, 808, 809, 5, 114, 0, 0, 809, - 810, 5, 111, 0, 0, 810, 811, 5, 99, 0, 0, 811, 812, 5, 97, 0, 0, 812, 813, - 5, 108, 0, 0, 813, 182, 1, 0, 0, 0, 814, 815, 5, 114, 0, 0, 815, 816, 5, - 101, 0, 0, 816, 817, 5, 118, 0, 0, 817, 818, 5, 101, 0, 0, 818, 819, 5, 114, - 0, 0, 819, 820, 5, 115, 0, 0, 820, 821, 5, 101, 0, 0, 821, 184, 1, 0, 0, 0, - 822, 823, 5, 114, 0, 0, 823, 824, 5, 108, 0, 0, 824, 825, 5, 111, 0, 0, 825, - 826, 5, 97, 0, 0, 826, 827, 5, 100, 0, 0, 827, 186, 1, 0, 0, 0, 828, 829, 5, - 114, 0, 0, 829, 830, 5, 111, 0, 0, 830, 831, 5, 116, 0, 0, 831, 832, 5, 97, - 0, 0, 832, 833, 5, 116, 0, 0, 833, 834, 5, 101, 0, 0, 834, 188, 1, 0, 0, 0, - 835, 836, 5, 114, 0, 0, 836, 837, 5, 115, 0, 0, 837, 838, 5, 97, 0, 0, 838, - 839, 5, 118, 0, 0, 839, 840, 5, 101, 0, 0, 840, 190, 1, 0, 0, 0, 841, 842, - 5, 114, 0, 0, 842, 843, 5, 116, 0, 0, 843, 844, 5, 114, 0, 0, 844, 845, 5, - 105, 0, 0, 845, 846, 5, 109, 0, 0, 846, 192, 1, 0, 0, 0, 847, 848, 5, 115, - 0, 0, 848, 849, 5, 97, 0, 0, 849, 850, 5, 118, 0, 0, 850, 851, 5, 101, 0, 0, - 851, 194, 1, 0, 0, 0, 852, 853, 5, 115, 0, 0, 853, 854, 5, 99, 0, 0, 854, - 855, 5, 97, 0, 0, 855, 856, 5, 110, 0, 0, 856, 196, 1, 0, 0, 0, 857, 858, 5, - 115, 0, 0, 858, 859, 5, 101, 0, 0, 859, 860, 5, 108, 0, 0, 860, 861, 5, 101, - 0, 0, 861, 862, 5, 99, 0, 0, 862, 863, 5, 116, 0, 0, 863, 198, 1, 0, 0, 0, - 864, 865, 5, 115, 0, 0, 865, 866, 5, 101, 0, 0, 866, 867, 5, 116, 0, 0, 867, - 200, 1, 0, 0, 0, 868, 869, 5, 115, 0, 0, 869, 870, 5, 104, 0, 0, 870, 871, - 5, 111, 0, 0, 871, 872, 5, 119, 0, 0, 872, 202, 1, 0, 0, 0, 873, 874, 5, - 115, 0, 0, 874, 875, 5, 105, 0, 0, 875, 876, 5, 103, 0, 0, 876, 877, 5, 110, - 0, 0, 877, 878, 5, 117, 0, 0, 878, 879, 5, 109, 0, 0, 879, 204, 1, 0, 0, 0, - 880, 881, 5, 115, 0, 0, 881, 882, 5, 105, 0, 0, 882, 883, 5, 110, 0, 0, 883, - 206, 1, 0, 0, 0, 884, 885, 5, 115, 0, 0, 885, 886, 5, 113, 0, 0, 886, 887, - 5, 114, 0, 0, 887, 888, 5, 116, 0, 0, 888, 208, 1, 0, 0, 0, 889, 890, 5, - 115, 0, 0, 890, 891, 5, 115, 0, 0, 891, 892, 5, 114, 0, 0, 892, 210, 1, 0, - 0, 0, 893, 894, 5, 115, 0, 0, 894, 895, 5, 116, 0, 0, 895, 896, 5, 114, 0, - 0, 896, 897, 5, 105, 0, 0, 897, 898, 5, 110, 0, 0, 898, 899, 5, 103, 0, 0, - 899, 212, 1, 0, 0, 0, 900, 901, 5, 115, 0, 0, 901, 902, 5, 117, 0, 0, 902, - 903, 5, 98, 0, 0, 903, 904, 5, 108, 0, 0, 904, 905, 5, 105, 0, 0, 905, 906, - 5, 115, 0, 0, 906, 907, 5, 116, 0, 0, 907, 214, 1, 0, 0, 0, 908, 909, 5, - 115, 0, 0, 909, 910, 5, 117, 0, 0, 910, 911, 5, 109, 0, 0, 911, 216, 1, 0, - 0, 0, 912, 913, 5, 115, 0, 0, 913, 914, 5, 117, 0, 0, 914, 915, 5, 109, 0, - 0, 915, 916, 5, 115, 0, 0, 916, 218, 1, 0, 0, 0, 917, 918, 5, 115, 0, 0, - 918, 919, 5, 118, 0, 0, 919, 220, 1, 0, 0, 0, 920, 921, 5, 115, 0, 0, 921, - 922, 5, 121, 0, 0, 922, 923, 5, 115, 0, 0, 923, 924, 5, 116, 0, 0, 924, 925, - 5, 101, 0, 0, 925, 926, 5, 109, 0, 0, 926, 222, 1, 0, 0, 0, 927, 928, 5, - 116, 0, 0, 928, 929, 5, 97, 0, 0, 929, 930, 5, 98, 0, 0, 930, 931, 5, 108, - 0, 0, 931, 932, 5, 101, 0, 0, 932, 933, 5, 115, 0, 0, 933, 224, 1, 0, 0, 0, - 934, 935, 5, 116, 0, 0, 935, 936, 5, 97, 0, 0, 936, 937, 5, 110, 0, 0, 937, - 226, 1, 0, 0, 0, 938, 939, 5, 116, 0, 0, 939, 940, 5, 105, 0, 0, 940, 941, - 5, 108, 0, 0, 941, 228, 1, 0, 0, 0, 942, 943, 5, 116, 0, 0, 943, 944, 5, - 114, 0, 0, 944, 945, 5, 105, 0, 0, 945, 946, 5, 109, 0, 0, 946, 230, 1, 0, - 0, 0, 947, 948, 5, 116, 0, 0, 948, 949, 5, 121, 0, 0, 949, 950, 5, 112, 0, - 0, 950, 951, 5, 101, 0, 0, 951, 232, 1, 0, 0, 0, 952, 953, 5, 117, 0, 0, - 953, 954, 5, 106, 0, 0, 954, 234, 1, 0, 0, 0, 955, 956, 5, 117, 0, 0, 956, - 957, 5, 110, 0, 0, 957, 958, 5, 103, 0, 0, 958, 959, 5, 114, 0, 0, 959, 960, - 5, 111, 0, 0, 960, 961, 5, 117, 0, 0, 961, 962, 5, 112, 0, 0, 962, 236, 1, - 0, 0, 0, 963, 964, 5, 117, 0, 0, 964, 965, 5, 110, 0, 0, 965, 966, 5, 105, - 0, 0, 966, 967, 5, 111, 0, 0, 967, 968, 5, 110, 0, 0, 968, 238, 1, 0, 0, 0, - 969, 970, 5, 117, 0, 0, 970, 971, 5, 112, 0, 0, 971, 972, 5, 100, 0, 0, 972, - 973, 5, 97, 0, 0, 973, 974, 5, 116, 0, 0, 974, 975, 5, 101, 0, 0, 975, 240, - 1, 0, 0, 0, 976, 977, 5, 117, 0, 0, 977, 978, 5, 112, 0, 0, 978, 979, 5, - 112, 0, 0, 979, 980, 5, 101, 0, 0, 980, 981, 5, 114, 0, 0, 981, 242, 1, 0, - 0, 0, 982, 983, 5, 117, 0, 0, 983, 984, 5, 112, 0, 0, 984, 985, 5, 115, 0, - 0, 985, 986, 5, 101, 0, 0, 986, 987, 5, 114, 0, 0, 987, 988, 5, 116, 0, 0, - 988, 244, 1, 0, 0, 0, 989, 990, 5, 118, 0, 0, 990, 991, 5, 97, 0, 0, 991, - 992, 5, 108, 0, 0, 992, 993, 5, 117, 0, 0, 993, 994, 5, 101, 0, 0, 994, 246, - 1, 0, 0, 0, 995, 996, 5, 118, 0, 0, 996, 997, 5, 97, 0, 0, 997, 998, 5, 114, - 0, 0, 998, 248, 1, 0, 0, 0, 999, 1000, 5, 118, 0, 0, 1000, 1001, 5, 105, 0, - 0, 1001, 1002, 5, 101, 0, 0, 1002, 1003, 5, 119, 0, 0, 1003, 250, 1, 0, 0, - 0, 1004, 1005, 5, 118, 0, 0, 1005, 1006, 5, 115, 0, 0, 1006, 252, 1, 0, 0, - 0, 1007, 1008, 5, 119, 0, 0, 1008, 1009, 5, 97, 0, 0, 1009, 1010, 5, 118, 0, - 0, 1010, 1011, 5, 103, 0, 0, 1011, 254, 1, 0, 0, 0, 1012, 1013, 5, 119, 0, - 0, 1013, 1014, 5, 104, 0, 0, 1014, 1015, 5, 101, 0, 0, 1015, 1016, 5, 114, - 0, 0, 1016, 1017, 5, 101, 0, 0, 1017, 256, 1, 0, 0, 0, 1018, 1019, 5, 119, - 0, 0, 1019, 1020, 5, 105, 0, 0, 1020, 1021, 5, 116, 0, 0, 1021, 1022, 5, - 104, 0, 0, 1022, 1023, 5, 105, 0, 0, 1023, 1024, 5, 110, 0, 0, 1024, 258, 1, - 0, 0, 0, 1025, 1026, 5, 119, 0, 0, 1026, 1027, 5, 106, 0, 0, 1027, 1028, 5, - 49, 0, 0, 1028, 260, 1, 0, 0, 0, 1029, 1030, 5, 119, 0, 0, 1030, 1031, 5, - 106, 0, 0, 1031, 1032, 5, 50, 0, 0, 1032, 262, 1, 0, 0, 0, 1033, 1034, 5, - 119, 0, 0, 1034, 1035, 5, 119, 0, 0, 1035, 264, 1, 0, 0, 0, 1036, 1037, 5, - 120, 0, 0, 1037, 1038, 5, 97, 0, 0, 1038, 1039, 5, 115, 0, 0, 1039, 1040, 5, - 99, 0, 0, 1040, 266, 1, 0, 0, 0, 1041, 1042, 5, 120, 0, 0, 1042, 1043, 5, - 98, 0, 0, 1043, 1044, 5, 97, 0, 0, 1044, 1045, 5, 114, 0, 0, 1045, 268, 1, - 0, 0, 0, 1046, 1047, 5, 120, 0, 0, 1047, 1048, 5, 99, 0, 0, 1048, 1049, 5, - 111, 0, 0, 1049, 1050, 5, 108, 0, 0, 1050, 1051, 5, 115, 0, 0, 1051, 270, 1, - 0, 0, 0, 1052, 1053, 5, 120, 0, 0, 1053, 1054, 5, 100, 0, 0, 1054, 1055, 5, - 101, 0, 0, 1055, 1056, 5, 115, 0, 0, 1056, 1057, 5, 99, 0, 0, 1057, 272, 1, - 0, 0, 0, 1058, 1059, 5, 120, 0, 0, 1059, 1060, 5, 101, 0, 0, 1060, 1061, 5, - 120, 0, 0, 1061, 1062, 5, 112, 0, 0, 1062, 274, 1, 0, 0, 0, 1063, 1064, 5, - 120, 0, 0, 1064, 1065, 5, 103, 0, 0, 1065, 1066, 5, 114, 0, 0, 1066, 1067, - 5, 111, 0, 0, 1067, 1068, 5, 117, 0, 0, 1068, 1069, 5, 112, 0, 0, 1069, 276, - 1, 0, 0, 0, 1070, 1071, 5, 120, 0, 0, 1071, 1072, 5, 107, 0, 0, 1072, 1073, - 5, 101, 0, 0, 1073, 1074, 5, 121, 0, 0, 1074, 278, 1, 0, 0, 0, 1075, 1076, - 5, 120, 0, 0, 1076, 1077, 5, 108, 0, 0, 1077, 1078, 5, 111, 0, 0, 1078, - 1079, 5, 103, 0, 0, 1079, 280, 1, 0, 0, 0, 1080, 1081, 5, 120, 0, 0, 1081, - 1082, 5, 112, 0, 0, 1082, 1083, 5, 114, 0, 0, 1083, 1084, 5, 101, 0, 0, - 1084, 1085, 5, 118, 0, 0, 1085, 282, 1, 0, 0, 0, 1086, 1087, 5, 120, 0, 0, - 1087, 1088, 5, 114, 0, 0, 1088, 1089, 5, 97, 0, 0, 1089, 1090, 5, 110, 0, 0, - 1090, 1091, 5, 107, 0, 0, 1091, 284, 1, 0, 0, 0, 1092, 1093, 5, 120, 0, 0, - 1093, 1094, 5, 114, 0, 0, 1094, 1095, 5, 97, 0, 0, 1095, 1096, 5, 110, 0, 0, - 1096, 1097, 5, 107, 0, 0, 1097, 1098, 5, 101, 0, 0, 1098, 1099, 5, 100, 0, - 0, 1099, 286, 1, 0, 0, 0, 1100, 1101, 5, 120, 0, 0, 1101, 1102, 5, 114, 0, - 0, 1102, 1103, 5, 101, 0, 0, 1103, 1104, 5, 99, 0, 0, 1104, 1105, 5, 115, 0, - 0, 1105, 288, 1, 0, 0, 0, 1106, 1107, 5, 120, 0, 0, 1107, 1108, 5, 114, 0, - 0, 1108, 1109, 5, 111, 0, 0, 1109, 1110, 5, 119, 0, 0, 1110, 1111, 5, 115, - 0, 0, 1111, 290, 1, 0, 0, 0, 1112, 1113, 5, 120, 0, 0, 1113, 1114, 5, 115, - 0, 0, 1114, 1115, 5, 115, 0, 0, 1115, 292, 1, 0, 0, 0, 1116, 1117, 5, 120, - 0, 0, 1117, 1118, 5, 116, 0, 0, 1118, 1119, 5, 121, 0, 0, 1119, 1120, 5, - 112, 0, 0, 1120, 1121, 5, 101, 0, 0, 1121, 294, 1, 0, 0, 0, 1122, 1123, 5, - 121, 0, 0, 1123, 1124, 5, 105, 0, 0, 1124, 1125, 5, 101, 0, 0, 1125, 1126, - 5, 108, 0, 0, 1126, 1127, 5, 100, 0, 0, 1127, 296, 1, 0, 0, 0, 1128, 1129, - 5, 122, 0, 0, 1129, 1130, 5, 105, 0, 0, 1130, 1131, 5, 112, 0, 0, 1131, 298, - 1, 0, 0, 0, 1132, 1133, 5, 43, 0, 0, 1133, 300, 1, 0, 0, 0, 1134, 1135, 5, - 45, 0, 0, 1135, 302, 1, 0, 0, 0, 1136, 1137, 5, 42, 0, 0, 1137, 304, 1, 0, - 0, 0, 1138, 1139, 5, 37, 0, 0, 1139, 306, 1, 0, 0, 0, 1140, 1141, 5, 61, 0, - 0, 1141, 308, 1, 0, 0, 0, 1142, 1143, 5, 60, 0, 0, 1143, 1144, 5, 62, 0, 0, - 1144, 310, 1, 0, 0, 0, 1145, 1146, 5, 60, 0, 0, 1146, 312, 1, 0, 0, 0, 1147, - 1148, 5, 60, 0, 0, 1148, 1149, 5, 61, 0, 0, 1149, 314, 1, 0, 0, 0, 1150, - 1151, 5, 62, 0, 0, 1151, 316, 1, 0, 0, 0, 1152, 1153, 5, 62, 0, 0, 1153, - 1154, 5, 61, 0, 0, 1154, 318, 1, 0, 0, 0, 1155, 1156, 5, 97, 0, 0, 1156, - 1157, 5, 110, 0, 0, 1157, 1158, 5, 100, 0, 0, 1158, 320, 1, 0, 0, 0, 1159, - 1160, 5, 111, 0, 0, 1160, 1161, 5, 114, 0, 0, 1161, 322, 1, 0, 0, 0, 1162, - 1163, 5, 110, 0, 0, 1163, 1164, 5, 111, 0, 0, 1164, 1165, 5, 116, 0, 0, - 1165, 324, 1, 0, 0, 0, 1166, 1167, 5, 105, 0, 0, 1167, 1168, 5, 110, 0, 0, - 1168, 1169, 5, 116, 0, 0, 1169, 326, 1, 0, 0, 0, 1170, 1171, 5, 108, 0, 0, - 1171, 1172, 5, 111, 0, 0, 1172, 1173, 5, 110, 0, 0, 1173, 1174, 5, 103, 0, - 0, 1174, 328, 1, 0, 0, 0, 1175, 1176, 5, 102, 0, 0, 1176, 1177, 5, 108, 0, - 0, 1177, 1178, 5, 111, 0, 0, 1178, 1179, 5, 97, 0, 0, 1179, 1180, 5, 116, 0, - 0, 1180, 330, 1, 0, 0, 0, 1181, 1182, 5, 100, 0, 0, 1182, 1183, 5, 111, 0, - 0, 1183, 1184, 5, 117, 0, 0, 1184, 1185, 5, 98, 0, 0, 1185, 1186, 5, 108, 0, - 0, 1186, 1187, 5, 101, 0, 0, 1187, 332, 1, 0, 0, 0, 1188, 1189, 5, 99, 0, 0, - 1189, 1190, 5, 104, 0, 0, 1190, 1191, 5, 97, 0, 0, 1191, 1192, 5, 114, 0, 0, - 1192, 334, 1, 0, 0, 0, 1193, 1194, 5, 115, 0, 0, 1194, 1195, 5, 121, 0, 0, - 1195, 1196, 5, 109, 0, 0, 1196, 1197, 5, 98, 0, 0, 1197, 1198, 5, 111, 0, 0, - 1198, 1199, 5, 108, 0, 0, 1199, 336, 1, 0, 0, 0, 1200, 1201, 5, 116, 0, 0, - 1201, 1202, 5, 105, 0, 0, 1202, 1203, 5, 109, 0, 0, 1203, 1204, 5, 101, 0, - 0, 1204, 1205, 5, 115, 0, 0, 1205, 1206, 5, 116, 0, 0, 1206, 1207, 5, 97, 0, - 0, 1207, 1208, 5, 109, 0, 0, 1208, 1209, 5, 112, 0, 0, 1209, 338, 1, 0, 0, - 0, 1210, 1214, 7, 0, 0, 0, 1211, 1213, 7, 1, 0, 0, 1212, 1211, 1, 0, 0, 0, - 1213, 1216, 1, 0, 0, 0, 1214, 1212, 1, 0, 0, 0, 1214, 1215, 1, 0, 0, 0, - 1215, 340, 1, 0, 0, 0, 1216, 1214, 1, 0, 0, 0, 1217, 1218, 7, 2, 0, 0, 1218, - 342, 1, 0, 0, 0, 1219, 1221, 3, 341, 170, 0, 1220, 1219, 1, 0, 0, 0, 1221, - 1222, 1, 0, 0, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, - 1230, 1, 0, 0, 0, 1224, 1226, 5, 46, 0, 0, 1225, 1227, 3, 341, 170, 0, 1226, - 1225, 1, 0, 0, 0, 1227, 1228, 1, 0, 0, 0, 1228, 1226, 1, 0, 0, 0, 1228, - 1229, 1, 0, 0, 0, 1229, 1231, 1, 0, 0, 0, 1230, 1224, 1, 0, 0, 0, 1230, - 1231, 1, 0, 0, 0, 1231, 344, 1, 0, 0, 0, 1232, 1237, 5, 34, 0, 0, 1233, - 1236, 3, 347, 173, 0, 1234, 1236, 8, 3, 0, 0, 1235, 1233, 1, 0, 0, 0, 1235, - 1234, 1, 0, 0, 0, 1236, 1239, 1, 0, 0, 0, 1237, 1235, 1, 0, 0, 0, 1237, - 1238, 1, 0, 0, 0, 1238, 1240, 1, 0, 0, 0, 1239, 1237, 1, 0, 0, 0, 1240, - 1241, 5, 34, 0, 0, 1241, 346, 1, 0, 0, 0, 1242, 1243, 5, 92, 0, 0, 1243, - 1244, 7, 4, 0, 0, 1244, 348, 1, 0, 0, 0, 1245, 1247, 7, 5, 0, 0, 1246, 1245, - 1, 0, 0, 0, 1247, 1248, 1, 0, 0, 0, 1248, 1246, 1, 0, 0, 0, 1248, 1249, 1, - 0, 0, 0, 1249, 1250, 1, 0, 0, 0, 1250, 1251, 6, 174, 0, 0, 1251, 350, 1, 0, - 0, 0, 8, 0, 1214, 1222, 1228, 1230, 1235, 1237, 1248, 1, 6, 0, 0, - ]; - - private static __ATN: ATN; - public static get _ATN(): ATN { - if (!qLexer.__ATN) { - qLexer.__ATN = new ATNDeserializer().deserialize(qLexer._serializedATN); - } - - return qLexer.__ATN; - } - - static DecisionsToDFA = qLexer._ATN.decisionToState.map( - (ds: DecisionState, index: number) => new DFA(ds, index) - ); -} diff --git a/server/src/utils/antlrGrammars/qListener.ts b/server/src/utils/antlrGrammars/qListener.ts deleted file mode 100644 index 9c8c1b47..00000000 --- a/server/src/utils/antlrGrammars/qListener.ts +++ /dev/null @@ -1,1779 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -// Generated from grammars/q.g4 by ANTLR 4.13.0 - -import { ParseTreeListener } from "antlr4"; - -import { - Abs_functionContext, - Acos_functionContext, - Additive_expressionContext, - All_functionContext, - And_expressionContext, - And_functionContext, - Any_functionContext, - Asin_functionContext, - Atan_functionContext, - Avg_functionContext, - Ceiling_functionContext, - Comparison_expressionContext, - Cos_functionContext, - Count_functionContext, - Cross_functionContext, - Delete_functionContext, - Deltas_functionContext, - Dev_functionContext, - Distinct_functionContext, - Div_functionContext, - Drop_functionContext, - Each_functionContext, - Enlist_functionContext, - Eval_functionContext, - Except_functionContext, - Exec_functionContext, - Exp_functionContext, - ExpressionContext, - Fby_functionContext, - Fill_functionContext, - First_functionContext, - Flip_functionContext, - Floor_functionContext, - Get_functionContext, - Group_functionContext, - Gtime_functionContext, - Hclose_functionContext, - Hcount_functionContext, - Hdel_functionContext, - Hopen_functionContext, - Hsym_functionContext, - Iasc_functionContext, - Idesc_functionContext, - Ij_functionContext, - In_functionContext, - Insert_functionContext, - Inter_functionContext, - Inv_functionContext, - Keys_functionContext, - Last_functionContext, - Like_functionContext, - List_functionContext, - Lj_functionContext, - Load_functionContext, - Log_functionContext, - Lower_functionContext, - Lsq_functionContext, - Ltime_functionContext, - Ltrim_functionContext, - Mavg_functionContext, - Max_functionContext, - Maxs_functionContext, - Mcount_functionContext, - Md5_functionContext, - Mdev_functionContext, - Med_functionContext, - Meta_functionContext, - Min_functionContext, - Mins_functionContext, - Mmax_functionContext, - Mmin_functionContext, - Mmu_functionContext, - Mod_functionContext, - Msum_functionContext, - Multiplicative_expressionContext, - Neg_functionContext, - Next_functionContext, - Not_functionContext, - Null_functionContext, - Or_expressionContext, - Or_functionContext, - Over_functionContext, - Parse_functionContext, - Peach_functionContext, - Pj_functionContext, - Plist_functionContext, - Prd_functionContext, - Prev_functionContext, - Primary_expressionContext, - Prior_functionContext, - Rand_functionContext, - Rank_functionContext, - Ratios_functionContext, - Raze_functionContext, - Read0_functionContext, - Read1_functionContext, - Reciprocal_functionContext, - Reverse_functionContext, - Rload_functionContext, - Rotate_functionContext, - Rsave_functionContext, - Rtrim_functionContext, - Save_functionContext, - Scan_functionContext, - Select_functionContext, - Set_functionContext, - Show_functionContext, - Signum_functionContext, - Sin_functionContext, - Sqrt_functionContext, - Ssr_functionContext, - Storage_typeContext, - String_functionContext, - Sublist_functionContext, - Sum_functionContext, - Sums_functionContext, - Sv_functionContext, - System_functionContext, - Tables_functionContext, - Tan_functionContext, - Til_functionContext, - Trim_functionContext, - Type_functionContext, - Uj_functionContext, - Unary_expressionContext, - Ungroup_functionContext, - Union_functionContext, - Update_functionContext, - Upper_functionContext, - Upsert_functionContext, - Value_functionContext, - Var_functionContext, - Variable_declarationContext, - Variable_nameContext, - View_functionContext, - Vs_functionContext, - Wavg_functionContext, - Where_functionContext, - Within_functionContext, - Wj1_functionContext, - Wj2_functionContext, - Ww_functionContext, - Xasc_functionContext, - Xbar_functionContext, - Xcols_functionContext, - Xdesc_functionContext, - Xexp_functionContext, - Xgroup_functionContext, - Xkey_functionContext, - Xlog_functionContext, - Xprev_functionContext, - Xrank_functionContext, - Xranked_functionContext, - Xrecs_functionContext, - Xrows_functionContext, - Xss_functionContext, - Xtype_functionContext, - Yield_functionContext, - Zip_functionContext, -} from "./qParser"; - -/** - * This interface defines a complete listener for a parse tree produced by - * `qParser`. - */ -export default class qListener extends ParseTreeListener { - /** - * Enter a parse tree produced by `qParser.variable_declaration`. - * @param ctx the parse tree - */ - enterVariable_declaration?: (ctx: Variable_declarationContext) => void; - /** - * Exit a parse tree produced by `qParser.variable_declaration`. - * @param ctx the parse tree - */ - exitVariable_declaration?: (ctx: Variable_declarationContext) => void; - /** - * Enter a parse tree produced by `qParser.storage_type`. - * @param ctx the parse tree - */ - enterStorage_type?: (ctx: Storage_typeContext) => void; - /** - * Exit a parse tree produced by `qParser.storage_type`. - * @param ctx the parse tree - */ - exitStorage_type?: (ctx: Storage_typeContext) => void; - /** - * Enter a parse tree produced by `qParser.variable_name`. - * @param ctx the parse tree - */ - enterVariable_name?: (ctx: Variable_nameContext) => void; - /** - * Exit a parse tree produced by `qParser.variable_name`. - * @param ctx the parse tree - */ - exitVariable_name?: (ctx: Variable_nameContext) => void; - /** - * Enter a parse tree produced by `qParser.expression`. - * @param ctx the parse tree - */ - enterExpression?: (ctx: ExpressionContext) => void; - /** - * Exit a parse tree produced by `qParser.expression`. - * @param ctx the parse tree - */ - exitExpression?: (ctx: ExpressionContext) => void; - /** - * Enter a parse tree produced by `qParser.or_expression`. - * @param ctx the parse tree - */ - enterOr_expression?: (ctx: Or_expressionContext) => void; - /** - * Exit a parse tree produced by `qParser.or_expression`. - * @param ctx the parse tree - */ - exitOr_expression?: (ctx: Or_expressionContext) => void; - /** - * Enter a parse tree produced by `qParser.and_expression`. - * @param ctx the parse tree - */ - enterAnd_expression?: (ctx: And_expressionContext) => void; - /** - * Exit a parse tree produced by `qParser.and_expression`. - * @param ctx the parse tree - */ - exitAnd_expression?: (ctx: And_expressionContext) => void; - /** - * Enter a parse tree produced by `qParser.comparison_expression`. - * @param ctx the parse tree - */ - enterComparison_expression?: (ctx: Comparison_expressionContext) => void; - /** - * Exit a parse tree produced by `qParser.comparison_expression`. - * @param ctx the parse tree - */ - exitComparison_expression?: (ctx: Comparison_expressionContext) => void; - /** - * Enter a parse tree produced by `qParser.additive_expression`. - * @param ctx the parse tree - */ - enterAdditive_expression?: (ctx: Additive_expressionContext) => void; - /** - * Exit a parse tree produced by `qParser.additive_expression`. - * @param ctx the parse tree - */ - exitAdditive_expression?: (ctx: Additive_expressionContext) => void; - /** - * Enter a parse tree produced by `qParser.multiplicative_expression`. - * @param ctx the parse tree - */ - enterMultiplicative_expression?: ( - ctx: Multiplicative_expressionContext - ) => void; - /** - * Exit a parse tree produced by `qParser.multiplicative_expression`. - * @param ctx the parse tree - */ - exitMultiplicative_expression?: ( - ctx: Multiplicative_expressionContext - ) => void; - /** - * Enter a parse tree produced by `qParser.unary_expression`. - * @param ctx the parse tree - */ - enterUnary_expression?: (ctx: Unary_expressionContext) => void; - /** - * Exit a parse tree produced by `qParser.unary_expression`. - * @param ctx the parse tree - */ - exitUnary_expression?: (ctx: Unary_expressionContext) => void; - /** - * Enter a parse tree produced by `qParser.primary_expression`. - * @param ctx the parse tree - */ - enterPrimary_expression?: (ctx: Primary_expressionContext) => void; - /** - * Exit a parse tree produced by `qParser.primary_expression`. - * @param ctx the parse tree - */ - exitPrimary_expression?: (ctx: Primary_expressionContext) => void; - /** - * Enter a parse tree produced by `qParser.abs_function`. - * @param ctx the parse tree - */ - enterAbs_function?: (ctx: Abs_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.abs_function`. - * @param ctx the parse tree - */ - exitAbs_function?: (ctx: Abs_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.acos_function`. - * @param ctx the parse tree - */ - enterAcos_function?: (ctx: Acos_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.acos_function`. - * @param ctx the parse tree - */ - exitAcos_function?: (ctx: Acos_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.all_function`. - * @param ctx the parse tree - */ - enterAll_function?: (ctx: All_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.all_function`. - * @param ctx the parse tree - */ - exitAll_function?: (ctx: All_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.and_function`. - * @param ctx the parse tree - */ - enterAnd_function?: (ctx: And_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.and_function`. - * @param ctx the parse tree - */ - exitAnd_function?: (ctx: And_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.any_function`. - * @param ctx the parse tree - */ - enterAny_function?: (ctx: Any_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.any_function`. - * @param ctx the parse tree - */ - exitAny_function?: (ctx: Any_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.asin_function`. - * @param ctx the parse tree - */ - enterAsin_function?: (ctx: Asin_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.asin_function`. - * @param ctx the parse tree - */ - exitAsin_function?: (ctx: Asin_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.atan_function`. - * @param ctx the parse tree - */ - enterAtan_function?: (ctx: Atan_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.atan_function`. - * @param ctx the parse tree - */ - exitAtan_function?: (ctx: Atan_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.avg_function`. - * @param ctx the parse tree - */ - enterAvg_function?: (ctx: Avg_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.avg_function`. - * @param ctx the parse tree - */ - exitAvg_function?: (ctx: Avg_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.ceiling_function`. - * @param ctx the parse tree - */ - enterCeiling_function?: (ctx: Ceiling_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.ceiling_function`. - * @param ctx the parse tree - */ - exitCeiling_function?: (ctx: Ceiling_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.cos_function`. - * @param ctx the parse tree - */ - enterCos_function?: (ctx: Cos_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.cos_function`. - * @param ctx the parse tree - */ - exitCos_function?: (ctx: Cos_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.count_function`. - * @param ctx the parse tree - */ - enterCount_function?: (ctx: Count_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.count_function`. - * @param ctx the parse tree - */ - exitCount_function?: (ctx: Count_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.cross_function`. - * @param ctx the parse tree - */ - enterCross_function?: (ctx: Cross_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.cross_function`. - * @param ctx the parse tree - */ - exitCross_function?: (ctx: Cross_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.delete_function`. - * @param ctx the parse tree - */ - enterDelete_function?: (ctx: Delete_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.delete_function`. - * @param ctx the parse tree - */ - exitDelete_function?: (ctx: Delete_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.deltas_function`. - * @param ctx the parse tree - */ - enterDeltas_function?: (ctx: Deltas_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.deltas_function`. - * @param ctx the parse tree - */ - exitDeltas_function?: (ctx: Deltas_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.dev_function`. - * @param ctx the parse tree - */ - enterDev_function?: (ctx: Dev_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.dev_function`. - * @param ctx the parse tree - */ - exitDev_function?: (ctx: Dev_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.distinct_function`. - * @param ctx the parse tree - */ - enterDistinct_function?: (ctx: Distinct_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.distinct_function`. - * @param ctx the parse tree - */ - exitDistinct_function?: (ctx: Distinct_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.div_function`. - * @param ctx the parse tree - */ - enterDiv_function?: (ctx: Div_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.div_function`. - * @param ctx the parse tree - */ - exitDiv_function?: (ctx: Div_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.drop_function`. - * @param ctx the parse tree - */ - enterDrop_function?: (ctx: Drop_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.drop_function`. - * @param ctx the parse tree - */ - exitDrop_function?: (ctx: Drop_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.each_function`. - * @param ctx the parse tree - */ - enterEach_function?: (ctx: Each_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.each_function`. - * @param ctx the parse tree - */ - exitEach_function?: (ctx: Each_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.enlist_function`. - * @param ctx the parse tree - */ - enterEnlist_function?: (ctx: Enlist_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.enlist_function`. - * @param ctx the parse tree - */ - exitEnlist_function?: (ctx: Enlist_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.eval_function`. - * @param ctx the parse tree - */ - enterEval_function?: (ctx: Eval_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.eval_function`. - * @param ctx the parse tree - */ - exitEval_function?: (ctx: Eval_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.except_function`. - * @param ctx the parse tree - */ - enterExcept_function?: (ctx: Except_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.except_function`. - * @param ctx the parse tree - */ - exitExcept_function?: (ctx: Except_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.exec_function`. - * @param ctx the parse tree - */ - enterExec_function?: (ctx: Exec_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.exec_function`. - * @param ctx the parse tree - */ - exitExec_function?: (ctx: Exec_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.exp_function`. - * @param ctx the parse tree - */ - enterExp_function?: (ctx: Exp_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.exp_function`. - * @param ctx the parse tree - */ - exitExp_function?: (ctx: Exp_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.fby_function`. - * @param ctx the parse tree - */ - enterFby_function?: (ctx: Fby_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.fby_function`. - * @param ctx the parse tree - */ - exitFby_function?: (ctx: Fby_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.fill_function`. - * @param ctx the parse tree - */ - enterFill_function?: (ctx: Fill_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.fill_function`. - * @param ctx the parse tree - */ - exitFill_function?: (ctx: Fill_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.first_function`. - * @param ctx the parse tree - */ - enterFirst_function?: (ctx: First_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.first_function`. - * @param ctx the parse tree - */ - exitFirst_function?: (ctx: First_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.flip_function`. - * @param ctx the parse tree - */ - enterFlip_function?: (ctx: Flip_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.flip_function`. - * @param ctx the parse tree - */ - exitFlip_function?: (ctx: Flip_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.floor_function`. - * @param ctx the parse tree - */ - enterFloor_function?: (ctx: Floor_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.floor_function`. - * @param ctx the parse tree - */ - exitFloor_function?: (ctx: Floor_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.get_function`. - * @param ctx the parse tree - */ - enterGet_function?: (ctx: Get_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.get_function`. - * @param ctx the parse tree - */ - exitGet_function?: (ctx: Get_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.group_function`. - * @param ctx the parse tree - */ - enterGroup_function?: (ctx: Group_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.group_function`. - * @param ctx the parse tree - */ - exitGroup_function?: (ctx: Group_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.gtime_function`. - * @param ctx the parse tree - */ - enterGtime_function?: (ctx: Gtime_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.gtime_function`. - * @param ctx the parse tree - */ - exitGtime_function?: (ctx: Gtime_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.hclose_function`. - * @param ctx the parse tree - */ - enterHclose_function?: (ctx: Hclose_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.hclose_function`. - * @param ctx the parse tree - */ - exitHclose_function?: (ctx: Hclose_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.hcount_function`. - * @param ctx the parse tree - */ - enterHcount_function?: (ctx: Hcount_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.hcount_function`. - * @param ctx the parse tree - */ - exitHcount_function?: (ctx: Hcount_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.hdel_function`. - * @param ctx the parse tree - */ - enterHdel_function?: (ctx: Hdel_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.hdel_function`. - * @param ctx the parse tree - */ - exitHdel_function?: (ctx: Hdel_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.hopen_function`. - * @param ctx the parse tree - */ - enterHopen_function?: (ctx: Hopen_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.hopen_function`. - * @param ctx the parse tree - */ - exitHopen_function?: (ctx: Hopen_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.hsym_function`. - * @param ctx the parse tree - */ - enterHsym_function?: (ctx: Hsym_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.hsym_function`. - * @param ctx the parse tree - */ - exitHsym_function?: (ctx: Hsym_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.iasc_function`. - * @param ctx the parse tree - */ - enterIasc_function?: (ctx: Iasc_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.iasc_function`. - * @param ctx the parse tree - */ - exitIasc_function?: (ctx: Iasc_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.idesc_function`. - * @param ctx the parse tree - */ - enterIdesc_function?: (ctx: Idesc_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.idesc_function`. - * @param ctx the parse tree - */ - exitIdesc_function?: (ctx: Idesc_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.ij_function`. - * @param ctx the parse tree - */ - enterIj_function?: (ctx: Ij_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.ij_function`. - * @param ctx the parse tree - */ - exitIj_function?: (ctx: Ij_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.in_function`. - * @param ctx the parse tree - */ - enterIn_function?: (ctx: In_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.in_function`. - * @param ctx the parse tree - */ - exitIn_function?: (ctx: In_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.insert_function`. - * @param ctx the parse tree - */ - enterInsert_function?: (ctx: Insert_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.insert_function`. - * @param ctx the parse tree - */ - exitInsert_function?: (ctx: Insert_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.inter_function`. - * @param ctx the parse tree - */ - enterInter_function?: (ctx: Inter_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.inter_function`. - * @param ctx the parse tree - */ - exitInter_function?: (ctx: Inter_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.inv_function`. - * @param ctx the parse tree - */ - enterInv_function?: (ctx: Inv_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.inv_function`. - * @param ctx the parse tree - */ - exitInv_function?: (ctx: Inv_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.keys_function`. - * @param ctx the parse tree - */ - enterKeys_function?: (ctx: Keys_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.keys_function`. - * @param ctx the parse tree - */ - exitKeys_function?: (ctx: Keys_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.last_function`. - * @param ctx the parse tree - */ - enterLast_function?: (ctx: Last_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.last_function`. - * @param ctx the parse tree - */ - exitLast_function?: (ctx: Last_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.like_function`. - * @param ctx the parse tree - */ - enterLike_function?: (ctx: Like_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.like_function`. - * @param ctx the parse tree - */ - exitLike_function?: (ctx: Like_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.list_function`. - * @param ctx the parse tree - */ - enterList_function?: (ctx: List_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.list_function`. - * @param ctx the parse tree - */ - exitList_function?: (ctx: List_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.lj_function`. - * @param ctx the parse tree - */ - enterLj_function?: (ctx: Lj_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.lj_function`. - * @param ctx the parse tree - */ - exitLj_function?: (ctx: Lj_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.load_function`. - * @param ctx the parse tree - */ - enterLoad_function?: (ctx: Load_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.load_function`. - * @param ctx the parse tree - */ - exitLoad_function?: (ctx: Load_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.log_function`. - * @param ctx the parse tree - */ - enterLog_function?: (ctx: Log_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.log_function`. - * @param ctx the parse tree - */ - exitLog_function?: (ctx: Log_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.lower_function`. - * @param ctx the parse tree - */ - enterLower_function?: (ctx: Lower_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.lower_function`. - * @param ctx the parse tree - */ - exitLower_function?: (ctx: Lower_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.lsq_function`. - * @param ctx the parse tree - */ - enterLsq_function?: (ctx: Lsq_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.lsq_function`. - * @param ctx the parse tree - */ - exitLsq_function?: (ctx: Lsq_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.ltime_function`. - * @param ctx the parse tree - */ - enterLtime_function?: (ctx: Ltime_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.ltime_function`. - * @param ctx the parse tree - */ - exitLtime_function?: (ctx: Ltime_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.ltrim_function`. - * @param ctx the parse tree - */ - enterLtrim_function?: (ctx: Ltrim_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.ltrim_function`. - * @param ctx the parse tree - */ - exitLtrim_function?: (ctx: Ltrim_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.mavg_function`. - * @param ctx the parse tree - */ - enterMavg_function?: (ctx: Mavg_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.mavg_function`. - * @param ctx the parse tree - */ - exitMavg_function?: (ctx: Mavg_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.max_function`. - * @param ctx the parse tree - */ - enterMax_function?: (ctx: Max_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.max_function`. - * @param ctx the parse tree - */ - exitMax_function?: (ctx: Max_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.maxs_function`. - * @param ctx the parse tree - */ - enterMaxs_function?: (ctx: Maxs_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.maxs_function`. - * @param ctx the parse tree - */ - exitMaxs_function?: (ctx: Maxs_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.mcount_function`. - * @param ctx the parse tree - */ - enterMcount_function?: (ctx: Mcount_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.mcount_function`. - * @param ctx the parse tree - */ - exitMcount_function?: (ctx: Mcount_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.md5_function`. - * @param ctx the parse tree - */ - enterMd5_function?: (ctx: Md5_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.md5_function`. - * @param ctx the parse tree - */ - exitMd5_function?: (ctx: Md5_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.mdev_function`. - * @param ctx the parse tree - */ - enterMdev_function?: (ctx: Mdev_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.mdev_function`. - * @param ctx the parse tree - */ - exitMdev_function?: (ctx: Mdev_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.med_function`. - * @param ctx the parse tree - */ - enterMed_function?: (ctx: Med_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.med_function`. - * @param ctx the parse tree - */ - exitMed_function?: (ctx: Med_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.meta_function`. - * @param ctx the parse tree - */ - enterMeta_function?: (ctx: Meta_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.meta_function`. - * @param ctx the parse tree - */ - exitMeta_function?: (ctx: Meta_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.min_function`. - * @param ctx the parse tree - */ - enterMin_function?: (ctx: Min_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.min_function`. - * @param ctx the parse tree - */ - exitMin_function?: (ctx: Min_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.mins_function`. - * @param ctx the parse tree - */ - enterMins_function?: (ctx: Mins_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.mins_function`. - * @param ctx the parse tree - */ - exitMins_function?: (ctx: Mins_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.mmax_function`. - * @param ctx the parse tree - */ - enterMmax_function?: (ctx: Mmax_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.mmax_function`. - * @param ctx the parse tree - */ - exitMmax_function?: (ctx: Mmax_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.mmin_function`. - * @param ctx the parse tree - */ - enterMmin_function?: (ctx: Mmin_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.mmin_function`. - * @param ctx the parse tree - */ - exitMmin_function?: (ctx: Mmin_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.mmu_function`. - * @param ctx the parse tree - */ - enterMmu_function?: (ctx: Mmu_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.mmu_function`. - * @param ctx the parse tree - */ - exitMmu_function?: (ctx: Mmu_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.mod_function`. - * @param ctx the parse tree - */ - enterMod_function?: (ctx: Mod_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.mod_function`. - * @param ctx the parse tree - */ - exitMod_function?: (ctx: Mod_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.msum_function`. - * @param ctx the parse tree - */ - enterMsum_function?: (ctx: Msum_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.msum_function`. - * @param ctx the parse tree - */ - exitMsum_function?: (ctx: Msum_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.neg_function`. - * @param ctx the parse tree - */ - enterNeg_function?: (ctx: Neg_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.neg_function`. - * @param ctx the parse tree - */ - exitNeg_function?: (ctx: Neg_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.next_function`. - * @param ctx the parse tree - */ - enterNext_function?: (ctx: Next_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.next_function`. - * @param ctx the parse tree - */ - exitNext_function?: (ctx: Next_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.not_function`. - * @param ctx the parse tree - */ - enterNot_function?: (ctx: Not_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.not_function`. - * @param ctx the parse tree - */ - exitNot_function?: (ctx: Not_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.null_function`. - * @param ctx the parse tree - */ - enterNull_function?: (ctx: Null_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.null_function`. - * @param ctx the parse tree - */ - exitNull_function?: (ctx: Null_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.or_function`. - * @param ctx the parse tree - */ - enterOr_function?: (ctx: Or_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.or_function`. - * @param ctx the parse tree - */ - exitOr_function?: (ctx: Or_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.over_function`. - * @param ctx the parse tree - */ - enterOver_function?: (ctx: Over_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.over_function`. - * @param ctx the parse tree - */ - exitOver_function?: (ctx: Over_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.parse_function`. - * @param ctx the parse tree - */ - enterParse_function?: (ctx: Parse_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.parse_function`. - * @param ctx the parse tree - */ - exitParse_function?: (ctx: Parse_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.peach_function`. - * @param ctx the parse tree - */ - enterPeach_function?: (ctx: Peach_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.peach_function`. - * @param ctx the parse tree - */ - exitPeach_function?: (ctx: Peach_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.pj_function`. - * @param ctx the parse tree - */ - enterPj_function?: (ctx: Pj_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.pj_function`. - * @param ctx the parse tree - */ - exitPj_function?: (ctx: Pj_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.plist_function`. - * @param ctx the parse tree - */ - enterPlist_function?: (ctx: Plist_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.plist_function`. - * @param ctx the parse tree - */ - exitPlist_function?: (ctx: Plist_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.prd_function`. - * @param ctx the parse tree - */ - enterPrd_function?: (ctx: Prd_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.prd_function`. - * @param ctx the parse tree - */ - exitPrd_function?: (ctx: Prd_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.prev_function`. - * @param ctx the parse tree - */ - enterPrev_function?: (ctx: Prev_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.prev_function`. - * @param ctx the parse tree - */ - exitPrev_function?: (ctx: Prev_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.prior_function`. - * @param ctx the parse tree - */ - enterPrior_function?: (ctx: Prior_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.prior_function`. - * @param ctx the parse tree - */ - exitPrior_function?: (ctx: Prior_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.rand_function`. - * @param ctx the parse tree - */ - enterRand_function?: (ctx: Rand_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.rand_function`. - * @param ctx the parse tree - */ - exitRand_function?: (ctx: Rand_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.rank_function`. - * @param ctx the parse tree - */ - enterRank_function?: (ctx: Rank_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.rank_function`. - * @param ctx the parse tree - */ - exitRank_function?: (ctx: Rank_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.ratios_function`. - * @param ctx the parse tree - */ - enterRatios_function?: (ctx: Ratios_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.ratios_function`. - * @param ctx the parse tree - */ - exitRatios_function?: (ctx: Ratios_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.raze_function`. - * @param ctx the parse tree - */ - enterRaze_function?: (ctx: Raze_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.raze_function`. - * @param ctx the parse tree - */ - exitRaze_function?: (ctx: Raze_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.read0_function`. - * @param ctx the parse tree - */ - enterRead0_function?: (ctx: Read0_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.read0_function`. - * @param ctx the parse tree - */ - exitRead0_function?: (ctx: Read0_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.read1_function`. - * @param ctx the parse tree - */ - enterRead1_function?: (ctx: Read1_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.read1_function`. - * @param ctx the parse tree - */ - exitRead1_function?: (ctx: Read1_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.reciprocal_function`. - * @param ctx the parse tree - */ - enterReciprocal_function?: (ctx: Reciprocal_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.reciprocal_function`. - * @param ctx the parse tree - */ - exitReciprocal_function?: (ctx: Reciprocal_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.reverse_function`. - * @param ctx the parse tree - */ - enterReverse_function?: (ctx: Reverse_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.reverse_function`. - * @param ctx the parse tree - */ - exitReverse_function?: (ctx: Reverse_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.rload_function`. - * @param ctx the parse tree - */ - enterRload_function?: (ctx: Rload_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.rload_function`. - * @param ctx the parse tree - */ - exitRload_function?: (ctx: Rload_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.rotate_function`. - * @param ctx the parse tree - */ - enterRotate_function?: (ctx: Rotate_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.rotate_function`. - * @param ctx the parse tree - */ - exitRotate_function?: (ctx: Rotate_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.rsave_function`. - * @param ctx the parse tree - */ - enterRsave_function?: (ctx: Rsave_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.rsave_function`. - * @param ctx the parse tree - */ - exitRsave_function?: (ctx: Rsave_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.rtrim_function`. - * @param ctx the parse tree - */ - enterRtrim_function?: (ctx: Rtrim_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.rtrim_function`. - * @param ctx the parse tree - */ - exitRtrim_function?: (ctx: Rtrim_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.save_function`. - * @param ctx the parse tree - */ - enterSave_function?: (ctx: Save_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.save_function`. - * @param ctx the parse tree - */ - exitSave_function?: (ctx: Save_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.scan_function`. - * @param ctx the parse tree - */ - enterScan_function?: (ctx: Scan_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.scan_function`. - * @param ctx the parse tree - */ - exitScan_function?: (ctx: Scan_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.select_function`. - * @param ctx the parse tree - */ - enterSelect_function?: (ctx: Select_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.select_function`. - * @param ctx the parse tree - */ - exitSelect_function?: (ctx: Select_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.set_function`. - * @param ctx the parse tree - */ - enterSet_function?: (ctx: Set_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.set_function`. - * @param ctx the parse tree - */ - exitSet_function?: (ctx: Set_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.show_function`. - * @param ctx the parse tree - */ - enterShow_function?: (ctx: Show_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.show_function`. - * @param ctx the parse tree - */ - exitShow_function?: (ctx: Show_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.signum_function`. - * @param ctx the parse tree - */ - enterSignum_function?: (ctx: Signum_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.signum_function`. - * @param ctx the parse tree - */ - exitSignum_function?: (ctx: Signum_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.sin_function`. - * @param ctx the parse tree - */ - enterSin_function?: (ctx: Sin_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.sin_function`. - * @param ctx the parse tree - */ - exitSin_function?: (ctx: Sin_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.sqrt_function`. - * @param ctx the parse tree - */ - enterSqrt_function?: (ctx: Sqrt_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.sqrt_function`. - * @param ctx the parse tree - */ - exitSqrt_function?: (ctx: Sqrt_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.ssr_function`. - * @param ctx the parse tree - */ - enterSsr_function?: (ctx: Ssr_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.ssr_function`. - * @param ctx the parse tree - */ - exitSsr_function?: (ctx: Ssr_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.string_function`. - * @param ctx the parse tree - */ - enterString_function?: (ctx: String_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.string_function`. - * @param ctx the parse tree - */ - exitString_function?: (ctx: String_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.sublist_function`. - * @param ctx the parse tree - */ - enterSublist_function?: (ctx: Sublist_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.sublist_function`. - * @param ctx the parse tree - */ - exitSublist_function?: (ctx: Sublist_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.sum_function`. - * @param ctx the parse tree - */ - enterSum_function?: (ctx: Sum_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.sum_function`. - * @param ctx the parse tree - */ - exitSum_function?: (ctx: Sum_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.sums_function`. - * @param ctx the parse tree - */ - enterSums_function?: (ctx: Sums_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.sums_function`. - * @param ctx the parse tree - */ - exitSums_function?: (ctx: Sums_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.sv_function`. - * @param ctx the parse tree - */ - enterSv_function?: (ctx: Sv_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.sv_function`. - * @param ctx the parse tree - */ - exitSv_function?: (ctx: Sv_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.system_function`. - * @param ctx the parse tree - */ - enterSystem_function?: (ctx: System_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.system_function`. - * @param ctx the parse tree - */ - exitSystem_function?: (ctx: System_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.tables_function`. - * @param ctx the parse tree - */ - enterTables_function?: (ctx: Tables_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.tables_function`. - * @param ctx the parse tree - */ - exitTables_function?: (ctx: Tables_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.tan_function`. - * @param ctx the parse tree - */ - enterTan_function?: (ctx: Tan_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.tan_function`. - * @param ctx the parse tree - */ - exitTan_function?: (ctx: Tan_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.til_function`. - * @param ctx the parse tree - */ - enterTil_function?: (ctx: Til_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.til_function`. - * @param ctx the parse tree - */ - exitTil_function?: (ctx: Til_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.trim_function`. - * @param ctx the parse tree - */ - enterTrim_function?: (ctx: Trim_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.trim_function`. - * @param ctx the parse tree - */ - exitTrim_function?: (ctx: Trim_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.type_function`. - * @param ctx the parse tree - */ - enterType_function?: (ctx: Type_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.type_function`. - * @param ctx the parse tree - */ - exitType_function?: (ctx: Type_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.uj_function`. - * @param ctx the parse tree - */ - enterUj_function?: (ctx: Uj_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.uj_function`. - * @param ctx the parse tree - */ - exitUj_function?: (ctx: Uj_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.ungroup_function`. - * @param ctx the parse tree - */ - enterUngroup_function?: (ctx: Ungroup_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.ungroup_function`. - * @param ctx the parse tree - */ - exitUngroup_function?: (ctx: Ungroup_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.union_function`. - * @param ctx the parse tree - */ - enterUnion_function?: (ctx: Union_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.union_function`. - * @param ctx the parse tree - */ - exitUnion_function?: (ctx: Union_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.update_function`. - * @param ctx the parse tree - */ - enterUpdate_function?: (ctx: Update_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.update_function`. - * @param ctx the parse tree - */ - exitUpdate_function?: (ctx: Update_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.upper_function`. - * @param ctx the parse tree - */ - enterUpper_function?: (ctx: Upper_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.upper_function`. - * @param ctx the parse tree - */ - exitUpper_function?: (ctx: Upper_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.upsert_function`. - * @param ctx the parse tree - */ - enterUpsert_function?: (ctx: Upsert_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.upsert_function`. - * @param ctx the parse tree - */ - exitUpsert_function?: (ctx: Upsert_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.value_function`. - * @param ctx the parse tree - */ - enterValue_function?: (ctx: Value_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.value_function`. - * @param ctx the parse tree - */ - exitValue_function?: (ctx: Value_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.var_function`. - * @param ctx the parse tree - */ - enterVar_function?: (ctx: Var_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.var_function`. - * @param ctx the parse tree - */ - exitVar_function?: (ctx: Var_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.view_function`. - * @param ctx the parse tree - */ - enterView_function?: (ctx: View_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.view_function`. - * @param ctx the parse tree - */ - exitView_function?: (ctx: View_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.vs_function`. - * @param ctx the parse tree - */ - enterVs_function?: (ctx: Vs_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.vs_function`. - * @param ctx the parse tree - */ - exitVs_function?: (ctx: Vs_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.wavg_function`. - * @param ctx the parse tree - */ - enterWavg_function?: (ctx: Wavg_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.wavg_function`. - * @param ctx the parse tree - */ - exitWavg_function?: (ctx: Wavg_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.where_function`. - * @param ctx the parse tree - */ - enterWhere_function?: (ctx: Where_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.where_function`. - * @param ctx the parse tree - */ - exitWhere_function?: (ctx: Where_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.within_function`. - * @param ctx the parse tree - */ - enterWithin_function?: (ctx: Within_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.within_function`. - * @param ctx the parse tree - */ - exitWithin_function?: (ctx: Within_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.wj1_function`. - * @param ctx the parse tree - */ - enterWj1_function?: (ctx: Wj1_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.wj1_function`. - * @param ctx the parse tree - */ - exitWj1_function?: (ctx: Wj1_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.wj2_function`. - * @param ctx the parse tree - */ - enterWj2_function?: (ctx: Wj2_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.wj2_function`. - * @param ctx the parse tree - */ - exitWj2_function?: (ctx: Wj2_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.ww_function`. - * @param ctx the parse tree - */ - enterWw_function?: (ctx: Ww_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.ww_function`. - * @param ctx the parse tree - */ - exitWw_function?: (ctx: Ww_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xasc_function`. - * @param ctx the parse tree - */ - enterXasc_function?: (ctx: Xasc_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xasc_function`. - * @param ctx the parse tree - */ - exitXasc_function?: (ctx: Xasc_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xbar_function`. - * @param ctx the parse tree - */ - enterXbar_function?: (ctx: Xbar_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xbar_function`. - * @param ctx the parse tree - */ - exitXbar_function?: (ctx: Xbar_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xcols_function`. - * @param ctx the parse tree - */ - enterXcols_function?: (ctx: Xcols_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xcols_function`. - * @param ctx the parse tree - */ - exitXcols_function?: (ctx: Xcols_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xdesc_function`. - * @param ctx the parse tree - */ - enterXdesc_function?: (ctx: Xdesc_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xdesc_function`. - * @param ctx the parse tree - */ - exitXdesc_function?: (ctx: Xdesc_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xexp_function`. - * @param ctx the parse tree - */ - enterXexp_function?: (ctx: Xexp_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xexp_function`. - * @param ctx the parse tree - */ - exitXexp_function?: (ctx: Xexp_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xgroup_function`. - * @param ctx the parse tree - */ - enterXgroup_function?: (ctx: Xgroup_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xgroup_function`. - * @param ctx the parse tree - */ - exitXgroup_function?: (ctx: Xgroup_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xkey_function`. - * @param ctx the parse tree - */ - enterXkey_function?: (ctx: Xkey_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xkey_function`. - * @param ctx the parse tree - */ - exitXkey_function?: (ctx: Xkey_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xlog_function`. - * @param ctx the parse tree - */ - enterXlog_function?: (ctx: Xlog_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xlog_function`. - * @param ctx the parse tree - */ - exitXlog_function?: (ctx: Xlog_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xprev_function`. - * @param ctx the parse tree - */ - enterXprev_function?: (ctx: Xprev_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xprev_function`. - * @param ctx the parse tree - */ - exitXprev_function?: (ctx: Xprev_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xrank_function`. - * @param ctx the parse tree - */ - enterXrank_function?: (ctx: Xrank_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xrank_function`. - * @param ctx the parse tree - */ - exitXrank_function?: (ctx: Xrank_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xranked_function`. - * @param ctx the parse tree - */ - enterXranked_function?: (ctx: Xranked_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xranked_function`. - * @param ctx the parse tree - */ - exitXranked_function?: (ctx: Xranked_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xrecs_function`. - * @param ctx the parse tree - */ - enterXrecs_function?: (ctx: Xrecs_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xrecs_function`. - * @param ctx the parse tree - */ - exitXrecs_function?: (ctx: Xrecs_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xrows_function`. - * @param ctx the parse tree - */ - enterXrows_function?: (ctx: Xrows_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xrows_function`. - * @param ctx the parse tree - */ - exitXrows_function?: (ctx: Xrows_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xss_function`. - * @param ctx the parse tree - */ - enterXss_function?: (ctx: Xss_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xss_function`. - * @param ctx the parse tree - */ - exitXss_function?: (ctx: Xss_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.xtype_function`. - * @param ctx the parse tree - */ - enterXtype_function?: (ctx: Xtype_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.xtype_function`. - * @param ctx the parse tree - */ - exitXtype_function?: (ctx: Xtype_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.yield_function`. - * @param ctx the parse tree - */ - enterYield_function?: (ctx: Yield_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.yield_function`. - * @param ctx the parse tree - */ - exitYield_function?: (ctx: Yield_functionContext) => void; - /** - * Enter a parse tree produced by `qParser.zip_function`. - * @param ctx the parse tree - */ - enterZip_function?: (ctx: Zip_functionContext) => void; - /** - * Exit a parse tree produced by `qParser.zip_function`. - * @param ctx the parse tree - */ - exitZip_function?: (ctx: Zip_functionContext) => void; -} diff --git a/server/src/utils/antlrGrammars/qParser.ts b/server/src/utils/antlrGrammars/qParser.ts deleted file mode 100644 index d13ced59..00000000 --- a/server/src/utils/antlrGrammars/qParser.ts +++ /dev/null @@ -1,11407 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -// Generated from grammars/q.g4 by ANTLR 4.13.0 -// noinspection ES6UnusedImports,JSUnusedGlobalSymbols,JSUnusedLocalSymbols - -import { - ATN, - ATNDeserializer, - DFA, - DecisionState, - FailedPredicateException, - NoViableAltException, - Parser, - ParserATNSimulator, - ParserRuleContext, - PredictionContextCache, - RecognitionException, - TerminalNode, - Token, - TokenStream, -} from "antlr4"; -import qListener from "./qListener"; -// for running tests with parameters, TODO: discuss strategy for typed parameters in CI -// eslint-disable-next-line no-unused-vars -type int = number; - -export default class qParser extends Parser { - public static readonly T__0 = 1; - public static readonly T__1 = 2; - public static readonly T__2 = 3; - public static readonly T__3 = 4; - public static readonly T__4 = 5; - public static readonly T__5 = 6; - public static readonly T__6 = 7; - public static readonly T__7 = 8; - public static readonly T__8 = 9; - public static readonly T__9 = 10; - public static readonly T__10 = 11; - public static readonly T__11 = 12; - public static readonly T__12 = 13; - public static readonly T__13 = 14; - public static readonly T__14 = 15; - public static readonly T__15 = 16; - public static readonly T__16 = 17; - public static readonly T__17 = 18; - public static readonly T__18 = 19; - public static readonly T__19 = 20; - public static readonly T__20 = 21; - public static readonly T__21 = 22; - public static readonly T__22 = 23; - public static readonly T__23 = 24; - public static readonly T__24 = 25; - public static readonly T__25 = 26; - public static readonly T__26 = 27; - public static readonly T__27 = 28; - public static readonly T__28 = 29; - public static readonly T__29 = 30; - public static readonly T__30 = 31; - public static readonly T__31 = 32; - public static readonly T__32 = 33; - public static readonly T__33 = 34; - public static readonly T__34 = 35; - public static readonly T__35 = 36; - public static readonly T__36 = 37; - public static readonly T__37 = 38; - public static readonly T__38 = 39; - public static readonly T__39 = 40; - public static readonly T__40 = 41; - public static readonly T__41 = 42; - public static readonly T__42 = 43; - public static readonly T__43 = 44; - public static readonly T__44 = 45; - public static readonly T__45 = 46; - public static readonly T__46 = 47; - public static readonly T__47 = 48; - public static readonly T__48 = 49; - public static readonly T__49 = 50; - public static readonly T__50 = 51; - public static readonly T__51 = 52; - public static readonly T__52 = 53; - public static readonly T__53 = 54; - public static readonly T__54 = 55; - public static readonly T__55 = 56; - public static readonly T__56 = 57; - public static readonly T__57 = 58; - public static readonly T__58 = 59; - public static readonly T__59 = 60; - public static readonly T__60 = 61; - public static readonly T__61 = 62; - public static readonly T__62 = 63; - public static readonly T__63 = 64; - public static readonly T__64 = 65; - public static readonly T__65 = 66; - public static readonly T__66 = 67; - public static readonly T__67 = 68; - public static readonly T__68 = 69; - public static readonly T__69 = 70; - public static readonly T__70 = 71; - public static readonly T__71 = 72; - public static readonly T__72 = 73; - public static readonly T__73 = 74; - public static readonly T__74 = 75; - public static readonly T__75 = 76; - public static readonly T__76 = 77; - public static readonly T__77 = 78; - public static readonly T__78 = 79; - public static readonly T__79 = 80; - public static readonly T__80 = 81; - public static readonly T__81 = 82; - public static readonly T__82 = 83; - public static readonly T__83 = 84; - public static readonly T__84 = 85; - public static readonly T__85 = 86; - public static readonly T__86 = 87; - public static readonly T__87 = 88; - public static readonly T__88 = 89; - public static readonly T__89 = 90; - public static readonly T__90 = 91; - public static readonly T__91 = 92; - public static readonly T__92 = 93; - public static readonly T__93 = 94; - public static readonly T__94 = 95; - public static readonly T__95 = 96; - public static readonly T__96 = 97; - public static readonly T__97 = 98; - public static readonly T__98 = 99; - public static readonly T__99 = 100; - public static readonly T__100 = 101; - public static readonly T__101 = 102; - public static readonly T__102 = 103; - public static readonly T__103 = 104; - public static readonly T__104 = 105; - public static readonly T__105 = 106; - public static readonly T__106 = 107; - public static readonly T__107 = 108; - public static readonly T__108 = 109; - public static readonly T__109 = 110; - public static readonly T__110 = 111; - public static readonly T__111 = 112; - public static readonly T__112 = 113; - public static readonly T__113 = 114; - public static readonly T__114 = 115; - public static readonly T__115 = 116; - public static readonly T__116 = 117; - public static readonly T__117 = 118; - public static readonly T__118 = 119; - public static readonly T__119 = 120; - public static readonly T__120 = 121; - public static readonly T__121 = 122; - public static readonly T__122 = 123; - public static readonly T__123 = 124; - public static readonly T__124 = 125; - public static readonly T__125 = 126; - public static readonly T__126 = 127; - public static readonly T__127 = 128; - public static readonly T__128 = 129; - public static readonly T__129 = 130; - public static readonly T__130 = 131; - public static readonly T__131 = 132; - public static readonly T__132 = 133; - public static readonly T__133 = 134; - public static readonly T__134 = 135; - public static readonly T__135 = 136; - public static readonly T__136 = 137; - public static readonly T__137 = 138; - public static readonly T__138 = 139; - public static readonly T__139 = 140; - public static readonly T__140 = 141; - public static readonly T__141 = 142; - public static readonly T__142 = 143; - public static readonly T__143 = 144; - public static readonly T__144 = 145; - public static readonly T__145 = 146; - public static readonly T__146 = 147; - public static readonly T__147 = 148; - public static readonly T__148 = 149; - public static readonly PLUS = 150; - public static readonly MINUS = 151; - public static readonly MULTIPLY = 152; - public static readonly DIVIDE = 153; - public static readonly EQUALS = 154; - public static readonly NOT_EQUALS = 155; - public static readonly LESS_THAN = 156; - public static readonly LESS_THAN_OR_EQUAL = 157; - public static readonly GREATER_THAN = 158; - public static readonly GREATER_THAN_OR_EQUAL = 159; - public static readonly AND = 160; - public static readonly OR = 161; - public static readonly NOT = 162; - public static readonly INT = 163; - public static readonly LONG = 164; - public static readonly FLOAT = 165; - public static readonly DOUBLE = 166; - public static readonly CHAR = 167; - public static readonly SYMBOL = 168; - public static readonly TIMESTAMP = 169; - public static readonly ID = 170; - public static readonly DIGIT = 171; - public static readonly NUMBER = 172; - public static readonly STRING = 173; - public static readonly ESC = 174; - public static readonly WS = 175; - public static readonly EOF = Token.EOF; - public static readonly RULE_variable_declaration = 0; - public static readonly RULE_storage_type = 1; - public static readonly RULE_variable_name = 2; - public static readonly RULE_expression = 3; - public static readonly RULE_or_expression = 4; - public static readonly RULE_and_expression = 5; - public static readonly RULE_comparison_expression = 6; - public static readonly RULE_additive_expression = 7; - public static readonly RULE_multiplicative_expression = 8; - public static readonly RULE_unary_expression = 9; - public static readonly RULE_primary_expression = 10; - public static readonly RULE_abs_function = 11; - public static readonly RULE_acos_function = 12; - public static readonly RULE_all_function = 13; - public static readonly RULE_and_function = 14; - public static readonly RULE_any_function = 15; - public static readonly RULE_asin_function = 16; - public static readonly RULE_atan_function = 17; - public static readonly RULE_avg_function = 18; - public static readonly RULE_ceiling_function = 19; - public static readonly RULE_cos_function = 20; - public static readonly RULE_count_function = 21; - public static readonly RULE_cross_function = 22; - public static readonly RULE_delete_function = 23; - public static readonly RULE_deltas_function = 24; - public static readonly RULE_dev_function = 25; - public static readonly RULE_distinct_function = 26; - public static readonly RULE_div_function = 27; - public static readonly RULE_drop_function = 28; - public static readonly RULE_each_function = 29; - public static readonly RULE_enlist_function = 30; - public static readonly RULE_eval_function = 31; - public static readonly RULE_except_function = 32; - public static readonly RULE_exec_function = 33; - public static readonly RULE_exp_function = 34; - public static readonly RULE_fby_function = 35; - public static readonly RULE_fill_function = 36; - public static readonly RULE_first_function = 37; - public static readonly RULE_flip_function = 38; - public static readonly RULE_floor_function = 39; - public static readonly RULE_get_function = 40; - public static readonly RULE_group_function = 41; - public static readonly RULE_gtime_function = 42; - public static readonly RULE_hclose_function = 43; - public static readonly RULE_hcount_function = 44; - public static readonly RULE_hdel_function = 45; - public static readonly RULE_hopen_function = 46; - public static readonly RULE_hsym_function = 47; - public static readonly RULE_iasc_function = 48; - public static readonly RULE_idesc_function = 49; - public static readonly RULE_ij_function = 50; - public static readonly RULE_in_function = 51; - public static readonly RULE_insert_function = 52; - public static readonly RULE_inter_function = 53; - public static readonly RULE_inv_function = 54; - public static readonly RULE_keys_function = 55; - public static readonly RULE_last_function = 56; - public static readonly RULE_like_function = 57; - public static readonly RULE_list_function = 58; - public static readonly RULE_lj_function = 59; - public static readonly RULE_load_function = 60; - public static readonly RULE_log_function = 61; - public static readonly RULE_lower_function = 62; - public static readonly RULE_lsq_function = 63; - public static readonly RULE_ltime_function = 64; - public static readonly RULE_ltrim_function = 65; - public static readonly RULE_mavg_function = 66; - public static readonly RULE_max_function = 67; - public static readonly RULE_maxs_function = 68; - public static readonly RULE_mcount_function = 69; - public static readonly RULE_md5_function = 70; - public static readonly RULE_mdev_function = 71; - public static readonly RULE_med_function = 72; - public static readonly RULE_meta_function = 73; - public static readonly RULE_min_function = 74; - public static readonly RULE_mins_function = 75; - public static readonly RULE_mmax_function = 76; - public static readonly RULE_mmin_function = 77; - public static readonly RULE_mmu_function = 78; - public static readonly RULE_mod_function = 79; - public static readonly RULE_msum_function = 80; - public static readonly RULE_neg_function = 81; - public static readonly RULE_next_function = 82; - public static readonly RULE_not_function = 83; - public static readonly RULE_null_function = 84; - public static readonly RULE_or_function = 85; - public static readonly RULE_over_function = 86; - public static readonly RULE_parse_function = 87; - public static readonly RULE_peach_function = 88; - public static readonly RULE_pj_function = 89; - public static readonly RULE_plist_function = 90; - public static readonly RULE_prd_function = 91; - public static readonly RULE_prev_function = 92; - public static readonly RULE_prior_function = 93; - public static readonly RULE_rand_function = 94; - public static readonly RULE_rank_function = 95; - public static readonly RULE_ratios_function = 96; - public static readonly RULE_raze_function = 97; - public static readonly RULE_read0_function = 98; - public static readonly RULE_read1_function = 99; - public static readonly RULE_reciprocal_function = 100; - public static readonly RULE_reverse_function = 101; - public static readonly RULE_rload_function = 102; - public static readonly RULE_rotate_function = 103; - public static readonly RULE_rsave_function = 104; - public static readonly RULE_rtrim_function = 105; - public static readonly RULE_save_function = 106; - public static readonly RULE_scan_function = 107; - public static readonly RULE_select_function = 108; - public static readonly RULE_set_function = 109; - public static readonly RULE_show_function = 110; - public static readonly RULE_signum_function = 111; - public static readonly RULE_sin_function = 112; - public static readonly RULE_sqrt_function = 113; - public static readonly RULE_ssr_function = 114; - public static readonly RULE_string_function = 115; - public static readonly RULE_sublist_function = 116; - public static readonly RULE_sum_function = 117; - public static readonly RULE_sums_function = 118; - public static readonly RULE_sv_function = 119; - public static readonly RULE_system_function = 120; - public static readonly RULE_tables_function = 121; - public static readonly RULE_tan_function = 122; - public static readonly RULE_til_function = 123; - public static readonly RULE_trim_function = 124; - public static readonly RULE_type_function = 125; - public static readonly RULE_uj_function = 126; - public static readonly RULE_ungroup_function = 127; - public static readonly RULE_union_function = 128; - public static readonly RULE_update_function = 129; - public static readonly RULE_upper_function = 130; - public static readonly RULE_upsert_function = 131; - public static readonly RULE_value_function = 132; - public static readonly RULE_var_function = 133; - public static readonly RULE_view_function = 134; - public static readonly RULE_vs_function = 135; - public static readonly RULE_wavg_function = 136; - public static readonly RULE_where_function = 137; - public static readonly RULE_within_function = 138; - public static readonly RULE_wj1_function = 139; - public static readonly RULE_wj2_function = 140; - public static readonly RULE_ww_function = 141; - public static readonly RULE_xasc_function = 142; - public static readonly RULE_xbar_function = 143; - public static readonly RULE_xcols_function = 144; - public static readonly RULE_xdesc_function = 145; - public static readonly RULE_xexp_function = 146; - public static readonly RULE_xgroup_function = 147; - public static readonly RULE_xkey_function = 148; - public static readonly RULE_xlog_function = 149; - public static readonly RULE_xprev_function = 150; - public static readonly RULE_xrank_function = 151; - public static readonly RULE_xranked_function = 152; - public static readonly RULE_xrecs_function = 153; - public static readonly RULE_xrows_function = 154; - public static readonly RULE_xss_function = 155; - public static readonly RULE_xtype_function = 156; - public static readonly RULE_yield_function = 157; - public static readonly RULE_zip_function = 158; - public static readonly literalNames: (string | null)[] = [ - null, - "';'", - "'('", - "')'", - "'abs'", - "'acos'", - "'all'", - "'any'", - "'asin'", - "'atan'", - "'avg'", - "'ceiling'", - "'cos'", - "'count'", - "'cross'", - "','", - "'delete'", - "'deltas'", - "'dev'", - "'distinct'", - "'div'", - "'drop'", - "'each'", - "'enlist'", - "'eval'", - "'except'", - "'exec'", - "'exp'", - "'fby'", - "'fill'", - "'first'", - "'flip'", - "'floor'", - "'get'", - "'group'", - "'gtime'", - "'hclose'", - "'hcount'", - "'hdel'", - "'hopen'", - "'hsym'", - "'iasc'", - "'idesc'", - "'ij'", - "'in'", - "'insert'", - "'inter'", - "'inv'", - "'keys'", - "'last'", - "'like'", - "'list'", - "'lj'", - "'load'", - "'log'", - "'lower'", - "'lsq'", - "'ltime'", - "'ltrim'", - "'mavg'", - "'max'", - "'maxs'", - "'mcount'", - "'md5'", - "'mdev'", - "'med'", - "'meta'", - "'min'", - "'mins'", - "'mmax'", - "'mmin'", - "'mmu'", - "'mod'", - "'msum'", - "'neg'", - "'next'", - "'null'", - "'over'", - "'parse'", - "'peach'", - "'pj'", - "'plist'", - "'prd'", - "'prev'", - "'prior'", - "'rand'", - "'rank'", - "'ratios'", - "'raze'", - "'read0'", - "'read1'", - "'reciprocal'", - "'reverse'", - "'rload'", - "'rotate'", - "'rsave'", - "'rtrim'", - "'save'", - "'scan'", - "'select'", - "'set'", - "'show'", - "'signum'", - "'sin'", - "'sqrt'", - "'ssr'", - "'string'", - "'sublist'", - "'sum'", - "'sums'", - "'sv'", - "'system'", - "'tables'", - "'tan'", - "'til'", - "'trim'", - "'type'", - "'uj'", - "'ungroup'", - "'union'", - "'update'", - "'upper'", - "'upsert'", - "'value'", - "'var'", - "'view'", - "'vs'", - "'wavg'", - "'where'", - "'within'", - "'wj1'", - "'wj2'", - "'ww'", - "'xasc'", - "'xbar'", - "'xcols'", - "'xdesc'", - "'xexp'", - "'xgroup'", - "'xkey'", - "'xlog'", - "'xprev'", - "'xrank'", - "'xranked'", - "'xrecs'", - "'xrows'", - "'xss'", - "'xtype'", - "'yield'", - "'zip'", - "'+'", - "'-'", - "'*'", - "'%'", - "'='", - "'<>'", - "'<'", - "'<='", - "'>'", - "'>='", - "'and'", - "'or'", - "'not'", - "'int'", - "'long'", - "'float'", - "'double'", - "'char'", - "'symbol'", - "'timestamp'", - ]; - public static readonly symbolicNames: (string | null)[] = [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - "PLUS", - "MINUS", - "MULTIPLY", - "DIVIDE", - "EQUALS", - "NOT_EQUALS", - "LESS_THAN", - "LESS_THAN_OR_EQUAL", - "GREATER_THAN", - "GREATER_THAN_OR_EQUAL", - "AND", - "OR", - "NOT", - "INT", - "LONG", - "FLOAT", - "DOUBLE", - "CHAR", - "SYMBOL", - "TIMESTAMP", - "ID", - "DIGIT", - "NUMBER", - "STRING", - "ESC", - "WS", - ]; - // tslint:disable:no-trailing-whitespace - public static readonly ruleNames: string[] = [ - "variable_declaration", - "storage_type", - "variable_name", - "expression", - "or_expression", - "and_expression", - "comparison_expression", - "additive_expression", - "multiplicative_expression", - "unary_expression", - "primary_expression", - "abs_function", - "acos_function", - "all_function", - "and_function", - "any_function", - "asin_function", - "atan_function", - "avg_function", - "ceiling_function", - "cos_function", - "count_function", - "cross_function", - "delete_function", - "deltas_function", - "dev_function", - "distinct_function", - "div_function", - "drop_function", - "each_function", - "enlist_function", - "eval_function", - "except_function", - "exec_function", - "exp_function", - "fby_function", - "fill_function", - "first_function", - "flip_function", - "floor_function", - "get_function", - "group_function", - "gtime_function", - "hclose_function", - "hcount_function", - "hdel_function", - "hopen_function", - "hsym_function", - "iasc_function", - "idesc_function", - "ij_function", - "in_function", - "insert_function", - "inter_function", - "inv_function", - "keys_function", - "last_function", - "like_function", - "list_function", - "lj_function", - "load_function", - "log_function", - "lower_function", - "lsq_function", - "ltime_function", - "ltrim_function", - "mavg_function", - "max_function", - "maxs_function", - "mcount_function", - "md5_function", - "mdev_function", - "med_function", - "meta_function", - "min_function", - "mins_function", - "mmax_function", - "mmin_function", - "mmu_function", - "mod_function", - "msum_function", - "neg_function", - "next_function", - "not_function", - "null_function", - "or_function", - "over_function", - "parse_function", - "peach_function", - "pj_function", - "plist_function", - "prd_function", - "prev_function", - "prior_function", - "rand_function", - "rank_function", - "ratios_function", - "raze_function", - "read0_function", - "read1_function", - "reciprocal_function", - "reverse_function", - "rload_function", - "rotate_function", - "rsave_function", - "rtrim_function", - "save_function", - "scan_function", - "select_function", - "set_function", - "show_function", - "signum_function", - "sin_function", - "sqrt_function", - "ssr_function", - "string_function", - "sublist_function", - "sum_function", - "sums_function", - "sv_function", - "system_function", - "tables_function", - "tan_function", - "til_function", - "trim_function", - "type_function", - "uj_function", - "ungroup_function", - "union_function", - "update_function", - "upper_function", - "upsert_function", - "value_function", - "var_function", - "view_function", - "vs_function", - "wavg_function", - "where_function", - "within_function", - "wj1_function", - "wj2_function", - "ww_function", - "xasc_function", - "xbar_function", - "xcols_function", - "xdesc_function", - "xexp_function", - "xgroup_function", - "xkey_function", - "xlog_function", - "xprev_function", - "xrank_function", - "xranked_function", - "xrecs_function", - "xrows_function", - "xss_function", - "xtype_function", - "yield_function", - "zip_function", - ]; - public get grammarFileName(): string { - return "q.g4"; - } - public get literalNames(): (string | null)[] { - return qParser.literalNames; - } - public get symbolicNames(): (string | null)[] { - return qParser.symbolicNames; - } - public get ruleNames(): string[] { - return qParser.ruleNames; - } - public get serializedATN(): number[] { - return qParser._serializedATN; - } - - protected createFailedPredicateException( - predicate?: string, - message?: string - ): FailedPredicateException { - return new FailedPredicateException(this, predicate, message); - } - - constructor(input: TokenStream) { - super(input); - this._interp = new ParserATNSimulator( - this, - qParser._ATN, - qParser.DecisionsToDFA, - new PredictionContextCache() - ); - } - // @RuleVersion(0) - public variable_declaration(): Variable_declarationContext { - let localctx: Variable_declarationContext = new Variable_declarationContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 0, qParser.RULE_variable_declaration); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 318; - this.storage_type(); - this.state = 319; - this.variable_name(); - this.state = 320; - this.match(qParser.EQUALS); - this.state = 321; - this.expression(); - this.state = 322; - this.match(qParser.T__0); - } - } catch (re) { - if (re instanceof RecognitionException) { - localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return localctx; - } - // @RuleVersion(0) - public storage_type(): Storage_typeContext { - let localctx: Storage_typeContext = new Storage_typeContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 2, qParser.RULE_storage_type); - let _la: number; - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 324; - _la = this._input.LA(1); - if ( - !(((_la - 163) & ~0x1f) === 0 && ((1 << (_la - 163)) & 127) !== 0) - ) { - this._errHandler.recoverInline(this); - } else { - this._errHandler.reportMatch(this); - this.consume(); - } - } - } 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 variable_name(): Variable_nameContext { - let localctx: Variable_nameContext = new Variable_nameContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 4, qParser.RULE_variable_name); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 326; - this.match(qParser.ID); - } - } 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 expression(): ExpressionContext { - let localctx: ExpressionContext = new ExpressionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 6, qParser.RULE_expression); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 328; - this.or_expression(); - } - } 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 or_expression(): Or_expressionContext { - let localctx: Or_expressionContext = new Or_expressionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 8, qParser.RULE_or_expression); - let _la: number; - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 330; - this.and_expression(); - this.state = 335; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === 161) { - { - { - this.state = 331; - this.match(qParser.OR); - this.state = 332; - this.and_expression(); - } - } - this.state = 337; - 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 and_expression(): And_expressionContext { - let localctx: And_expressionContext = new And_expressionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 10, qParser.RULE_and_expression); - let _la: number; - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 338; - this.comparison_expression(); - this.state = 343; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === 160) { - { - { - this.state = 339; - this.match(qParser.AND); - this.state = 340; - this.comparison_expression(); - } - } - this.state = 345; - 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 comparison_expression(): Comparison_expressionContext { - let localctx: Comparison_expressionContext = - new Comparison_expressionContext(this, this._ctx, this.state); - this.enterRule(localctx, 12, qParser.RULE_comparison_expression); - let _la: number; - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 346; - this.additive_expression(); - this.state = 351; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === 154) { - { - { - this.state = 347; - this.match(qParser.EQUALS); - this.state = 348; - this.additive_expression(); - } - } - this.state = 353; - 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 additive_expression(): Additive_expressionContext { - let localctx: Additive_expressionContext = new Additive_expressionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 14, qParser.RULE_additive_expression); - let _la: number; - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 354; - this.multiplicative_expression(); - this.state = 359; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === 150) { - { - { - this.state = 355; - this.match(qParser.PLUS); - this.state = 356; - this.multiplicative_expression(); - } - } - this.state = 361; - 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 multiplicative_expression(): Multiplicative_expressionContext { - let localctx: Multiplicative_expressionContext = - new Multiplicative_expressionContext(this, this._ctx, this.state); - this.enterRule(localctx, 16, qParser.RULE_multiplicative_expression); - let _la: number; - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 362; - this.unary_expression(); - this.state = 367; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === 152) { - { - { - this.state = 363; - this.match(qParser.MULTIPLY); - this.state = 364; - this.unary_expression(); - } - } - this.state = 369; - 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 unary_expression(): Unary_expressionContext { - let localctx: Unary_expressionContext = new Unary_expressionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 18, qParser.RULE_unary_expression); - try { - this.state = 373; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case 2: - case 170: - case 172: - case 173: - this.enterOuterAlt(localctx, 1); - { - this.state = 370; - this.primary_expression(); - } - break; - case 151: - this.enterOuterAlt(localctx, 2); - { - this.state = 371; - this.match(qParser.MINUS); - this.state = 372; - this.primary_expression(); - } - 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 primary_expression(): Primary_expressionContext { - let localctx: Primary_expressionContext = new Primary_expressionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 20, qParser.RULE_primary_expression); - try { - this.state = 382; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case 172: - this.enterOuterAlt(localctx, 1); - { - this.state = 375; - this.match(qParser.NUMBER); - } - break; - case 173: - this.enterOuterAlt(localctx, 2); - { - this.state = 376; - this.match(qParser.STRING); - } - break; - case 170: - this.enterOuterAlt(localctx, 3); - { - this.state = 377; - this.variable_name(); - } - break; - case 2: - this.enterOuterAlt(localctx, 4); - { - this.state = 378; - this.match(qParser.T__1); - this.state = 379; - this.expression(); - this.state = 380; - this.match(qParser.T__2); - } - 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 abs_function(): Abs_functionContext { - let localctx: Abs_functionContext = new Abs_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 22, qParser.RULE_abs_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 384; - this.match(qParser.T__3); - this.state = 385; - this.match(qParser.T__1); - this.state = 386; - this.expression(); - this.state = 387; - this.match(qParser.T__2); - } - } 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 acos_function(): Acos_functionContext { - let localctx: Acos_functionContext = new Acos_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 24, qParser.RULE_acos_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 389; - this.match(qParser.T__4); - this.state = 390; - this.match(qParser.T__1); - this.state = 391; - this.expression(); - this.state = 392; - this.match(qParser.T__2); - } - } 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 all_function(): All_functionContext { - let localctx: All_functionContext = new All_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 26, qParser.RULE_all_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 394; - this.match(qParser.T__5); - this.state = 395; - this.match(qParser.T__1); - this.state = 396; - this.expression(); - this.state = 397; - this.match(qParser.T__2); - } - } 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 and_function(): And_functionContext { - let localctx: And_functionContext = new And_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 28, qParser.RULE_and_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 399; - this.match(qParser.AND); - this.state = 400; - this.match(qParser.T__1); - this.state = 401; - this.expression(); - this.state = 402; - this.match(qParser.T__2); - } - } 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 any_function(): Any_functionContext { - let localctx: Any_functionContext = new Any_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 30, qParser.RULE_any_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 404; - this.match(qParser.T__6); - this.state = 405; - this.match(qParser.T__1); - this.state = 406; - this.expression(); - this.state = 407; - this.match(qParser.T__2); - } - } 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 asin_function(): Asin_functionContext { - let localctx: Asin_functionContext = new Asin_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 32, qParser.RULE_asin_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 409; - this.match(qParser.T__7); - this.state = 410; - this.match(qParser.T__1); - this.state = 411; - this.expression(); - this.state = 412; - this.match(qParser.T__2); - } - } 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 atan_function(): Atan_functionContext { - let localctx: Atan_functionContext = new Atan_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 34, qParser.RULE_atan_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 414; - this.match(qParser.T__8); - this.state = 415; - this.match(qParser.T__1); - this.state = 416; - this.expression(); - this.state = 417; - this.match(qParser.T__2); - } - } 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 avg_function(): Avg_functionContext { - let localctx: Avg_functionContext = new Avg_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 36, qParser.RULE_avg_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 419; - this.match(qParser.T__9); - this.state = 420; - this.match(qParser.T__1); - this.state = 421; - this.expression(); - this.state = 422; - this.match(qParser.T__2); - } - } 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 ceiling_function(): Ceiling_functionContext { - let localctx: Ceiling_functionContext = new Ceiling_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 38, qParser.RULE_ceiling_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 424; - this.match(qParser.T__10); - this.state = 425; - this.match(qParser.T__1); - this.state = 426; - this.expression(); - this.state = 427; - this.match(qParser.T__2); - } - } 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 cos_function(): Cos_functionContext { - let localctx: Cos_functionContext = new Cos_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 40, qParser.RULE_cos_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 429; - this.match(qParser.T__11); - this.state = 430; - this.match(qParser.T__1); - this.state = 431; - this.expression(); - this.state = 432; - this.match(qParser.T__2); - } - } 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 count_function(): Count_functionContext { - let localctx: Count_functionContext = new Count_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 42, qParser.RULE_count_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 434; - this.match(qParser.T__12); - this.state = 435; - this.match(qParser.T__1); - this.state = 436; - this.expression(); - this.state = 437; - this.match(qParser.T__2); - } - } 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 cross_function(): Cross_functionContext { - let localctx: Cross_functionContext = new Cross_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 44, qParser.RULE_cross_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 439; - this.match(qParser.T__13); - this.state = 440; - this.match(qParser.T__1); - this.state = 441; - this.expression(); - this.state = 442; - this.match(qParser.T__14); - this.state = 443; - this.expression(); - this.state = 444; - this.match(qParser.T__2); - } - } 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 delete_function(): Delete_functionContext { - let localctx: Delete_functionContext = new Delete_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 46, qParser.RULE_delete_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 446; - this.match(qParser.T__15); - this.state = 447; - this.match(qParser.T__1); - this.state = 448; - this.expression(); - this.state = 449; - this.match(qParser.T__2); - } - } 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 deltas_function(): Deltas_functionContext { - let localctx: Deltas_functionContext = new Deltas_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 48, qParser.RULE_deltas_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 451; - this.match(qParser.T__16); - this.state = 452; - this.match(qParser.T__1); - this.state = 453; - this.expression(); - this.state = 454; - this.match(qParser.T__2); - } - } 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 dev_function(): Dev_functionContext { - let localctx: Dev_functionContext = new Dev_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 50, qParser.RULE_dev_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 456; - this.match(qParser.T__17); - this.state = 457; - this.match(qParser.T__1); - this.state = 458; - this.expression(); - this.state = 459; - this.match(qParser.T__2); - } - } 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 distinct_function(): Distinct_functionContext { - let localctx: Distinct_functionContext = new Distinct_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 52, qParser.RULE_distinct_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 461; - this.match(qParser.T__18); - this.state = 462; - this.match(qParser.T__1); - this.state = 463; - this.expression(); - this.state = 464; - this.match(qParser.T__2); - } - } 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 div_function(): Div_functionContext { - let localctx: Div_functionContext = new Div_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 54, qParser.RULE_div_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 466; - this.match(qParser.T__19); - this.state = 467; - this.match(qParser.T__1); - this.state = 468; - this.expression(); - this.state = 469; - this.match(qParser.T__14); - this.state = 470; - this.expression(); - this.state = 471; - this.match(qParser.T__2); - } - } 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 drop_function(): Drop_functionContext { - let localctx: Drop_functionContext = new Drop_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 56, qParser.RULE_drop_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 473; - this.match(qParser.T__20); - this.state = 474; - this.match(qParser.T__1); - this.state = 475; - this.expression(); - this.state = 476; - this.match(qParser.T__2); - } - } 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 each_function(): Each_functionContext { - let localctx: Each_functionContext = new Each_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 58, qParser.RULE_each_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 478; - this.match(qParser.T__21); - this.state = 479; - this.match(qParser.T__1); - this.state = 480; - this.expression(); - this.state = 481; - this.match(qParser.T__2); - } - } 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 enlist_function(): Enlist_functionContext { - let localctx: Enlist_functionContext = new Enlist_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 60, qParser.RULE_enlist_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 483; - this.match(qParser.T__22); - this.state = 484; - this.match(qParser.T__1); - this.state = 485; - this.expression(); - this.state = 486; - this.match(qParser.T__2); - } - } 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 eval_function(): Eval_functionContext { - let localctx: Eval_functionContext = new Eval_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 62, qParser.RULE_eval_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 488; - this.match(qParser.T__23); - this.state = 489; - this.match(qParser.T__1); - this.state = 490; - this.expression(); - this.state = 491; - this.match(qParser.T__2); - } - } 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 except_function(): Except_functionContext { - let localctx: Except_functionContext = new Except_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 64, qParser.RULE_except_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 493; - this.match(qParser.T__24); - this.state = 494; - this.match(qParser.T__1); - this.state = 495; - this.expression(); - this.state = 496; - this.match(qParser.T__14); - this.state = 497; - this.expression(); - this.state = 498; - this.match(qParser.T__2); - } - } 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 exec_function(): Exec_functionContext { - let localctx: Exec_functionContext = new Exec_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 66, qParser.RULE_exec_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 500; - this.match(qParser.T__25); - this.state = 501; - this.match(qParser.T__1); - this.state = 502; - this.expression(); - this.state = 503; - this.match(qParser.T__14); - this.state = 504; - this.expression(); - this.state = 505; - this.match(qParser.T__2); - } - } 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 exp_function(): Exp_functionContext { - let localctx: Exp_functionContext = new Exp_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 68, qParser.RULE_exp_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 507; - this.match(qParser.T__26); - this.state = 508; - this.match(qParser.T__1); - this.state = 509; - this.expression(); - this.state = 510; - this.match(qParser.T__2); - } - } 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 fby_function(): Fby_functionContext { - let localctx: Fby_functionContext = new Fby_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 70, qParser.RULE_fby_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 512; - this.match(qParser.T__27); - this.state = 513; - this.match(qParser.T__1); - this.state = 514; - this.expression(); - this.state = 515; - this.match(qParser.T__2); - } - } 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 fill_function(): Fill_functionContext { - let localctx: Fill_functionContext = new Fill_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 72, qParser.RULE_fill_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 517; - this.match(qParser.T__28); - this.state = 518; - this.match(qParser.T__1); - this.state = 519; - this.expression(); - this.state = 520; - this.match(qParser.T__14); - this.state = 521; - this.expression(); - this.state = 522; - this.match(qParser.T__2); - } - } 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 first_function(): First_functionContext { - let localctx: First_functionContext = new First_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 74, qParser.RULE_first_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 524; - this.match(qParser.T__29); - this.state = 525; - this.match(qParser.T__1); - this.state = 526; - this.expression(); - this.state = 527; - this.match(qParser.T__2); - } - } 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 flip_function(): Flip_functionContext { - let localctx: Flip_functionContext = new Flip_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 76, qParser.RULE_flip_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 529; - this.match(qParser.T__30); - this.state = 530; - this.match(qParser.T__1); - this.state = 531; - this.expression(); - this.state = 532; - this.match(qParser.T__2); - } - } 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 floor_function(): Floor_functionContext { - let localctx: Floor_functionContext = new Floor_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 78, qParser.RULE_floor_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 534; - this.match(qParser.T__31); - this.state = 535; - this.match(qParser.T__1); - this.state = 536; - this.expression(); - this.state = 537; - this.match(qParser.T__2); - } - } 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 get_function(): Get_functionContext { - let localctx: Get_functionContext = new Get_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 80, qParser.RULE_get_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 539; - this.match(qParser.T__32); - this.state = 540; - this.match(qParser.T__1); - this.state = 541; - this.expression(); - this.state = 542; - this.match(qParser.T__2); - } - } 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 group_function(): Group_functionContext { - let localctx: Group_functionContext = new Group_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 82, qParser.RULE_group_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 544; - this.match(qParser.T__33); - this.state = 545; - this.match(qParser.T__1); - this.state = 546; - this.expression(); - this.state = 547; - this.match(qParser.T__14); - this.state = 548; - this.expression(); - this.state = 549; - this.match(qParser.T__2); - } - } 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 gtime_function(): Gtime_functionContext { - let localctx: Gtime_functionContext = new Gtime_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 84, qParser.RULE_gtime_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 551; - this.match(qParser.T__34); - this.state = 552; - this.match(qParser.T__1); - this.state = 553; - this.expression(); - this.state = 554; - this.match(qParser.T__2); - } - } 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 hclose_function(): Hclose_functionContext { - let localctx: Hclose_functionContext = new Hclose_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 86, qParser.RULE_hclose_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 556; - this.match(qParser.T__35); - this.state = 557; - this.match(qParser.T__1); - this.state = 558; - this.expression(); - this.state = 559; - this.match(qParser.T__2); - } - } 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 hcount_function(): Hcount_functionContext { - let localctx: Hcount_functionContext = new Hcount_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 88, qParser.RULE_hcount_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 561; - this.match(qParser.T__36); - this.state = 562; - this.match(qParser.T__1); - this.state = 563; - this.expression(); - this.state = 564; - this.match(qParser.T__2); - } - } 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 hdel_function(): Hdel_functionContext { - let localctx: Hdel_functionContext = new Hdel_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 90, qParser.RULE_hdel_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 566; - this.match(qParser.T__37); - this.state = 567; - this.match(qParser.T__1); - this.state = 568; - this.expression(); - this.state = 569; - this.match(qParser.T__14); - this.state = 570; - this.expression(); - this.state = 571; - this.match(qParser.T__2); - } - } 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 hopen_function(): Hopen_functionContext { - let localctx: Hopen_functionContext = new Hopen_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 92, qParser.RULE_hopen_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 573; - this.match(qParser.T__38); - this.state = 574; - this.match(qParser.T__1); - this.state = 575; - this.expression(); - this.state = 576; - this.match(qParser.T__2); - } - } 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 hsym_function(): Hsym_functionContext { - let localctx: Hsym_functionContext = new Hsym_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 94, qParser.RULE_hsym_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 578; - this.match(qParser.T__39); - this.state = 579; - this.match(qParser.T__1); - this.state = 580; - this.expression(); - this.state = 581; - this.match(qParser.T__2); - } - } 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 iasc_function(): Iasc_functionContext { - let localctx: Iasc_functionContext = new Iasc_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 96, qParser.RULE_iasc_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 583; - this.match(qParser.T__40); - this.state = 584; - this.match(qParser.T__1); - this.state = 585; - this.expression(); - this.state = 586; - this.match(qParser.T__2); - } - } 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 idesc_function(): Idesc_functionContext { - let localctx: Idesc_functionContext = new Idesc_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 98, qParser.RULE_idesc_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 588; - this.match(qParser.T__41); - this.state = 589; - this.match(qParser.T__1); - this.state = 590; - this.expression(); - this.state = 591; - this.match(qParser.T__2); - } - } 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 ij_function(): Ij_functionContext { - let localctx: Ij_functionContext = new Ij_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 100, qParser.RULE_ij_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 593; - this.match(qParser.T__42); - this.state = 594; - this.match(qParser.T__1); - this.state = 595; - this.expression(); - this.state = 596; - this.match(qParser.T__14); - this.state = 597; - this.expression(); - this.state = 598; - this.match(qParser.T__2); - } - } 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 in_function(): In_functionContext { - let localctx: In_functionContext = new In_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 102, qParser.RULE_in_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 600; - this.match(qParser.T__43); - this.state = 601; - this.match(qParser.T__1); - this.state = 602; - this.expression(); - this.state = 603; - this.match(qParser.T__14); - this.state = 604; - this.expression(); - this.state = 605; - this.match(qParser.T__2); - } - } 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 insert_function(): Insert_functionContext { - let localctx: Insert_functionContext = new Insert_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 104, qParser.RULE_insert_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 607; - this.match(qParser.T__44); - this.state = 608; - this.match(qParser.T__1); - this.state = 609; - this.expression(); - this.state = 610; - this.match(qParser.T__14); - this.state = 611; - this.expression(); - this.state = 612; - this.match(qParser.T__2); - } - } 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 inter_function(): Inter_functionContext { - let localctx: Inter_functionContext = new Inter_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 106, qParser.RULE_inter_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 614; - this.match(qParser.T__45); - this.state = 615; - this.match(qParser.T__1); - this.state = 616; - this.expression(); - this.state = 617; - this.match(qParser.T__14); - this.state = 618; - this.expression(); - this.state = 619; - this.match(qParser.T__2); - } - } 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 inv_function(): Inv_functionContext { - let localctx: Inv_functionContext = new Inv_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 108, qParser.RULE_inv_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 621; - this.match(qParser.T__46); - this.state = 622; - this.match(qParser.T__1); - this.state = 623; - this.expression(); - this.state = 624; - this.match(qParser.T__2); - } - } 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 keys_function(): Keys_functionContext { - let localctx: Keys_functionContext = new Keys_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 110, qParser.RULE_keys_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 626; - this.match(qParser.T__47); - this.state = 627; - this.match(qParser.T__1); - this.state = 628; - this.expression(); - this.state = 629; - this.match(qParser.T__2); - } - } 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 last_function(): Last_functionContext { - let localctx: Last_functionContext = new Last_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 112, qParser.RULE_last_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 631; - this.match(qParser.T__48); - this.state = 632; - this.match(qParser.T__1); - this.state = 633; - this.expression(); - this.state = 634; - this.match(qParser.T__2); - } - } 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 like_function(): Like_functionContext { - let localctx: Like_functionContext = new Like_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 114, qParser.RULE_like_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 636; - this.match(qParser.T__49); - this.state = 637; - this.match(qParser.T__1); - this.state = 638; - this.expression(); - this.state = 639; - this.match(qParser.T__14); - this.state = 640; - this.expression(); - this.state = 641; - this.match(qParser.T__2); - } - } 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 list_function(): List_functionContext { - let localctx: List_functionContext = new List_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 116, qParser.RULE_list_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 643; - this.match(qParser.T__50); - this.state = 644; - this.match(qParser.T__1); - this.state = 645; - this.expression(); - this.state = 646; - this.match(qParser.T__2); - } - } 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 lj_function(): Lj_functionContext { - let localctx: Lj_functionContext = new Lj_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 118, qParser.RULE_lj_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 648; - this.match(qParser.T__51); - this.state = 649; - this.match(qParser.T__1); - this.state = 650; - this.expression(); - this.state = 651; - this.match(qParser.T__14); - this.state = 652; - this.expression(); - this.state = 653; - this.match(qParser.T__2); - } - } 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 load_function(): Load_functionContext { - let localctx: Load_functionContext = new Load_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 120, qParser.RULE_load_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 655; - this.match(qParser.T__52); - this.state = 656; - this.match(qParser.T__1); - this.state = 657; - this.expression(); - this.state = 658; - this.match(qParser.T__2); - } - } 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 log_function(): Log_functionContext { - let localctx: Log_functionContext = new Log_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 122, qParser.RULE_log_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 660; - this.match(qParser.T__53); - this.state = 661; - this.match(qParser.T__1); - this.state = 662; - this.expression(); - this.state = 663; - this.match(qParser.T__2); - } - } 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 lower_function(): Lower_functionContext { - let localctx: Lower_functionContext = new Lower_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 124, qParser.RULE_lower_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 665; - this.match(qParser.T__54); - this.state = 666; - this.match(qParser.T__1); - this.state = 667; - this.expression(); - this.state = 668; - this.match(qParser.T__2); - } - } 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 lsq_function(): Lsq_functionContext { - let localctx: Lsq_functionContext = new Lsq_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 126, qParser.RULE_lsq_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 670; - this.match(qParser.T__55); - this.state = 671; - this.match(qParser.T__1); - this.state = 672; - this.expression(); - this.state = 673; - this.match(qParser.T__14); - this.state = 674; - this.expression(); - this.state = 675; - this.match(qParser.T__2); - } - } 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 ltime_function(): Ltime_functionContext { - let localctx: Ltime_functionContext = new Ltime_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 128, qParser.RULE_ltime_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 677; - this.match(qParser.T__56); - this.state = 678; - this.match(qParser.T__1); - this.state = 679; - this.expression(); - this.state = 680; - this.match(qParser.T__2); - } - } 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 ltrim_function(): Ltrim_functionContext { - let localctx: Ltrim_functionContext = new Ltrim_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 130, qParser.RULE_ltrim_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 682; - this.match(qParser.T__57); - this.state = 683; - this.match(qParser.T__1); - this.state = 684; - this.expression(); - this.state = 685; - this.match(qParser.T__2); - } - } 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 mavg_function(): Mavg_functionContext { - let localctx: Mavg_functionContext = new Mavg_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 132, qParser.RULE_mavg_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 687; - this.match(qParser.T__58); - this.state = 688; - this.match(qParser.T__1); - this.state = 689; - this.expression(); - this.state = 690; - this.match(qParser.T__14); - this.state = 691; - this.expression(); - this.state = 692; - this.match(qParser.T__2); - } - } 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 max_function(): Max_functionContext { - let localctx: Max_functionContext = new Max_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 134, qParser.RULE_max_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 694; - this.match(qParser.T__59); - this.state = 695; - this.match(qParser.T__1); - this.state = 696; - this.expression(); - this.state = 697; - this.match(qParser.T__2); - } - } 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 maxs_function(): Maxs_functionContext { - let localctx: Maxs_functionContext = new Maxs_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 136, qParser.RULE_maxs_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 699; - this.match(qParser.T__60); - this.state = 700; - this.match(qParser.T__1); - this.state = 701; - this.expression(); - this.state = 702; - this.match(qParser.T__2); - } - } 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 mcount_function(): Mcount_functionContext { - let localctx: Mcount_functionContext = new Mcount_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 138, qParser.RULE_mcount_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 704; - this.match(qParser.T__61); - this.state = 705; - this.match(qParser.T__1); - this.state = 706; - this.expression(); - this.state = 707; - this.match(qParser.T__2); - } - } 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 md5_function(): Md5_functionContext { - let localctx: Md5_functionContext = new Md5_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 140, qParser.RULE_md5_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 709; - this.match(qParser.T__62); - this.state = 710; - this.match(qParser.T__1); - this.state = 711; - this.expression(); - this.state = 712; - this.match(qParser.T__2); - } - } 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 mdev_function(): Mdev_functionContext { - let localctx: Mdev_functionContext = new Mdev_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 142, qParser.RULE_mdev_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 714; - this.match(qParser.T__63); - this.state = 715; - this.match(qParser.T__1); - this.state = 716; - this.expression(); - this.state = 717; - this.match(qParser.T__14); - this.state = 718; - this.expression(); - this.state = 719; - this.match(qParser.T__2); - } - } 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 med_function(): Med_functionContext { - let localctx: Med_functionContext = new Med_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 144, qParser.RULE_med_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 721; - this.match(qParser.T__64); - this.state = 722; - this.match(qParser.T__1); - this.state = 723; - this.expression(); - this.state = 724; - this.match(qParser.T__2); - } - } 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 meta_function(): Meta_functionContext { - let localctx: Meta_functionContext = new Meta_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 146, qParser.RULE_meta_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 726; - this.match(qParser.T__65); - this.state = 727; - this.match(qParser.T__1); - this.state = 728; - this.expression(); - this.state = 729; - this.match(qParser.T__2); - } - } 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 min_function(): Min_functionContext { - let localctx: Min_functionContext = new Min_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 148, qParser.RULE_min_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 731; - this.match(qParser.T__66); - this.state = 732; - this.match(qParser.T__1); - this.state = 733; - this.expression(); - this.state = 734; - this.match(qParser.T__2); - } - } 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 mins_function(): Mins_functionContext { - let localctx: Mins_functionContext = new Mins_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 150, qParser.RULE_mins_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 736; - this.match(qParser.T__67); - this.state = 737; - this.match(qParser.T__1); - this.state = 738; - this.expression(); - this.state = 739; - this.match(qParser.T__2); - } - } 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 mmax_function(): Mmax_functionContext { - let localctx: Mmax_functionContext = new Mmax_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 152, qParser.RULE_mmax_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 741; - this.match(qParser.T__68); - this.state = 742; - this.match(qParser.T__1); - this.state = 743; - this.expression(); - this.state = 744; - this.match(qParser.T__14); - this.state = 745; - this.expression(); - this.state = 746; - this.match(qParser.T__2); - } - } 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 mmin_function(): Mmin_functionContext { - let localctx: Mmin_functionContext = new Mmin_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 154, qParser.RULE_mmin_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 748; - this.match(qParser.T__69); - this.state = 749; - this.match(qParser.T__1); - this.state = 750; - this.expression(); - this.state = 751; - this.match(qParser.T__14); - this.state = 752; - this.expression(); - this.state = 753; - this.match(qParser.T__2); - } - } 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 mmu_function(): Mmu_functionContext { - let localctx: Mmu_functionContext = new Mmu_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 156, qParser.RULE_mmu_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 755; - this.match(qParser.T__70); - this.state = 756; - this.match(qParser.T__1); - this.state = 757; - this.expression(); - this.state = 758; - this.match(qParser.T__2); - } - } 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 mod_function(): Mod_functionContext { - let localctx: Mod_functionContext = new Mod_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 158, qParser.RULE_mod_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 760; - this.match(qParser.T__71); - this.state = 761; - this.match(qParser.T__1); - this.state = 762; - this.expression(); - this.state = 763; - this.match(qParser.T__14); - this.state = 764; - this.expression(); - this.state = 765; - this.match(qParser.T__2); - } - } 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 msum_function(): Msum_functionContext { - let localctx: Msum_functionContext = new Msum_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 160, qParser.RULE_msum_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 767; - this.match(qParser.T__72); - this.state = 768; - this.match(qParser.T__1); - this.state = 769; - this.expression(); - this.state = 770; - this.match(qParser.T__2); - } - } 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 neg_function(): Neg_functionContext { - let localctx: Neg_functionContext = new Neg_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 162, qParser.RULE_neg_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 772; - this.match(qParser.T__73); - this.state = 773; - this.match(qParser.T__1); - this.state = 774; - this.expression(); - this.state = 775; - this.match(qParser.T__2); - } - } 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 next_function(): Next_functionContext { - let localctx: Next_functionContext = new Next_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 164, qParser.RULE_next_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 777; - this.match(qParser.T__74); - this.state = 778; - this.match(qParser.T__1); - this.state = 779; - this.expression(); - this.state = 780; - this.match(qParser.T__2); - } - } 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 not_function(): Not_functionContext { - let localctx: Not_functionContext = new Not_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 166, qParser.RULE_not_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 782; - this.match(qParser.NOT); - this.state = 783; - this.match(qParser.T__1); - this.state = 784; - this.expression(); - this.state = 785; - this.match(qParser.T__2); - } - } 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 null_function(): Null_functionContext { - let localctx: Null_functionContext = new Null_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 168, qParser.RULE_null_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 787; - this.match(qParser.T__75); - this.state = 788; - this.match(qParser.T__1); - this.state = 789; - this.expression(); - this.state = 790; - this.match(qParser.T__2); - } - } 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 or_function(): Or_functionContext { - let localctx: Or_functionContext = new Or_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 170, qParser.RULE_or_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 792; - this.match(qParser.OR); - this.state = 793; - this.match(qParser.T__1); - this.state = 794; - this.expression(); - this.state = 795; - this.match(qParser.T__2); - } - } 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 over_function(): Over_functionContext { - let localctx: Over_functionContext = new Over_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 172, qParser.RULE_over_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 797; - this.match(qParser.T__76); - this.state = 798; - this.match(qParser.T__1); - this.state = 799; - this.expression(); - this.state = 800; - this.match(qParser.T__2); - } - } 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 parse_function(): Parse_functionContext { - let localctx: Parse_functionContext = new Parse_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 174, qParser.RULE_parse_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 802; - this.match(qParser.T__77); - this.state = 803; - this.match(qParser.T__1); - this.state = 804; - this.expression(); - this.state = 805; - this.match(qParser.T__2); - } - } 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 peach_function(): Peach_functionContext { - let localctx: Peach_functionContext = new Peach_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 176, qParser.RULE_peach_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 807; - this.match(qParser.T__78); - this.state = 808; - this.match(qParser.T__1); - this.state = 809; - this.expression(); - this.state = 810; - this.match(qParser.T__2); - } - } 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 pj_function(): Pj_functionContext { - let localctx: Pj_functionContext = new Pj_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 178, qParser.RULE_pj_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 812; - this.match(qParser.T__79); - this.state = 813; - this.match(qParser.T__1); - this.state = 814; - this.expression(); - this.state = 815; - this.match(qParser.T__14); - this.state = 816; - this.expression(); - this.state = 817; - this.match(qParser.T__2); - } - } 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 plist_function(): Plist_functionContext { - let localctx: Plist_functionContext = new Plist_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 180, qParser.RULE_plist_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 819; - this.match(qParser.T__80); - this.state = 820; - this.match(qParser.T__1); - this.state = 821; - this.expression(); - this.state = 822; - this.match(qParser.T__2); - } - } 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 prd_function(): Prd_functionContext { - let localctx: Prd_functionContext = new Prd_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 182, qParser.RULE_prd_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 824; - this.match(qParser.T__81); - this.state = 825; - this.match(qParser.T__1); - this.state = 826; - this.expression(); - this.state = 827; - this.match(qParser.T__2); - } - } 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 prev_function(): Prev_functionContext { - let localctx: Prev_functionContext = new Prev_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 184, qParser.RULE_prev_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 829; - this.match(qParser.T__82); - this.state = 830; - this.match(qParser.T__1); - this.state = 831; - this.expression(); - this.state = 832; - this.match(qParser.T__2); - } - } 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 prior_function(): Prior_functionContext { - let localctx: Prior_functionContext = new Prior_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 186, qParser.RULE_prior_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 834; - this.match(qParser.T__83); - this.state = 835; - this.match(qParser.T__1); - this.state = 836; - this.expression(); - this.state = 837; - this.match(qParser.T__2); - } - } 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 rand_function(): Rand_functionContext { - let localctx: Rand_functionContext = new Rand_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 188, qParser.RULE_rand_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 839; - this.match(qParser.T__84); - this.state = 840; - this.match(qParser.T__1); - this.state = 841; - this.expression(); - this.state = 842; - this.match(qParser.T__2); - } - } 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 rank_function(): Rank_functionContext { - let localctx: Rank_functionContext = new Rank_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 190, qParser.RULE_rank_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 844; - this.match(qParser.T__85); - this.state = 845; - this.match(qParser.T__1); - this.state = 846; - this.expression(); - this.state = 847; - this.match(qParser.T__2); - } - } 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 ratios_function(): Ratios_functionContext { - let localctx: Ratios_functionContext = new Ratios_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 192, qParser.RULE_ratios_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 849; - this.match(qParser.T__86); - this.state = 850; - this.match(qParser.T__1); - this.state = 851; - this.expression(); - this.state = 852; - this.match(qParser.T__2); - } - } 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 raze_function(): Raze_functionContext { - let localctx: Raze_functionContext = new Raze_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 194, qParser.RULE_raze_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 854; - this.match(qParser.T__87); - this.state = 855; - this.match(qParser.T__1); - this.state = 856; - this.expression(); - this.state = 857; - this.match(qParser.T__2); - } - } 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 read0_function(): Read0_functionContext { - let localctx: Read0_functionContext = new Read0_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 196, qParser.RULE_read0_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 859; - this.match(qParser.T__88); - this.state = 860; - this.match(qParser.T__1); - this.state = 861; - this.expression(); - this.state = 862; - this.match(qParser.T__2); - } - } 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 read1_function(): Read1_functionContext { - let localctx: Read1_functionContext = new Read1_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 198, qParser.RULE_read1_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 864; - this.match(qParser.T__89); - this.state = 865; - this.match(qParser.T__1); - this.state = 866; - this.expression(); - this.state = 867; - this.match(qParser.T__2); - } - } 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 reciprocal_function(): Reciprocal_functionContext { - let localctx: Reciprocal_functionContext = new Reciprocal_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 200, qParser.RULE_reciprocal_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 869; - this.match(qParser.T__90); - this.state = 870; - this.match(qParser.T__1); - this.state = 871; - this.expression(); - this.state = 872; - this.match(qParser.T__2); - } - } 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 reverse_function(): Reverse_functionContext { - let localctx: Reverse_functionContext = new Reverse_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 202, qParser.RULE_reverse_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 874; - this.match(qParser.T__91); - this.state = 875; - this.match(qParser.T__1); - this.state = 876; - this.expression(); - this.state = 877; - this.match(qParser.T__2); - } - } 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 rload_function(): Rload_functionContext { - let localctx: Rload_functionContext = new Rload_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 204, qParser.RULE_rload_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 879; - this.match(qParser.T__92); - this.state = 880; - this.match(qParser.T__1); - this.state = 881; - this.expression(); - this.state = 882; - this.match(qParser.T__2); - } - } 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 rotate_function(): Rotate_functionContext { - let localctx: Rotate_functionContext = new Rotate_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 206, qParser.RULE_rotate_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 884; - this.match(qParser.T__93); - this.state = 885; - this.match(qParser.T__1); - this.state = 886; - this.expression(); - this.state = 887; - this.match(qParser.T__14); - this.state = 888; - this.expression(); - this.state = 889; - this.match(qParser.T__2); - } - } 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 rsave_function(): Rsave_functionContext { - let localctx: Rsave_functionContext = new Rsave_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 208, qParser.RULE_rsave_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 891; - this.match(qParser.T__94); - this.state = 892; - this.match(qParser.T__1); - this.state = 893; - this.expression(); - this.state = 894; - this.match(qParser.T__14); - this.state = 895; - this.expression(); - this.state = 896; - this.match(qParser.T__2); - } - } 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 rtrim_function(): Rtrim_functionContext { - let localctx: Rtrim_functionContext = new Rtrim_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 210, qParser.RULE_rtrim_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 898; - this.match(qParser.T__95); - this.state = 899; - this.match(qParser.T__1); - this.state = 900; - this.expression(); - this.state = 901; - this.match(qParser.T__2); - } - } 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 save_function(): Save_functionContext { - let localctx: Save_functionContext = new Save_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 212, qParser.RULE_save_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 903; - this.match(qParser.T__96); - this.state = 904; - this.match(qParser.T__1); - this.state = 905; - this.expression(); - this.state = 906; - this.match(qParser.T__14); - this.state = 907; - this.expression(); - this.state = 908; - this.match(qParser.T__2); - } - } 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 scan_function(): Scan_functionContext { - let localctx: Scan_functionContext = new Scan_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 214, qParser.RULE_scan_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 910; - this.match(qParser.T__97); - this.state = 911; - this.match(qParser.T__1); - this.state = 912; - this.expression(); - this.state = 913; - this.match(qParser.T__14); - this.state = 914; - this.expression(); - this.state = 915; - this.match(qParser.T__2); - } - } 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 select_function(): Select_functionContext { - let localctx: Select_functionContext = new Select_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 216, qParser.RULE_select_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 917; - this.match(qParser.T__98); - this.state = 918; - this.match(qParser.T__1); - this.state = 919; - this.expression(); - this.state = 920; - this.match(qParser.T__2); - } - } 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 set_function(): Set_functionContext { - let localctx: Set_functionContext = new Set_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 218, qParser.RULE_set_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 922; - this.match(qParser.T__99); - this.state = 923; - this.match(qParser.T__1); - this.state = 924; - this.expression(); - this.state = 925; - this.match(qParser.T__14); - this.state = 926; - this.expression(); - this.state = 927; - this.match(qParser.T__2); - } - } 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 show_function(): Show_functionContext { - let localctx: Show_functionContext = new Show_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 220, qParser.RULE_show_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 929; - this.match(qParser.T__100); - this.state = 930; - this.match(qParser.T__1); - this.state = 931; - this.expression(); - this.state = 932; - this.match(qParser.T__2); - } - } 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 signum_function(): Signum_functionContext { - let localctx: Signum_functionContext = new Signum_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 222, qParser.RULE_signum_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 934; - this.match(qParser.T__101); - this.state = 935; - this.match(qParser.T__1); - this.state = 936; - this.expression(); - this.state = 937; - this.match(qParser.T__2); - } - } 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 sin_function(): Sin_functionContext { - let localctx: Sin_functionContext = new Sin_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 224, qParser.RULE_sin_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 939; - this.match(qParser.T__102); - this.state = 940; - this.match(qParser.T__1); - this.state = 941; - this.expression(); - this.state = 942; - this.match(qParser.T__2); - } - } 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 sqrt_function(): Sqrt_functionContext { - let localctx: Sqrt_functionContext = new Sqrt_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 226, qParser.RULE_sqrt_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 944; - this.match(qParser.T__103); - this.state = 945; - this.match(qParser.T__1); - this.state = 946; - this.expression(); - this.state = 947; - this.match(qParser.T__2); - } - } 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 ssr_function(): Ssr_functionContext { - let localctx: Ssr_functionContext = new Ssr_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 228, qParser.RULE_ssr_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 949; - this.match(qParser.T__104); - this.state = 950; - this.match(qParser.T__1); - this.state = 951; - this.expression(); - this.state = 952; - this.match(qParser.T__14); - this.state = 953; - this.expression(); - this.state = 954; - this.match(qParser.T__2); - } - } 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 string_function(): String_functionContext { - let localctx: String_functionContext = new String_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 230, qParser.RULE_string_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 956; - this.match(qParser.T__105); - this.state = 957; - this.match(qParser.T__1); - this.state = 958; - this.expression(); - this.state = 959; - this.match(qParser.T__2); - } - } 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 sublist_function(): Sublist_functionContext { - let localctx: Sublist_functionContext = new Sublist_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 232, qParser.RULE_sublist_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 961; - this.match(qParser.T__106); - this.state = 962; - this.match(qParser.T__1); - this.state = 963; - this.expression(); - this.state = 964; - this.match(qParser.T__14); - this.state = 965; - this.expression(); - this.state = 966; - this.match(qParser.T__2); - } - } 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 sum_function(): Sum_functionContext { - let localctx: Sum_functionContext = new Sum_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 234, qParser.RULE_sum_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 968; - this.match(qParser.T__107); - this.state = 969; - this.match(qParser.T__1); - this.state = 970; - this.expression(); - this.state = 971; - this.match(qParser.T__2); - } - } 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 sums_function(): Sums_functionContext { - let localctx: Sums_functionContext = new Sums_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 236, qParser.RULE_sums_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 973; - this.match(qParser.T__108); - this.state = 974; - this.match(qParser.T__1); - this.state = 975; - this.expression(); - this.state = 976; - this.match(qParser.T__2); - } - } 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 sv_function(): Sv_functionContext { - let localctx: Sv_functionContext = new Sv_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 238, qParser.RULE_sv_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 978; - this.match(qParser.T__109); - this.state = 979; - this.match(qParser.T__1); - this.state = 980; - this.expression(); - this.state = 981; - this.match(qParser.T__2); - } - } 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 system_function(): System_functionContext { - let localctx: System_functionContext = new System_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 240, qParser.RULE_system_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 983; - this.match(qParser.T__110); - this.state = 984; - this.match(qParser.T__1); - this.state = 985; - this.expression(); - this.state = 986; - this.match(qParser.T__2); - } - } 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 tables_function(): Tables_functionContext { - let localctx: Tables_functionContext = new Tables_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 242, qParser.RULE_tables_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 988; - this.match(qParser.T__111); - this.state = 989; - this.match(qParser.T__1); - this.state = 990; - this.expression(); - this.state = 991; - this.match(qParser.T__2); - } - } 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 tan_function(): Tan_functionContext { - let localctx: Tan_functionContext = new Tan_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 244, qParser.RULE_tan_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 993; - this.match(qParser.T__112); - this.state = 994; - this.match(qParser.T__1); - this.state = 995; - this.expression(); - this.state = 996; - this.match(qParser.T__2); - } - } 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 til_function(): Til_functionContext { - let localctx: Til_functionContext = new Til_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 246, qParser.RULE_til_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 998; - this.match(qParser.T__113); - this.state = 999; - this.match(qParser.T__1); - this.state = 1000; - this.expression(); - this.state = 1001; - this.match(qParser.T__2); - } - } 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 trim_function(): Trim_functionContext { - let localctx: Trim_functionContext = new Trim_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 248, qParser.RULE_trim_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1003; - this.match(qParser.T__114); - this.state = 1004; - this.match(qParser.T__1); - this.state = 1005; - this.expression(); - this.state = 1006; - this.match(qParser.T__2); - } - } 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 type_function(): Type_functionContext { - let localctx: Type_functionContext = new Type_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 250, qParser.RULE_type_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1008; - this.match(qParser.T__115); - this.state = 1009; - this.match(qParser.T__1); - this.state = 1010; - this.expression(); - this.state = 1011; - this.match(qParser.T__2); - } - } 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 uj_function(): Uj_functionContext { - let localctx: Uj_functionContext = new Uj_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 252, qParser.RULE_uj_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1013; - this.match(qParser.T__116); - this.state = 1014; - this.match(qParser.T__1); - this.state = 1015; - this.expression(); - this.state = 1016; - this.match(qParser.T__14); - this.state = 1017; - this.expression(); - this.state = 1018; - this.match(qParser.T__2); - } - } 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 ungroup_function(): Ungroup_functionContext { - let localctx: Ungroup_functionContext = new Ungroup_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 254, qParser.RULE_ungroup_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1020; - this.match(qParser.T__117); - this.state = 1021; - this.match(qParser.T__1); - this.state = 1022; - this.expression(); - this.state = 1023; - this.match(qParser.T__2); - } - } 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 union_function(): Union_functionContext { - let localctx: Union_functionContext = new Union_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 256, qParser.RULE_union_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1025; - this.match(qParser.T__118); - this.state = 1026; - this.match(qParser.T__1); - this.state = 1027; - this.expression(); - this.state = 1028; - this.match(qParser.T__14); - this.state = 1029; - this.expression(); - this.state = 1030; - this.match(qParser.T__2); - } - } 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 update_function(): Update_functionContext { - let localctx: Update_functionContext = new Update_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 258, qParser.RULE_update_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1032; - this.match(qParser.T__119); - this.state = 1033; - this.match(qParser.T__1); - this.state = 1034; - this.expression(); - this.state = 1035; - this.match(qParser.T__14); - this.state = 1036; - this.expression(); - this.state = 1037; - this.match(qParser.T__2); - } - } 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 upper_function(): Upper_functionContext { - let localctx: Upper_functionContext = new Upper_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 260, qParser.RULE_upper_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1039; - this.match(qParser.T__120); - this.state = 1040; - this.match(qParser.T__1); - this.state = 1041; - this.expression(); - this.state = 1042; - this.match(qParser.T__2); - } - } 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 upsert_function(): Upsert_functionContext { - let localctx: Upsert_functionContext = new Upsert_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 262, qParser.RULE_upsert_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1044; - this.match(qParser.T__121); - this.state = 1045; - this.match(qParser.T__1); - this.state = 1046; - this.expression(); - this.state = 1047; - this.match(qParser.T__14); - this.state = 1048; - this.expression(); - this.state = 1049; - this.match(qParser.T__2); - } - } 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_function(): Value_functionContext { - let localctx: Value_functionContext = new Value_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 264, qParser.RULE_value_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1051; - this.match(qParser.T__122); - this.state = 1052; - this.match(qParser.T__1); - this.state = 1053; - this.expression(); - this.state = 1054; - this.match(qParser.T__2); - } - } 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 var_function(): Var_functionContext { - let localctx: Var_functionContext = new Var_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 266, qParser.RULE_var_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1056; - this.match(qParser.T__123); - this.state = 1057; - this.match(qParser.T__1); - this.state = 1058; - this.expression(); - this.state = 1059; - this.match(qParser.T__2); - } - } 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 view_function(): View_functionContext { - let localctx: View_functionContext = new View_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 268, qParser.RULE_view_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1061; - this.match(qParser.T__124); - this.state = 1062; - this.match(qParser.T__1); - this.state = 1063; - this.expression(); - this.state = 1064; - this.match(qParser.T__2); - } - } 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 vs_function(): Vs_functionContext { - let localctx: Vs_functionContext = new Vs_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 270, qParser.RULE_vs_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1066; - this.match(qParser.T__125); - this.state = 1067; - this.match(qParser.T__1); - this.state = 1068; - this.expression(); - this.state = 1069; - this.match(qParser.T__2); - } - } 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 wavg_function(): Wavg_functionContext { - let localctx: Wavg_functionContext = new Wavg_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 272, qParser.RULE_wavg_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1071; - this.match(qParser.T__126); - this.state = 1072; - this.match(qParser.T__1); - this.state = 1073; - this.expression(); - this.state = 1074; - this.match(qParser.T__14); - this.state = 1075; - this.expression(); - this.state = 1076; - this.match(qParser.T__2); - } - } 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 where_function(): Where_functionContext { - let localctx: Where_functionContext = new Where_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 274, qParser.RULE_where_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1078; - this.match(qParser.T__127); - this.state = 1079; - this.match(qParser.T__1); - this.state = 1080; - this.expression(); - this.state = 1081; - this.match(qParser.T__2); - } - } 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 within_function(): Within_functionContext { - let localctx: Within_functionContext = new Within_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 276, qParser.RULE_within_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1083; - this.match(qParser.T__128); - this.state = 1084; - this.match(qParser.T__1); - this.state = 1085; - this.expression(); - this.state = 1086; - this.match(qParser.T__14); - this.state = 1087; - this.expression(); - this.state = 1088; - this.match(qParser.T__2); - } - } 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 wj1_function(): Wj1_functionContext { - let localctx: Wj1_functionContext = new Wj1_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 278, qParser.RULE_wj1_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1090; - this.match(qParser.T__129); - this.state = 1091; - this.match(qParser.T__1); - this.state = 1092; - this.expression(); - this.state = 1093; - this.match(qParser.T__14); - this.state = 1094; - this.expression(); - this.state = 1095; - this.match(qParser.T__2); - } - } 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 wj2_function(): Wj2_functionContext { - let localctx: Wj2_functionContext = new Wj2_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 280, qParser.RULE_wj2_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1097; - this.match(qParser.T__130); - this.state = 1098; - this.match(qParser.T__1); - this.state = 1099; - this.expression(); - this.state = 1100; - this.match(qParser.T__14); - this.state = 1101; - this.expression(); - this.state = 1102; - this.match(qParser.T__2); - } - } 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 ww_function(): Ww_functionContext { - let localctx: Ww_functionContext = new Ww_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 282, qParser.RULE_ww_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1104; - this.match(qParser.T__131); - this.state = 1105; - this.match(qParser.T__1); - this.state = 1106; - this.expression(); - this.state = 1107; - this.match(qParser.T__2); - } - } 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 xasc_function(): Xasc_functionContext { - let localctx: Xasc_functionContext = new Xasc_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 284, qParser.RULE_xasc_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1109; - this.match(qParser.T__132); - this.state = 1110; - this.match(qParser.T__1); - this.state = 1111; - this.expression(); - this.state = 1112; - this.match(qParser.T__2); - } - } 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 xbar_function(): Xbar_functionContext { - let localctx: Xbar_functionContext = new Xbar_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 286, qParser.RULE_xbar_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1114; - this.match(qParser.T__133); - this.state = 1115; - this.match(qParser.T__1); - this.state = 1116; - this.expression(); - this.state = 1117; - this.match(qParser.T__14); - this.state = 1118; - this.expression(); - this.state = 1119; - this.match(qParser.T__2); - } - } 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 xcols_function(): Xcols_functionContext { - let localctx: Xcols_functionContext = new Xcols_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 288, qParser.RULE_xcols_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1121; - this.match(qParser.T__134); - this.state = 1122; - this.match(qParser.T__1); - this.state = 1123; - this.expression(); - this.state = 1124; - this.match(qParser.T__2); - } - } 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 xdesc_function(): Xdesc_functionContext { - let localctx: Xdesc_functionContext = new Xdesc_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 290, qParser.RULE_xdesc_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1126; - this.match(qParser.T__135); - this.state = 1127; - this.match(qParser.T__1); - this.state = 1128; - this.expression(); - this.state = 1129; - this.match(qParser.T__2); - } - } 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 xexp_function(): Xexp_functionContext { - let localctx: Xexp_functionContext = new Xexp_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 292, qParser.RULE_xexp_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1131; - this.match(qParser.T__136); - this.state = 1132; - this.match(qParser.T__1); - this.state = 1133; - this.expression(); - this.state = 1134; - this.match(qParser.T__2); - } - } 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 xgroup_function(): Xgroup_functionContext { - let localctx: Xgroup_functionContext = new Xgroup_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 294, qParser.RULE_xgroup_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1136; - this.match(qParser.T__137); - this.state = 1137; - this.match(qParser.T__1); - this.state = 1138; - this.expression(); - this.state = 1139; - this.match(qParser.T__14); - this.state = 1140; - this.expression(); - this.state = 1141; - this.match(qParser.T__2); - } - } 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 xkey_function(): Xkey_functionContext { - let localctx: Xkey_functionContext = new Xkey_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 296, qParser.RULE_xkey_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1143; - this.match(qParser.T__138); - this.state = 1144; - this.match(qParser.T__1); - this.state = 1145; - this.expression(); - this.state = 1146; - this.match(qParser.T__14); - this.state = 1147; - this.expression(); - this.state = 1148; - this.match(qParser.T__2); - } - } 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 xlog_function(): Xlog_functionContext { - let localctx: Xlog_functionContext = new Xlog_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 298, qParser.RULE_xlog_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1150; - this.match(qParser.T__139); - this.state = 1151; - this.match(qParser.T__1); - this.state = 1152; - this.expression(); - this.state = 1153; - this.match(qParser.T__2); - } - } 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 xprev_function(): Xprev_functionContext { - let localctx: Xprev_functionContext = new Xprev_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 300, qParser.RULE_xprev_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1155; - this.match(qParser.T__140); - this.state = 1156; - this.match(qParser.T__1); - this.state = 1157; - this.expression(); - this.state = 1158; - this.match(qParser.T__2); - } - } 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 xrank_function(): Xrank_functionContext { - let localctx: Xrank_functionContext = new Xrank_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 302, qParser.RULE_xrank_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1160; - this.match(qParser.T__141); - this.state = 1161; - this.match(qParser.T__1); - this.state = 1162; - this.expression(); - this.state = 1163; - this.match(qParser.T__2); - } - } 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 xranked_function(): Xranked_functionContext { - let localctx: Xranked_functionContext = new Xranked_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 304, qParser.RULE_xranked_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1165; - this.match(qParser.T__142); - this.state = 1166; - this.match(qParser.T__1); - this.state = 1167; - this.expression(); - this.state = 1168; - this.match(qParser.T__2); - } - } 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 xrecs_function(): Xrecs_functionContext { - let localctx: Xrecs_functionContext = new Xrecs_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 306, qParser.RULE_xrecs_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1170; - this.match(qParser.T__143); - this.state = 1171; - this.match(qParser.T__1); - this.state = 1172; - this.expression(); - this.state = 1173; - this.match(qParser.T__2); - } - } 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 xrows_function(): Xrows_functionContext { - let localctx: Xrows_functionContext = new Xrows_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 308, qParser.RULE_xrows_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1175; - this.match(qParser.T__144); - this.state = 1176; - this.match(qParser.T__1); - this.state = 1177; - this.expression(); - this.state = 1178; - this.match(qParser.T__2); - } - } 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 xss_function(): Xss_functionContext { - let localctx: Xss_functionContext = new Xss_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 310, qParser.RULE_xss_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1180; - this.match(qParser.T__145); - this.state = 1181; - this.match(qParser.T__1); - this.state = 1182; - this.expression(); - this.state = 1183; - this.match(qParser.T__2); - } - } 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 xtype_function(): Xtype_functionContext { - let localctx: Xtype_functionContext = new Xtype_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 312, qParser.RULE_xtype_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1185; - this.match(qParser.T__146); - this.state = 1186; - this.match(qParser.T__1); - this.state = 1187; - this.expression(); - this.state = 1188; - this.match(qParser.T__2); - } - } 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 yield_function(): Yield_functionContext { - let localctx: Yield_functionContext = new Yield_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 314, qParser.RULE_yield_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1190; - this.match(qParser.T__147); - this.state = 1191; - this.match(qParser.T__1); - this.state = 1192; - this.expression(); - this.state = 1193; - this.match(qParser.T__2); - } - } 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 zip_function(): Zip_functionContext { - let localctx: Zip_functionContext = new Zip_functionContext( - this, - this._ctx, - this.state - ); - this.enterRule(localctx, 316, qParser.RULE_zip_function); - try { - this.enterOuterAlt(localctx, 1); - { - this.state = 1195; - this.match(qParser.T__148); - this.state = 1196; - this.match(qParser.T__1); - this.state = 1197; - this.expression(); - this.state = 1198; - this.match(qParser.T__14); - this.state = 1199; - this.expression(); - this.state = 1200; - this.match(qParser.T__2); - } - } 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 static readonly _serializedATN: number[] = [ - 4, 1, 175, 1203, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, - 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, - 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, - 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, - 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, - 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, - 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, - 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, - 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, - 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, - 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, - 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, - 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, - 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, - 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, - 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, - 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, - 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, - 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, - 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, - 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, - 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, - 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, - 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, - 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, - 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, - 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, - 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, - 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, - 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, - 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 5, 4, 334, 8, 4, - 10, 4, 12, 4, 337, 9, 4, 1, 5, 1, 5, 1, 5, 5, 5, 342, 8, 5, 10, 5, 12, 5, - 345, 9, 5, 1, 6, 1, 6, 1, 6, 5, 6, 350, 8, 6, 10, 6, 12, 6, 353, 9, 6, 1, 7, - 1, 7, 1, 7, 5, 7, 358, 8, 7, 10, 7, 12, 7, 361, 9, 7, 1, 8, 1, 8, 1, 8, 5, - 8, 366, 8, 8, 10, 8, 12, 8, 369, 9, 8, 1, 9, 1, 9, 1, 9, 3, 9, 374, 8, 9, 1, - 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 383, 8, 10, 1, 11, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, - 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, - 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, - 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, - 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, - 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, - 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, - 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, - 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, - 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, - 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, - 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, - 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, - 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, - 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, - 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, - 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, - 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, - 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, - 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, - 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, - 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, - 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, - 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, - 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, - 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, - 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, - 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, - 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, - 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, - 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, - 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, - 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, - 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, - 78, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, - 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, - 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, - 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, - 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, - 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, - 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, - 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, - 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, - 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, - 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, - 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, - 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, - 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, - 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, - 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, - 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, - 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, - 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, - 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, - 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, - 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, - 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, - 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, - 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, - 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, - 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, - 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, - 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, - 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 133, 1, - 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, - 1, 135, 1, 135, 1, 136, 1, 136, 1, 136, 1, 136, 1, 136, 1, 136, 1, 136, 1, - 137, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 138, 1, 138, - 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, - 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, - 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, - 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, 1, 144, 1, 144, - 1, 145, 1, 145, 1, 145, 1, 145, 1, 145, 1, 146, 1, 146, 1, 146, 1, 146, 1, - 146, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 148, 1, 148, - 1, 148, 1, 148, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 149, 1, 149, 1, - 149, 1, 150, 1, 150, 1, 150, 1, 150, 1, 150, 1, 151, 1, 151, 1, 151, 1, 151, - 1, 151, 1, 152, 1, 152, 1, 152, 1, 152, 1, 152, 1, 153, 1, 153, 1, 153, 1, - 153, 1, 153, 1, 154, 1, 154, 1, 154, 1, 154, 1, 154, 1, 155, 1, 155, 1, 155, - 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, - 157, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, - 1, 158, 0, 0, 159, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, - 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, - 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, - 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, - 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, - 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, - 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, - 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, - 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, - 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, - 314, 316, 0, 1, 1, 0, 163, 169, 1052, 0, 318, 1, 0, 0, 0, 2, 324, 1, 0, 0, - 0, 4, 326, 1, 0, 0, 0, 6, 328, 1, 0, 0, 0, 8, 330, 1, 0, 0, 0, 10, 338, 1, - 0, 0, 0, 12, 346, 1, 0, 0, 0, 14, 354, 1, 0, 0, 0, 16, 362, 1, 0, 0, 0, 18, - 373, 1, 0, 0, 0, 20, 382, 1, 0, 0, 0, 22, 384, 1, 0, 0, 0, 24, 389, 1, 0, 0, - 0, 26, 394, 1, 0, 0, 0, 28, 399, 1, 0, 0, 0, 30, 404, 1, 0, 0, 0, 32, 409, - 1, 0, 0, 0, 34, 414, 1, 0, 0, 0, 36, 419, 1, 0, 0, 0, 38, 424, 1, 0, 0, 0, - 40, 429, 1, 0, 0, 0, 42, 434, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 446, 1, - 0, 0, 0, 48, 451, 1, 0, 0, 0, 50, 456, 1, 0, 0, 0, 52, 461, 1, 0, 0, 0, 54, - 466, 1, 0, 0, 0, 56, 473, 1, 0, 0, 0, 58, 478, 1, 0, 0, 0, 60, 483, 1, 0, 0, - 0, 62, 488, 1, 0, 0, 0, 64, 493, 1, 0, 0, 0, 66, 500, 1, 0, 0, 0, 68, 507, - 1, 0, 0, 0, 70, 512, 1, 0, 0, 0, 72, 517, 1, 0, 0, 0, 74, 524, 1, 0, 0, 0, - 76, 529, 1, 0, 0, 0, 78, 534, 1, 0, 0, 0, 80, 539, 1, 0, 0, 0, 82, 544, 1, - 0, 0, 0, 84, 551, 1, 0, 0, 0, 86, 556, 1, 0, 0, 0, 88, 561, 1, 0, 0, 0, 90, - 566, 1, 0, 0, 0, 92, 573, 1, 0, 0, 0, 94, 578, 1, 0, 0, 0, 96, 583, 1, 0, 0, - 0, 98, 588, 1, 0, 0, 0, 100, 593, 1, 0, 0, 0, 102, 600, 1, 0, 0, 0, 104, - 607, 1, 0, 0, 0, 106, 614, 1, 0, 0, 0, 108, 621, 1, 0, 0, 0, 110, 626, 1, 0, - 0, 0, 112, 631, 1, 0, 0, 0, 114, 636, 1, 0, 0, 0, 116, 643, 1, 0, 0, 0, 118, - 648, 1, 0, 0, 0, 120, 655, 1, 0, 0, 0, 122, 660, 1, 0, 0, 0, 124, 665, 1, 0, - 0, 0, 126, 670, 1, 0, 0, 0, 128, 677, 1, 0, 0, 0, 130, 682, 1, 0, 0, 0, 132, - 687, 1, 0, 0, 0, 134, 694, 1, 0, 0, 0, 136, 699, 1, 0, 0, 0, 138, 704, 1, 0, - 0, 0, 140, 709, 1, 0, 0, 0, 142, 714, 1, 0, 0, 0, 144, 721, 1, 0, 0, 0, 146, - 726, 1, 0, 0, 0, 148, 731, 1, 0, 0, 0, 150, 736, 1, 0, 0, 0, 152, 741, 1, 0, - 0, 0, 154, 748, 1, 0, 0, 0, 156, 755, 1, 0, 0, 0, 158, 760, 1, 0, 0, 0, 160, - 767, 1, 0, 0, 0, 162, 772, 1, 0, 0, 0, 164, 777, 1, 0, 0, 0, 166, 782, 1, 0, - 0, 0, 168, 787, 1, 0, 0, 0, 170, 792, 1, 0, 0, 0, 172, 797, 1, 0, 0, 0, 174, - 802, 1, 0, 0, 0, 176, 807, 1, 0, 0, 0, 178, 812, 1, 0, 0, 0, 180, 819, 1, 0, - 0, 0, 182, 824, 1, 0, 0, 0, 184, 829, 1, 0, 0, 0, 186, 834, 1, 0, 0, 0, 188, - 839, 1, 0, 0, 0, 190, 844, 1, 0, 0, 0, 192, 849, 1, 0, 0, 0, 194, 854, 1, 0, - 0, 0, 196, 859, 1, 0, 0, 0, 198, 864, 1, 0, 0, 0, 200, 869, 1, 0, 0, 0, 202, - 874, 1, 0, 0, 0, 204, 879, 1, 0, 0, 0, 206, 884, 1, 0, 0, 0, 208, 891, 1, 0, - 0, 0, 210, 898, 1, 0, 0, 0, 212, 903, 1, 0, 0, 0, 214, 910, 1, 0, 0, 0, 216, - 917, 1, 0, 0, 0, 218, 922, 1, 0, 0, 0, 220, 929, 1, 0, 0, 0, 222, 934, 1, 0, - 0, 0, 224, 939, 1, 0, 0, 0, 226, 944, 1, 0, 0, 0, 228, 949, 1, 0, 0, 0, 230, - 956, 1, 0, 0, 0, 232, 961, 1, 0, 0, 0, 234, 968, 1, 0, 0, 0, 236, 973, 1, 0, - 0, 0, 238, 978, 1, 0, 0, 0, 240, 983, 1, 0, 0, 0, 242, 988, 1, 0, 0, 0, 244, - 993, 1, 0, 0, 0, 246, 998, 1, 0, 0, 0, 248, 1003, 1, 0, 0, 0, 250, 1008, 1, - 0, 0, 0, 252, 1013, 1, 0, 0, 0, 254, 1020, 1, 0, 0, 0, 256, 1025, 1, 0, 0, - 0, 258, 1032, 1, 0, 0, 0, 260, 1039, 1, 0, 0, 0, 262, 1044, 1, 0, 0, 0, 264, - 1051, 1, 0, 0, 0, 266, 1056, 1, 0, 0, 0, 268, 1061, 1, 0, 0, 0, 270, 1066, - 1, 0, 0, 0, 272, 1071, 1, 0, 0, 0, 274, 1078, 1, 0, 0, 0, 276, 1083, 1, 0, - 0, 0, 278, 1090, 1, 0, 0, 0, 280, 1097, 1, 0, 0, 0, 282, 1104, 1, 0, 0, 0, - 284, 1109, 1, 0, 0, 0, 286, 1114, 1, 0, 0, 0, 288, 1121, 1, 0, 0, 0, 290, - 1126, 1, 0, 0, 0, 292, 1131, 1, 0, 0, 0, 294, 1136, 1, 0, 0, 0, 296, 1143, - 1, 0, 0, 0, 298, 1150, 1, 0, 0, 0, 300, 1155, 1, 0, 0, 0, 302, 1160, 1, 0, - 0, 0, 304, 1165, 1, 0, 0, 0, 306, 1170, 1, 0, 0, 0, 308, 1175, 1, 0, 0, 0, - 310, 1180, 1, 0, 0, 0, 312, 1185, 1, 0, 0, 0, 314, 1190, 1, 0, 0, 0, 316, - 1195, 1, 0, 0, 0, 318, 319, 3, 2, 1, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, - 154, 0, 0, 321, 322, 3, 6, 3, 0, 322, 323, 5, 1, 0, 0, 323, 1, 1, 0, 0, 0, - 324, 325, 7, 0, 0, 0, 325, 3, 1, 0, 0, 0, 326, 327, 5, 170, 0, 0, 327, 5, 1, - 0, 0, 0, 328, 329, 3, 8, 4, 0, 329, 7, 1, 0, 0, 0, 330, 335, 3, 10, 5, 0, - 331, 332, 5, 161, 0, 0, 332, 334, 3, 10, 5, 0, 333, 331, 1, 0, 0, 0, 334, - 337, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 9, 1, 0, - 0, 0, 337, 335, 1, 0, 0, 0, 338, 343, 3, 12, 6, 0, 339, 340, 5, 160, 0, 0, - 340, 342, 3, 12, 6, 0, 341, 339, 1, 0, 0, 0, 342, 345, 1, 0, 0, 0, 343, 341, - 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 11, 1, 0, 0, 0, 345, 343, 1, 0, 0, 0, - 346, 351, 3, 14, 7, 0, 347, 348, 5, 154, 0, 0, 348, 350, 3, 14, 7, 0, 349, - 347, 1, 0, 0, 0, 350, 353, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, - 0, 0, 352, 13, 1, 0, 0, 0, 353, 351, 1, 0, 0, 0, 354, 359, 3, 16, 8, 0, 355, - 356, 5, 150, 0, 0, 356, 358, 3, 16, 8, 0, 357, 355, 1, 0, 0, 0, 358, 361, 1, - 0, 0, 0, 359, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 15, 1, 0, 0, 0, - 361, 359, 1, 0, 0, 0, 362, 367, 3, 18, 9, 0, 363, 364, 5, 152, 0, 0, 364, - 366, 3, 18, 9, 0, 365, 363, 1, 0, 0, 0, 366, 369, 1, 0, 0, 0, 367, 365, 1, - 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 17, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, - 370, 374, 3, 20, 10, 0, 371, 372, 5, 151, 0, 0, 372, 374, 3, 20, 10, 0, 373, - 370, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 19, 1, 0, 0, 0, 375, 383, 5, - 172, 0, 0, 376, 383, 5, 173, 0, 0, 377, 383, 3, 4, 2, 0, 378, 379, 5, 2, 0, - 0, 379, 380, 3, 6, 3, 0, 380, 381, 5, 3, 0, 0, 381, 383, 1, 0, 0, 0, 382, - 375, 1, 0, 0, 0, 382, 376, 1, 0, 0, 0, 382, 377, 1, 0, 0, 0, 382, 378, 1, 0, - 0, 0, 383, 21, 1, 0, 0, 0, 384, 385, 5, 4, 0, 0, 385, 386, 5, 2, 0, 0, 386, - 387, 3, 6, 3, 0, 387, 388, 5, 3, 0, 0, 388, 23, 1, 0, 0, 0, 389, 390, 5, 5, - 0, 0, 390, 391, 5, 2, 0, 0, 391, 392, 3, 6, 3, 0, 392, 393, 5, 3, 0, 0, 393, - 25, 1, 0, 0, 0, 394, 395, 5, 6, 0, 0, 395, 396, 5, 2, 0, 0, 396, 397, 3, 6, - 3, 0, 397, 398, 5, 3, 0, 0, 398, 27, 1, 0, 0, 0, 399, 400, 5, 160, 0, 0, - 400, 401, 5, 2, 0, 0, 401, 402, 3, 6, 3, 0, 402, 403, 5, 3, 0, 0, 403, 29, - 1, 0, 0, 0, 404, 405, 5, 7, 0, 0, 405, 406, 5, 2, 0, 0, 406, 407, 3, 6, 3, - 0, 407, 408, 5, 3, 0, 0, 408, 31, 1, 0, 0, 0, 409, 410, 5, 8, 0, 0, 410, - 411, 5, 2, 0, 0, 411, 412, 3, 6, 3, 0, 412, 413, 5, 3, 0, 0, 413, 33, 1, 0, - 0, 0, 414, 415, 5, 9, 0, 0, 415, 416, 5, 2, 0, 0, 416, 417, 3, 6, 3, 0, 417, - 418, 5, 3, 0, 0, 418, 35, 1, 0, 0, 0, 419, 420, 5, 10, 0, 0, 420, 421, 5, 2, - 0, 0, 421, 422, 3, 6, 3, 0, 422, 423, 5, 3, 0, 0, 423, 37, 1, 0, 0, 0, 424, - 425, 5, 11, 0, 0, 425, 426, 5, 2, 0, 0, 426, 427, 3, 6, 3, 0, 427, 428, 5, - 3, 0, 0, 428, 39, 1, 0, 0, 0, 429, 430, 5, 12, 0, 0, 430, 431, 5, 2, 0, 0, - 431, 432, 3, 6, 3, 0, 432, 433, 5, 3, 0, 0, 433, 41, 1, 0, 0, 0, 434, 435, - 5, 13, 0, 0, 435, 436, 5, 2, 0, 0, 436, 437, 3, 6, 3, 0, 437, 438, 5, 3, 0, - 0, 438, 43, 1, 0, 0, 0, 439, 440, 5, 14, 0, 0, 440, 441, 5, 2, 0, 0, 441, - 442, 3, 6, 3, 0, 442, 443, 5, 15, 0, 0, 443, 444, 3, 6, 3, 0, 444, 445, 5, - 3, 0, 0, 445, 45, 1, 0, 0, 0, 446, 447, 5, 16, 0, 0, 447, 448, 5, 2, 0, 0, - 448, 449, 3, 6, 3, 0, 449, 450, 5, 3, 0, 0, 450, 47, 1, 0, 0, 0, 451, 452, - 5, 17, 0, 0, 452, 453, 5, 2, 0, 0, 453, 454, 3, 6, 3, 0, 454, 455, 5, 3, 0, - 0, 455, 49, 1, 0, 0, 0, 456, 457, 5, 18, 0, 0, 457, 458, 5, 2, 0, 0, 458, - 459, 3, 6, 3, 0, 459, 460, 5, 3, 0, 0, 460, 51, 1, 0, 0, 0, 461, 462, 5, 19, - 0, 0, 462, 463, 5, 2, 0, 0, 463, 464, 3, 6, 3, 0, 464, 465, 5, 3, 0, 0, 465, - 53, 1, 0, 0, 0, 466, 467, 5, 20, 0, 0, 467, 468, 5, 2, 0, 0, 468, 469, 3, 6, - 3, 0, 469, 470, 5, 15, 0, 0, 470, 471, 3, 6, 3, 0, 471, 472, 5, 3, 0, 0, - 472, 55, 1, 0, 0, 0, 473, 474, 5, 21, 0, 0, 474, 475, 5, 2, 0, 0, 475, 476, - 3, 6, 3, 0, 476, 477, 5, 3, 0, 0, 477, 57, 1, 0, 0, 0, 478, 479, 5, 22, 0, - 0, 479, 480, 5, 2, 0, 0, 480, 481, 3, 6, 3, 0, 481, 482, 5, 3, 0, 0, 482, - 59, 1, 0, 0, 0, 483, 484, 5, 23, 0, 0, 484, 485, 5, 2, 0, 0, 485, 486, 3, 6, - 3, 0, 486, 487, 5, 3, 0, 0, 487, 61, 1, 0, 0, 0, 488, 489, 5, 24, 0, 0, 489, - 490, 5, 2, 0, 0, 490, 491, 3, 6, 3, 0, 491, 492, 5, 3, 0, 0, 492, 63, 1, 0, - 0, 0, 493, 494, 5, 25, 0, 0, 494, 495, 5, 2, 0, 0, 495, 496, 3, 6, 3, 0, - 496, 497, 5, 15, 0, 0, 497, 498, 3, 6, 3, 0, 498, 499, 5, 3, 0, 0, 499, 65, - 1, 0, 0, 0, 500, 501, 5, 26, 0, 0, 501, 502, 5, 2, 0, 0, 502, 503, 3, 6, 3, - 0, 503, 504, 5, 15, 0, 0, 504, 505, 3, 6, 3, 0, 505, 506, 5, 3, 0, 0, 506, - 67, 1, 0, 0, 0, 507, 508, 5, 27, 0, 0, 508, 509, 5, 2, 0, 0, 509, 510, 3, 6, - 3, 0, 510, 511, 5, 3, 0, 0, 511, 69, 1, 0, 0, 0, 512, 513, 5, 28, 0, 0, 513, - 514, 5, 2, 0, 0, 514, 515, 3, 6, 3, 0, 515, 516, 5, 3, 0, 0, 516, 71, 1, 0, - 0, 0, 517, 518, 5, 29, 0, 0, 518, 519, 5, 2, 0, 0, 519, 520, 3, 6, 3, 0, - 520, 521, 5, 15, 0, 0, 521, 522, 3, 6, 3, 0, 522, 523, 5, 3, 0, 0, 523, 73, - 1, 0, 0, 0, 524, 525, 5, 30, 0, 0, 525, 526, 5, 2, 0, 0, 526, 527, 3, 6, 3, - 0, 527, 528, 5, 3, 0, 0, 528, 75, 1, 0, 0, 0, 529, 530, 5, 31, 0, 0, 530, - 531, 5, 2, 0, 0, 531, 532, 3, 6, 3, 0, 532, 533, 5, 3, 0, 0, 533, 77, 1, 0, - 0, 0, 534, 535, 5, 32, 0, 0, 535, 536, 5, 2, 0, 0, 536, 537, 3, 6, 3, 0, - 537, 538, 5, 3, 0, 0, 538, 79, 1, 0, 0, 0, 539, 540, 5, 33, 0, 0, 540, 541, - 5, 2, 0, 0, 541, 542, 3, 6, 3, 0, 542, 543, 5, 3, 0, 0, 543, 81, 1, 0, 0, 0, - 544, 545, 5, 34, 0, 0, 545, 546, 5, 2, 0, 0, 546, 547, 3, 6, 3, 0, 547, 548, - 5, 15, 0, 0, 548, 549, 3, 6, 3, 0, 549, 550, 5, 3, 0, 0, 550, 83, 1, 0, 0, - 0, 551, 552, 5, 35, 0, 0, 552, 553, 5, 2, 0, 0, 553, 554, 3, 6, 3, 0, 554, - 555, 5, 3, 0, 0, 555, 85, 1, 0, 0, 0, 556, 557, 5, 36, 0, 0, 557, 558, 5, 2, - 0, 0, 558, 559, 3, 6, 3, 0, 559, 560, 5, 3, 0, 0, 560, 87, 1, 0, 0, 0, 561, - 562, 5, 37, 0, 0, 562, 563, 5, 2, 0, 0, 563, 564, 3, 6, 3, 0, 564, 565, 5, - 3, 0, 0, 565, 89, 1, 0, 0, 0, 566, 567, 5, 38, 0, 0, 567, 568, 5, 2, 0, 0, - 568, 569, 3, 6, 3, 0, 569, 570, 5, 15, 0, 0, 570, 571, 3, 6, 3, 0, 571, 572, - 5, 3, 0, 0, 572, 91, 1, 0, 0, 0, 573, 574, 5, 39, 0, 0, 574, 575, 5, 2, 0, - 0, 575, 576, 3, 6, 3, 0, 576, 577, 5, 3, 0, 0, 577, 93, 1, 0, 0, 0, 578, - 579, 5, 40, 0, 0, 579, 580, 5, 2, 0, 0, 580, 581, 3, 6, 3, 0, 581, 582, 5, - 3, 0, 0, 582, 95, 1, 0, 0, 0, 583, 584, 5, 41, 0, 0, 584, 585, 5, 2, 0, 0, - 585, 586, 3, 6, 3, 0, 586, 587, 5, 3, 0, 0, 587, 97, 1, 0, 0, 0, 588, 589, - 5, 42, 0, 0, 589, 590, 5, 2, 0, 0, 590, 591, 3, 6, 3, 0, 591, 592, 5, 3, 0, - 0, 592, 99, 1, 0, 0, 0, 593, 594, 5, 43, 0, 0, 594, 595, 5, 2, 0, 0, 595, - 596, 3, 6, 3, 0, 596, 597, 5, 15, 0, 0, 597, 598, 3, 6, 3, 0, 598, 599, 5, - 3, 0, 0, 599, 101, 1, 0, 0, 0, 600, 601, 5, 44, 0, 0, 601, 602, 5, 2, 0, 0, - 602, 603, 3, 6, 3, 0, 603, 604, 5, 15, 0, 0, 604, 605, 3, 6, 3, 0, 605, 606, - 5, 3, 0, 0, 606, 103, 1, 0, 0, 0, 607, 608, 5, 45, 0, 0, 608, 609, 5, 2, 0, - 0, 609, 610, 3, 6, 3, 0, 610, 611, 5, 15, 0, 0, 611, 612, 3, 6, 3, 0, 612, - 613, 5, 3, 0, 0, 613, 105, 1, 0, 0, 0, 614, 615, 5, 46, 0, 0, 615, 616, 5, - 2, 0, 0, 616, 617, 3, 6, 3, 0, 617, 618, 5, 15, 0, 0, 618, 619, 3, 6, 3, 0, - 619, 620, 5, 3, 0, 0, 620, 107, 1, 0, 0, 0, 621, 622, 5, 47, 0, 0, 622, 623, - 5, 2, 0, 0, 623, 624, 3, 6, 3, 0, 624, 625, 5, 3, 0, 0, 625, 109, 1, 0, 0, - 0, 626, 627, 5, 48, 0, 0, 627, 628, 5, 2, 0, 0, 628, 629, 3, 6, 3, 0, 629, - 630, 5, 3, 0, 0, 630, 111, 1, 0, 0, 0, 631, 632, 5, 49, 0, 0, 632, 633, 5, - 2, 0, 0, 633, 634, 3, 6, 3, 0, 634, 635, 5, 3, 0, 0, 635, 113, 1, 0, 0, 0, - 636, 637, 5, 50, 0, 0, 637, 638, 5, 2, 0, 0, 638, 639, 3, 6, 3, 0, 639, 640, - 5, 15, 0, 0, 640, 641, 3, 6, 3, 0, 641, 642, 5, 3, 0, 0, 642, 115, 1, 0, 0, - 0, 643, 644, 5, 51, 0, 0, 644, 645, 5, 2, 0, 0, 645, 646, 3, 6, 3, 0, 646, - 647, 5, 3, 0, 0, 647, 117, 1, 0, 0, 0, 648, 649, 5, 52, 0, 0, 649, 650, 5, - 2, 0, 0, 650, 651, 3, 6, 3, 0, 651, 652, 5, 15, 0, 0, 652, 653, 3, 6, 3, 0, - 653, 654, 5, 3, 0, 0, 654, 119, 1, 0, 0, 0, 655, 656, 5, 53, 0, 0, 656, 657, - 5, 2, 0, 0, 657, 658, 3, 6, 3, 0, 658, 659, 5, 3, 0, 0, 659, 121, 1, 0, 0, - 0, 660, 661, 5, 54, 0, 0, 661, 662, 5, 2, 0, 0, 662, 663, 3, 6, 3, 0, 663, - 664, 5, 3, 0, 0, 664, 123, 1, 0, 0, 0, 665, 666, 5, 55, 0, 0, 666, 667, 5, - 2, 0, 0, 667, 668, 3, 6, 3, 0, 668, 669, 5, 3, 0, 0, 669, 125, 1, 0, 0, 0, - 670, 671, 5, 56, 0, 0, 671, 672, 5, 2, 0, 0, 672, 673, 3, 6, 3, 0, 673, 674, - 5, 15, 0, 0, 674, 675, 3, 6, 3, 0, 675, 676, 5, 3, 0, 0, 676, 127, 1, 0, 0, - 0, 677, 678, 5, 57, 0, 0, 678, 679, 5, 2, 0, 0, 679, 680, 3, 6, 3, 0, 680, - 681, 5, 3, 0, 0, 681, 129, 1, 0, 0, 0, 682, 683, 5, 58, 0, 0, 683, 684, 5, - 2, 0, 0, 684, 685, 3, 6, 3, 0, 685, 686, 5, 3, 0, 0, 686, 131, 1, 0, 0, 0, - 687, 688, 5, 59, 0, 0, 688, 689, 5, 2, 0, 0, 689, 690, 3, 6, 3, 0, 690, 691, - 5, 15, 0, 0, 691, 692, 3, 6, 3, 0, 692, 693, 5, 3, 0, 0, 693, 133, 1, 0, 0, - 0, 694, 695, 5, 60, 0, 0, 695, 696, 5, 2, 0, 0, 696, 697, 3, 6, 3, 0, 697, - 698, 5, 3, 0, 0, 698, 135, 1, 0, 0, 0, 699, 700, 5, 61, 0, 0, 700, 701, 5, - 2, 0, 0, 701, 702, 3, 6, 3, 0, 702, 703, 5, 3, 0, 0, 703, 137, 1, 0, 0, 0, - 704, 705, 5, 62, 0, 0, 705, 706, 5, 2, 0, 0, 706, 707, 3, 6, 3, 0, 707, 708, - 5, 3, 0, 0, 708, 139, 1, 0, 0, 0, 709, 710, 5, 63, 0, 0, 710, 711, 5, 2, 0, - 0, 711, 712, 3, 6, 3, 0, 712, 713, 5, 3, 0, 0, 713, 141, 1, 0, 0, 0, 714, - 715, 5, 64, 0, 0, 715, 716, 5, 2, 0, 0, 716, 717, 3, 6, 3, 0, 717, 718, 5, - 15, 0, 0, 718, 719, 3, 6, 3, 0, 719, 720, 5, 3, 0, 0, 720, 143, 1, 0, 0, 0, - 721, 722, 5, 65, 0, 0, 722, 723, 5, 2, 0, 0, 723, 724, 3, 6, 3, 0, 724, 725, - 5, 3, 0, 0, 725, 145, 1, 0, 0, 0, 726, 727, 5, 66, 0, 0, 727, 728, 5, 2, 0, - 0, 728, 729, 3, 6, 3, 0, 729, 730, 5, 3, 0, 0, 730, 147, 1, 0, 0, 0, 731, - 732, 5, 67, 0, 0, 732, 733, 5, 2, 0, 0, 733, 734, 3, 6, 3, 0, 734, 735, 5, - 3, 0, 0, 735, 149, 1, 0, 0, 0, 736, 737, 5, 68, 0, 0, 737, 738, 5, 2, 0, 0, - 738, 739, 3, 6, 3, 0, 739, 740, 5, 3, 0, 0, 740, 151, 1, 0, 0, 0, 741, 742, - 5, 69, 0, 0, 742, 743, 5, 2, 0, 0, 743, 744, 3, 6, 3, 0, 744, 745, 5, 15, 0, - 0, 745, 746, 3, 6, 3, 0, 746, 747, 5, 3, 0, 0, 747, 153, 1, 0, 0, 0, 748, - 749, 5, 70, 0, 0, 749, 750, 5, 2, 0, 0, 750, 751, 3, 6, 3, 0, 751, 752, 5, - 15, 0, 0, 752, 753, 3, 6, 3, 0, 753, 754, 5, 3, 0, 0, 754, 155, 1, 0, 0, 0, - 755, 756, 5, 71, 0, 0, 756, 757, 5, 2, 0, 0, 757, 758, 3, 6, 3, 0, 758, 759, - 5, 3, 0, 0, 759, 157, 1, 0, 0, 0, 760, 761, 5, 72, 0, 0, 761, 762, 5, 2, 0, - 0, 762, 763, 3, 6, 3, 0, 763, 764, 5, 15, 0, 0, 764, 765, 3, 6, 3, 0, 765, - 766, 5, 3, 0, 0, 766, 159, 1, 0, 0, 0, 767, 768, 5, 73, 0, 0, 768, 769, 5, - 2, 0, 0, 769, 770, 3, 6, 3, 0, 770, 771, 5, 3, 0, 0, 771, 161, 1, 0, 0, 0, - 772, 773, 5, 74, 0, 0, 773, 774, 5, 2, 0, 0, 774, 775, 3, 6, 3, 0, 775, 776, - 5, 3, 0, 0, 776, 163, 1, 0, 0, 0, 777, 778, 5, 75, 0, 0, 778, 779, 5, 2, 0, - 0, 779, 780, 3, 6, 3, 0, 780, 781, 5, 3, 0, 0, 781, 165, 1, 0, 0, 0, 782, - 783, 5, 162, 0, 0, 783, 784, 5, 2, 0, 0, 784, 785, 3, 6, 3, 0, 785, 786, 5, - 3, 0, 0, 786, 167, 1, 0, 0, 0, 787, 788, 5, 76, 0, 0, 788, 789, 5, 2, 0, 0, - 789, 790, 3, 6, 3, 0, 790, 791, 5, 3, 0, 0, 791, 169, 1, 0, 0, 0, 792, 793, - 5, 161, 0, 0, 793, 794, 5, 2, 0, 0, 794, 795, 3, 6, 3, 0, 795, 796, 5, 3, 0, - 0, 796, 171, 1, 0, 0, 0, 797, 798, 5, 77, 0, 0, 798, 799, 5, 2, 0, 0, 799, - 800, 3, 6, 3, 0, 800, 801, 5, 3, 0, 0, 801, 173, 1, 0, 0, 0, 802, 803, 5, - 78, 0, 0, 803, 804, 5, 2, 0, 0, 804, 805, 3, 6, 3, 0, 805, 806, 5, 3, 0, 0, - 806, 175, 1, 0, 0, 0, 807, 808, 5, 79, 0, 0, 808, 809, 5, 2, 0, 0, 809, 810, - 3, 6, 3, 0, 810, 811, 5, 3, 0, 0, 811, 177, 1, 0, 0, 0, 812, 813, 5, 80, 0, - 0, 813, 814, 5, 2, 0, 0, 814, 815, 3, 6, 3, 0, 815, 816, 5, 15, 0, 0, 816, - 817, 3, 6, 3, 0, 817, 818, 5, 3, 0, 0, 818, 179, 1, 0, 0, 0, 819, 820, 5, - 81, 0, 0, 820, 821, 5, 2, 0, 0, 821, 822, 3, 6, 3, 0, 822, 823, 5, 3, 0, 0, - 823, 181, 1, 0, 0, 0, 824, 825, 5, 82, 0, 0, 825, 826, 5, 2, 0, 0, 826, 827, - 3, 6, 3, 0, 827, 828, 5, 3, 0, 0, 828, 183, 1, 0, 0, 0, 829, 830, 5, 83, 0, - 0, 830, 831, 5, 2, 0, 0, 831, 832, 3, 6, 3, 0, 832, 833, 5, 3, 0, 0, 833, - 185, 1, 0, 0, 0, 834, 835, 5, 84, 0, 0, 835, 836, 5, 2, 0, 0, 836, 837, 3, - 6, 3, 0, 837, 838, 5, 3, 0, 0, 838, 187, 1, 0, 0, 0, 839, 840, 5, 85, 0, 0, - 840, 841, 5, 2, 0, 0, 841, 842, 3, 6, 3, 0, 842, 843, 5, 3, 0, 0, 843, 189, - 1, 0, 0, 0, 844, 845, 5, 86, 0, 0, 845, 846, 5, 2, 0, 0, 846, 847, 3, 6, 3, - 0, 847, 848, 5, 3, 0, 0, 848, 191, 1, 0, 0, 0, 849, 850, 5, 87, 0, 0, 850, - 851, 5, 2, 0, 0, 851, 852, 3, 6, 3, 0, 852, 853, 5, 3, 0, 0, 853, 193, 1, 0, - 0, 0, 854, 855, 5, 88, 0, 0, 855, 856, 5, 2, 0, 0, 856, 857, 3, 6, 3, 0, - 857, 858, 5, 3, 0, 0, 858, 195, 1, 0, 0, 0, 859, 860, 5, 89, 0, 0, 860, 861, - 5, 2, 0, 0, 861, 862, 3, 6, 3, 0, 862, 863, 5, 3, 0, 0, 863, 197, 1, 0, 0, - 0, 864, 865, 5, 90, 0, 0, 865, 866, 5, 2, 0, 0, 866, 867, 3, 6, 3, 0, 867, - 868, 5, 3, 0, 0, 868, 199, 1, 0, 0, 0, 869, 870, 5, 91, 0, 0, 870, 871, 5, - 2, 0, 0, 871, 872, 3, 6, 3, 0, 872, 873, 5, 3, 0, 0, 873, 201, 1, 0, 0, 0, - 874, 875, 5, 92, 0, 0, 875, 876, 5, 2, 0, 0, 876, 877, 3, 6, 3, 0, 877, 878, - 5, 3, 0, 0, 878, 203, 1, 0, 0, 0, 879, 880, 5, 93, 0, 0, 880, 881, 5, 2, 0, - 0, 881, 882, 3, 6, 3, 0, 882, 883, 5, 3, 0, 0, 883, 205, 1, 0, 0, 0, 884, - 885, 5, 94, 0, 0, 885, 886, 5, 2, 0, 0, 886, 887, 3, 6, 3, 0, 887, 888, 5, - 15, 0, 0, 888, 889, 3, 6, 3, 0, 889, 890, 5, 3, 0, 0, 890, 207, 1, 0, 0, 0, - 891, 892, 5, 95, 0, 0, 892, 893, 5, 2, 0, 0, 893, 894, 3, 6, 3, 0, 894, 895, - 5, 15, 0, 0, 895, 896, 3, 6, 3, 0, 896, 897, 5, 3, 0, 0, 897, 209, 1, 0, 0, - 0, 898, 899, 5, 96, 0, 0, 899, 900, 5, 2, 0, 0, 900, 901, 3, 6, 3, 0, 901, - 902, 5, 3, 0, 0, 902, 211, 1, 0, 0, 0, 903, 904, 5, 97, 0, 0, 904, 905, 5, - 2, 0, 0, 905, 906, 3, 6, 3, 0, 906, 907, 5, 15, 0, 0, 907, 908, 3, 6, 3, 0, - 908, 909, 5, 3, 0, 0, 909, 213, 1, 0, 0, 0, 910, 911, 5, 98, 0, 0, 911, 912, - 5, 2, 0, 0, 912, 913, 3, 6, 3, 0, 913, 914, 5, 15, 0, 0, 914, 915, 3, 6, 3, - 0, 915, 916, 5, 3, 0, 0, 916, 215, 1, 0, 0, 0, 917, 918, 5, 99, 0, 0, 918, - 919, 5, 2, 0, 0, 919, 920, 3, 6, 3, 0, 920, 921, 5, 3, 0, 0, 921, 217, 1, 0, - 0, 0, 922, 923, 5, 100, 0, 0, 923, 924, 5, 2, 0, 0, 924, 925, 3, 6, 3, 0, - 925, 926, 5, 15, 0, 0, 926, 927, 3, 6, 3, 0, 927, 928, 5, 3, 0, 0, 928, 219, - 1, 0, 0, 0, 929, 930, 5, 101, 0, 0, 930, 931, 5, 2, 0, 0, 931, 932, 3, 6, 3, - 0, 932, 933, 5, 3, 0, 0, 933, 221, 1, 0, 0, 0, 934, 935, 5, 102, 0, 0, 935, - 936, 5, 2, 0, 0, 936, 937, 3, 6, 3, 0, 937, 938, 5, 3, 0, 0, 938, 223, 1, 0, - 0, 0, 939, 940, 5, 103, 0, 0, 940, 941, 5, 2, 0, 0, 941, 942, 3, 6, 3, 0, - 942, 943, 5, 3, 0, 0, 943, 225, 1, 0, 0, 0, 944, 945, 5, 104, 0, 0, 945, - 946, 5, 2, 0, 0, 946, 947, 3, 6, 3, 0, 947, 948, 5, 3, 0, 0, 948, 227, 1, 0, - 0, 0, 949, 950, 5, 105, 0, 0, 950, 951, 5, 2, 0, 0, 951, 952, 3, 6, 3, 0, - 952, 953, 5, 15, 0, 0, 953, 954, 3, 6, 3, 0, 954, 955, 5, 3, 0, 0, 955, 229, - 1, 0, 0, 0, 956, 957, 5, 106, 0, 0, 957, 958, 5, 2, 0, 0, 958, 959, 3, 6, 3, - 0, 959, 960, 5, 3, 0, 0, 960, 231, 1, 0, 0, 0, 961, 962, 5, 107, 0, 0, 962, - 963, 5, 2, 0, 0, 963, 964, 3, 6, 3, 0, 964, 965, 5, 15, 0, 0, 965, 966, 3, - 6, 3, 0, 966, 967, 5, 3, 0, 0, 967, 233, 1, 0, 0, 0, 968, 969, 5, 108, 0, 0, - 969, 970, 5, 2, 0, 0, 970, 971, 3, 6, 3, 0, 971, 972, 5, 3, 0, 0, 972, 235, - 1, 0, 0, 0, 973, 974, 5, 109, 0, 0, 974, 975, 5, 2, 0, 0, 975, 976, 3, 6, 3, - 0, 976, 977, 5, 3, 0, 0, 977, 237, 1, 0, 0, 0, 978, 979, 5, 110, 0, 0, 979, - 980, 5, 2, 0, 0, 980, 981, 3, 6, 3, 0, 981, 982, 5, 3, 0, 0, 982, 239, 1, 0, - 0, 0, 983, 984, 5, 111, 0, 0, 984, 985, 5, 2, 0, 0, 985, 986, 3, 6, 3, 0, - 986, 987, 5, 3, 0, 0, 987, 241, 1, 0, 0, 0, 988, 989, 5, 112, 0, 0, 989, - 990, 5, 2, 0, 0, 990, 991, 3, 6, 3, 0, 991, 992, 5, 3, 0, 0, 992, 243, 1, 0, - 0, 0, 993, 994, 5, 113, 0, 0, 994, 995, 5, 2, 0, 0, 995, 996, 3, 6, 3, 0, - 996, 997, 5, 3, 0, 0, 997, 245, 1, 0, 0, 0, 998, 999, 5, 114, 0, 0, 999, - 1000, 5, 2, 0, 0, 1000, 1001, 3, 6, 3, 0, 1001, 1002, 5, 3, 0, 0, 1002, 247, - 1, 0, 0, 0, 1003, 1004, 5, 115, 0, 0, 1004, 1005, 5, 2, 0, 0, 1005, 1006, 3, - 6, 3, 0, 1006, 1007, 5, 3, 0, 0, 1007, 249, 1, 0, 0, 0, 1008, 1009, 5, 116, - 0, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 6, 3, 0, 1011, 1012, 5, 3, 0, - 0, 1012, 251, 1, 0, 0, 0, 1013, 1014, 5, 117, 0, 0, 1014, 1015, 5, 2, 0, 0, - 1015, 1016, 3, 6, 3, 0, 1016, 1017, 5, 15, 0, 0, 1017, 1018, 3, 6, 3, 0, - 1018, 1019, 5, 3, 0, 0, 1019, 253, 1, 0, 0, 0, 1020, 1021, 5, 118, 0, 0, - 1021, 1022, 5, 2, 0, 0, 1022, 1023, 3, 6, 3, 0, 1023, 1024, 5, 3, 0, 0, - 1024, 255, 1, 0, 0, 0, 1025, 1026, 5, 119, 0, 0, 1026, 1027, 5, 2, 0, 0, - 1027, 1028, 3, 6, 3, 0, 1028, 1029, 5, 15, 0, 0, 1029, 1030, 3, 6, 3, 0, - 1030, 1031, 5, 3, 0, 0, 1031, 257, 1, 0, 0, 0, 1032, 1033, 5, 120, 0, 0, - 1033, 1034, 5, 2, 0, 0, 1034, 1035, 3, 6, 3, 0, 1035, 1036, 5, 15, 0, 0, - 1036, 1037, 3, 6, 3, 0, 1037, 1038, 5, 3, 0, 0, 1038, 259, 1, 0, 0, 0, 1039, - 1040, 5, 121, 0, 0, 1040, 1041, 5, 2, 0, 0, 1041, 1042, 3, 6, 3, 0, 1042, - 1043, 5, 3, 0, 0, 1043, 261, 1, 0, 0, 0, 1044, 1045, 5, 122, 0, 0, 1045, - 1046, 5, 2, 0, 0, 1046, 1047, 3, 6, 3, 0, 1047, 1048, 5, 15, 0, 0, 1048, - 1049, 3, 6, 3, 0, 1049, 1050, 5, 3, 0, 0, 1050, 263, 1, 0, 0, 0, 1051, 1052, - 5, 123, 0, 0, 1052, 1053, 5, 2, 0, 0, 1053, 1054, 3, 6, 3, 0, 1054, 1055, 5, - 3, 0, 0, 1055, 265, 1, 0, 0, 0, 1056, 1057, 5, 124, 0, 0, 1057, 1058, 5, 2, - 0, 0, 1058, 1059, 3, 6, 3, 0, 1059, 1060, 5, 3, 0, 0, 1060, 267, 1, 0, 0, 0, - 1061, 1062, 5, 125, 0, 0, 1062, 1063, 5, 2, 0, 0, 1063, 1064, 3, 6, 3, 0, - 1064, 1065, 5, 3, 0, 0, 1065, 269, 1, 0, 0, 0, 1066, 1067, 5, 126, 0, 0, - 1067, 1068, 5, 2, 0, 0, 1068, 1069, 3, 6, 3, 0, 1069, 1070, 5, 3, 0, 0, - 1070, 271, 1, 0, 0, 0, 1071, 1072, 5, 127, 0, 0, 1072, 1073, 5, 2, 0, 0, - 1073, 1074, 3, 6, 3, 0, 1074, 1075, 5, 15, 0, 0, 1075, 1076, 3, 6, 3, 0, - 1076, 1077, 5, 3, 0, 0, 1077, 273, 1, 0, 0, 0, 1078, 1079, 5, 128, 0, 0, - 1079, 1080, 5, 2, 0, 0, 1080, 1081, 3, 6, 3, 0, 1081, 1082, 5, 3, 0, 0, - 1082, 275, 1, 0, 0, 0, 1083, 1084, 5, 129, 0, 0, 1084, 1085, 5, 2, 0, 0, - 1085, 1086, 3, 6, 3, 0, 1086, 1087, 5, 15, 0, 0, 1087, 1088, 3, 6, 3, 0, - 1088, 1089, 5, 3, 0, 0, 1089, 277, 1, 0, 0, 0, 1090, 1091, 5, 130, 0, 0, - 1091, 1092, 5, 2, 0, 0, 1092, 1093, 3, 6, 3, 0, 1093, 1094, 5, 15, 0, 0, - 1094, 1095, 3, 6, 3, 0, 1095, 1096, 5, 3, 0, 0, 1096, 279, 1, 0, 0, 0, 1097, - 1098, 5, 131, 0, 0, 1098, 1099, 5, 2, 0, 0, 1099, 1100, 3, 6, 3, 0, 1100, - 1101, 5, 15, 0, 0, 1101, 1102, 3, 6, 3, 0, 1102, 1103, 5, 3, 0, 0, 1103, - 281, 1, 0, 0, 0, 1104, 1105, 5, 132, 0, 0, 1105, 1106, 5, 2, 0, 0, 1106, - 1107, 3, 6, 3, 0, 1107, 1108, 5, 3, 0, 0, 1108, 283, 1, 0, 0, 0, 1109, 1110, - 5, 133, 0, 0, 1110, 1111, 5, 2, 0, 0, 1111, 1112, 3, 6, 3, 0, 1112, 1113, 5, - 3, 0, 0, 1113, 285, 1, 0, 0, 0, 1114, 1115, 5, 134, 0, 0, 1115, 1116, 5, 2, - 0, 0, 1116, 1117, 3, 6, 3, 0, 1117, 1118, 5, 15, 0, 0, 1118, 1119, 3, 6, 3, - 0, 1119, 1120, 5, 3, 0, 0, 1120, 287, 1, 0, 0, 0, 1121, 1122, 5, 135, 0, 0, - 1122, 1123, 5, 2, 0, 0, 1123, 1124, 3, 6, 3, 0, 1124, 1125, 5, 3, 0, 0, - 1125, 289, 1, 0, 0, 0, 1126, 1127, 5, 136, 0, 0, 1127, 1128, 5, 2, 0, 0, - 1128, 1129, 3, 6, 3, 0, 1129, 1130, 5, 3, 0, 0, 1130, 291, 1, 0, 0, 0, 1131, - 1132, 5, 137, 0, 0, 1132, 1133, 5, 2, 0, 0, 1133, 1134, 3, 6, 3, 0, 1134, - 1135, 5, 3, 0, 0, 1135, 293, 1, 0, 0, 0, 1136, 1137, 5, 138, 0, 0, 1137, - 1138, 5, 2, 0, 0, 1138, 1139, 3, 6, 3, 0, 1139, 1140, 5, 15, 0, 0, 1140, - 1141, 3, 6, 3, 0, 1141, 1142, 5, 3, 0, 0, 1142, 295, 1, 0, 0, 0, 1143, 1144, - 5, 139, 0, 0, 1144, 1145, 5, 2, 0, 0, 1145, 1146, 3, 6, 3, 0, 1146, 1147, 5, - 15, 0, 0, 1147, 1148, 3, 6, 3, 0, 1148, 1149, 5, 3, 0, 0, 1149, 297, 1, 0, - 0, 0, 1150, 1151, 5, 140, 0, 0, 1151, 1152, 5, 2, 0, 0, 1152, 1153, 3, 6, 3, - 0, 1153, 1154, 5, 3, 0, 0, 1154, 299, 1, 0, 0, 0, 1155, 1156, 5, 141, 0, 0, - 1156, 1157, 5, 2, 0, 0, 1157, 1158, 3, 6, 3, 0, 1158, 1159, 5, 3, 0, 0, - 1159, 301, 1, 0, 0, 0, 1160, 1161, 5, 142, 0, 0, 1161, 1162, 5, 2, 0, 0, - 1162, 1163, 3, 6, 3, 0, 1163, 1164, 5, 3, 0, 0, 1164, 303, 1, 0, 0, 0, 1165, - 1166, 5, 143, 0, 0, 1166, 1167, 5, 2, 0, 0, 1167, 1168, 3, 6, 3, 0, 1168, - 1169, 5, 3, 0, 0, 1169, 305, 1, 0, 0, 0, 1170, 1171, 5, 144, 0, 0, 1171, - 1172, 5, 2, 0, 0, 1172, 1173, 3, 6, 3, 0, 1173, 1174, 5, 3, 0, 0, 1174, 307, - 1, 0, 0, 0, 1175, 1176, 5, 145, 0, 0, 1176, 1177, 5, 2, 0, 0, 1177, 1178, 3, - 6, 3, 0, 1178, 1179, 5, 3, 0, 0, 1179, 309, 1, 0, 0, 0, 1180, 1181, 5, 146, - 0, 0, 1181, 1182, 5, 2, 0, 0, 1182, 1183, 3, 6, 3, 0, 1183, 1184, 5, 3, 0, - 0, 1184, 311, 1, 0, 0, 0, 1185, 1186, 5, 147, 0, 0, 1186, 1187, 5, 2, 0, 0, - 1187, 1188, 3, 6, 3, 0, 1188, 1189, 5, 3, 0, 0, 1189, 313, 1, 0, 0, 0, 1190, - 1191, 5, 148, 0, 0, 1191, 1192, 5, 2, 0, 0, 1192, 1193, 3, 6, 3, 0, 1193, - 1194, 5, 3, 0, 0, 1194, 315, 1, 0, 0, 0, 1195, 1196, 5, 149, 0, 0, 1196, - 1197, 5, 2, 0, 0, 1197, 1198, 3, 6, 3, 0, 1198, 1199, 5, 15, 0, 0, 1199, - 1200, 3, 6, 3, 0, 1200, 1201, 5, 3, 0, 0, 1201, 317, 1, 0, 0, 0, 7, 335, - 343, 351, 359, 367, 373, 382, - ]; - - private static __ATN: ATN; - public static get _ATN(): ATN { - if (!qParser.__ATN) { - qParser.__ATN = new ATNDeserializer().deserialize(qParser._serializedATN); - } - - return qParser.__ATN; - } - - static DecisionsToDFA = qParser._ATN.decisionToState.map( - (ds: DecisionState, index: number) => new DFA(ds, index) - ); -} - -export class Variable_declarationContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public storage_type(): Storage_typeContext { - return this.getTypedRuleContext( - Storage_typeContext, - 0 - ) as Storage_typeContext; - } - public variable_name(): Variable_nameContext { - return this.getTypedRuleContext( - Variable_nameContext, - 0 - ) as Variable_nameContext; - } - public EQUALS(): TerminalNode { - return this.getToken(qParser.EQUALS, 0); - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_variable_declaration; - } - public enterRule(listener: qListener): void { - if (listener.enterVariable_declaration) { - listener.enterVariable_declaration(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitVariable_declaration) { - listener.exitVariable_declaration(this); - } - } -} - -export class Storage_typeContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public INT(): TerminalNode { - return this.getToken(qParser.INT, 0); - } - public LONG(): TerminalNode { - return this.getToken(qParser.LONG, 0); - } - public FLOAT(): TerminalNode { - return this.getToken(qParser.FLOAT, 0); - } - public DOUBLE(): TerminalNode { - return this.getToken(qParser.DOUBLE, 0); - } - public CHAR(): TerminalNode { - return this.getToken(qParser.CHAR, 0); - } - public SYMBOL(): TerminalNode { - return this.getToken(qParser.SYMBOL, 0); - } - public TIMESTAMP(): TerminalNode { - return this.getToken(qParser.TIMESTAMP, 0); - } - public get ruleIndex(): number { - return qParser.RULE_storage_type; - } - public enterRule(listener: qListener): void { - if (listener.enterStorage_type) { - listener.enterStorage_type(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitStorage_type) { - listener.exitStorage_type(this); - } - } -} - -export class Variable_nameContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public ID(): TerminalNode { - return this.getToken(qParser.ID, 0); - } - public get ruleIndex(): number { - return qParser.RULE_variable_name; - } - public enterRule(listener: qListener): void { - if (listener.enterVariable_name) { - listener.enterVariable_name(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitVariable_name) { - listener.exitVariable_name(this); - } - } -} - -export class ExpressionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public or_expression(): Or_expressionContext { - return this.getTypedRuleContext( - Or_expressionContext, - 0 - ) as Or_expressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_expression; - } - public enterRule(listener: qListener): void { - if (listener.enterExpression) { - listener.enterExpression(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitExpression) { - listener.exitExpression(this); - } - } -} - -export class Or_expressionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public and_expression_list(): And_expressionContext[] { - return this.getTypedRuleContexts( - And_expressionContext - ) as And_expressionContext[]; - } - public and_expression(i: number): And_expressionContext { - return this.getTypedRuleContext( - And_expressionContext, - i - ) as And_expressionContext; - } - public OR_list(): TerminalNode[] { - return this.getTokens(qParser.OR); - } - public OR(i: number): TerminalNode { - return this.getToken(qParser.OR, i); - } - public get ruleIndex(): number { - return qParser.RULE_or_expression; - } - public enterRule(listener: qListener): void { - if (listener.enterOr_expression) { - listener.enterOr_expression(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitOr_expression) { - listener.exitOr_expression(this); - } - } -} - -export class And_expressionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public comparison_expression_list(): Comparison_expressionContext[] { - return this.getTypedRuleContexts( - Comparison_expressionContext - ) as Comparison_expressionContext[]; - } - public comparison_expression(i: number): Comparison_expressionContext { - return this.getTypedRuleContext( - Comparison_expressionContext, - i - ) as Comparison_expressionContext; - } - public AND_list(): TerminalNode[] { - return this.getTokens(qParser.AND); - } - public AND(i: number): TerminalNode { - return this.getToken(qParser.AND, i); - } - public get ruleIndex(): number { - return qParser.RULE_and_expression; - } - public enterRule(listener: qListener): void { - if (listener.enterAnd_expression) { - listener.enterAnd_expression(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAnd_expression) { - listener.exitAnd_expression(this); - } - } -} - -export class Comparison_expressionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public additive_expression_list(): Additive_expressionContext[] { - return this.getTypedRuleContexts( - Additive_expressionContext - ) as Additive_expressionContext[]; - } - public additive_expression(i: number): Additive_expressionContext { - return this.getTypedRuleContext( - Additive_expressionContext, - i - ) as Additive_expressionContext; - } - public EQUALS_list(): TerminalNode[] { - return this.getTokens(qParser.EQUALS); - } - public EQUALS(i: number): TerminalNode { - return this.getToken(qParser.EQUALS, i); - } - public get ruleIndex(): number { - return qParser.RULE_comparison_expression; - } - public enterRule(listener: qListener): void { - if (listener.enterComparison_expression) { - listener.enterComparison_expression(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitComparison_expression) { - listener.exitComparison_expression(this); - } - } -} - -export class Additive_expressionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public multiplicative_expression_list(): Multiplicative_expressionContext[] { - return this.getTypedRuleContexts( - Multiplicative_expressionContext - ) as Multiplicative_expressionContext[]; - } - public multiplicative_expression( - i: number - ): Multiplicative_expressionContext { - return this.getTypedRuleContext( - Multiplicative_expressionContext, - i - ) as Multiplicative_expressionContext; - } - public PLUS_list(): TerminalNode[] { - return this.getTokens(qParser.PLUS); - } - public PLUS(i: number): TerminalNode { - return this.getToken(qParser.PLUS, i); - } - public get ruleIndex(): number { - return qParser.RULE_additive_expression; - } - public enterRule(listener: qListener): void { - if (listener.enterAdditive_expression) { - listener.enterAdditive_expression(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAdditive_expression) { - listener.exitAdditive_expression(this); - } - } -} - -export class Multiplicative_expressionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public unary_expression_list(): Unary_expressionContext[] { - return this.getTypedRuleContexts( - Unary_expressionContext - ) as Unary_expressionContext[]; - } - public unary_expression(i: number): Unary_expressionContext { - return this.getTypedRuleContext( - Unary_expressionContext, - i - ) as Unary_expressionContext; - } - public MULTIPLY_list(): TerminalNode[] { - return this.getTokens(qParser.MULTIPLY); - } - public MULTIPLY(i: number): TerminalNode { - return this.getToken(qParser.MULTIPLY, i); - } - public get ruleIndex(): number { - return qParser.RULE_multiplicative_expression; - } - public enterRule(listener: qListener): void { - if (listener.enterMultiplicative_expression) { - listener.enterMultiplicative_expression(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMultiplicative_expression) { - listener.exitMultiplicative_expression(this); - } - } -} - -export class Unary_expressionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public primary_expression(): Primary_expressionContext { - return this.getTypedRuleContext( - Primary_expressionContext, - 0 - ) as Primary_expressionContext; - } - public MINUS(): TerminalNode { - return this.getToken(qParser.MINUS, 0); - } - public get ruleIndex(): number { - return qParser.RULE_unary_expression; - } - public enterRule(listener: qListener): void { - if (listener.enterUnary_expression) { - listener.enterUnary_expression(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitUnary_expression) { - listener.exitUnary_expression(this); - } - } -} - -export class Primary_expressionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public NUMBER(): TerminalNode { - return this.getToken(qParser.NUMBER, 0); - } - public STRING(): TerminalNode { - return this.getToken(qParser.STRING, 0); - } - public variable_name(): Variable_nameContext { - return this.getTypedRuleContext( - Variable_nameContext, - 0 - ) as Variable_nameContext; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_primary_expression; - } - public enterRule(listener: qListener): void { - if (listener.enterPrimary_expression) { - listener.enterPrimary_expression(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitPrimary_expression) { - listener.exitPrimary_expression(this); - } - } -} - -export class Abs_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_abs_function; - } - public enterRule(listener: qListener): void { - if (listener.enterAbs_function) { - listener.enterAbs_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAbs_function) { - listener.exitAbs_function(this); - } - } -} - -export class Acos_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_acos_function; - } - public enterRule(listener: qListener): void { - if (listener.enterAcos_function) { - listener.enterAcos_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAcos_function) { - listener.exitAcos_function(this); - } - } -} - -export class All_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_all_function; - } - public enterRule(listener: qListener): void { - if (listener.enterAll_function) { - listener.enterAll_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAll_function) { - listener.exitAll_function(this); - } - } -} - -export class And_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public AND(): TerminalNode { - return this.getToken(qParser.AND, 0); - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_and_function; - } - public enterRule(listener: qListener): void { - if (listener.enterAnd_function) { - listener.enterAnd_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAnd_function) { - listener.exitAnd_function(this); - } - } -} - -export class Any_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_any_function; - } - public enterRule(listener: qListener): void { - if (listener.enterAny_function) { - listener.enterAny_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAny_function) { - listener.exitAny_function(this); - } - } -} - -export class Asin_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_asin_function; - } - public enterRule(listener: qListener): void { - if (listener.enterAsin_function) { - listener.enterAsin_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAsin_function) { - listener.exitAsin_function(this); - } - } -} - -export class Atan_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_atan_function; - } - public enterRule(listener: qListener): void { - if (listener.enterAtan_function) { - listener.enterAtan_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAtan_function) { - listener.exitAtan_function(this); - } - } -} - -export class Avg_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_avg_function; - } - public enterRule(listener: qListener): void { - if (listener.enterAvg_function) { - listener.enterAvg_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitAvg_function) { - listener.exitAvg_function(this); - } - } -} - -export class Ceiling_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_ceiling_function; - } - public enterRule(listener: qListener): void { - if (listener.enterCeiling_function) { - listener.enterCeiling_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitCeiling_function) { - listener.exitCeiling_function(this); - } - } -} - -export class Cos_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_cos_function; - } - public enterRule(listener: qListener): void { - if (listener.enterCos_function) { - listener.enterCos_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitCos_function) { - listener.exitCos_function(this); - } - } -} - -export class Count_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_count_function; - } - public enterRule(listener: qListener): void { - if (listener.enterCount_function) { - listener.enterCount_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitCount_function) { - listener.exitCount_function(this); - } - } -} - -export class Cross_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_cross_function; - } - public enterRule(listener: qListener): void { - if (listener.enterCross_function) { - listener.enterCross_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitCross_function) { - listener.exitCross_function(this); - } - } -} - -export class Delete_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_delete_function; - } - public enterRule(listener: qListener): void { - if (listener.enterDelete_function) { - listener.enterDelete_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitDelete_function) { - listener.exitDelete_function(this); - } - } -} - -export class Deltas_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_deltas_function; - } - public enterRule(listener: qListener): void { - if (listener.enterDeltas_function) { - listener.enterDeltas_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitDeltas_function) { - listener.exitDeltas_function(this); - } - } -} - -export class Dev_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_dev_function; - } - public enterRule(listener: qListener): void { - if (listener.enterDev_function) { - listener.enterDev_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitDev_function) { - listener.exitDev_function(this); - } - } -} - -export class Distinct_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_distinct_function; - } - public enterRule(listener: qListener): void { - if (listener.enterDistinct_function) { - listener.enterDistinct_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitDistinct_function) { - listener.exitDistinct_function(this); - } - } -} - -export class Div_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_div_function; - } - public enterRule(listener: qListener): void { - if (listener.enterDiv_function) { - listener.enterDiv_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitDiv_function) { - listener.exitDiv_function(this); - } - } -} - -export class Drop_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_drop_function; - } - public enterRule(listener: qListener): void { - if (listener.enterDrop_function) { - listener.enterDrop_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitDrop_function) { - listener.exitDrop_function(this); - } - } -} - -export class Each_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_each_function; - } - public enterRule(listener: qListener): void { - if (listener.enterEach_function) { - listener.enterEach_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitEach_function) { - listener.exitEach_function(this); - } - } -} - -export class Enlist_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_enlist_function; - } - public enterRule(listener: qListener): void { - if (listener.enterEnlist_function) { - listener.enterEnlist_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitEnlist_function) { - listener.exitEnlist_function(this); - } - } -} - -export class Eval_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_eval_function; - } - public enterRule(listener: qListener): void { - if (listener.enterEval_function) { - listener.enterEval_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitEval_function) { - listener.exitEval_function(this); - } - } -} - -export class Except_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_except_function; - } - public enterRule(listener: qListener): void { - if (listener.enterExcept_function) { - listener.enterExcept_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitExcept_function) { - listener.exitExcept_function(this); - } - } -} - -export class Exec_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_exec_function; - } - public enterRule(listener: qListener): void { - if (listener.enterExec_function) { - listener.enterExec_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitExec_function) { - listener.exitExec_function(this); - } - } -} - -export class Exp_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_exp_function; - } - public enterRule(listener: qListener): void { - if (listener.enterExp_function) { - listener.enterExp_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitExp_function) { - listener.exitExp_function(this); - } - } -} - -export class Fby_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_fby_function; - } - public enterRule(listener: qListener): void { - if (listener.enterFby_function) { - listener.enterFby_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitFby_function) { - listener.exitFby_function(this); - } - } -} - -export class Fill_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_fill_function; - } - public enterRule(listener: qListener): void { - if (listener.enterFill_function) { - listener.enterFill_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitFill_function) { - listener.exitFill_function(this); - } - } -} - -export class First_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_first_function; - } - public enterRule(listener: qListener): void { - if (listener.enterFirst_function) { - listener.enterFirst_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitFirst_function) { - listener.exitFirst_function(this); - } - } -} - -export class Flip_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_flip_function; - } - public enterRule(listener: qListener): void { - if (listener.enterFlip_function) { - listener.enterFlip_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitFlip_function) { - listener.exitFlip_function(this); - } - } -} - -export class Floor_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_floor_function; - } - public enterRule(listener: qListener): void { - if (listener.enterFloor_function) { - listener.enterFloor_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitFloor_function) { - listener.exitFloor_function(this); - } - } -} - -export class Get_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_get_function; - } - public enterRule(listener: qListener): void { - if (listener.enterGet_function) { - listener.enterGet_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitGet_function) { - listener.exitGet_function(this); - } - } -} - -export class Group_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_group_function; - } - public enterRule(listener: qListener): void { - if (listener.enterGroup_function) { - listener.enterGroup_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitGroup_function) { - listener.exitGroup_function(this); - } - } -} - -export class Gtime_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_gtime_function; - } - public enterRule(listener: qListener): void { - if (listener.enterGtime_function) { - listener.enterGtime_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitGtime_function) { - listener.exitGtime_function(this); - } - } -} - -export class Hclose_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_hclose_function; - } - public enterRule(listener: qListener): void { - if (listener.enterHclose_function) { - listener.enterHclose_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitHclose_function) { - listener.exitHclose_function(this); - } - } -} - -export class Hcount_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_hcount_function; - } - public enterRule(listener: qListener): void { - if (listener.enterHcount_function) { - listener.enterHcount_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitHcount_function) { - listener.exitHcount_function(this); - } - } -} - -export class Hdel_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_hdel_function; - } - public enterRule(listener: qListener): void { - if (listener.enterHdel_function) { - listener.enterHdel_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitHdel_function) { - listener.exitHdel_function(this); - } - } -} - -export class Hopen_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_hopen_function; - } - public enterRule(listener: qListener): void { - if (listener.enterHopen_function) { - listener.enterHopen_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitHopen_function) { - listener.exitHopen_function(this); - } - } -} - -export class Hsym_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_hsym_function; - } - public enterRule(listener: qListener): void { - if (listener.enterHsym_function) { - listener.enterHsym_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitHsym_function) { - listener.exitHsym_function(this); - } - } -} - -export class Iasc_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_iasc_function; - } - public enterRule(listener: qListener): void { - if (listener.enterIasc_function) { - listener.enterIasc_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitIasc_function) { - listener.exitIasc_function(this); - } - } -} - -export class Idesc_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_idesc_function; - } - public enterRule(listener: qListener): void { - if (listener.enterIdesc_function) { - listener.enterIdesc_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitIdesc_function) { - listener.exitIdesc_function(this); - } - } -} - -export class Ij_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_ij_function; - } - public enterRule(listener: qListener): void { - if (listener.enterIj_function) { - listener.enterIj_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitIj_function) { - listener.exitIj_function(this); - } - } -} - -export class In_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_in_function; - } - public enterRule(listener: qListener): void { - if (listener.enterIn_function) { - listener.enterIn_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitIn_function) { - listener.exitIn_function(this); - } - } -} - -export class Insert_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_insert_function; - } - public enterRule(listener: qListener): void { - if (listener.enterInsert_function) { - listener.enterInsert_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitInsert_function) { - listener.exitInsert_function(this); - } - } -} - -export class Inter_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_inter_function; - } - public enterRule(listener: qListener): void { - if (listener.enterInter_function) { - listener.enterInter_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitInter_function) { - listener.exitInter_function(this); - } - } -} - -export class Inv_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_inv_function; - } - public enterRule(listener: qListener): void { - if (listener.enterInv_function) { - listener.enterInv_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitInv_function) { - listener.exitInv_function(this); - } - } -} - -export class Keys_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_keys_function; - } - public enterRule(listener: qListener): void { - if (listener.enterKeys_function) { - listener.enterKeys_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitKeys_function) { - listener.exitKeys_function(this); - } - } -} - -export class Last_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_last_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLast_function) { - listener.enterLast_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLast_function) { - listener.exitLast_function(this); - } - } -} - -export class Like_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_like_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLike_function) { - listener.enterLike_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLike_function) { - listener.exitLike_function(this); - } - } -} - -export class List_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_list_function; - } - public enterRule(listener: qListener): void { - if (listener.enterList_function) { - listener.enterList_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitList_function) { - listener.exitList_function(this); - } - } -} - -export class Lj_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_lj_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLj_function) { - listener.enterLj_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLj_function) { - listener.exitLj_function(this); - } - } -} - -export class Load_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_load_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLoad_function) { - listener.enterLoad_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLoad_function) { - listener.exitLoad_function(this); - } - } -} - -export class Log_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_log_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLog_function) { - listener.enterLog_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLog_function) { - listener.exitLog_function(this); - } - } -} - -export class Lower_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_lower_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLower_function) { - listener.enterLower_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLower_function) { - listener.exitLower_function(this); - } - } -} - -export class Lsq_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_lsq_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLsq_function) { - listener.enterLsq_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLsq_function) { - listener.exitLsq_function(this); - } - } -} - -export class Ltime_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_ltime_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLtime_function) { - listener.enterLtime_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLtime_function) { - listener.exitLtime_function(this); - } - } -} - -export class Ltrim_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_ltrim_function; - } - public enterRule(listener: qListener): void { - if (listener.enterLtrim_function) { - listener.enterLtrim_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitLtrim_function) { - listener.exitLtrim_function(this); - } - } -} - -export class Mavg_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_mavg_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMavg_function) { - listener.enterMavg_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMavg_function) { - listener.exitMavg_function(this); - } - } -} - -export class Max_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_max_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMax_function) { - listener.enterMax_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMax_function) { - listener.exitMax_function(this); - } - } -} - -export class Maxs_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_maxs_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMaxs_function) { - listener.enterMaxs_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMaxs_function) { - listener.exitMaxs_function(this); - } - } -} - -export class Mcount_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_mcount_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMcount_function) { - listener.enterMcount_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMcount_function) { - listener.exitMcount_function(this); - } - } -} - -export class Md5_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_md5_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMd5_function) { - listener.enterMd5_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMd5_function) { - listener.exitMd5_function(this); - } - } -} - -export class Mdev_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_mdev_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMdev_function) { - listener.enterMdev_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMdev_function) { - listener.exitMdev_function(this); - } - } -} - -export class Med_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_med_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMed_function) { - listener.enterMed_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMed_function) { - listener.exitMed_function(this); - } - } -} - -export class Meta_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_meta_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMeta_function) { - listener.enterMeta_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMeta_function) { - listener.exitMeta_function(this); - } - } -} - -export class Min_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_min_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMin_function) { - listener.enterMin_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMin_function) { - listener.exitMin_function(this); - } - } -} - -export class Mins_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_mins_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMins_function) { - listener.enterMins_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMins_function) { - listener.exitMins_function(this); - } - } -} - -export class Mmax_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_mmax_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMmax_function) { - listener.enterMmax_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMmax_function) { - listener.exitMmax_function(this); - } - } -} - -export class Mmin_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_mmin_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMmin_function) { - listener.enterMmin_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMmin_function) { - listener.exitMmin_function(this); - } - } -} - -export class Mmu_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_mmu_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMmu_function) { - listener.enterMmu_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMmu_function) { - listener.exitMmu_function(this); - } - } -} - -export class Mod_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_mod_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMod_function) { - listener.enterMod_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMod_function) { - listener.exitMod_function(this); - } - } -} - -export class Msum_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_msum_function; - } - public enterRule(listener: qListener): void { - if (listener.enterMsum_function) { - listener.enterMsum_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitMsum_function) { - listener.exitMsum_function(this); - } - } -} - -export class Neg_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_neg_function; - } - public enterRule(listener: qListener): void { - if (listener.enterNeg_function) { - listener.enterNeg_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitNeg_function) { - listener.exitNeg_function(this); - } - } -} - -export class Next_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_next_function; - } - public enterRule(listener: qListener): void { - if (listener.enterNext_function) { - listener.enterNext_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitNext_function) { - listener.exitNext_function(this); - } - } -} - -export class Not_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public NOT(): TerminalNode { - return this.getToken(qParser.NOT, 0); - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_not_function; - } - public enterRule(listener: qListener): void { - if (listener.enterNot_function) { - listener.enterNot_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitNot_function) { - listener.exitNot_function(this); - } - } -} - -export class Null_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_null_function; - } - public enterRule(listener: qListener): void { - if (listener.enterNull_function) { - listener.enterNull_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitNull_function) { - listener.exitNull_function(this); - } - } -} - -export class Or_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public OR(): TerminalNode { - return this.getToken(qParser.OR, 0); - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_or_function; - } - public enterRule(listener: qListener): void { - if (listener.enterOr_function) { - listener.enterOr_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitOr_function) { - listener.exitOr_function(this); - } - } -} - -export class Over_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_over_function; - } - public enterRule(listener: qListener): void { - if (listener.enterOver_function) { - listener.enterOver_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitOver_function) { - listener.exitOver_function(this); - } - } -} - -export class Parse_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_parse_function; - } - public enterRule(listener: qListener): void { - if (listener.enterParse_function) { - listener.enterParse_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitParse_function) { - listener.exitParse_function(this); - } - } -} - -export class Peach_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_peach_function; - } - public enterRule(listener: qListener): void { - if (listener.enterPeach_function) { - listener.enterPeach_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitPeach_function) { - listener.exitPeach_function(this); - } - } -} - -export class Pj_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_pj_function; - } - public enterRule(listener: qListener): void { - if (listener.enterPj_function) { - listener.enterPj_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitPj_function) { - listener.exitPj_function(this); - } - } -} - -export class Plist_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_plist_function; - } - public enterRule(listener: qListener): void { - if (listener.enterPlist_function) { - listener.enterPlist_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitPlist_function) { - listener.exitPlist_function(this); - } - } -} - -export class Prd_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_prd_function; - } - public enterRule(listener: qListener): void { - if (listener.enterPrd_function) { - listener.enterPrd_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitPrd_function) { - listener.exitPrd_function(this); - } - } -} - -export class Prev_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_prev_function; - } - public enterRule(listener: qListener): void { - if (listener.enterPrev_function) { - listener.enterPrev_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitPrev_function) { - listener.exitPrev_function(this); - } - } -} - -export class Prior_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_prior_function; - } - public enterRule(listener: qListener): void { - if (listener.enterPrior_function) { - listener.enterPrior_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitPrior_function) { - listener.exitPrior_function(this); - } - } -} - -export class Rand_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_rand_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRand_function) { - listener.enterRand_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRand_function) { - listener.exitRand_function(this); - } - } -} - -export class Rank_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_rank_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRank_function) { - listener.enterRank_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRank_function) { - listener.exitRank_function(this); - } - } -} - -export class Ratios_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_ratios_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRatios_function) { - listener.enterRatios_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRatios_function) { - listener.exitRatios_function(this); - } - } -} - -export class Raze_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_raze_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRaze_function) { - listener.enterRaze_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRaze_function) { - listener.exitRaze_function(this); - } - } -} - -export class Read0_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_read0_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRead0_function) { - listener.enterRead0_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRead0_function) { - listener.exitRead0_function(this); - } - } -} - -export class Read1_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_read1_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRead1_function) { - listener.enterRead1_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRead1_function) { - listener.exitRead1_function(this); - } - } -} - -export class Reciprocal_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_reciprocal_function; - } - public enterRule(listener: qListener): void { - if (listener.enterReciprocal_function) { - listener.enterReciprocal_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitReciprocal_function) { - listener.exitReciprocal_function(this); - } - } -} - -export class Reverse_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_reverse_function; - } - public enterRule(listener: qListener): void { - if (listener.enterReverse_function) { - listener.enterReverse_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitReverse_function) { - listener.exitReverse_function(this); - } - } -} - -export class Rload_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_rload_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRload_function) { - listener.enterRload_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRload_function) { - listener.exitRload_function(this); - } - } -} - -export class Rotate_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_rotate_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRotate_function) { - listener.enterRotate_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRotate_function) { - listener.exitRotate_function(this); - } - } -} - -export class Rsave_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_rsave_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRsave_function) { - listener.enterRsave_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRsave_function) { - listener.exitRsave_function(this); - } - } -} - -export class Rtrim_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_rtrim_function; - } - public enterRule(listener: qListener): void { - if (listener.enterRtrim_function) { - listener.enterRtrim_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitRtrim_function) { - listener.exitRtrim_function(this); - } - } -} - -export class Save_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_save_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSave_function) { - listener.enterSave_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSave_function) { - listener.exitSave_function(this); - } - } -} - -export class Scan_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_scan_function; - } - public enterRule(listener: qListener): void { - if (listener.enterScan_function) { - listener.enterScan_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitScan_function) { - listener.exitScan_function(this); - } - } -} - -export class Select_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_select_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSelect_function) { - listener.enterSelect_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSelect_function) { - listener.exitSelect_function(this); - } - } -} - -export class Set_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_set_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSet_function) { - listener.enterSet_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSet_function) { - listener.exitSet_function(this); - } - } -} - -export class Show_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_show_function; - } - public enterRule(listener: qListener): void { - if (listener.enterShow_function) { - listener.enterShow_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitShow_function) { - listener.exitShow_function(this); - } - } -} - -export class Signum_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_signum_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSignum_function) { - listener.enterSignum_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSignum_function) { - listener.exitSignum_function(this); - } - } -} - -export class Sin_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_sin_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSin_function) { - listener.enterSin_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSin_function) { - listener.exitSin_function(this); - } - } -} - -export class Sqrt_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_sqrt_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSqrt_function) { - listener.enterSqrt_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSqrt_function) { - listener.exitSqrt_function(this); - } - } -} - -export class Ssr_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_ssr_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSsr_function) { - listener.enterSsr_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSsr_function) { - listener.exitSsr_function(this); - } - } -} - -export class String_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_string_function; - } - public enterRule(listener: qListener): void { - if (listener.enterString_function) { - listener.enterString_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitString_function) { - listener.exitString_function(this); - } - } -} - -export class Sublist_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_sublist_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSublist_function) { - listener.enterSublist_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSublist_function) { - listener.exitSublist_function(this); - } - } -} - -export class Sum_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_sum_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSum_function) { - listener.enterSum_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSum_function) { - listener.exitSum_function(this); - } - } -} - -export class Sums_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_sums_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSums_function) { - listener.enterSums_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSums_function) { - listener.exitSums_function(this); - } - } -} - -export class Sv_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_sv_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSv_function) { - listener.enterSv_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSv_function) { - listener.exitSv_function(this); - } - } -} - -export class System_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_system_function; - } - public enterRule(listener: qListener): void { - if (listener.enterSystem_function) { - listener.enterSystem_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitSystem_function) { - listener.exitSystem_function(this); - } - } -} - -export class Tables_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_tables_function; - } - public enterRule(listener: qListener): void { - if (listener.enterTables_function) { - listener.enterTables_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitTables_function) { - listener.exitTables_function(this); - } - } -} - -export class Tan_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_tan_function; - } - public enterRule(listener: qListener): void { - if (listener.enterTan_function) { - listener.enterTan_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitTan_function) { - listener.exitTan_function(this); - } - } -} - -export class Til_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_til_function; - } - public enterRule(listener: qListener): void { - if (listener.enterTil_function) { - listener.enterTil_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitTil_function) { - listener.exitTil_function(this); - } - } -} - -export class Trim_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_trim_function; - } - public enterRule(listener: qListener): void { - if (listener.enterTrim_function) { - listener.enterTrim_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitTrim_function) { - listener.exitTrim_function(this); - } - } -} - -export class Type_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_type_function; - } - public enterRule(listener: qListener): void { - if (listener.enterType_function) { - listener.enterType_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitType_function) { - listener.exitType_function(this); - } - } -} - -export class Uj_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_uj_function; - } - public enterRule(listener: qListener): void { - if (listener.enterUj_function) { - listener.enterUj_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitUj_function) { - listener.exitUj_function(this); - } - } -} - -export class Ungroup_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_ungroup_function; - } - public enterRule(listener: qListener): void { - if (listener.enterUngroup_function) { - listener.enterUngroup_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitUngroup_function) { - listener.exitUngroup_function(this); - } - } -} - -export class Union_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_union_function; - } - public enterRule(listener: qListener): void { - if (listener.enterUnion_function) { - listener.enterUnion_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitUnion_function) { - listener.exitUnion_function(this); - } - } -} - -export class Update_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_update_function; - } - public enterRule(listener: qListener): void { - if (listener.enterUpdate_function) { - listener.enterUpdate_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitUpdate_function) { - listener.exitUpdate_function(this); - } - } -} - -export class Upper_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_upper_function; - } - public enterRule(listener: qListener): void { - if (listener.enterUpper_function) { - listener.enterUpper_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitUpper_function) { - listener.exitUpper_function(this); - } - } -} - -export class Upsert_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_upsert_function; - } - public enterRule(listener: qListener): void { - if (listener.enterUpsert_function) { - listener.enterUpsert_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitUpsert_function) { - listener.exitUpsert_function(this); - } - } -} - -export class Value_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_value_function; - } - public enterRule(listener: qListener): void { - if (listener.enterValue_function) { - listener.enterValue_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitValue_function) { - listener.exitValue_function(this); - } - } -} - -export class Var_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_var_function; - } - public enterRule(listener: qListener): void { - if (listener.enterVar_function) { - listener.enterVar_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitVar_function) { - listener.exitVar_function(this); - } - } -} - -export class View_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_view_function; - } - public enterRule(listener: qListener): void { - if (listener.enterView_function) { - listener.enterView_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitView_function) { - listener.exitView_function(this); - } - } -} - -export class Vs_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_vs_function; - } - public enterRule(listener: qListener): void { - if (listener.enterVs_function) { - listener.enterVs_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitVs_function) { - listener.exitVs_function(this); - } - } -} - -export class Wavg_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_wavg_function; - } - public enterRule(listener: qListener): void { - if (listener.enterWavg_function) { - listener.enterWavg_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitWavg_function) { - listener.exitWavg_function(this); - } - } -} - -export class Where_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_where_function; - } - public enterRule(listener: qListener): void { - if (listener.enterWhere_function) { - listener.enterWhere_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitWhere_function) { - listener.exitWhere_function(this); - } - } -} - -export class Within_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_within_function; - } - public enterRule(listener: qListener): void { - if (listener.enterWithin_function) { - listener.enterWithin_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitWithin_function) { - listener.exitWithin_function(this); - } - } -} - -export class Wj1_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_wj1_function; - } - public enterRule(listener: qListener): void { - if (listener.enterWj1_function) { - listener.enterWj1_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitWj1_function) { - listener.exitWj1_function(this); - } - } -} - -export class Wj2_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_wj2_function; - } - public enterRule(listener: qListener): void { - if (listener.enterWj2_function) { - listener.enterWj2_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitWj2_function) { - listener.exitWj2_function(this); - } - } -} - -export class Ww_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_ww_function; - } - public enterRule(listener: qListener): void { - if (listener.enterWw_function) { - listener.enterWw_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitWw_function) { - listener.exitWw_function(this); - } - } -} - -export class Xasc_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xasc_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXasc_function) { - listener.enterXasc_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXasc_function) { - listener.exitXasc_function(this); - } - } -} - -export class Xbar_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xbar_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXbar_function) { - listener.enterXbar_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXbar_function) { - listener.exitXbar_function(this); - } - } -} - -export class Xcols_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xcols_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXcols_function) { - listener.enterXcols_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXcols_function) { - listener.exitXcols_function(this); - } - } -} - -export class Xdesc_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xdesc_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXdesc_function) { - listener.enterXdesc_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXdesc_function) { - listener.exitXdesc_function(this); - } - } -} - -export class Xexp_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xexp_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXexp_function) { - listener.enterXexp_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXexp_function) { - listener.exitXexp_function(this); - } - } -} - -export class Xgroup_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xgroup_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXgroup_function) { - listener.enterXgroup_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXgroup_function) { - listener.exitXgroup_function(this); - } - } -} - -export class Xkey_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xkey_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXkey_function) { - listener.enterXkey_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXkey_function) { - listener.exitXkey_function(this); - } - } -} - -export class Xlog_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xlog_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXlog_function) { - listener.enterXlog_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXlog_function) { - listener.exitXlog_function(this); - } - } -} - -export class Xprev_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xprev_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXprev_function) { - listener.enterXprev_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXprev_function) { - listener.exitXprev_function(this); - } - } -} - -export class Xrank_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xrank_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXrank_function) { - listener.enterXrank_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXrank_function) { - listener.exitXrank_function(this); - } - } -} - -export class Xranked_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xranked_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXranked_function) { - listener.enterXranked_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXranked_function) { - listener.exitXranked_function(this); - } - } -} - -export class Xrecs_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xrecs_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXrecs_function) { - listener.enterXrecs_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXrecs_function) { - listener.exitXrecs_function(this); - } - } -} - -export class Xrows_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xrows_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXrows_function) { - listener.enterXrows_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXrows_function) { - listener.exitXrows_function(this); - } - } -} - -export class Xss_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xss_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXss_function) { - listener.enterXss_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXss_function) { - listener.exitXss_function(this); - } - } -} - -export class Xtype_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_xtype_function; - } - public enterRule(listener: qListener): void { - if (listener.enterXtype_function) { - listener.enterXtype_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitXtype_function) { - listener.exitXtype_function(this); - } - } -} - -export class Yield_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression(): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, 0) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_yield_function; - } - public enterRule(listener: qListener): void { - if (listener.enterYield_function) { - listener.enterYield_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitYield_function) { - listener.exitYield_function(this); - } - } -} - -export class Zip_functionContext extends ParserRuleContext { - constructor( - parser?: qParser, - parent?: ParserRuleContext, - invokingState?: number - ) { - super(parent, invokingState); - this.parser = parser; - } - public expression_list(): ExpressionContext[] { - return this.getTypedRuleContexts(ExpressionContext) as ExpressionContext[]; - } - public expression(i: number): ExpressionContext { - return this.getTypedRuleContext(ExpressionContext, i) as ExpressionContext; - } - public get ruleIndex(): number { - return qParser.RULE_zip_function; - } - public enterRule(listener: qListener): void { - if (listener.enterZip_function) { - listener.enterZip_function(this); - } - } - public exitRule(listener: qListener): void { - if (listener.exitZip_function) { - listener.exitZip_function(this); - } - } -} diff --git a/server/src/utils/cpUtils.ts b/server/src/utils/cpUtils.ts deleted file mode 100644 index 911907ba..00000000 --- a/server/src/utils/cpUtils.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import * as cp from "child_process"; -import * as os from "os"; - -export async function executeCommand( - workingDirectory: string | undefined, - command: string, - ...args: string[] -): Promise { - const result: ICommandResult = await tryExecuteCommand( - workingDirectory, - command, - ...args - ); - if (result.code !== 0) { - throw new Error( - `Failed to run ${command} command. Check output window for more details.` - ); - } else { - console.log(`Finished running command: ${command} ${result.formattedArgs}`); - } - return result.cmdOutput; -} - -export async function tryExecuteCommand( - workingDirectory: string | undefined, - command: string, - ...args: string[] -): Promise { - return await new Promise( - ( - resolve: (res: ICommandResult) => void, - reject: (e: Error) => void - ): void => { - let cmdOutput = ""; - let cmdOutputIncludingStderr = ""; - const formattedArgs: string = args.join(" "); - - workingDirectory = workingDirectory || os.tmpdir(); - const options: cp.SpawnOptions = { - cwd: workingDirectory, - shell: true, - }; - const childProc: cp.ChildProcess = cp.spawn(command, args, options); - - childProc.stdout?.on("data", (data: string | Buffer) => { - data = data.toString(); - cmdOutput = cmdOutput.concat(data); - cmdOutputIncludingStderr = cmdOutputIncludingStderr.concat(data); - console.log(data); - }); - - childProc.stderr?.on("data", (data: string | Buffer) => { - data = data.toString(); - cmdOutputIncludingStderr = cmdOutputIncludingStderr.concat(data); - console.log(data); - }); - - childProc.on("error", reject); - - childProc.on("close", (code: number) => { - resolve({ code, cmdOutput, cmdOutputIncludingStderr, formattedArgs }); - }); - } - ); -} - -export interface ICommandResult { - code: number; - cmdOutput: string; - cmdOutputIncludingStderr: string; - formattedArgs: string; -} - -const quotationMark: string = process.platform === "win32" ? '"' : "'"; - -export function wrapArgInQuotes(arg?: string | boolean | number): string { - arg ??= ""; - return typeof arg === "string" - ? quotationMark + arg + quotationMark - : String(arg); -} diff --git a/server/src/utils/parserUtils.ts b/server/src/utils/parserUtils.ts deleted file mode 100644 index c7aaffab..00000000 --- a/server/src/utils/parserUtils.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import { CharStreams, CommonTokenStream } from "antlr4"; -import fs from "fs"; -import { CompletionItem, CompletionItemKind } from "vscode-languageserver/node"; -import qLexer from "./antlrGrammars/qLexer"; -import qParser from "./antlrGrammars/qParser"; -import { qLangParserItems } from "./qLangParser"; - -export async function initializeParser(): Promise { - const input = ""; - const chars = CharStreams.fromString(input); - const lexer = new qLexer(chars); - const tokens = new CommonTokenStream(lexer); - const parser = new qParser(tokens); - parser.buildParseTrees = true; - return parser; -} - -export function getQLangParserRef(): CompletionItem[] { - const qLangParserItemsWithKind: CompletionItem[] = qLangParserItems.map( - (item: CompletionItem) => { - item.kind = item.kind as CompletionItemKind; - return item; - } - ); - - return qLangParserItemsWithKind; -} - -export const qLangParser = getQLangParserRef(); -export const qLangSampleParser = fs.readFileSync( - `${__dirname}/../grammars/qLangSamples.q`, - "utf8" -); diff --git a/src/commands/buildToolsCommand.ts b/src/commands/buildToolsCommand.ts new file mode 100644 index 00000000..a3df86b8 --- /dev/null +++ b/src/commands/buildToolsCommand.ts @@ -0,0 +1,138 @@ +/* + * Copyright (c) 1998-2023 Kx Systems Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +import { + Diagnostic, + DiagnosticSeverity, + ProgressLocation, + Range, + TextDocument, + Uri, + window, + workspace, +} from "vscode"; +import { spawn } from "child_process"; +import { tmpdir, platform, arch } from "os"; +import fs from "fs"; +import Path from "path"; +import { ext } from "../extensionVariables"; + +const enum LinterErrorClass { + INFO = "info", + WARNING = "warning", + ERROR = "error", +} + +interface LinterResult { + fileName: string; + namespace: string; + label: string; + errorClass: LinterErrorClass; + description: string; + problemText: string; + errorMessage: string; + startLine: number; + startCol: number; + endLine: number; + endCol: number; + fname: string; +} + +function getLinter(args: string[]) { + if (platform() === "darwin" && arch() === "arm64") { + return spawn("arch", ["-x86_64", "q", ...args]); + } + return spawn("q", args); +} + +function getLinterResults(uri: Uri) { + return new Promise((resolve, reject) => { + if (!process.env.QHOME) { + reject(new Error("QHOME is not set")); + } + if (!process.env.AXLIBRARIES_HOME) { + reject(new Error("AXLIBRARIES_HOME is not set")); + } + const results = Path.join( + tmpdir(), + `kdb-qlint-${new Date().getTime()}.json`, + ); + const linter = getLinter([ + `${process.env.AXLIBRARIES_HOME}/ws/qlint.q_`, + "-src", + uri.path, + "-out", + results, + ]); + linter.on("exit", () => { + fs.readFile(results, "utf8", (error, data) => { + if (error) { + reject(error); + } else { + try { + const parsed = JSON.parse(data); + resolve(parsed); + } catch (error) { + reject(error); + } + } + }); + }); + linter.on("error", (error) => reject(error)); + }); +} + +function createDiagnosticFromResult(result: LinterResult) { + return new Diagnostic( + new Range( + result.startLine - 1, + result.startCol - 1, + result.endLine - 1, + result.endCol, + ), + result.description, + result.errorClass === LinterErrorClass.WARNING + ? DiagnosticSeverity.Warning + : result.errorClass === LinterErrorClass.ERROR + ? DiagnosticSeverity.Error + : result.errorClass === LinterErrorClass.INFO + ? DiagnosticSeverity.Information + : DiagnosticSeverity.Hint, + ); +} + +export async function lint(uri: Uri) { + if (!uri.path.endsWith(".q") && !uri.path.endsWith(".quke")) { + return; + } + await window.withProgress( + { title: "Linting", location: ProgressLocation.Window, cancellable: false }, + async () => { + const results = await getLinterResults(uri); + ext.diagnosticCollection.set( + uri, + results.map(createDiagnosticFromResult), + ); + }, + ); +} + +export async function updateLintng(document: TextDocument) { + const linting = workspace + .getConfiguration("kdb", document) + .get("linting", false); + + if (linting) { + await lint(document.uri); + } +} diff --git a/src/extension.ts b/src/extension.ts index 209e3a1c..1e039f45 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -14,15 +14,10 @@ import { env } from "node:process"; import path from "path"; import { - CancellationToken, commands, - CompletionItem, - CompletionItemKind, EventEmitter, ExtensionContext, languages, - Position, - TextDocument, TextDocumentContentProvider, Uri, window, @@ -92,6 +87,8 @@ import { import { runQFileTerminal } from "./utils/execution"; import AuthSettings from "./utils/secretStorage"; import { Telemetry } from "./utils/telemetryClient"; +import { lint, updateLintng } from "./commands/buildToolsCommand"; +import { CompletionProvider } from "./services/completionProvider"; let client: LanguageClient; @@ -317,7 +314,26 @@ export async function activate(context: ExtensionContext) { await executeQuery(query, undefined, isPython); } }), + commands.registerCommand("kdb.qlint", async () => { + const editor = window.activeTextEditor; + if (editor) { + await lint(editor.document.uri); + } + }), + ext.diagnosticCollection, + ); + + workspace.onDidSaveTextDocument(updateLintng); + workspace.onDidOpenTextDocument(updateLintng); + workspace.onDidCloseTextDocument((document) => + ext.diagnosticCollection.delete(document.uri), + ); + workspace.onDidChangeTextDocument((event) => + ext.diagnosticCollection.delete(event.document.uri), ); + if (window.activeTextEditor) { + updateLintng(window.activeTextEditor.document); + } const lastResult: QueryResult | undefined = undefined; const resultSchema = "vscode-kdb-q"; @@ -337,57 +353,10 @@ export async function activate(context: ExtensionContext) { ); context.subscriptions.push( - languages.registerCompletionItemProvider("q", { - provideCompletionItems( - document: TextDocument, - _position: Position, - _token: CancellationToken, - ) { - const items: CompletionItem[] = []; - - ext.keywords.forEach((x) => - items.push({ label: x, kind: CompletionItemKind.Keyword }), - ); - ext.functions.forEach((x) => - items.push({ - label: x, - insertText: x, - kind: CompletionItemKind.Function, - }), - ); - ext.tables.forEach((x) => - items.push({ - label: x, - insertText: x, - kind: CompletionItemKind.Value, - }), - ); - ext.variables.forEach((x) => - items.push({ - label: x, - insertText: x, - kind: CompletionItemKind.Variable, - }), - ); - - const text = document.getText(); - const regex = /([.\w]+)[ \t]*:/gm; - let match; - while ((match = regex.exec(text))) { - const name = match[1]; - const found = items.find((item) => item.label === name); - if (!found) { - items.push({ - label: name, - insertText: name, - kind: CompletionItemKind.Variable, - }); - } - } - - return items; - }, - }), + languages.registerCompletionItemProvider( + { language: "q" }, + new CompletionProvider(), + ), ); //q language server @@ -404,7 +373,7 @@ export async function activate(context: ExtensionContext) { const clientOptions: LanguageClientOptions = { documentSelector: [{ scheme: "file", language: "q" }], synchronize: { - fileEvents: workspace.createFileSystemWatcher("**/*.q"), + fileEvents: workspace.createFileSystemWatcher("**/*.{q,quke}"), }, }; @@ -415,25 +384,7 @@ export async function activate(context: ExtensionContext) { clientOptions, ); - context.subscriptions.push( - commands.registerCommand("kdb.sendServerCache", (code) => { - client.sendNotification("analyzeServerCache", code); - }), - ); - - context.subscriptions.push( - commands.registerCommand("kdb.sendOnHover", (hoverItems) => { - client.sendNotification("prepareOnHover", hoverItems); - }), - ); - - client.start().then(() => { - const configuration = workspace.getConfiguration("kdb.sourceFiles"); - client.sendNotification("analyzeSourceCode", { - globsPattern: configuration.get("globsPattern"), - ignorePattern: configuration.get("ignorePattern"), - }); - }); + await client.start(); Telemetry.sendEvent("Extension.Activated"); } diff --git a/src/extensionVariables.ts b/src/extensionVariables.ts index 9d08c7fa..eb5e4deb 100644 --- a/src/extensionVariables.ts +++ b/src/extensionVariables.ts @@ -11,7 +11,7 @@ * specific language governing permissions and limitations under the License. */ -import { ExtensionContext, extensions, OutputChannel } from "vscode"; +import { ExtensionContext, extensions, languages, OutputChannel } from "vscode"; import { LanguageClient } from "vscode-languageclient/node"; import { Connection } from "./models/connection"; import { LocalProcess } from "./models/localProcess"; @@ -272,4 +272,7 @@ export namespace ext { minutes: 1000 * 60, seconds: 1000, }; + + export const diagnosticCollection = + languages.createDiagnosticCollection("kdb"); } diff --git a/server/src/utils/qLangParser.ts b/src/services/completionProvider.ts similarity index 97% rename from server/src/utils/qLangParser.ts rename to src/services/completionProvider.ts index 823be6ab..98971d18 100644 --- a/server/src/utils/qLangParser.ts +++ b/src/services/completionProvider.ts @@ -11,9 +11,51 @@ * specific language governing permissions and limitations under the License. */ -import { CompletionItem } from "vscode-languageserver/node"; +import { + CompletionItem, + CompletionItemKind, + CompletionItemProvider, + CompletionList, + ProviderResult, +} from "vscode"; +import { ext } from "../extensionVariables"; -export const qLangParserItems: CompletionItem[] = [ +export class CompletionProvider implements CompletionItemProvider { + provideCompletionItems(): ProviderResult< + CompletionItem[] | CompletionList + > { + const items: CompletionItem[] = []; + + ext.keywords.forEach((x) => + items.push({ label: x, kind: CompletionItemKind.Keyword }), + ); + ext.functions.forEach((x) => + items.push({ + label: x, + insertText: x, + kind: CompletionItemKind.Function, + }), + ); + ext.tables.forEach((x) => + items.push({ + label: x, + insertText: x, + kind: CompletionItemKind.Value, + }), + ); + ext.variables.forEach((x) => + items.push({ + label: x, + insertText: x, + kind: CompletionItemKind.Variable, + }), + ); + + return [...items, ...qLangParserItems]; + } +} + +const qLangParserItems: CompletionItem[] = [ { label: "abs", detail: "absolute value", From b640463b02b091b8aad12ac114f23f6e9312210e Mon Sep 17 00:00:00 2001 From: ecmel Date: Fri, 19 Apr 2024 17:17:58 +0300 Subject: [PATCH 02/25] added references --- server/src/qLangServer.ts | 6 ++++++ server/src/server.ts | 4 +++- src/services/completionProvider.ts | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/server/src/qLangServer.ts b/server/src/qLangServer.ts index bcb0a382..ec78c971 100644 --- a/server/src/qLangServer.ts +++ b/server/src/qLangServer.ts @@ -42,6 +42,7 @@ export default class QLangServer { this.documents.listen(this.connection); this.connection.onCompletion(this.onCompletion.bind(this)); this.connection.onDefinition(this.onDefinition.bind(this)); + this.connection.onReferences(this.onReferences.bind(this)); this.connection.onRenameRequest(this.onRenameRequest.bind(this)); } @@ -50,6 +51,7 @@ export default class QLangServer { textDocumentSync: TextDocumentSyncKind.Full, completionProvider: { resolveProvider: false }, definitionProvider: true, + referencesProvider: true, renameProvider: true, }; } @@ -62,6 +64,10 @@ export default class QLangServer { return []; } + private onReferences(): Location[] { + return []; + } + private onRenameRequest({ textDocument, position, diff --git a/server/src/server.ts b/server/src/server.ts index 992047fa..cf777f51 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -17,8 +17,10 @@ import QLangServer from "./qLangServer"; const connection: Connection = createConnection(ProposedFeatures.all); +let server: QLangServer; + connection.onInitialize((params) => { - const server = new QLangServer(connection, params); + server = new QLangServer(connection, params); return { capabilities: server.capabilities(), }; diff --git a/src/services/completionProvider.ts b/src/services/completionProvider.ts index 98971d18..f35fda5c 100644 --- a/src/services/completionProvider.ts +++ b/src/services/completionProvider.ts @@ -26,27 +26,27 @@ export class CompletionProvider implements CompletionItemProvider { > { const items: CompletionItem[] = []; - ext.keywords.forEach((x) => - items.push({ label: x, kind: CompletionItemKind.Keyword }), + ext.keywords.forEach((item) => + items.push({ label: item, kind: CompletionItemKind.Keyword }), ); - ext.functions.forEach((x) => + ext.functions.forEach((item) => items.push({ - label: x, - insertText: x, + label: item, + insertText: item, kind: CompletionItemKind.Function, }), ); - ext.tables.forEach((x) => + ext.tables.forEach((item) => items.push({ - label: x, - insertText: x, + label: item, + insertText: item, kind: CompletionItemKind.Value, }), ); - ext.variables.forEach((x) => + ext.variables.forEach((item) => items.push({ - label: x, - insertText: x, + label: item, + insertText: item, kind: CompletionItemKind.Variable, }), ); From 2bf786aecb4a967a4d601ef02f531c99a0727bb0 Mon Sep 17 00:00:00 2001 From: ecmel Date: Sat, 20 Apr 2024 14:46:48 +0300 Subject: [PATCH 03/25] added linter cache --- package.json | 2 +- src/commands/buildToolsCommand.ts | 218 ++++++++++++++++++++---------- src/extension.ts | 17 +-- 3 files changed, 150 insertions(+), 87 deletions(-) diff --git a/package.json b/package.json index a25c9b9f..005e9f95 100644 --- a/package.json +++ b/package.json @@ -320,7 +320,7 @@ }, { "command": "kdb.qlint", - "title": "Lint File" + "title": "q: Lint File" } ], "keybindings": [ diff --git a/src/commands/buildToolsCommand.ts b/src/commands/buildToolsCommand.ts index a3df86b8..fc99c730 100644 --- a/src/commands/buildToolsCommand.ts +++ b/src/commands/buildToolsCommand.ts @@ -11,6 +11,8 @@ * specific language governing permissions and limitations under the License. */ +import Path from "path"; +import fs from "fs"; import { Diagnostic, DiagnosticSeverity, @@ -21,16 +23,16 @@ import { window, workspace, } from "vscode"; -import { spawn } from "child_process"; +import { spawn, exec } from "child_process"; import { tmpdir, platform, arch } from "os"; -import fs from "fs"; -import Path from "path"; import { ext } from "../extensionVariables"; +const cache = new Map>(); + const enum LinterErrorClass { - INFO = "info", - WARNING = "warning", ERROR = "error", + WARNING = "warning", + INFO = "info", } interface LinterResult { @@ -48,91 +50,163 @@ interface LinterResult { fname: string; } -function getLinter(args: string[]) { +function initBuildTools() { + return new Promise((resolve, reject) => { + if (!process.env.QHOME) { + return reject(new Error("QHOME is not set")); + } + if (!process.env.AXLIBRARIES_HOME) { + return reject(new Error("AXLIBRARIES_HOME is not set")); + } + if (platform() === "darwin") { + const xattr = exec( + "xattr -dr com.apple.quarantine $AXLIBRARIES_HOME/ws/lib/*.{so,dylib}", + ); + xattr.on("exit", () => resolve()); + xattr.on("error", (error) => reject(error)); + } else { + resolve(); + } + }); +} + +function getTool(args: string[]) { if (platform() === "darwin" && arch() === "arm64") { return spawn("arch", ["-x86_64", "q", ...args]); } return spawn("q", args); } +function isLintingSupported(document: TextDocument) { + const path = document.uri.path; + return path.endsWith(".q") || path.endsWith(".quke"); +} + +function isAutoLintingEnabled(document: TextDocument) { + return workspace + .getConfiguration("kdb", document) + .get("linting", false); +} + +function isAutoLintingSupported(document: TextDocument) { + return isLintingSupported(document) && isAutoLintingEnabled(document); +} + function getLinterResults(uri: Uri) { return new Promise((resolve, reject) => { - if (!process.env.QHOME) { - reject(new Error("QHOME is not set")); - } - if (!process.env.AXLIBRARIES_HOME) { - reject(new Error("AXLIBRARIES_HOME is not set")); - } - const results = Path.join( - tmpdir(), - `kdb-qlint-${new Date().getTime()}.json`, - ); - const linter = getLinter([ - `${process.env.AXLIBRARIES_HOME}/ws/qlint.q_`, - "-src", - uri.path, - "-out", - results, - ]); - linter.on("exit", () => { - fs.readFile(results, "utf8", (error, data) => { - if (error) { - reject(error); - } else { - try { - const parsed = JSON.parse(data); - resolve(parsed); - } catch (error) { - reject(error); - } - } - }); - }); - linter.on("error", (error) => reject(error)); + initBuildTools() + .then(() => { + const results = Path.join( + tmpdir(), + `kdb-qlint-${new Date().getTime()}.json`, + ); + const linter = getTool([ + `${process.env.AXLIBRARIES_HOME}/ws/qlint.q_`, + "-src", + uri.path, + "-out", + results, + "-quiet", + ]); + linter.on("exit", () => { + fs.readFile(results, "utf8", (error, data) => { + if (error) { + reject(error); + } else { + try { + const parsed = JSON.parse(data); + resolve(parsed); + } catch (error) { + reject(error); + } + } + }); + }); + linter.on("error", (error) => reject(error)); + }) + .catch(reject); }); } -function createDiagnosticFromResult(result: LinterResult) { - return new Diagnostic( - new Range( - result.startLine - 1, - result.startCol - 1, - result.endLine - 1, - result.endCol, - ), - result.description, - result.errorClass === LinterErrorClass.WARNING - ? DiagnosticSeverity.Warning - : result.errorClass === LinterErrorClass.ERROR - ? DiagnosticSeverity.Error - : result.errorClass === LinterErrorClass.INFO - ? DiagnosticSeverity.Information - : DiagnosticSeverity.Hint, - ); -} +const severity: { [key: string]: DiagnosticSeverity } = { + [LinterErrorClass.ERROR]: DiagnosticSeverity.Error, + [LinterErrorClass.WARNING]: DiagnosticSeverity.Warning, + [LinterErrorClass.INFO]: DiagnosticSeverity.Information, +}; -export async function lint(uri: Uri) { - if (!uri.path.endsWith(".q") && !uri.path.endsWith(".quke")) { - return; - } - await window.withProgress( +function lint(document: TextDocument) { + return window.withProgress( { title: "Linting", location: ProgressLocation.Window, cancellable: false }, async () => { - const results = await getLinterResults(uri); - ext.diagnosticCollection.set( - uri, - results.map(createDiagnosticFromResult), - ); + try { + return (await getLinterResults(document.uri)).map( + (result) => + new Diagnostic( + new Range( + result.startLine - 1, + result.startCol - 1, + result.endLine - 1, + result.endCol, + ), + `${result.label}: ${result.description}`, + severity[result.errorClass], + ), + ); + } catch (error) { + window.showErrorMessage(`Linting Failed ${error}`); + return []; + } }, ); } -export async function updateLintng(document: TextDocument) { - const linting = workspace - .getConfiguration("kdb", document) - .get("linting", false); +async function setDiagnostics(document: TextDocument) { + let diagnostics = cache.get(document.uri.path); + if (!diagnostics) { + diagnostics = lint(document); + cache.set(document.uri.path, diagnostics); + } + ext.diagnosticCollection.set(document.uri, await diagnostics); +} + +export async function lintCommand(document: TextDocument) { + if (isLintingSupported(document)) { + await setDiagnostics(document); + } +} - if (linting) { - await lint(document.uri); +export async function connectBuildTools() { + workspace.onDidSaveTextDocument(async (document) => { + if (isAutoLintingSupported(document)) { + await setDiagnostics(document); + } + }); + + workspace.onDidOpenTextDocument(async (document) => { + if (isAutoLintingSupported(document)) { + await setDiagnostics(document); + } + }); + + workspace.onDidCloseTextDocument((document) => { + if (isLintingSupported(document)) { + ext.diagnosticCollection.delete(document.uri); + } + }); + + workspace.onDidChangeTextDocument((event) => { + if (isLintingSupported(event.document)) { + if (event.contentChanges.length > 0) { + cache.delete(event.document.uri.path); + ext.diagnosticCollection.delete(event.document.uri); + } + } + }); + + if (window.activeTextEditor) { + const document = window.activeTextEditor.document; + if (isAutoLintingSupported(document)) { + await setDiagnostics(document); + } } } diff --git a/src/extension.ts b/src/extension.ts index 1e039f45..35f20060 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -87,7 +87,7 @@ import { import { runQFileTerminal } from "./utils/execution"; import AuthSettings from "./utils/secretStorage"; import { Telemetry } from "./utils/telemetryClient"; -import { lint, updateLintng } from "./commands/buildToolsCommand"; +import { connectBuildTools, lintCommand } from "./commands/buildToolsCommand"; import { CompletionProvider } from "./services/completionProvider"; let client: LanguageClient; @@ -317,24 +317,12 @@ export async function activate(context: ExtensionContext) { commands.registerCommand("kdb.qlint", async () => { const editor = window.activeTextEditor; if (editor) { - await lint(editor.document.uri); + await lintCommand(editor.document); } }), ext.diagnosticCollection, ); - workspace.onDidSaveTextDocument(updateLintng); - workspace.onDidOpenTextDocument(updateLintng); - workspace.onDidCloseTextDocument((document) => - ext.diagnosticCollection.delete(document.uri), - ); - workspace.onDidChangeTextDocument((event) => - ext.diagnosticCollection.delete(event.document.uri), - ); - if (window.activeTextEditor) { - updateLintng(window.activeTextEditor.document); - } - const lastResult: QueryResult | undefined = undefined; const resultSchema = "vscode-kdb-q"; const resultProvider = new (class implements TextDocumentContentProvider { @@ -385,6 +373,7 @@ export async function activate(context: ExtensionContext) { ); await client.start(); + await connectBuildTools(); Telemetry.sendEvent("Extension.Activated"); } From cc9cd5efc87792c7b8806419a7b017c571cb82f7 Mon Sep 17 00:00:00 2001 From: ecmel Date: Sat, 20 Apr 2024 17:13:38 +0300 Subject: [PATCH 04/25] fixes KXI-41892 --- package.json | 59 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 005e9f95..fc403bae 100644 --- a/package.json +++ b/package.json @@ -189,6 +189,7 @@ }, "commands": [ { + "category": "KX", "command": "kdb.refreshServerObjects", "title": "Refresh server objects", "icon": { @@ -197,130 +198,158 @@ } }, { + "category": "KX", "command": "kdb.startLocalProcess", "title": "Start q process" }, { + "category": "KX", "command": "kdb.stopLocalProcess", "title": "Stop q process" }, { + "category": "KX", "command": "kdb.addConnection", "title": "Add new connection" }, { + "category": "KX", "command": "kdb.removeConnection", "title": "Remove connection" }, { + "category": "KX", "command": "kdb.connect", "title": "Connect server" }, { + "category": "KX", "command": "kdb.addAuthentication", "title": "Add Authentication", "position": "end" }, { + "category": "KX", "command": "kdb.enableTLS", "title": "Enable TLS" }, { + "category": "KX", "command": "kdb.insightsConnect", "title": "Connect to Insights" }, { + "category": "KX", "command": "kdb.insightsRemove", "title": "Remove connection" }, { + "category": "KX", "command": "kdb.disconnect", "title": "Disconnect" }, { + "category": "KX", "command": "kdb.queryHistory.rerun", "title": "Rerun query" }, { + "category": "KX", "command": "kdb.queryHistory.clear", "title": "Clear query history" }, { + "category": "KX", "command": "kdb.dataSource.addDataSource", "title": "Add new DataSource" }, { + "category": "KX", "command": "kdb.dataSource.populateScratchpad", "title": "Populate a new scratchpad" }, { + "category": "KX", "command": "kdb.dataSource.saveDataSource", "title": "Save changes in the DataSource" }, { + "category": "KX", "command": "kdb.dataSource.runDataSource", "title": "Execute DataSource at Inisghts Instance" }, { + "category": "KX", "command": "kdb.dataSource.renameDataSource", "title": "Rename DataSource" }, { + "category": "KX", "command": "kdb.dataSource.deleteDataSource", "title": "Delete DataSource" }, { + "category": "KX", "command": "kdb.dataSource.openDataSource", "title": "Open DataSource" }, { + "category": "KX", "command": "kdb.resultsPanel.update", "title": "Update Results View" }, { + "category": "KX", "command": "kdb.resultsPanel.clear", "title": "Clear Results View" }, { + "category": "KX", "command": "kdb.resultsPanel.export.csv", "title": "Export to CSV" }, { + "category": "KX", "command": "kdb.terminal.run", "title": "Run q file in a new q instance", - "when": "kdb.QHOME || config.kdb.qHomeDirectory" + "icon": "$(run)" }, { + "category": "KX", "command": "kdb.terminal.start", - "title": "q: Start REPL" + "title": "Start REPL" }, { + "category": "KX", "command": "kdb.execute.selectedQuery", - "title": "Execute Current Selection", - "when": "kdb.connected" + "title": "Execute Current Selection" }, { + "category": "KX", "command": "kdb.execute.fileQuery", "title": "Execute Entire File", - "when": "kdb.connected" + "icon": "$(run)" }, { + "category": "KX", "command": "kdb.execute.pythonScratchpadQuery", - "title": "Execute Current Selection in Insights Scratchpad", - "when": "kdb.connected" + "title": "Execute Current Selection in Insights Scratchpad" }, { + "category": "KX", "command": "kdb.execute.pythonFileScratchpadQuery", "title": "Execute Entire File in Insights Scratchpad", - "when": "kdb.connected" + "icon": "$(run)" }, { + "category": "KX", "command": "kdb.execute.entireFile", "title": "Execute Entire File" }, { + "category": "KX", "command": "kdb.qlint", - "title": "q: Lint File" + "title": "Lint q source file" } ], "keybindings": [ @@ -594,20 +623,20 @@ "group": "dataSourceFiles" } ], - "editor/title": [ + "editor/title/run": [ { "command": "kdb.terminal.run", - "when": "resourceLangId == q && (kdb.QHOME || config.kdb.qHomeDirectory)", - "group": "navigation" + "group": "navigation@0", + "when": "resourceLangId == q && (kdb.QHOME || config.kdb.qHomeDirectory)" }, { "command": "kdb.execute.fileQuery", - "when": "resourceLangId == q && kdb.connected && editorFocus", - "group": "navigation" + "group": "navigation@0", + "when": "resourceLangId == q && kdb.connected && editorFocus" }, { "command": "kdb.execute.pythonFileScratchpadQuery", - "group": "navigation", + "group": "navigation@0", "when": "editorLangId == python && kdb.insightsConnected" } ], From 6ca09eef461da4ae7006a5c2b4535d20ca8795f8 Mon Sep 17 00:00:00 2001 From: ecmel Date: Sat, 20 Apr 2024 19:43:42 +0300 Subject: [PATCH 05/25] added option to disable qlint warnings --- src/commands/buildToolsCommand.ts | 25 ++++++++-------- src/extension.ts | 5 ++++ src/services/quickFixProvider.ts | 50 +++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 12 deletions(-) create mode 100644 src/services/quickFixProvider.ts diff --git a/src/commands/buildToolsCommand.ts b/src/commands/buildToolsCommand.ts index fc99c730..47f75be7 100644 --- a/src/commands/buildToolsCommand.ts +++ b/src/commands/buildToolsCommand.ts @@ -139,19 +139,20 @@ function lint(document: TextDocument) { { title: "Linting", location: ProgressLocation.Window, cancellable: false }, async () => { try { - return (await getLinterResults(document.uri)).map( - (result) => - new Diagnostic( - new Range( - result.startLine - 1, - result.startCol - 1, - result.endLine - 1, - result.endCol, - ), - `${result.label}: ${result.description}`, - severity[result.errorClass], + return (await getLinterResults(document.uri)).map((result) => { + const diagnostic = new Diagnostic( + new Range( + result.startLine - 1, + result.startCol - 1, + result.endLine - 1, + result.endCol, ), - ); + result.description, + severity[result.errorClass], + ); + diagnostic.code = result.label; + return diagnostic; + }); } catch (error) { window.showErrorMessage(`Linting Failed ${error}`); return []; diff --git a/src/extension.ts b/src/extension.ts index 35f20060..321654dc 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -89,6 +89,7 @@ import AuthSettings from "./utils/secretStorage"; import { Telemetry } from "./utils/telemetryClient"; import { connectBuildTools, lintCommand } from "./commands/buildToolsCommand"; import { CompletionProvider } from "./services/completionProvider"; +import { QuickFixProvider } from "./services/quickFixProvider"; let client: LanguageClient; @@ -320,6 +321,10 @@ export async function activate(context: ExtensionContext) { await lintCommand(editor.document); } }), + languages.registerCodeActionsProvider( + { language: "q" }, + new QuickFixProvider(), + ), ext.diagnosticCollection, ); diff --git a/src/services/quickFixProvider.ts b/src/services/quickFixProvider.ts new file mode 100644 index 00000000..61635096 --- /dev/null +++ b/src/services/quickFixProvider.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1998-2023 Kx Systems Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +import { + CodeAction, + CodeActionKind, + CodeActionProvider, + Command, + Position, + ProviderResult, + Range, + TextDocument, + WorkspaceEdit, +} from "vscode"; +import { ext } from "../extensionVariables"; + +export class QuickFixProvider implements CodeActionProvider { + provideCodeActions( + document: TextDocument, + range: Range, + ): ProviderResult<(CodeAction | Command)[]> { + const action = new CodeAction( + "Disable qlint warning", + CodeActionKind.QuickFix, + ); + const diagnostics = ext.diagnosticCollection.get(document.uri) || []; + const diagnostic = diagnostics.find((item) => item.range.isEqual(range)); + + if (diagnostic) { + action.diagnostics = [diagnostic]; + action.edit = new WorkspaceEdit(); + action.edit.insert( + document.uri, + new Position(range.start.line, 0), + `// @qlintsuppress ${diagnostic.code}\n`, + ); + return [action]; + } + } +} From c88f4ef5da4f7cbc836ae1f3a1bc83f68adcb80b Mon Sep 17 00:00:00 2001 From: ecmel Date: Sat, 20 Apr 2024 20:17:24 +0300 Subject: [PATCH 06/25] updated quickfix --- src/commands/buildToolsCommand.ts | 1 + src/services/quickFixProvider.ts | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/commands/buildToolsCommand.ts b/src/commands/buildToolsCommand.ts index 47f75be7..4d71500e 100644 --- a/src/commands/buildToolsCommand.ts +++ b/src/commands/buildToolsCommand.ts @@ -150,6 +150,7 @@ function lint(document: TextDocument) { result.description, severity[result.errorClass], ); + diagnostic.source = "qlint"; diagnostic.code = result.label; return diagnostic; }); diff --git a/src/services/quickFixProvider.ts b/src/services/quickFixProvider.ts index 61635096..d7c41b15 100644 --- a/src/services/quickFixProvider.ts +++ b/src/services/quickFixProvider.ts @@ -29,20 +29,21 @@ export class QuickFixProvider implements CodeActionProvider { document: TextDocument, range: Range, ): ProviderResult<(CodeAction | Command)[]> { - const action = new CodeAction( - "Disable qlint warning", - CodeActionKind.QuickFix, - ); const diagnostics = ext.diagnosticCollection.get(document.uri) || []; - const diagnostic = diagnostics.find((item) => item.range.isEqual(range)); - + const diagnostic = diagnostics.find( + (item) => item.source === "qlint" && item.range.isEqual(range), + ); if (diagnostic) { + const action = new CodeAction( + `Suppress ${diagnostic.code}`, + CodeActionKind.QuickFix, + ); action.diagnostics = [diagnostic]; action.edit = new WorkspaceEdit(); action.edit.insert( document.uri, new Position(range.start.line, 0), - `// @qlintsuppress ${diagnostic.code}\n`, + `// @qlintsuppress ${diagnostic.code}(1)\n`, ); return [action]; } From 54edd6e0bf72c1cb2b3cd2d1f5800c007151a71d Mon Sep 17 00:00:00 2001 From: ecmel Date: Tue, 23 Apr 2024 21:38:34 +0300 Subject: [PATCH 07/25] fixes KXI-36339 --- package.json | 23 +- server/src/parser/index.ts | 1 - server/src/parser/keywords.ts | 3 +- server/src/parser/lexer.ts | 6 +- server/src/parser/literals.ts | 2 +- server/src/parser/parser.ts | 294 +++++++++-------------- server/src/parser/tokens.ts | 38 +-- server/src/parser/types.d.ts | 319 ------------------------ server/src/parser/visitor.ts | 386 ------------------------------ server/src/qLangServer.ts | 268 +++++++++++++-------- src/commands/buildToolsCommand.ts | 110 ++++++--- src/services/quickFixProvider.ts | 25 +- 12 files changed, 421 insertions(+), 1054 deletions(-) delete mode 100644 server/src/parser/types.d.ts delete mode 100644 server/src/parser/visitor.ts diff --git a/package.json b/package.json index fc403bae..33b93927 100644 --- a/package.json +++ b/package.json @@ -312,7 +312,8 @@ "category": "KX", "command": "kdb.terminal.run", "title": "Run q file in a new q instance", - "icon": "$(run)" + "icon": "$(run)", + "enablement": "(kdb.QHOME || config.kdb.qHomeDirectory)" }, { "category": "KX", @@ -328,7 +329,8 @@ "category": "KX", "command": "kdb.execute.fileQuery", "title": "Execute Entire File", - "icon": "$(run)" + "icon": "$(run)", + "enablement": "kdb.connected && editorFocus" }, { "category": "KX", @@ -339,7 +341,8 @@ "category": "KX", "command": "kdb.execute.pythonFileScratchpadQuery", "title": "Execute Entire File in Insights Scratchpad", - "icon": "$(run)" + "icon": "$(run)", + "enablement": "kdb.insightsConnected" }, { "category": "KX", @@ -625,18 +628,18 @@ ], "editor/title/run": [ { - "command": "kdb.terminal.run", - "group": "navigation@0", - "when": "resourceLangId == q && (kdb.QHOME || config.kdb.qHomeDirectory)" + "command": "kdb.execute.fileQuery", + "group": "q@0", + "when": "resourceLangId == q" }, { - "command": "kdb.execute.fileQuery", - "group": "navigation@0", - "when": "resourceLangId == q && kdb.connected && editorFocus" + "command": "kdb.terminal.run", + "group": "q@1", + "when": "resourceLangId == q" }, { "command": "kdb.execute.pythonFileScratchpadQuery", - "group": "navigation@0", + "group": "q@0", "when": "editorLangId == python && kdb.insightsConnected" } ], diff --git a/server/src/parser/index.ts b/server/src/parser/index.ts index 309bff9b..fbd30e57 100644 --- a/server/src/parser/index.ts +++ b/server/src/parser/index.ts @@ -17,4 +17,3 @@ export * from "./lexer"; export * from "./literals"; export * from "./parser"; export * from "./tokens"; -export * from "./visitor"; diff --git a/server/src/parser/keywords.ts b/server/src/parser/keywords.ts index c4d0ae7d..8c5863e4 100644 --- a/server/src/parser/keywords.ts +++ b/server/src/parser/keywords.ts @@ -13,8 +13,7 @@ import { createToken } from "chevrotain"; -export const IdentifierPattern = - /(?:(?:\.[a-zA-Z_0-9]+)+|[a-zA-Z][a-zA-Z_0-9]*)/; +export const IdentifierPattern = /\.?[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z0-9_]+)*/; export const Identifier = createToken({ name: "Identifier", diff --git a/server/src/parser/lexer.ts b/server/src/parser/lexer.ts index 9154a05e..26f0c9dd 100644 --- a/server/src/parser/lexer.ts +++ b/server/src/parser/lexer.ts @@ -31,6 +31,8 @@ import { BlockComment, Colon, Command, + Comparator, + DoubleColon, Iterator, LastComment, LBracket, @@ -67,11 +69,13 @@ export const QTokens = [ Keyword, Reserved, Identifier, - SemiColon, WhiteSpace, Iterator, + DoubleColon, Operator, + Comparator, Colon, + SemiColon, LParen, RParen, LBracket, diff --git a/server/src/parser/literals.ts b/server/src/parser/literals.ts index 77849e39..1547ad19 100644 --- a/server/src/parser/literals.ts +++ b/server/src/parser/literals.ts @@ -15,7 +15,7 @@ import { createToken } from "chevrotain"; export const CharLiteral = createToken({ name: "CharLiteral", - pattern: /"(?:\\.|(?:(?!\r?\n\S)[^"]))*"/, + pattern: /"(?:\\.|[^"])*"/, }); export const SymbolLiteral = createToken({ diff --git a/server/src/parser/parser.ts b/server/src/parser/parser.ts index ba7c869d..5aedc3e5 100644 --- a/server/src/parser/parser.ts +++ b/server/src/parser/parser.ts @@ -11,201 +11,131 @@ * specific language governing permissions and limitations under the License. */ -import { CstParser } from "chevrotain"; -import { QLexer, QTokens } from "./lexer"; -import { - BinaryLiteral, - ByteLiteral, - CharLiteral, - DateLiteral, - DateTimeLiteral, - FileLiteral, - InfinityLiteral, - MonthLiteral, - NumberLiteral, - SymbolLiteral, - TimeLiteral, - TimeStampLiteral, -} from "./literals"; +import { IToken } from "chevrotain"; +import { QLexer } from "./lexer"; import { Colon, Command, - Iterator, + DoubleColon, LBracket, LCurly, LParen, - Operator, RBracket, RCurly, RParen, - SemiColon, } from "./tokens"; -import { RSql, Identifier, Keyword, LSql, Reserved } from "./keywords"; - -class Parser extends CstParser { - constructor() { - super(QTokens, { maxLookahead: 3 }); - this.performSelfAnalysis(); - } - - public script = this.RULE("script", () => { - this.MANY(() => this.SUBRULE(this.expression)); - }); - - private expression = this.RULE("expression", () => { - this.OR([ - { ALT: () => this.SUBRULE(this.iterator) }, - { ALT: () => this.SUBRULE(this.assignment) }, - { ALT: () => this.SUBRULE(this.group) }, - { ALT: () => this.SUBRULE(this.lambda) }, - { ALT: () => this.SUBRULE(this.bracket) }, - { ALT: () => this.SUBRULE(this.sql) }, - { ALT: () => this.SUBRULE(this.symbol) }, - { ALT: () => this.SUBRULE(this.command) }, - { ALT: () => this.SUBRULE(this.operator) }, - { ALT: () => this.SUBRULE(this.semiColon) }, - ]); - }); - - private iterator = this.RULE("iterator", () => { - this.CONSUME(Iterator); - }); - - private assignment = this.RULE("assignment", () => { - this.OPTION(() => this.SUBRULE(this.operator)); - this.AT_LEAST_ONE(() => this.CONSUME(Colon)); - this.OPTION1(() => this.SUBRULE(this.expression)); - }); - - private group = this.RULE("group", () => { - this.CONSUME(LParen); - this.OPTION(() => this.SUBRULE(this.bracket)); - this.MANY(() => this.SUBRULE(this.expression)); - this.CONSUME(RParen); - }); - - private lambda = this.RULE("lambda", () => { - this.CONSUME(LCurly); - this.OPTION(() => this.SUBRULE(this.bracket)); - this.MANY(() => this.SUBRULE(this.expression)); - this.CONSUME(RCurly); - }); - - private bracket = this.RULE("bracket", () => { - this.CONSUME(LBracket); - this.MANY(() => this.SUBRULE(this.expression)); - this.CONSUME(RBracket); - }); - - private sql = this.RULE("sql", () => { - this.CONSUME(LSql); - this.MANY(() => this.SUBRULE(this.expression)); - this.CONSUME(RSql); - }); - - private symbol = this.RULE("symbol", () => { - this.OR([ - { ALT: () => this.SUBRULE(this.literal) }, - { ALT: () => this.SUBRULE(this.reserved) }, - { ALT: () => this.SUBRULE(this.keyword) }, - { ALT: () => this.SUBRULE(this.identifier) }, - ]); - }); - - private literal = this.RULE("literal", () => { - this.OR([ - { ALT: () => this.SUBRULE(this.charLiteral) }, - { ALT: () => this.SUBRULE(this.symbolLiteral) }, - { ALT: () => this.SUBRULE(this.dateTimeLiteral) }, - { ALT: () => this.SUBRULE(this.timeStampLiteral) }, - { ALT: () => this.SUBRULE(this.dateLiteral) }, - { ALT: () => this.SUBRULE(this.monthLiteral) }, - { ALT: () => this.SUBRULE(this.timeLiteral) }, - { ALT: () => this.SUBRULE(this.fileLiteral) }, - { ALT: () => this.SUBRULE(this.infinityLiteral) }, - { ALT: () => this.SUBRULE(this.binaryLiteral) }, - { ALT: () => this.SUBRULE(this.byteLiteral) }, - { ALT: () => this.SUBRULE(this.numberLiteral) }, - ]); - }); - - private charLiteral = this.RULE("charLiteral", () => { - this.CONSUME(CharLiteral); - }); - - private symbolLiteral = this.RULE("symbolLiteral", () => { - this.CONSUME(SymbolLiteral); - }); - - private dateTimeLiteral = this.RULE("dateTimeLiteral", () => { - this.CONSUME(DateTimeLiteral); - }); - - private timeStampLiteral = this.RULE("timeStampLiteral", () => { - this.CONSUME(TimeStampLiteral); - }); +import { Identifier, LSql, RSql } from "./keywords"; - private dateLiteral = this.RULE("dateLiteral", () => { - this.CONSUME(DateLiteral); - }); - - private monthLiteral = this.RULE("monthLiteral", () => { - this.CONSUME(MonthLiteral); - }); - - private timeLiteral = this.RULE("timeLiteral", () => { - this.CONSUME(TimeLiteral); - }); - - private fileLiteral = this.RULE("fileLiteral", () => { - this.CONSUME(FileLiteral); - }); - - private infinityLiteral = this.RULE("infinityLiteral", () => { - this.CONSUME(InfinityLiteral); - }); - - private binaryLiteral = this.RULE("binaryLiteral", () => { - this.CONSUME(BinaryLiteral); - }); - - private byteLiteral = this.RULE("byteLiteral", () => { - this.CONSUME(ByteLiteral); - }); - - private numberLiteral = this.RULE("numberLiteral", () => { - this.CONSUME(NumberLiteral); - }); - - private reserved = this.RULE("reserved", () => { - this.CONSUME(Reserved); - }); - - private keyword = this.RULE("keyword", () => { - this.CONSUME(Keyword); - }); - - private identifier = this.RULE("identifier", () => { - this.CONSUME(Identifier); - }); - - private command = this.RULE("command", () => { - this.CONSUME(Command); - }); +function setQualified(token: Token, namespace: string) { + token.identifier = + token.scope || !namespace ? token.image : `${namespace}.${token.image}`; +} - private operator = this.RULE("operator", () => { - this.CONSUME(Operator); - }); +export const enum TokenKind { + Identifier, + Assignment, +} - private semiColon = this.RULE("semiColon", () => { - this.CONSUME(SemiColon); - }); +export interface Token extends IToken { + kind?: TokenKind; + scope?: Token; + lambda?: Token; + argument?: boolean; + identifier?: string; +} - public parse(script: string) { - const lexed = QLexer.tokenize(script); - this.input = lexed.tokens; - return this.script(); +export function parse(text: string): Token[] { + const result = QLexer.tokenize(text); + const tokens = result.tokens as Token[]; + const scopes: Token[] = []; + + let namespace = ""; + let sql = 0; + let table = 0; + let argument = 0; + let token, prev, next: IToken; + + for (let i = 0; i < tokens.length; i++) { + token = tokens[i]; + switch (token.tokenType) { + case Identifier: + if (argument) { + token.kind = TokenKind.Assignment; + token.argument = true; + token.scope = scopes[scopes.length - 1]; + token.identifier = token.image; + } else { + token.kind = TokenKind.Identifier; + if (!token.image.includes(".")) { + token.scope = scopes[scopes.length - 1]; + } + setQualified(token, namespace); + } + break; + case Colon: + case DoubleColon: + if (!sql && !table) { + prev = tokens[i - 1]; + if (prev?.kind === TokenKind.Identifier) { + prev.kind = TokenKind.Assignment; + if (token.tokenType === DoubleColon) { + prev.scope = undefined; + } + setQualified(prev, namespace); + } + } + break; + case LCurly: + prev = tokens[i - 2]; + if (prev?.kind === TokenKind.Assignment) { + prev.lambda = token; + } + next = tokens[i + 1]; + if (next?.tokenType === LBracket) { + argument++; + } + scopes.push(token); + break; + case RBracket: + if (argument) { + argument--; + } + break; + case RCurly: + scopes.pop(); + break; + case LSql: + sql++; + break; + case RSql: + sql--; + break; + case LParen: + if (table) { + table++; + } + next = tokens[i + 1]; + if (next?.tokenType === LBracket) { + table++; + } + break; + case RParen: + if (table) { + table--; + } + break; + case Command: + const [cmd, arg] = token.image.split(/\s+/, 2); + switch (cmd) { + case "\\d": + if (arg) { + namespace = arg === "." ? "" : arg; + } + break; + } + break; + } } -} -export const QParser = new Parser(); + return tokens; +} diff --git a/server/src/parser/tokens.ts b/server/src/parser/tokens.ts index e176bbce..2beb848e 100644 --- a/server/src/parser/tokens.ts +++ b/server/src/parser/tokens.ts @@ -13,6 +13,12 @@ import { Lexer, createToken } from "chevrotain"; +export const WhiteSpace = createToken({ + name: "WhiteSpace", + pattern: /\s+/, + group: Lexer.SKIPPED, +}); + export const BlockComment = createToken({ name: "BlockComment", pattern: /(??!#@$&~|%*+-]/, + pattern: /[_,.'^?!#@$&|%*+-]/, +}); + +export const Comparator = createToken({ + name: "Comparator", + pattern: /[~<=>]/, }); export const Colon = createToken({ @@ -67,6 +70,11 @@ export const Colon = createToken({ pattern: /:/, }); +export const SemiColon = createToken({ + name: "SemiColon", + pattern: /;/, +}); + export const LParen = createToken({ name: "LParen", pattern: /\(/, diff --git a/server/src/parser/types.d.ts b/server/src/parser/types.d.ts deleted file mode 100644 index 6b50715c..00000000 --- a/server/src/parser/types.d.ts +++ /dev/null @@ -1,319 +0,0 @@ -import type { CstNode, ICstVisitor, IToken } from "chevrotain"; - -export interface ScriptCstNode extends CstNode { - name: "script"; - children: ScriptCstChildren; -} - -export type ScriptCstChildren = { - expression?: ExpressionCstNode[]; -}; - -export interface ExpressionCstNode extends CstNode { - name: "expression"; - children: ExpressionCstChildren; -} - -export type ExpressionCstChildren = { - iterator?: IteratorCstNode[]; - assignment?: AssignmentCstNode[]; - group?: GroupCstNode[]; - lambda?: LambdaCstNode[]; - bracket?: BracketCstNode[]; - sql?: SqlCstNode[]; - symbol?: SymbolCstNode[]; - command?: CommandCstNode[]; - operator?: OperatorCstNode[]; - semiColon?: SemiColonCstNode[]; -}; - -export interface IteratorCstNode extends CstNode { - name: "iterator"; - children: IteratorCstChildren; -} - -export type IteratorCstChildren = { - Iterator: IToken[]; -}; - -export interface AssignmentCstNode extends CstNode { - name: "assignment"; - children: AssignmentCstChildren; -} - -export type AssignmentCstChildren = { - operator?: OperatorCstNode[]; - Colon: IToken[]; - expression?: ExpressionCstNode[]; -}; - -export interface GroupCstNode extends CstNode { - name: "group"; - children: GroupCstChildren; -} - -export type GroupCstChildren = { - LParen: IToken[]; - bracket?: BracketCstNode[]; - expression?: ExpressionCstNode[]; - RParen: IToken[]; -}; - -export interface LambdaCstNode extends CstNode { - name: "lambda"; - children: LambdaCstChildren; -} - -export type LambdaCstChildren = { - LCurly: IToken[]; - bracket?: BracketCstNode[]; - expression?: ExpressionCstNode[]; - RCurly: IToken[]; -}; - -export interface BracketCstNode extends CstNode { - name: "bracket"; - children: BracketCstChildren; -} - -export type BracketCstChildren = { - LBracket: IToken[]; - expression?: ExpressionCstNode[]; - RBracket: IToken[]; -}; - -export interface SqlCstNode extends CstNode { - name: "sql"; - children: SqlCstChildren; -} - -export type SqlCstChildren = { - LSql: IToken[]; - expression?: ExpressionCstNode[]; - RSql: IToken[]; -}; - -export interface SymbolCstNode extends CstNode { - name: "symbol"; - children: SymbolCstChildren; -} - -export type SymbolCstChildren = { - literal?: LiteralCstNode[]; - reserved?: ReservedCstNode[]; - keyword?: KeywordCstNode[]; - identifier?: IdentifierCstNode[]; -}; - -export interface LiteralCstNode extends CstNode { - name: "literal"; - children: LiteralCstChildren; -} - -export type LiteralCstChildren = { - charLiteral?: CharLiteralCstNode[]; - symbolLiteral?: SymbolLiteralCstNode[]; - dateTimeLiteral?: DateTimeLiteralCstNode[]; - timeStampLiteral?: TimeStampLiteralCstNode[]; - dateLiteral?: DateLiteralCstNode[]; - monthLiteral?: MonthLiteralCstNode[]; - timeLiteral?: TimeLiteralCstNode[]; - fileLiteral?: FileLiteralCstNode[]; - infinityLiteral?: InfinityLiteralCstNode[]; - binaryLiteral?: BinaryLiteralCstNode[]; - byteLiteral?: ByteLiteralCstNode[]; - numberLiteral?: NumberLiteralCstNode[]; -}; - -export interface CharLiteralCstNode extends CstNode { - name: "charLiteral"; - children: CharLiteralCstChildren; -} - -export type CharLiteralCstChildren = { - CharLiteral: IToken[]; -}; - -export interface SymbolLiteralCstNode extends CstNode { - name: "symbolLiteral"; - children: SymbolLiteralCstChildren; -} - -export type SymbolLiteralCstChildren = { - SymbolLiteral: IToken[]; -}; - -export interface DateTimeLiteralCstNode extends CstNode { - name: "dateTimeLiteral"; - children: DateTimeLiteralCstChildren; -} - -export type DateTimeLiteralCstChildren = { - DateTimeLiteral: IToken[]; -}; - -export interface TimeStampLiteralCstNode extends CstNode { - name: "timeStampLiteral"; - children: TimeStampLiteralCstChildren; -} - -export type TimeStampLiteralCstChildren = { - TimeStampLiteral: IToken[]; -}; - -export interface DateLiteralCstNode extends CstNode { - name: "dateLiteral"; - children: DateLiteralCstChildren; -} - -export type DateLiteralCstChildren = { - DateLiteral: IToken[]; -}; - -export interface MonthLiteralCstNode extends CstNode { - name: "monthLiteral"; - children: MonthLiteralCstChildren; -} - -export type MonthLiteralCstChildren = { - MonthLiteral: IToken[]; -}; - -export interface TimeLiteralCstNode extends CstNode { - name: "timeLiteral"; - children: TimeLiteralCstChildren; -} - -export type TimeLiteralCstChildren = { - TimeLiteral: IToken[]; -}; - -export interface FileLiteralCstNode extends CstNode { - name: "fileLiteral"; - children: FileLiteralCstChildren; -} - -export type FileLiteralCstChildren = { - FileLiteral: IToken[]; -}; - -export interface InfinityLiteralCstNode extends CstNode { - name: "infinityLiteral"; - children: InfinityLiteralCstChildren; -} - -export type InfinityLiteralCstChildren = { - InfinityLiteral: IToken[]; -}; - -export interface BinaryLiteralCstNode extends CstNode { - name: "binaryLiteral"; - children: BinaryLiteralCstChildren; -} - -export type BinaryLiteralCstChildren = { - BinaryLiteral: IToken[]; -}; - -export interface ByteLiteralCstNode extends CstNode { - name: "byteLiteral"; - children: ByteLiteralCstChildren; -} - -export type ByteLiteralCstChildren = { - ByteLiteral: IToken[]; -}; - -export interface NumberLiteralCstNode extends CstNode { - name: "numberLiteral"; - children: NumberLiteralCstChildren; -} - -export type NumberLiteralCstChildren = { - NumberLiteral: IToken[]; -}; - -export interface ReservedCstNode extends CstNode { - name: "reserved"; - children: ReservedCstChildren; -} - -export type ReservedCstChildren = { - Reserved: IToken[]; -}; - -export interface KeywordCstNode extends CstNode { - name: "keyword"; - children: KeywordCstChildren; -} - -export type KeywordCstChildren = { - Keyword: IToken[]; -}; - -export interface IdentifierCstNode extends CstNode { - name: "identifier"; - children: IdentifierCstChildren; -} - -export type IdentifierCstChildren = { - Identifier: IToken[]; -}; - -export interface CommandCstNode extends CstNode { - name: "command"; - children: CommandCstChildren; -} - -export type CommandCstChildren = { - Command: IToken[]; -}; - -export interface OperatorCstNode extends CstNode { - name: "operator"; - children: OperatorCstChildren; -} - -export type OperatorCstChildren = { - Operator: IToken[]; -}; - -export interface SemiColonCstNode extends CstNode { - name: "semiColon"; - children: SemiColonCstChildren; -} - -export type SemiColonCstChildren = { - SemiColon: IToken[]; -}; - -export interface ICstNodeVisitor extends ICstVisitor { - script(children: ScriptCstChildren, param?: IN): OUT; - expression(children: ExpressionCstChildren, param?: IN): OUT; - iterator(children: IteratorCstChildren, param?: IN): OUT; - assignment(children: AssignmentCstChildren, param?: IN): OUT; - group(children: GroupCstChildren, param?: IN): OUT; - lambda(children: LambdaCstChildren, param?: IN): OUT; - bracket(children: BracketCstChildren, param?: IN): OUT; - sql(children: SqlCstChildren, param?: IN): OUT; - symbol(children: SymbolCstChildren, param?: IN): OUT; - literal(children: LiteralCstChildren, param?: IN): OUT; - charLiteral(children: CharLiteralCstChildren, param?: IN): OUT; - symbolLiteral(children: SymbolLiteralCstChildren, param?: IN): OUT; - dateTimeLiteral(children: DateTimeLiteralCstChildren, param?: IN): OUT; - timeStampLiteral(children: TimeStampLiteralCstChildren, param?: IN): OUT; - dateLiteral(children: DateLiteralCstChildren, param?: IN): OUT; - monthLiteral(children: MonthLiteralCstChildren, param?: IN): OUT; - timeLiteral(children: TimeLiteralCstChildren, param?: IN): OUT; - fileLiteral(children: FileLiteralCstChildren, param?: IN): OUT; - infinityLiteral(children: InfinityLiteralCstChildren, param?: IN): OUT; - binaryLiteral(children: BinaryLiteralCstChildren, param?: IN): OUT; - byteLiteral(children: ByteLiteralCstChildren, param?: IN): OUT; - numberLiteral(children: NumberLiteralCstChildren, param?: IN): OUT; - reserved(children: ReservedCstChildren, param?: IN): OUT; - keyword(children: KeywordCstChildren, param?: IN): OUT; - identifier(children: IdentifierCstChildren, param?: IN): OUT; - command(children: CommandCstChildren, param?: IN): OUT; - operator(children: OperatorCstChildren, param?: IN): OUT; - semiColon(children: SemiColonCstChildren, param?: IN): OUT; -} diff --git a/server/src/parser/visitor.ts b/server/src/parser/visitor.ts deleted file mode 100644 index 3e90b453..00000000 --- a/server/src/parser/visitor.ts +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import type { - AssignmentCstChildren, - BinaryLiteralCstChildren, - BracketCstChildren, - ByteLiteralCstChildren, - CharLiteralCstChildren, - CommandCstChildren, - DateLiteralCstChildren, - DateTimeLiteralCstChildren, - ExpressionCstChildren, - FileLiteralCstChildren, - GroupCstChildren, - ICstNodeVisitor, - IdentifierCstChildren, - InfinityLiteralCstChildren, - IteratorCstChildren, - KeywordCstChildren, - LambdaCstChildren, - LiteralCstChildren, - MonthLiteralCstChildren, - NumberLiteralCstChildren, - OperatorCstChildren, - ReservedCstChildren, - ScriptCstChildren, - SemiColonCstChildren, - SqlCstChildren, - SymbolCstChildren, - SymbolLiteralCstChildren, - TimeLiteralCstChildren, - TimeStampLiteralCstChildren, -} from "./types"; -import { CstNode, IToken } from "chevrotain"; -import { QParser } from "./parser"; - -const BaseQVisitor = QParser.getBaseCstVisitorConstructorWithDefaults(); - -class QVisitor extends BaseQVisitor implements ICstNodeVisitor { - private tokens: Token[] = []; - private scopes: Token[] = []; - private assigns: Token[] = []; - private statement = 0; - - constructor() { - super(); - this.validateVisitor(); - } - - ast(): QAst { - return { - script: this.tokens, - assign: this.assigns, - }; - } - - private consume(ctx: IToken & Partial) { - const token = { - type: ctx.type || TokenType.LITERAL, - name: ctx.tokenType.name, - image: ctx.image, - startOffset: ctx.startOffset, - endOffset: (ctx.endOffset || ctx.startOffset) + 1, - statement: this.statement, - scope: this.scopes[this.scopes.length - 1], - }; - this.tokens.push(token); - return token; - } - - private push(ctx: IToken & Partial) { - const token = this.consume(ctx); - this.scopes.push(token); - return token; - } - - private pop() { - return this.scopes.pop(); - } - - private scoped(delta = 0) { - let c = this.tokens.length - 1; - const anchor = this.tokens[c].scope; - while (anchor && c > 0) { - c--; - if (this.tokens[c] === anchor) { - break; - } - } - return c + delta; - } - - private peek( - type: TokenType[], - skip: TokenType[] = [], - count = 1, - scope = true, - ) { - let c = this.tokens.length - 1; - const anchor = this.tokens[c]; - let current: Token; - while (count > 0 && c > 0) { - c--; - current = this.tokens[c]; - if (current.statement !== anchor.statement) { - break; - } - if (scope && current.scope !== anchor.scope) { - continue; - } - if (skip.indexOf(current.type) >= 0) { - continue; - } - if (type.indexOf(current.type) >= 0) { - return current; - } - count--; - } - return undefined; - } - - private assign(token: Token, tag?: string) { - token.tag = tag; - this.assigns.push(token); - } - - script(ctx: ScriptCstChildren) { - ctx.expression?.forEach((rule) => this.visit(rule)); - } - - expression(ctx: ExpressionCstChildren) { - ctx.assignment?.forEach((rule) => this.visit(rule)); - ctx.bracket?.forEach((rule) => this.visit(rule)); - ctx.command?.forEach((rule) => this.visit(rule)); - ctx.group?.forEach((rule) => this.visit(rule)); - ctx.iterator?.forEach((rule) => this.visit(rule)); - ctx.lambda?.forEach((rule) => this.visit(rule)); - ctx.operator?.forEach((rule) => this.visit(rule)); - ctx.semiColon?.forEach((rule) => this.visit(rule)); - ctx.sql?.forEach((rule) => this.visit(rule)); - ctx.symbol?.forEach((rule) => this.visit(rule)); - } - - semiColon(ctx: SemiColonCstChildren) { - this.consume({ ...ctx.SemiColon[0], type: TokenType.SEMICOLON }); - this.statement++; - } - - sql(ctx: SqlCstChildren) { - this.push({ ...ctx.LSql[0], type: TokenType.SQL }); - ctx.expression?.forEach((rule) => this.visit(rule)); - this.pop(); - } - - bracket(ctx: BracketCstChildren) { - this.push({ ...ctx.LBracket[0], type: TokenType.BRACKET }); - ctx.expression?.forEach((rule) => this.visit(rule)); - this.pop(); - } - - group(ctx: GroupCstChildren) { - const type = ctx.bracket ? TokenType.TABLE : TokenType.GROUP; - this.push({ ...ctx.LParen[0], type }); - ctx.bracket?.forEach((rule) => this.visit(rule)); - ctx.expression?.forEach((rule) => this.visit(rule)); - this.pop(); - } - - lambda(ctx: LambdaCstChildren) { - this.push({ ...ctx.LCurly[0], type: TokenType.LAMBDA }); - if (ctx.bracket) { - this.visit(ctx.bracket); - for (let i = this.scoped(); i < this.tokens.length; i++) { - const token = this.tokens[i]; - if (token.type === TokenType.IDENTIFIER) { - this.assign(token, "ARGUMENT"); - } - } - } - ctx.expression?.forEach((rule) => this.visit(rule)); - this.pop(); - } - - assignment(ctx: AssignmentCstChildren) { - ctx.operator?.forEach((rule) => this.visit(rule)); - const assignment = this.consume({ - ...ctx.Colon[0], - type: TokenType.ASSIGN, - }); - let symbol = this.peek(SymbolTypes, [ - TokenType.OPERATOR, - TokenType.BRACKET, - ]); - if (ctx.expression) { - this.visit(ctx.expression); - if (ctx.operator && ctx.expression[0].children.bracket) { - symbol = this.tokens[this.scoped(1)]; - } else { - if (ctx.expression[0].children.semiColon) { - symbol = undefined; - } - } - } else { - symbol = undefined; - } - if (symbol) { - if (!scope(assignment, NoAssignTypes)) { - if (ctx.Colon.length > 1) { - const local = this.assigns.find( - (token) => - token.type === TokenType.IDENTIFIER && - token.image === symbol?.image && - scope(token) === scope(assignment), - ); - if (!local) { - symbol.scope = undefined; - } - } - this.assign(symbol, "ASSIGNED"); - } - } - } - - symbol(ctx: SymbolCstChildren) { - ctx.literal?.forEach((rule) => this.visit(rule)); - ctx.reserved?.forEach((rule) => this.visit(rule)); - ctx.keyword?.forEach((rule) => this.visit(rule)); - ctx.identifier?.forEach((rule) => this.visit(rule)); - } - - literal(ctx: LiteralCstChildren) { - ctx.binaryLiteral?.forEach((rule) => this.visit(rule)); - ctx.byteLiteral?.forEach((rule) => this.visit(rule)); - ctx.charLiteral?.forEach((rule) => this.visit(rule)); - ctx.dateLiteral?.forEach((rule) => this.visit(rule)); - ctx.dateTimeLiteral?.forEach((rule) => this.visit(rule)); - ctx.fileLiteral?.forEach((rule) => this.visit(rule)); - ctx.infinityLiteral?.forEach((rule) => this.visit(rule)); - ctx.monthLiteral?.forEach((rule) => this.visit(rule)); - ctx.numberLiteral?.forEach((rule) => this.visit(rule)); - ctx.symbolLiteral?.forEach((rule) => this.visit(rule)); - ctx.timeStampLiteral?.forEach((rule) => this.visit(rule)); - } - - binaryLiteral(ctx: BinaryLiteralCstChildren) { - this.consume({ ...ctx.BinaryLiteral[0], type: TokenType.LITERAL }); - } - - byteLiteral(ctx: ByteLiteralCstChildren) { - this.consume({ ...ctx.ByteLiteral[0], type: TokenType.LITERAL }); - } - - charLiteral(ctx: CharLiteralCstChildren) { - this.consume({ ...ctx.CharLiteral[0], type: TokenType.LITERAL }); - } - - dateLiteral(ctx: DateLiteralCstChildren) { - this.consume({ ...ctx.DateLiteral[0], type: TokenType.LITERAL }); - } - - dateTimeLiteral(ctx: DateTimeLiteralCstChildren) { - this.consume({ ...ctx.DateTimeLiteral[0], type: TokenType.LITERAL }); - } - - fileLiteral(ctx: FileLiteralCstChildren) { - this.consume({ ...ctx.FileLiteral[0], type: TokenType.LITERAL }); - } - - infinityLiteral(ctx: InfinityLiteralCstChildren) { - this.consume({ ...ctx.InfinityLiteral[0], type: TokenType.LITERAL }); - } - - monthLiteral(ctx: MonthLiteralCstChildren) { - this.consume({ ...ctx.MonthLiteral[0], type: TokenType.LITERAL }); - } - - timeLiteral(ctx: TimeLiteralCstChildren) { - this.consume({ ...ctx.TimeLiteral[0], type: TokenType.LITERAL }); - } - - numberLiteral(ctx: NumberLiteralCstChildren) { - this.consume({ ...ctx.NumberLiteral[0], type: TokenType.LITERAL }); - } - - symbolLiteral(ctx: SymbolLiteralCstChildren) { - this.consume({ ...ctx.SymbolLiteral[0], type: TokenType.LITERAL }); - } - - timeStampLiteral(ctx: TimeStampLiteralCstChildren) { - this.consume({ ...ctx.TimeStampLiteral[0], type: TokenType.LITERAL }); - } - - reserved(ctx: ReservedCstChildren) { - this.consume({ ...ctx.Reserved[0], type: TokenType.RESERVED }); - } - - keyword(ctx: KeywordCstChildren) { - this.consume({ ...ctx.Keyword[0], type: TokenType.KEYWORD }); - } - - identifier(ctx: IdentifierCstChildren) { - this.consume({ ...ctx.Identifier[0], type: TokenType.IDENTIFIER }); - } - - iterator(ctx: IteratorCstChildren) { - this.consume({ ...ctx.Iterator[0], type: TokenType.ITERATOR }); - } - - command(ctx: CommandCstChildren) { - this.consume({ ...ctx.Command[0], type: TokenType.COMMAND }); - } - - operator(ctx: OperatorCstChildren) { - this.consume({ ...ctx.Operator[0], type: TokenType.OPERATOR }); - } -} - -export interface Token { - type: TokenType; - name: string; - scope?: Token; - tag?: string; - statement: number; - image: string; - startOffset: number; - endOffset: number; -} - -export interface QAst { - script: Token[]; - assign: Token[]; -} - -export const enum TokenType { - LITERAL, - RESERVED, - KEYWORD, - IDENTIFIER, - SQL, - GROUP, - LAMBDA, - BRACKET, - TABLE, - ITERATOR, - OPERATOR, - COMMAND, - ASSIGN, - SEMICOLON, -} - -export const SymbolTypes = [ - TokenType.LITERAL, - TokenType.RESERVED, - TokenType.KEYWORD, - TokenType.IDENTIFIER, -]; - -export const NoAssignTypes = [TokenType.TABLE, TokenType.SQL]; - -export function scope(token: Token, types = [TokenType.LAMBDA]) { - let scope; - while ((scope = token.scope)) { - if (types.indexOf(scope.type) >= 0) { - break; - } - token = scope; - } - return scope; -} - -export function analyze(cstNode: CstNode | CstNode[]) { - const visitor = new QVisitor(); - visitor.visit(cstNode); - return visitor.ast(); -} diff --git a/server/src/qLangServer.ts b/server/src/qLangServer.ts index ec78c971..acb3cda4 100644 --- a/server/src/qLangServer.ts +++ b/server/src/qLangServer.ts @@ -15,147 +15,174 @@ import { TextDocument } from "vscode-languageserver-textdocument"; import { CompletionItem, Connection, + DefinitionParams, + DocumentSymbol, + DocumentSymbolParams, InitializeParams, Location, + Position, Range, + ReferenceParams, RenameParams, ServerCapabilities, + SymbolKind, + TextDocumentPositionParams, TextDocumentSyncKind, TextDocuments, TextEdit, WorkspaceEdit, } from "vscode-languageserver/node"; -import { TokenType, IdentifierPattern, scope, analyze } from "./parser"; -import { KeywordPattern } from "./parser/keywords"; -import { QParser } from "./parser/parser"; +import { Identifier, Token, TokenKind, parse } from "./parser"; +import { IToken } from "chevrotain"; -export default class QLangServer { - private connection: Connection; - private params: InitializeParams; - public documents: TextDocuments = new TextDocuments( - TextDocument, +function rangeFromToken(token: IToken): Range { + return Range.create( + (token.startLine || 1) - 1, + (token.startColumn || 1) - 1, + (token.endLine || 1) - 1, + token.endColumn || 1, ); +} + +function hasPosition(token: Token, position: Position) { + const { start, end } = rangeFromToken(token); + return ( + start.line <= position.line && + end.line >= position.line && + start.character <= position.character && + end.character >= position.character + ); +} + +export default class QLangServer { + private declare connection: Connection; + private declare params: InitializeParams; + private declare documents: TextDocuments; constructor(connection: Connection, params: InitializeParams) { this.connection = connection; this.params = params; + this.documents = new TextDocuments(TextDocument); this.documents.listen(this.connection); - this.connection.onCompletion(this.onCompletion.bind(this)); - this.connection.onDefinition(this.onDefinition.bind(this)); this.connection.onReferences(this.onReferences.bind(this)); + this.connection.onDefinition(this.onDefinition.bind(this)); + this.connection.onDocumentSymbol(this.onDocumentSymbol.bind(this)); + this.connection.onCompletion(this.onCompletion.bind(this)); this.connection.onRenameRequest(this.onRenameRequest.bind(this)); } public capabilities(): ServerCapabilities { return { textDocumentSync: TextDocumentSyncKind.Full, - completionProvider: { resolveProvider: false }, - definitionProvider: true, referencesProvider: true, + definitionProvider: true, + documentSymbolProvider: true, + completionProvider: { resolveProvider: false }, renameProvider: true, }; } - private onCompletion(): CompletionItem[] { - return []; - } - - private onDefinition(): Location[] { - return []; - } - - private onReferences(): Location[] { - return []; + public onReferences({ + textDocument, + position, + }: ReferenceParams): Location[] | undefined { + return this.findReferences({ textDocument, position }).map((token) => + Location.create(textDocument.uri, rangeFromToken(token)), + ); } - private onRenameRequest({ + public onDefinition({ textDocument, position, - newName, - }: RenameParams): WorkspaceEdit | null | undefined { - let match = IdentifierPattern.exec(newName); - if (!match || match[0] !== newName) { - return null; - } - match = KeywordPattern.exec(newName); - if (match && match[0] === newName) { - return null; - } + }: DefinitionParams): Location[] | undefined { const document = this.documents.get(textDocument.uri); if (!document) { - return null; + return; } - const cst = QParser.parse(document.getText()); - if (QParser.errors.length > 0) { - return null; - } - const offset = document.offsetAt(position); - const { script, assign } = analyze(cst); - const symbol = script.find( - (entity) => - entity.type === TokenType.IDENTIFIER && - offset >= entity.startOffset && - offset <= entity.endOffset, - ); - if (!symbol) { - return null; + + const tokens = parse(document.getText()); + const source = tokens.find((token) => hasPosition(token, position)); + + if (!source || source.tokenType !== Identifier) { + return; } - let targets; - const symbolScope = scope(symbol); - const local = assign.find( - (entity) => - symbol.image === entity.image && - symbolScope && - symbolScope === scope(entity), - ); - if (local) { - const exists = assign.find( - (entity) => entity.image === newName && symbolScope === scope(entity), - ); - if (exists) { - return null; - } - targets = script.filter( - (entity) => - symbol.image === entity.image && - symbolScope && - symbolScope === scope(entity) && - entity.type === TokenType.IDENTIFIER, - ); - } else { - const global = assign.find( - (entity) => !scope(entity) && symbol.image === entity.image, + + let target: Token[] = []; + + if (source.scope) { + target = tokens.filter( + (token) => + token.scope === source.scope && + token.kind === TokenKind.Assignment && + token.identifier === source.identifier, ); - if (!global) { - return null; - } - const exists = assign.find( - (entity) => !scope(entity) && entity.image === newName, + } + + if (target.length === 0) { + target = tokens.filter( + (token) => + !token.scope && + token.kind === TokenKind.Assignment && + token.identifier === source.identifier, ); - if (exists) { - return null; - } - targets = script.filter((entity) => { - if ( - entity.type !== TokenType.IDENTIFIER || - entity.image !== symbol.image - ) { - return false; - } - const scoped = scope(entity); - const local = assign.find( - (ident) => - ident.image === entity.image && scoped && scope(ident) === scoped, - ); - return !local; - }); } - const edits = targets.map((entity) => { - const start = document.positionAt(entity.startOffset); - const end = document.positionAt(entity.endOffset); - const range = Range.create(start, end); - return TextEdit.replace(range, newName); - }); + + return target.map((token) => + Location.create(textDocument.uri, rangeFromToken(token)), + ); + } + + public onDocumentSymbol({ + textDocument, + }: DocumentSymbolParams): DocumentSymbol[] | undefined { + const document = this.documents.get(textDocument.uri); + if (!document) { + return; + } + + const tokens = parse(document.getText()); + + return tokens + .filter((token) => token.kind === TokenKind.Assignment && !token.scope) + .map((token) => + DocumentSymbol.create( + token.identifier || token.image, + undefined, + token.lambda ? SymbolKind.Object : SymbolKind.Variable, + rangeFromToken(token), + rangeFromToken(token), + tokens + .filter( + (child) => + child.scope && + child.scope === token.lambda && + child.kind === TokenKind.Assignment, + ) + .map((token) => + DocumentSymbol.create( + token.image, + undefined, + token.argument ? SymbolKind.Array : SymbolKind.Variable, + rangeFromToken(token), + rangeFromToken(token), + ), + ), + ), + ); + } + + public onCompletion(): CompletionItem[] { + return []; + } + + public onRenameRequest({ + textDocument, + position, + newName, + }: RenameParams): WorkspaceEdit | null { + const edits = this.findReferences({ textDocument, position }).map((token) => + TextEdit.replace(rangeFromToken(token), newName), + ); if (edits.length > 0) { return { changes: { @@ -165,4 +192,43 @@ export default class QLangServer { } return null; } + + private findReferences({ + textDocument, + position, + }: TextDocumentPositionParams): Token[] { + let target: Token[] = []; + + const document = this.documents.get(textDocument.uri); + if (!document) { + return target; + } + + const tokens = parse(document.getText()); + const source = tokens.find((token) => hasPosition(token, position)); + + if (!source || source.tokenType !== Identifier) { + return target; + } + + if (source.scope) { + target = tokens.filter( + (token) => + token.scope === source.scope && + token.tokenType === Identifier && + token.identifier === source.identifier, + ); + } + + if (target.length === 0) { + target = tokens.filter( + (token) => + !token.scope && + token.tokenType === Identifier && + token.identifier === source.identifier, + ); + } + + return target; + } } diff --git a/src/commands/buildToolsCommand.ts b/src/commands/buildToolsCommand.ts index 4d71500e..cba43496 100644 --- a/src/commands/buildToolsCommand.ts +++ b/src/commands/buildToolsCommand.ts @@ -23,8 +23,8 @@ import { window, workspace, } from "vscode"; -import { spawn, exec } from "child_process"; -import { tmpdir, platform, arch } from "os"; +import { spawn } from "child_process"; +import { tmpdir } from "os"; import { ext } from "../extensionVariables"; const cache = new Map>(); @@ -50,33 +50,79 @@ interface LinterResult { fname: string; } +const prefix: { [key: string]: string } = { + win32: Path.join("w64", "q.exe"), + darwin: Path.join("m64", "q"), + linux: Path.join("l64", "q"), + l64arm: Path.join("l64arm", "q"), +}; + +function getRuntime() { + const home = workspace + .getConfiguration() + .get("kdb.qHomeDirectory", `${process.env.QHOME || ""}`); + + if (!home) { + throw new Error("kdb q runtime not found"); + } + + const platform = + process.platform === "linux" && process.arch === "arm64" + ? "l64arm" + : process.platform; + + const target = prefix[platform]; + + if (!target) { + throw new Error(`Build Tools not supported on ${platform}`); + } + + return Path.join(home, target); +} + +function getTool(args: string[]) { + if (process.platform === "darwin" && process.arch === "arm64") { + return spawn("/usr/bin/arch", ["-x86_64", getRuntime(), ...args]); + } + return spawn(getRuntime(), args); +} + +function getLinter() { + if (process.env.AXLIBRARIES_HOME) { + return Path.join(process.env.AXLIBRARIES_HOME, "ws", "qlint.q_"); + } + throw new Error("AXLIBRARIES_HOME is not set"); +} + function initBuildTools() { return new Promise((resolve, reject) => { - if (!process.env.QHOME) { - return reject(new Error("QHOME is not set")); - } - if (!process.env.AXLIBRARIES_HOME) { - return reject(new Error("AXLIBRARIES_HOME is not set")); - } - if (platform() === "darwin") { - const xattr = exec( - "xattr -dr com.apple.quarantine $AXLIBRARIES_HOME/ws/lib/*.{so,dylib}", - ); - xattr.on("exit", () => resolve()); - xattr.on("error", (error) => reject(error)); + if (process.env.AXLIBRARIES_HOME) { + if (process.platform === "darwin") { + const xattr = spawn( + "/usr/bin/xattr", + [ + "-d", + "com.apple.quarantine", + Path.join( + process.env.AXLIBRARIES_HOME, + "ws", + "lib", + "*.{so,dylib}", + ), + ], + { shell: true }, + ); + xattr.on("exit", () => resolve()); + xattr.on("error", (error) => reject(error)); + } else { + resolve(); + } } else { - resolve(); + reject(new Error("AXLIBRARIES_HOME is not set")); } }); } -function getTool(args: string[]) { - if (platform() === "darwin" && arch() === "arm64") { - return spawn("arch", ["-x86_64", "q", ...args]); - } - return spawn("q", args); -} - function isLintingSupported(document: TextDocument) { const path = document.uri.path; return path.endsWith(".q") || path.endsWith(".quke"); @@ -101,7 +147,7 @@ function getLinterResults(uri: Uri) { `kdb-qlint-${new Date().getTime()}.json`, ); const linter = getTool([ - `${process.env.AXLIBRARIES_HOME}/ws/qlint.q_`, + getLinter(), "-src", uri.path, "-out", @@ -114,8 +160,7 @@ function getLinterResults(uri: Uri) { reject(error); } else { try { - const parsed = JSON.parse(data); - resolve(parsed); + resolve(JSON.parse(data)); } catch (error) { reject(error); } @@ -136,10 +181,19 @@ const severity: { [key: string]: DiagnosticSeverity } = { function lint(document: TextDocument) { return window.withProgress( - { title: "Linting", location: ProgressLocation.Window, cancellable: false }, - async () => { + { + title: "Linting", + location: ProgressLocation.Window, + cancellable: true, + }, + async (_progress, token) => { try { - return (await getLinterResults(document.uri)).map((result) => { + const results = await getLinterResults(document.uri); + if (token.isCancellationRequested) { + cache.delete(document.uri.path); + return []; + } + return results.map((result) => { const diagnostic = new Diagnostic( new Range( result.startLine - 1, diff --git a/src/services/quickFixProvider.ts b/src/services/quickFixProvider.ts index d7c41b15..f537e06e 100644 --- a/src/services/quickFixProvider.ts +++ b/src/services/quickFixProvider.ts @@ -34,18 +34,27 @@ export class QuickFixProvider implements CodeActionProvider { (item) => item.source === "qlint" && item.range.isEqual(range), ); if (diagnostic) { - const action = new CodeAction( - `Suppress ${diagnostic.code}`, + const once = new CodeAction("Suppress warning", CodeActionKind.QuickFix); + once.diagnostics = [diagnostic]; + once.edit = new WorkspaceEdit(); + once.edit.insert( + document.uri, + new Position(range.start.line, 0), + `//@qlintsuppress ${diagnostic.code}(1)\n`, + ); + const always = new CodeAction( + `Suppress all warnings (${diagnostic.code})`, CodeActionKind.QuickFix, ); - action.diagnostics = [diagnostic]; - action.edit = new WorkspaceEdit(); - action.edit.insert( + always.diagnostics = [diagnostic]; + always.edit = new WorkspaceEdit(); + always.edit.insert( document.uri, - new Position(range.start.line, 0), - `// @qlintsuppress ${diagnostic.code}(1)\n`, + new Position(0, 0), + `//@qlintsuppress ${diagnostic.code}\n`, ); - return [action]; + + return [once, always]; } } } From fd697a6f31c34bc70f31f5750f46c3e8075b4636 Mon Sep 17 00:00:00 2001 From: ecmel Date: Wed, 24 Apr 2024 06:58:34 +0300 Subject: [PATCH 08/25] fixed completion --- server/src/qLangServer.ts | 198 ++++++++++++++++++++------------------ 1 file changed, 105 insertions(+), 93 deletions(-) diff --git a/server/src/qLangServer.ts b/server/src/qLangServer.ts index acb3cda4..819e9c2f 100644 --- a/server/src/qLangServer.ts +++ b/server/src/qLangServer.ts @@ -14,6 +14,8 @@ import { TextDocument } from "vscode-languageserver-textdocument"; import { CompletionItem, + CompletionItemKind, + CompletionParams, Connection, DefinitionParams, DocumentSymbol, @@ -26,16 +28,15 @@ import { RenameParams, ServerCapabilities, SymbolKind, - TextDocumentPositionParams, + TextDocumentIdentifier, TextDocumentSyncKind, TextDocuments, TextEdit, WorkspaceEdit, } from "vscode-languageserver/node"; import { Identifier, Token, TokenKind, parse } from "./parser"; -import { IToken } from "chevrotain"; -function rangeFromToken(token: IToken): Range { +function rangeFromToken(token: Token): Range { return Range.create( (token.startLine || 1) - 1, (token.startColumn || 1) - 1, @@ -54,6 +55,13 @@ function hasPosition(token: Token, position: Position) { ); } +const enum FindKind { + Reference, + Definition, + Rename, + Completion, +} + export default class QLangServer { private declare connection: Connection; private declare params: InitializeParams; @@ -64,80 +72,30 @@ export default class QLangServer { this.params = params; this.documents = new TextDocuments(TextDocument); this.documents.listen(this.connection); + this.connection.onDocumentSymbol(this.onDocumentSymbol.bind(this)); this.connection.onReferences(this.onReferences.bind(this)); this.connection.onDefinition(this.onDefinition.bind(this)); - this.connection.onDocumentSymbol(this.onDocumentSymbol.bind(this)); - this.connection.onCompletion(this.onCompletion.bind(this)); this.connection.onRenameRequest(this.onRenameRequest.bind(this)); + this.connection.onCompletion(this.onCompletion.bind(this)); } public capabilities(): ServerCapabilities { return { textDocumentSync: TextDocumentSyncKind.Full, + documentSymbolProvider: true, referencesProvider: true, definitionProvider: true, - documentSymbolProvider: true, - completionProvider: { resolveProvider: false }, renameProvider: true, + completionProvider: { resolveProvider: false }, }; } - public onReferences({ - textDocument, - position, - }: ReferenceParams): Location[] | undefined { - return this.findReferences({ textDocument, position }).map((token) => - Location.create(textDocument.uri, rangeFromToken(token)), - ); - } - - public onDefinition({ - textDocument, - position, - }: DefinitionParams): Location[] | undefined { - const document = this.documents.get(textDocument.uri); - if (!document) { - return; - } - - const tokens = parse(document.getText()); - const source = tokens.find((token) => hasPosition(token, position)); - - if (!source || source.tokenType !== Identifier) { - return; - } - - let target: Token[] = []; - - if (source.scope) { - target = tokens.filter( - (token) => - token.scope === source.scope && - token.kind === TokenKind.Assignment && - token.identifier === source.identifier, - ); - } - - if (target.length === 0) { - target = tokens.filter( - (token) => - !token.scope && - token.kind === TokenKind.Assignment && - token.identifier === source.identifier, - ); - } - - return target.map((token) => - Location.create(textDocument.uri, rangeFromToken(token)), - ); - } - public onDocumentSymbol({ textDocument, - }: DocumentSymbolParams): DocumentSymbol[] | undefined { + }: DocumentSymbolParams): DocumentSymbol[] { const document = this.documents.get(textDocument.uri); if (!document) { - return; + return []; } const tokens = parse(document.getText()); @@ -171,8 +129,21 @@ export default class QLangServer { ); } - public onCompletion(): CompletionItem[] { - return []; + public onReferences({ textDocument, position }: ReferenceParams): Location[] { + return this.findIdentifiers(FindKind.Reference, textDocument, position).map( + (token) => Location.create(textDocument.uri, rangeFromToken(token)), + ); + } + + public onDefinition({ + textDocument, + position, + }: DefinitionParams): Location[] { + return this.findIdentifiers( + FindKind.Definition, + textDocument, + position, + ).map((token) => Location.create(textDocument.uri, rangeFromToken(token))); } public onRenameRequest({ @@ -180,55 +151,96 @@ export default class QLangServer { position, newName, }: RenameParams): WorkspaceEdit | null { - const edits = this.findReferences({ textDocument, position }).map((token) => - TextEdit.replace(rangeFromToken(token), newName), - ); - if (edits.length > 0) { - return { - changes: { - [textDocument.uri]: edits, - }, - }; - } - return null; + const edits = this.findIdentifiers( + FindKind.Rename, + textDocument, + position, + ).map((token) => TextEdit.replace(rangeFromToken(token), newName)); + return edits.length === 0 + ? null + : { + changes: { + [textDocument.uri]: edits, + }, + }; } - private findReferences({ + public onCompletion({ textDocument, position, - }: TextDocumentPositionParams): Token[] { - let target: Token[] = []; + }: CompletionParams): CompletionItem[] { + return this.findIdentifiers( + FindKind.Completion, + textDocument, + position, + ).map((token) => ({ + label: token.identifier || token.image, + kind: token.lambda + ? CompletionItemKind.Function + : CompletionItemKind.Variable, + })); + } + private findIdentifiers( + kind: FindKind, + textDocument: TextDocumentIdentifier, + position: Position, + ): Token[] { const document = this.documents.get(textDocument.uri); if (!document) { - return target; + return []; } - const tokens = parse(document.getText()); const source = tokens.find((token) => hasPosition(token, position)); - - if (!source || source.tokenType !== Identifier) { - return target; + if (!source) { + return []; } - if (source.scope) { - target = tokens.filter( + const isLocal = (source: Token) => + source.scope && + tokens.find( (token) => token.scope === source.scope && - token.tokenType === Identifier && + token.kind === TokenKind.Assignment && token.identifier === source.identifier, ); - } - if (target.length === 0) { - target = tokens.filter( - (token) => - !token.scope && - token.tokenType === Identifier && - token.identifier === source.identifier, - ); + switch (kind) { + case FindKind.Rename: + case FindKind.Reference: + return isLocal(source) + ? tokens.filter( + (token) => + token.tokenType === Identifier && + token.identifier === source.identifier && + token.scope === source.scope, + ) + : tokens.filter( + (token) => + token.tokenType === Identifier && + token.identifier === source.identifier && + !isLocal(token), + ); + case FindKind.Definition: + return isLocal(source) + ? tokens.filter( + (token) => + token.kind === TokenKind.Assignment && + token.identifier === source.identifier && + token.scope === source.scope, + ) + : tokens.filter( + (token) => + token.kind === TokenKind.Assignment && + token.identifier === source.identifier && + !isLocal(token), + ); + case FindKind.Completion: + return tokens.filter( + (token) => + token.kind === TokenKind.Assignment && + (!token.scope || token.scope === source.scope), + ); } - - return target; } } From ad4da2086b78c2125f442d2c9ef27493fd99b330 Mon Sep 17 00:00:00 2001 From: ecmel Date: Wed, 24 Apr 2024 13:14:56 +0300 Subject: [PATCH 09/25] generate TextMate grammar from lexer --- language-configuration.json | 2 +- server/src/parser/language.ts | 10 +- syntaxes/q.tmLanguage.json | 14 +- test/suite/cpUtils.test.ts | 45 --- test/suite/linter.test.ts | 205 +---------- test/suite/parser.test.ts | 93 +---- test/suite/qLangServer.test.ts | 626 +-------------------------------- 7 files changed, 41 insertions(+), 954 deletions(-) delete mode 100644 test/suite/cpUtils.test.ts diff --git a/language-configuration.json b/language-configuration.json index 23086dcb..0d253696 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -34,5 +34,5 @@ "blockComment": ["/", "\\"], "lineComment": "//" }, - "wordPattern": "(?:\\.[A-Za-z][A-Za-z_0-9.]*(??!#@$&~|%*+-]" + "match": "[_,.'^?!#@$&|%*+-]" }, { "name": "punctuation.assignment.q", @@ -228,4 +232,4 @@ ] } } -} +} \ No newline at end of file diff --git a/test/suite/cpUtils.test.ts b/test/suite/cpUtils.test.ts deleted file mode 100644 index 1374b0d3..00000000 --- a/test/suite/cpUtils.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import * as assert from "assert"; -import * as cpUtils from "../../server/src/utils/cpUtils"; - -describe("cpUtils", () => { - describe("wrapArgInQuotes", () => { - it("should return a quoted string for string", () => { - const result = cpUtils.wrapArgInQuotes("test"); - assert.strictEqual(result.substring(1, 5), "test"); - }); - - it("should return a string value for boolean", () => { - const result = cpUtils.wrapArgInQuotes(true); - assert.strictEqual(result, "true"); - }); - - it("should return a string value for number", () => { - const result = cpUtils.wrapArgInQuotes(1); - assert.strictEqual(result, "1"); - }); - - it("should return an empty quoted string for none", () => { - const result = cpUtils.wrapArgInQuotes(); - assert.strictEqual(result.length, 2); - }); - }); - - describe("executeCommand", () => { - it("should throw an exception for none", async () => { - await assert.rejects(cpUtils.executeCommand("./", "__none")); - }); - }); -}); diff --git a/test/suite/linter.test.ts b/test/suite/linter.test.ts index 58d52e62..de30fe1d 100644 --- a/test/suite/linter.test.ts +++ b/test/suite/linter.test.ts @@ -12,208 +12,11 @@ */ import * as assert from "assert"; -import * as sinon from "sinon"; -import { lint } from "../../server/src/linter"; -import { QParser, analyze } from "../../server/src/parser"; -describe("linter", () => { - afterEach(() => { - sinon.restore(); - }); - - describe("ASSIGN_RESERVED_WORD", () => { - it("should lint assign reseved word", () => { - const cst = QParser.parse("til:1"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "ASSIGN_RESERVED_WORD"); - }); - }); - - describe("INVALID_ASSIGN", () => { - it("should lint invalid assign", () => { - const cst = QParser.parse("123:1"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "INVALID_ASSIGN"); - }); - }); - - describe("UNUSED_PARAM", () => { - it("should lint unused param", () => { - const cst = QParser.parse("{[a]}"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "UNUSED_PARAM"); - }); - - it("should not lint unused param outside lambda scope", () => { - const cst = QParser.parse("[a:1];a"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - assert.strictEqual(ast.assign[0].image, "a"); - const results = lint(ast); - assert.strictEqual(results.length, 0); - }); - }); - - describe("UNUSED_VAR", () => { - it("should lint unused var", () => { - const cst = QParser.parse("a:1"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "UNUSED_VAR"); - }); - - it("should lint unused var in assign through", () => { - const cst = QParser.parse("+:[a;1]"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "UNUSED_VAR"); - }); - }); - - describe("LINE_LENGTH", () => { - it("should not lint valid line length", () => { - const cst = QParser.parse( - "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n" - ); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 0); - }); - }); - - describe("TOO_MANY_LOCALS", () => { - it("should lint too many locals", () => { - let usage = ""; - for (let i = 1; i <= 111; i++) { - usage += `i${i}:${i};i${i}*${i};`; - } - const cst = QParser.parse(`{${usage}}`); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "TOO_MANY_LOCALS"); - }); - }); - - describe("TOO_MANY_GLOBALS", () => { - it("should lint too many globals", () => { - let globals = ""; - for (let i = 1; i <= 111; i++) { - globals += `i${i}:${i};`; - } - let usage = ""; - for (let i = 1; i <= 111; i++) { - usage += `i${i}*${i};`; - } - const cst = QParser.parse(`${globals}{${usage}}`); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "TOO_MANY_GLOBALS"); - }); - }); - - describe("TOO_MANY_CONSTANTS", () => { - it("should lint too many constants", () => { - let text = ""; - for (let i = 1; i <= 240; i++) { - text += `i${i};`; - } - const cst = QParser.parse(`{${text}}`); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "TOO_MANY_CONSTANTS"); - }); - }); - - describe("DEPRECATED_DATETIME", () => { - it("should lint datetime", () => { - const cst = QParser.parse("2000.01.01T12:00:00.000"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "DEPRECATED_DATETIME"); - }); - }); - - describe("TOO_MANY_ARGUMENTS", () => { - it("should not lint too many arguments", () => { - const cst = QParser.parse( - "{[a, b, c, d, e, f, g, h, i] a*b*c*d*e*f*g*h*i}" - ); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "TOO_MANY_ARGUMENTS"); - }); - }); - - describe("INVALID_ESCAPE", () => { - it("should lint invalid escape", () => { - const cst = QParser.parse('"\\a"'); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "INVALID_ESCAPE"); - }); - }); - - describe("FIXED_SEED", () => { - it("should lint fixed seed", () => { - const cst = QParser.parse("1?0Ng"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "FIXED_SEED"); - }); - - it("should not lint fixed seed", () => { - const cst = QParser.parse("-1?0Ng"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 0); - }); - }); - - describe("DECLARED_AFTER_USE", () => { - it("should lint declared after use", () => { - const cst = QParser.parse("a;a:1"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].name, "DECLARED_AFTER_USE"); - }); - - it("should respect right to left", () => { - const cst = QParser.parse("(a;a:1)"); - assert.deepEqual(QParser.errors, []); - const ast = analyze(cst); - const results = lint(ast); - assert.strictEqual(results.length, 0); +describe("Parser", () => { + describe("Feature", () => { + it("should", () => { + assert.strictEqual(1, 1); }); }); }); diff --git a/test/suite/parser.test.ts b/test/suite/parser.test.ts index 5f59852d..2a9df9d9 100644 --- a/test/suite/parser.test.ts +++ b/test/suite/parser.test.ts @@ -12,94 +12,13 @@ */ import * as assert from "assert"; -import { CharLiteral, QLexer, QParser } from "../../server/src/parser"; +import { generateTextMateGrammar } from "../../server/src/parser"; -describe("QLexer", () => { - describe("CharLiteral", () => { - it("should tokenize string", () => { - const lexed = QLexer.tokenize('"char"'); - assert.strictEqual(lexed.tokens.length, 1); - assert.strictEqual(lexed.tokens[0].tokenType, CharLiteral); - }); - - it("should tokenize empty string", () => { - const lexed = QLexer.tokenize('""'); - assert.strictEqual(lexed.tokens.length, 1); - assert.strictEqual(lexed.tokens[0].tokenType, CharLiteral); - }); - }); -}); - -describe("QParser", () => { - describe("comments", () => { - it("should ignore block", () => { - QParser.parse("/\na:\n1\n\\"); - assert.deepEqual(QParser.errors, []); - }); - - it("should ignore line", () => { - QParser.parse("/a:\n"); - assert.deepEqual(QParser.errors, []); - }); - - it("should ignore inline", () => { - QParser.parse("a: 1 /a:\n"); - assert.deepEqual(QParser.errors, []); - }); - }); - - describe("script", () => { - it("should parse empty", () => { - QParser.parse(""); - assert.deepEqual(QParser.errors, []); - }); - }); - - describe("statement", () => { - it("should parse empty", () => { - QParser.parse(";\n\r\n;"); - assert.deepEqual(QParser.errors, []); - }); - }); - - describe("expression", () => { - describe("identifier", () => { - it("should parse", () => { - QParser.parse("absolute;"); - assert.deepEqual(QParser.errors, []); - }); - - it("should parse namespaced", () => { - QParser.parse(".absolute.value;"); - assert.deepEqual(QParser.errors, []); - }); - }); - - describe("assignment", () => { - it("should parse", () => { - QParser.parse("a:1;"); - assert.deepEqual(QParser.errors, []); - }); - - it("should parse multiple", () => { - QParser.parse("a:b:c:1;"); - assert.deepEqual(QParser.errors, []); - }); - - it("should parse multiline", () => { - QParser.parse("a\n :b:c:\r\n 1;"); - assert.deepEqual(QParser.errors, []); - }); - - it("should parse indexed", () => { - QParser.parse("a[1]:1;"); - assert.deepEqual(QParser.errors, []); - }); - - it("should parse infixed", () => { - QParser.parse("a[1]+:1;"); - assert.deepEqual(QParser.errors, []); - }); +describe("Parser", () => { + describe("TextMate", () => { + it("should generate TextMate grammar file", () => { + const grammar = generateTextMateGrammar(); + assert.ok(grammar); }); }); }); diff --git a/test/suite/qLangServer.test.ts b/test/suite/qLangServer.test.ts index 448d426c..fa2318a2 100644 --- a/test/suite/qLangServer.test.ts +++ b/test/suite/qLangServer.test.ts @@ -16,23 +16,7 @@ import * as assert from "assert"; import * as sinon from "sinon"; -import { - CallHierarchyIncomingCallsParams, - CallHierarchyItem, - CompletionItem, - Connection, - DocumentSymbolParams, - InitializeParams, - Position, - PublishDiagnosticsParams, - ReferenceParams, - RenameParams, - SemanticTokensParams, - SignatureHelpParams, - TextDocumentIdentifier, - TextDocumentPositionParams, -} from "vscode-languageserver"; -import { TextDocument } from "vscode-languageserver-textdocument"; +import { Connection, InitializeParams } from "vscode-languageserver"; import QLangServer from "../../server/src/qLangServer"; describe("qLangServer", () => { @@ -47,42 +31,18 @@ describe("qLangServer", () => { onWillSaveTextDocument() {}, onWillSaveTextDocumentWaitUntil() {}, onDidSaveTextDocument() {}, - onNotification() {}, - onCompletion() {}, - onCompletionResolve() {}, - onHover() {}, - onDocumentHighlight() {}, - onDefinition() {}, onDocumentSymbol() {}, onReferences() {}, + onDefinition() {}, onRenameRequest() {}, - onDidChangeConfiguration() {}, - sendDiagnostics() {}, - languages: { - semanticTokens: { - on() {}, - }, - callHierarchy: { - onPrepare() {}, - onIncomingCalls() {}, - onOutgoingCalls() {}, - }, - }, - console: { - error() {}, - warn() {}, - info() {}, - }, - workspace: { - getConfiguration() {}, - }, + onCompletion() {}, }); const params = { workspaceFolders: null, }; - server = await QLangServer.initialize(connection, params); + server = new QLangServer(connection, params); }); afterEach(() => { @@ -90,576 +50,14 @@ describe("qLangServer", () => { }); describe("capabilities", () => { - it("should return a value", () => { - assert.ok(server.capabilities()); - }); - }); - - describe("debugWithLogs", () => { - it("should log a warning message", () => { - const warnStub = sinon.stub(server.connection.console, "warn"); - let ok = false; - warnStub.value(() => (ok = true)); - server.debugWithLogs("request", "msg"); - assert.ok(ok); - }); - }); - - describe("writeConsoleMsg", () => { - it("should log an error message", () => { - const errorStub = sinon.stub(server.connection.console, "error"); - let ok = false; - errorStub.value(() => (ok = true)); - server.writeConsoleMsg("msg", "error"); - assert.ok(ok); - }); - - it("should log an info message", () => { - const infoStub = sinon.stub(server.connection.console, "info"); - let ok = false; - infoStub.value(() => (ok = true)); - server.writeConsoleMsg("msg", "info"); - assert.ok(ok); - }); - }); - - describe("onCompletion", () => { - it("should return an empty array", () => { - const getKeywordStub = sinon.stub(server, "getKeyword"); - getKeywordStub.value(() => undefined); - const result = server["onCompletion"]({ - textDocument: TextDocumentIdentifier.create("/test/test.q"), - position: Position.create(0, 0), - }); - assert.strictEqual(result.length, 0); - }); - - it("should return a value", () => { - const doc = TextDocument.create("/test/test.q", "q", 1, "aco"); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 3); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onCompletion"]({ - textDocument, - position, - }); - assert.ok(result.length > 0); - }); - }); - - describe("onCompletionResolve", () => { - it("should return a value", async () => { - const item = { label: "test" }; - const result = await server["onCompletionResolve"](item); - assert.strictEqual(result, item); - }); - }); - - describe("onHover", () => { - it("onHover should return null", async () => { - const getKeywordStub = sinon.stub(server, "getEntireKeyword"); - getKeywordStub.value(() => undefined); - const result = await server["onHover"]({ - textDocument: TextDocumentIdentifier.create("/test/test.q"), - position: Position.create(0, 0), - }); - assert.strictEqual(result, null); - }); - - it("onHover should return a value", async () => { - const doc = TextDocument.create("/test/test.q", "q", 1, "acos"); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = await server["onHover"]({ - textDocument, - position, - }); - // TODO - assert.ok(result); - }); - }); - - describe("onDocumentHighlight", () => { - it("should return an empty array", () => { - const result = server["onDocumentHighlight"]({ - textDocument: TextDocumentIdentifier.create("/test/test.q"), - position: Position.create(0, 0), - }); - assert.strictEqual(result.length, 0); - }); - }); - - describe("onDefinition", () => { - it("should return an empty array", () => { - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => undefined); - const result = server["onDefinition"]({ - textDocument: TextDocumentIdentifier.create("/test/test.q"), - position: Position.create(0, 0), - }); - assert.strictEqual(result.length, 0); - }); - - it("should return a value", () => { - const doc = TextDocument.create( - "/test/test.q", - "q", - 1, - "test_func: {[x] x*x};\ntest_func[2];" - ); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(1, 1); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const valuesStub = sinon.stub( - server.analyzer["uriToTextDocument"], - "values" - ); - valuesStub.value(() => [doc]); - const result = server["onDefinition"]({ - textDocument, - position, - }); - assert.ok(result.length > 0); - }); - - it("should return an empty array", () => { - const doc = TextDocument.create( - "/test/test.q", - "q", - 1, - "test_func: {[x] x*x};\ntest_func[2];" - ); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(1, 1); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const valuesStub = sinon.stub( - server.analyzer["uriToTextDocument"], - "values" - ); - valuesStub.value(() => [doc]); - const getWordRangeAtPositionStub = sinon.stub( - server.analyzer, - "getWordRangeAtPosition" - ); - getWordRangeAtPositionStub.value(() => undefined); - const result = server["onDefinition"]({ - textDocument, - position, - }); - assert.strictEqual(result.length, 0); - }); - - it("should return an empty array", () => { - const doc = TextDocument.create( - "/test/test.q", - "q", - 1, - "test_func: {[x] x*x};\ntest_func[2];" - ); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(1, 1); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const valuesStub = sinon.stub( - server.analyzer["uriToTextDocument"], - "values" - ); - valuesStub.value(() => [doc]); - const getDefinitionsStub = sinon.stub(server.analyzer, "getDefinitions"); - getDefinitionsStub.value(() => undefined); - const result = server["onDefinition"]({ - textDocument, - position, - }); - assert.strictEqual(result.length, 0); - }); - }); - - describe("onDocumentSymbol", () => { - it("should return an empty array", () => { - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => undefined); - const result = server["onDocumentSymbol"]({ - textDocument: TextDocumentIdentifier.create("/test/test.q"), - position: Position.create(0, 0), - }); - assert.strictEqual(result.length, 0); - }); - - it("should return a value", () => { - const doc = TextDocument.create("/test/test.q", "q", 1, "a:1; b:2;"); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 3); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onDocumentSymbol"]({ - textDocument, - position, - }); - // TODO PR-103 - assert.strictEqual(result.length, 0); - }); - }); - - describe("onPrepareCallHierarchy", () => { - it("should return an empty array", () => { - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => undefined); - const result = server["onPrepareCallHierarchy"](< - TextDocumentPositionParams - >{ - textDocument: TextDocumentIdentifier.create("/test/test.q"), - position: Position.create(0, 0), - }); - assert.strictEqual(result.length, 0); - }); - - it("should return a value", () => { - const doc = TextDocument.create("/test/test.q", "q", 1, "a:1; b:2;"); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 3); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onPrepareCallHierarchy"](< - TextDocumentPositionParams - >{ - textDocument, - position, - }); - // TODO - assert.strictEqual(result.length, 0); - }); - }); - - describe("onIncomingCallsCallHierarchy", () => { - it("should return an empty array", () => { - const result = server.onIncomingCallsCallHierarchy(< - CallHierarchyIncomingCallsParams - >{ - item: { name: undefined }, - }); - assert.strictEqual(result.length, 0); - }); - }); - - describe("onOutgoingCallsCallHierarchy", () => { - it("should return a value", () => { - const result = server.onOutgoingCallsCallHierarchy({ - item: { uri: "test", name: "test" }, - }); - // TODO - assert.ok(result); - }); - }); - - describe("onReferences", () => { - it("should return an empty array", () => { - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 0); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => undefined); - const result = server["onReferences"]({ - textDocument, - position, - }); - assert.strictEqual(result.length, 0); - }); - - it("should return a value", () => { - const doc = TextDocument.create( - "/test/test.q", - "q", - 1, - "test_func: {[x] x*x};\ntest_func[2];" - ); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(1, 1); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const valuesStub = sinon.stub( - server.analyzer["uriToTextDocument"], - "values" - ); - valuesStub.value(() => [doc]); - const result = server["onReferences"]({ - textDocument, - position, - }); - assert.ok(result.length > 0); - }); - }); - - describe("onRenameRequest", () => { - it("should return a value", () => { - const doc = TextDocument.create("/test/test.q", "q", 1, "SOMEVAR:1"); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const newName = "CHANGEDVAR"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.deepEqual(result, { - changes: { - "/test/test.q": [ - { - newText: "CHANGEDVAR", - range: { - end: { - character: 7, - line: 0, - }, - start: { - character: 0, - line: 0, - }, - }, - }, - ], - }, - }); - }); - - it("should not rename if new name is assigned", () => { - const script = "a:1;b:2;"; - const doc = TextDocument.create("/test/test.q", "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const newName = "b"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result, null); - }); - - it("should not rename if new name is not assigned", () => { - const script = "a:1;{b:2};"; - const uri = "/test/test.q"; - const doc = TextDocument.create(uri, "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const newName = "b"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result.changes[uri].length, 1); - }); - - it("should respect name scope", () => { - const script = "a:1;{a:2};"; - const uri = "/test/test.q"; - const doc = TextDocument.create(uri, "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const newName = "b"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result.changes[uri].length, 1); - }); - - it("should not rename keywords", () => { - const script = "til:1;"; - const uri = "/test/test.q"; - const doc = TextDocument.create(uri, "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const newName = "b"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result, null); - }); - - it("should not rename to a keyword", () => { - const script = "a:1;"; - const uri = "/test/test.q"; - const doc = TextDocument.create(uri, "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const newName = "til"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result, null); - }); - - it("should not rename to a none identifier", () => { - const script = "a:1;"; - const uri = "/test/test.q"; - const doc = TextDocument.create(uri, "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const newName = "1"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result, null); - }); - - it("should not rename to a none identifier 2", () => { - const script = "a:1;"; - const uri = "/test/test.q"; - const doc = TextDocument.create(uri, "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 1); - const newName = "1somename"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result, null); - }); - - it("should rename locals", () => { - const script = "a:1;{a:1}"; - const uri = "/test/test.q"; - const doc = TextDocument.create(uri, "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 6); - const newName = "b"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result.changes[uri].length, 1); - }); - - it("should rename global assign", () => { - const script = "a:1;{a::1}"; - const uri = "/test/test.q"; - const doc = TextDocument.create(uri, "q", 1, script); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 6); - const newName = "b"; - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onRenameRequest"]({ - textDocument, - position, - newName, - }); - assert.strictEqual(result.changes[uri].length, 2); - }); - }); - - describe("onSignatureHelp", () => { - it("should return a value", () => { - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const position = Position.create(0, 0); - const result = server["onSignatureHelp"]({ - textDocument, - position, - }); - // TODO - assert.strictEqual(result, undefined); - }); - }); - - describe("onSemanticsTokens", () => { - it("should return a value", () => { - const doc = TextDocument.create("/test/test.q", "q", 1, "TOKEN:1"); - const textDocument = TextDocumentIdentifier.create("/test/test.q"); - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => doc); - const result = server["onSemanticsTokens"]({ - textDocument, - }); - // TODO - assert.strictEqual(result.data.length, 0); - }); - }); - - describe("validateTextDocument", () => { - it("should publish a diagnostic", async () => { - const sendDiagnosticsStub = sinon.stub( - server.connection, - "sendDiagnostics" - ); - let result: PublishDiagnosticsParams; - sendDiagnosticsStub.value( - async (params: PublishDiagnosticsParams) => (result = params) - ); - const doc = TextDocument.create( - "/test/test.q", - "q", - 1, - "2000.01.01T12:00:00.000" - ); - await server["validateTextDocument"](doc); - assert.strictEqual(result.diagnostics.length, 1); - }); - }); - - describe("getKeyword", () => { - it("should return undefimed", async () => { - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => undefined); - const result = server["getKeyword"]({ - textDocument: TextDocumentIdentifier.create("/test/test.q"), - position: Position.create(0, 0), - }); - assert.strictEqual(result, undefined); - }); - }); - - describe("getEntireKeyword", () => { - it("should return undefimed", async () => { - const getStub = sinon.stub(server.documents, "get"); - getStub.value(() => undefined); - const result = server["getEntireKeyword"]({ - textDocument: TextDocumentIdentifier.create("/test/test.q"), - position: Position.create(0, 0), - }); - assert.strictEqual(result, undefined); - }); - }); - - describe("getCurrentWordRange", () => { - it("should return undefimed", async () => { - const result = server["getCurrentWordRange"]( - Position.create(0, 0), - TextDocument.create("/test/test.q", "q", 1, "") - ); - assert.strictEqual(result, undefined); + it("should support desired features", () => { + const capabilities = server.capabilities(); + assert.ok(capabilities.textDocumentSync); + assert.ok(capabilities.documentSymbolProvider); + assert.ok(capabilities.referencesProvider); + assert.ok(capabilities.definitionProvider); + assert.ok(capabilities.renameProvider); + assert.ok(capabilities.completionProvider); }); }); }); From 8bdb3d4832dabe1ec206f6be1ff453f2fe950441 Mon Sep 17 00:00:00 2001 From: ecmel Date: Wed, 24 Apr 2024 16:47:05 +0300 Subject: [PATCH 10/25] added DO NOT EDIT warning --- server/src/parser/language.ts | 19 ++++++++++++++++--- syntaxes/q.tmLanguage.json | 5 +++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/server/src/parser/language.ts b/server/src/parser/language.ts index 0349d490..9df0ea2d 100644 --- a/server/src/parser/language.ts +++ b/server/src/parser/language.ts @@ -25,7 +25,15 @@ import { TimeStampLiteral, } from "./literals"; import { Identifier, Keyword, Reserved } from "./keywords"; -import { Command, Iterator, LineComment, Operator } from "./tokens"; +import { + Colon, + Command, + DoubleColon, + Iterator, + LineComment, + Operator, + SemiColon, +} from "./tokens"; import { TokenType } from "chevrotain"; import { writeFileSync } from "fs"; import { resolve } from "path"; @@ -111,6 +119,7 @@ const StringLiteral = [/"/, /\\["\\]/]; const ControlKeyword = /[$!?#@'^]/; const language = { + description: "This file is auto generated DO NOT EDIT", name: "q", scopeName: "source.q", patterns: [ @@ -269,11 +278,15 @@ const language = { }, { name: "punctuation.assignment.q", - match: ":", + match: _(Colon), + }, + { + name: "punctuation.assignment.q", + match: _(DoubleColon), }, { name: "punctuation.terminator.statement.q", - match: ";", + match: _(SemiColon), }, ], }, diff --git a/syntaxes/q.tmLanguage.json b/syntaxes/q.tmLanguage.json index 743e5c5a..aed423cf 100644 --- a/syntaxes/q.tmLanguage.json +++ b/syntaxes/q.tmLanguage.json @@ -1,4 +1,5 @@ { + "description": "This file is auto generated DO NOT EDIT", "name": "q", "scopeName": "source.q", "patterns": [ @@ -225,6 +226,10 @@ "name": "punctuation.assignment.q", "match": ":" }, + { + "name": "punctuation.assignment.q", + "match": "::" + }, { "name": "punctuation.terminator.statement.q", "match": ";" From 544d01ef11c97dc5cd2eae130b8889c72a01d0c7 Mon Sep 17 00:00:00 2001 From: ecmel Date: Thu, 25 Apr 2024 16:26:01 +0300 Subject: [PATCH 11/25] initial quke support --- server/src/parser/lexer.ts | 40 +++++++++++++++--- server/src/parser/parser.ts | 65 ++++++++++++++++++++++++----- server/src/parser/quke.ts | 55 +++++++++++++++++++++++++ server/src/qLangServer.ts | 82 ++++++++++++++++++++++++------------- test/suite/parser.test.ts | 2 +- 5 files changed, 198 insertions(+), 46 deletions(-) create mode 100644 server/src/parser/quke.ts diff --git a/server/src/parser/lexer.ts b/server/src/parser/lexer.ts index 26f0c9dd..0d880605 100644 --- a/server/src/parser/lexer.ts +++ b/server/src/parser/lexer.ts @@ -46,12 +46,21 @@ import { SemiColon, WhiteSpace, } from "./tokens"; +import { + After, + Before, + Description, + Expect, + Feature, + Quke, + Should, + ToMatch, +} from "./quke"; -export const QTokens = [ - BlockComment, - LastComment, - LineComment, - CharLiteral, +const Prelude = [BlockComment, LastComment, LineComment, CharLiteral]; + +const QTokens = [ + Quke, Command, SymbolLiteral, DateTimeLiteral, @@ -84,4 +93,23 @@ export const QTokens = [ RCurly, ]; -export const QLexer = new Lexer(QTokens, { safeMode: true }); +const QukeTokens = [ + Description, + Feature, + Before, + After, + Should, + Expect, + ToMatch, +]; + +export const QLexer = new Lexer( + { + defaultMode: "q_mode", + modes: { + q_mode: [...Prelude, ...QTokens], + quke_mode: [...Prelude, ...QukeTokens, ...QTokens], + }, + }, + { safeMode: true }, +); diff --git a/server/src/parser/parser.ts b/server/src/parser/parser.ts index 5aedc3e5..64e83b0d 100644 --- a/server/src/parser/parser.ts +++ b/server/src/parser/parser.ts @@ -24,11 +24,26 @@ import { RCurly, RParen, } from "./tokens"; -import { Identifier, LSql, RSql } from "./keywords"; +import { Identifier, IdentifierPattern, LSql, RSql } from "./keywords"; +import { After, Before, Expect, Feature, Quke, Should, ToMatch } from "./quke"; -function setQualified(token: Token, namespace: string) { +function args(image: string, count: number): string[] { + return image.split(/\s+/, count); +} + +function isIdentifier(image: string): boolean { + const matches = IdentifierPattern.exec(image); + return !matches || matches[0] === image; +} + +function setQualified(token: Token, namespace: string): void { token.identifier = - token.scope || !namespace ? token.image : `${namespace}.${token.image}`; + !namespace || + !namespace.startsWith(".") || + token.scope || + token.image.startsWith(".") + ? token.image + : `${namespace}.${token.image}`; } export const enum TokenKind { @@ -36,12 +51,18 @@ export const enum TokenKind { Assignment, } +export const enum IdentifierKind { + Argument, + Table, + Sql, +} + export interface Token extends IToken { kind?: TokenKind; + identifier?: string; + identifierKind?: IdentifierKind; scope?: Token; lambda?: Token; - argument?: boolean; - identifier?: string; } export function parse(text: string): Token[] { @@ -61,7 +82,7 @@ export function parse(text: string): Token[] { case Identifier: if (argument) { token.kind = TokenKind.Assignment; - token.argument = true; + token.identifierKind = IdentifierKind.Argument; token.scope = scopes[scopes.length - 1]; token.identifier = token.image; } else { @@ -74,9 +95,13 @@ export function parse(text: string): Token[] { break; case Colon: case DoubleColon: - if (!sql && !table) { - prev = tokens[i - 1]; - if (prev?.kind === TokenKind.Identifier) { + prev = tokens[i - 1]; + if (prev?.kind === TokenKind.Identifier) { + if (sql) { + prev.identifierKind = IdentifierKind.Sql; + } else if (table) { + prev.identifierKind = IdentifierKind.Table; + } else { prev.kind = TokenKind.Assignment; if (token.tokenType === DoubleColon) { prev.scope = undefined; @@ -125,15 +150,33 @@ export function parse(text: string): Token[] { } break; case Command: - const [cmd, arg] = token.image.split(/\s+/, 2); + const [cmd, arg] = args(token.image, 2); switch (cmd) { case "\\d": - if (arg) { + if (arg && arg.startsWith(".") && isIdentifier(arg)) { namespace = arg === "." ? "" : arg; } break; } break; + case Quke: + case Feature: + case Should: + if (scopes[scopes.length - 1]) { + scopes.pop(); + } + break; + case Before: + case After: + case ToMatch: + case Expect: + if (scopes[scopes.length - 1]) { + scopes.pop(); + } + token.kind = TokenKind.Assignment; + token.lambda = token; + scopes.push(token); + break; } } diff --git a/server/src/parser/quke.ts b/server/src/parser/quke.ts new file mode 100644 index 00000000..5c298a14 --- /dev/null +++ b/server/src/parser/quke.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 1998-2023 Kx Systems Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +import { createToken } from "chevrotain"; + +export const Quke = createToken({ + name: "Quke", + pattern: /(? + token.scope === source.scope && + token.kind === TokenKind.Assignment && + token.identifier === source.identifier, + ) + ); +} + function hasPosition(token: Token, position: Position) { const { start, end } = rangeFromToken(token); return ( @@ -55,11 +74,11 @@ function hasPosition(token: Token, position: Position) { ); } -const enum FindKind { - Reference, - Definition, - Rename, - Completion, +function isAssignable(token: Token) { + return ( + token.identifierKind !== IdentifierKind.Sql && + token.identifierKind !== IdentifierKind.Table + ); } export default class QLangServer { @@ -120,7 +139,9 @@ export default class QLangServer { DocumentSymbol.create( token.image, undefined, - token.argument ? SymbolKind.Array : SymbolKind.Variable, + token.identifierKind === IdentifierKind.Argument + ? SymbolKind.Array + : SymbolKind.Variable, rangeFromToken(token), rangeFromToken(token), ), @@ -192,55 +213,60 @@ export default class QLangServer { } const tokens = parse(document.getText()); const source = tokens.find((token) => hasPosition(token, position)); - if (!source) { + if (!source || !isAssignable(source)) { return []; } - const isLocal = (source: Token) => - source.scope && - tokens.find( - (token) => - token.scope === source.scope && - token.kind === TokenKind.Assignment && - token.identifier === source.identifier, - ); - switch (kind) { case FindKind.Rename: case FindKind.Reference: - return isLocal(source) + return isLocal(source, tokens) ? tokens.filter( (token) => token.tokenType === Identifier && token.identifier === source.identifier && - token.scope === source.scope, + token.scope === source.scope && + isAssignable(token), ) : tokens.filter( (token) => token.tokenType === Identifier && token.identifier === source.identifier && - !isLocal(token), + !isLocal(token, tokens) && + isAssignable(token), ); case FindKind.Definition: - return isLocal(source) + return isLocal(source, tokens) ? tokens.filter( (token) => token.kind === TokenKind.Assignment && token.identifier === source.identifier && - token.scope === source.scope, + token.scope === source.scope && + isAssignable(token), ) : tokens.filter( (token) => token.kind === TokenKind.Assignment && token.identifier === source.identifier && - !isLocal(token), + !isLocal(token, tokens) && + isAssignable(token), ); case FindKind.Completion: - return tokens.filter( - (token) => - token.kind === TokenKind.Assignment && - (!token.scope || token.scope === source.scope), - ); + const completions: Token[] = []; + tokens + .filter( + (token) => + token.kind === TokenKind.Assignment && + (!token.scope || token.scope === source.scope) && + isAssignable(token), + ) + .forEach( + (token) => + !completions.find( + (item) => item.identifier === token.identifier, + ) && completions.push(token), + ); + return completions; } } } diff --git a/test/suite/parser.test.ts b/test/suite/parser.test.ts index 2a9df9d9..4a46808b 100644 --- a/test/suite/parser.test.ts +++ b/test/suite/parser.test.ts @@ -15,7 +15,7 @@ import * as assert from "assert"; import { generateTextMateGrammar } from "../../server/src/parser"; describe("Parser", () => { - describe("TextMate", () => { + describe("language", () => { it("should generate TextMate grammar file", () => { const grammar = generateTextMateGrammar(); assert.ok(grammar); From 25ad8f8e150b08431b20d716c7e680aa1ef84bcd Mon Sep 17 00:00:00 2001 From: ecmel Date: Thu, 25 Apr 2024 21:49:04 +0300 Subject: [PATCH 12/25] fixes KXI-42841 --- server/src/parser/language.ts | 100 ++++++------- server/src/parser/lexer.ts | 35 ++++- server/src/parser/parser.ts | 57 ++++++-- server/src/parser/quke.ts | 111 ++++++++++++-- syntaxes/q.tmLanguage.json | 266 +++++++++++++++++++++++++--------- 5 files changed, 408 insertions(+), 161 deletions(-) diff --git a/server/src/parser/language.ts b/server/src/parser/language.ts index 9df0ea2d..d41debeb 100644 --- a/server/src/parser/language.ts +++ b/server/src/parser/language.ts @@ -37,11 +37,36 @@ import { import { TokenType } from "chevrotain"; import { writeFileSync } from "fs"; import { resolve } from "path"; +import { Quke, qukeNoDescription, qukeWithDescription } from "./quke"; function _(token: TokenType | RegExp) { return ("PATTERN" in token ? `${token.PATTERN}` : `${token}`).slice(1, -1); } +const includes = [ + { + include: "#comments", + }, + { + include: "#strings", + }, + { + include: "#literals", + }, + { + include: "#keywords", + }, + { + include: "#identifiers", + }, + { + include: "#commands", + }, + { + include: "#operators", + }, +]; + const qdoc = { patterns: [ { @@ -79,37 +104,28 @@ const qdoc = { ], }; -const qtest = { +const quke = { patterns: [ { - name: "comment.feature.q", - begin: "\\b[x]feature\\b", - end: "^(?=\\S)", - }, - { - name: "comment.should.q", - begin: "\\b[x]should\\b", - end: "^((?=\\S)|\\s+(?=[x]?should))\\b", - }, - { - name: "comment.other.q", - begin: "\\b[x](expect|bench|property)\\b", - end: "^((?=\\S)|\\s+(?=[x]?(should|expect|bench|property)))\\b", - }, - { - name: "support.function.q", - match: "\\b(before|after|skip)\\b", - }, - { - match: "\\b(feature|should|expect|bench|property)\\b\\s+(.*)", - captures: { - 1: { + begin: _(Quke), + patterns: [ + ...qukeWithDescription.map((item) => ({ + match: _(item), + captures: { + 1: { + name: "support.function.q", + }, + 2: { + name: "string.quoted.q", + }, + }, + })), + ...qukeNoDescription.map((item) => ({ name: "support.function.q", - }, - 2: { - name: "string.quoted.q", - }, - }, + match: _(item), + })), + ...includes, + ], }, ], }; @@ -124,33 +140,15 @@ const language = { scopeName: "source.q", patterns: [ { - include: "#comments", - }, - { - include: "#strings", - }, - { - include: "#qtest", - }, - { - include: "#literals", - }, - { - include: "#keywords", - }, - { - include: "#identifiers", - }, - { - include: "#commands", - }, - { - include: "#operators", + include: "#quke", }, + ...includes, ], repository: { comments: { patterns: [ + quke, + qdoc, { name: "comment.block.q", begin: _(BlockComment[0]), @@ -169,7 +167,6 @@ const language = { }, ], }, - qdoc, strings: { patterns: [ { @@ -185,7 +182,6 @@ const language = { }, ], }, - qtest, literals: { patterns: [ { diff --git a/server/src/parser/lexer.ts b/server/src/parser/lexer.ts index 0d880605..f4731ec0 100644 --- a/server/src/parser/lexer.ts +++ b/server/src/parser/lexer.ts @@ -48,19 +48,29 @@ import { } from "./tokens"; import { After, + AfterEach, + Baseline, Before, - Description, + BeforeEach, + Behaviour, + Bench, Expect, Feature, + Property, Quke, + Replicate, + Setup, Should, + SkipIf, + Teardown, + TimeLimit, ToMatch, + Tolerance, } from "./quke"; const Prelude = [BlockComment, LastComment, LineComment, CharLiteral]; const QTokens = [ - Quke, Command, SymbolLiteral, DateTimeLiteral, @@ -94,12 +104,23 @@ const QTokens = [ ]; const QukeTokens = [ - Description, - Feature, - Before, After, - Should, + AfterEach, + Baseline, + Before, + BeforeEach, + Behaviour, + Bench, Expect, + Feature, + Property, + Replicate, + Setup, + Should, + SkipIf, + Teardown, + TimeLimit, + Tolerance, ToMatch, ]; @@ -107,7 +128,7 @@ export const QLexer = new Lexer( { defaultMode: "q_mode", modes: { - q_mode: [...Prelude, ...QTokens], + q_mode: [...Prelude, Quke, ...QTokens], quke_mode: [...Prelude, ...QukeTokens, ...QTokens], }, }, diff --git a/server/src/parser/parser.ts b/server/src/parser/parser.ts index 64e83b0d..afcf8c34 100644 --- a/server/src/parser/parser.ts +++ b/server/src/parser/parser.ts @@ -25,7 +25,26 @@ import { RParen, } from "./tokens"; import { Identifier, IdentifierPattern, LSql, RSql } from "./keywords"; -import { After, Before, Expect, Feature, Quke, Should, ToMatch } from "./quke"; +import { + After, + AfterEach, + Baseline, + Before, + BeforeEach, + Behaviour, + Bench, + Expect, + Feature, + Property, + Replicate, + Setup, + Should, + SkipIf, + Teardown, + TimeLimit, + ToMatch, + Tolerance, +} from "./quke"; function args(image: string, count: number): string[] { return image.split(/\s+/, count); @@ -55,6 +74,7 @@ export const enum IdentifierKind { Argument, Table, Sql, + Quke, } export interface Token extends IToken { @@ -63,6 +83,7 @@ export interface Token extends IToken { identifierKind?: IdentifierKind; scope?: Token; lambda?: Token; + description?: string; } export function parse(text: string): Token[] { @@ -112,7 +133,7 @@ export function parse(text: string): Token[] { break; case LCurly: prev = tokens[i - 2]; - if (prev?.kind === TokenKind.Assignment) { + if (prev?.kind === TokenKind.Assignment && !prev.lambda) { prev.lambda = token; } next = tokens[i + 1]; @@ -136,11 +157,8 @@ export function parse(text: string): Token[] { sql--; break; case LParen: - if (table) { - table++; - } next = tokens[i + 1]; - if (next?.tokenType === LBracket) { + if (table || next?.tokenType === LBracket) { table++; } break; @@ -159,21 +177,30 @@ export function parse(text: string): Token[] { break; } break; - case Quke: + case Bench: case Feature: + case Replicate: case Should: - if (scopes[scopes.length - 1]) { - scopes.pop(); - } + case TimeLimit: + case Tolerance: + token.identifierKind = IdentifierKind.Quke; + scopes.pop(); break; - case Before: case After: - case ToMatch: + case AfterEach: + case Baseline: + case Before: + case BeforeEach: + case Behaviour: case Expect: - if (scopes[scopes.length - 1]) { - scopes.pop(); - } + case Property: + case Setup: + case SkipIf: + case Teardown: + case ToMatch: + scopes.pop(); token.kind = TokenKind.Assignment; + token.identifierKind = IdentifierKind.Quke; token.lambda = token; scopes.push(token); break; diff --git a/server/src/parser/quke.ts b/server/src/parser/quke.ts index 5c298a14..c952e680 100644 --- a/server/src/parser/quke.ts +++ b/server/src/parser/quke.ts @@ -21,12 +21,42 @@ export const Quke = createToken({ export const Feature = createToken({ name: "Feature", - pattern: /\bx?feature\b/, + pattern: /\b(x?feature)\b(.*)/, }); -export const Before = createToken({ - name: "Before", - pattern: /\bx?before\b/, +export const Should = createToken({ + name: "Should", + pattern: /\b(x?should)\b(.*)/, +}); + +export const Expect = createToken({ + name: "Expect", + pattern: /\b(x?expect)\b(.*)/, +}); + +export const ToMatch = createToken({ + name: "ToMatch", + pattern: /\b(x?to match)\b(.*)/, +}); + +export const Behaviour = createToken({ + name: "Behaviour", + pattern: /\b(x?behaviour)\b(.*)/, +}); + +export const Baseline = createToken({ + name: "Baseline", + pattern: /\b(x?baseline)\b(.*)/, +}); + +export const Bench = createToken({ + name: "Bench", + pattern: /\b(x?bench)\b(.*)/, +}); + +export const Property = createToken({ + name: "Property", + pattern: /\b(x?property)\b(.*)/, }); export const After = createToken({ @@ -34,22 +64,71 @@ export const After = createToken({ pattern: /\bx?after\b/, }); -export const Should = createToken({ - name: "Should", - pattern: /\bx?should\b/, +export const AfterEach = createToken({ + name: "AfterEach", + pattern: /\bx?after each\b/, }); -export const Expect = createToken({ - name: "Expect", - pattern: /\bx?expect\b/, +export const Before = createToken({ + name: "Before", + pattern: /\bx?before\b/, }); -export const ToMatch = createToken({ - name: "ToMatch", - pattern: /\bx?to match\b/, +export const BeforeEach = createToken({ + name: "BeforeEach", + pattern: /\bx?before each\b/, +}); + +export const Setup = createToken({ + name: "Setup", + pattern: /\bx?setup\b/, }); -export const Description = createToken({ - name: "Description", - pattern: /(?<=\bx?(?:feature|should|expect|to match)\b)[^\r\n]*/, +export const Teardown = createToken({ + name: "Teardown", + pattern: /\bx?teardown\b/, }); + +export const SkipIf = createToken({ + name: "SkipIf", + pattern: /\bx?skip if\b/, +}); + +export const TimeLimit = createToken({ + name: "TimeLimit", + pattern: /\bx?timelimit\b/, +}); + +export const Tolerance = createToken({ + name: "Tolerance", + pattern: /\bx?tolerance\b/, +}); + +export const Replicate = createToken({ + name: "Replicate", + pattern: /\bx?replicate\b/, +}); + +export const qukeWithDescription = [ + Feature, + Should, + Expect, + ToMatch, + Behaviour, + Baseline, + Bench, + Property, +]; + +export const qukeNoDescription = [ + After, + AfterEach, + Before, + BeforeEach, + Setup, + Teardown, + SkipIf, + TimeLimit, + Tolerance, + Replicate, +]; diff --git a/syntaxes/q.tmLanguage.json b/syntaxes/q.tmLanguage.json index aed423cf..bafd8d88 100644 --- a/syntaxes/q.tmLanguage.json +++ b/syntaxes/q.tmLanguage.json @@ -4,13 +4,13 @@ "scopeName": "source.q", "patterns": [ { - "include": "#comments" + "include": "#quke" }, { - "include": "#strings" + "include": "#comments" }, { - "include": "#qtest" + "include": "#strings" }, { "include": "#literals" @@ -31,6 +31,198 @@ "repository": { "comments": { "patterns": [ + { + "patterns": [ + { + "begin": "(? Date: Thu, 25 Apr 2024 23:13:20 +0300 Subject: [PATCH 13/25] fixed coloring in quke --- server/src/parser/language.ts | 8 ++++++++ server/src/parser/lexer.ts | 4 ++-- server/src/parser/quke.ts | 6 +++--- syntaxes/q.tmLanguage.json | 18 +++++++++++++----- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/server/src/parser/language.ts b/server/src/parser/language.ts index d41debeb..8c2f83b1 100644 --- a/server/src/parser/language.ts +++ b/server/src/parser/language.ts @@ -108,6 +108,14 @@ const quke = { patterns: [ { begin: _(Quke), + captures: { + 1: { + name: "support.function.q", + }, + 2: { + name: "string.quoted.q", + }, + }, patterns: [ ...qukeWithDescription.map((item) => ({ match: _(item), diff --git a/server/src/parser/lexer.ts b/server/src/parser/lexer.ts index f4731ec0..c50955e5 100644 --- a/server/src/parser/lexer.ts +++ b/server/src/parser/lexer.ts @@ -104,11 +104,11 @@ const QTokens = [ ]; const QukeTokens = [ - After, AfterEach, + After, Baseline, - Before, BeforeEach, + Before, Behaviour, Bench, Expect, diff --git a/server/src/parser/quke.ts b/server/src/parser/quke.ts index c952e680..ad90e933 100644 --- a/server/src/parser/quke.ts +++ b/server/src/parser/quke.ts @@ -15,7 +15,7 @@ import { createToken } from "chevrotain"; export const Quke = createToken({ name: "Quke", - pattern: /(? Date: Fri, 26 Apr 2024 07:53:40 +0300 Subject: [PATCH 14/25] update language --- server/src/parser/language.ts | 291 ++++++++++++-------------- server/src/parser/lexer.ts | 6 +- server/src/parser/parser.ts | 3 +- syntaxes/q.tmLanguage.json | 378 ++++++++++++++++------------------ 4 files changed, 314 insertions(+), 364 deletions(-) diff --git a/server/src/parser/language.ts b/server/src/parser/language.ts index 8c2f83b1..5e3c7447 100644 --- a/server/src/parser/language.ts +++ b/server/src/parser/language.ts @@ -28,6 +28,7 @@ import { Identifier, Keyword, Reserved } from "./keywords"; import { Colon, Command, + Comparator, DoubleColon, Iterator, LineComment, @@ -45,10 +46,7 @@ function _(token: TokenType | RegExp) { const includes = [ { - include: "#comments", - }, - { - include: "#strings", + include: "#multiline", }, { include: "#literals", @@ -57,13 +55,7 @@ const includes = [ include: "#keywords", }, { - include: "#identifiers", - }, - { - include: "#commands", - }, - { - include: "#operators", + include: "#tokens", }, ]; @@ -140,7 +132,138 @@ const quke = { const BlockComment = [/^\/\s*$/, /^\\\s*$/]; const StringLiteral = [/"/, /\\["\\]/]; -const ControlKeyword = /[$!?#@'^]/; + +const repository = { + quke, + qdoc, + multiline: { + patterns: [ + { + name: "comment.block.q", + begin: _(BlockComment[0]), + end: _(BlockComment[1]), + }, + { + name: "comment.last.q", + begin: _(BlockComment[1]), + }, + { + include: "#qdoc", + }, + { + name: "comment.line.q", + match: _(LineComment), + }, + { + name: "string.quoted.q", + begin: _(StringLiteral[0]), + end: _(StringLiteral[0]), + patterns: [ + { + name: "constant.character.escape.q", + match: _(StringLiteral[1]), + }, + ], + }, + ], + }, + literals: { + patterns: [ + { + name: "support.type.symbol.q", + match: _(SymbolLiteral), + }, + { + name: "constant.numeric.datetime.q", + match: _(DateTimeLiteral), + }, + { + name: "constant.numeric.timestamp.q", + match: _(TimeStampLiteral), + }, + { + name: "constant.numeric.date.q", + match: _(DateLiteral), + }, + { + name: "constant.numeric.month.q", + match: _(MonthLiteral), + }, + { + name: "constant.numeric.time.q", + match: _(TimeLiteral), + }, + { + name: "constant.numeric.file.q", + match: _(FileLiteral), + }, + { + name: "constant.language.infinity.q", + match: _(InfinityLiteral), + }, + { + name: "constant.numeric.binary.q", + match: _(BinaryLiteral), + }, + { + name: "constant.numeric.byte.q", + match: _(ByteLiteral), + }, + { + name: "constant.numeric.number.q", + match: _(NumberLiteral), + }, + ], + }, + keywords: { + patterns: [ + { + name: "keyword.other.reserved.q", + match: `${_(Reserved)}\\b`, + }, + { + name: "keyword.other.q", + match: `\\b${_(Keyword)}\\b`, + }, + { + name: "variable.other.q", + match: `${_(Identifier)}\\b`, + }, + ], + }, + tokens: { + patterns: [ + { + name: "constant.character.q", + match: _(Command), + }, + { + name: "keyword.other.iterator.q", + match: _(Iterator), + }, + { + name: "punctuation.assignment.q", + match: _(DoubleColon), + }, + { + name: "keyword.operator.arithmetic.q", + match: _(Operator), + }, + { + name: "keyword.operator.arithmetic.q", + match: _(Comparator), + }, + { + name: "punctuation.assignment.q", + match: _(Colon), + }, + { + name: "punctuation.terminator.statement.q", + match: _(SemiColon), + }, + ], + }, +}; const language = { description: "This file is auto generated DO NOT EDIT", @@ -152,149 +275,7 @@ const language = { }, ...includes, ], - repository: { - comments: { - patterns: [ - quke, - qdoc, - { - name: "comment.block.q", - begin: _(BlockComment[0]), - end: _(BlockComment[1]), - }, - { - name: "comment.last.q", - begin: _(BlockComment[1]), - }, - { - include: "#qdoc", - }, - { - name: "comment.line.q", - match: _(LineComment), - }, - ], - }, - strings: { - patterns: [ - { - name: "string.quoted.q", - begin: _(StringLiteral[0]), - end: _(StringLiteral[0]), - patterns: [ - { - name: "constant.character.escape.q", - match: _(StringLiteral[1]), - }, - ], - }, - ], - }, - literals: { - patterns: [ - { - name: "support.type.symbol.q", - match: _(SymbolLiteral), - }, - { - name: "constant.numeric.datetime.q", - match: _(DateTimeLiteral), - }, - { - name: "constant.numeric.timestamp.q", - match: _(TimeStampLiteral), - }, - { - name: "constant.numeric.date.q", - match: _(DateLiteral), - }, - { - name: "constant.numeric.month.q", - match: _(MonthLiteral), - }, - { - name: "constant.numeric.time.q", - match: _(TimeLiteral), - }, - { - name: "constant.numeric.file.q", - match: _(FileLiteral), - }, - { - name: "constant.language.infinity.q", - match: _(InfinityLiteral), - }, - { - name: "constant.numeric.binary.q", - match: _(BinaryLiteral), - }, - { - name: "constant.numeric.byte.q", - match: _(ByteLiteral), - }, - { - name: "constant.numeric.number.q", - match: _(NumberLiteral), - }, - ], - }, - keywords: { - patterns: [ - { - name: "keyword.other.reserved.q", - match: `${_(Reserved)}\\b`, - }, - { - name: "keyword.other.q", - match: `\\b${_(Keyword)}\\b`, - }, - ], - }, - identifiers: { - patterns: [ - { - name: "variable.other.q", - match: `${_(Identifier)}\\b`, - }, - ], - }, - commands: { - patterns: [ - { - name: "constant.character.q", - match: _(Command), - }, - ], - }, - operators: { - patterns: [ - { - name: "keyword.other.iterator.q", - match: _(Iterator), - }, - { - name: "keyword.other.control.q", - match: _(ControlKeyword), - }, - { - name: "keyword.operator.arithmetic.q", - match: _(Operator), - }, - { - name: "punctuation.assignment.q", - match: _(Colon), - }, - { - name: "punctuation.assignment.q", - match: _(DoubleColon), - }, - { - name: "punctuation.terminator.statement.q", - match: _(SemiColon), - }, - ], - }, - }, + repository, }; export function generateTextMateGrammar() { diff --git a/server/src/parser/lexer.ts b/server/src/parser/lexer.ts index c50955e5..f8c7f823 100644 --- a/server/src/parser/lexer.ts +++ b/server/src/parser/lexer.ts @@ -68,7 +68,7 @@ import { Tolerance, } from "./quke"; -const Prelude = [BlockComment, LastComment, LineComment, CharLiteral]; +const MultiLine = [BlockComment, LastComment, LineComment, CharLiteral]; const QTokens = [ Command, @@ -128,8 +128,8 @@ export const QLexer = new Lexer( { defaultMode: "q_mode", modes: { - q_mode: [...Prelude, Quke, ...QTokens], - quke_mode: [...Prelude, ...QukeTokens, ...QTokens], + q_mode: [...MultiLine, Quke, ...QTokens], + quke_mode: [...MultiLine, ...QukeTokens, ...QTokens], }, }, { safeMode: true }, diff --git a/server/src/parser/parser.ts b/server/src/parser/parser.ts index afcf8c34..5f0b08be 100644 --- a/server/src/parser/parser.ts +++ b/server/src/parser/parser.ts @@ -83,7 +83,6 @@ export interface Token extends IToken { identifierKind?: IdentifierKind; scope?: Token; lambda?: Token; - description?: string; } export function parse(text: string): Token[] { @@ -171,7 +170,7 @@ export function parse(text: string): Token[] { const [cmd, arg] = args(token.image, 2); switch (cmd) { case "\\d": - if (arg && arg.startsWith(".") && isIdentifier(arg)) { + if (arg?.startsWith(".") && isIdentifier(arg)) { namespace = arg === "." ? "" : arg; } break; diff --git a/syntaxes/q.tmLanguage.json b/syntaxes/q.tmLanguage.json index ca0fb972..7daf63fa 100644 --- a/syntaxes/q.tmLanguage.json +++ b/syntaxes/q.tmLanguage.json @@ -7,10 +7,7 @@ "include": "#quke" }, { - "include": "#comments" - }, - { - "include": "#strings" + "include": "#multiline" }, { "include": "#literals" @@ -19,22 +16,25 @@ "include": "#keywords" }, { - "include": "#identifiers" - }, - { - "include": "#commands" - }, - { - "include": "#operators" + "include": "#tokens" } ], "repository": { - "comments": { + "quke": { "patterns": [ { + "begin": "(?]" }, { "name": "punctuation.assignment.q", - "match": "::" + "match": ":" }, { "name": "punctuation.terminator.statement.q", From 7ef703dfd8e7df3d2fa0e48745bd21806b9d9e75 Mon Sep 17 00:00:00 2001 From: ecmel Date: Fri, 26 Apr 2024 08:36:45 +0300 Subject: [PATCH 15/25] added static system d --- server/src/parser/keywords.ts | 6 ++++++ server/src/parser/language.ts | 16 ++++------------ server/src/parser/lexer.ts | 3 ++- server/src/parser/parser.ts | 26 ++++++++++++++++++++++---- syntaxes/q.tmLanguage.json | 8 -------- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/server/src/parser/keywords.ts b/server/src/parser/keywords.ts index 8c5863e4..c913f15f 100644 --- a/server/src/parser/keywords.ts +++ b/server/src/parser/keywords.ts @@ -20,6 +20,12 @@ export const Identifier = createToken({ pattern: IdentifierPattern, }); +export const System = createToken({ + name: "System", + pattern: /system/, + longer_alt: Identifier, +}); + export const LSql = createToken({ name: "LSql", pattern: /(?:select|exec|update|delete)/, diff --git a/server/src/parser/language.ts b/server/src/parser/language.ts index 5e3c7447..9f4d2408 100644 --- a/server/src/parser/language.ts +++ b/server/src/parser/language.ts @@ -40,10 +40,6 @@ import { writeFileSync } from "fs"; import { resolve } from "path"; import { Quke, qukeNoDescription, qukeWithDescription } from "./quke"; -function _(token: TokenType | RegExp) { - return ("PATTERN" in token ? `${token.PATTERN}` : `${token}`).slice(1, -1); -} - const includes = [ { include: "#multiline", @@ -83,14 +79,6 @@ const qdoc = { }, ], }, - { - name: "variable.other.qdoc", - match: "[\\w.]+?(?=\\s*{.+})", - }, - { - name: "variable.other.qdoc", - match: "\\s\\.[\\w.]+?\\s", - }, ], }, ], @@ -278,6 +266,10 @@ const language = { repository, }; +function _(token: TokenType | RegExp) { + return ("PATTERN" in token ? `${token.PATTERN}` : `${token}`).slice(1, -1); +} + export function generateTextMateGrammar() { const grammar = JSON.stringify(language, null, 2); writeFileSync(resolve("syntaxes", "q.tmLanguage.json"), grammar); diff --git a/server/src/parser/lexer.ts b/server/src/parser/lexer.ts index f8c7f823..5beaed53 100644 --- a/server/src/parser/lexer.ts +++ b/server/src/parser/lexer.ts @@ -12,7 +12,7 @@ */ import { Lexer } from "chevrotain"; -import { RSql, Identifier, Keyword, LSql, Reserved } from "./keywords"; +import { RSql, Identifier, Keyword, LSql, Reserved, System } from "./keywords"; import { BinaryLiteral, ByteLiteral, @@ -83,6 +83,7 @@ const QTokens = [ BinaryLiteral, ByteLiteral, NumberLiteral, + System, LSql, RSql, Keyword, diff --git a/server/src/parser/parser.ts b/server/src/parser/parser.ts index 5f0b08be..96a18f8b 100644 --- a/server/src/parser/parser.ts +++ b/server/src/parser/parser.ts @@ -24,7 +24,7 @@ import { RCurly, RParen, } from "./tokens"; -import { Identifier, IdentifierPattern, LSql, RSql } from "./keywords"; +import { Identifier, IdentifierPattern, LSql, RSql, System } from "./keywords"; import { After, AfterEach, @@ -45,6 +45,7 @@ import { ToMatch, Tolerance, } from "./quke"; +import { CharLiteral } from "./literals"; function args(image: string, count: number): string[] { return image.split(/\s+/, count); @@ -96,6 +97,12 @@ export function parse(text: string): Token[] { let argument = 0; let token, prev, next: IToken; + const _namespace = (arg: string) => { + if (arg?.startsWith(".") && isIdentifier(arg)) { + namespace = arg === "." ? "" : arg; + } + }; + for (let i = 0; i < tokens.length; i++) { token = tokens[i]; switch (token.tokenType) { @@ -170,12 +177,23 @@ export function parse(text: string): Token[] { const [cmd, arg] = args(token.image, 2); switch (cmd) { case "\\d": - if (arg?.startsWith(".") && isIdentifier(arg)) { - namespace = arg === "." ? "" : arg; - } + _namespace(arg); break; } break; + case System: + next = tokens[i + 1]; + if (next?.tokenType === CharLiteral) { + const [cmd, arg] = args(next.image.slice(1, -1), 2); + switch (cmd) { + case "d": + if (token.startColumn === 1) { + _namespace(arg); + } + break; + } + } + break; case Bench: case Feature: case Replicate: diff --git a/syntaxes/q.tmLanguage.json b/syntaxes/q.tmLanguage.json index 7daf63fa..f8e5176e 100644 --- a/syntaxes/q.tmLanguage.json +++ b/syntaxes/q.tmLanguage.json @@ -198,14 +198,6 @@ "match": "\\b(type|atom|anything|dict|enum|function|hsym|option|string|table|tuple|typedef|vector|bool|boolean|byte|char|character|date|datetime|float|guid|int|integer|long|minute|month|real|second|short|string|symbol|time|timespan|timestamp)\\b" } ] - }, - { - "name": "variable.other.qdoc", - "match": "[\\w.]+?(?=\\s*{.+})" - }, - { - "name": "variable.other.qdoc", - "match": "\\s\\.[\\w.]+?\\s" } ] } From 7b0f5b55032bd4d8ea4dbcbc0b2f4e8f2c56eeac Mon Sep 17 00:00:00 2001 From: ecmel Date: Fri, 26 Apr 2024 11:59:48 +0300 Subject: [PATCH 16/25] added tests --- server/src/qLangServer.ts | 2 +- .../{linter.test.ts => buildTools.test.ts} | 20 +++- test/suite/parser.test.ts | 2 +- test/suite/qLangServer.test.ts | 107 +++++++++++++++++- 4 files changed, 123 insertions(+), 8 deletions(-) rename test/suite/{linter.test.ts => buildTools.test.ts} (53%) diff --git a/server/src/qLangServer.ts b/server/src/qLangServer.ts index 1a9a05e8..7fad1f14 100644 --- a/server/src/qLangServer.ts +++ b/server/src/qLangServer.ts @@ -84,7 +84,7 @@ function isAssignable(token: Token) { export default class QLangServer { private declare connection: Connection; private declare params: InitializeParams; - private declare documents: TextDocuments; + public declare documents: TextDocuments; constructor(connection: Connection, params: InitializeParams) { this.connection = connection; diff --git a/test/suite/linter.test.ts b/test/suite/buildTools.test.ts similarity index 53% rename from test/suite/linter.test.ts rename to test/suite/buildTools.test.ts index de30fe1d..2e3491f1 100644 --- a/test/suite/linter.test.ts +++ b/test/suite/buildTools.test.ts @@ -12,11 +12,23 @@ */ import * as assert from "assert"; +import * as tools from "../../src/commands/buildToolsCommand"; +import { workspace } from "vscode"; -describe("Parser", () => { - describe("Feature", () => { - it("should", () => { - assert.strictEqual(1, 1); +describe("buildTools", () => { + describe("connectBuildTools", () => { + it("should connect build tools", async () => { + await assert.doesNotReject(async () => tools.connectBuildTools()); + }); + }); + + describe("lintCommand", () => { + it("should lint", async () => { + const document = await workspace.openTextDocument({ + language: "q", + content: "a;a:1", + }); + await assert.doesNotReject(async () => tools.lintCommand(document)); }); }); }); diff --git a/test/suite/parser.test.ts b/test/suite/parser.test.ts index 4a46808b..296fcfd6 100644 --- a/test/suite/parser.test.ts +++ b/test/suite/parser.test.ts @@ -14,7 +14,7 @@ import * as assert from "assert"; import { generateTextMateGrammar } from "../../server/src/parser"; -describe("Parser", () => { +describe("QParser", () => { describe("language", () => { it("should generate TextMate grammar file", () => { const grammar = generateTextMateGrammar(); diff --git a/test/suite/qLangServer.test.ts b/test/suite/qLangServer.test.ts index fa2318a2..1969cda0 100644 --- a/test/suite/qLangServer.test.ts +++ b/test/suite/qLangServer.test.ts @@ -11,13 +11,19 @@ * specific language governing permissions and limitations under the License. */ -/* eslint @typescript-eslint/no-explicit-any: 0 */ /* eslint @typescript-eslint/no-empty-function: 0 */ import * as assert from "assert"; import * as sinon from "sinon"; -import { Connection, InitializeParams } from "vscode-languageserver"; +import { + Connection, + InitializeParams, + Position, + Range, + TextDocumentIdentifier, +} from "vscode-languageserver"; import QLangServer from "../../server/src/qLangServer"; +import { TextDocument } from "vscode-languageserver-textdocument"; describe("qLangServer", () => { let server: QLangServer; @@ -60,4 +66,101 @@ describe("qLangServer", () => { assert.ok(capabilities.completionProvider); }); }); + + describe("onDocumentSymbol", () => { + it("should return golobals", () => { + const textDocument = TextDocumentIdentifier.create("test.q"); + sinon + .stub(server.documents, "get") + .value(() => TextDocument.create("test.q", "q", 1, "a:1")); + const result = server.onDocumentSymbol({ textDocument }); + assert.strictEqual(result.length, 1); + assert.strictEqual(result[0].name, "a"); + }); + }); + + describe("onReferences", () => { + it("should return golobal references", () => { + const position = Position.create(0, 5); + const context = { + includeDeclaration: true, + }; + const textDocument = TextDocumentIdentifier.create("test.q"); + sinon + .stub(server.documents, "get") + .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); + const result = server.onReferences({ + textDocument, + position, + context, + }); + assert.strictEqual(result.length, 2); + assert.deepStrictEqual(result[0].range, Range.create(0, 0, 0, 1)); + assert.deepStrictEqual(result[1].range, Range.create(0, 4, 0, 5)); + }); + }); + + describe("onDefinition", () => { + it("should return golobal definition", () => { + const position = Position.create(0, 5); + const textDocument = TextDocumentIdentifier.create("test.q"); + sinon + .stub(server.documents, "get") + .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); + const result = server.onDefinition({ + textDocument, + position, + }); + assert.strictEqual(result.length, 1); + assert.deepStrictEqual(result[0].range, Range.create(0, 0, 0, 1)); + }); + }); + + describe("onRenameRequest", () => { + it("should rename golobal identifiers", () => { + const position = Position.create(0, 5); + const newName = "b"; + const textDocument = TextDocumentIdentifier.create("test.q"); + sinon + .stub(server.documents, "get") + .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); + const result = server.onRenameRequest({ + textDocument, + position, + newName, + }); + assert.ok(result); + assert.strictEqual(result.changes[textDocument.uri].length, 2); + }); + }); + + describe("onCompletion", () => { + it("should complete golobal identifiers", () => { + const position = Position.create(0, 5); + const textDocument = TextDocumentIdentifier.create("test.q"); + sinon + .stub(server.documents, "get") + .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); + const result = server.onCompletion({ + textDocument, + position, + }); + assert.strictEqual(result.length, 1); + }); + }); + + describe("onCompletion", () => { + it("should complete golobal variables", () => { + const position = Position.create(0, 5); + const textDocument = TextDocumentIdentifier.create("test.q"); + sinon + .stub(server.documents, "get") + .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); + const result = server.onCompletion({ + textDocument, + position, + }); + assert.strictEqual(result.length, 1); + }); + }); }); From 008b73212218be4dcc1bd7b9c4dd50160a58feb0 Mon Sep 17 00:00:00 2001 From: ecmel Date: Fri, 26 Apr 2024 12:28:02 +0300 Subject: [PATCH 17/25] fixed test --- server/src/parser/language.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/parser/language.ts b/server/src/parser/language.ts index 9f4d2408..a1b67e36 100644 --- a/server/src/parser/language.ts +++ b/server/src/parser/language.ts @@ -272,6 +272,9 @@ function _(token: TokenType | RegExp) { export function generateTextMateGrammar() { const grammar = JSON.stringify(language, null, 2); - writeFileSync(resolve("syntaxes", "q.tmLanguage.json"), grammar); + writeFileSync( + resolve(__dirname, "../".repeat(4), "syntaxes", "q.tmLanguage.json"), + grammar, + ); return grammar; } From ac47c17dd2000293a131a36f27ae0930e7e0955d Mon Sep 17 00:00:00 2001 From: ecmel Date: Fri, 26 Apr 2024 13:47:48 +0300 Subject: [PATCH 18/25] fixed duplicate test --- test/suite/qLangServer.test.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/suite/qLangServer.test.ts b/test/suite/qLangServer.test.ts index 1969cda0..380317ab 100644 --- a/test/suite/qLangServer.test.ts +++ b/test/suite/qLangServer.test.ts @@ -147,15 +147,12 @@ describe("qLangServer", () => { }); assert.strictEqual(result.length, 1); }); - }); - - describe("onCompletion", () => { - it("should complete golobal variables", () => { + it("should filter out duplicates", () => { const position = Position.create(0, 5); const textDocument = TextDocumentIdentifier.create("test.q"); sinon .stub(server.documents, "get") - .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); + .value(() => TextDocument.create("test.q", "q", 1, "a:1;a;a:2;a")); const result = server.onCompletion({ textDocument, position, From 829e08690f0cadd70d4b16bfcdd2438f9037e6e3 Mon Sep 17 00:00:00 2001 From: ecmel Date: Fri, 26 Apr 2024 22:19:52 +0300 Subject: [PATCH 19/25] increase coverage --- server/src/linter/assign.ts | 103 ------- server/src/linter/rules.ts | 542 --------------------------------- server/src/parser/parser.ts | 3 + server/src/qLangServer.ts | 101 +++--- test/suite/qLangServer.test.ts | 131 ++++---- 5 files changed, 115 insertions(+), 765 deletions(-) delete mode 100644 server/src/linter/assign.ts delete mode 100644 server/src/linter/rules.ts diff --git a/server/src/linter/assign.ts b/server/src/linter/assign.ts deleted file mode 100644 index 7f105fe0..00000000 --- a/server/src/linter/assign.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import { Token, TokenType, QAst, scope } from "../parser"; - -export function assignReservedWord({ assign }: QAst): Token[] { - return assign.filter((entity) => entity.type === TokenType.KEYWORD); -} - -export function invalidAssign({ assign }: QAst): Token[] { - return assign.filter((entity) => entity.type === TokenType.LITERAL); -} - -export function unusedParam({ script, assign }: QAst): Token[] { - assign = assign.filter( - (token) => token.type === TokenType.IDENTIFIER && token.tag === "ARGUMENT", - ); - - script = script.filter( - (token) => - token.tag !== "ASSIGNED" && - token.tag !== "ARGUMENT" && - token.type === TokenType.IDENTIFIER && - assign.find((symbol) => symbol.image === token.image), - ); - - assign = assign.filter( - (token) => - !script.find( - (symbol) => - symbol.image === token.image && scope(symbol) === scope(token), - ), - ); - - return assign; -} - -export function unusedVar({ script, assign }: QAst): Token[] { - const locals = assign.filter( - (token) => token.type === TokenType.IDENTIFIER && scope(token), - ); - - assign = assign.filter( - (token) => token.type === TokenType.IDENTIFIER && token.tag === "ASSIGNED", - ); - - script = script.filter( - (token) => - token.tag !== "ASSIGNED" && - token.tag !== "ARGUMENT" && - token.type === TokenType.IDENTIFIER && - assign.find((symbol) => symbol.image === token.image), - ); - - assign = assign.filter( - (token) => - !script.find( - (symbol) => - symbol.image === token.image && - (scope(symbol) === scope(token) || - (!scope(token) && - !locals.find( - (local) => - local.image === token.image && scope(local) === scope(symbol), - ))), - ), - ); - - return assign; -} - -export function declaredAfterUse({ script, assign }: QAst): Token[] { - return assign - .filter((token) => token.tag === "ASSIGNED" && !scope(token)) - .filter((token) => { - const found = script.find( - (entity) => - entity.type === TokenType.IDENTIFIER && - entity.tag !== "ASSIGNED" && - entity.image === token.image && - !scope(entity), - ); - - if (found) { - const group = scope(found, [TokenType.GROUP]); - return group && group === scope(token, [TokenType.GROUP]) - ? found.statement > token.statement - : found.statement < token.statement; - } - - return false; - }); -} diff --git a/server/src/linter/rules.ts b/server/src/linter/rules.ts deleted file mode 100644 index 2bfa6933..00000000 --- a/server/src/linter/rules.ts +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) 1998-2023 Kx Systems Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -import { Token, QAst } from "../parser"; -import { - assignReservedWord, - declaredAfterUse, - invalidAssign, - unusedParam, - unusedVar, -} from "./assign"; -import { - tooManyArguments, - tooManyConstants, - tooManyGlobals, - tooManyLocals, -} from "./limit"; -import { deprecatedDatetime, fixedSeed, invalidEscape } from "./other"; - -export enum RuleSeverity { - ERROR = "ERROR", - WARNING = "WARNING", - INFO = "INFO", - HINT = "HINT", -} - -export interface LinterRule { - name: string; - message: string; - severity: RuleSeverity; - check: (ast: QAst) => Token[]; -} - -const check = () => []; - -const AssignReservedWordRule: LinterRule = { - name: "ASSIGN_RESERVED_WORD", - message: "Assignment to a reserved word", - severity: RuleSeverity.ERROR, - check: assignReservedWord, -}; - -const CondEvenArgsRule: LinterRule = { - name: "COND_EVENARGS", - message: "Conditional $ should not be used with an even number of arguments", - severity: RuleSeverity.ERROR, - check, -}; - -const DeclaredAfterUseRule: LinterRule = { - name: "DECLARED_AFTER_USE", - message: "The variable was declared after being used", - severity: RuleSeverity.HINT, - check: declaredAfterUse, -}; - -const GlobalPeachRule: LinterRule = { - name: "GLOBAL_PEACH", - message: "Modifying globals inside a peach statement is not allowed", - severity: RuleSeverity.ERROR, - check, -}; - -const InvalidAdverbRule: LinterRule = { - name: "INVALID_ADVERB", - message: "A binary adverb cannot be applied to a unary function", - severity: RuleSeverity.ERROR, - check, -}; - -const InvalidAssignRule: LinterRule = { - name: "INVALID_ASSIGN", - message: "Attempt to assign to a string, symbol, or number", - severity: RuleSeverity.ERROR, - check: invalidAssign, -}; - -const InvalidEscapeRule: LinterRule = { - name: "INVALID_ESCAPE", - message: - 'Invalid Escape Sequence: Valid escape sequences are: \\n,\\r,\\t,\\\\,\\/,\\" and three digit octal sequences \\377 or smaller', - severity: RuleSeverity.HINT, - check: invalidEscape, -}; - -const InvalidQukeRule: LinterRule = { - name: "INVALID_QUKE", - message: "A quke file was improperly formatted", - severity: RuleSeverity.ERROR, - check, -}; - -const OverwriteArtifactRule: LinterRule = { - name: "OVERWRITE_ARTIFACT", - message: "Variable assignment overwrites namespace or artifact", - severity: RuleSeverity.ERROR, - check, -}; - -const StatementInExprRule: LinterRule = { - name: "STATEMENT_IN_EXPR", - message: - "If, while, or do statement used in expression, possible missing semicolon", - severity: RuleSeverity.ERROR, - check, -}; - -const ReservedNameRule: LinterRule = { - name: "RESERVED_NAME", - message: "File has reserved name", - severity: RuleSeverity.ERROR, - check, -}; - -const TooManyConstantsRule: LinterRule = { - name: "TOO_MANY_CONSTANTS", - message: "Too many constants in a function", - severity: RuleSeverity.ERROR, - check: tooManyConstants, -}; - -const TooManyGlobalsRule: LinterRule = { - name: "TOO_MANY_GLOBALS", - message: "Too many globals in a function", - severity: RuleSeverity.ERROR, - check: tooManyGlobals, -}; - -const UnindentedCodeRule: LinterRule = { - name: "UNINDENTED_CODE", - message: "Any multiline expression must be indented after the first line", - severity: RuleSeverity.ERROR, - check, -}; - -const TooManyLocalsRule: LinterRule = { - name: "TOO_MANY_LOCALS", - message: "Too many locals in a function", - severity: RuleSeverity.ERROR, - check: tooManyLocals, -}; - -const TooManyArgumentsRule: LinterRule = { - name: "TOO_MANY_ARGUMENTS", - message: "Too many arguments in a function", - severity: RuleSeverity.ERROR, - check: tooManyArguments, -}; - -const BackwardCompatibilityRule: LinterRule = { - name: "BACKWARD_COMPATIBILITY", - message: - "This function has backward compatibility issues with kdb versions less than 3.6", - severity: RuleSeverity.WARNING, - check, -}; - -const CastTypeNumericalRule: LinterRule = { - name: "CAST_TYPE_NUMERICAL", - message: - "Casting using a short to indicate cast type is unnecessarily unclear. Another form is advised", - severity: RuleSeverity.WARNING, - check, -}; - -const ConditionallyDeclaredRule: LinterRule = { - name: "CONDITIONALLY_DECLARED", - message: - "This variable may be undefined at this point, as it was only declared conditionally", - severity: RuleSeverity.WARNING, - check, -}; - -const DebugFunctionRule: LinterRule = { - name: "DEBUG_FUNCTION", - message: "eval, or value when run on a string literal", - severity: RuleSeverity.WARNING, - check, -}; - -const DeprecatedDatetimeRule: LinterRule = { - name: "DEPRECATED_DATETIME", - message: "Datetime has been deprecated", - severity: RuleSeverity.WARNING, - check: deprecatedDatetime, -}; - -const DeprecatedFunctionRule: LinterRule = { - name: "DEPRECATED_FUNCTION", - message: "This file uses a deprecated function", - severity: RuleSeverity.WARNING, - check, -}; - -const EmptyIfRule: LinterRule = { - name: "EMPTY_IF", - message: "If statement lacks code to execute", - severity: RuleSeverity.WARNING, - check, -}; - -const FixedSeedRule: LinterRule = { - name: "FIXED_SEED", - message: - "Inputting a positive number into ?0Ng will result in the same sequence every run", - severity: RuleSeverity.WARNING, - check: fixedSeed, -}; - -const FunctionStartRule: LinterRule = { - name: "FUNCTION_START", - message: "Function artifact must start with a function", - severity: RuleSeverity.WARNING, - check, -}; - -const InsufficientIndentRule: LinterRule = { - name: "INSUFFICIENT_INDENT", - message: - "Indentation must be equal to or greater than the second line of the function body, and the second line must have an indentation greater than the first line", - severity: RuleSeverity.WARNING, - check, -}; - -const InternalRule: LinterRule = { - name: "INTERNAL", - message: "Reference to an internal api of another module", - severity: RuleSeverity.WARNING, - check, -}; - -const InvalidFunctionRule: LinterRule = { - name: "INVALID_FUNCTION", - message: - "Function artifacts must be lambda definitions, rather than projections, immediately invoked functions, or functions in expressions", - severity: RuleSeverity.WARNING, - check, -}; - -const MalformedSuppressionRule: LinterRule = { - name: "MALFORMED_SUPPRESSION", - message: "Malformed @qlintsuppress tag", - severity: RuleSeverity.WARNING, - check, -}; - -const MissingDependencyRule: LinterRule = { - name: "MISSING_DEPENDENCY", - message: - "Any reference to another namespace should be listed in the dependency list", - severity: RuleSeverity.WARNING, - check, -}; - -const NameCollisionRule: LinterRule = { - name: "NAME_COLLISION", - message: "Executing statement in editor could overwrite global variable", - severity: RuleSeverity.WARNING, - check, -}; - -const NeedExplicitReturnRule: LinterRule = { - name: "NEED_EXPLICIT_RETURN", - message: "Explicit return needed. Otherwise will return generic null", - severity: RuleSeverity.WARNING, - check, -}; - -const PossibleReturnRule: LinterRule = { - name: "POSSIBLE_RETURN", - message: "Assignment statement looks like return", - severity: RuleSeverity.WARNING, - check, -}; - -const UndeclaredVarRule: LinterRule = { - name: "UNDECLARED_VAR", - message: "Undeclared variable in function will be treated as global", - severity: RuleSeverity.WARNING, - check, -}; - -const UnusedInternalRule: LinterRule = { - name: "UNUSED_INTERNAL", - message: - "This function is marked as internal (is part of a sub-namespace i) but was never used within the namespace", - severity: RuleSeverity.WARNING, - check, -}; - -const UnusedParamRule: LinterRule = { - name: "UNUSED_PARAM", - message: "This param was declared then never used", - severity: RuleSeverity.HINT, - check: unusedParam, -}; - -const UnusedVarRule: LinterRule = { - name: "UNUSED_VAR", - message: "This variable was declared then never used", - severity: RuleSeverity.HINT, - check: unusedVar, -}; - -const RandomGuidsRule: LinterRule = { - name: "RANDOM_GUIDS", - message: - "Multiple calls to ?0ng in quick succession, with negative numbers, can produce the same output", - severity: RuleSeverity.WARNING, - check, -}; - -const UnreachableCodeRule: LinterRule = { - name: "UNREACHABLE_CODE", - message: "A preceding return prevents this statement from being reached", - severity: RuleSeverity.WARNING, - check, -}; - -const UnexpectedCondNewline: LinterRule = { - name: "UNEXPECTED_COND_NEWLINE", - message: "Condition should begin on same line as loop or if statement", - severity: RuleSeverity.WARNING, - check, -}; - -const UnparenthesizedJoinRule: LinterRule = { - name: "UNPARENTHESIZED_JOIN", - message: - "A potential join in this QSQL statement will be interpreted as separate statements unless wrapped in parentheses", - severity: RuleSeverity.WARNING, - check, -}; - -const VarQErrorRule: LinterRule = { - name: "VAR_Q_ERROR", - message: - "Variable name the same as q error message. This can cause ambiguous error messages", - severity: RuleSeverity.WARNING, - check, -}; - -const MissingSemicolonRule: LinterRule = { - name: "MISSING_SEMICOLON", - message: - "An apply statement spans multiple lines with the same indentation and an assignment on the second line, potentially indicating a missing semi-colon ", - severity: RuleSeverity.WARNING, - check, -}; - -const MalformedRule: LinterRule = { - name: "MALFORMED_RULE", - message: "Malformed @qlintrule tag", - severity: RuleSeverity.WARNING, - check, -}; - -const TodoRule: LinterRule = { - name: "TODO", - message: "Todo qDoc tag present", - severity: RuleSeverity.WARNING, - check, -}; - -const LineLengthRule: LinterRule = { - name: "LINE_LENGTH", - message: "Maximum line length exceeded", - severity: RuleSeverity.WARNING, - check, -}; - -const DefaultQdocRule: LinterRule = { - name: "DEFAULT_QDOC", - message: "The file has the default documentation", - severity: RuleSeverity.INFO, - check, -}; - -const InvalidKindRule: LinterRule = { - name: "INVALID_KIND", - message: "Invalid qdoc kind in tag", - severity: RuleSeverity.INFO, - check, -}; - -const InvalidTypedefRule: LinterRule = { - name: "INVALID_TYPEDEF", - message: "Invalid typedef tag", - severity: RuleSeverity.INFO, - check, -}; - -const InvalidTagRule: LinterRule = { - name: "INVALID_TAG", - message: "Tag not recognized as valid qDoc tag", - severity: RuleSeverity.INFO, - check, -}; - -const MissingOverviewRule: LinterRule = { - name: "MISSING_OVERVIEW", - message: "Missing @fileOverview tag with associated description", - severity: RuleSeverity.INFO, - check, -}; - -const MissingReturnsRule: LinterRule = { - name: "MISSING_RETURNS", - message: "Missing @returns tag", - severity: RuleSeverity.INFO, - check, -}; - -const MissingTypeRule: LinterRule = { - name: "MISSING_TYPE", - message: "Missing type in returns or param tag", - severity: RuleSeverity.INFO, - check, -}; - -const MultipleReturnsRule: LinterRule = { - name: "MULTIPLE_RETURNS", - message: "Multiple @returns tags", - severity: RuleSeverity.INFO, - check, -}; - -const OurOfOrderParamRule: LinterRule = { - name: "OUT_OF_ORDER_PARAM", - message: "Parameters out of order", - severity: RuleSeverity.INFO, - check, -}; - -const ParamNotInCodeRule: LinterRule = { - name: "PARAM_NOT_IN_CODE", - message: "This param is not in the function", - severity: RuleSeverity.INFO, - check, -}; - -const QdocTypeRule: LinterRule = { - name: "QDOC_TYPE", - message: "Invalid type in tag", - severity: RuleSeverity.INFO, - check, -}; - -const RedundantQlobalAssignRule: LinterRule = { - name: "REDUNDANT_GLOBAL_ASSIGN", - message: - "Using the global amend operator on a fully qualified name is redundant", - severity: RuleSeverity.INFO, - check, -}; - -const UndocumentedParamRule: LinterRule = { - name: "UNDOCUMENTED_PARAM", - message: "Undocumented parameter", - severity: RuleSeverity.INFO, - check, -}; - -const UnusedDependencyRule: LinterRule = { - name: "UNUSED_DEPENDENCY", - message: "Unused dependencies", - severity: RuleSeverity.INFO, - check, -}; - -export const Rules: LinterRule[] = [ - AssignReservedWordRule, - CondEvenArgsRule, - DeclaredAfterUseRule, - GlobalPeachRule, - InvalidAdverbRule, - InvalidAssignRule, - InvalidEscapeRule, - InvalidQukeRule, - OverwriteArtifactRule, - StatementInExprRule, - ReservedNameRule, - TooManyConstantsRule, - TooManyGlobalsRule, - TooManyLocalsRule, - TooManyArgumentsRule, - UnindentedCodeRule, - BackwardCompatibilityRule, - CastTypeNumericalRule, - ConditionallyDeclaredRule, - DebugFunctionRule, - DeprecatedDatetimeRule, - DeprecatedFunctionRule, - EmptyIfRule, - FixedSeedRule, - FunctionStartRule, - InsufficientIndentRule, - InternalRule, - InvalidFunctionRule, - MalformedSuppressionRule, - MissingDependencyRule, - NameCollisionRule, - NeedExplicitReturnRule, - PossibleReturnRule, - UndeclaredVarRule, - UnusedInternalRule, - UnusedParamRule, - UnusedVarRule, - RandomGuidsRule, - UnreachableCodeRule, - UnexpectedCondNewline, - UnparenthesizedJoinRule, - VarQErrorRule, - MissingSemicolonRule, - MalformedRule, - TodoRule, - LineLengthRule, - DefaultQdocRule, - InvalidKindRule, - InvalidTypedefRule, - InvalidTagRule, - MissingOverviewRule, - MissingReturnsRule, - MissingTypeRule, - MultipleReturnsRule, - OurOfOrderParamRule, - ParamNotInCodeRule, - QdocTypeRule, - RedundantQlobalAssignRule, - UndocumentedParamRule, - UnusedDependencyRule, -]; diff --git a/server/src/parser/parser.ts b/server/src/parser/parser.ts index 96a18f8b..ce54fa68 100644 --- a/server/src/parser/parser.ts +++ b/server/src/parser/parser.ts @@ -84,6 +84,8 @@ export interface Token extends IToken { identifierKind?: IdentifierKind; scope?: Token; lambda?: Token; + source?: Token; + namespace?: string; } export function parse(text: string): Token[] { @@ -105,6 +107,7 @@ export function parse(text: string): Token[] { for (let i = 0; i < tokens.length; i++) { token = tokens[i]; + token.namespace = namespace; switch (token.tokenType) { case Identifier: if (argument) { diff --git a/server/src/qLangServer.ts b/server/src/qLangServer.ts index 7fad1f14..a702c5f4 100644 --- a/server/src/qLangServer.ts +++ b/server/src/qLangServer.ts @@ -64,16 +64,6 @@ function isLocal(source: Token, tokens: Token[]) { ); } -function hasPosition(token: Token, position: Position) { - const { start, end } = rangeFromToken(token); - return ( - start.line <= position.line && - end.line >= position.line && - start.character <= position.character && - end.character >= position.character - ); -} - function isAssignable(token: Token) { return ( token.identifierKind !== IdentifierKind.Sql && @@ -81,6 +71,24 @@ function isAssignable(token: Token) { ); } +function positionToToken(position: Position, tokens: Token[]) { + return tokens.find((token) => { + const { start, end } = rangeFromToken(token); + return ( + start.line <= position.line && + end.line >= position.line && + start.character <= position.character && + end.character >= position.character + ); + }); +} + +function getLabel(token: Token, source?: Token): string { + return !token.identifier || source?.namespace === token.namespace + ? token.image + : token.identifier; +} + export default class QLangServer { private declare connection: Connection; private declare params: InitializeParams; @@ -112,18 +120,12 @@ export default class QLangServer { public onDocumentSymbol({ textDocument, }: DocumentSymbolParams): DocumentSymbol[] { - const document = this.documents.get(textDocument.uri); - if (!document) { - return []; - } - - const tokens = parse(document.getText()); - + const tokens = this.parse(textDocument); return tokens .filter((token) => token.kind === TokenKind.Assignment && !token.scope) .map((token) => DocumentSymbol.create( - token.identifier || token.image, + getLabel(token), undefined, token.lambda ? SymbolKind.Object : SymbolKind.Variable, rangeFromToken(token), @@ -151,7 +153,9 @@ export default class QLangServer { } public onReferences({ textDocument, position }: ReferenceParams): Location[] { - return this.findIdentifiers(FindKind.Reference, textDocument, position).map( + const tokens = this.parse(textDocument); + const source = positionToToken(position, tokens); + return this.findIdentifiers(FindKind.Reference, tokens, source).map( (token) => Location.create(textDocument.uri, rangeFromToken(token)), ); } @@ -160,11 +164,11 @@ export default class QLangServer { textDocument, position, }: DefinitionParams): Location[] { - return this.findIdentifiers( - FindKind.Definition, - textDocument, - position, - ).map((token) => Location.create(textDocument.uri, rangeFromToken(token))); + const tokens = this.parse(textDocument); + const source = positionToToken(position, tokens); + return this.findIdentifiers(FindKind.Definition, tokens, source).map( + (token) => Location.create(textDocument.uri, rangeFromToken(token)), + ); } public onRenameRequest({ @@ -172,11 +176,11 @@ export default class QLangServer { position, newName, }: RenameParams): WorkspaceEdit | null { - const edits = this.findIdentifiers( - FindKind.Rename, - textDocument, - position, - ).map((token) => TextEdit.replace(rangeFromToken(token), newName)); + const tokens = this.parse(textDocument); + const source = positionToToken(position, tokens); + const edits = this.findIdentifiers(FindKind.Rename, tokens, source).map( + (token) => TextEdit.replace(rangeFromToken(token), newName), + ); return edits.length === 0 ? null : { @@ -190,33 +194,34 @@ export default class QLangServer { textDocument, position, }: CompletionParams): CompletionItem[] { - return this.findIdentifiers( - FindKind.Completion, - textDocument, - position, - ).map((token) => ({ - label: token.identifier || token.image, - kind: token.lambda - ? CompletionItemKind.Function - : CompletionItemKind.Variable, - })); + const tokens = this.parse(textDocument); + const source = positionToToken(position, tokens); + return this.findIdentifiers(FindKind.Completion, tokens, source).map( + (token) => ({ + label: getLabel(token, source), + kind: token.lambda + ? CompletionItemKind.Function + : CompletionItemKind.Variable, + }), + ); } - private findIdentifiers( - kind: FindKind, - textDocument: TextDocumentIdentifier, - position: Position, - ): Token[] { + private parse(textDocument: TextDocumentIdentifier): Token[] { const document = this.documents.get(textDocument.uri); if (!document) { return []; } - const tokens = parse(document.getText()); - const source = tokens.find((token) => hasPosition(token, position)); - if (!source || !isAssignable(source)) { + return parse(document.getText()); + } + + private findIdentifiers( + kind: FindKind, + tokens: Token[], + source?: Token, + ): Token[] { + if (!source) { return []; } - switch (kind) { case FindKind.Rename: case FindKind.Reference: diff --git a/test/suite/qLangServer.test.ts b/test/suite/qLangServer.test.ts index 380317ab..74a8a774 100644 --- a/test/suite/qLangServer.test.ts +++ b/test/suite/qLangServer.test.ts @@ -18,16 +18,26 @@ import * as sinon from "sinon"; import { Connection, InitializeParams, - Position, - Range, TextDocumentIdentifier, } from "vscode-languageserver"; -import QLangServer from "../../server/src/qLangServer"; import { TextDocument } from "vscode-languageserver-textdocument"; +import QLangServer from "../../server/src/qLangServer"; describe("qLangServer", () => { let server: QLangServer; + function createDocument(content: string) { + content = content.trim(); + const document = TextDocument.create("test.q", "q", 1, content); + const position = document.positionAt(content.length); + const textDocument = TextDocumentIdentifier.create("test.q"); + sinon.stub(server.documents, "get").value(() => document); + return { + textDocument, + position, + }; + } + beforeEach(async () => { const connection = ({ listen() {}, @@ -68,96 +78,73 @@ describe("qLangServer", () => { }); describe("onDocumentSymbol", () => { - it("should return golobals", () => { - const textDocument = TextDocumentIdentifier.create("test.q"); - sinon - .stub(server.documents, "get") - .value(() => TextDocument.create("test.q", "q", 1, "a:1")); - const result = server.onDocumentSymbol({ textDocument }); - assert.strictEqual(result.length, 1); - assert.strictEqual(result[0].name, "a"); + it("should return symbols", () => { + const params = createDocument("a:1;b:{[c]d:c+1;d};b"); + const result = server.onDocumentSymbol(params); + assert.strictEqual(result.length, 2); }); }); describe("onReferences", () => { - it("should return golobal references", () => { - const position = Position.create(0, 5); - const context = { - includeDeclaration: true, - }; - const textDocument = TextDocumentIdentifier.create("test.q"); - sinon - .stub(server.documents, "get") - .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); + it("should return references", () => { + const params = createDocument( + '\\d .a\nsystem "d .a"\na:1;b:{[c]d:c+1;d};b', + ); const result = server.onReferences({ - textDocument, - position, - context, + ...params, + context: { includeDeclaration: true }, }); assert.strictEqual(result.length, 2); - assert.deepStrictEqual(result[0].range, Range.create(0, 0, 0, 1)); - assert.deepStrictEqual(result[1].range, Range.create(0, 4, 0, 5)); + }); + it("should return references for quke", () => { + const params = createDocument(` + feature + before + after + before each + after each + should + expect + a:1;a + `); + const result = server.onReferences({ + ...params, + context: { includeDeclaration: true }, + }); + assert.strictEqual(result.length, 2); + }); + it("should skip table and sql", () => { + const params = createDocument("select a:1 from;([]a:1)"); + const result = server.onReferences({ + ...params, + context: { includeDeclaration: true }, + }); + assert.strictEqual(result.length, 0); }); }); describe("onDefinition", () => { - it("should return golobal definition", () => { - const position = Position.create(0, 5); - const textDocument = TextDocumentIdentifier.create("test.q"); - sinon - .stub(server.documents, "get") - .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); - const result = server.onDefinition({ - textDocument, - position, - }); + it("should return definitions", () => { + const params = createDocument("a:1;b:{[c]d:c+1;d};b"); + const result = server.onDefinition(params); assert.strictEqual(result.length, 1); - assert.deepStrictEqual(result[0].range, Range.create(0, 0, 0, 1)); }); }); describe("onRenameRequest", () => { - it("should rename golobal identifiers", () => { - const position = Position.create(0, 5); - const newName = "b"; - const textDocument = TextDocumentIdentifier.create("test.q"); - sinon - .stub(server.documents, "get") - .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); - const result = server.onRenameRequest({ - textDocument, - position, - newName, - }); + it("should rename identifiers", () => { + const params = createDocument("a:1;b:{[c]d:c+1;d};b"); + const result = server.onRenameRequest({ ...params, newName: "newName" }); assert.ok(result); - assert.strictEqual(result.changes[textDocument.uri].length, 2); + assert.strictEqual(result.changes[params.textDocument.uri].length, 2); }); }); describe("onCompletion", () => { - it("should complete golobal identifiers", () => { - const position = Position.create(0, 5); - const textDocument = TextDocumentIdentifier.create("test.q"); - sinon - .stub(server.documents, "get") - .value(() => TextDocument.create("test.q", "q", 1, "a:1;a")); - const result = server.onCompletion({ - textDocument, - position, - }); - assert.strictEqual(result.length, 1); - }); - it("should filter out duplicates", () => { - const position = Position.create(0, 5); - const textDocument = TextDocumentIdentifier.create("test.q"); - sinon - .stub(server.documents, "get") - .value(() => TextDocument.create("test.q", "q", 1, "a:1;a;a:2;a")); - const result = server.onCompletion({ - textDocument, - position, - }); - assert.strictEqual(result.length, 1); + it("should complete identifiers", () => { + const params = createDocument("a:1;b:{[c]d:c+1;d};b"); + const result = server.onCompletion(params); + assert.strictEqual(result.length, 2); }); }); }); From 6f8c255dcb4e2c2f189ede983f523d281f5f374a Mon Sep 17 00:00:00 2001 From: ecmel Date: Sat, 27 Apr 2024 11:01:27 +0300 Subject: [PATCH 20/25] fix for KXI-43318 --- server/src/parser/keywords.ts | 16 +++++--------- server/src/parser/language.ts | 6 +++++- server/src/parser/parser.ts | 11 +++------- server/src/parser/quke.ts | 38 +++++++++++++++++----------------- server/src/qLangServer.ts | 12 ++++++++--- syntaxes/q.tmLanguage.json | 38 +++++++++++++++++----------------- test/suite/qLangServer.test.ts | 37 +++++++++++++++++++-------------- 7 files changed, 81 insertions(+), 77 deletions(-) diff --git a/server/src/parser/keywords.ts b/server/src/parser/keywords.ts index c913f15f..9cb688cd 100644 --- a/server/src/parser/keywords.ts +++ b/server/src/parser/keywords.ts @@ -13,11 +13,9 @@ import { createToken } from "chevrotain"; -export const IdentifierPattern = /\.?[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z0-9_]+)*/; - export const Identifier = createToken({ name: "Identifier", - pattern: IdentifierPattern, + pattern: /\.?[a-zA-Z][a-zA-Z0-9_]*(?:\.[a-zA-Z0-9_]+)*/, }); export const System = createToken({ @@ -38,20 +36,16 @@ export const RSql = createToken({ longer_alt: Identifier, }); -export const KeywordPattern = - /(?:reciprocal|distinct|ceiling|reverse|sublist|ungroup|delete|deltas|differ|enlist|except|getenv|hclose|hcount|insert|mcount|ratios|rotate|select|setenv|signum|string|system|tables|update|upsert|within|xgroup|count|cross|dsave|fills|first|fkeys|floor|group|gtime|hopen|idesc|inter|lower|ltime|ltrim|parse|peach|prior|read0|read1|reval|rload|rsave|rtrim|union|upper|value|views|where|while|xcols|xdesc|xprev|xrank|acos|ajf0|asin|asof|atan|attr|avgs|binr|cols|desc|each|eval|exec|exit|flip|from|hdel|hsym|iasc|keys|last|like|load|mavg|maxs|mdev|meta|mins|mmax|mmin|msum|next|null|over|prds|prev|rand|rank|raze|save|scan|scov|sdev|show|sqrt|sums|svar|trim|type|view|wavg|wsum|xasc|xbar|xcol|xexp|xkey|xlog|abs|aj0|ajf|all|and|any|asc|avg|bin|cor|cos|cov|csv|cut|dev|div|ema|exp|fby|get|ijf|inv|key|ljf|log|lsq|max|md5|med|min|mmu|mod|neg|not|prd|set|sin|ssr|sum|tan|til|ujf|var|wj1|aj|do|ej|if|ij|in|lj|or|pj|ss|sv|uj|vs|wj)/; - export const Keyword = createToken({ name: "Keyword", - pattern: KeywordPattern, + pattern: + /(?:reciprocal|distinct|ceiling|reverse|sublist|ungroup|delete|deltas|differ|enlist|except|getenv|hclose|hcount|insert|mcount|ratios|rotate|select|setenv|signum|string|system|tables|update|upsert|within|xgroup|count|cross|dsave|fills|first|fkeys|floor|group|gtime|hopen|idesc|inter|lower|ltime|ltrim|parse|peach|prior|read0|read1|reval|rload|rsave|rtrim|union|upper|value|views|where|while|xcols|xdesc|xprev|xrank|acos|ajf0|asin|asof|atan|attr|avgs|binr|cols|desc|each|eval|exec|exit|flip|from|hdel|hsym|iasc|keys|last|like|load|mavg|maxs|mdev|meta|mins|mmax|mmin|msum|next|null|over|prds|prev|rand|rank|raze|save|scan|scov|sdev|show|sqrt|sums|svar|trim|type|view|wavg|wsum|xasc|xbar|xcol|xexp|xkey|xlog|abs|aj0|ajf|all|and|any|asc|avg|bin|cor|cos|cov|csv|cut|dev|div|ema|exp|fby|get|ijf|inv|key|ljf|log|lsq|max|md5|med|min|mmu|mod|neg|not|prd|set|sin|ssr|sum|tan|til|ujf|var|wj1|aj|do|ej|if|ij|in|lj|or|pj|ss|sv|uj|vs|wj)/, longer_alt: Identifier, }); -export const ReservedPattern = - /(?:\.h\.(?:iso8601|code|edsn|fram|HOME|htac|html|http|logo|text|hta|htc|hug|nbr|pre|val|xmp|br|c0|c1|cd|ed|ha|hb|hc|he|hn|hp|hr|ht|hu|hy|jx|sa|sb|sc|td|tx|ty|uh|xd|xs|xt|d)|\.j\.(?:jd|[jk])|\.m\.(?:addmonths|dpfts|dsftg|addr|btoa|dpft|hdpf|host|view|chk|def|ens|fmt|fpn|fps|fsn|ind|j10|j12|MAP|opt|par|res|sbt|trp|x10|x12|b6|bt|bv|Cf|cn|dd|en|ff|fk|fs|ft|fu|gc|gz|hg|hp|id|nA|pd|PD|pf|pn|pt|pv|PV|qp|qt|s1|ts|ty|vp|Xf|[aADfklMPsuvVwx])|\.[Qq]\.(?:addmonths|dpfts|dsftg|addr|btoa|dpft|hdpf|host|sha1|view|chk|def|ens|fmt|fpn|fps|fsn|ind|j10|j12|MAP|opt|par|res|sbt|trp|x10|x12|b6|bt|bv|Cf|cn|dd|en|fc|ff|fk|fs|ft|fu|gc|gz|hg|hp|id|nA|pd|PD|pf|pn|pt|pv|PV|qp|qt|s1|ts|ty|vp|Xf|[aADfklMPsSuvVwx])|\.z\.(?:exit|ac|bm|ex|ey|pc|pd|pg|ph|pi|pm|po|pp|pq|ps|pw|ts|vs|wc|wo|ws|zd|[abcdDefhikKlnNopPqstTuwWxXzZ]))/; - export const Reserved = createToken({ name: "Reserved", - pattern: ReservedPattern, + pattern: + /(?:\.h\.(?:iso8601|code|edsn|fram|HOME|htac|html|http|logo|text|hta|htc|hug|nbr|pre|val|xmp|br|c0|c1|cd|ed|ha|hb|hc|he|hn|hp|hr|ht|hu|hy|jx|sa|sb|sc|td|tx|ty|uh|xd|xs|xt|d)|\.j\.(?:jd|[jk])|\.m\.(?:addmonths|dpfts|dsftg|addr|btoa|dpft|hdpf|host|view|chk|def|ens|fmt|fpn|fps|fsn|ind|j10|j12|MAP|opt|par|res|sbt|trp|x10|x12|b6|bt|bv|Cf|cn|dd|en|ff|fk|fs|ft|fu|gc|gz|hg|hp|id|nA|pd|PD|pf|pn|pt|pv|PV|qp|qt|s1|ts|ty|vp|Xf|[aADfklMPsuvVwx])|\.[Qq]\.(?:addmonths|dpfts|dsftg|addr|btoa|dpft|hdpf|host|sha1|view|chk|def|ens|fmt|fpn|fps|fsn|ind|j10|j12|MAP|opt|par|res|sbt|trp|x10|x12|b6|bt|bv|Cf|cn|dd|en|fc|ff|fk|fs|ft|fu|gc|gz|hg|hp|id|nA|pd|PD|pf|pn|pt|pv|PV|qp|qt|s1|ts|ty|vp|Xf|[aADfklMPsSuvVwx])|\.z\.(?:exit|ac|bm|ex|ey|pc|pd|pg|ph|pi|pm|po|pp|pq|ps|pw|ts|vs|wc|wo|ws|zd|[abcdDefhikKlnNopPqstTuwWxXzZ]))/, longer_alt: Identifier, }); diff --git a/server/src/parser/language.ts b/server/src/parser/language.ts index a1b67e36..55d1b07c 100644 --- a/server/src/parser/language.ts +++ b/server/src/parser/language.ts @@ -267,7 +267,11 @@ const language = { }; function _(token: TokenType | RegExp) { - return ("PATTERN" in token ? `${token.PATTERN}` : `${token}`).slice(1, -1); + const pattern = "PATTERN" in token ? `${token.PATTERN}` : `${token}`; + const index = pattern.lastIndexOf("/"); + const options = pattern.slice(index + 1); + const result = pattern.slice(1, index); + return options ? `(?${options})${result}` : result; } export function generateTextMateGrammar() { diff --git a/server/src/parser/parser.ts b/server/src/parser/parser.ts index ce54fa68..140c1474 100644 --- a/server/src/parser/parser.ts +++ b/server/src/parser/parser.ts @@ -24,7 +24,7 @@ import { RCurly, RParen, } from "./tokens"; -import { Identifier, IdentifierPattern, LSql, RSql, System } from "./keywords"; +import { Identifier, LSql, RSql, System } from "./keywords"; import { After, AfterEach, @@ -51,11 +51,6 @@ function args(image: string, count: number): string[] { return image.split(/\s+/, count); } -function isIdentifier(image: string): boolean { - const matches = IdentifierPattern.exec(image); - return !matches || matches[0] === image; -} - function setQualified(token: Token, namespace: string): void { token.identifier = !namespace || @@ -100,8 +95,8 @@ export function parse(text: string): Token[] { let token, prev, next: IToken; const _namespace = (arg: string) => { - if (arg?.startsWith(".") && isIdentifier(arg)) { - namespace = arg === "." ? "" : arg; + if (arg) { + namespace = `.${arg.split(/\./, 2)[1]}`; } }; diff --git a/server/src/parser/quke.ts b/server/src/parser/quke.ts index ad90e933..62fbbfc6 100644 --- a/server/src/parser/quke.ts +++ b/server/src/parser/quke.ts @@ -15,98 +15,98 @@ import { createToken } from "chevrotain"; export const Quke = createToken({ name: "Quke", - pattern: /(? { describe("onDocumentSymbol", () => { it("should return symbols", () => { - const params = createDocument("a:1;b:{[c]d:c+1;d};b"); + const params = createDocument("a:1;b:{[c]d:c+1;e::1;d};b"); const result = server.onDocumentSymbol(params); - assert.strictEqual(result.length, 2); + assert.strictEqual(result.length, 3); + }); + it("should skip table and sql", () => { + const params = createDocument("select a:1 from;([]a:1);a"); + const result = server.onDocumentSymbol(params); + assert.strictEqual(result.length, 0); }); }); describe("onReferences", () => { it("should return references", () => { - const params = createDocument( - '\\d .a\nsystem "d .a"\na:1;b:{[c]d:c+1;d};b', - ); + const params = createDocument("a:1;b:{[c]d:c+1;d};b"); const result = server.onReferences({ ...params, context: { includeDeclaration: true }, @@ -98,13 +101,16 @@ describe("qLangServer", () => { }); it("should return references for quke", () => { const params = createDocument(` - feature + feature + bench + replicate + FEATURE before after before each after each should - expect + EXPECT a:1;a `); const result = server.onReferences({ @@ -113,14 +119,6 @@ describe("qLangServer", () => { }); assert.strictEqual(result.length, 2); }); - it("should skip table and sql", () => { - const params = createDocument("select a:1 from;([]a:1)"); - const result = server.onReferences({ - ...params, - context: { includeDeclaration: true }, - }); - assert.strictEqual(result.length, 0); - }); }); describe("onDefinition", () => { @@ -129,6 +127,11 @@ describe("qLangServer", () => { const result = server.onDefinition(params); assert.strictEqual(result.length, 1); }); + it("should return local definitions", () => { + const params = createDocument("a:1;b:{[c]d:1;d"); + const result = server.onDefinition(params); + assert.strictEqual(result.length, 1); + }); }); describe("onRenameRequest", () => { @@ -142,7 +145,9 @@ describe("qLangServer", () => { describe("onCompletion", () => { it("should complete identifiers", () => { - const params = createDocument("a:1;b:{[c]d:c+1;d};b"); + const params = createDocument( + '\\d .a\nsystem "d .a"\na:1;b:{[c]d:c+1;d};b', + ); const result = server.onCompletion(params); assert.strictEqual(result.length, 2); }); From e55b3e799a3c01834a05aac66eceb7107704b170 Mon Sep 17 00:00:00 2001 From: ecmel Date: Sun, 28 Apr 2024 12:37:32 +0300 Subject: [PATCH 21/25] add build tools tests --- server/src/parser/language.ts | 24 +++-------- server/src/parser/parser.ts | 51 +++++++++++----------- server/src/qLangServer.ts | 70 ++++++++++++++++--------------- src/commands/buildToolsCommand.ts | 26 ++++++------ syntaxes/q.tmLanguage.json | 13 +----- test/suite/buildTools.test.ts | 55 ++++++++++++++++++++---- test/suite/qLangServer.test.ts | 2 +- 7 files changed, 131 insertions(+), 110 deletions(-) diff --git a/server/src/parser/language.ts b/server/src/parser/language.ts index 55d1b07c..07f8e35f 100644 --- a/server/src/parser/language.ts +++ b/server/src/parser/language.ts @@ -62,22 +62,10 @@ const qdoc = { begin: "(?:(?<=\\r?\\n|[ \\t])|(? { if (arg) { - namespace = `.${arg.split(/\./, 2)[1]}`; + const args = arg.split(/\.+/, 2); + namespace = args[1] ? `.${args[1]}` : ""; } }; @@ -110,26 +111,26 @@ export function parse(text: string): Token[] { token.identifierKind = IdentifierKind.Argument; token.scope = scopes[scopes.length - 1]; token.identifier = token.image; - } else { - token.kind = TokenKind.Identifier; - if (!token.image.includes(".")) { - token.scope = scopes[scopes.length - 1]; - } - setQualified(token, namespace); + break; + } + token.kind = TokenKind.Identifier; + if (sql || table) { + token.identifierKind = IdentifierKind.Unassignable; } + if (!token.image.includes(".")) { + token.scope = scopes[scopes.length - 1]; + } + setQualified(token, namespace); break; case Colon: case DoubleColon: prev = tokens[i - 1]; if (prev?.kind === TokenKind.Identifier) { - if (sql) { - prev.identifierKind = IdentifierKind.Sql; - } else if (table) { - prev.identifierKind = IdentifierKind.Table; - } else { + if (prev.identifierKind !== IdentifierKind.Unassignable) { prev.kind = TokenKind.Assignment; if (token.tokenType === DoubleColon) { prev.scope = undefined; + prev.kind = TokenKind.Identifier; } setQualified(prev, namespace); } @@ -140,8 +141,10 @@ export function parse(text: string): Token[] { if (prev?.kind === TokenKind.Assignment && !prev.lambda) { prev.lambda = token; } + token.nullary = true; next = tokens[i + 1]; if (next?.tokenType === LBracket) { + token.nullary = false; argument++; } scopes.push(token); @@ -192,27 +195,27 @@ export function parse(text: string): Token[] { } } break; - case Bench: case Feature: - case Replicate: case Should: + case Bench: + case Replicate: case TimeLimit: case Tolerance: token.identifierKind = IdentifierKind.Quke; scopes.pop(); break; + case Expect: + case ToMatch: + case Property: case After: case AfterEach: - case Baseline: case Before: case BeforeEach: + case SkipIf: + case Baseline: case Behaviour: - case Expect: - case Property: case Setup: - case SkipIf: case Teardown: - case ToMatch: scopes.pop(); token.kind = TokenKind.Assignment; token.identifierKind = IdentifierKind.Quke; diff --git a/server/src/qLangServer.ts b/server/src/qLangServer.ts index 90bd12dd..563c7bab 100644 --- a/server/src/qLangServer.ts +++ b/server/src/qLangServer.ts @@ -52,26 +52,28 @@ function rangeFromToken(token: Token): Range { ); } -function isLocal(source: Token, tokens: Token[]) { - return ( - source.scope && - tokens.find( - (token) => - token.scope === source.scope && - token.kind === TokenKind.Assignment && - token.identifier === source.identifier, - ) - ); -} - -function isAssignable(token: Token) { - return ( - token.identifierKind !== IdentifierKind.Sql && - token.identifierKind !== IdentifierKind.Table +function isLocal(tokens: Token[], target: Token) { + if (!target.scope) { + return false; + } + if (target.scope.nullary) { + if ( + target.identifier === "x" || + target.identifier === "y" || + target.identifier === "z" + ) { + return true; + } + } + return !!tokens.find( + (token) => + token.kind === TokenKind.Assignment && + token.scope === target.scope && + token.identifier === target.identifier, ); } -function positionToToken(position: Position, tokens: Token[]) { +function positionToToken(tokens: Token[], position: Position) { return tokens.find((token) => { const { start, end } = rangeFromToken(token); return ( @@ -160,7 +162,7 @@ export default class QLangServer { public onReferences({ textDocument, position }: ReferenceParams): Location[] { const tokens = this.parse(textDocument); - const source = positionToToken(position, tokens); + const source = positionToToken(tokens, position); return this.findIdentifiers(FindKind.Reference, tokens, source).map( (token) => Location.create(textDocument.uri, rangeFromToken(token)), ); @@ -171,7 +173,7 @@ export default class QLangServer { position, }: DefinitionParams): Location[] { const tokens = this.parse(textDocument); - const source = positionToToken(position, tokens); + const source = positionToToken(tokens, position); return this.findIdentifiers(FindKind.Definition, tokens, source).map( (token) => Location.create(textDocument.uri, rangeFromToken(token)), ); @@ -183,7 +185,7 @@ export default class QLangServer { newName, }: RenameParams): WorkspaceEdit | null { const tokens = this.parse(textDocument); - const source = positionToToken(position, tokens); + const source = positionToToken(tokens, position); const edits = this.findIdentifiers(FindKind.Rename, tokens, source).map( (token) => TextEdit.replace(rangeFromToken(token), newName), ); @@ -201,7 +203,7 @@ export default class QLangServer { position, }: CompletionParams): CompletionItem[] { const tokens = this.parse(textDocument); - const source = positionToToken(position, tokens); + const source = positionToToken(tokens, position); return this.findIdentifiers(FindKind.Completion, tokens, source).map( (token) => ({ label: getLabel(token, source), @@ -225,42 +227,42 @@ export default class QLangServer { tokens: Token[], source?: Token, ): Token[] { - if (!source) { + if (!source || source.identifierKind === IdentifierKind.Unassignable) { return []; } switch (kind) { case FindKind.Rename: case FindKind.Reference: - return isLocal(source, tokens) + return isLocal(tokens, source) ? tokens.filter( (token) => token.tokenType === Identifier && + token.identifierKind !== IdentifierKind.Unassignable && token.identifier === source.identifier && - token.scope === source.scope && - isAssignable(token), + token.scope === source.scope, ) : tokens.filter( (token) => token.tokenType === Identifier && + token.identifierKind !== IdentifierKind.Unassignable && token.identifier === source.identifier && - !isLocal(token, tokens) && - isAssignable(token), + !isLocal(tokens, token), ); case FindKind.Definition: - return isLocal(source, tokens) + return isLocal(tokens, source) ? tokens.filter( (token) => token.kind === TokenKind.Assignment && + token.identifierKind !== IdentifierKind.Unassignable && token.identifier === source.identifier && - token.scope === source.scope && - isAssignable(token), + token.scope === source.scope, ) : tokens.filter( (token) => token.kind === TokenKind.Assignment && + token.identifierKind !== IdentifierKind.Unassignable && token.identifier === source.identifier && - !isLocal(token, tokens) && - isAssignable(token), + !isLocal(tokens, token), ); case FindKind.Completion: const completions: Token[] = []; @@ -268,8 +270,8 @@ export default class QLangServer { .filter( (token) => token.kind === TokenKind.Assignment && - (!token.scope || token.scope === source.scope) && - isAssignable(token), + token.identifierKind !== IdentifierKind.Unassignable && + (!token.scope || token.scope === source.scope), ) .forEach( (token) => diff --git a/src/commands/buildToolsCommand.ts b/src/commands/buildToolsCommand.ts index cba43496..6b03652c 100644 --- a/src/commands/buildToolsCommand.ts +++ b/src/commands/buildToolsCommand.ts @@ -57,10 +57,14 @@ const prefix: { [key: string]: string } = { l64arm: Path.join("l64arm", "q"), }; +function getBuidToolsHome() { + return process.env.AXLIBRARIES_HOME; +} + function getRuntime() { const home = workspace - .getConfiguration() - .get("kdb.qHomeDirectory", `${process.env.QHOME || ""}`); + .getConfiguration("kdb") + .get("qHomeDirectory", ""); if (!home) { throw new Error("kdb q runtime not found"); @@ -88,27 +92,24 @@ function getTool(args: string[]) { } function getLinter() { - if (process.env.AXLIBRARIES_HOME) { - return Path.join(process.env.AXLIBRARIES_HOME, "ws", "qlint.q_"); + const home = getBuidToolsHome(); + if (home) { + return Path.join(home, "ws", "qlint.q_"); } throw new Error("AXLIBRARIES_HOME is not set"); } function initBuildTools() { return new Promise((resolve, reject) => { - if (process.env.AXLIBRARIES_HOME) { + const home = getBuidToolsHome(); + if (home) { if (process.platform === "darwin") { const xattr = spawn( "/usr/bin/xattr", [ "-d", "com.apple.quarantine", - Path.join( - process.env.AXLIBRARIES_HOME, - "ws", - "lib", - "*.{so,dylib}", - ), + Path.join(home, "ws", "lib", "*.{so,dylib}"), ], { shell: true }, ); @@ -209,8 +210,7 @@ function lint(document: TextDocument) { return diagnostic; }); } catch (error) { - window.showErrorMessage(`Linting Failed ${error}`); - return []; + throw new Error(`Linting Failed ${error}`); } }, ); diff --git a/syntaxes/q.tmLanguage.json b/syntaxes/q.tmLanguage.json index c542e78c..9f604a48 100644 --- a/syntaxes/q.tmLanguage.json +++ b/syntaxes/q.tmLanguage.json @@ -184,20 +184,9 @@ "begin": "(?:(?<=\\r?\\n|[ \\t])|(? { + function setQHome(path?: string) { + sinon + .stub(workspace, "getConfiguration") + .value(() => ({ get: () => path })); + } + + function setAxHome(path?: string) { + sinon.stub(process.env, "AXLIBRARIES_HOME").value(path); + } + + function openTextDocument(path: string) { + return workspace.openTextDocument( + Uri.file(Path.resolve("/workspace", path)).with({ + scheme: "untitled", + }), + ); + } + + beforeEach(() => { + mock({ + "/workspace": { + "lint.q": "a;a:1", + }, + }); + }); + + afterEach(() => { + mock.restore(); + sinon.restore(); + }); + describe("connectBuildTools", () => { it("should connect build tools", async () => { - await assert.doesNotReject(async () => tools.connectBuildTools()); + await assert.doesNotReject(() => tools.connectBuildTools()); }); }); describe("lintCommand", () => { - it("should lint", async () => { - const document = await workspace.openTextDocument({ - language: "q", - content: "a;a:1", - }); - await assert.doesNotReject(async () => tools.lintCommand(document)); + it("should reject if q home directory is not set", async () => { + setQHome(); + setAxHome("/ax"); + const document = await openTextDocument("lint.q"); + await assert.rejects(() => tools.lintCommand(document)); + }); + it("should reject if ax home directory is not set", async () => { + setAxHome(); + setQHome("/q"); + const document = await openTextDocument("lint.q"); + await assert.rejects(() => tools.lintCommand(document)); }); }); }); diff --git a/test/suite/qLangServer.test.ts b/test/suite/qLangServer.test.ts index 342747cf..05dd528e 100644 --- a/test/suite/qLangServer.test.ts +++ b/test/suite/qLangServer.test.ts @@ -81,7 +81,7 @@ describe("qLangServer", () => { it("should return symbols", () => { const params = createDocument("a:1;b:{[c]d:c+1;e::1;d};b"); const result = server.onDocumentSymbol(params); - assert.strictEqual(result.length, 3); + assert.strictEqual(result.length, 2); }); it("should skip table and sql", () => { const params = createDocument("select a:1 from;([]a:1);a"); From 6bdb1bbeb83a93db10559290ec1e6fa8ce6ec182 Mon Sep 17 00:00:00 2001 From: ecmel Date: Sun, 28 Apr 2024 12:43:29 +0300 Subject: [PATCH 22/25] fixed stub --- test/suite/buildTools.test.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/suite/buildTools.test.ts b/test/suite/buildTools.test.ts index d3e7726e..ab14c6a0 100644 --- a/test/suite/buildTools.test.ts +++ b/test/suite/buildTools.test.ts @@ -19,13 +19,13 @@ import { Uri, workspace } from "vscode"; import * as tools from "../../src/commands/buildToolsCommand"; describe("buildTools", () => { - function setQHome(path?: string) { + function setQHome(path: string) { sinon .stub(workspace, "getConfiguration") .value(() => ({ get: () => path })); } - function setAxHome(path?: string) { + function setAxHome(path: string) { sinon.stub(process.env, "AXLIBRARIES_HOME").value(path); } @@ -37,6 +37,10 @@ describe("buildTools", () => { ); } + before(() => { + process.env.AXLIBRARIES_HOME = ""; + }); + beforeEach(() => { mock({ "/workspace": { @@ -58,14 +62,14 @@ describe("buildTools", () => { describe("lintCommand", () => { it("should reject if q home directory is not set", async () => { - setQHome(); + setQHome(""); setAxHome("/ax"); const document = await openTextDocument("lint.q"); await assert.rejects(() => tools.lintCommand(document)); }); it("should reject if ax home directory is not set", async () => { - setAxHome(); setQHome("/q"); + setAxHome(""); const document = await openTextDocument("lint.q"); await assert.rejects(() => tools.lintCommand(document)); }); From ae4d06c763729c9a896a157590c265fc019dc51a Mon Sep 17 00:00:00 2001 From: ecmel Date: Sun, 28 Apr 2024 13:15:49 +0300 Subject: [PATCH 23/25] added quick fix test --- src/services/quickFixProvider.ts | 1 - test/suite/buildTools.test.ts | 13 ++++++++++++- test/suite/parser.test.ts | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/services/quickFixProvider.ts b/src/services/quickFixProvider.ts index f537e06e..3d6aae3a 100644 --- a/src/services/quickFixProvider.ts +++ b/src/services/quickFixProvider.ts @@ -53,7 +53,6 @@ export class QuickFixProvider implements CodeActionProvider { new Position(0, 0), `//@qlintsuppress ${diagnostic.code}\n`, ); - return [once, always]; } } diff --git a/test/suite/buildTools.test.ts b/test/suite/buildTools.test.ts index ab14c6a0..dc3f8246 100644 --- a/test/suite/buildTools.test.ts +++ b/test/suite/buildTools.test.ts @@ -15,10 +15,13 @@ import * as assert from "assert"; import * as sinon from "sinon"; import Path from "path"; import mock from "mock-fs"; -import { Uri, workspace } from "vscode"; +import { Range, Uri, workspace } from "vscode"; import * as tools from "../../src/commands/buildToolsCommand"; +import { QuickFixProvider } from "../../src/services/quickFixProvider"; describe("buildTools", () => { + const quickFix = new QuickFixProvider(); + function setQHome(path: string) { sinon .stub(workspace, "getConfiguration") @@ -73,5 +76,13 @@ describe("buildTools", () => { const document = await openTextDocument("lint.q"); await assert.rejects(() => tools.lintCommand(document)); }); + it("should provide no QuickFix for empty diagnostics", async () => { + const document = await openTextDocument("lint.q"); + const result = await quickFix.provideCodeActions( + document, + new Range(0, 0, 0, 0), + ); + assert.ok(!result); + }); }); }); diff --git a/test/suite/parser.test.ts b/test/suite/parser.test.ts index 296fcfd6..da153ddf 100644 --- a/test/suite/parser.test.ts +++ b/test/suite/parser.test.ts @@ -12,12 +12,12 @@ */ import * as assert from "assert"; -import { generateTextMateGrammar } from "../../server/src/parser"; +import * as parser from "../../server/src/parser"; describe("QParser", () => { describe("language", () => { it("should generate TextMate grammar file", () => { - const grammar = generateTextMateGrammar(); + const grammar = parser.generateTextMateGrammar(); assert.ok(grammar); }); }); From 2f3ec292c4946d3d941cf3dcf7f3c94556760154 Mon Sep 17 00:00:00 2001 From: ecmel Date: Sun, 28 Apr 2024 13:39:03 +0300 Subject: [PATCH 24/25] added completion provider test --- test/suite/buildTools.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/suite/buildTools.test.ts b/test/suite/buildTools.test.ts index dc3f8246..edd6947f 100644 --- a/test/suite/buildTools.test.ts +++ b/test/suite/buildTools.test.ts @@ -18,10 +18,9 @@ import mock from "mock-fs"; import { Range, Uri, workspace } from "vscode"; import * as tools from "../../src/commands/buildToolsCommand"; import { QuickFixProvider } from "../../src/services/quickFixProvider"; +import { CompletionProvider } from "../../src/services/completionProvider"; describe("buildTools", () => { - const quickFix = new QuickFixProvider(); - function setQHome(path: string) { sinon .stub(workspace, "getConfiguration") @@ -77,6 +76,7 @@ describe("buildTools", () => { await assert.rejects(() => tools.lintCommand(document)); }); it("should provide no QuickFix for empty diagnostics", async () => { + const quickFix = new QuickFixProvider(); const document = await openTextDocument("lint.q"); const result = await quickFix.provideCodeActions( document, @@ -85,4 +85,12 @@ describe("buildTools", () => { assert.ok(!result); }); }); + + describe("CompletionProvider", () => { + it("should provide global completions", async () => { + const comletion = new CompletionProvider(); + const result = await comletion.provideCompletionItems(); + assert.ok(Array.isArray(result)); + }); + }); }); From c4f986aea9986ecc6b68e8b4dee755e26927905d Mon Sep 17 00:00:00 2001 From: ecmel Date: Sun, 28 Apr 2024 18:40:59 +0300 Subject: [PATCH 25/25] increase coverage --- server/src/qLangServer.ts | 14 ++-- test/suite/parser.test.ts | 5 +- test/suite/qLangServer.test.ts | 117 +++++++++++++++++++++++++-------- 3 files changed, 99 insertions(+), 37 deletions(-) diff --git a/server/src/qLangServer.ts b/server/src/qLangServer.ts index 563c7bab..9b8d796a 100644 --- a/server/src/qLangServer.ts +++ b/server/src/qLangServer.ts @@ -86,15 +86,15 @@ function positionToToken(tokens: Token[], position: Position) { } function getLabel(token: Token, source?: Token): string { - if (!token.identifier) { - return token.image; - } + const label = token.identifier || token.image; + if (source?.namespace) { - if (token.identifier.startsWith(source.namespace)) { - return token.identifier.replace(`${source.namespace}.`, ""); + if (label.startsWith(source.namespace)) { + return label.replace(`${source.namespace}.`, ""); } } - return token.identifier; + + return label; } export default class QLangServer { @@ -271,6 +271,8 @@ export default class QLangServer { (token) => token.kind === TokenKind.Assignment && token.identifierKind !== IdentifierKind.Unassignable && + (token.identifier?.startsWith(".") || + token.namespace === source.namespace) && (!token.scope || token.scope === source.scope), ) .forEach( diff --git a/test/suite/parser.test.ts b/test/suite/parser.test.ts index da153ddf..0de1ee85 100644 --- a/test/suite/parser.test.ts +++ b/test/suite/parser.test.ts @@ -12,13 +12,12 @@ */ import * as assert from "assert"; -import * as parser from "../../server/src/parser"; +import { generateTextMateGrammar } from "../../server/src/parser"; describe("QParser", () => { describe("language", () => { it("should generate TextMate grammar file", () => { - const grammar = parser.generateTextMateGrammar(); - assert.ok(grammar); + assert.ok(generateTextMateGrammar()); }); }); }); diff --git a/test/suite/qLangServer.test.ts b/test/suite/qLangServer.test.ts index 05dd528e..7b3fd35d 100644 --- a/test/suite/qLangServer.test.ts +++ b/test/suite/qLangServer.test.ts @@ -23,6 +23,8 @@ import { import { TextDocument } from "vscode-languageserver-textdocument"; import QLangServer from "../../server/src/qLangServer"; +const context = { includeDeclaration: true }; + describe("qLangServer", () => { let server: QLangServer; @@ -79,44 +81,98 @@ describe("qLangServer", () => { describe("onDocumentSymbol", () => { it("should return symbols", () => { - const params = createDocument("a:1;b:{[c]d:c+1;e::1;d};b"); + const params = createDocument("a:1;b:{[c]d:c+1;e::1;d}"); const result = server.onDocumentSymbol(params); assert.strictEqual(result.length, 2); }); it("should skip table and sql", () => { - const params = createDocument("select a:1 from;([]a:1);a"); + const params = createDocument(")([]a:1;b:2);select a:1 from("); const result = server.onDocumentSymbol(params); assert.strictEqual(result.length, 0); }); + it("should account for \\d can be only one level deep", () => { + const params = createDocument("\\d .foo.bar\na:1"); + const result = server.onDocumentSymbol(params); + assert.strictEqual(result.length, 1); + assert.strictEqual(result[0].name, ".foo.a"); + }); + it("should account for bogus \\d", () => { + const params = createDocument("\\d\na:1"); + const result = server.onDocumentSymbol(params); + assert.strictEqual(result.length, 1); + assert.strictEqual(result[0].name, "a"); + }); + it("should account for bogus \\d foo", () => { + const params = createDocument("\\d foo\na:1"); + const result = server.onDocumentSymbol(params); + assert.strictEqual(result.length, 1); + assert.strictEqual(result[0].name, "a"); + }); + it('should account for bogus system"d', () => { + const params = createDocument('system"d";a:1'); + const result = server.onDocumentSymbol(params); + assert.strictEqual(result.length, 1); + assert.strictEqual(result[0].name, "a"); + }); + it('should account for bogus system"d', () => { + const params = createDocument("a:1;system"); + const result = server.onDocumentSymbol(params); + assert.strictEqual(result.length, 1); + }); + it('should account for only static system"d', () => { + const params = createDocument('a:1;system"d .foo";b:1'); + const result = server.onDocumentSymbol(params); + assert.strictEqual(result.length, 2); + assert.strictEqual(result[1].name, "b"); + }); }); describe("onReferences", () => { - it("should return references", () => { - const params = createDocument("a:1;b:{[c]d:c+1;d};b"); - const result = server.onReferences({ - ...params, - context: { includeDeclaration: true }, - }); + it("should return empty array for no text", () => { + const params = createDocument(""); + const result = server.onReferences({ ...params, context }); + assert.strictEqual(result.length, 0); + }); + it("should return empty array for bogus assignment", () => { + const params = createDocument(":"); + const result = server.onReferences({ ...params, context }); + assert.strictEqual(result.length, 0); + }); + it("should return empty array for bogus function", () => { + const params = createDocument("{"); + const result = server.onReferences({ ...params, context }); + assert.strictEqual(result.length, 0); + }); + it("should return references in anonymous functions", () => { + const params = createDocument("{a:1;a"); + const result = server.onReferences({ ...params, context }); + assert.strictEqual(result.length, 2); + }); + it("should support imlplicit arguments", () => { + const params = createDocument("x:1;y:1;z:1;{x+y+z};x"); + const result = server.onReferences({ ...params, context }); + assert.strictEqual(result.length, 2); + }); + it("should find globals in functions", () => { + const params = createDocument("a:1;{a"); + const result = server.onReferences({ ...params, context }); + assert.strictEqual(result.length, 2); + }); + it("should find locals in functions", () => { + const params = createDocument("a:1;{a:2;a"); + const result = server.onReferences({ ...params, context }); assert.strictEqual(result.length, 2); }); + it("should apply namespace to globals in functions", () => { + const params = createDocument( + "\\d .foo\na:1;f:{a::2};\\d .\n.foo.f[];.foo.a", + ); + const result = server.onReferences({ ...params, context }); + assert.strictEqual(result.length, 3); + }); it("should return references for quke", () => { - const params = createDocument(` - feature - bench - replicate - FEATURE - before - after - before each - after each - should - EXPECT - a:1;a - `); - const result = server.onReferences({ - ...params, - context: { includeDeclaration: true }, - }); + const params = createDocument("FEATURE\nfeature\nshould\nEXPECT\na:1;a"); + const result = server.onReferences({ ...params, context }); assert.strictEqual(result.length, 2); }); }); @@ -145,11 +201,16 @@ describe("qLangServer", () => { describe("onCompletion", () => { it("should complete identifiers", () => { - const params = createDocument( - '\\d .a\nsystem "d .a"\na:1;b:{[c]d:c+1;d};b', - ); + const params = createDocument("a:1;b:{[c]d:c+1;d};b"); + const result = server.onCompletion(params); + assert.strictEqual(result.length, 2); + }); + it("should complete according to namespace context", () => { + const params = createDocument("a:1\n\\d .foo\na:1\n\\d .bar\na:1;a"); const result = server.onCompletion(params); assert.strictEqual(result.length, 2); + assert.strictEqual(result[0].label, ".foo.a"); + assert.strictEqual(result[1].label, "a"); }); }); });