From 14a5214e8259e5047f22fe5a8ae103470f80c4b4 Mon Sep 17 00:00:00 2001 From: Hayden Date: Tue, 12 Dec 2023 20:05:21 +0800 Subject: [PATCH] support format g4 (#232) * chore: install antlr-format-cli to format g4 files * style: format all g4 files * chore: apply antlr-format to lint-staged --- .lintstagedrc.js | 1 + antlr.format.json | 34 + package.json | 2 + pnpm-lock.yaml | 128 + src/grammar/flinksql/FlinkSqlLexer.g4 | 1117 ++- src/grammar/flinksql/FlinkSqlParser.g4 | 356 +- src/grammar/hive/HiveSqlLexer.g4 | 957 ++- src/grammar/hive/HiveSqlParser.g4 | 602 +- src/grammar/impala/ImpalaSqlLexer.g4 | 592 +- src/grammar/impala/ImpalaSqlParser.g4 | 881 ++- src/grammar/mysql/MySqlLexer.g4 | 1918 ++--- src/grammar/mysql/MySqlParser.g4 | 2983 +++++--- src/grammar/pgsql/PostgreSQLLexer.g4 | 1295 ++-- src/grammar/pgsql/PostgreSQLParser.g4 | 8892 ++++++++++++++---------- src/grammar/plsql/PlSqlLexer.g4 | 4752 ++++++------- src/grammar/plsql/PlSqlParser.g4 | 1963 +++--- src/grammar/spark/SparkSqlLexer.g4 | 833 ++- src/grammar/spark/SparkSqlParser.g4 | 669 +- src/grammar/trinosql/TrinoSql.g4 | 2208 +++--- yarn.lock | 270 +- 20 files changed, 16763 insertions(+), 13690 deletions(-) create mode 100644 antlr.format.json diff --git a/.lintstagedrc.js b/.lintstagedrc.js index e53bd95..425af2d 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,4 +1,5 @@ module.exports = { '*.js': [`prettier --write`], '*.ts': [`prettier --write`], + '*.g4': [`antlr-format -c ./antlr.format.json -v`], }; diff --git a/antlr.format.json b/antlr.format.json new file mode 100644 index 0000000..2c274d0 --- /dev/null +++ b/antlr.format.json @@ -0,0 +1,34 @@ +{ + "main": { + "alignTrailingComments": true, + "columnLimit": 150, + "minEmptyLines": 1, + "maxEmptyLinesToKeep": 1, + "reflowComments": false, + "useTab": false, + "allowShortRulesOnASingleLine": false, + "allowShortBlocksOnASingleLine": true, + "alignSemicolons": "hanging", + "alignColons": "hanging", + "spaceBeforeAssignmentOperators": false, + "keepEmptyLinesAtTheStartOfBlocks": true + }, + "lexer": { + "alignTrailingComments": true, + "columnLimit": 150, + "maxEmptyLinesToKeep": 1, + "reflowComments": false, + "useTab": false, + "allowShortRulesOnASingleLine": true, + "allowShortBlocksOnASingleLine": true, + "minEmptyLines": 0, + "alignSemicolons": "none", + "alignColons": "trailing", + "singleLineOverrulesHangingColon": true, + "alignLexerCommands": true, + "alignLabels": true, + "alignTrailers": true, + "spaceBeforeAssignmentOperators": false, + "groupedAlignments": true + } +} \ No newline at end of file diff --git a/package.json b/package.json index d4a3e97..0df96b2 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "release": "node ./scripts/release.js", "lint": "prettier --check '**/*.ts' --config ./.prettierrc", "lint-fix": "prettier --write '**/*.ts' --config ./.prettierrc", + "format-g4": "antlr-format -c ./antlr.format.json -v ./src/grammar/**/*.g4", "cleanComment": "node ./scripts/cleanCommentCli.js" }, "license": "MIT", @@ -39,6 +40,7 @@ "@swc/jest": "^0.2.26", "@types/jest": "^29.5.1", "@types/node": "^18.15.11", + "antlr-format-cli": "^1.2.1", "antlr4ts-cli": "^0.5.0-alpha.4", "chalk": "4.1.2", "commitizen": "^4.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a75663b..a600682 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,7 @@ specifiers: '@swc/jest': ^0.2.26 '@types/jest': ^29.5.1 '@types/node': ^18.15.11 + antlr-format-cli: ^1.2.1 antlr4-c3: 3.1.1 antlr4ts: 0.5.0-alpha.4 antlr4ts-cli: ^0.5.0-alpha.4 @@ -35,6 +36,7 @@ devDependencies: '@swc/jest': 0.2.26_@swc+core@1.3.60 '@types/jest': 29.5.1 '@types/node': 18.16.16 + antlr-format-cli: 1.2.1 antlr4ts-cli: 0.5.0-alpha.4 chalk: 4.1.2 commitizen: 4.3.0_@swc+core@1.3.60 @@ -351,6 +353,13 @@ packages: '@babel/helper-plugin-utils': 7.21.5 dev: true + /@babel/runtime/7.23.6: + resolution: {integrity: sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.0 + dev: true + /@babel/template/7.21.9: resolution: {integrity: sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==} engines: {node: '>=6.9.0'} @@ -587,6 +596,11 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true + /@humanwhocodes/momoa/2.0.4: + resolution: {integrity: sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==} + engines: {node: '>=10.10.0'} + dev: true + /@hutson/parse-repository-url/3.0.2: resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} engines: {node: '>=6.9.0'} @@ -899,6 +913,22 @@ packages: dev: true optional: true + /@readme/better-ajv-errors/1.6.0_ajv@8.12.0: + resolution: {integrity: sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ==} + engines: {node: '>=14'} + peerDependencies: + ajv: 4.11.8 - 8 + dependencies: + '@babel/code-frame': 7.21.4 + '@babel/runtime': 7.23.6 + '@humanwhocodes/momoa': 2.0.4 + ajv: 8.12.0 + chalk: 4.1.2 + json-to-ast: 2.1.0 + jsonpointer: 5.0.1 + leven: 3.1.0 + dev: true + /@sinclair/typebox/0.25.24: resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} dev: true @@ -1112,6 +1142,10 @@ packages: pretty-format: 29.5.0 dev: true + /@types/json-schema/7.0.15: + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + dev: true + /@types/minimist/1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -1233,12 +1267,32 @@ packages: engines: {node: '>=12'} dev: true + /antlr-format-cli/1.2.1: + resolution: {integrity: sha512-vqpoL9x3bXiNnC/vzZG3XOyk2vUAHPmBbI/ufyAqbxQHD27OPuUM4n/6m6NBEZZ7V4U2aEiefnZg2SCaSU89oA==} + hasBin: true + dependencies: + '@readme/better-ajv-errors': 1.6.0_ajv@8.12.0 + ajv: 8.12.0 + antlr4ng: 2.0.2 + commander: 11.1.0 + glob: 10.3.10 + ts-json-schema-generator: 1.4.0 + transitivePeerDependencies: + - antlr4ng-cli + dev: true + /antlr4-c3/3.1.1: resolution: {integrity: sha512-S7DixV12kxWexTkQYGvooCgHYU5AjF74oYio+ZNgm0XN3EzxDY3J6Si9GprQ4KksvgWwK//EgZnL/26WB+bOpw==} dependencies: antlr4ts: 0.5.0-alpha.4 dev: false + /antlr4ng/2.0.2: + resolution: {integrity: sha512-Fhs3AvhoGigRt3RpHw0wGA7n03j9BpskH9yCUViNB7NtKuCA+imy2orEZ8qcgPG98f7IryEPYlG9sx99f3ZOyw==} + peerDependencies: + antlr4ng-cli: 1.0.4 + dev: true + /antlr4ts-cli/0.5.0-alpha.4: resolution: {integrity: sha512-lVPVBTA2CVHRYILSKilL6Jd4hAumhSZZWA7UbQNQrmaSSj7dPmmYaN4bOmZG79cOy0lS00i4LY68JZZjZMWVrw==} hasBin: true @@ -1558,6 +1612,11 @@ packages: engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} dev: true + /code-error-fragment/0.0.230: + resolution: {integrity: sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==} + engines: {node: '>= 4'} + dev: true + /collect-v8-coverage/1.0.1: resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} dev: true @@ -1587,6 +1646,11 @@ packages: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} dev: true + /commander/11.1.0: + resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + engines: {node: '>=16'} + dev: true + /commander/9.5.0: resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} engines: {node: ^12.20.0 || >=14} @@ -2312,6 +2376,17 @@ packages: path-is-absolute: 1.0.1 dev: true + /glob/8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + dev: true + /global-dirs/0.1.1: resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} engines: {node: '>=4'} @@ -2348,6 +2423,10 @@ packages: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true + /grapheme-splitter/1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true + /handlebars/4.7.7: resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==} engines: {node: '>=0.4.7'} @@ -3107,6 +3186,14 @@ packages: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} dev: true + /json-to-ast/2.1.0: + resolution: {integrity: sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==} + engines: {node: '>= 4'} + dependencies: + code-error-fragment: 0.0.230 + grapheme-splitter: 1.0.4 + dev: true + /json5/2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -3130,6 +3217,11 @@ packages: engines: {'0': node >= 0.2.0} dev: true + /jsonpointer/5.0.1: + resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} + engines: {node: '>=0.10.0'} + dev: true + /kind-of/6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -3405,6 +3497,13 @@ packages: brace-expansion: 1.1.11 dev: true + /minimatch/5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimatch/9.0.3: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} @@ -3823,6 +3922,10 @@ packages: strip-indent: 3.0.0 dev: true + /regenerator-runtime/0.14.0: + resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} + dev: true + /require-directory/2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -3910,6 +4013,11 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true + /safe-stable-stringify/2.4.3: + resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} + engines: {node: '>=10'} + dev: true + /safer-buffer/2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true @@ -4253,6 +4361,20 @@ packages: engines: {node: '>=8'} dev: true + /ts-json-schema-generator/1.4.0: + resolution: {integrity: sha512-wm8vyihmGgYpxrqRshmYkWGNwEk+sf3xV2rUgxv8Ryeh7bSpMO7pZQOht+2rS002eDkFTxR7EwRPXVzrS0WJTg==} + engines: {node: '>=10.0.0'} + hasBin: true + dependencies: + '@types/json-schema': 7.0.15 + commander: 11.1.0 + glob: 8.1.0 + json5: 2.2.3 + normalize-path: 3.0.0 + safe-stable-stringify: 2.4.3 + typescript: 5.2.2 + dev: true + /ts-node/10.9.1_0d2585e4297d96d8e906ef9bffd6d443: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -4324,6 +4446,12 @@ packages: hasBin: true dev: true + /typescript/5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + /uglify-js/3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} diff --git a/src/grammar/flinksql/FlinkSqlLexer.g4 b/src/grammar/flinksql/FlinkSqlLexer.g4 index 35bfb22..3a2dee4 100644 --- a/src/grammar/flinksql/FlinkSqlLexer.g4 +++ b/src/grammar/flinksql/FlinkSqlLexer.g4 @@ -1,13 +1,15 @@ +// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing +// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true +// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true + lexer grammar FlinkSqlLexer; // SKIP -SPACE: [ \t\r\n]+ -> channel(HIDDEN); -COMMENT_INPUT: '/*' .*? '*/' -> channel(HIDDEN); -LINE_COMMENT: ( - ('--' | '#') ~[\r\n]* ('\r'? '\n' | EOF) - | '--' ('\r'? '\n' | EOF) - ) -> channel(HIDDEN); +SPACE : [ \t\r\n]+ -> channel(HIDDEN); +COMMENT_INPUT : '/*' .*? '*/' -> channel(HIDDEN); +LINE_COMMENT: (('--' | '#') ~[\r\n]* ('\r'? '\n' | EOF) | '--' ('\r'? '\n' | EOF)) -> channel(HIDDEN); /** * Keywords and Reserved Keywords @@ -22,440 +24,440 @@ LINE_COMMENT: ( * Please keep the keyword in alphabetical order if new keyword is added. * When adding new keywords, please consider whether they should be added to the NonReserved Keywords section below. */ -KW_ABS: 'ABS'; -KW_ALL: 'ALL'; -KW_ALLOCATE: 'ALLOCATE'; -KW_ALLOW: 'ALLOW'; -KW_ALTER: 'ALTER'; -KW_ANALYZE: 'ANALYZE'; -KW_AND: 'AND'; -KW_ANY: 'ANY'; -KW_ARE: 'ARE'; -KW_ARRAY: 'ARRAY'; -KW_ARRAY_AGG: 'ARRAY_AGG'; -KW_ARRAY_CONCAT_AGG: 'ARRAY_CONCAT_AGG'; -KW_ARRAY_MAX_CARDINALITY: 'ARRAY_MAX_CARDINALITY'; -KW_AS: 'AS'; -KW_ASENSITIVE: 'ASENSITIVE'; -KW_ASYMMETRIC: 'ASYMMETRIC'; -KW_AT: 'AT'; -KW_ATOMIC: 'ATOMIC'; -KW_AUTHORIZATION: 'AUTHORIZATION'; -KW_AVG: 'AVG'; -KW_BEGIN: 'BEGIN'; -KW_BEGIN_FRAME: 'BEGIN_FRAME'; -KW_BEGIN_PARTITION: 'BEGIN_PARTITION'; -KW_BETWEEN: 'BETWEEN'; -KW_BIGINT: 'BIGINT'; -KW_BINARY: 'BINARY'; -KW_BIT: 'BIT'; -KW_BLOB: 'BLOB'; -KW_BOOLEAN: 'BOOLEAN'; -KW_BOTH: 'BOTH'; -KW_BY: 'BY'; -KW_BYTES: 'BYTES'; -KW_CALL: 'CALL'; -KW_CALLED: 'CALLED'; -KW_CARDINALITY: 'CARDINALITY'; -KW_CASCADED: 'CASCADED'; -KW_CASE: 'CASE'; -KW_CAST: 'CAST'; -KW_CATALOGS: 'CATALOGS'; -KW_CEIL: 'CEIL'; -KW_CEILING: 'CEILING'; -KW_CHANGELOG_MODE: 'CHANGELOG_MODE'; -KW_CHAR: 'CHAR'; -KW_CHARACTER: 'CHARACTER'; -KW_CHARACTER_LENGTH: 'CHARACTER_LENGTH'; -KW_CHAR_LENGTH: 'CHAR_LENGTH'; -KW_CHECK: 'CHECK'; -KW_CLASSIFIER: 'CLASSIFIER'; -KW_CLOB: 'CLOB'; -KW_CLOSE: 'CLOSE'; -KW_COALESCE: 'COALESCE'; -KW_COLLATE: 'COLLATE'; -KW_COLLECT: 'COLLECT'; -KW_COLUMN: 'COLUMN'; -KW_COLUMNS: 'COLUMNS'; -KW_COMMENT: 'COMMENT'; -KW_COMMIT: 'COMMIT'; -KW_COMPUTE: 'COMPUTE'; -KW_CONDITION: 'CONDITION'; -KW_CONNECT: 'CONNECT'; -KW_CONSTRAINT: 'CONSTRAINT'; -KW_CONTAINS: 'CONTAINS'; -KW_CONVERT: 'CONVERT'; -KW_CORR: 'CORR'; -KW_CORRESPONDING: 'CORRESPONDING'; -KW_COUNT: 'COUNT'; -KW_COVAR_POP: 'COVAR_POP'; -KW_COVAR_SAMP: 'COVAR_SAMP'; -KW_CREATE: 'CREATE'; -KW_CROSS: 'CROSS'; -KW_CUBE: 'CUBE'; -KW_CUME_DIST: 'CUME_DIST'; -KW_CURRENT: 'CURRENT'; -KW_CURRENT_CATALOG: 'CURRENT_CATALOG'; -KW_CURRENT_DATE: 'CURRENT_DATE'; -KW_CURRENT_DEFAULT_TRANSFORM_GROUP: 'CURRENT_DEFAULT_TRANSFORM_GROUP'; -KW_CURRENT_PATH: 'CURRENT_PATH'; -KW_CURRENT_ROLE: 'CURRENT_ROLE'; -KW_CURRENT_ROW: 'CURRENT_ROW'; -KW_CURRENT_SCHEMA: 'CURRENT_SCHEMA'; -KW_CURRENT_TIME: 'CURRENT_TIME'; -KW_CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; -KW_CURRENT_TRANSFORM_GROUP_FOR_TYPE: 'CURRENT_TRANSFORM_GROUP_FOR_TYPE'; -KW_CURRENT_USER: 'CURRENT_USER'; -KW_CURSOR: 'CURSOR'; -KW_CYCLE: 'CYCLE'; -KW_DATABASES: 'DATABASES'; -KW_DATE: 'DATE'; -KW_DATETIME: 'DATETIME'; -KW_DATETIME_DIFF: 'DATETIME_DIFF'; -KW_DATETIME_TRUNC: 'DATETIME_TRUNC'; -KW_DATE_DIFF: 'DATE_DIFF'; -KW_DATE_TRUNC: 'DATE_TRUNC'; -KW_DAY: 'DAY'; -KW_DAYOFWEEK: 'DAYOFWEEK'; -KW_DAYOFYEAR: 'DAYOFYEAR'; -KW_DEALLOCATE: 'DEALLOCATE'; -KW_DEC: 'DEC'; -KW_DECIMAL: 'DECIMAL'; -KW_DECLARE: 'DECLARE'; -KW_DEFAULT: 'DEFAULT'; -KW_DEFINE: 'DEFINE'; -KW_DELETE: 'DELETE'; -KW_DENSE_RANK: 'DENSE_RANK'; -KW_DEREF: 'DEREF'; -KW_DESCRIBE: 'DESCRIBE'; -KW_DETERMINISTIC: 'DETERMINISTIC'; -KW_DISALLOW: 'DISALLOW'; -KW_DISCONNECT: 'DISCONNECT'; -KW_DISTINCT: 'DISTINCT'; -KW_DOT: 'DOT'; -KW_DOUBLE: 'DOUBLE'; -KW_DROP: 'DROP'; -KW_DYNAMIC: 'DYNAMIC'; -KW_EACH: 'EACH'; -KW_ELEMENT: 'ELEMENT'; -KW_ELSE: 'ELSE'; -KW_EMPTY: 'EMPTY'; -KW_END: 'END'; +KW_ABS : 'ABS'; +KW_ALL : 'ALL'; +KW_ALLOCATE : 'ALLOCATE'; +KW_ALLOW : 'ALLOW'; +KW_ALTER : 'ALTER'; +KW_ANALYZE : 'ANALYZE'; +KW_AND : 'AND'; +KW_ANY : 'ANY'; +KW_ARE : 'ARE'; +KW_ARRAY : 'ARRAY'; +KW_ARRAY_AGG : 'ARRAY_AGG'; +KW_ARRAY_CONCAT_AGG : 'ARRAY_CONCAT_AGG'; +KW_ARRAY_MAX_CARDINALITY : 'ARRAY_MAX_CARDINALITY'; +KW_AS : 'AS'; +KW_ASENSITIVE : 'ASENSITIVE'; +KW_ASYMMETRIC : 'ASYMMETRIC'; +KW_AT : 'AT'; +KW_ATOMIC : 'ATOMIC'; +KW_AUTHORIZATION : 'AUTHORIZATION'; +KW_AVG : 'AVG'; +KW_BEGIN : 'BEGIN'; +KW_BEGIN_FRAME : 'BEGIN_FRAME'; +KW_BEGIN_PARTITION : 'BEGIN_PARTITION'; +KW_BETWEEN : 'BETWEEN'; +KW_BIGINT : 'BIGINT'; +KW_BINARY : 'BINARY'; +KW_BIT : 'BIT'; +KW_BLOB : 'BLOB'; +KW_BOOLEAN : 'BOOLEAN'; +KW_BOTH : 'BOTH'; +KW_BY : 'BY'; +KW_BYTES : 'BYTES'; +KW_CALL : 'CALL'; +KW_CALLED : 'CALLED'; +KW_CARDINALITY : 'CARDINALITY'; +KW_CASCADED : 'CASCADED'; +KW_CASE : 'CASE'; +KW_CAST : 'CAST'; +KW_CATALOGS : 'CATALOGS'; +KW_CEIL : 'CEIL'; +KW_CEILING : 'CEILING'; +KW_CHANGELOG_MODE : 'CHANGELOG_MODE'; +KW_CHAR : 'CHAR'; +KW_CHARACTER : 'CHARACTER'; +KW_CHARACTER_LENGTH : 'CHARACTER_LENGTH'; +KW_CHAR_LENGTH : 'CHAR_LENGTH'; +KW_CHECK : 'CHECK'; +KW_CLASSIFIER : 'CLASSIFIER'; +KW_CLOB : 'CLOB'; +KW_CLOSE : 'CLOSE'; +KW_COALESCE : 'COALESCE'; +KW_COLLATE : 'COLLATE'; +KW_COLLECT : 'COLLECT'; +KW_COLUMN : 'COLUMN'; +KW_COLUMNS : 'COLUMNS'; +KW_COMMENT : 'COMMENT'; +KW_COMMIT : 'COMMIT'; +KW_COMPUTE : 'COMPUTE'; +KW_CONDITION : 'CONDITION'; +KW_CONNECT : 'CONNECT'; +KW_CONSTRAINT : 'CONSTRAINT'; +KW_CONTAINS : 'CONTAINS'; +KW_CONVERT : 'CONVERT'; +KW_CORR : 'CORR'; +KW_CORRESPONDING : 'CORRESPONDING'; +KW_COUNT : 'COUNT'; +KW_COVAR_POP : 'COVAR_POP'; +KW_COVAR_SAMP : 'COVAR_SAMP'; +KW_CREATE : 'CREATE'; +KW_CROSS : 'CROSS'; +KW_CUBE : 'CUBE'; +KW_CUME_DIST : 'CUME_DIST'; +KW_CURRENT : 'CURRENT'; +KW_CURRENT_CATALOG : 'CURRENT_CATALOG'; +KW_CURRENT_DATE : 'CURRENT_DATE'; +KW_CURRENT_DEFAULT_TRANSFORM_GROUP : 'CURRENT_DEFAULT_TRANSFORM_GROUP'; +KW_CURRENT_PATH : 'CURRENT_PATH'; +KW_CURRENT_ROLE : 'CURRENT_ROLE'; +KW_CURRENT_ROW : 'CURRENT_ROW'; +KW_CURRENT_SCHEMA : 'CURRENT_SCHEMA'; +KW_CURRENT_TIME : 'CURRENT_TIME'; +KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; +KW_CURRENT_TRANSFORM_GROUP_FOR_TYPE : 'CURRENT_TRANSFORM_GROUP_FOR_TYPE'; +KW_CURRENT_USER : 'CURRENT_USER'; +KW_CURSOR : 'CURSOR'; +KW_CYCLE : 'CYCLE'; +KW_DATABASES : 'DATABASES'; +KW_DATE : 'DATE'; +KW_DATETIME : 'DATETIME'; +KW_DATETIME_DIFF : 'DATETIME_DIFF'; +KW_DATETIME_TRUNC : 'DATETIME_TRUNC'; +KW_DATE_DIFF : 'DATE_DIFF'; +KW_DATE_TRUNC : 'DATE_TRUNC'; +KW_DAY : 'DAY'; +KW_DAYOFWEEK : 'DAYOFWEEK'; +KW_DAYOFYEAR : 'DAYOFYEAR'; +KW_DEALLOCATE : 'DEALLOCATE'; +KW_DEC : 'DEC'; +KW_DECIMAL : 'DECIMAL'; +KW_DECLARE : 'DECLARE'; +KW_DEFAULT : 'DEFAULT'; +KW_DEFINE : 'DEFINE'; +KW_DELETE : 'DELETE'; +KW_DENSE_RANK : 'DENSE_RANK'; +KW_DEREF : 'DEREF'; +KW_DESCRIBE : 'DESCRIBE'; +KW_DETERMINISTIC : 'DETERMINISTIC'; +KW_DISALLOW : 'DISALLOW'; +KW_DISCONNECT : 'DISCONNECT'; +KW_DISTINCT : 'DISTINCT'; +KW_DOT : 'DOT'; +KW_DOUBLE : 'DOUBLE'; +KW_DROP : 'DROP'; +KW_DYNAMIC : 'DYNAMIC'; +KW_EACH : 'EACH'; +KW_ELEMENT : 'ELEMENT'; +KW_ELSE : 'ELSE'; +KW_EMPTY : 'EMPTY'; +KW_END : 'END'; // KW_END_EXEC: 'END-EXEC'; -KW_END_FRAME: 'END_FRAME'; -KW_END_PARTITION: 'END_PARTITION'; -KW_ENFORCED: 'ENFORCED'; -KW_EQUALS: 'EQUALS'; -KW_ESCAPE: 'ESCAPE'; -KW_ESTIMATED_COST: 'ESTIMATED_COST'; -KW_EVERY: 'EVERY'; -KW_EXCEPT: 'EXCEPT'; -KW_EXEC: 'EXEC'; -KW_EXECUTE: 'EXECUTE'; -KW_EXISTS: 'EXISTS'; -KW_EXP: 'EXP'; -KW_EXPLAIN: 'EXPLAIN'; -KW_EXTEND: 'EXTEND'; -KW_EXTENDED: 'EXTENDED'; -KW_EXTERNAL: 'EXTERNAL'; -KW_EXTRACT: 'EXTRACT'; -KW_FALSE: 'FALSE'; -KW_FETCH: 'FETCH'; -KW_FILTER: 'FILTER'; -KW_FIRST_VALUE: 'FIRST_VALUE'; -KW_FLOAT: 'FLOAT'; -KW_FLOOR: 'FLOOR'; -KW_FOR: 'FOR'; -KW_FOREIGN: 'FOREIGN'; -KW_FRAME_ROW: 'FRAME_ROW'; -KW_FREE: 'FREE'; -KW_FRIDAY: 'FRIDAY'; -KW_FROM: 'FROM'; -KW_FULL: 'FULL'; -KW_FUNCTION: 'FUNCTION'; -KW_FUNCTIONS: 'FUNCTIONS'; -KW_FUSION: 'FUSION'; -KW_GET: 'GET'; -KW_GLOBAL: 'GLOBAL'; -KW_GRANT: 'GRANT'; -KW_GROUP: 'GROUP'; -KW_GROUPING: 'GROUPING'; -KW_GROUPS: 'GROUPS'; -KW_GROUP_CONCAT: 'GROUP_CONCAT'; -KW_HAVING: 'HAVING'; -KW_HOLD: 'HOLD'; -KW_HOUR: 'HOUR'; -KW_IDENTITY: 'IDENTITY'; -KW_IF: 'IF'; -KW_ILIKE: 'ILIKE'; -KW_IMPORT: 'IMPORT'; -KW_IN: 'IN'; -KW_INCLUDE: 'INCLUDE'; -KW_INDICATOR: 'INDICATOR'; -KW_INITIAL: 'INITIAL'; -KW_INNER: 'INNER'; -KW_INOUT: 'INOUT'; -KW_INSENSITIVE: 'INSENSITIVE'; -KW_INSERT: 'INSERT'; -KW_INT: 'INT'; -KW_INTEGER: 'INTEGER'; -KW_INTERSECT: 'INTERSECT'; -KW_INTERSECTION: 'INTERSECTION'; -KW_INTERVAL: 'INTERVAL'; -KW_INTO: 'INTO'; -KW_IS: 'IS'; -KW_JOIN: 'JOIN'; -KW_JSON_ARRAY: 'JSON_ARRAY'; -KW_JSON_ARRAYAGG: 'JSON_ARRAYAGG'; -KW_JSON_EXECUTION_PLAN: 'JSON_EXECUTION_PLAN'; -KW_JSON_EXISTS: 'JSON_EXISTS'; -KW_JSON_OBJECT: 'JSON_OBJECT'; -KW_JSON_OBJECTAGG: 'JSON_OBJECTAGG'; -KW_JSON_QUERY: 'JSON_QUERY'; -KW_JSON_VALUE: 'JSON_VALUE'; -KW_LAG: 'LAG'; -KW_LANGUAGE: 'LANGUAGE'; -KW_LARGE: 'LARGE'; -KW_LAST_VALUE: 'LAST_VALUE'; -KW_LATERAL: 'LATERAL'; -KW_LEAD: 'LEAD'; -KW_LEADING: 'LEADING'; -KW_LEFT: 'LEFT'; -KW_LIKE: 'LIKE'; -KW_LIKE_REGEX: 'LIKE_REGEX'; -KW_LIMIT: 'LIMIT'; -KW_LN: 'LN'; -KW_LOCAL: 'LOCAL'; -KW_LOCALTIME: 'LOCALTIME'; -KW_LOCALTIMESTAMP: 'LOCALTIMESTAMP'; -KW_LOWER: 'LOWER'; -KW_MATCH: 'MATCH'; -KW_MATCHES: 'MATCHES'; -KW_MATCH_NUMBER: 'MATCH_NUMBER'; -KW_MATCH_RECOGNIZE: 'MATCH_RECOGNIZE'; -KW_MAX: 'MAX'; -KW_MEASURES: 'MEASURES'; -KW_MEMBER: 'MEMBER'; -KW_MERGE: 'MERGE'; -KW_METADATA: 'METADATA'; -KW_METHOD: 'METHOD'; -KW_MIN: 'MIN'; -KW_MINUS: 'MINUS'; -KW_MINUTE: 'MINUTE'; -KW_MOD: 'MOD'; -KW_MODIFIES: 'MODIFIES'; -KW_MODIFY: 'MODIFY'; -KW_MODULE: 'MODULE'; -KW_MODULES: 'MODULES'; -KW_MONDAY: 'MONDAY'; -KW_MONTH: 'MONTH'; -KW_MORE: 'MORE'; -KW_MULTISET: 'MULTISET'; -KW_NATIONAL: 'NATIONAL'; -KW_NATURAL: 'NATURAL'; -KW_NCHAR: 'NCHAR'; -KW_NCLOB: 'NCLOB'; -KW_NEW: 'NEW'; -KW_NEXT: 'NEXT'; -KW_NO: 'NO'; -KW_NONE: 'NONE'; -KW_NORMALIZE: 'NORMALIZE'; -KW_NOT: 'NOT'; -KW_NTH_VALUE: 'NTH_VALUE'; -KW_NTILE: 'NTILE'; -KW_NULL: 'NULL'; -KW_NULLIF: 'NULLIF'; -KW_NUMERIC: 'NUMERIC'; -KW_OCCURRENCES_REGEX: 'OCCURRENCES_REGEX'; -KW_OCTET_LENGTH: 'OCTET_LENGTH'; -KW_OF: 'OF'; -KW_OFFSET: 'OFFSET'; -KW_OLD: 'OLD'; -KW_OMIT: 'OMIT'; -KW_ON: 'ON'; -KW_ONE: 'ONE'; -KW_ONLY: 'ONLY'; -KW_OPEN: 'OPEN'; -KW_OR: 'OR'; -KW_ORDER: 'ORDER'; -KW_ORDINAL: 'ORDINAL'; -KW_OUT: 'OUT'; -KW_OUTER: 'OUTER'; -KW_OVER: 'OVER'; -KW_OVERLAPS: 'OVERLAPS'; -KW_OVERLAY: 'OVERLAY'; -KW_OVERWRITE: 'OVERWRITE'; -KW_OVERWRITING: 'OVERWRITING'; -KW_PARAMETER: 'PARAMETER'; -KW_PARTITION: 'PARTITION'; -KW_PARTITIONED: 'PARTITIONED'; -KW_PARTITIONS: 'PARTITIONS'; -KW_PATTERN: 'PATTERN'; -KW_PER: 'PER'; -KW_PERCENT: 'PERCENT'; -KW_PERCENTILE_CONT: 'PERCENTILE_CONT'; -KW_PERCENTILE_DISC: 'PERCENTILE_DISC'; -KW_PERCENT_RANK: 'PERCENT_RANK'; -KW_PERIOD: 'PERIOD'; -KW_PERMUTE: 'PERMUTE'; -KW_PIVOT: 'PIVOT'; -KW_PORTION: 'PORTION'; -KW_POSITION: 'POSITION'; -KW_POSITION_REGEX: 'POSITION_REGEX'; -KW_POWER: 'POWER'; -KW_PRECEDES: 'PRECEDES'; -KW_PRECISION: 'PRECISION'; -KW_PREPARE: 'PREPARE'; -KW_PREV: 'PREV'; -KW_PRIMARY: 'PRIMARY'; -KW_PROCEDURE: 'PROCEDURE'; -KW_QUALIFY: 'QUALIFY'; -KW_QUARTERS: 'QUARTERS'; -KW_RANGE: 'RANGE'; -KW_RANK: 'RANK'; -KW_RAW: 'RAW'; -KW_READS: 'READS'; -KW_REAL: 'REAL'; -KW_RECURSIVE: 'RECURSIVE'; -KW_REF: 'REF'; -KW_REFERENCES: 'REFERENCES'; -KW_REFERENCING: 'REFERENCING'; -KW_REGR_AVGX: 'REGR_AVGX'; -KW_REGR_AVGY: 'REGR_AVGY'; -KW_REGR_COUNT: 'REGR_COUNT'; -KW_REGR_INTERCEPT: 'REGR_INTERCEPT'; -KW_REGR_R2: 'REGR_R2'; -KW_REGR_SLOPE: 'REGR_SLOPE'; -KW_REGR_SXX: 'REGR_SXX'; -KW_REGR_SXY: 'REGR_SXY'; -KW_REGR_SYY: 'REGR_SYY'; -KW_RELEASE: 'RELEASE'; -KW_RENAME: 'RENAME'; -KW_RESET: 'RESET'; -KW_RESULT: 'RESULT'; -KW_RETURN: 'RETURN'; -KW_RETURNS: 'RETURNS'; -KW_REVOKE: 'REVOKE'; -KW_RIGHT: 'RIGHT'; -KW_RLIKE: 'RLIKE'; -KW_ROLLBACK: 'ROLLBACK'; -KW_ROLLUP: 'ROLLUP'; -KW_ROW: 'ROW'; -KW_ROWS: 'ROWS'; -KW_ROW_NUMBER: 'ROW_NUMBER'; -KW_RUNNING: 'RUNNING'; -KW_SAFE_CAST: 'SAFE_CAST'; -KW_SAFE_OFFSET: 'SAFE_OFFSET'; -KW_SAFE_ORDINAL: 'SAFE_ORDINAL'; -KW_SATURDAY: 'SATURDAY'; -KW_SAVEPOINT: 'SAVEPOINT'; -KW_SCALA: 'SCALA'; -KW_SCOPE: 'SCOPE'; -KW_SCROLL: 'SCROLL'; -KW_SEARCH: 'SEARCH'; -KW_SECOND: 'SECOND'; -KW_SEEK: 'SEEK'; -KW_SELECT: 'SELECT'; -KW_SENSITIVE: 'SENSITIVE'; -KW_SEPARATOR: 'SEPARATOR'; -KW_SESSION_USER: 'SESSION_USER'; -KW_SET: 'SET'; -KW_SHOW: 'SHOW'; -KW_SIMILAR: 'SIMILAR'; -KW_SKIP: 'SKIP'; -KW_SMALLINT: 'SMALLINT'; -KW_SOME: 'SOME'; -KW_SPECIFIC: 'SPECIFIC'; -KW_SPECIFICTYPE: 'SPECIFICTYPE'; -KW_SQL: 'SQL'; -KW_SQLEXCEPTION: 'SQLEXCEPTION'; -KW_SQLSTATE: 'SQLSTATE'; -KW_SQLWARNING: 'SQLWARNING'; -KW_SQRT: 'SQRT'; -KW_START: 'START'; -KW_STATEMENT: 'STATEMENT'; -KW_STATIC: 'STATIC'; -KW_STATISTICS: 'STATISTICS'; -KW_STDDEV_POP: 'STDDEV_POP'; -KW_STDDEV_SAMP: 'STDDEV_SAMP'; -KW_STREAM: 'STREAM'; -KW_STRING: 'STRING'; -KW_STRING_AGG: 'STRING_AGG'; -KW_SUBMULTISET: 'SUBMULTISET'; -KW_SUBSET: 'SUBSET'; -KW_SUBSTRING: 'SUBSTRING'; -KW_SUBSTRING_REGEX: 'SUBSTRING_REGEX'; -KW_SUCCEEDS: 'SUCCEEDS'; -KW_SUM: 'SUM'; -KW_SUNDAY: 'SUNDAY'; -KW_SYMMETRIC: 'SYMMETRIC'; -KW_SYSTEM: 'SYSTEM'; -KW_SYSTEM_TIME: 'SYSTEM_TIME'; -KW_SYSTEM_USER: 'SYSTEM_USER'; -KW_TABLE: 'TABLE'; -KW_TABLES: 'TABLES'; -KW_TABLESAMPLE: 'TABLESAMPLE'; -KW_THEN: 'THEN'; -KW_THURSDAY: 'THURSDAY'; -KW_TIME: 'TIME'; -KW_TIMESTAMP: 'TIMESTAMP'; -KW_TIMESTAMP_DIFF: 'TIMESTAMP_DIFF'; -KW_TIMESTAMP_LTZ: 'TIMESTAMP_LTZ'; -KW_TIMESTAMP_TRUNC: 'TIMESTAMP_TRUNC'; -KW_TIMEZONE_HOUR: 'TIMEZONE_HOUR'; -KW_TIMEZONE_MINUTE: 'TIMEZONE_MINUTE'; -KW_TIME_DIFF: 'TIME_DIFF'; -KW_TIME_TRUNC: 'TIME_TRUNC'; -KW_TINYINT: 'TINYINT'; -KW_TO: 'TO'; -KW_TRAILING: 'TRAILING'; -KW_TRANSLATE: 'TRANSLATE'; -KW_TRANSLATE_REGEX: 'TRANSLATE_REGEX'; -KW_TRANSLATION: 'TRANSLATION'; -KW_TREAT: 'TREAT'; -KW_TRIGGER: 'TRIGGER'; -KW_TRIM: 'TRIM'; -KW_TRIM_ARRAY: 'TRIM_ARRAY'; -KW_TRUE: 'TRUE'; -KW_TRUNCATE: 'TRUNCATE'; -KW_TRY_CAST: 'TRY_CAST'; -KW_TUESDAY: 'TUESDAY'; -KW_UESCAPE: 'UESCAPE'; -KW_UNION: 'UNION'; -KW_UNIQUE: 'UNIQUE'; -KW_UNKNOWN: 'UNKNOWN'; -KW_UNNEST: 'UNNEST'; -KW_UNPIVOT: 'UNPIVOT'; -KW_UPDATE: 'UPDATE'; -KW_UPPER: 'UPPER'; -KW_UPSERT: 'UPSERT'; -KW_USE: 'USE'; -KW_USER: 'USER'; -KW_USING: 'USING'; -KW_VALUE: 'VALUE'; -KW_VALUES: 'VALUES'; -KW_VALUE_OF: 'VALUE_OF'; -KW_VARBINARY: 'VARBINARY'; -KW_VARCHAR: 'VARCHAR'; -KW_VARYING: 'VARYING'; -KW_VAR_POP: 'VAR_POP'; -KW_VAR_SAMP: 'VAR_SAMP'; -KW_VERSIONING: 'VERSIONING'; -KW_VIEWS: 'VIEWS'; -KW_VIRTUAL: 'VIRTUAL'; -KW_WATERMARK: 'WATERMARK'; -KW_WATERMARKS: 'WATERMARKS'; -KW_WEDNESDAY: 'WEDNESDAY'; -KW_WEEKS: 'WEEKS'; -KW_WHEN: 'WHEN'; -KW_WHENEVER: 'WHENEVER'; -KW_WHERE: 'WHERE'; -KW_WIDTH_BUCKET: 'WIDTH_BUCKET'; -KW_WINDOW: 'WINDOW'; -KW_WITH: 'WITH'; -KW_WITHIN: 'WITHIN'; -KW_WITHOUT: 'WITHOUT'; -KW_YEAR: 'YEAR'; +KW_END_FRAME : 'END_FRAME'; +KW_END_PARTITION : 'END_PARTITION'; +KW_ENFORCED : 'ENFORCED'; +KW_EQUALS : 'EQUALS'; +KW_ESCAPE : 'ESCAPE'; +KW_ESTIMATED_COST : 'ESTIMATED_COST'; +KW_EVERY : 'EVERY'; +KW_EXCEPT : 'EXCEPT'; +KW_EXEC : 'EXEC'; +KW_EXECUTE : 'EXECUTE'; +KW_EXISTS : 'EXISTS'; +KW_EXP : 'EXP'; +KW_EXPLAIN : 'EXPLAIN'; +KW_EXTEND : 'EXTEND'; +KW_EXTENDED : 'EXTENDED'; +KW_EXTERNAL : 'EXTERNAL'; +KW_EXTRACT : 'EXTRACT'; +KW_FALSE : 'FALSE'; +KW_FETCH : 'FETCH'; +KW_FILTER : 'FILTER'; +KW_FIRST_VALUE : 'FIRST_VALUE'; +KW_FLOAT : 'FLOAT'; +KW_FLOOR : 'FLOOR'; +KW_FOR : 'FOR'; +KW_FOREIGN : 'FOREIGN'; +KW_FRAME_ROW : 'FRAME_ROW'; +KW_FREE : 'FREE'; +KW_FRIDAY : 'FRIDAY'; +KW_FROM : 'FROM'; +KW_FULL : 'FULL'; +KW_FUNCTION : 'FUNCTION'; +KW_FUNCTIONS : 'FUNCTIONS'; +KW_FUSION : 'FUSION'; +KW_GET : 'GET'; +KW_GLOBAL : 'GLOBAL'; +KW_GRANT : 'GRANT'; +KW_GROUP : 'GROUP'; +KW_GROUPING : 'GROUPING'; +KW_GROUPS : 'GROUPS'; +KW_GROUP_CONCAT : 'GROUP_CONCAT'; +KW_HAVING : 'HAVING'; +KW_HOLD : 'HOLD'; +KW_HOUR : 'HOUR'; +KW_IDENTITY : 'IDENTITY'; +KW_IF : 'IF'; +KW_ILIKE : 'ILIKE'; +KW_IMPORT : 'IMPORT'; +KW_IN : 'IN'; +KW_INCLUDE : 'INCLUDE'; +KW_INDICATOR : 'INDICATOR'; +KW_INITIAL : 'INITIAL'; +KW_INNER : 'INNER'; +KW_INOUT : 'INOUT'; +KW_INSENSITIVE : 'INSENSITIVE'; +KW_INSERT : 'INSERT'; +KW_INT : 'INT'; +KW_INTEGER : 'INTEGER'; +KW_INTERSECT : 'INTERSECT'; +KW_INTERSECTION : 'INTERSECTION'; +KW_INTERVAL : 'INTERVAL'; +KW_INTO : 'INTO'; +KW_IS : 'IS'; +KW_JOIN : 'JOIN'; +KW_JSON_ARRAY : 'JSON_ARRAY'; +KW_JSON_ARRAYAGG : 'JSON_ARRAYAGG'; +KW_JSON_EXECUTION_PLAN : 'JSON_EXECUTION_PLAN'; +KW_JSON_EXISTS : 'JSON_EXISTS'; +KW_JSON_OBJECT : 'JSON_OBJECT'; +KW_JSON_OBJECTAGG : 'JSON_OBJECTAGG'; +KW_JSON_QUERY : 'JSON_QUERY'; +KW_JSON_VALUE : 'JSON_VALUE'; +KW_LAG : 'LAG'; +KW_LANGUAGE : 'LANGUAGE'; +KW_LARGE : 'LARGE'; +KW_LAST_VALUE : 'LAST_VALUE'; +KW_LATERAL : 'LATERAL'; +KW_LEAD : 'LEAD'; +KW_LEADING : 'LEADING'; +KW_LEFT : 'LEFT'; +KW_LIKE : 'LIKE'; +KW_LIKE_REGEX : 'LIKE_REGEX'; +KW_LIMIT : 'LIMIT'; +KW_LN : 'LN'; +KW_LOCAL : 'LOCAL'; +KW_LOCALTIME : 'LOCALTIME'; +KW_LOCALTIMESTAMP : 'LOCALTIMESTAMP'; +KW_LOWER : 'LOWER'; +KW_MATCH : 'MATCH'; +KW_MATCHES : 'MATCHES'; +KW_MATCH_NUMBER : 'MATCH_NUMBER'; +KW_MATCH_RECOGNIZE : 'MATCH_RECOGNIZE'; +KW_MAX : 'MAX'; +KW_MEASURES : 'MEASURES'; +KW_MEMBER : 'MEMBER'; +KW_MERGE : 'MERGE'; +KW_METADATA : 'METADATA'; +KW_METHOD : 'METHOD'; +KW_MIN : 'MIN'; +KW_MINUS : 'MINUS'; +KW_MINUTE : 'MINUTE'; +KW_MOD : 'MOD'; +KW_MODIFIES : 'MODIFIES'; +KW_MODIFY : 'MODIFY'; +KW_MODULE : 'MODULE'; +KW_MODULES : 'MODULES'; +KW_MONDAY : 'MONDAY'; +KW_MONTH : 'MONTH'; +KW_MORE : 'MORE'; +KW_MULTISET : 'MULTISET'; +KW_NATIONAL : 'NATIONAL'; +KW_NATURAL : 'NATURAL'; +KW_NCHAR : 'NCHAR'; +KW_NCLOB : 'NCLOB'; +KW_NEW : 'NEW'; +KW_NEXT : 'NEXT'; +KW_NO : 'NO'; +KW_NONE : 'NONE'; +KW_NORMALIZE : 'NORMALIZE'; +KW_NOT : 'NOT'; +KW_NTH_VALUE : 'NTH_VALUE'; +KW_NTILE : 'NTILE'; +KW_NULL : 'NULL'; +KW_NULLIF : 'NULLIF'; +KW_NUMERIC : 'NUMERIC'; +KW_OCCURRENCES_REGEX : 'OCCURRENCES_REGEX'; +KW_OCTET_LENGTH : 'OCTET_LENGTH'; +KW_OF : 'OF'; +KW_OFFSET : 'OFFSET'; +KW_OLD : 'OLD'; +KW_OMIT : 'OMIT'; +KW_ON : 'ON'; +KW_ONE : 'ONE'; +KW_ONLY : 'ONLY'; +KW_OPEN : 'OPEN'; +KW_OR : 'OR'; +KW_ORDER : 'ORDER'; +KW_ORDINAL : 'ORDINAL'; +KW_OUT : 'OUT'; +KW_OUTER : 'OUTER'; +KW_OVER : 'OVER'; +KW_OVERLAPS : 'OVERLAPS'; +KW_OVERLAY : 'OVERLAY'; +KW_OVERWRITE : 'OVERWRITE'; +KW_OVERWRITING : 'OVERWRITING'; +KW_PARAMETER : 'PARAMETER'; +KW_PARTITION : 'PARTITION'; +KW_PARTITIONED : 'PARTITIONED'; +KW_PARTITIONS : 'PARTITIONS'; +KW_PATTERN : 'PATTERN'; +KW_PER : 'PER'; +KW_PERCENT : 'PERCENT'; +KW_PERCENTILE_CONT : 'PERCENTILE_CONT'; +KW_PERCENTILE_DISC : 'PERCENTILE_DISC'; +KW_PERCENT_RANK : 'PERCENT_RANK'; +KW_PERIOD : 'PERIOD'; +KW_PERMUTE : 'PERMUTE'; +KW_PIVOT : 'PIVOT'; +KW_PORTION : 'PORTION'; +KW_POSITION : 'POSITION'; +KW_POSITION_REGEX : 'POSITION_REGEX'; +KW_POWER : 'POWER'; +KW_PRECEDES : 'PRECEDES'; +KW_PRECISION : 'PRECISION'; +KW_PREPARE : 'PREPARE'; +KW_PREV : 'PREV'; +KW_PRIMARY : 'PRIMARY'; +KW_PROCEDURE : 'PROCEDURE'; +KW_QUALIFY : 'QUALIFY'; +KW_QUARTERS : 'QUARTERS'; +KW_RANGE : 'RANGE'; +KW_RANK : 'RANK'; +KW_RAW : 'RAW'; +KW_READS : 'READS'; +KW_REAL : 'REAL'; +KW_RECURSIVE : 'RECURSIVE'; +KW_REF : 'REF'; +KW_REFERENCES : 'REFERENCES'; +KW_REFERENCING : 'REFERENCING'; +KW_REGR_AVGX : 'REGR_AVGX'; +KW_REGR_AVGY : 'REGR_AVGY'; +KW_REGR_COUNT : 'REGR_COUNT'; +KW_REGR_INTERCEPT : 'REGR_INTERCEPT'; +KW_REGR_R2 : 'REGR_R2'; +KW_REGR_SLOPE : 'REGR_SLOPE'; +KW_REGR_SXX : 'REGR_SXX'; +KW_REGR_SXY : 'REGR_SXY'; +KW_REGR_SYY : 'REGR_SYY'; +KW_RELEASE : 'RELEASE'; +KW_RENAME : 'RENAME'; +KW_RESET : 'RESET'; +KW_RESULT : 'RESULT'; +KW_RETURN : 'RETURN'; +KW_RETURNS : 'RETURNS'; +KW_REVOKE : 'REVOKE'; +KW_RIGHT : 'RIGHT'; +KW_RLIKE : 'RLIKE'; +KW_ROLLBACK : 'ROLLBACK'; +KW_ROLLUP : 'ROLLUP'; +KW_ROW : 'ROW'; +KW_ROWS : 'ROWS'; +KW_ROW_NUMBER : 'ROW_NUMBER'; +KW_RUNNING : 'RUNNING'; +KW_SAFE_CAST : 'SAFE_CAST'; +KW_SAFE_OFFSET : 'SAFE_OFFSET'; +KW_SAFE_ORDINAL : 'SAFE_ORDINAL'; +KW_SATURDAY : 'SATURDAY'; +KW_SAVEPOINT : 'SAVEPOINT'; +KW_SCALA : 'SCALA'; +KW_SCOPE : 'SCOPE'; +KW_SCROLL : 'SCROLL'; +KW_SEARCH : 'SEARCH'; +KW_SECOND : 'SECOND'; +KW_SEEK : 'SEEK'; +KW_SELECT : 'SELECT'; +KW_SENSITIVE : 'SENSITIVE'; +KW_SEPARATOR : 'SEPARATOR'; +KW_SESSION_USER : 'SESSION_USER'; +KW_SET : 'SET'; +KW_SHOW : 'SHOW'; +KW_SIMILAR : 'SIMILAR'; +KW_SKIP : 'SKIP'; +KW_SMALLINT : 'SMALLINT'; +KW_SOME : 'SOME'; +KW_SPECIFIC : 'SPECIFIC'; +KW_SPECIFICTYPE : 'SPECIFICTYPE'; +KW_SQL : 'SQL'; +KW_SQLEXCEPTION : 'SQLEXCEPTION'; +KW_SQLSTATE : 'SQLSTATE'; +KW_SQLWARNING : 'SQLWARNING'; +KW_SQRT : 'SQRT'; +KW_START : 'START'; +KW_STATEMENT : 'STATEMENT'; +KW_STATIC : 'STATIC'; +KW_STATISTICS : 'STATISTICS'; +KW_STDDEV_POP : 'STDDEV_POP'; +KW_STDDEV_SAMP : 'STDDEV_SAMP'; +KW_STREAM : 'STREAM'; +KW_STRING : 'STRING'; +KW_STRING_AGG : 'STRING_AGG'; +KW_SUBMULTISET : 'SUBMULTISET'; +KW_SUBSET : 'SUBSET'; +KW_SUBSTRING : 'SUBSTRING'; +KW_SUBSTRING_REGEX : 'SUBSTRING_REGEX'; +KW_SUCCEEDS : 'SUCCEEDS'; +KW_SUM : 'SUM'; +KW_SUNDAY : 'SUNDAY'; +KW_SYMMETRIC : 'SYMMETRIC'; +KW_SYSTEM : 'SYSTEM'; +KW_SYSTEM_TIME : 'SYSTEM_TIME'; +KW_SYSTEM_USER : 'SYSTEM_USER'; +KW_TABLE : 'TABLE'; +KW_TABLES : 'TABLES'; +KW_TABLESAMPLE : 'TABLESAMPLE'; +KW_THEN : 'THEN'; +KW_THURSDAY : 'THURSDAY'; +KW_TIME : 'TIME'; +KW_TIMESTAMP : 'TIMESTAMP'; +KW_TIMESTAMP_DIFF : 'TIMESTAMP_DIFF'; +KW_TIMESTAMP_LTZ : 'TIMESTAMP_LTZ'; +KW_TIMESTAMP_TRUNC : 'TIMESTAMP_TRUNC'; +KW_TIMEZONE_HOUR : 'TIMEZONE_HOUR'; +KW_TIMEZONE_MINUTE : 'TIMEZONE_MINUTE'; +KW_TIME_DIFF : 'TIME_DIFF'; +KW_TIME_TRUNC : 'TIME_TRUNC'; +KW_TINYINT : 'TINYINT'; +KW_TO : 'TO'; +KW_TRAILING : 'TRAILING'; +KW_TRANSLATE : 'TRANSLATE'; +KW_TRANSLATE_REGEX : 'TRANSLATE_REGEX'; +KW_TRANSLATION : 'TRANSLATION'; +KW_TREAT : 'TREAT'; +KW_TRIGGER : 'TRIGGER'; +KW_TRIM : 'TRIM'; +KW_TRIM_ARRAY : 'TRIM_ARRAY'; +KW_TRUE : 'TRUE'; +KW_TRUNCATE : 'TRUNCATE'; +KW_TRY_CAST : 'TRY_CAST'; +KW_TUESDAY : 'TUESDAY'; +KW_UESCAPE : 'UESCAPE'; +KW_UNION : 'UNION'; +KW_UNIQUE : 'UNIQUE'; +KW_UNKNOWN : 'UNKNOWN'; +KW_UNNEST : 'UNNEST'; +KW_UNPIVOT : 'UNPIVOT'; +KW_UPDATE : 'UPDATE'; +KW_UPPER : 'UPPER'; +KW_UPSERT : 'UPSERT'; +KW_USE : 'USE'; +KW_USER : 'USER'; +KW_USING : 'USING'; +KW_VALUE : 'VALUE'; +KW_VALUES : 'VALUES'; +KW_VALUE_OF : 'VALUE_OF'; +KW_VARBINARY : 'VARBINARY'; +KW_VARCHAR : 'VARCHAR'; +KW_VARYING : 'VARYING'; +KW_VAR_POP : 'VAR_POP'; +KW_VAR_SAMP : 'VAR_SAMP'; +KW_VERSIONING : 'VERSIONING'; +KW_VIEWS : 'VIEWS'; +KW_VIRTUAL : 'VIRTUAL'; +KW_WATERMARK : 'WATERMARK'; +KW_WATERMARKS : 'WATERMARKS'; +KW_WEDNESDAY : 'WEDNESDAY'; +KW_WEEKS : 'WEEKS'; +KW_WHEN : 'WHEN'; +KW_WHENEVER : 'WHENEVER'; +KW_WHERE : 'WHERE'; +KW_WIDTH_BUCKET : 'WIDTH_BUCKET'; +KW_WINDOW : 'WINDOW'; +KW_WITH : 'WITH'; +KW_WITHIN : 'WITHIN'; +KW_WITHOUT : 'WITHOUT'; +KW_YEAR : 'YEAR'; /** * Non-Reserved Keywords @@ -463,133 +465,130 @@ KW_YEAR: 'YEAR'; * Please keep the keyword in alphabetical order if new keyword is added. * New non-reserved keywords should also be added to the nonReservedKeywords rule in FlinkSqlParser.g4 file. */ -KW_ADD :'ADD'; -KW_AFTER :'AFTER'; -KW_ASC :'ASC'; -KW_CASCADE :'CASCADE'; -KW_CATALOG :'CATALOG'; -KW_CENTURY :'CENTURY'; -KW_CONFIG :'CONFIG'; -KW_CONSTRAINTS :'CONSTRAINTS'; -KW_CUMULATE :'CUMULATE'; -KW_DATA :'DATA'; -KW_DATABASE :'DATABASE'; -KW_DAYS :'DAYS'; -KW_DECADE :'DECADE'; -KW_DESC :'DESC'; -KW_DESCRIPTOR :'DESCRIPTOR'; -KW_DIV :'DIV'; -KW_ENGINE :'ENGINE'; -KW_EPOCH :'EPOCH'; -KW_EXCLUDING :'EXCLUDING'; -KW_FILE :'FILE'; -KW_FIRST :'FIRST'; -KW_GENERATED :'GENERATED'; -KW_HOP :'HOP'; -KW_HOURS :'HOURS'; -KW_IGNORE :'IGNORE'; -KW_INCLUDING :'INCLUDING'; -KW_JAR :'JAR'; -KW_JARS :'JARS'; -KW_JAVA :'JAVA'; -KW_KEY :'KEY'; -KW_LAST :'LAST'; -KW_LOAD :'LOAD'; -KW_MAP :'MAP'; -KW_MICROSECOND :'MICROSECOND'; -KW_MILLENNIUM :'MILLENNIUM'; -KW_MILLISECOND :'MILLISECOND'; -KW_MINUTES :'MINUTES'; -KW_MONTHS :'MONTHS'; -KW_NANOSECOND :'NANOSECOND'; -KW_NULLS :'NULLS'; -KW_OPTIONS :'OPTIONS'; -KW_PAST :'PAST'; -KW_PLAN :'PLAN'; -KW_PRECEDING :'PRECEDING'; -KW_PYTHON :'PYTHON'; -KW_PYTHON_ARCHIVES :'PYTHON_ARCHIVES'; -KW_PYTHON_DEPENDENCIES :'PYTHON_DEPENDENCIES'; -KW_PYTHON_FILES :'PYTHON_FILES'; -KW_PYTHON_JAR :'PYTHON_JAR'; -KW_PYTHON_PARAMETER :'PYTHON_PARAMETER'; -KW_PYTHON_REQUIREMENTS :'PYTHON_REQUIREMENTS'; -KW_QUARTER :'QUARTER'; -KW_REMOVE :'REMOVE'; -KW_RESTRICT :'RESTRICT'; -KW_SECONDS :'SECONDS'; -KW_SESSION :'SESSION'; -KW_SETS :'SETS'; -KW_SIZE :'SIZE'; -KW_SLIDE :'SLIDE'; -KW_STEP :'STEP'; -KW_TEMPORARY :'TEMPORARY'; -KW_TIMECOL :'TIMECOL'; -KW_TUMBLE :'TUMBLE'; -KW_UNLOAD :'UNLOAD'; -KW_VIEW :'VIEW'; -KW_WEEK :'WEEK'; -KW_YEARS :'YEARS'; -KW_ZONE :'ZONE'; - +KW_ADD : 'ADD'; +KW_AFTER : 'AFTER'; +KW_ASC : 'ASC'; +KW_CASCADE : 'CASCADE'; +KW_CATALOG : 'CATALOG'; +KW_CENTURY : 'CENTURY'; +KW_CONFIG : 'CONFIG'; +KW_CONSTRAINTS : 'CONSTRAINTS'; +KW_CUMULATE : 'CUMULATE'; +KW_DATA : 'DATA'; +KW_DATABASE : 'DATABASE'; +KW_DAYS : 'DAYS'; +KW_DECADE : 'DECADE'; +KW_DESC : 'DESC'; +KW_DESCRIPTOR : 'DESCRIPTOR'; +KW_DIV : 'DIV'; +KW_ENGINE : 'ENGINE'; +KW_EPOCH : 'EPOCH'; +KW_EXCLUDING : 'EXCLUDING'; +KW_FILE : 'FILE'; +KW_FIRST : 'FIRST'; +KW_GENERATED : 'GENERATED'; +KW_HOP : 'HOP'; +KW_HOURS : 'HOURS'; +KW_IGNORE : 'IGNORE'; +KW_INCLUDING : 'INCLUDING'; +KW_JAR : 'JAR'; +KW_JARS : 'JARS'; +KW_JAVA : 'JAVA'; +KW_KEY : 'KEY'; +KW_LAST : 'LAST'; +KW_LOAD : 'LOAD'; +KW_MAP : 'MAP'; +KW_MICROSECOND : 'MICROSECOND'; +KW_MILLENNIUM : 'MILLENNIUM'; +KW_MILLISECOND : 'MILLISECOND'; +KW_MINUTES : 'MINUTES'; +KW_MONTHS : 'MONTHS'; +KW_NANOSECOND : 'NANOSECOND'; +KW_NULLS : 'NULLS'; +KW_OPTIONS : 'OPTIONS'; +KW_PAST : 'PAST'; +KW_PLAN : 'PLAN'; +KW_PRECEDING : 'PRECEDING'; +KW_PYTHON : 'PYTHON'; +KW_PYTHON_ARCHIVES : 'PYTHON_ARCHIVES'; +KW_PYTHON_DEPENDENCIES : 'PYTHON_DEPENDENCIES'; +KW_PYTHON_FILES : 'PYTHON_FILES'; +KW_PYTHON_JAR : 'PYTHON_JAR'; +KW_PYTHON_PARAMETER : 'PYTHON_PARAMETER'; +KW_PYTHON_REQUIREMENTS : 'PYTHON_REQUIREMENTS'; +KW_QUARTER : 'QUARTER'; +KW_REMOVE : 'REMOVE'; +KW_RESTRICT : 'RESTRICT'; +KW_SECONDS : 'SECONDS'; +KW_SESSION : 'SESSION'; +KW_SETS : 'SETS'; +KW_SIZE : 'SIZE'; +KW_SLIDE : 'SLIDE'; +KW_STEP : 'STEP'; +KW_TEMPORARY : 'TEMPORARY'; +KW_TIMECOL : 'TIMECOL'; +KW_TUMBLE : 'TUMBLE'; +KW_UNLOAD : 'UNLOAD'; +KW_VIEW : 'VIEW'; +KW_WEEK : 'WEEK'; +KW_YEARS : 'YEARS'; +KW_ZONE : 'ZONE'; // Operators. Comparation -EQUAL_SYMBOL: '='; -GREATER_SYMBOL: '>'; -LESS_SYMBOL: '<'; -EXCLAMATION_SYMBOL: '!'; - +EQUAL_SYMBOL : '='; +GREATER_SYMBOL : '>'; +LESS_SYMBOL : '<'; +EXCLAMATION_SYMBOL : '!'; // Operators. Bit -BIT_NOT_OP: '~'; -BIT_OR_OP: '|'; -BIT_AND_OP: '&'; -BIT_XOR_OP: '^'; - +BIT_NOT_OP : '~'; +BIT_OR_OP : '|'; +BIT_AND_OP : '&'; +BIT_XOR_OP : '^'; // Constructors symbols -DOT: '.'; -LS_BRACKET: '['; -RS_BRACKET: ']'; -LR_BRACKET: '('; -RR_BRACKET: ')'; -LB_BRACKET: '{'; -RB_BRACKET: '}'; -COMMA: ','; -SEMICOLON: ';'; -AT_SIGN: '@'; -SINGLE_QUOTE_SYMB: '\''; -DOUBLE_QUOTE_SYMB: '"'; -REVERSE_QUOTE_SYMB: '`'; -COLON_SYMB: ':'; -ASTERISK_SIGN: '*'; -UNDERLINE_SIGN: '_'; -HYPNEN_SIGN: '-'; -ADD_SIGN: '+'; -PENCENT_SIGN: '%'; -DOUBLE_VERTICAL_SIGN: '||'; -DOUBLE_HYPNEN_SIGN: '--'; -SLASH_SIGN: '/'; -QUESTION_MARK_SIGN: '?'; -DOUBLE_RIGHT_ARROW: '=>'; -STRING_LITERAL: DQUOTA_STRING | SQUOTA_STRING | BQUOTA_STRING; -DIG_LITERAL: DEC_DIGIT+; -REAL_LITERAL: (DEC_DIGIT+)? '.' DEC_DIGIT+ - | DEC_DIGIT+ '.' EXPONENT_NUM_PART - | (DEC_DIGIT+)? '.' (DEC_DIGIT+ EXPONENT_NUM_PART) - | DEC_DIGIT+ EXPONENT_NUM_PART; -BIT_STRING: BIT_STRING_L; -ID_LITERAL: ID_LITERAL_FRAG; +DOT : '.'; +LS_BRACKET : '['; +RS_BRACKET : ']'; +LR_BRACKET : '('; +RR_BRACKET : ')'; +LB_BRACKET : '{'; +RB_BRACKET : '}'; +COMMA : ','; +SEMICOLON : ';'; +AT_SIGN : '@'; +SINGLE_QUOTE_SYMB : '\''; +DOUBLE_QUOTE_SYMB : '"'; +REVERSE_QUOTE_SYMB : '`'; +COLON_SYMB : ':'; +ASTERISK_SIGN : '*'; +UNDERLINE_SIGN : '_'; +HYPNEN_SIGN : '-'; +ADD_SIGN : '+'; +PENCENT_SIGN : '%'; +DOUBLE_VERTICAL_SIGN : '||'; +DOUBLE_HYPNEN_SIGN : '--'; +SLASH_SIGN : '/'; +QUESTION_MARK_SIGN : '?'; +DOUBLE_RIGHT_ARROW : '=>'; +STRING_LITERAL : DQUOTA_STRING | SQUOTA_STRING | BQUOTA_STRING; +DIG_LITERAL : DEC_DIGIT+; +REAL_LITERAL: (DEC_DIGIT+)? '.' DEC_DIGIT+ + | DEC_DIGIT+ '.' EXPONENT_NUM_PART + | (DEC_DIGIT+)? '.' (DEC_DIGIT+ EXPONENT_NUM_PART) + | DEC_DIGIT+ EXPONENT_NUM_PART; +BIT_STRING : BIT_STRING_L; +ID_LITERAL : ID_LITERAL_FRAG; -fragment JAR_FILE_PARTTARN: '`' ( '\\'. | '``' | ~('`'|'\\'))* '`'; -fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+; -fragment ID_LITERAL_FRAG: [A-Z_0-9a-z]*?[A-Z_a-z]+?[A-Z_0-9a-z]*; -fragment DEC_DIGIT: [0-9]; -fragment DEC_LETTER: [A-Za-z]; -fragment DQUOTA_STRING: '"' ( '\\'. | '""' | ~('"'| '\\') )* '"'; -fragment SQUOTA_STRING: '\'' ('\\'. | '\'\'' | ~('\'' | '\\'))* '\''; -fragment BIT_STRING_L: 'B' '\'' [01]+ '\''; -fragment BQUOTA_STRING: '`' ( '\\'. | '``' | ~('`'|'\\'))* '`'; \ No newline at end of file +fragment JAR_FILE_PARTTARN : '`' ( '\\' . | '``' | ~('`' | '\\'))* '`'; +fragment EXPONENT_NUM_PART : 'E' [-+]? DEC_DIGIT+; +fragment ID_LITERAL_FRAG : [A-Z_0-9a-z]*? [A-Z_a-z]+? [A-Z_0-9a-z]*; +fragment DEC_DIGIT : [0-9]; +fragment DEC_LETTER : [A-Za-z]; +fragment DQUOTA_STRING : '"' ( '\\' . | '""' | ~('"' | '\\'))* '"'; +fragment SQUOTA_STRING : '\'' ('\\' . | '\'\'' | ~('\'' | '\\'))* '\''; +fragment BIT_STRING_L : 'B' '\'' [01]+ '\''; +fragment BQUOTA_STRING : '`' ( '\\' . | '``' | ~('`' | '\\'))* '`'; \ No newline at end of file diff --git a/src/grammar/flinksql/FlinkSqlParser.g4 b/src/grammar/flinksql/FlinkSqlParser.g4 index 4545461..7d96518 100644 --- a/src/grammar/flinksql/FlinkSqlParser.g4 +++ b/src/grammar/flinksql/FlinkSqlParser.g4 @@ -1,8 +1,16 @@ +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging +// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true + parser grammar FlinkSqlParser; -options { tokenVocab=FlinkSqlLexer; } +options { + tokenVocab=FlinkSqlLexer; +} -program: singleStatement* EOF; +program + : singleStatement* EOF + ; singleStatement : sqlStatement SEMICOLON? @@ -10,10 +18,18 @@ singleStatement ; sqlStatement - : ddlStatement | dmlStatement | describeStatement - | explainStatement | useStatement | showStatememt - | loadStatement | unloadStatememt | setStatememt - | resetStatememt | jarStatememt | dtAddStatement + : ddlStatement + | dmlStatement + | describeStatement + | explainStatement + | useStatement + | showStatememt + | loadStatement + | unloadStatememt + | setStatememt + | resetStatememt + | jarStatememt + | dtAddStatement ; emptyStatement @@ -21,13 +37,25 @@ emptyStatement ; ddlStatement - : createTable | createDatabase | createView | createFunction | createCatalog - | alterTable | alertView | alterDatabase | alterFunction - | dropCatalog | dropTable | dropDatabase | dropView | dropFunction + : createTable + | createDatabase + | createView + | createFunction + | createCatalog + | alterTable + | alertView + | alterDatabase + | alterFunction + | dropCatalog + | dropTable + | dropDatabase + | dropView + | dropFunction ; dmlStatement - : queryStatement | insertStatement + : queryStatement + | insertStatement ; // some statemen @@ -36,7 +64,11 @@ describeStatement ; explainStatement - : KW_EXPLAIN (explainDetails | KW_PLAN KW_FOR)? (dmlStatement | insertSimpleStatement | insertMulStatement) + : KW_EXPLAIN (explainDetails | KW_PLAN KW_FOR)? ( + dmlStatement + | insertSimpleStatement + | insertMulStatement + ) ; explainDetails @@ -44,11 +76,13 @@ explainDetails ; explainDetail - : KW_CHANGELOG_MODE | KW_JSON_EXECUTION_PLAN | KW_ESTIMATED_COST + : KW_CHANGELOG_MODE + | KW_JSON_EXECUTION_PLAN + | KW_ESTIMATED_COST ; useStatement - : KW_USE KW_CATALOG catalogPath + : KW_USE KW_CATALOG catalogPath | KW_USE databasePath | useModuleStatement ; @@ -60,8 +94,8 @@ useModuleStatement showStatememt : KW_SHOW (KW_CATALOGS | KW_DATABASES | KW_VIEWS | KW_JARS) | KW_SHOW KW_CURRENT (KW_CATALOG | KW_DATABASE) - | KW_SHOW KW_TABLES (( KW_FROM | KW_IN ) databasePath)? likePredicate? - | KW_SHOW KW_COLUMNS ( KW_FROM | KW_IN ) (viewPath| tablePath) likePredicate? + | KW_SHOW KW_TABLES (( KW_FROM | KW_IN) databasePath)? likePredicate? + | KW_SHOW KW_COLUMNS ( KW_FROM | KW_IN) (viewPath | tablePath) likePredicate? | KW_SHOW KW_CREATE (KW_TABLE tablePath | KW_VIEW viewPath) | KW_SHOW KW_USER? KW_FUNCTIONS | KW_SHOW KW_FULL? KW_MODULES @@ -70,7 +104,7 @@ showStatememt loadStatement : KW_LOAD KW_MODULE uid (KW_WITH tablePropertyList)? ; - + unloadStatememt : KW_UNLOAD KW_MODULE uid ; @@ -82,7 +116,7 @@ setStatememt resetStatememt : KW_RESET tablePropertyKey? ; - + jarStatememt : (KW_ADD | KW_REMOVE) KW_JAR jarFileName ; @@ -91,7 +125,13 @@ jarStatememt dtAddStatement : KW_ADD KW_JAR KW_WITH dtFilePath (KW_AS uid)? | KW_ADD KW_FILE KW_WITH dtFilePath (KW_AS uid)? (KW_RENAME uid)? - | KW_ADD (KW_PYTHON_FILES | KW_PYTHON_REQUIREMENTS | KW_PYTHON_DEPENDENCIES | KW_PYTHON_JAR | KW_PYTHON_ARCHIVES) KW_WITH dtFilePath KW_RENAME uid + | KW_ADD ( + KW_PYTHON_FILES + | KW_PYTHON_REQUIREMENTS + | KW_PYTHON_DEPENDENCIES + | KW_PYTHON_JAR + | KW_PYTHON_ARCHIVES + ) KW_WITH dtFilePath KW_RENAME uid | KW_ADD KW_PYTHON_PARAMETER dtFilePath | KW_ADD KW_ENGINE KW_FILE KW_WITH dtFilePath KW_RENAME uid KW_KEY uid | KW_ADD KW_CONFIG KW_FILE KW_WITH dtFilePath KW_FOR uid KW_AS uid @@ -106,19 +146,12 @@ dtFilePath createTable : (simpleCreateTable | createTableAsSelect) ; - + simpleCreateTable - : KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tablePathCreate - LR_BRACKET - columnOptionDefinition (COMMA columnOptionDefinition)* - (COMMA watermarkDefinition)? - (COMMA tableConstraint)? - (COMMA selfDefinitionClause)? - RR_BRACKET - commentSpec? - partitionDefinition? - withOption - likeDefinition? + : KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tablePathCreate LR_BRACKET columnOptionDefinition ( + COMMA columnOptionDefinition + )* (COMMA watermarkDefinition)? (COMMA tableConstraint)? (COMMA selfDefinitionClause)? RR_BRACKET commentSpec? partitionDefinition? withOption + likeDefinition? ; /* @@ -141,10 +174,12 @@ physicalColumnDefinition columnNameCreate : uid - | expression; + | expression + ; columnName - : uid | expression + : uid + | expression ; columnNameList @@ -153,9 +188,21 @@ columnNameList columnType : typeName=(KW_DATE | KW_BOOLEAN | KW_NULL) - | typeName=(KW_CHAR | KW_VARCHAR | KW_STRING | KW_BINARY | KW_VARBINARY | KW_BYTES - | KW_TINYINT | KW_SMALLINT |KW_INT | KW_INTEGER | KW_BIGINT - | KW_TIME | KW_TIMESTAMP_LTZ | KW_DATETIME + | typeName=( + KW_CHAR + | KW_VARCHAR + | KW_STRING + | KW_BINARY + | KW_VARBINARY + | KW_BYTES + | KW_TINYINT + | KW_SMALLINT + | KW_INT + | KW_INTEGER + | KW_BIGINT + | KW_TIME + | KW_TIMESTAMP_LTZ + | KW_DATETIME ) lengthOneDimension? | typeName=KW_TIMESTAMP lengthOneDimension? ((KW_WITHOUT | KW_WITH) KW_LOCAL? KW_TIME KW_ZONE)? | typeName=(KW_DECIMAL | KW_DEC | KW_NUMERIC | KW_FLOAT | KW_DOUBLE) lengthTwoOptionalDimension? @@ -190,7 +237,8 @@ rowTypeDimension ; columnConstraint - :(KW_CONSTRAINT constraintName)? KW_PRIMARY KW_KEY (KW_NOT KW_ENFORCED)? | KW_NOT? KW_NULL + : (KW_CONSTRAINT constraintName)? KW_PRIMARY KW_KEY (KW_NOT KW_ENFORCED)? + | KW_NOT? KW_NULL ; commentSpec @@ -239,9 +287,9 @@ transformList ; transform - : columnName #identityTransform - | qualifiedName #columnTransform - | LR_BRACKET transformArgument (COMMA transformArgument)* RR_BRACKET #applyTransform + : columnName # identityTransform + | qualifiedName # columnTransform + | LR_BRACKET transformArgument (COMMA transformArgument)* RR_BRACKET # applyTransform ; transformArgument @@ -271,11 +319,13 @@ createView ; createFunction - : KW_CREATE (KW_TEMPORARY|KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifNotExists? functionNameCreate KW_AS identifier (KW_LANGUAGE (KW_JAVA|KW_SCALA|KW_PYTHON))? usingClause? + : KW_CREATE (KW_TEMPORARY | KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifNotExists? functionNameCreate KW_AS identifier ( + KW_LANGUAGE (KW_JAVA | KW_SCALA | KW_PYTHON) + )? usingClause? ; usingClause - : KW_USING KW_JAR jarFileName (COMMA KW_JAR jarFileName)* + : KW_USING KW_JAR jarFileName (COMMA KW_JAR jarFileName)* ; jarFileName @@ -287,7 +337,13 @@ jarFileName // it only includes rename, set key, add constraint, drop constraint, add unique alterTable - : KW_ALTER KW_TABLE ifExists? tablePath (renameDefinition | setKeyValueDefinition | addConstraint | dropConstraint | addUnique) + : KW_ALTER KW_TABLE ifExists? tablePath ( + renameDefinition + | setKeyValueDefinition + | addConstraint + | dropConstraint + | addUnique + ) ; renameDefinition @@ -323,10 +379,11 @@ alterDatabase ; alterFunction - : KW_ALTER (KW_TEMPORARY|KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifExists? functionName KW_AS identifier (KW_LANGUAGE (KW_JAVA|KW_SCALA|KW_PYTHON))? // TODO + : KW_ALTER (KW_TEMPORARY | KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifExists? functionName KW_AS identifier ( + KW_LANGUAGE (KW_JAVA | KW_SCALA | KW_PYTHON) + )? // TODO ; - // Drop statements dropCatalog @@ -346,20 +403,19 @@ dropView ; dropFunction - : KW_DROP (KW_TEMPORARY|KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifExists? functionName + : KW_DROP (KW_TEMPORARY | KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifExists? functionName ; - // Insert statements insertStatement -: (KW_EXECUTE? insertSimpleStatement) - | insertMulStatementCompatibility | (KW_EXECUTE insertMulStatement) + : (KW_EXECUTE? insertSimpleStatement) + | insertMulStatementCompatibility + | (KW_EXECUTE insertMulStatement) ; insertSimpleStatement - : KW_INSERT (KW_INTO | KW_OVERWRITE) tablePath - ( + : KW_INSERT (KW_INTO | KW_OVERWRITE) tablePath ( insertPartitionDefinition? columnNameList? queryStatement | valuesDefinition ) @@ -374,13 +430,11 @@ valuesDefinition ; valuesRowDefinition - : LR_BRACKET - constant (COMMA constant)* - RR_BRACKET + : LR_BRACKET constant (COMMA constant)* RR_BRACKET ; insertMulStatementCompatibility - : KW_BEGIN KW_STATEMENT KW_SET SEMICOLON (insertSimpleStatement SEMICOLON)+ KW_END + : KW_BEGIN KW_STATEMENT KW_SET SEMICOLON (insertSimpleStatement SEMICOLON)+ KW_END ; insertMulStatement @@ -399,7 +453,7 @@ queryStatement ; valuesCaluse - : KW_VALUES expression (COMMA expression )* + : KW_VALUES expression (COMMA expression)* ; withClause @@ -420,12 +474,15 @@ selectStatement ; selectClause - : KW_SELECT setQuantifier? (ASTERISK_SIGN | projectItemDefinition (COMMA projectItemDefinition)*) + : KW_SELECT setQuantifier? ( + ASTERISK_SIGN + | projectItemDefinition (COMMA projectItemDefinition)* + ) ; projectItemDefinition : overWindowItem - | columnName (KW_AS? expression )? + | columnName (KW_AS? expression)? ; overWindowItem @@ -481,7 +538,7 @@ windoTVFName : KW_TUMBLE | KW_HOP | KW_CUMULATE -; + ; windowTVFParam : KW_TABLE timeAttrColumn @@ -563,25 +620,12 @@ namedWindow ; windowSpec - : name=errorCapturingIdentifier? - LR_BRACKET - partitionByClause? - orderByCaluse? - windowFrame? - RR_BRACKET + : name=errorCapturingIdentifier? LR_BRACKET partitionByClause? orderByCaluse? windowFrame? RR_BRACKET ; matchRecognizeClause - : KW_MATCH_RECOGNIZE - LR_BRACKET - partitionByClause? - orderByCaluse? - measuresClause? - outputMode? - afterMatchStrategy? - patternDefination? - patternVariablesDefination - RR_BRACKET ( KW_AS? identifier )? + : KW_MATCH_RECOGNIZE LR_BRACKET partitionByClause? orderByCaluse? measuresClause? outputMode? afterMatchStrategy? patternDefination? + patternVariablesDefination RR_BRACKET (KW_AS? identifier)? ; orderByCaluse @@ -605,7 +649,7 @@ quantifiers | (ADD_SIGN) | (QUESTION_MARK_SIGN) | (LB_BRACKET DIG_LITERAL COMMA DIG_LITERAL RB_BRACKET) - | (LB_BRACKET DIG_LITERAL COMMA RB_BRACKET) + | (LB_BRACKET DIG_LITERAL COMMA RB_BRACKET) | (LB_BRACKET COMMA DIG_LITERAL RB_BRACKET) ; @@ -614,11 +658,7 @@ measuresClause ; patternDefination - : KW_PATTERN - LR_BRACKET - patternVariable+ - RR_BRACKET - withinClause? + : KW_PATTERN LR_BRACKET patternVariable+ RR_BRACKET withinClause? ; patternVariable @@ -631,7 +671,7 @@ outputMode ; afterMatchStrategy - : KW_AFTER KW_MATCH KW_SKIP KW_PAST KW_LAST KW_ROW + : KW_AFTER KW_MATCH KW_SKIP KW_PAST KW_LAST KW_ROW | KW_AFTER KW_MATCH KW_SKIP KW_TO KW_NEXT KW_ROW | KW_AFTER KW_MATCH KW_SKIP KW_TO KW_LAST unquotedIdentifier | KW_AFTER KW_MATCH KW_SKIP KW_TO KW_FIRST unquotedIdentifier @@ -654,7 +694,6 @@ withinClause : KW_WITHIN timeIntervalExpression ; - // expression expression @@ -662,19 +701,16 @@ expression ; booleanExpression - : KW_NOT booleanExpression #logicalNot - | KW_EXISTS LR_BRACKET queryStatement RR_BRACKET #exists - | valueExpression predicate? #predicated - | left=booleanExpression operator=KW_AND right=booleanExpression #logicalBinary - | left=booleanExpression operator=KW_OR right=booleanExpression #logicalBinary - | booleanExpression KW_IS KW_NOT? kind=(KW_TRUE | KW_FALSE | KW_UNKNOWN | KW_NULL) #logicalNested + : KW_NOT booleanExpression # logicalNot + | KW_EXISTS LR_BRACKET queryStatement RR_BRACKET # exists + | valueExpression predicate? # predicated + | left=booleanExpression operator=KW_AND right=booleanExpression # logicalBinary + | left=booleanExpression operator=KW_OR right=booleanExpression # logicalBinary + | booleanExpression KW_IS KW_NOT? kind=(KW_TRUE | KW_FALSE | KW_UNKNOWN | KW_NULL) # logicalNested ; predicate - : KW_NOT? - kind=KW_BETWEEN (KW_ASYMMETRIC | KW_SYMMETRIC)? - lower=valueExpression KW_AND - upper=valueExpression + : KW_NOT? kind=KW_BETWEEN (KW_ASYMMETRIC | KW_SYMMETRIC)? lower=valueExpression KW_AND upper=valueExpression | KW_NOT? kind=KW_IN LR_BRACKET expression (COMMA expression)* RR_BRACKET | KW_NOT? kind=KW_IN LR_BRACKET queryStatement RR_BRACKET | kind=KW_EXISTS LR_BRACKET queryStatement RR_BRACKET @@ -686,42 +722,45 @@ predicate ; likePredicate - : KW_NOT? kind=KW_LIKE quantifier=(KW_ANY | KW_ALL) (LR_BRACKET RR_BRACKET | LR_BRACKET expression (COMMA expression)* RR_BRACKET) + : KW_NOT? kind=KW_LIKE quantifier=(KW_ANY | KW_ALL) ( + LR_BRACKET RR_BRACKET + | LR_BRACKET expression (COMMA expression)* RR_BRACKET + ) | KW_NOT? kind=KW_LIKE pattern=valueExpression (KW_ESCAPE stringLiteral)? ; valueExpression - : primaryExpression #valueExpressionDefault - | operator=(HYPNEN_SIGN | ADD_SIGN | BIT_NOT_OP) valueExpression #arithmeticUnary - | left=valueExpression operator=(ASTERISK_SIGN | SLASH_SIGN | PENCENT_SIGN | KW_DIV) right=valueExpression #arithmeticBinary - | left=valueExpression operator=(ADD_SIGN | HYPNEN_SIGN | DOUBLE_VERTICAL_SIGN) right=valueExpression #arithmeticBinary - | left=valueExpression operator=BIT_AND_OP right=valueExpression #arithmeticBinary - | left=valueExpression operator=BIT_XOR_OP right=valueExpression #arithmeticBinary - | left=valueExpression operator=BIT_OR_OP right=valueExpression #arithmeticBinary - | left=valueExpression comparisonOperator right=valueExpression #comparison + : primaryExpression # valueExpressionDefault + | operator=(HYPNEN_SIGN | ADD_SIGN | BIT_NOT_OP) valueExpression # arithmeticUnary + | left=valueExpression operator=(ASTERISK_SIGN | SLASH_SIGN | PENCENT_SIGN | KW_DIV) right=valueExpression # arithmeticBinary + | left=valueExpression operator=(ADD_SIGN | HYPNEN_SIGN | DOUBLE_VERTICAL_SIGN) right=valueExpression # arithmeticBinary + | left=valueExpression operator=BIT_AND_OP right=valueExpression # arithmeticBinary + | left=valueExpression operator=BIT_XOR_OP right=valueExpression # arithmeticBinary + | left=valueExpression operator=BIT_OR_OP right=valueExpression # arithmeticBinary + | left=valueExpression comparisonOperator right=valueExpression # comparison ; primaryExpression - : KW_CASE whenClause+ (KW_ELSE elseExpression=expression)? KW_END #searchedCase - | KW_CASE value=expression whenClause+ (KW_ELSE elseExpression=expression)? KW_END #simpleCase - | KW_CAST LR_BRACKET expression KW_AS columnType RR_BRACKET #cast + : KW_CASE whenClause+ (KW_ELSE elseExpression=expression)? KW_END # searchedCase + | KW_CASE value=expression whenClause+ (KW_ELSE elseExpression=expression)? KW_END # simpleCase + | KW_CAST LR_BRACKET expression KW_AS columnType RR_BRACKET # cast // | STRUCT LR_BRACKET (argument+=namedExpression (COMMA argument+=namedExpression)*)? RR_BRACKET #struct - | KW_FIRST LR_BRACKET expression (KW_IGNORE KW_NULLS)? RR_BRACKET #first - | KW_LAST LR_BRACKET expression (KW_IGNORE KW_NULLS)? RR_BRACKET #last - | KW_POSITION LR_BRACKET substr=valueExpression KW_IN str=valueExpression RR_BRACKET #position - | constant #constantDefault - | ASTERISK_SIGN #star - | uid DOT ASTERISK_SIGN #star + | KW_FIRST LR_BRACKET expression (KW_IGNORE KW_NULLS)? RR_BRACKET # first + | KW_LAST LR_BRACKET expression (KW_IGNORE KW_NULLS)? RR_BRACKET # last + | KW_POSITION LR_BRACKET substr=valueExpression KW_IN str=valueExpression RR_BRACKET # position + | constant # constantDefault + | ASTERISK_SIGN # star + | uid DOT ASTERISK_SIGN # star // | LR_BRACKET namedExpression (COMMA namedExpression)+ RR_BRACKET #rowConstructor - | LR_BRACKET queryStatement RR_BRACKET #subqueryExpression - | functionName LR_BRACKET (setQuantifier? functionParam (COMMA functionParam)*)? RR_BRACKET #functionCall + | LR_BRACKET queryStatement RR_BRACKET # subqueryExpression + | functionName LR_BRACKET (setQuantifier? functionParam (COMMA functionParam)*)? RR_BRACKET # functionCall // | identifier '->' expression #lambda // | '(' identifier (',' identifier)+ ')' '->' expression #lambda - | value=primaryExpression LS_BRACKET index=valueExpression RS_BRACKET #subscript - | identifier #columnReference - | dereferenceDefinition #dereference - | LR_BRACKET expression RR_BRACKET #parenthesizedExpression - | KW_CURRENT_TIMESTAMP #dateFunctionExpression + | value=primaryExpression LS_BRACKET index=valueExpression RS_BRACKET # subscript + | identifier # columnReference + | dereferenceDefinition # dereference + | LR_BRACKET expression RR_BRACKET # parenthesizedExpression + | KW_CURRENT_TIMESTAMP # dateFunctionExpression // | EXTRACT LR_BRACKET field=identifier KW_FROM source=valueExpression RR_BRACKET #extract // | (SUBSTR | SUBSTRING) LR_BRACKET str=valueExpression (KW_FROM | COMMA) pos=valueExpression // ((KW_FOR | COMMA) len=valueExpression)? RR_BRACKET #substring @@ -758,7 +797,8 @@ correlationName ; qualifiedName - : identifier | dereferenceDefinition + : identifier + | dereferenceDefinition ; timeIntervalExpression @@ -795,8 +835,8 @@ errorCapturingIdentifier ; errorCapturingIdentifierExtra - : (KW_MINUS identifier)+ #errorIdent - | #realIdent + : (KW_MINUS identifier)+ # errorIdent + | # realIdent ; identifierList @@ -808,13 +848,14 @@ identifierSeq ; identifier - : unquotedIdentifier #unquotedIdentifierAlternative - | quotedIdentifier #quotedIdentifierAlternative - | nonReservedKeywords #nonReservedKeywordsAlternative + : unquotedIdentifier # unquotedIdentifierAlternative + | quotedIdentifier # quotedIdentifierAlternative + | nonReservedKeywords # nonReservedKeywordsAlternative ; unquotedIdentifier - : DIG_LITERAL | ID_LITERAL + : DIG_LITERAL + | ID_LITERAL ; quotedIdentifier @@ -870,10 +911,12 @@ withOption ; ifNotExists - : KW_IF KW_NOT KW_EXISTS; + : KW_IF KW_NOT KW_EXISTS + ; ifExists - : KW_IF KW_EXISTS; + : KW_IF KW_EXISTS + ; tablePropertyList : LR_BRACKET tableProperty (COMMA tableProperty)* RR_BRACKET @@ -884,7 +927,8 @@ tableProperty ; tablePropertyKey - : identifier | dereferenceDefinition + : identifier + | dereferenceDefinition | STRING_LITERAL ; @@ -898,56 +942,56 @@ tablePropertyValue logicalOperator : KW_AND | BIT_AND_OP BIT_AND_OP - | KW_OR + | KW_OR | BIT_OR_OP BIT_OR_OP ; comparisonOperator - : EQUAL_SYMBOL - | GREATER_SYMBOL - | LESS_SYMBOL - | LESS_SYMBOL EQUAL_SYMBOL + : EQUAL_SYMBOL + | GREATER_SYMBOL + | LESS_SYMBOL + | LESS_SYMBOL EQUAL_SYMBOL | GREATER_SYMBOL EQUAL_SYMBOL - | LESS_SYMBOL GREATER_SYMBOL - | EXCLAMATION_SYMBOL EQUAL_SYMBOL + | LESS_SYMBOL GREATER_SYMBOL + | EXCLAMATION_SYMBOL EQUAL_SYMBOL | LESS_SYMBOL EQUAL_SYMBOL GREATER_SYMBOL ; bitOperator - : LESS_SYMBOL LESS_SYMBOL - | GREATER_SYMBOL GREATER_SYMBOL - | BIT_AND_OP - | BIT_XOR_OP + : LESS_SYMBOL LESS_SYMBOL + | GREATER_SYMBOL GREATER_SYMBOL + | BIT_AND_OP + | BIT_XOR_OP | BIT_OR_OP ; mathOperator - : ASTERISK_SIGN - | SLASH_SIGN - | PENCENT_SIGN - | KW_DIV - | ADD_SIGN - | HYPNEN_SIGN + : ASTERISK_SIGN + | SLASH_SIGN + | PENCENT_SIGN + | KW_DIV + | ADD_SIGN + | HYPNEN_SIGN | DOUBLE_HYPNEN_SIGN ; unaryOperator - : EXCLAMATION_SYMBOL - | BIT_NOT_OP - | ADD_SIGN - | HYPNEN_SIGN + : EXCLAMATION_SYMBOL + | BIT_NOT_OP + | ADD_SIGN + | HYPNEN_SIGN | KW_NOT ; constant : timeIntervalExpression | timePointLiteral - | stringLiteral // 引号包含的字符串 - | HYPNEN_SIGN? decimalLiteral // 正/负整数 - | booleanLiteral // 布尔值 - | REAL_LITERAL // 小数 + | stringLiteral // 引号包含的字符串 + | HYPNEN_SIGN? decimalLiteral // 正/负整数 + | booleanLiteral // 布尔值 + | REAL_LITERAL // 小数 | BIT_STRING - | KW_NOT? KW_NULL // 空 | 非空 + | KW_NOT? KW_NULL // 空 | 非空 ; timePointLiteral @@ -963,7 +1007,9 @@ decimalLiteral ; booleanLiteral - : KW_TRUE | KW_FALSE; + : KW_TRUE + | KW_FALSE + ; setQuantifier : KW_DISTINCT @@ -1159,5 +1205,5 @@ nonReservedKeywords | KW_VIEW | KW_WEEK | KW_YEARS - | KW_ZONE + | KW_ZONE ; \ No newline at end of file diff --git a/src/grammar/hive/HiveSqlLexer.g4 b/src/grammar/hive/HiveSqlLexer.g4 index 830aae0..3fad6f4 100644 --- a/src/grammar/hive/HiveSqlLexer.g4 +++ b/src/grammar/hive/HiveSqlLexer.g4 @@ -20,472 +20,462 @@ * Reference: https://github.com/antlr/grammars-v4/blob/master/sql/hive/v4/HiveLexer.g4 */ +// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing +// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true +// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true + lexer grammar HiveSqlLexer; // unsupported option caseInsensitive in antlr4@4.9 // options { caseInsensitive = true; } // Keywords -KW_ABORT : 'ABORT'; -KW_ACTIVATE : 'ACTIVATE'; -KW_ACTIVE : 'ACTIVE'; -KW_ADD : 'ADD'; -KW_ADMIN : 'ADMIN'; -KW_AFTER : 'AFTER'; -KW_ALL : 'ALL'; -KW_ALLOC_FRACTION : 'ALLOC_FRACTION'; -KW_ALTER : 'ALTER'; -KW_ANALYZE : 'ANALYZE'; -KW_AND : 'AND'; -KW_ANTI : 'ANTI'; -KW_ANY : 'ANY'; -KW_APPLICATION : 'APPLICATION'; -KW_ARCHIVE : 'ARCHIVE'; -KW_ARRAY : 'ARRAY'; -KW_AS : 'AS'; -KW_ASC : 'ASC'; -KW_AST : 'AST'; -KW_AT : 'AT'; -KW_AUTHORIZATION : 'AUTHORIZATION'; -KW_AUTOCOMMIT : 'AUTOCOMMIT'; -KW_BATCH : 'BATCH'; -KW_BEFORE : 'BEFORE'; -KW_BETWEEN : 'BETWEEN'; -KW_BIGINT : 'BIGINT'; -KW_BINARY : 'BINARY'; -KW_BOOLEAN : 'BOOLEAN'; -KW_BOTH : 'BOTH'; -KW_BUCKET : 'BUCKET'; -KW_BUCKETS : 'BUCKETS'; -KW_BY : 'BY'; -KW_CACHE : 'CACHE'; -KW_CASCADE : 'CASCADE'; -KW_CASE : 'CASE'; -KW_CAST : 'CAST'; -KW_CBO : 'CBO'; -KW_CHANGE : 'CHANGE'; -KW_CHAR : 'CHAR'; -KW_CHECK : 'CHECK'; -KW_CLUSTER : 'CLUSTER'; -KW_CLUSTERED : 'CLUSTERED'; -KW_CLUSTERSTATUS : 'CLUSTERSTATUS'; -KW_COLLECTION : 'COLLECTION'; -KW_COLUMN : 'COLUMN'; -KW_COLUMNS : 'COLUMNS'; -KW_COMMENT : 'COMMENT'; -KW_COMMIT : 'COMMIT'; -KW_COMPACT : 'COMPACT'; -KW_COMPACTIONS : 'COMPACTIONS'; -KW_COMPACT_ID : 'COMPACTIONID'; -KW_COMPUTE : 'COMPUTE'; -KW_CONCATENATE : 'CONCATENATE'; -KW_CONF : 'CONF'; -KW_CONSTRAINT : 'CONSTRAINT'; -KW_CONTINUE : 'CONTINUE'; -KW_COST : 'COST'; -KW_CREATE : 'CREATE'; -KW_CRON : 'CRON'; -KW_CROSS : 'CROSS'; -KW_CUBE : 'CUBE'; -KW_CURRENT : 'CURRENT'; -KW_CURRENT_DATE : 'CURRENT_DATE'; -KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; -KW_CURSOR : 'CURSOR'; -KW_DATA : 'DATA'; -KW_DATABASE : 'DATABASE'; -KW_DATABASES : 'DATABASES'; -KW_DATACONNECTOR : 'CONNECTOR'; -KW_DATACONNECTORS : 'CONNECTORS'; -KW_DATE : 'DATE'; -KW_DATETIME : 'DATETIME'; -KW_DAY : 'DAY'; -KW_DAYS : 'DAYS'; -KW_DAYOFWEEK : 'DAYOFWEEK'; -KW_DBPROPERTIES : 'DBPROPERTIES'; -KW_DCPROPERTIES : 'DCPROPERTIES'; -KW_DDL : 'DDL'; -KW_DEBUG : 'DEBUG'; -KW_DEC : 'DEC'; -KW_DECIMAL : 'DECIMAL'; -KW_NUMERIC : 'NUMERIC'; -KW_DEFAULT : 'DEFAULT'; -KW_DEFERRED : 'DEFERRED'; -KW_DEFINED : 'DEFINED'; -KW_DELETE : 'DELETE'; -KW_DELIMITED : 'DELIMITED'; -KW_DEPENDENCY : 'DEPENDENCY'; -KW_DESC : 'DESC'; -KW_DESCRIBE : 'DESCRIBE'; -KW_DETAIL : 'DETAIL'; -KW_DIRECTORIES : 'DIRECTORIES'; -KW_DIRECTORY : 'DIRECTORY'; -KW_DISABLE : 'DISABLE'; -KW_DISABLED : 'DISABLED'; -KW_DISTINCT : 'DISTINCT'; -KW_DISTRIBUTE : 'DISTRIBUTE'; -KW_DISTRIBUTED : 'DISTRIBUTED'; -KW_DO : 'DO'; -KW_DOUBLE : 'DOUBLE'; -KW_DROP : 'DROP'; -KW_RECOVER : 'RECOVER'; -KW_DUMP : 'DUMP'; -KW_ELEM_TYPE : '$ELEM$'; -KW_ELSE : 'ELSE'; -KW_ENABLE : 'ENABLE'; -KW_ENABLED : 'ENABLED'; -KW_END : 'END'; -KW_ENFORCED : 'ENFORCED'; -KW_ESCAPED : 'ESCAPED'; -KW_EVERY : 'EVERY'; -KW_EXCEPT : 'EXCEPT'; -KW_EXCHANGE : 'EXCHANGE'; -KW_EXCLUSIVE : 'EXCLUSIVE'; -KW_EXECUTE : 'EXECUTE'; -KW_EXECUTED : 'EXECUTED'; -KW_EXISTS : 'EXISTS'; -KW_EXPIRE_SNAPSHOTS : 'EXPIRE_SNAPSHOTS'; -KW_EXPLAIN : 'EXPLAIN'; -KW_EXPORT : 'EXPORT'; -KW_EXPRESSION : 'EXPRESSION'; -KW_EXTENDED : 'EXTENDED'; -KW_EXTERNAL : 'EXTERNAL'; -KW_EXTRACT : 'EXTRACT'; -KW_FALSE : 'FALSE'; -KW_FETCH : 'FETCH'; -KW_FIELDS : 'FIELDS'; -KW_FILE : 'FILE'; -KW_FILEFORMAT : 'FILEFORMAT'; -KW_FIRST : 'FIRST'; -KW_FLOAT : 'FLOAT'; -KW_FLOOR : 'FLOOR'; -KW_FOLLOWING : 'FOLLOWING'; -KW_FOR : 'FOR'; -KW_FORCE : 'FORCE'; -KW_FOREIGN : 'FOREIGN'; -KW_FORMAT : 'FORMAT'; -KW_FORMATTED : 'FORMATTED'; -KW_FROM : 'FROM'; -KW_FULL : 'FULL'; -KW_FUNCTION : 'FUNCTION'; -KW_FUNCTIONS : 'FUNCTIONS'; -KW_GRANT : 'GRANT'; -KW_GROUP : 'GROUP'; -KW_GROUPING : 'GROUPING'; -KW_HAVING : 'HAVING'; -KW_HOLD_DDLTIME : 'HOLD_DDLTIME'; -KW_HOUR : 'HOUR'; -KW_HOURS : 'HOURS'; -KW_IDXPROPERTIES : 'IDXPROPERTIES'; -KW_IF : 'IF'; -KW_IGNORE : 'IGNORE'; -KW_IMPORT : 'IMPORT'; -KW_IN : 'IN'; -KW_INDEX : 'INDEX'; -KW_INDEXES : 'INDEXES'; -KW_INNER : 'INNER'; -KW_INPATH : 'INPATH'; -KW_INPUTDRIVER : 'INPUTDRIVER'; -KW_INPUTFORMAT : 'INPUTFORMAT'; -KW_INSERT : 'INSERT'; -KW_INT : 'INT'; -KW_INTEGER : 'INTEGER'; -KW_INTERSECT : 'INTERSECT'; -KW_INTERVAL : 'INTERVAL'; -KW_INTO : 'INTO'; -KW_IS : 'IS'; -KW_ISOLATION : 'ISOLATION'; -KW_ITEMS : 'ITEMS'; -KW_JAR : 'JAR'; -KW_JOIN : 'JOIN'; -KW_JOINCOST : 'JOINCOST'; -KW_KEY : 'KEY'; -KW_KEYS : 'KEYS'; -KW_KEY_TYPE : '$KEY$'; -KW_KILL : 'KILL'; -KW_LAST : 'LAST'; -KW_LATERAL : 'LATERAL'; -KW_LEADING : 'LEADING'; -KW_LEFT : 'LEFT'; -KW_LESS : 'LESS'; -KW_LEVEL : 'LEVEL'; -KW_LIKE : 'LIKE'; -KW_LIMIT : 'LIMIT'; -KW_LINES : 'LINES'; -KW_LOAD : 'LOAD'; -KW_LOCAL : 'LOCAL'; -KW_LOCATION : 'LOCATION'; -KW_LOCK : 'LOCK'; -KW_LOCKS : 'LOCKS'; -KW_LOGICAL : 'LOGICAL'; -KW_LONG : 'LONG'; -KW_MACRO : 'MACRO'; -KW_MANAGED : 'MANAGED'; -KW_MANAGEDLOCATION : 'MANAGEDLOCATION'; -KW_MANAGEMENT : 'MANAGEMENT'; -KW_MAP : 'MAP'; -KW_MAPJOIN : 'MAPJOIN'; -KW_MAPPING : 'MAPPING'; -KW_MATCHED : 'MATCHED'; -KW_MATERIALIZED : 'MATERIALIZED'; -KW_MERGE : 'MERGE'; -KW_METADATA : 'METADATA'; -KW_MINUS : 'MINUS'; -KW_MINUTE : 'MINUTE'; -KW_MINUTES : 'MINUTES'; -KW_MONTH : 'MONTH'; -KW_MONTHS : 'MONTHS'; -KW_MORE : 'MORE'; -KW_MOVE : 'MOVE'; -KW_MSCK : 'MSCK'; -KW_NONE : 'NONE'; -KW_NORELY : 'NORELY'; -KW_NOSCAN : 'NOSCAN'; -KW_NOT : 'NOT'; -KW_NOVALIDATE : 'NOVALIDATE'; -KW_NO_DROP : 'NO_DROP'; -KW_NULL : 'NULL'; -KW_NULLS : 'NULLS'; -KW_OF : 'OF'; -KW_OFFLINE : 'OFFLINE'; -KW_OFFSET : 'OFFSET'; -KW_ON : 'ON'; -KW_ONLY : 'ONLY'; -KW_OPERATOR : 'OPERATOR'; -KW_OPTION : 'OPTION'; -KW_OR : 'OR'; -KW_ORDER : 'ORDER'; -KW_OUT : 'OUT'; -KW_OUTER : 'OUTER'; -KW_OUTPUTDRIVER : 'OUTPUTDRIVER'; -KW_OUTPUTFORMAT : 'OUTPUTFORMAT'; -KW_OVER : 'OVER'; -KW_OVERWRITE : 'OVERWRITE'; -KW_OWNER : 'OWNER'; -KW_PARTITION : 'PARTITION'; -KW_PARTITIONED : 'PARTITIONED'; -KW_PARTITIONS : 'PARTITIONS'; -KW_PATH : 'PATH'; -KW_PERCENT : 'PERCENT'; -KW_PKFK_JOIN : 'PKFK_JOIN'; -KW_PLAN : 'PLAN'; -KW_PLANS : 'PLANS'; -KW_PLUS : 'PLUS'; -KW_POOL : 'POOL'; -KW_PRECEDING : 'PRECEDING'; -KW_PRECISION : 'PRECISION'; -KW_PREPARE : 'PREPARE'; -KW_PRESERVE : 'PRESERVE'; -KW_PRIMARY : 'PRIMARY'; -KW_PRINCIPALS : 'PRINCIPALS'; -KW_PROCEDURE : 'PROCEDURE'; -KW_PROTECTION : 'PROTECTION'; -KW_PURGE : 'PURGE'; -KW_QUALIFY : 'QUALIFY'; -KW_QUARTER : 'QUARTER'; -KW_QUERY : 'QUERY'; -KW_QUERY_PARALLELISM : 'QUERY_PARALLELISM'; -KW_RANGE : 'RANGE'; -KW_READ : 'READ'; -KW_READONLY : 'READONLY'; -KW_READS : 'READS'; -KW_REAL : 'REAL'; -KW_REBUILD : 'REBUILD'; -KW_RECORDREADER : 'RECORDREADER'; -KW_RECORDWRITER : 'RECORDWRITER'; -KW_REDUCE : 'REDUCE'; -KW_REFERENCES : 'REFERENCES'; -KW_REGEXP : 'REGEXP'; -KW_RELOAD : 'RELOAD'; -KW_RELY : 'RELY'; -KW_REMOTE : 'REMOTE'; -KW_RENAME : 'RENAME'; -KW_REOPTIMIZATION : 'REOPTIMIZATION'; -KW_REPAIR : 'REPAIR'; -KW_REPL : 'REPL'; -KW_REPLACE : 'REPLACE'; -KW_REPLICATION : 'REPLICATION'; -KW_RESOURCE : 'RESOURCE'; -KW_RESPECT : 'RESPECT'; -KW_RESTRICT : 'RESTRICT'; -KW_REVOKE : 'REVOKE'; -KW_REWRITE : 'REWRITE'; -KW_RIGHT : 'RIGHT'; -KW_RLIKE : 'RLIKE'; -KW_ROLE : 'ROLE'; -KW_ROLES : 'ROLES'; -KW_ROLLBACK : 'ROLLBACK'; -KW_ROLLUP : 'ROLLUP'; -KW_ROW : 'ROW'; -KW_ROWS : 'ROWS'; -KW_SCHEDULED : 'SCHEDULED'; -KW_SCHEDULING_POLICY : 'SCHEDULING_POLICY'; -KW_SCHEMA : 'SCHEMA'; -KW_SCHEMAS : 'SCHEMAS'; -KW_SECOND : 'SECOND'; -KW_SECONDS : 'SECONDS'; -KW_SELECT : 'SELECT'; -KW_SEMI : 'SEMI'; -KW_SERDE : 'SERDE'; -KW_SERDEPROPERTIES : 'SERDEPROPERTIES'; -KW_SERVER : 'SERVER'; -KW_SET : 'SET'; -KW_SETS : 'SETS'; -KW_SET_CURRENT_SNAPSHOT : 'SET_CURRENT_SNAPSHOT'; -KW_SHARED : 'SHARED'; -KW_SHOW : 'SHOW'; -KW_SHOW_DATABASE : 'SHOW_DATABASE'; -KW_SKEWED : 'SKEWED'; -KW_SMALLINT : 'SMALLINT'; -KW_SNAPSHOT : 'SNAPSHOT'; -KW_SOME : 'SOME'; -KW_SORT : 'SORT'; -KW_SORTED : 'SORTED'; -KW_SPEC : 'SPEC'; -KW_SSL : 'SSL'; -KW_START : 'START'; -KW_STATISTICS : 'STATISTICS'; -KW_STATUS : 'STATUS'; -KW_STORED : 'STORED'; -KW_STREAMTABLE : 'STREAMTABLE'; -KW_STRING : 'STRING'; -KW_STRUCT : 'STRUCT'; -KW_SUMMARY : 'SUMMARY'; -KW_SYNC : 'SYNC'; -KW_SYSTEM_TIME : 'SYSTEM_TIME'; -KW_SYSTEM_VERSION : 'SYSTEM_VERSION'; -KW_TABLE : 'TABLE'; -KW_TABLES : 'TABLES'; -KW_TABLESAMPLE : 'TABLESAMPLE'; -KW_TBLPROPERTIES : 'TBLPROPERTIES'; -KW_TEMPORARY : 'TEMPORARY'; -KW_TERMINATED : 'TERMINATED'; -KW_THEN : 'THEN'; -KW_TIME : 'TIME'; -KW_TIMESTAMP : 'TIMESTAMP'; -KW_TIMESTAMPLOCALTZ : 'TIMESTAMPLOCALTZ'; -KW_TIMESTAMPTZ : 'TIMESTAMPTZ'; -KW_TINYINT : 'TINYINT'; -KW_TO : 'TO'; -KW_TOUCH : 'TOUCH'; -KW_TRAILING : 'TRAILING'; -KW_TRANSACTION : 'TRANSACTION'; -KW_TRANSACTIONAL : 'TRANSACTIONAL'; -KW_TRANSACTIONS : 'TRANSACTIONS'; -KW_TRANSFORM : 'TRANSFORM'; -KW_TRIGGER : 'TRIGGER'; -KW_TRIM : 'TRIM'; -KW_TRUE : 'TRUE'; -KW_TRUNCATE : 'TRUNCATE'; -KW_TYPE : 'TYPE'; -KW_UNARCHIVE : 'UNARCHIVE'; -KW_UNBOUNDED : 'UNBOUNDED'; -KW_UNDO : 'UNDO'; -KW_UNION : 'UNION'; -KW_UNIONTYPE : 'UNIONTYPE'; -KW_UNIQUE : 'UNIQUE'; -KW_UNIQUEJOIN : 'UNIQUEJOIN'; -KW_UNKNOWN : 'UNKNOWN'; -KW_UNLOCK : 'UNLOCK'; -KW_UNMANAGED : 'UNMANAGED'; -KW_UNSET : 'UNSET'; -KW_UNSIGNED : 'UNSIGNED'; -KW_UPDATE : 'UPDATE'; -KW_URI : 'URI'; -KW_URL : 'URL'; -KW_USE : 'USE'; -KW_USER : 'USER'; -KW_USING : 'USING'; -KW_UTC : 'UTC'; -KW_UTCTIMESTAMP : 'UTC_TMESTAMP'; -KW_VALIDATE : 'VALIDATE'; -KW_VALUES : 'VALUES'; -KW_VALUE_TYPE : '$VALUE$'; -KW_VARCHAR : 'VARCHAR'; -KW_VECTORIZATION : 'VECTORIZATION'; -KW_VIEW : 'VIEW'; -KW_VIEWS : 'VIEWS'; -KW_WAIT : 'WAIT'; -KW_WEEK : 'WEEK'; -KW_WEEKS : 'WEEKS'; -KW_WHEN : 'WHEN'; -KW_WHERE : 'WHERE'; -KW_WHILE : 'WHILE'; -KW_WINDOW : 'WINDOW'; -KW_WITH : 'WITH'; -KW_WITHIN : 'WITHIN'; -KW_WORK : 'WORK'; -KW_WORKLOAD : 'WORKLOAD'; -KW_WRITE : 'WRITE'; -KW_YEAR : 'YEAR'; -KW_YEARS : 'YEARS'; -KW_ZONE : 'ZONE'; +KW_ABORT : 'ABORT'; +KW_ACTIVATE : 'ACTIVATE'; +KW_ACTIVE : 'ACTIVE'; +KW_ADD : 'ADD'; +KW_ADMIN : 'ADMIN'; +KW_AFTER : 'AFTER'; +KW_ALL : 'ALL'; +KW_ALLOC_FRACTION : 'ALLOC_FRACTION'; +KW_ALTER : 'ALTER'; +KW_ANALYZE : 'ANALYZE'; +KW_AND : 'AND'; +KW_ANTI : 'ANTI'; +KW_ANY : 'ANY'; +KW_APPLICATION : 'APPLICATION'; +KW_ARCHIVE : 'ARCHIVE'; +KW_ARRAY : 'ARRAY'; +KW_AS : 'AS'; +KW_ASC : 'ASC'; +KW_AST : 'AST'; +KW_AT : 'AT'; +KW_AUTHORIZATION : 'AUTHORIZATION'; +KW_AUTOCOMMIT : 'AUTOCOMMIT'; +KW_BATCH : 'BATCH'; +KW_BEFORE : 'BEFORE'; +KW_BETWEEN : 'BETWEEN'; +KW_BIGINT : 'BIGINT'; +KW_BINARY : 'BINARY'; +KW_BOOLEAN : 'BOOLEAN'; +KW_BOTH : 'BOTH'; +KW_BUCKET : 'BUCKET'; +KW_BUCKETS : 'BUCKETS'; +KW_BY : 'BY'; +KW_CACHE : 'CACHE'; +KW_CASCADE : 'CASCADE'; +KW_CASE : 'CASE'; +KW_CAST : 'CAST'; +KW_CBO : 'CBO'; +KW_CHANGE : 'CHANGE'; +KW_CHAR : 'CHAR'; +KW_CHECK : 'CHECK'; +KW_CLUSTER : 'CLUSTER'; +KW_CLUSTERED : 'CLUSTERED'; +KW_CLUSTERSTATUS : 'CLUSTERSTATUS'; +KW_COLLECTION : 'COLLECTION'; +KW_COLUMN : 'COLUMN'; +KW_COLUMNS : 'COLUMNS'; +KW_COMMENT : 'COMMENT'; +KW_COMMIT : 'COMMIT'; +KW_COMPACT : 'COMPACT'; +KW_COMPACTIONS : 'COMPACTIONS'; +KW_COMPACT_ID : 'COMPACTIONID'; +KW_COMPUTE : 'COMPUTE'; +KW_CONCATENATE : 'CONCATENATE'; +KW_CONF : 'CONF'; +KW_CONSTRAINT : 'CONSTRAINT'; +KW_CONTINUE : 'CONTINUE'; +KW_COST : 'COST'; +KW_CREATE : 'CREATE'; +KW_CRON : 'CRON'; +KW_CROSS : 'CROSS'; +KW_CUBE : 'CUBE'; +KW_CURRENT : 'CURRENT'; +KW_CURRENT_DATE : 'CURRENT_DATE'; +KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; +KW_CURSOR : 'CURSOR'; +KW_DATA : 'DATA'; +KW_DATABASE : 'DATABASE'; +KW_DATABASES : 'DATABASES'; +KW_DATACONNECTOR : 'CONNECTOR'; +KW_DATACONNECTORS : 'CONNECTORS'; +KW_DATE : 'DATE'; +KW_DATETIME : 'DATETIME'; +KW_DAY : 'DAY'; +KW_DAYS : 'DAYS'; +KW_DAYOFWEEK : 'DAYOFWEEK'; +KW_DBPROPERTIES : 'DBPROPERTIES'; +KW_DCPROPERTIES : 'DCPROPERTIES'; +KW_DDL : 'DDL'; +KW_DEBUG : 'DEBUG'; +KW_DEC : 'DEC'; +KW_DECIMAL : 'DECIMAL'; +KW_NUMERIC : 'NUMERIC'; +KW_DEFAULT : 'DEFAULT'; +KW_DEFERRED : 'DEFERRED'; +KW_DEFINED : 'DEFINED'; +KW_DELETE : 'DELETE'; +KW_DELIMITED : 'DELIMITED'; +KW_DEPENDENCY : 'DEPENDENCY'; +KW_DESC : 'DESC'; +KW_DESCRIBE : 'DESCRIBE'; +KW_DETAIL : 'DETAIL'; +KW_DIRECTORIES : 'DIRECTORIES'; +KW_DIRECTORY : 'DIRECTORY'; +KW_DISABLE : 'DISABLE'; +KW_DISABLED : 'DISABLED'; +KW_DISTINCT : 'DISTINCT'; +KW_DISTRIBUTE : 'DISTRIBUTE'; +KW_DISTRIBUTED : 'DISTRIBUTED'; +KW_DO : 'DO'; +KW_DOUBLE : 'DOUBLE'; +KW_DROP : 'DROP'; +KW_RECOVER : 'RECOVER'; +KW_DUMP : 'DUMP'; +KW_ELEM_TYPE : '$ELEM$'; +KW_ELSE : 'ELSE'; +KW_ENABLE : 'ENABLE'; +KW_ENABLED : 'ENABLED'; +KW_END : 'END'; +KW_ENFORCED : 'ENFORCED'; +KW_ESCAPED : 'ESCAPED'; +KW_EVERY : 'EVERY'; +KW_EXCEPT : 'EXCEPT'; +KW_EXCHANGE : 'EXCHANGE'; +KW_EXCLUSIVE : 'EXCLUSIVE'; +KW_EXECUTE : 'EXECUTE'; +KW_EXECUTED : 'EXECUTED'; +KW_EXISTS : 'EXISTS'; +KW_EXPIRE_SNAPSHOTS : 'EXPIRE_SNAPSHOTS'; +KW_EXPLAIN : 'EXPLAIN'; +KW_EXPORT : 'EXPORT'; +KW_EXPRESSION : 'EXPRESSION'; +KW_EXTENDED : 'EXTENDED'; +KW_EXTERNAL : 'EXTERNAL'; +KW_EXTRACT : 'EXTRACT'; +KW_FALSE : 'FALSE'; +KW_FETCH : 'FETCH'; +KW_FIELDS : 'FIELDS'; +KW_FILE : 'FILE'; +KW_FILEFORMAT : 'FILEFORMAT'; +KW_FIRST : 'FIRST'; +KW_FLOAT : 'FLOAT'; +KW_FLOOR : 'FLOOR'; +KW_FOLLOWING : 'FOLLOWING'; +KW_FOR : 'FOR'; +KW_FORCE : 'FORCE'; +KW_FOREIGN : 'FOREIGN'; +KW_FORMAT : 'FORMAT'; +KW_FORMATTED : 'FORMATTED'; +KW_FROM : 'FROM'; +KW_FULL : 'FULL'; +KW_FUNCTION : 'FUNCTION'; +KW_FUNCTIONS : 'FUNCTIONS'; +KW_GRANT : 'GRANT'; +KW_GROUP : 'GROUP'; +KW_GROUPING : 'GROUPING'; +KW_HAVING : 'HAVING'; +KW_HOLD_DDLTIME : 'HOLD_DDLTIME'; +KW_HOUR : 'HOUR'; +KW_HOURS : 'HOURS'; +KW_IDXPROPERTIES : 'IDXPROPERTIES'; +KW_IF : 'IF'; +KW_IGNORE : 'IGNORE'; +KW_IMPORT : 'IMPORT'; +KW_IN : 'IN'; +KW_INDEX : 'INDEX'; +KW_INDEXES : 'INDEXES'; +KW_INNER : 'INNER'; +KW_INPATH : 'INPATH'; +KW_INPUTDRIVER : 'INPUTDRIVER'; +KW_INPUTFORMAT : 'INPUTFORMAT'; +KW_INSERT : 'INSERT'; +KW_INT : 'INT'; +KW_INTEGER : 'INTEGER'; +KW_INTERSECT : 'INTERSECT'; +KW_INTERVAL : 'INTERVAL'; +KW_INTO : 'INTO'; +KW_IS : 'IS'; +KW_ISOLATION : 'ISOLATION'; +KW_ITEMS : 'ITEMS'; +KW_JAR : 'JAR'; +KW_JOIN : 'JOIN'; +KW_JOINCOST : 'JOINCOST'; +KW_KEY : 'KEY'; +KW_KEYS : 'KEYS'; +KW_KEY_TYPE : '$KEY$'; +KW_KILL : 'KILL'; +KW_LAST : 'LAST'; +KW_LATERAL : 'LATERAL'; +KW_LEADING : 'LEADING'; +KW_LEFT : 'LEFT'; +KW_LESS : 'LESS'; +KW_LEVEL : 'LEVEL'; +KW_LIKE : 'LIKE'; +KW_LIMIT : 'LIMIT'; +KW_LINES : 'LINES'; +KW_LOAD : 'LOAD'; +KW_LOCAL : 'LOCAL'; +KW_LOCATION : 'LOCATION'; +KW_LOCK : 'LOCK'; +KW_LOCKS : 'LOCKS'; +KW_LOGICAL : 'LOGICAL'; +KW_LONG : 'LONG'; +KW_MACRO : 'MACRO'; +KW_MANAGED : 'MANAGED'; +KW_MANAGEDLOCATION : 'MANAGEDLOCATION'; +KW_MANAGEMENT : 'MANAGEMENT'; +KW_MAP : 'MAP'; +KW_MAPJOIN : 'MAPJOIN'; +KW_MAPPING : 'MAPPING'; +KW_MATCHED : 'MATCHED'; +KW_MATERIALIZED : 'MATERIALIZED'; +KW_MERGE : 'MERGE'; +KW_METADATA : 'METADATA'; +KW_MINUS : 'MINUS'; +KW_MINUTE : 'MINUTE'; +KW_MINUTES : 'MINUTES'; +KW_MONTH : 'MONTH'; +KW_MONTHS : 'MONTHS'; +KW_MORE : 'MORE'; +KW_MOVE : 'MOVE'; +KW_MSCK : 'MSCK'; +KW_NONE : 'NONE'; +KW_NORELY : 'NORELY'; +KW_NOSCAN : 'NOSCAN'; +KW_NOT : 'NOT'; +KW_NOVALIDATE : 'NOVALIDATE'; +KW_NO_DROP : 'NO_DROP'; +KW_NULL : 'NULL'; +KW_NULLS : 'NULLS'; +KW_OF : 'OF'; +KW_OFFLINE : 'OFFLINE'; +KW_OFFSET : 'OFFSET'; +KW_ON : 'ON'; +KW_ONLY : 'ONLY'; +KW_OPERATOR : 'OPERATOR'; +KW_OPTION : 'OPTION'; +KW_OR : 'OR'; +KW_ORDER : 'ORDER'; +KW_OUT : 'OUT'; +KW_OUTER : 'OUTER'; +KW_OUTPUTDRIVER : 'OUTPUTDRIVER'; +KW_OUTPUTFORMAT : 'OUTPUTFORMAT'; +KW_OVER : 'OVER'; +KW_OVERWRITE : 'OVERWRITE'; +KW_OWNER : 'OWNER'; +KW_PARTITION : 'PARTITION'; +KW_PARTITIONED : 'PARTITIONED'; +KW_PARTITIONS : 'PARTITIONS'; +KW_PATH : 'PATH'; +KW_PERCENT : 'PERCENT'; +KW_PKFK_JOIN : 'PKFK_JOIN'; +KW_PLAN : 'PLAN'; +KW_PLANS : 'PLANS'; +KW_PLUS : 'PLUS'; +KW_POOL : 'POOL'; +KW_PRECEDING : 'PRECEDING'; +KW_PRECISION : 'PRECISION'; +KW_PREPARE : 'PREPARE'; +KW_PRESERVE : 'PRESERVE'; +KW_PRIMARY : 'PRIMARY'; +KW_PRINCIPALS : 'PRINCIPALS'; +KW_PROCEDURE : 'PROCEDURE'; +KW_PROTECTION : 'PROTECTION'; +KW_PURGE : 'PURGE'; +KW_QUALIFY : 'QUALIFY'; +KW_QUARTER : 'QUARTER'; +KW_QUERY : 'QUERY'; +KW_QUERY_PARALLELISM : 'QUERY_PARALLELISM'; +KW_RANGE : 'RANGE'; +KW_READ : 'READ'; +KW_READONLY : 'READONLY'; +KW_READS : 'READS'; +KW_REAL : 'REAL'; +KW_REBUILD : 'REBUILD'; +KW_RECORDREADER : 'RECORDREADER'; +KW_RECORDWRITER : 'RECORDWRITER'; +KW_REDUCE : 'REDUCE'; +KW_REFERENCES : 'REFERENCES'; +KW_REGEXP : 'REGEXP'; +KW_RELOAD : 'RELOAD'; +KW_RELY : 'RELY'; +KW_REMOTE : 'REMOTE'; +KW_RENAME : 'RENAME'; +KW_REOPTIMIZATION : 'REOPTIMIZATION'; +KW_REPAIR : 'REPAIR'; +KW_REPL : 'REPL'; +KW_REPLACE : 'REPLACE'; +KW_REPLICATION : 'REPLICATION'; +KW_RESOURCE : 'RESOURCE'; +KW_RESPECT : 'RESPECT'; +KW_RESTRICT : 'RESTRICT'; +KW_REVOKE : 'REVOKE'; +KW_REWRITE : 'REWRITE'; +KW_RIGHT : 'RIGHT'; +KW_RLIKE : 'RLIKE'; +KW_ROLE : 'ROLE'; +KW_ROLES : 'ROLES'; +KW_ROLLBACK : 'ROLLBACK'; +KW_ROLLUP : 'ROLLUP'; +KW_ROW : 'ROW'; +KW_ROWS : 'ROWS'; +KW_SCHEDULED : 'SCHEDULED'; +KW_SCHEDULING_POLICY : 'SCHEDULING_POLICY'; +KW_SCHEMA : 'SCHEMA'; +KW_SCHEMAS : 'SCHEMAS'; +KW_SECOND : 'SECOND'; +KW_SECONDS : 'SECONDS'; +KW_SELECT : 'SELECT'; +KW_SEMI : 'SEMI'; +KW_SERDE : 'SERDE'; +KW_SERDEPROPERTIES : 'SERDEPROPERTIES'; +KW_SERVER : 'SERVER'; +KW_SET : 'SET'; +KW_SETS : 'SETS'; +KW_SET_CURRENT_SNAPSHOT : 'SET_CURRENT_SNAPSHOT'; +KW_SHARED : 'SHARED'; +KW_SHOW : 'SHOW'; +KW_SHOW_DATABASE : 'SHOW_DATABASE'; +KW_SKEWED : 'SKEWED'; +KW_SMALLINT : 'SMALLINT'; +KW_SNAPSHOT : 'SNAPSHOT'; +KW_SOME : 'SOME'; +KW_SORT : 'SORT'; +KW_SORTED : 'SORTED'; +KW_SPEC : 'SPEC'; +KW_SSL : 'SSL'; +KW_START : 'START'; +KW_STATISTICS : 'STATISTICS'; +KW_STATUS : 'STATUS'; +KW_STORED : 'STORED'; +KW_STREAMTABLE : 'STREAMTABLE'; +KW_STRING : 'STRING'; +KW_STRUCT : 'STRUCT'; +KW_SUMMARY : 'SUMMARY'; +KW_SYNC : 'SYNC'; +KW_SYSTEM_TIME : 'SYSTEM_TIME'; +KW_SYSTEM_VERSION : 'SYSTEM_VERSION'; +KW_TABLE : 'TABLE'; +KW_TABLES : 'TABLES'; +KW_TABLESAMPLE : 'TABLESAMPLE'; +KW_TBLPROPERTIES : 'TBLPROPERTIES'; +KW_TEMPORARY : 'TEMPORARY'; +KW_TERMINATED : 'TERMINATED'; +KW_THEN : 'THEN'; +KW_TIME : 'TIME'; +KW_TIMESTAMP : 'TIMESTAMP'; +KW_TIMESTAMPLOCALTZ : 'TIMESTAMPLOCALTZ'; +KW_TIMESTAMPTZ : 'TIMESTAMPTZ'; +KW_TINYINT : 'TINYINT'; +KW_TO : 'TO'; +KW_TOUCH : 'TOUCH'; +KW_TRAILING : 'TRAILING'; +KW_TRANSACTION : 'TRANSACTION'; +KW_TRANSACTIONAL : 'TRANSACTIONAL'; +KW_TRANSACTIONS : 'TRANSACTIONS'; +KW_TRANSFORM : 'TRANSFORM'; +KW_TRIGGER : 'TRIGGER'; +KW_TRIM : 'TRIM'; +KW_TRUE : 'TRUE'; +KW_TRUNCATE : 'TRUNCATE'; +KW_TYPE : 'TYPE'; +KW_UNARCHIVE : 'UNARCHIVE'; +KW_UNBOUNDED : 'UNBOUNDED'; +KW_UNDO : 'UNDO'; +KW_UNION : 'UNION'; +KW_UNIONTYPE : 'UNIONTYPE'; +KW_UNIQUE : 'UNIQUE'; +KW_UNIQUEJOIN : 'UNIQUEJOIN'; +KW_UNKNOWN : 'UNKNOWN'; +KW_UNLOCK : 'UNLOCK'; +KW_UNMANAGED : 'UNMANAGED'; +KW_UNSET : 'UNSET'; +KW_UNSIGNED : 'UNSIGNED'; +KW_UPDATE : 'UPDATE'; +KW_URI : 'URI'; +KW_URL : 'URL'; +KW_USE : 'USE'; +KW_USER : 'USER'; +KW_USING : 'USING'; +KW_UTC : 'UTC'; +KW_UTCTIMESTAMP : 'UTC_TMESTAMP'; +KW_VALIDATE : 'VALIDATE'; +KW_VALUES : 'VALUES'; +KW_VALUE_TYPE : '$VALUE$'; +KW_VARCHAR : 'VARCHAR'; +KW_VECTORIZATION : 'VECTORIZATION'; +KW_VIEW : 'VIEW'; +KW_VIEWS : 'VIEWS'; +KW_WAIT : 'WAIT'; +KW_WEEK : 'WEEK'; +KW_WEEKS : 'WEEKS'; +KW_WHEN : 'WHEN'; +KW_WHERE : 'WHERE'; +KW_WHILE : 'WHILE'; +KW_WINDOW : 'WINDOW'; +KW_WITH : 'WITH'; +KW_WITHIN : 'WITHIN'; +KW_WORK : 'WORK'; +KW_WORKLOAD : 'WORKLOAD'; +KW_WRITE : 'WRITE'; +KW_YEAR : 'YEAR'; +KW_YEARS : 'YEARS'; +KW_ZONE : 'ZONE'; // Operators // NOTE: if you add a new function/operator, add it to sysFuncNames so that describe function _FUNC_ will work. -DOT : '.'; // generated as a part of Number rule -COLON : ':' ; -COMMA : ',' ; -SEMICOLON : ';' ; +DOT : '.'; // generated as a part of Number rule +COLON : ':'; +COMMA : ','; +SEMICOLON : ';'; -LPAREN : '(' ; -RPAREN : ')' ; -LSQUARE : '[' ; -RSQUARE : ']' ; -LCURLY : '{'; -RCURLY : '}'; +LPAREN : '('; +RPAREN : ')'; +LSQUARE : '['; +RSQUARE : ']'; +LCURLY : '{'; +RCURLY : '}'; -EQUAL : '=' | '=='; -EQUAL_NS : '<=>'; -NOTEQUAL : '<>' | '!='; -LESSTHANOREQUALTO : '<='; -LESSTHAN : '<'; +EQUAL : '=' | '=='; +EQUAL_NS : '<=>'; +NOTEQUAL : '<>' | '!='; +LESSTHANOREQUALTO : '<='; +LESSTHAN : '<'; GREATERTHANOREQUALTO : '>='; -GREATERTHAN : '>'; +GREATERTHAN : '>'; DIVIDE : '/'; -PLUS : '+'; -MINUS : '-'; -STAR : '*'; -MOD : '%'; -DIV : 'DIV'; +PLUS : '+'; +MINUS : '-'; +STAR : '*'; +MOD : '%'; +DIV : 'DIV'; -BITWISENOT: '!'; -AMPERSAND : '&'; -TILDE : '~'; -BITWISEOR : '|'; +BITWISENOT : '!'; +AMPERSAND : '&'; +TILDE : '~'; +BITWISEOR : '|'; CONCATENATE : '||'; -BITWISEXOR : '^'; -QUESTION : '?'; -DOLLAR : '$'; +BITWISEXOR : '^'; +QUESTION : '?'; +DOLLAR : '$'; // LITERALS -StringLiteral - : ( '\'' ( ~('\''|'\\') | ('\\' .) )* '\'' - | '"' ( ~('"'|'\\') | ('\\' .) )* '"' - )+ - ; +StringLiteral: ( '\'' ( ~('\'' | '\\') | ('\\' .))* '\'' | '"' ( ~('"' | '\\') | ('\\' .))* '"')+; -CharSetLiteral - : StringLiteral - | '0' 'X' (HexDigit | Digit)+ - ; +CharSetLiteral: StringLiteral | '0' 'X' (HexDigit | Digit)+; -IntegralLiteral - : Digit+ ('L' | 'S' | 'Y') - ; +IntegralLiteral: Digit+ ('L' | 'S' | 'Y'); -NumberLiteral - : Number ('B'? 'D') - ; +NumberLiteral: Number ('B'? 'D'); -ByteLengthLiteral - : Digit+ [BKMG] - ; +ByteLengthLiteral: Digit+ [BKMG]; -Number - : Digit+ (DOT Digit* Exponent? | Exponent)? - ; +Number: Digit+ (DOT Digit* Exponent? | Exponent)?; /* An Identifier can be: @@ -508,67 +498,46 @@ An Identifier can be: - hint name - window name */ -Identifier - : (Letter | Digit) (Letter | Digit | '_')* - | QuotedIdentifier - | '`' RegexComponent+ '`' - ; +Identifier: (Letter | Digit) (Letter | Digit | '_')* | QuotedIdentifier | '`' RegexComponent+ '`'; -fragment -QuotedIdentifier - : '`' ('``' | ~'`')* '`' - ; +fragment QuotedIdentifier: '`' ('``' | ~'`')* '`'; -fragment -Letter - : 'A'..'Z' - | 'a'..'z' - ; +fragment Letter: 'A' ..'Z' | 'a' ..'z'; -fragment -HexDigit - : 'A'..'F' - ; +fragment HexDigit: 'A' ..'F'; -fragment -Digit - : '0'..'9' - ; +fragment Digit: '0' ..'9'; -fragment -Exponent - : ('E') ( PLUS|MINUS )? (Digit)+ - ; +fragment Exponent: ('E') ( PLUS | MINUS)? (Digit)+; -fragment -RegexComponent - : 'A'..'Z' | '0'..'9' | '_' - | PLUS | STAR | QUESTION | MINUS | DOT - | LPAREN | RPAREN | LSQUARE | RSQUARE | LCURLY | RCURLY - | BITWISEXOR | BITWISEOR | DOLLAR | BITWISENOT - ; +fragment RegexComponent: + 'A' ..'Z' + | '0' ..'9' + | '_' + | PLUS + | STAR + | QUESTION + | MINUS + | DOT + | LPAREN + | RPAREN + | LSQUARE + | RSQUARE + | LCURLY + | RCURLY + | BITWISEXOR + | BITWISEOR + | DOLLAR + | BITWISENOT; -CharSetName - : '_' (Letter | Digit | '_' | '-' | '.' | ':')+ - ; +CharSetName: '_' (Letter | Digit | '_' | '-' | '.' | ':')+; -WHITE_SPACE - : (' '|'\r'|'\t'|'\n') -> channel(HIDDEN) - ; +WHITE_SPACE: (' ' | '\r' | '\t' | '\n') -> channel(HIDDEN); -LINE_COMMENT - : '--' ~('\n' | '\r')* -> channel(HIDDEN) - ; +LINE_COMMENT: '--' ~('\n' | '\r')* -> channel(HIDDEN); -QUERY_HINT - : SHOW_HINT - | HIDDEN_HINT - ; +QUERY_HINT: SHOW_HINT | HIDDEN_HINT; -SHOW_HINT - : '/*+' (QUERY_HINT | .)*? '*/' ->channel(HIDDEN) - ; +SHOW_HINT: '/*+' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN); -HIDDEN_HINT - : '/*' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN) - ; \ No newline at end of file +HIDDEN_HINT: '/*' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN); \ No newline at end of file diff --git a/src/grammar/hive/HiveSqlParser.g4 b/src/grammar/hive/HiveSqlParser.g4 index 16570d0..2cbfdd9 100644 --- a/src/grammar/hive/HiveSqlParser.g4 +++ b/src/grammar/hive/HiveSqlParser.g4 @@ -20,6 +20,10 @@ * Reference: https://github.com/antlr/grammars-v4/blob/master/sql/hive/v4/HiveParser.g4 */ +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging +// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true + parser grammar HiveSqlParser; options @@ -27,7 +31,9 @@ options tokenVocab=HiveSqlLexer; } -program : statement* EOF; +program + : statement* EOF + ; // starting rule statement @@ -35,10 +41,7 @@ statement ; explainStatement - : KW_EXPLAIN ( - explainOption* execStatement - | KW_REWRITE queryStatementExpression - ) + : KW_EXPLAIN (explainOption* execStatement | KW_REWRITE queryStatementExpression) ; explainOption @@ -98,24 +101,17 @@ replicationClause ; exportStatement - : KW_EXPORT - KW_TABLE tableOrPartition - KW_TO StringLiteral - replicationClause? + : KW_EXPORT KW_TABLE tableOrPartition KW_TO StringLiteral replicationClause? ; importStatement - : KW_IMPORT - (KW_EXTERNAL? KW_TABLE tableOrPartition)? - KW_FROM path=StringLiteral - tableLocation? + : KW_IMPORT (KW_EXTERNAL? KW_TABLE tableOrPartition)? KW_FROM path=StringLiteral tableLocation? ; replDumpStatement - : KW_REPL KW_DUMP - dbPolicy=replDbPolicy - (KW_REPLACE oldDbPolicy=replDbPolicy)? - (KW_WITH replConf=replConfigs)? + : KW_REPL KW_DUMP dbPolicy=replDbPolicy (KW_REPLACE oldDbPolicy=replDbPolicy)? ( + KW_WITH replConf=replConfigs + )? ; replDbPolicy @@ -123,10 +119,9 @@ replDbPolicy ; replLoadStatement - : KW_REPL KW_LOAD - sourceDbPolicy=replDbPolicy - (KW_INTO dbName=dbSchemaName)? - (KW_WITH replConf=replConfigs)? + : KW_REPL KW_LOAD sourceDbPolicy=replDbPolicy (KW_INTO dbName=dbSchemaName)? ( + KW_WITH replConf=replConfigs + )? ; replConfigs @@ -142,9 +137,7 @@ replTableLevelPolicy ; replStatusStatement - : KW_REPL KW_STATUS - dbName=dbSchemaName - (KW_WITH replConf=replConfigs)? + : KW_REPL KW_STATUS dbName=dbSchemaName (KW_WITH replConf=replConfigs)? ; ddlStatement @@ -231,19 +224,12 @@ orReplace ; createDatabaseStatement - : KW_CREATE KW_REMOTE? db_schema - ifNotExists? - name=dbSchemaNameCreate - databaseComment? - dbLocation? - dbManagedLocation? - (KW_WITH KW_DBPROPERTIES dbprops=dbProperties)? - | KW_CREATE KW_REMOTE db_schema - ifNotExists? - name=dbSchemaNameCreate - databaseComment? - dbConnectorName - (KW_WITH KW_DBPROPERTIES dbprops=dbProperties)? + : KW_CREATE KW_REMOTE? db_schema ifNotExists? name=dbSchemaNameCreate databaseComment? dbLocation? dbManagedLocation? ( + KW_WITH KW_DBPROPERTIES dbprops=dbProperties + )? + | KW_CREATE KW_REMOTE db_schema ifNotExists? name=dbSchemaNameCreate databaseComment? dbConnectorName ( + KW_WITH KW_DBPROPERTIES dbprops=dbProperties + )? ; dbLocation @@ -291,8 +277,7 @@ inputFileFormat ; tabTypeExpr - : id_ (DOT id_)? - (id_ (DOT (KW_ELEM_TYPE | KW_KEY_TYPE | KW_VALUE_TYPE | id_))*)? + : id_ (DOT id_)? (id_ (DOT (KW_ELEM_TYPE | KW_KEY_TYPE | KW_VALUE_TYPE | id_))*)? ; partTypeExpr @@ -304,8 +289,7 @@ tabPartColTypeExpr ; descStatement - : (KW_DESCRIBE | KW_DESC) - ( + : (KW_DESCRIBE | KW_DESC) ( db_schema KW_EXTENDED? dbName=dbSchemaName | KW_DATACONNECTOR KW_EXTENDED? dcName=dbSchemaName | KW_FUNCTION KW_EXTENDED? name=functionNameForDDL @@ -315,10 +299,13 @@ descStatement ; analyzeStatement - : KW_ANALYZE KW_TABLE parttype=tableOrPartition - ( KW_COMPUTE KW_STATISTICS (noscan=KW_NOSCAN | KW_FOR KW_COLUMNS statsColumnName=columnNameList?)? - | KW_CACHE KW_METADATA - ) + : KW_ANALYZE KW_TABLE parttype=tableOrPartition ( + KW_COMPUTE KW_STATISTICS ( + noscan=KW_NOSCAN + | KW_FOR KW_COLUMNS statsColumnName=columnNameList? + )? + | KW_CACHE KW_METADATA + ) ; from_in @@ -334,25 +321,37 @@ db_schema showStatement : KW_SHOW (KW_DATABASES | KW_SCHEMAS) (KW_LIKE showStmtIdentifier)? | KW_SHOW isExtended=KW_EXTENDED? KW_TABLES (from_in db_name=dbSchemaName)? filter=showTablesFilterExpr? - | KW_SHOW KW_VIEWS (from_in db_name=dbSchemaName)? (KW_LIKE showStmtIdentifier | showStmtIdentifier)? - | KW_SHOW KW_MATERIALIZED KW_VIEWS (from_in db_name=dbSchemaName)? (KW_LIKE showStmtIdentifier|showStmtIdentifier)? - | KW_SHOW KW_SORTED? KW_COLUMNS from_in tableOrView (from_in db_name=dbSchemaName)? (KW_LIKE showStmtIdentifier|showStmtIdentifier)? + | KW_SHOW KW_VIEWS (from_in db_name=dbSchemaName)? ( + KW_LIKE showStmtIdentifier + | showStmtIdentifier + )? + | KW_SHOW KW_MATERIALIZED KW_VIEWS (from_in db_name=dbSchemaName)? ( + KW_LIKE showStmtIdentifier + | showStmtIdentifier + )? + | KW_SHOW KW_SORTED? KW_COLUMNS from_in tableOrView (from_in db_name=dbSchemaName)? ( + KW_LIKE showStmtIdentifier + | showStmtIdentifier + )? | KW_SHOW KW_FUNCTIONS (KW_LIKE functionNameForDDL)? | KW_SHOW KW_PARTITIONS tabOrViewName=tableOrView partitionSpec? whereClause? orderByClause? limitClause? | KW_SHOW KW_CREATE (db_schema db_name=dbSchemaName | KW_TABLE tabName=tableName) | KW_SHOW KW_TABLE KW_EXTENDED (from_in db_name=dbSchemaName)? KW_LIKE showStmtIdentifier partitionSpec? | KW_SHOW KW_TBLPROPERTIES tableName (LPAREN prptyName=StringLiteral RPAREN)? - | KW_SHOW KW_LOCKS (db_schema dbName=dbSchemaName isExtended=KW_EXTENDED? | parttype=partTypeExpr? isExtended=KW_EXTENDED?) - | KW_SHOW KW_COMPACTIONS - ( compactionId - | db_schema dbName=dbSchemaName compactionPool? compactionType? compactionStatus? orderByClause? limitClause? - | parttype=partTypeExpr? compactionPool? compactionType? compactionStatus? orderByClause? limitClause? - ) + | KW_SHOW KW_LOCKS ( + db_schema dbName=dbSchemaName isExtended=KW_EXTENDED? + | parttype=partTypeExpr? isExtended=KW_EXTENDED? + ) + | KW_SHOW KW_COMPACTIONS ( + compactionId + | db_schema dbName=dbSchemaName compactionPool? compactionType? compactionStatus? orderByClause? limitClause? + | parttype=partTypeExpr? compactionPool? compactionType? compactionStatus? orderByClause? limitClause? + ) | KW_SHOW KW_TRANSACTIONS | KW_SHOW KW_CONF StringLiteral | KW_SHOW KW_RESOURCE (KW_PLAN rp_name=id_ | KW_PLANS) | KW_SHOW KW_DATACONNECTORS - | KW_SHOW KW_FORMATTED? ( KW_INDEX | KW_INDEXES ) KW_ON tableName (from_in dbSchemaName)? + | KW_SHOW KW_FORMATTED? (KW_INDEX | KW_INDEXES) KW_ON tableName (from_in dbSchemaName)? ; showTablesFilterExpr @@ -391,10 +390,7 @@ dropRoleStatement ; grantPrivileges - : KW_GRANT privList=privilegeList - privilegeObject? - KW_TO principalSpecification - withGrantOption? + : KW_GRANT privList=privilegeList privilegeObject? KW_TO principalSpecification withGrantOption? ; revokePrivileges @@ -422,11 +418,7 @@ showCurrentRole ; setRole - : KW_SET KW_ROLE - ( all=KW_ALL - | none=KW_NONE - | id_ - ) + : KW_SET KW_ROLE (all=KW_ALL | none=KW_NONE | id_) ; showGrants @@ -518,14 +510,15 @@ withAdminOption ; metastoreCheck - : KW_MSCK repair=KW_REPAIR? - (KW_TABLE tableName - (opt=(KW_ADD | KW_DROP | KW_SYNC) parts=KW_PARTITIONS partitionSelectorSpec?)? - ) + : KW_MSCK repair=KW_REPAIR? ( + KW_TABLE tableName ( + opt=(KW_ADD | KW_DROP | KW_SYNC) parts=KW_PARTITIONS partitionSelectorSpec? + )? + ) ; resourceList - : resource (COMMA resource)* + : resource (COMMA resource)* ; resource @@ -539,8 +532,9 @@ resourceType ; createFunctionStatement - : KW_CREATE temp=KW_TEMPORARY? KW_FUNCTION functionNameCreate KW_AS StringLiteral - (KW_USING rList=resourceList)? + : KW_CREATE temp=KW_TEMPORARY? KW_FUNCTION functionNameCreate KW_AS StringLiteral ( + KW_USING rList=resourceList + )? ; dropFunctionStatement @@ -552,8 +546,7 @@ reloadFunctionsStatement ; createMacroStatement - : KW_CREATE KW_TEMPORARY KW_MACRO Identifier - LPAREN columnNameTypeList? RPAREN expression + : KW_CREATE KW_TEMPORARY KW_MACRO Identifier LPAREN columnNameTypeList? RPAREN expression ; dropMacroStatement @@ -561,25 +554,21 @@ dropMacroStatement ; createIndexStatement - : KW_CREATE KW_INDEX id_ KW_ON KW_TABLE tableName columnParenthesesList KW_AS indextype=StringLiteral - (KW_WITH KW_DEFERRED KW_REBUILD)? - (KW_IDXPROPERTIES tableProperties)? - (KW_IN KW_TABLE tableName)? - (KW_PARTITIONED KW_BY columnParenthesesList)? - (tableRowFormat? tableFileFormat)? - (KW_LOCATION locn=StringLiteral)? - tablePropertiesPrefixed? - tableComment?; + : KW_CREATE KW_INDEX id_ KW_ON KW_TABLE tableName columnParenthesesList KW_AS indextype=StringLiteral ( + KW_WITH KW_DEFERRED KW_REBUILD + )? (KW_IDXPROPERTIES tableProperties)? (KW_IN KW_TABLE tableName)? ( + KW_PARTITIONED KW_BY columnParenthesesList + )? (tableRowFormat? tableFileFormat)? (KW_LOCATION locn=StringLiteral)? tablePropertiesPrefixed? tableComment? + ; dropIndexStatement - : KW_DROP KW_INDEX ifExists? id_ KW_ON tableName; + : KW_DROP KW_INDEX ifExists? id_ KW_ON tableName + ; createViewStatement - : KW_CREATE orReplace? KW_VIEW ifNotExists? name=viewNameCreate - (LPAREN columnNameCommentList RPAREN)? tableComment? viewPartition? - tablePropertiesPrefixed? - KW_AS - selectStatementWithCTE + : KW_CREATE orReplace? KW_VIEW ifNotExists? name=viewNameCreate ( + LPAREN columnNameCommentList RPAREN + )? tableComment? viewPartition? tablePropertiesPrefixed? KW_AS selectStatementWithCTE ; viewPartition @@ -612,10 +601,8 @@ dropViewStatement ; createMaterializedViewStatement - : KW_CREATE KW_MATERIALIZED KW_VIEW ifNotExists? name=viewNameCreate - rewriteDisabled? tableComment? viewPartition? viewOrganization? - tableRowFormat? tableFileFormat? tableLocation? - tablePropertiesPrefixed? KW_AS selectStatementWithCTE + : KW_CREATE KW_MATERIALIZED KW_VIEW ifNotExists? name=viewNameCreate rewriteDisabled? tableComment? viewPartition? viewOrganization? + tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? KW_AS selectStatementWithCTE ; dropMaterializedViewStatement @@ -623,11 +610,7 @@ dropMaterializedViewStatement ; createScheduledQueryStatement - : KW_CREATE KW_SCHEDULED KW_QUERY name=id_ - scheduleSpec - executedAsSpec? - enableSpecification? - definedAsSpec + : KW_CREATE KW_SCHEDULED KW_QUERY name=id_ scheduleSpec executedAsSpec? enableSpecification? definedAsSpec ; dropScheduledQueryStatement @@ -648,8 +631,9 @@ alterScheduledQueryChange scheduleSpec : KW_CRON cronString=StringLiteral - | KW_EVERY value=Number? qualifier=intervalQualifiers - ((KW_AT | KW_OFFSET KW_BY) offsetTs=StringLiteral)? + | KW_EVERY value=Number? qualifier=intervalQualifiers ( + (KW_AT | KW_OFFSET KW_BY) offsetTs=StringLiteral + )? ; executedAsSpec @@ -670,10 +654,10 @@ tableComment ; createTablePartitionSpec - : KW_PARTITIONED KW_BY - ( LPAREN (opt1=createTablePartitionColumnTypeSpec | opt2=createTablePartitionColumnSpec) + : KW_PARTITIONED KW_BY ( + LPAREN (opt1=createTablePartitionColumnTypeSpec | opt2=createTablePartitionColumnSpec) | KW_SPEC LPAREN spec=partitionTransformSpec - ) RPAREN + ) RPAREN ; createTablePartitionColumnTypeSpec @@ -699,8 +683,9 @@ partitionTransformType ; tableBuckets - : KW_CLUSTERED KW_BY LPAREN bucketCols=columnNameList RPAREN - (KW_SORTED KW_BY LPAREN sortCols=columnNameOrderList RPAREN)? KW_INTO num=Number KW_BUCKETS + : KW_CLUSTERED KW_BY LPAREN bucketCols=columnNameList RPAREN ( + KW_SORTED KW_BY LPAREN sortCols=columnNameOrderList RPAREN + )? KW_INTO num=Number KW_BUCKETS ; tableImplBuckets @@ -725,12 +710,14 @@ recordWriter ; rowFormatSerde - : KW_ROW KW_FORMAT KW_SERDE name=StringLiteral (KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)? + : KW_ROW KW_FORMAT KW_SERDE name=StringLiteral ( + KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties + )? ; rowFormatDelimited - : KW_ROW KW_FORMAT KW_DELIMITED tableRowFormatFieldIdentifier? tableRowFormatCollItemsIdentifier? - tableRowFormatMapKeysIdentifier? tableRowFormatLinesIdentifier? tableRowNullFormat? + : KW_ROW KW_FORMAT KW_DELIMITED tableRowFormatFieldIdentifier? tableRowFormatCollItemsIdentifier? tableRowFormatMapKeysIdentifier? + tableRowFormatLinesIdentifier? tableRowNullFormat? ; tableRowFormat @@ -760,7 +747,9 @@ keyProperty ; tableRowFormatFieldIdentifier - : KW_FIELDS KW_TERMINATED KW_BY fldIdnt=StringLiteral (KW_ESCAPED KW_BY fldEscape=StringLiteral)? + : KW_FIELDS KW_TERMINATED KW_BY fldIdnt=StringLiteral ( + KW_ESCAPED KW_BY fldEscape=StringLiteral + )? ; tableRowFormatCollItemsIdentifier @@ -780,16 +769,15 @@ tableRowNullFormat ; tableFileFormat - : KW_STORED KW_AS KW_INPUTFORMAT - inFmt=StringLiteral KW_OUTPUTFORMAT - outFmt=StringLiteral - (KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)? - | KW_STORED KW_BY storageHandler=StringLiteral - (KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)? - (KW_STORED KW_AS fileformat=id_)? - | KW_STORED KW_BY genericSpec=id_ - (KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)? - (KW_STORED KW_AS fileformat=id_)? + : KW_STORED KW_AS KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral ( + KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral + )? + | KW_STORED KW_BY storageHandler=StringLiteral ( + KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties + )? (KW_STORED KW_AS fileformat=id_)? + | KW_STORED KW_BY genericSpec=id_ (KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)? ( + KW_STORED KW_AS fileformat=id_ + )? | KW_STORED KW_AS genericSpec=id_ ; @@ -854,8 +842,8 @@ enforcedSpecification ; relySpecification - : KW_RELY - | KW_NORELY + : KW_RELY + | KW_NORELY ; createConstraint @@ -880,13 +868,13 @@ checkConstraint ; createForeignKey - : (KW_CONSTRAINT constraintName=id_)? KW_FOREIGN KW_KEY fkCols=columnParenthesesList - KW_REFERENCES tabName=tableName parCols=columnParenthesesList constraintOptsCreate? + : (KW_CONSTRAINT constraintName=id_)? KW_FOREIGN KW_KEY fkCols=columnParenthesesList KW_REFERENCES tabName=tableName parCols=columnParenthesesList + constraintOptsCreate? ; alterForeignKeyWithName - : KW_CONSTRAINT constraintName=id_ KW_FOREIGN KW_KEY fkCols=columnParenthesesList - KW_REFERENCES tabName=tableName parCols=columnParenthesesList constraintOptsAlter? + : KW_CONSTRAINT constraintName=id_ KW_FOREIGN KW_KEY fkCols=columnParenthesesList KW_REFERENCES tabName=tableName parCols=columnParenthesesList + constraintOptsAlter? ; skewedValueElement @@ -1032,7 +1020,8 @@ type | listType | structType | mapType - | unionType; + | unionType + ; primitiveType : KW_TINYINT @@ -1121,25 +1110,13 @@ regularBody ; atomSelectStatement - : s=selectClause - f=fromClause? - w=whereClause? - g=groupByClause? - h=havingClause? - win=window_clause? - q=qualifyClause? + : s=selectClause f=fromClause? w=whereClause? g=groupByClause? h=havingClause? win=window_clause? q=qualifyClause? | LPAREN selectStatement RPAREN | valuesSource ; selectStatement - : a=atomSelectStatement - set=setOpSelectStatement? - o=orderByClause? - c=clusterByClause? - d=distributeByClause? - sort=sortByClause? - l=limitClause? + : a=atomSelectStatement set=setOpSelectStatement? o=orderByClause? c=clusterByClause? d=distributeByClause? sort=sortByClause? l=limitClause? ; setOpSelectStatement @@ -1151,37 +1128,17 @@ selectStatementWithCTE ; body - : insertClause - selectClause - lateralView? - whereClause? - groupByClause? - havingClause? - window_clause? - qualifyClause? - orderByClause? - clusterByClause? - distributeByClause? - sortByClause? - limitClause? - | selectClause - lateralView? - whereClause? - groupByClause? - havingClause? - window_clause? - qualifyClause? - orderByClause? - clusterByClause? - distributeByClause? - sortByClause? - limitClause? + : insertClause selectClause lateralView? whereClause? groupByClause? havingClause? window_clause? qualifyClause? orderByClause? clusterByClause? + distributeByClause? sortByClause? limitClause? + | selectClause lateralView? whereClause? groupByClause? havingClause? window_clause? qualifyClause? orderByClause? clusterByClause? + distributeByClause? sortByClause? limitClause? ; insertClause - : KW_INSERT ( KW_OVERWRITE destination ifNotExists? - | KW_INTO KW_TABLE? tableOrPartition (LPAREN targetCols=columnNameList RPAREN)? - ) + : KW_INSERT ( + KW_OVERWRITE destination ifNotExists? + | KW_INTO KW_TABLE? tableOrPartition (LPAREN targetCols=columnNameList RPAREN)? + ) ; destination @@ -1235,7 +1192,7 @@ sqlTransactionStatement ; startTransactionStatement - : KW_START KW_TRANSACTION (transactionMode (COMMA transactionMode)* )? + : KW_START KW_TRANSACTION (transactionMode (COMMA transactionMode)*)? ; transactionMode @@ -1267,6 +1224,7 @@ rollbackStatement setAutoCommitStatement : KW_SET KW_AUTOCOMMIT booleanValueTok ; + /* END user defined transaction boundaries */ @@ -1285,6 +1243,7 @@ BEGIN SQL Merge statement mergeStatement : KW_MERGE QUERY_HINT? KW_INTO tableName (KW_AS? id_)? KW_USING joinSourcePart KW_ON expression whenClauses ; + /* Allow 0,1 or 2 WHEN MATCHED clauses and 0 or 1 WHEN NOT MATCHED Each WHEN clause may have AND . @@ -1311,6 +1270,7 @@ updateOrDelete : KW_UPDATE setColumnsClause | KW_DELETE ; + /* END SQL Merge statement */ @@ -1343,13 +1303,14 @@ END SHOW COMPACTIONS statement */ alterStatement - : KW_ALTER ( KW_TABLE tableName alterTableStatementSuffix - | KW_VIEW viewName KW_AS? alterViewStatementSuffix - | KW_MATERIALIZED KW_VIEW tableNameTree=viewName alterMaterializedViewStatementSuffix - | db_schema alterDatabaseStatementSuffix - | KW_DATACONNECTOR alterDataConnectorStatementSuffix - | KW_INDEX alterIndexStatementSuffix - ) + : KW_ALTER ( + KW_TABLE tableName alterTableStatementSuffix + | KW_VIEW viewName KW_AS? alterViewStatementSuffix + | KW_MATERIALIZED KW_VIEW tableNameTree=viewName alterMaterializedViewStatementSuffix + | db_schema alterDatabaseStatementSuffix + | KW_DATACONNECTOR alterDataConnectorStatementSuffix + | KW_INDEX alterIndexStatementSuffix + ) ; alterTableStatementSuffix @@ -1448,7 +1409,7 @@ alterStatementSuffixAddCol ; alterStatementSuffixAddConstraint - : KW_ADD (fk=alterForeignKeyWithName | alterConstraintWithName) + : KW_ADD (fk=alterForeignKeyWithName | alterConstraintWithName) ; alterStatementSuffixUpdateColumns @@ -1465,12 +1426,15 @@ alterStatementSuffixDropConstraint ; alterStatementSuffixRenameCol - : KW_CHANGE KW_COLUMN? oldName=columnName newName=columnNameCreate colType alterColumnConstraint? - (KW_COMMENT comment=StringLiteral)? alterStatementChangeColPosition? restrictOrCascade? + : KW_CHANGE KW_COLUMN? oldName=columnName newName=columnNameCreate colType alterColumnConstraint? ( + KW_COMMENT comment=StringLiteral + )? alterStatementChangeColPosition? restrictOrCascade? ; alterStatementSuffixUpdateStatsCol - : KW_UPDATE KW_STATISTICS KW_FOR KW_COLUMN? colName=columnName KW_SET tableProperties (KW_COMMENT comment=StringLiteral)? + : KW_UPDATE KW_STATISTICS KW_FOR KW_COLUMN? colName=columnName KW_SET tableProperties ( + KW_COMMENT comment=StringLiteral + )? ; alterStatementSuffixUpdateStats @@ -1511,7 +1475,9 @@ alterStatementSuffixRecoverPartitions ; alterStatementSuffixDropPartitions - : KW_DROP ifExists? KW_PARTITION partitionSelectorSpec (COMMA KW_PARTITION partitionSelectorSpec)* dropPartitionsIgnoreClause? KW_PURGE? replicationClause? + : KW_DROP ifExists? KW_PARTITION partitionSelectorSpec ( + COMMA KW_PARTITION partitionSelectorSpec + )* dropPartitionsIgnoreClause? KW_PURGE? replicationClause? ; alterStatementSuffixProperties @@ -1525,9 +1491,10 @@ alterViewSuffixProperties ; alterStatementSuffixSerdeProperties - : KW_SET ( KW_SERDE serdeName=StringLiteral (KW_WITH KW_SERDEPROPERTIES tableProperties)? - | KW_SERDEPROPERTIES tableProperties - ) + : KW_SET ( + KW_SERDE serdeName=StringLiteral (KW_WITH KW_SERDEPROPERTIES tableProperties)? + | KW_SERDEPROPERTIES tableProperties + ) | KW_UNSET KW_SERDEPROPERTIES tableProperties ; @@ -1578,7 +1545,9 @@ alterStatementSuffixRenamePart ; alterStatementSuffixStatsPart - : KW_UPDATE KW_STATISTICS KW_FOR KW_COLUMN? colName=columnName KW_SET tableProperties (KW_COMMENT comment=StringLiteral)? + : KW_UPDATE KW_STATISTICS KW_FOR KW_COLUMN? colName=columnName KW_SET tableProperties ( + KW_COMMENT comment=StringLiteral + )? ; alterStatementSuffixMergeFiles @@ -1598,7 +1567,9 @@ compactPool ; alterStatementSuffixCompact - : KW_COMPACT compactType=StringLiteral blocking? tableImplBuckets? orderByClause? compactPool? (KW_WITH KW_OVERWRITE KW_TBLPROPERTIES tableProperties)? + : KW_COMPACT compactType=StringLiteral blocking? tableImplBuckets? orderByClause? compactPool? ( + KW_WITH KW_OVERWRITE KW_TBLPROPERTIES tableProperties + )? ; alterStatementSuffixSetOwner @@ -1610,20 +1581,21 @@ alterStatementSuffixSetPartSpec ; alterStatementSuffixExecute - : KW_EXECUTE ( KW_ROLLBACK LPAREN rollbackParam=(StringLiteral | Number) - | KW_EXPIRE_SNAPSHOTS LPAREN expireParam=StringLiteral - | KW_SET_CURRENT_SNAPSHOT LPAREN snapshotParam=Number - ) RPAREN + : KW_EXECUTE ( + KW_ROLLBACK LPAREN rollbackParam=(StringLiteral | Number) + | KW_EXPIRE_SNAPSHOTS LPAREN expireParam=StringLiteral + | KW_SET_CURRENT_SNAPSHOT LPAREN snapshotParam=Number + ) RPAREN ; alterIndexStatementSuffix - : id_ KW_ON tableName - partitionSpec? - KW_REBUILD; + : id_ KW_ON tableName partitionSpec? KW_REBUILD + ; fileFormat - : KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral KW_SERDE serdeCls=StringLiteral - (KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)? + : KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral KW_SERDE serdeCls=StringLiteral ( + KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral + )? | genericSpec=id_ ; @@ -1655,46 +1627,22 @@ likeTableOrFile Rules for parsing createtable */ createTableStatement - : KW_CREATE temp=KW_TEMPORARY? trans=KW_TRANSACTIONAL? ext=KW_EXTERNAL? KW_TABLE ifNotExists? name=tableNameCreate - ( likeTableOrFile - createTablePartitionSpec? - tableRowFormat? - tableFileFormat? - tableLocation? - tablePropertiesPrefixed? - | (LPAREN columnNameTypeOrConstraintList RPAREN)? - tableComment? - createTablePartitionSpec? - tableBuckets? - tableSkewed? - tableRowFormat? - tableFileFormat? - tableLocation? - tablePropertiesPrefixed? - (KW_AS selectStatementWithCTE)? - ) - | KW_CREATE mgd=KW_MANAGED KW_TABLE ifNotExists? name=tableNameCreate - ( likeTableOrFile - tableRowFormat? - tableFileFormat? - tableLocation? - tablePropertiesPrefixed? - | (LPAREN columnNameTypeOrConstraintList RPAREN)? - tableComment? - createTablePartitionSpec? - tableBuckets? - tableSkewed? - tableRowFormat? - tableFileFormat? - tableLocation? - tablePropertiesPrefixed? - (KW_AS selectStatementWithCTE)? - ) + : KW_CREATE temp=KW_TEMPORARY? trans=KW_TRANSACTIONAL? ext=KW_EXTERNAL? KW_TABLE ifNotExists? name=tableNameCreate ( + likeTableOrFile createTablePartitionSpec? tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? + | (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? createTablePartitionSpec? tableBuckets? tableSkewed? tableRowFormat? + tableFileFormat? tableLocation? tablePropertiesPrefixed? (KW_AS selectStatementWithCTE)? + ) + | KW_CREATE mgd=KW_MANAGED KW_TABLE ifNotExists? name=tableNameCreate ( + likeTableOrFile tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? + | (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? createTablePartitionSpec? tableBuckets? tableSkewed? tableRowFormat? + tableFileFormat? tableLocation? tablePropertiesPrefixed? (KW_AS selectStatementWithCTE)? + ) ; createDataConnectorStatement - : KW_CREATE KW_DATACONNECTOR ifNotExists? name=id_ dataConnectorType? dataConnectorUrl? dataConnectorComment? - (KW_WITH KW_DCPROPERTIES dcprops=dcProperties)? + : KW_CREATE KW_DATACONNECTOR ifNotExists? name=id_ dataConnectorType? dataConnectorUrl? dataConnectorComment? ( + KW_WITH KW_DCPROPERTIES dcprops=dcProperties + )? ; dataConnectorComment @@ -1756,7 +1704,9 @@ atomjoinSource ; joinSource - : atomjoinSource (joinToken joinSourcePart (KW_ON expression | KW_USING columnParenthesesList)?)* + : atomjoinSource ( + joinToken joinSourcePart (KW_ON expression | KW_USING columnParenthesesList)? + )* ; joinSourcePart @@ -1777,18 +1727,20 @@ uniqueJoinToken joinToken : COMMA - | ( KW_INNER - | KW_CROSS - | (KW_RIGHT | KW_FULL) KW_OUTER? - | KW_LEFT (KW_SEMI | KW_ANTI | KW_OUTER)? - )? KW_JOIN + | ( + KW_INNER + | KW_CROSS + | (KW_RIGHT | KW_FULL) KW_OUTER? + | KW_LEFT (KW_SEMI | KW_ANTI | KW_OUTER)? + )? KW_JOIN ; lateralView : KW_LATERAL KW_VIEW KW_OUTER function_ tableAlias (KW_AS id_ (COMMA id_)*)? - | COMMA? KW_LATERAL ( KW_VIEW function_ tableAlias (KW_AS id_ (COMMA id_)*)? - | KW_TABLE LPAREN valuesClause RPAREN KW_AS? tableAlias (LPAREN id_ (COMMA id_)* RPAREN)? - ) + | COMMA? KW_LATERAL ( + KW_VIEW function_ tableAlias (KW_AS id_ (COMMA id_)*)? + | KW_TABLE LPAREN valuesClause RPAREN KW_AS? tableAlias (LPAREN id_ (COMMA id_)* RPAREN)? + ) ; tableAlias @@ -1796,8 +1748,9 @@ tableAlias ; tableBucketSample - : KW_TABLESAMPLE LPAREN KW_BUCKET numerator=Number KW_OUT KW_OF denominator=Number - (KW_ON expr+=expression (COMMA expr+=expression)*)? RPAREN + : KW_TABLESAMPLE LPAREN KW_BUCKET numerator=Number KW_OUT KW_OF denominator=Number ( + KW_ON expr+=expression (COMMA expr+=expression)* + )? RPAREN ; splitSample @@ -1810,13 +1763,16 @@ tableSample ; tableSource - : tabname=tableOrView props=tableProperties? ts=tableSample? asOf=asOfClause? (KW_AS? alias=id_)? + : tabname=tableOrView props=tableProperties? ts=tableSample? asOf=asOfClause? ( + KW_AS? alias=id_ + )? ; asOfClause - : KW_FOR ( KW_SYSTEM_TIME KW_AS KW_OF asOfTime=expression - | KW_FOR KW_SYSTEM_VERSION KW_AS KW_OF asOfVersion=Number - ) + : KW_FOR ( + KW_SYSTEM_TIME KW_AS KW_OF asOfTime=expression + | KW_FOR KW_SYSTEM_VERSION KW_AS KW_OF asOfVersion=Number + ) ; uniqueJoinTableSource @@ -1876,10 +1832,9 @@ partitionTableFunctionSource ; partitionedTableFunction - : n=id_ LPAREN KW_ON - ptfsrc=partitionTableFunctionSource spec=partitioningSpec? - (Identifier LPAREN expression RPAREN (COMMA Identifier LPAREN expression RPAREN)*)? - RPAREN alias=id_? + : n=id_ LPAREN KW_ON ptfsrc=partitionTableFunctionSource spec=partitioningSpec? ( + Identifier LPAREN expression RPAREN (COMMA Identifier LPAREN expression RPAREN)* + )? RPAREN alias=id_? ; /** @@ -1954,11 +1909,9 @@ selectList ; selectTrfmClause - : LPAREN selectExpressionList RPAREN - rowFormat recordWriter - KW_USING StringLiteral - (KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList))? - rowFormat recordReader + : LPAREN selectExpressionList RPAREN rowFormat recordWriter KW_USING StringLiteral ( + KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList) + )? rowFormat recordReader ; selectItem @@ -1967,11 +1920,9 @@ selectItem ; trfmClause - : (KW_MAP | KW_REDUCE) selectExpressionList - rowFormat recordWriter - KW_USING StringLiteral - (KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList))? - rowFormat recordReader + : (KW_MAP | KW_REDUCE) selectExpressionList rowFormat recordWriter KW_USING StringLiteral ( + KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList) + )? rowFormat recordReader ; selectExpression @@ -2005,15 +1956,17 @@ window_frame ; window_range_expression - : KW_ROWS ( window_frame_start_boundary - | KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary - ) + : KW_ROWS ( + window_frame_start_boundary + | KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary + ) ; window_value_expression - : KW_RANGE ( window_frame_start_boundary - | KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary - ) + : KW_RANGE ( + window_frame_start_boundary + | KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary + ) ; window_frame_start_boundary @@ -2046,15 +1999,14 @@ groupByEmpty // standard rollup syntax rollupStandard - : (rollup=KW_ROLLUP | cube=KW_CUBE) - LPAREN expression (COMMA expression)* RPAREN + : (rollup=KW_ROLLUP | cube=KW_CUBE) LPAREN expression (COMMA expression)* RPAREN ; // old hive rollup syntax rollupOldSyntax - : expr=expressionsNotInParenthesis - (rollup=KW_WITH KW_ROLLUP | cube=KW_WITH KW_CUBE)? - (sets=KW_GROUPING KW_SETS LPAREN groupingSetExpression (COMMA groupingSetExpression)* RPAREN)? + : expr=expressionsNotInParenthesis (rollup=KW_WITH KW_ROLLUP | cube=KW_WITH KW_CUBE)? ( + sets=KW_GROUPING KW_SETS LPAREN groupingSetExpression (COMMA groupingSetExpression)* RPAREN + )? ; groupingSetExpression @@ -2150,17 +2102,16 @@ sortByClause // TRIM([LEADING|TRAILING|BOTH] trim_characters FROM str) trimFunction - : KW_TRIM LPAREN (leading=KW_LEADING | trailing=KW_TRAILING | KW_BOTH)? - trim_characters=selectExpression? KW_FROM str=selectExpression RPAREN + : KW_TRIM LPAREN (leading=KW_LEADING | trailing=KW_TRAILING | KW_BOTH)? trim_characters=selectExpression? KW_FROM str=selectExpression RPAREN ; // fun(par1, par2, par3) function_ : trimFunction - | functionNameForInvoke - LPAREN - (star=STAR | dist=all_distinct? (selectExpression (COMMA selectExpression)*)?) - ( + | functionNameForInvoke LPAREN ( + star=STAR + | dist=all_distinct? (selectExpression (COMMA selectExpression)*)? + ) ( // SELECT rank(3) WITHIN GROUP () RPAREN within=KW_WITHIN KW_GROUP LPAREN ordBy=orderByClause RPAREN // No null treatment: SELECT first_value(b) OVER () @@ -2169,7 +2120,7 @@ function_ // Non-standard null treatment spec: SELECT first_value(b IGNORE NULLS) OVER () | nt=null_treatment RPAREN KW_OVER ws=window_specification | RPAREN - ) + ) ; null_treatment @@ -2201,27 +2152,15 @@ internalFunctionName // Hive Internal Function ; castExpression - : KW_CAST - LPAREN - expression - KW_AS - toType=primitiveType - (fmt=KW_FORMAT StringLiteral)? - RPAREN + : KW_CAST LPAREN expression KW_AS toType=primitiveType (fmt=KW_FORMAT StringLiteral)? RPAREN ; caseExpression - : KW_CASE expression - (KW_WHEN expression KW_THEN expression)+ - (KW_ELSE expression)? - KW_END + : KW_CASE expression (KW_WHEN expression KW_THEN expression)+ (KW_ELSE expression)? KW_END ; whenExpression - : KW_CASE - (KW_WHEN expression KW_THEN expression)+ - (KW_ELSE expression)? - KW_END + : KW_CASE (KW_WHEN expression KW_THEN expression)+ (KW_ELSE expression)? KW_END ; floorExpression @@ -2363,7 +2302,9 @@ precedenceBitwiseXorOperator ; precedenceBitwiseXorExpression - : precedenceUnaryPrefixExpression (precedenceBitwiseXorOperator precedenceUnaryPrefixExpression)* + : precedenceUnaryPrefixExpression ( + precedenceBitwiseXorOperator precedenceUnaryPrefixExpression + )* ; precedenceStarOperator @@ -2392,7 +2333,6 @@ precedenceConcatenateOperator precedenceConcatenateExpression : precedencePlusExpression (precedenceConcatenateOperator plus=precedencePlusExpression)* - ; precedenceAmpersandOperator @@ -2483,10 +2423,10 @@ precedenceEqualOperator ; precedenceEqualExpression - : precedenceSimilarExpression - ( equal+=precedenceEqualOperator p+=precedenceSimilarExpression + : precedenceSimilarExpression ( + equal+=precedenceEqualOperator p+=precedenceSimilarExpression | dist+=precedenceDistinctOperator p+=precedenceSimilarExpression - )* + )* ; isCondition @@ -2988,8 +2928,10 @@ rpUnassignList ; createResourcePlanStatement - : KW_CREATE KW_RESOURCE KW_PLAN ifNotExists? - (name=id_ KW_LIKE likeName=id_ | name=id_ (KW_WITH rpAssignList)?) + : KW_CREATE KW_RESOURCE KW_PLAN ifNotExists? ( + name=id_ KW_LIKE likeName=id_ + | name=id_ (KW_WITH rpAssignList)? + ) ; withReplace @@ -3057,14 +2999,14 @@ decimal alterResourcePlanStatement : KW_ALTER KW_RESOURCE KW_PLAN name=id_ ( - KW_VALIDATE + KW_VALIDATE | disable | KW_SET rpAssignList | KW_UNSET rpUnassignList | KW_RENAME KW_TO newName=id_ | activate enable? | enable activate? - ) + ) ; /** It might make sense to make this more generic, if something else could be enabled/disabled. @@ -3075,9 +3017,9 @@ globalWmStatement replaceResourcePlanStatement : KW_REPLACE ( - KW_ACTIVE KW_RESOURCE KW_PLAN KW_WITH src=id_ + KW_ACTIVE KW_RESOURCE KW_PLAN KW_WITH src=id_ | KW_RESOURCE KW_PLAN dest=id_ KW_WITH src=id_ - ) + ) ; dropResourcePlanStatement @@ -3131,15 +3073,14 @@ triggerActionExpressionStandalone ; createTriggerStatement - : KW_CREATE KW_TRIGGER rpName=id_ DOT triggerName=id_ - KW_WHEN triggerExpression KW_DO triggerActionExpression + : KW_CREATE KW_TRIGGER rpName=id_ DOT triggerName=id_ KW_WHEN triggerExpression KW_DO triggerActionExpression ; alterTriggerStatement - : KW_ALTER KW_TRIGGER rpName=id_ DOT triggerName=id_ - ( KW_WHEN triggerExpression KW_DO triggerActionExpression - | (KW_ADD KW_TO | KW_DROP KW_FROM) (KW_POOL poolName=poolPath | KW_UNMANAGED) - ) + : KW_ALTER KW_TRIGGER rpName=id_ DOT triggerName=id_ ( + KW_WHEN triggerExpression KW_DO triggerActionExpression + | (KW_ADD KW_TO | KW_DROP KW_FROM) (KW_POOL poolName=poolPath | KW_UNMANAGED) + ) ; dropTriggerStatement @@ -3147,11 +3088,12 @@ dropTriggerStatement ; poolAssign - : ( KW_ALLOC_FRACTION EQUAL allocFraction=Number - | KW_QUERY_PARALLELISM EQUAL parallelism=Number - | KW_SCHEDULING_POLICY EQUAL policy=StringLiteral - | KW_PATH EQUAL path=poolPath - ) + : ( + KW_ALLOC_FRACTION EQUAL allocFraction=Number + | KW_QUERY_PARALLELISM EQUAL parallelism=Number + | KW_SCHEDULING_POLICY EQUAL policy=StringLiteral + | KW_PATH EQUAL path=poolPath + ) ; poolAssignList @@ -3159,16 +3101,15 @@ poolAssignList ; createPoolStatement - : KW_CREATE KW_POOL rpName=id_ DOT poolPath - KW_WITH poolAssignList + : KW_CREATE KW_POOL rpName=id_ DOT poolPath KW_WITH poolAssignList ; alterPoolStatement - : KW_ALTER KW_POOL rpName=id_ DOT poolPath - ( KW_SET poolAssignList + : KW_ALTER KW_POOL rpName=id_ DOT poolPath ( + KW_SET poolAssignList | KW_UNSET KW_SCHEDULING_POLICY | (KW_ADD | KW_DROP) KW_TRIGGER triggerName=id_ - ) + ) ; dropPoolStatement @@ -3176,20 +3117,19 @@ dropPoolStatement ; createMappingStatement - : KW_CREATE mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) - KW_MAPPING name=StringLiteral - KW_IN rpName=id_ (KW_TO path=poolPath | unmanaged) - (KW_WITH KW_ORDER order=Number)? + : KW_CREATE mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_ ( + KW_TO path=poolPath + | unmanaged + ) (KW_WITH KW_ORDER order=Number)? ; alterMappingStatement - : KW_ALTER mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) - KW_MAPPING name=StringLiteral - KW_IN rpName=id_ (KW_TO path=poolPath | unmanaged) - (KW_WITH KW_ORDER order=Number)? + : KW_ALTER mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_ ( + KW_TO path=poolPath + | unmanaged + ) (KW_WITH KW_ORDER order=Number)? ; dropMappingStatement - : KW_DROP mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING - name=StringLiteral KW_IN rpName=id_ - ; + : KW_DROP mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_ + ; \ No newline at end of file diff --git a/src/grammar/impala/ImpalaSqlLexer.g4 b/src/grammar/impala/ImpalaSqlLexer.g4 index 919116a..ab35df0 100644 --- a/src/grammar/impala/ImpalaSqlLexer.g4 +++ b/src/grammar/impala/ImpalaSqlLexer.g4 @@ -19,351 +19,317 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing +// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true +// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true + lexer grammar ImpalaSqlLexer; -options { caseInsensitive = true; } +options { + caseInsensitive=true; +} -KW_ADD : 'ADD'; -KW_ALL : 'ALL'; -KW_ANALYTIC : 'ANALYTIC'; -KW_ALTER : 'ALTER'; -KW_AND : 'AND'; -KW_ANY : 'ANY'; -KW_ANTI : 'ANTI'; -KW_ARRAY : 'ARRAY'; -KW_AS : 'AS'; -KW_ASC : 'ASC'; -KW_AT : 'AT'; -KW_AGGREGATE : 'AGGREGATE'; -KW_AUTHORIZATION : 'AUTHORIZATION'; -KW_BERNOULLI : 'BERNOULLI'; -KW_BETWEEN : 'BETWEEN'; -KW_BLOCK_SIZE : 'BLOCK_SIZE'; -KW_PARTITIONED : 'PARTITIONED'; -KW_PREPARE_FN : 'PREPARE_FN'; -KW_EXTERNAL : 'EXTERNAL'; -KW_CLOSEFN : 'CLOSEFN'; -KW_SORT : 'SORT'; -KW_PURGE : 'PURGE'; -KW_STORED : 'STORED'; -KW_LOCATION : 'LOCATION'; -KW_TBLPROPERTIES : 'TBLPROPERTIES'; -KW_BY : 'BY'; -KW_CASCADE : 'CASCADE'; -KW_CASE : 'CASE'; -KW_CAST : 'CAST'; -KW_CACHED : 'CACHED'; -KW_CHANGE : 'CHANGE'; -KW_COLUMN : 'COLUMN'; -KW_COLUMNS : 'COLUMNS'; -KW_COMMENT : 'COMMENT'; -KW_COMPRESSION : 'COMPRESSION'; -KW_COMPUTE : 'COMPUTE'; -KW_CREATE : 'CREATE'; -KW_CROSS : 'CROSS'; -KW_CURRENT : 'CURRENT'; -KW_CURRENT_DATE : 'CURRENT_DATE'; -KW_CURRENT_PATH : 'CURRENT_PATH'; -KW_CURRENT_TIME : 'CURRENT_TIME'; -KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; -KW_CURRENT_USER : 'CURRENT_USER'; -KW_DATA : 'DATA'; -KW_DATABASE : 'DATABASE'; -KW_DATABASES : 'DATABASES'; -KW_DAY : 'DAY'; -KW_DAYS : 'DAYS'; -KW_DELETE : 'DELETE'; -KW_DEFAULT : 'DEFAULT'; -KW_DELIMITED : 'DELIMITED'; -KW_DISABLE : 'DISABLE'; -KW_UPDATE : 'UPDATE'; -KW_DESC : 'DESC'; -KW_DESCRIBE : 'DESCRIBE'; -KW_DISTINCT : 'DISTINCT'; -KW_DROP : 'DROP'; -KW_ELSE : 'ELSE'; -KW_ENCODING : 'ENCODING'; -KW_END : 'END'; -KW_ESCAPE : 'ESCAPE'; -KW_ESCAPED : 'ESCAPED'; -KW_EXCEPT : 'EXCEPT'; -KW_EXCLUDING : 'EXCLUDING'; -KW_EXISTS : 'EXISTS'; -KW_EXPLAIN : 'EXPLAIN'; -KW_EXTRACT : 'EXTRACT'; -KW_EXTENDED : 'EXTENDED'; -KW_FALSE : 'FALSE'; -KW_FIELDS : 'FIELDS'; -KW_FILEFORMAT : 'FILEFORMAT'; -KW_FILES : 'FILES'; -KW_FILTER : 'FILTER'; -KW_FIRST : 'FIRST'; -KW_FINALIZE_FN : 'FINALIZE_FN'; -KW_FOLLOWING : 'FOLLOWING'; -KW_FOR : 'FOR'; -KW_FORMAT : 'FORMAT'; -KW_FORMATTED : 'FORMATTED'; -KW_FOREIGN : 'FOREIGN'; -KW_FROM : 'FROM'; -KW_FULL : 'FULL'; -KW_FUNCTION : 'FUNCTION'; -KW_FUNCTIONS : 'FUNCTIONS'; -KW_GRANT : 'GRANT'; -KW_GROUP : 'GROUP'; -KW_GROUPING : 'GROUPING'; -KW_HASH : 'HASH'; -KW_HAVING : 'HAVING'; -KW_HOUR : 'HOUR'; -KW_HOURS : 'HOURS'; -KW_IF : 'IF'; -KW_IN : 'IN'; -KW_INCLUDING : 'INCLUDING'; -KW_INCREMENTAL : 'INCREMENTAL'; -KW_INNER : 'INNER'; -KW_INPATH : 'INPATH'; -KW_INSERT : 'INSERT'; -KW_INTERSECT : 'INTERSECT'; -KW_INTERVAL : 'INTERVAL'; -KW_INTERMEDIATE : 'INTERMEDIATE'; -KW_INTO : 'INTO'; -KW_INIT_FN : 'INIT_FN'; -KW_IREGEXP : 'IREGEXP'; -KW_ILIKE : 'ILIKE'; -KW_INVALIDATE : 'INVALIDATE'; -KW_IS : 'IS'; -KW_JOIN : 'JOIN'; -KW_KEY : 'KEY'; -KW_KUDU : 'KUDU'; -KW_LAST : 'LAST'; -KW_LATERAL : 'LATERAL'; -KW_LEFT : 'LEFT'; -KW_LIKE : 'LIKE'; -KW_LIMIT : 'LIMIT'; -KW_LINES : 'LINES'; -KW_LOAD : 'LOAD'; -KW_LOCALTIME : 'LOCALTIME'; -KW_LOCALTIMESTAMP : 'LOCALTIMESTAMP'; -KW_METADATA : 'METADATA'; -KW_MAP : 'MAP'; -KW_MINUTE : 'MINUTE'; -KW_MINUTES : 'MINUTES'; -KW_MONTH : 'MONTH'; -KW_MONTHS : 'MONTHS'; -KW_MERGE_FN : 'MERGE_FN'; -KW_NFC : 'NFC'; -KW_NFD : 'NFD'; -KW_NFKC : 'NFKC'; -KW_NFKD : 'NFKD'; -KW_NORMALIZE : 'NORMALIZE'; -KW_NOT : 'NOT'; -KW_NULL : 'NULL'; -KW_NULLS : 'NULLS'; -KW_OFFSET : 'OFFSET'; -KW_ON : 'ON'; -KW_OPTION : 'OPTION'; -KW_OR : 'OR'; -KW_ORDER : 'ORDER'; -KW_ORDINALITY : 'ORDINALITY'; -KW_OUTER : 'OUTER'; -KW_OWNER : 'OWNER'; -KW_OVER : 'OVER'; -KW_OVERWRITE : 'OVERWRITE'; -KW_PARTITION : 'PARTITION'; -KW_PARTITIONS : 'PARTITIONS'; -KW_PARQUET : 'PARQUET'; -KW_POSITION : 'POSITION'; -KW_PRECEDING : 'PRECEDING'; -KW_PRIMARY : 'PRIMARY'; -KW_REPLICATION : 'REPLICATION'; -KW_PRIVILEGES : 'PRIVILEGES'; -KW_PROPERTIES : 'PROPERTIES'; -KW_RANGE : 'RANGE'; -KW_RECOVER : 'RECOVER'; -KW_RENAME : 'RENAME'; -KW_REPEATABLE : 'REPEATABLE'; -KW_REPLACE : 'REPLACE'; -KW_RESTRICT : 'RESTRICT'; -KW_RETURNS : 'RETURNS'; -KW_REVOKE : 'REVOKE'; -KW_REFRESH : 'REFRESH'; -KW_REGEXP : 'REGEXP'; -KW_RLIKE : 'RLIKE'; -KW_RIGHT : 'RIGHT'; -KW_ROLE : 'ROLE'; -KW_ROLES : 'ROLES'; -KW_ROW : 'ROW'; -KW_ROWS : 'ROWS'; -KW_SCHEMA : 'SCHEMA'; -KW_SCHEMAS : 'SCHEMAS'; -KW_SECOND : 'SECOND'; -KW_SECONDS : 'SECONDS'; -KW_SELECT : 'SELECT'; -KW_SERDEPROPERTIES : 'SERDEPROPERTIES'; -KW_SET : 'SET'; -KW_SEMI : 'SEMI'; -KW_SERVER : 'SERVER'; -KW_SHOW : 'SHOW'; -KW_SHUTDOWN : 'SHUTDOWN'; -KW_SOME : 'SOME'; -KW_STATS : 'STATS'; -KW_STRUCT : 'STRUCT'; -KW_STRAIGHT_JOIN : 'STRAIGHT_JOIN'; -KW_SUBSTRING : 'SUBSTRING'; -KW_SYSTEM : 'SYSTEM'; -KW_SYMBOL : 'SYMBOL'; -KW_SERIALIZE_FN : 'SERIALIZE_FN'; -KW_TABLE : 'TABLE'; -KW_TABLES : 'TABLES'; -KW_TABLESAMPLE : 'TABLESAMPLE'; -KW_TERMINATED : 'TERMINATED '; -KW_THEN : 'THEN'; -KW_TO : 'TO'; -KW_TRUE : 'TRUE'; -KW_TRY_CAST : 'TRY_CAST'; -KW_TRUNCATE : 'TRUNCATE'; -KW_UNCACHED : 'UNCACHED'; -KW_UESCAPE : 'UESCAPE'; -KW_UNBOUNDED : 'UNBOUNDED'; -KW_UNION : 'UNION'; -KW_UNNEST : 'UNNEST'; -KW_UNSET : 'UNSET'; -KW_USE : 'USE'; -KW_USER : 'USER'; -KW_USING : 'USING'; -KW_UPDATE_FN : 'UPDATE_FN'; -KW_UPSERT : 'UPSERT'; -KW_UNKNOWN : 'UNKNOWN'; -KW_URI : 'URI'; -KW_VALUE : 'VALUE'; -KW_VALUES : 'VALUES'; -KW_VIEW : 'VIEW'; -KW_VIEWS : 'VIEWS'; -KW_WHEN : 'WHEN'; -KW_WHERE : 'WHERE'; -KW_WITH : 'WITH'; -KW_YEAR : 'YEAR'; -KW_YEARS : 'YEARS'; -KW_TEXTFILE : 'TEXTFILE'; -KW_ORC : 'ORC'; -KW_AVRO : 'AVRO'; -KW_SEQUENCEFILE : 'SEQUENCEFILE'; -KW_RCFILE : 'RCFILE'; -KW_REFERENCES : 'REFERENCES'; -KW_NOVALIDATE : 'NOVALIDATE'; -KW_RELY : 'RELY'; +KW_ADD : 'ADD'; +KW_ALL : 'ALL'; +KW_ANALYTIC : 'ANALYTIC'; +KW_ALTER : 'ALTER'; +KW_AND : 'AND'; +KW_ANY : 'ANY'; +KW_ANTI : 'ANTI'; +KW_ARRAY : 'ARRAY'; +KW_AS : 'AS'; +KW_ASC : 'ASC'; +KW_AT : 'AT'; +KW_AGGREGATE : 'AGGREGATE'; +KW_AUTHORIZATION : 'AUTHORIZATION'; +KW_BERNOULLI : 'BERNOULLI'; +KW_BETWEEN : 'BETWEEN'; +KW_BLOCK_SIZE : 'BLOCK_SIZE'; +KW_PARTITIONED : 'PARTITIONED'; +KW_PREPARE_FN : 'PREPARE_FN'; +KW_EXTERNAL : 'EXTERNAL'; +KW_CLOSEFN : 'CLOSEFN'; +KW_SORT : 'SORT'; +KW_PURGE : 'PURGE'; +KW_STORED : 'STORED'; +KW_LOCATION : 'LOCATION'; +KW_TBLPROPERTIES : 'TBLPROPERTIES'; +KW_BY : 'BY'; +KW_CASCADE : 'CASCADE'; +KW_CASE : 'CASE'; +KW_CAST : 'CAST'; +KW_CACHED : 'CACHED'; +KW_CHANGE : 'CHANGE'; +KW_COLUMN : 'COLUMN'; +KW_COLUMNS : 'COLUMNS'; +KW_COMMENT : 'COMMENT'; +KW_COMPRESSION : 'COMPRESSION'; +KW_COMPUTE : 'COMPUTE'; +KW_CREATE : 'CREATE'; +KW_CROSS : 'CROSS'; +KW_CURRENT : 'CURRENT'; +KW_CURRENT_DATE : 'CURRENT_DATE'; +KW_CURRENT_PATH : 'CURRENT_PATH'; +KW_CURRENT_TIME : 'CURRENT_TIME'; +KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; +KW_CURRENT_USER : 'CURRENT_USER'; +KW_DATA : 'DATA'; +KW_DATABASE : 'DATABASE'; +KW_DATABASES : 'DATABASES'; +KW_DAY : 'DAY'; +KW_DAYS : 'DAYS'; +KW_DELETE : 'DELETE'; +KW_DEFAULT : 'DEFAULT'; +KW_DELIMITED : 'DELIMITED'; +KW_DISABLE : 'DISABLE'; +KW_UPDATE : 'UPDATE'; +KW_DESC : 'DESC'; +KW_DESCRIBE : 'DESCRIBE'; +KW_DISTINCT : 'DISTINCT'; +KW_DROP : 'DROP'; +KW_ELSE : 'ELSE'; +KW_ENCODING : 'ENCODING'; +KW_END : 'END'; +KW_ESCAPE : 'ESCAPE'; +KW_ESCAPED : 'ESCAPED'; +KW_EXCEPT : 'EXCEPT'; +KW_EXCLUDING : 'EXCLUDING'; +KW_EXISTS : 'EXISTS'; +KW_EXPLAIN : 'EXPLAIN'; +KW_EXTRACT : 'EXTRACT'; +KW_EXTENDED : 'EXTENDED'; +KW_FALSE : 'FALSE'; +KW_FIELDS : 'FIELDS'; +KW_FILEFORMAT : 'FILEFORMAT'; +KW_FILES : 'FILES'; +KW_FILTER : 'FILTER'; +KW_FIRST : 'FIRST'; +KW_FINALIZE_FN : 'FINALIZE_FN'; +KW_FOLLOWING : 'FOLLOWING'; +KW_FOR : 'FOR'; +KW_FORMAT : 'FORMAT'; +KW_FORMATTED : 'FORMATTED'; +KW_FOREIGN : 'FOREIGN'; +KW_FROM : 'FROM'; +KW_FULL : 'FULL'; +KW_FUNCTION : 'FUNCTION'; +KW_FUNCTIONS : 'FUNCTIONS'; +KW_GRANT : 'GRANT'; +KW_GROUP : 'GROUP'; +KW_GROUPING : 'GROUPING'; +KW_HASH : 'HASH'; +KW_HAVING : 'HAVING'; +KW_HOUR : 'HOUR'; +KW_HOURS : 'HOURS'; +KW_IF : 'IF'; +KW_IN : 'IN'; +KW_INCLUDING : 'INCLUDING'; +KW_INCREMENTAL : 'INCREMENTAL'; +KW_INNER : 'INNER'; +KW_INPATH : 'INPATH'; +KW_INSERT : 'INSERT'; +KW_INTERSECT : 'INTERSECT'; +KW_INTERVAL : 'INTERVAL'; +KW_INTERMEDIATE : 'INTERMEDIATE'; +KW_INTO : 'INTO'; +KW_INIT_FN : 'INIT_FN'; +KW_IREGEXP : 'IREGEXP'; +KW_ILIKE : 'ILIKE'; +KW_INVALIDATE : 'INVALIDATE'; +KW_IS : 'IS'; +KW_JOIN : 'JOIN'; +KW_KEY : 'KEY'; +KW_KUDU : 'KUDU'; +KW_LAST : 'LAST'; +KW_LATERAL : 'LATERAL'; +KW_LEFT : 'LEFT'; +KW_LIKE : 'LIKE'; +KW_LIMIT : 'LIMIT'; +KW_LINES : 'LINES'; +KW_LOAD : 'LOAD'; +KW_LOCALTIME : 'LOCALTIME'; +KW_LOCALTIMESTAMP : 'LOCALTIMESTAMP'; +KW_METADATA : 'METADATA'; +KW_MAP : 'MAP'; +KW_MINUTE : 'MINUTE'; +KW_MINUTES : 'MINUTES'; +KW_MONTH : 'MONTH'; +KW_MONTHS : 'MONTHS'; +KW_MERGE_FN : 'MERGE_FN'; +KW_NFC : 'NFC'; +KW_NFD : 'NFD'; +KW_NFKC : 'NFKC'; +KW_NFKD : 'NFKD'; +KW_NORMALIZE : 'NORMALIZE'; +KW_NOT : 'NOT'; +KW_NULL : 'NULL'; +KW_NULLS : 'NULLS'; +KW_OFFSET : 'OFFSET'; +KW_ON : 'ON'; +KW_OPTION : 'OPTION'; +KW_OR : 'OR'; +KW_ORDER : 'ORDER'; +KW_ORDINALITY : 'ORDINALITY'; +KW_OUTER : 'OUTER'; +KW_OWNER : 'OWNER'; +KW_OVER : 'OVER'; +KW_OVERWRITE : 'OVERWRITE'; +KW_PARTITION : 'PARTITION'; +KW_PARTITIONS : 'PARTITIONS'; +KW_PARQUET : 'PARQUET'; +KW_POSITION : 'POSITION'; +KW_PRECEDING : 'PRECEDING'; +KW_PRIMARY : 'PRIMARY'; +KW_REPLICATION : 'REPLICATION'; +KW_PRIVILEGES : 'PRIVILEGES'; +KW_PROPERTIES : 'PROPERTIES'; +KW_RANGE : 'RANGE'; +KW_RECOVER : 'RECOVER'; +KW_RENAME : 'RENAME'; +KW_REPEATABLE : 'REPEATABLE'; +KW_REPLACE : 'REPLACE'; +KW_RESTRICT : 'RESTRICT'; +KW_RETURNS : 'RETURNS'; +KW_REVOKE : 'REVOKE'; +KW_REFRESH : 'REFRESH'; +KW_REGEXP : 'REGEXP'; +KW_RLIKE : 'RLIKE'; +KW_RIGHT : 'RIGHT'; +KW_ROLE : 'ROLE'; +KW_ROLES : 'ROLES'; +KW_ROW : 'ROW'; +KW_ROWS : 'ROWS'; +KW_SCHEMA : 'SCHEMA'; +KW_SCHEMAS : 'SCHEMAS'; +KW_SECOND : 'SECOND'; +KW_SECONDS : 'SECONDS'; +KW_SELECT : 'SELECT'; +KW_SERDEPROPERTIES : 'SERDEPROPERTIES'; +KW_SET : 'SET'; +KW_SEMI : 'SEMI'; +KW_SERVER : 'SERVER'; +KW_SHOW : 'SHOW'; +KW_SHUTDOWN : 'SHUTDOWN'; +KW_SOME : 'SOME'; +KW_STATS : 'STATS'; +KW_STRUCT : 'STRUCT'; +KW_STRAIGHT_JOIN : 'STRAIGHT_JOIN'; +KW_SUBSTRING : 'SUBSTRING'; +KW_SYSTEM : 'SYSTEM'; +KW_SYMBOL : 'SYMBOL'; +KW_SERIALIZE_FN : 'SERIALIZE_FN'; +KW_TABLE : 'TABLE'; +KW_TABLES : 'TABLES'; +KW_TABLESAMPLE : 'TABLESAMPLE'; +KW_TERMINATED : 'TERMINATED '; +KW_THEN : 'THEN'; +KW_TO : 'TO'; +KW_TRUE : 'TRUE'; +KW_TRY_CAST : 'TRY_CAST'; +KW_TRUNCATE : 'TRUNCATE'; +KW_UNCACHED : 'UNCACHED'; +KW_UESCAPE : 'UESCAPE'; +KW_UNBOUNDED : 'UNBOUNDED'; +KW_UNION : 'UNION'; +KW_UNNEST : 'UNNEST'; +KW_UNSET : 'UNSET'; +KW_USE : 'USE'; +KW_USER : 'USER'; +KW_USING : 'USING'; +KW_UPDATE_FN : 'UPDATE_FN'; +KW_UPSERT : 'UPSERT'; +KW_UNKNOWN : 'UNKNOWN'; +KW_URI : 'URI'; +KW_VALUE : 'VALUE'; +KW_VALUES : 'VALUES'; +KW_VIEW : 'VIEW'; +KW_VIEWS : 'VIEWS'; +KW_WHEN : 'WHEN'; +KW_WHERE : 'WHERE'; +KW_WITH : 'WITH'; +KW_YEAR : 'YEAR'; +KW_YEARS : 'YEARS'; +KW_TEXTFILE : 'TEXTFILE'; +KW_ORC : 'ORC'; +KW_AVRO : 'AVRO'; +KW_SEQUENCEFILE : 'SEQUENCEFILE'; +KW_RCFILE : 'RCFILE'; +KW_REFERENCES : 'REFERENCES'; +KW_NOVALIDATE : 'NOVALIDATE'; +KW_RELY : 'RELY'; STATS_NUMDVS : '\'NUMDVS\''; STATS_NUMNULLS : '\'NUMNULLS\''; STATS_AVGSIZE : '\'AVGSIZE\''; STATS_MAXSIZE : '\'MAXSIZE\''; -EQ : '='; -NEQ : '<>' | '!='; -LT : '<'; -LTE : '<='; -GT : '>'; -GTE : '>='; -PLUS: '+'; -MINUS: '-'; -ASTERISK: '*'; -SLASH: '/'; -PERCENT: '%'; -CONCAT: '||'; +EQ : '='; +NEQ : '<>' | '!='; +LT : '<'; +LTE : '<='; +GT : '>'; +GTE : '>='; +PLUS : '+'; +MINUS : '-'; +ASTERISK : '*'; +SLASH : '/'; +PERCENT : '%'; +CONCAT : '||'; -DOT : '.'; -SEMICOLON: ';'; -COMMA: ','; -COLON : ':' ; -LPAREN : '(' ; -RPAREN : ')' ; -LSQUARE : '[' ; -RSQUARE : ']' ; -LCURLY : '{'; -RCURLY : '}'; +DOT : '.'; +SEMICOLON : ';'; +COMMA : ','; +COLON : ':'; +LPAREN : '('; +RPAREN : ')'; +LSQUARE : '['; +RSQUARE : ']'; +LCURLY : '{'; +RCURLY : '}'; BITWISEOR : '|'; -QUESTION : '?'; +QUESTION : '?'; -RIGHT_ARROW : '->'; +RIGHT_ARROW: '->'; -STRING - : '\'' ( ~'\'' | '\'\'' )* '\'' - | '"' ( ~'"' | '""' )* '"' - ; +STRING: '\'' ( ~'\'' | '\'\'')* '\'' | '"' ( ~'"' | '""')* '"'; -UNICODE_STRING - : 'U&\'' ( ~'\'' | '\'\'' )* '\'' - ; +UNICODE_STRING: 'U&\'' ( ~'\'' | '\'\'')* '\''; // Note: we allow any character inside the binary literal and validate // its a correct literal when the AST is being constructed. This // allows us to provide more meaningful error messages to the user -BINARY_LITERAL - : 'X\'' (~'\'')* '\'' - ; +BINARY_LITERAL: 'X\'' (~'\'')* '\''; -INTEGER_VALUE - : DIGIT+ - ; +INTEGER_VALUE: DIGIT+; -DECIMAL_VALUE - : DIGIT+ '.' DIGIT* - | '.' DIGIT+ - ; +DECIMAL_VALUE: DIGIT+ '.' DIGIT* | '.' DIGIT+; -DOUBLE_VALUE - : DIGIT+ ('.' DIGIT*)? EXPONENT - | '.' DIGIT+ EXPONENT - ; +DOUBLE_VALUE: DIGIT+ ('.' DIGIT*)? EXPONENT | '.' DIGIT+ EXPONENT; -IDENTIFIER - : (LETTER | '_') (LETTER | DIGIT | '_' | '@' | ':')* - ; +IDENTIFIER: (LETTER | '_') (LETTER | DIGIT | '_' | '@' | ':')*; -DIGIT_IDENTIFIER - : DIGIT (LETTER | DIGIT | '_' | '@' | ':')+ - ; +DIGIT_IDENTIFIER: DIGIT (LETTER | DIGIT | '_' | '@' | ':')+; -QUOTED_IDENTIFIER - : '"' ( ~'"' | '""' )* '"' - ; +QUOTED_IDENTIFIER: '"' ( ~'"' | '""')* '"'; -BACKQUOTED_IDENTIFIER - : '`' ( ~'`' | '``' )* '`' - ; +BACKQUOTED_IDENTIFIER: '`' ( ~'`' | '``')* '`'; -TIME_WITH_TIME_ZONE - : 'TIME' WS 'WITH' WS 'TIME' WS 'ZONE' - ; +TIME_WITH_TIME_ZONE: 'TIME' WS 'WITH' WS 'TIME' WS 'ZONE'; -TIMESTAMP_WITH_TIME_ZONE - : 'TIMESTAMP' WS 'WITH' WS 'TIME' WS 'ZONE' - ; +TIMESTAMP_WITH_TIME_ZONE: 'TIMESTAMP' WS 'WITH' WS 'TIME' WS 'ZONE'; -DOUBLE_PRECISION - : 'DOUBLE' WS 'PRECISION' - ; +DOUBLE_PRECISION: 'DOUBLE' WS 'PRECISION'; -fragment EXPONENT - : 'E' [+-]? DIGIT+ - ; +fragment EXPONENT: 'E' [+-]? DIGIT+; -fragment DIGIT - : [0-9] - ; +fragment DIGIT: [0-9]; -fragment LETTER - : [A-Z] - ; +fragment LETTER: [A-Z]; -SIMPLE_COMMENT - : '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN) - ; +SIMPLE_COMMENT: '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN); -BRACKETED_COMMENT - : '/*' .*? '*/' -> channel(HIDDEN) - ; +BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN); -WS - : [ \r\n\t]+ -> channel(HIDDEN) - ; +WS: [ \r\n\t]+ -> channel(HIDDEN); \ No newline at end of file diff --git a/src/grammar/impala/ImpalaSqlParser.g4 b/src/grammar/impala/ImpalaSqlParser.g4 index f939fa0..39124d7 100644 --- a/src/grammar/impala/ImpalaSqlParser.g4 +++ b/src/grammar/impala/ImpalaSqlParser.g4 @@ -12,6 +12,10 @@ * limitations under the License. */ +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging +// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true + parser grammar ImpalaSqlParser; options @@ -19,7 +23,9 @@ options tokenVocab=ImpalaSqlLexer; } -program: singleStatement* EOF; +program + : singleStatement* EOF + ; singleStatement : sqlStatement SEMICOLON? @@ -50,7 +56,9 @@ sqlStatement | refreshStatement ; -useStatement: KW_USE databaseNamePath; +useStatement + : KW_USE databaseNamePath + ; createStatement : createSchema @@ -64,59 +72,56 @@ createStatement ; createTableSelect - : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate - (LPAREN columnDefinition (COMMA columnDefinition)* (COMMA constraintSpecification)? RPAREN)? - (KW_PARTITIONED KW_BY (partitionedBy | createColumnAliases) )? - createCommonItem - (KW_AS queryStatement)? + : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate ( + LPAREN columnDefinition (COMMA columnDefinition)* (COMMA constraintSpecification)? RPAREN + )? (KW_PARTITIONED KW_BY (partitionedBy | createColumnAliases))? createCommonItem ( + KW_AS queryStatement + )? ; createTableLike - : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate - KW_LIKE (tableNamePath | KW_PARQUET parquet=stringLiteral) - (KW_PARTITIONED KW_BY partitionedBy)? - createCommonItem + : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate KW_LIKE ( + tableNamePath + | KW_PARQUET parquet=stringLiteral + ) (KW_PARTITIONED KW_BY partitionedBy)? createCommonItem ; createKuduTableAsSelect - : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate - (LPAREN kuduTableElement (COMMA kuduTableElement)* (COMMA KW_PRIMARY KW_KEY columnAliases)? RPAREN)? - (KW_PRIMARY KW_KEY columnAliases?)? - (KW_PARTITION KW_BY kuduPartitionClause)? - (KW_COMMENT stringLiteral)? - KW_STORED KW_AS KW_KUDU - (KW_TBLPROPERTIES tblProp=properties)? - (KW_AS queryStatement)? + : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate ( + LPAREN kuduTableElement (COMMA kuduTableElement)* (COMMA KW_PRIMARY KW_KEY columnAliases)? RPAREN + )? (KW_PRIMARY KW_KEY columnAliases?)? (KW_PARTITION KW_BY kuduPartitionClause)? ( + KW_COMMENT stringLiteral + )? KW_STORED KW_AS KW_KUDU (KW_TBLPROPERTIES tblProp=properties)? (KW_AS queryStatement)? ; -createView: KW_CREATE KW_VIEW ifNotExists? viewNameCreate viewColumns? (KW_COMMENT stringLiteral)? (KW_TBLPROPERTIES tblProp=properties)? KW_AS queryStatement; - -createSchema: - KW_CREATE (KW_SCHEMA | KW_DATABASE) ifNotExists? databaseNameCreate - (KW_COMMENT comment=stringLiteral)? (KW_LOCATION location=stringLiteral)? +createView + : KW_CREATE KW_VIEW ifNotExists? viewNameCreate viewColumns? (KW_COMMENT stringLiteral)? ( + KW_TBLPROPERTIES tblProp=properties + )? KW_AS queryStatement ; -createRole: KW_CREATE KW_ROLE name=identifier; +createSchema + : KW_CREATE (KW_SCHEMA | KW_DATABASE) ifNotExists? databaseNameCreate ( + KW_COMMENT comment=stringLiteral + )? (KW_LOCATION location=stringLiteral)? + ; + +createRole + : KW_CREATE KW_ROLE name=identifier + ; createAggregateFunction - : KW_CREATE KW_AGGREGATE? KW_FUNCTION ifNotExists? functionNameCreate (LPAREN(type (COMMA type)*)? RPAREN)? - KW_RETURNS type - (KW_INTERMEDIATE type)? - KW_LOCATION STRING - (KW_INIT_FN EQ STRING)? - KW_UPDATE_FN EQ STRING - KW_MERGE_FN EQ STRING - (KW_PREPARE_FN EQ STRING)? - (KW_CLOSEFN EQ STRING)? - (KW_SERIALIZE_FN EQ STRING)? - (KW_FINALIZE_FN EQ STRING)? + : KW_CREATE KW_AGGREGATE? KW_FUNCTION ifNotExists? functionNameCreate ( + LPAREN (type (COMMA type)*)? RPAREN + )? KW_RETURNS type (KW_INTERMEDIATE type)? KW_LOCATION STRING (KW_INIT_FN EQ STRING)? KW_UPDATE_FN EQ STRING KW_MERGE_FN EQ STRING ( + KW_PREPARE_FN EQ STRING + )? (KW_CLOSEFN EQ STRING)? (KW_SERIALIZE_FN EQ STRING)? (KW_FINALIZE_FN EQ STRING)? ; createFunction - : KW_CREATE KW_FUNCTION ifNotExists? functionNameCreate (LPAREN(type (COMMA type)*)? RPAREN)? - (KW_RETURNS type)? - KW_LOCATION STRING - KW_SYMBOL EQ symbol=stringLiteral + : KW_CREATE KW_FUNCTION ifNotExists? functionNameCreate (LPAREN (type (COMMA type)*)? RPAREN)? ( + KW_RETURNS type + )? KW_LOCATION STRING KW_SYMBOL EQ symbol=stringLiteral ; alterStatement @@ -140,54 +145,122 @@ alterStatement | alterTableOwner ; -alterDatabase: KW_ALTER KW_DATABASE databaseNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) identifier; +alterDatabase + : KW_ALTER KW_DATABASE databaseNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) identifier + ; -alterStatsKey: KW_ALTER KW_TABLE tableNamePath KW_SET KW_COLUMN KW_STATS columnNamePath LPAREN statsKey EQ stringLiteral (COMMA statsKey EQ stringLiteral)? RPAREN; +alterStatsKey + : KW_ALTER KW_TABLE tableNamePath KW_SET KW_COLUMN KW_STATS columnNamePath LPAREN statsKey EQ stringLiteral ( + COMMA statsKey EQ stringLiteral + )? RPAREN + ; -alterPartitionCache: KW_ALTER KW_TABLE tableNamePath (KW_PARTITION expression)? KW_SET ((KW_CACHED KW_IN stringLiteral (KW_WITH KW_REPLICATION EQ number)?) | KW_UNCACHED); +alterPartitionCache + : KW_ALTER KW_TABLE tableNamePath (KW_PARTITION expression)? KW_SET ( + (KW_CACHED KW_IN stringLiteral (KW_WITH KW_REPLICATION EQ number)?) + | KW_UNCACHED + ) + ; -changeColumnDefine: KW_ALTER KW_TABLE tableNamePath KW_CHANGE KW_COLUMN columnSpecWithKudu; +changeColumnDefine + : KW_ALTER KW_TABLE tableNamePath KW_CHANGE KW_COLUMN columnSpecWithKudu + ; -alterDropSingleColumn: KW_ALTER KW_TABLE tableNamePath KW_DROP (KW_COLUMN)? columnNamePath; +alterDropSingleColumn + : KW_ALTER KW_TABLE tableNamePath KW_DROP (KW_COLUMN)? columnNamePath + ; -alterTableOwner: KW_ALTER KW_TABLE tableNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) identifier; +alterTableOwner + : KW_ALTER KW_TABLE tableNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) identifier + ; -replaceOrAddColumns: KW_ALTER KW_TABLE tableNamePath (KW_REPLACE | KW_ADD ifNotExists?) KW_COLUMNS LPAREN columnSpecWithKudu (COMMA columnSpecWithKudu)*? RPAREN; +replaceOrAddColumns + : KW_ALTER KW_TABLE tableNamePath (KW_REPLACE | KW_ADD ifNotExists?) KW_COLUMNS LPAREN columnSpecWithKudu ( + COMMA columnSpecWithKudu + )*? RPAREN + ; -addSingleColumn: KW_ALTER KW_TABLE tableNamePath KW_ADD KW_COLUMN ifNotExists? createColumnSpecWithKudu; +addSingleColumn + : KW_ALTER KW_TABLE tableNamePath KW_ADD KW_COLUMN ifNotExists? createColumnSpecWithKudu + ; -alterTableNonKuduOrKuduOnly: KW_ALTER KW_TABLE tableNamePath KW_ALTER (KW_COLUMN)? columnNamePath (KW_SET (kuduStorageAttr | KW_COMMENT stringLiteral ) | KW_DROP KW_DEFAULT); +alterTableNonKuduOrKuduOnly + : KW_ALTER KW_TABLE tableNamePath KW_ALTER (KW_COLUMN)? columnNamePath ( + KW_SET (kuduStorageAttr | KW_COMMENT stringLiteral) + | KW_DROP KW_DEFAULT + ) + ; -addPartitionByRangeOrValue: KW_ALTER KW_TABLE tableNamePath KW_ADD ifNotExists? (KW_PARTITION expression (KW_LOCATION stringLiteral)? (cacheSpec)? | KW_RANGE KW_PARTITION kuduPartitionSpec); +addPartitionByRangeOrValue + : KW_ALTER KW_TABLE tableNamePath KW_ADD ifNotExists? ( + KW_PARTITION expression (KW_LOCATION stringLiteral)? (cacheSpec)? + | KW_RANGE KW_PARTITION kuduPartitionSpec + ) + ; -alterFormat: KW_ALTER KW_TABLE tableNamePath (KW_PARTITION expression)? KW_SET ((KW_FILEFORMAT fileFormat) | (KW_ROW KW_FORMAT rowFormat) | (KW_LOCATION stringLiteral) | (KW_TBLPROPERTIES tblProp=properties) | (KW_SERDEPROPERTIES tblProp=properties)); +alterFormat + : KW_ALTER KW_TABLE tableNamePath (KW_PARTITION expression)? KW_SET ( + (KW_FILEFORMAT fileFormat) + | (KW_ROW KW_FORMAT rowFormat) + | (KW_LOCATION stringLiteral) + | (KW_TBLPROPERTIES tblProp=properties) + | (KW_SERDEPROPERTIES tblProp=properties) + ) + ; -recoverPartitions: KW_ALTER KW_TABLE tableNamePath KW_RECOVER KW_PARTITIONS; +recoverPartitions + : KW_ALTER KW_TABLE tableNamePath KW_RECOVER KW_PARTITIONS + ; -dropPartitionByRangeOrValue: KW_ALTER KW_TABLE tableNamePath KW_DROP ifExists? (KW_PARTITION expression KW_PURGE? | KW_RANGE KW_PARTITION kuduPartitionSpec); +dropPartitionByRangeOrValue + : KW_ALTER KW_TABLE tableNamePath KW_DROP ifExists? ( + KW_PARTITION expression KW_PURGE? + | KW_RANGE KW_PARTITION kuduPartitionSpec + ) + ; -alterView: KW_ALTER KW_VIEW viewNamePath viewColumns? KW_AS queryStatement; +alterView + : KW_ALTER KW_VIEW viewNamePath viewColumns? KW_AS queryStatement + ; -renameView: KW_ALTER KW_VIEW viewNamePath KW_RENAME KW_TO viewNamePath; +renameView + : KW_ALTER KW_VIEW viewNamePath KW_RENAME KW_TO viewNamePath + ; -alterViewOwner: KW_ALTER KW_VIEW viewNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) qualifiedName; +alterViewOwner + : KW_ALTER KW_VIEW viewNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) qualifiedName + ; -renameTable: KW_ALTER KW_TABLE tableNamePath KW_RENAME KW_TO tableNamePath; +renameTable + : KW_ALTER KW_TABLE tableNamePath KW_RENAME KW_TO tableNamePath + ; -alterUnSetOrSetViewTblproperties: KW_ALTER KW_VIEW viewNamePath (KW_UNSET | KW_SET) KW_TBLPROPERTIES tblProp=properties; +alterUnSetOrSetViewTblproperties + : KW_ALTER KW_VIEW viewNamePath (KW_UNSET | KW_SET) KW_TBLPROPERTIES tblProp=properties + ; -truncateTableStatement: KW_TRUNCATE KW_TABLE? ifExists? tableNamePath; +truncateTableStatement + : KW_TRUNCATE KW_TABLE? ifExists? tableNamePath + ; -describeStatement: KW_DESCRIBE KW_DATABASE? (KW_FORMATTED | KW_EXTENDED)? qualifiedName; +describeStatement + : KW_DESCRIBE KW_DATABASE? (KW_FORMATTED | KW_EXTENDED)? qualifiedName + ; computeStatement : computeStats | computeIncrementalStats ; -computeStats: KW_COMPUTE KW_STATS tableNamePath (columnAliases)? (KW_TABLESAMPLE KW_SYSTEM LPAREN number RPAREN (KW_REPEATABLE LPAREN number RPAREN)?)?; +computeStats + : KW_COMPUTE KW_STATS tableNamePath (columnAliases)? ( + KW_TABLESAMPLE KW_SYSTEM LPAREN number RPAREN (KW_REPEATABLE LPAREN number RPAREN)? + )? + ; -computeIncrementalStats: KW_COMPUTE KW_INCREMENTAL KW_STATS tableNamePath (KW_PARTITION expression)?; +computeIncrementalStats + : KW_COMPUTE KW_INCREMENTAL KW_STATS tableNamePath (KW_PARTITION expression)? + ; dropStatement : dropRole @@ -198,41 +271,65 @@ dropStatement | dropSchema ; -dropSchema: KW_DROP (KW_SCHEMA | KW_DATABASE) (ifExists)? databaseNamePath (KW_CASCADE | KW_RESTRICT)?; +dropSchema + : KW_DROP (KW_SCHEMA | KW_DATABASE) (ifExists)? databaseNamePath (KW_CASCADE | KW_RESTRICT)? + ; -dropView: KW_DROP KW_VIEW ifExists? viewNamePath; +dropView + : KW_DROP KW_VIEW ifExists? viewNamePath + ; -dropTable: KW_DROP KW_TABLE ifExists? tableNamePath KW_PURGE?; +dropTable + : KW_DROP KW_TABLE ifExists? tableNamePath KW_PURGE? + ; -dropIncrementalStats: KW_DROP KW_INCREMENTAL? KW_STATS tableNamePath (KW_PARTITION expression)?; +dropIncrementalStats + : KW_DROP KW_INCREMENTAL? KW_STATS tableNamePath (KW_PARTITION expression)? + ; -dropFunction: KW_DROP KW_AGGREGATE? KW_FUNCTION ifExists? functionNamePath (LPAREN(type (COMMA type)*)? RPAREN)?; +dropFunction + : KW_DROP KW_AGGREGATE? KW_FUNCTION ifExists? functionNamePath ( + LPAREN (type (COMMA type)*)? RPAREN + )? + ; -dropRole: KW_DROP KW_ROLE name=identifier; +dropRole + : KW_DROP KW_ROLE name=identifier + ; grantStatement : grantRole | grant ; -grantRole: KW_GRANT KW_ROLE identifier KW_TO KW_GROUP identifier; +grantRole + : KW_GRANT KW_ROLE identifier KW_TO KW_GROUP identifier + ; -grant: KW_GRANT privilege KW_ON objectType (qualifiedName)? KW_TO grantee=principal; +grant + : KW_GRANT privilege KW_ON objectType (qualifiedName)? KW_TO grantee=principal + ; revokeStatement : revokeRole | revoke ; -revokeRole: KW_REVOKE KW_ROLE identifier KW_FROM KW_GROUP identifier; +revokeRole + : KW_REVOKE KW_ROLE identifier KW_FROM KW_GROUP identifier + ; -revoke: KW_REVOKE (KW_GRANT KW_OPTION KW_FOR)? privilege KW_ON objectType (qualifiedName)? KW_FROM (grantee=principal | (KW_ROLE)? identifier); +revoke + : KW_REVOKE (KW_GRANT KW_OPTION KW_FOR)? privilege KW_ON objectType (qualifiedName)? KW_FROM ( + grantee=principal + | (KW_ROLE)? identifier + ) + ; insertStatement - : with? KW_INSERT (KW_INTO | KW_OVERWRITE) KW_TABLE? tableNamePath - columnAliases? - (KW_PARTITION LPAREN expression(COMMA expression)*RPAREN)? - queryStatement + : with? KW_INSERT (KW_INTO | KW_OVERWRITE) KW_TABLE? tableNamePath columnAliases? ( + KW_PARTITION LPAREN expression (COMMA expression)* RPAREN + )? queryStatement ; deleteStatement @@ -240,13 +337,25 @@ deleteStatement | deleteTableRef ; -delete: KW_DELETE KW_FROM? tableNamePath (KW_WHERE booleanExpression)?; +delete + : KW_DELETE KW_FROM? tableNamePath (KW_WHERE booleanExpression)? + ; -deleteTableRef: KW_DELETE tableNamePath (KW_AS? identifier)? KW_FROM (relation (COMMA relation)*)? (KW_WHERE booleanExpression)?; +deleteTableRef + : KW_DELETE tableNamePath (KW_AS? identifier)? KW_FROM (relation (COMMA relation)*)? ( + KW_WHERE booleanExpression + )? + ; -updateStatement: KW_UPDATE tableNamePath KW_SET assignmentList (KW_FROM relation (COMMA relation)*)? (KW_WHERE booleanExpression)?; +updateStatement + : KW_UPDATE tableNamePath KW_SET assignmentList (KW_FROM relation (COMMA relation)*)? ( + KW_WHERE booleanExpression + )? + ; -upsertStatement: KW_UPSERT KW_INTO KW_TABLE? tableNamePath columnAliases? queryStatement; +upsertStatement + : KW_UPSERT KW_INTO KW_TABLE? tableNamePath columnAliases? queryStatement + ; showStatement : showRoles @@ -264,59 +373,80 @@ showStatement ; showSchemas - : KW_SHOW (KW_SCHEMAS | KW_DATABASES) - (KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*)? + : KW_SHOW (KW_SCHEMAS | KW_DATABASES) ( + KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)* + )? ; showTables - : - KW_SHOW KW_TABLES (KW_IN tableNamePath)? - (KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*)? + : KW_SHOW KW_TABLES (KW_IN tableNamePath)? ( + KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)* + )? ; showFunctions - : - KW_SHOW (KW_AGGREGATE | KW_ANALYTIC)? KW_FUNCTIONS (KW_IN databaseNamePath)? - (KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*)? + : KW_SHOW (KW_AGGREGATE | KW_ANALYTIC)? KW_FUNCTIONS (KW_IN databaseNamePath)? ( + KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)* + )? ; -showCreateTable: KW_SHOW KW_CREATE KW_TABLE tableNamePath; +showCreateTable + : KW_SHOW KW_CREATE KW_TABLE tableNamePath + ; -showCreateView: KW_SHOW KW_CREATE KW_VIEW viewNamePath; +showCreateView + : KW_SHOW KW_CREATE KW_VIEW viewNamePath + ; -showTableStats: KW_SHOW KW_TABLE KW_STATS tableNamePath; +showTableStats + : KW_SHOW KW_TABLE KW_STATS tableNamePath + ; -showColumnStats: KW_SHOW KW_COLUMN KW_STATS tableNamePath; +showColumnStats + : KW_SHOW KW_COLUMN KW_STATS tableNamePath + ; -showPartitions: KW_SHOW (KW_RANGE)? KW_PARTITIONS tableNamePath; +showPartitions + : KW_SHOW (KW_RANGE)? KW_PARTITIONS tableNamePath + ; -showFiles: KW_SHOW KW_FILES KW_IN tableNamePath (KW_PARTITION LPAREN expression (COMMA expression)?RPAREN)?; +showFiles + : KW_SHOW KW_FILES KW_IN tableNamePath ( + KW_PARTITION LPAREN expression (COMMA expression)? RPAREN + )? + ; -showRoles: KW_SHOW (KW_CURRENT)? KW_ROLES; +showRoles + : KW_SHOW (KW_CURRENT)? KW_ROLES + ; -showRoleGrant: KW_SHOW KW_ROLE KW_GRANT KW_GROUP identifier; +showRoleGrant + : KW_SHOW KW_ROLE KW_GRANT KW_GROUP identifier + ; showGrants : showDatabaseGrant | showTableGrant | showColumnGrant - | KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier - (KW_ON (KW_SERVER | KW_URI) (qualifiedName)?)? + | KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier ( + KW_ON (KW_SERVER | KW_URI) (qualifiedName)? + )? ; -showDatabaseGrant: - KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier - (KW_ON KW_DATABASE (databaseNamePath)?)? +showDatabaseGrant + : KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier ( + KW_ON KW_DATABASE (databaseNamePath)? + )? ; -showTableGrant: - KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier - (KW_ON KW_TABLE (tableNamePath)?)? +showTableGrant + : KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (KW_ON KW_TABLE (tableNamePath)?)? ; -showColumnGrant: - KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier - (KW_ON KW_COLUMN (columnNamePath)?)? +showColumnGrant + : KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier ( + KW_ON KW_COLUMN (columnNamePath)? + )? ; addCommentStatement @@ -325,32 +455,57 @@ addCommentStatement | addColumnComments ; -addDatabaseComments: KW_COMMENT KW_ON KW_DATABASE databaseNamePath KW_IS (stringLiteral | KW_NULL); - -addTableComments: KW_COMMENT KW_ON KW_TABLE tableNamePath KW_IS (stringLiteral | KW_NULL); - -addColumnComments: KW_COMMENT KW_ON KW_COLUMN columnNamePath KW_IS (stringLiteral | KW_NULL); - -explainStatement: KW_EXPLAIN sqlStatement; - -setStatement: KW_SET (KW_ALL | identifier EQ expression)?; - -shutdownStatement: COLON KW_SHUTDOWN LPAREN (stringLiteral? | stringLiteral (COMMA expression)? | expression) RPAREN; - -invalidateMetaStatement: KW_INVALIDATE KW_METADATA tableNamePath; - -loadDataStatement: - KW_LOAD KW_DATA KW_INPATH STRING (KW_OVERWRITE)? KW_INTO KW_TABLE tableNamePath - (KW_PARTITION LPAREN expression (COMMA expression)?RPAREN)? +addDatabaseComments + : KW_COMMENT KW_ON KW_DATABASE databaseNamePath KW_IS (stringLiteral | KW_NULL) ; -refreshStatement: refreshMeta | refreshAuth | refreshFunction; +addTableComments + : KW_COMMENT KW_ON KW_TABLE tableNamePath KW_IS (stringLiteral | KW_NULL) + ; -refreshMeta: KW_REFRESH tableNamePath (KW_PARTITION LPAREN expression (COMMA expression)*? RPAREN)?; +addColumnComments + : KW_COMMENT KW_ON KW_COLUMN columnNamePath KW_IS (stringLiteral | KW_NULL) + ; -refreshAuth: KW_REFRESH KW_AUTHORIZATION; +explainStatement + : KW_EXPLAIN sqlStatement + ; -refreshFunction: KW_REFRESH KW_FUNCTIONS functionNamePath; +setStatement + : KW_SET (KW_ALL | identifier EQ expression)? + ; + +shutdownStatement + : COLON KW_SHUTDOWN LPAREN (stringLiteral? | stringLiteral (COMMA expression)? | expression) RPAREN + ; + +invalidateMetaStatement + : KW_INVALIDATE KW_METADATA tableNamePath + ; + +loadDataStatement + : KW_LOAD KW_DATA KW_INPATH STRING (KW_OVERWRITE)? KW_INTO KW_TABLE tableNamePath ( + KW_PARTITION LPAREN expression (COMMA expression)? RPAREN + )? + ; + +refreshStatement + : refreshMeta + | refreshAuth + | refreshFunction + ; + +refreshMeta + : KW_REFRESH tableNamePath (KW_PARTITION LPAREN expression (COMMA expression)*? RPAREN)? + ; + +refreshAuth + : KW_REFRESH KW_AUTHORIZATION + ; + +refreshFunction + : KW_REFRESH KW_FUNCTIONS functionNamePath + ; ifExists : KW_IF KW_EXISTS @@ -360,54 +515,79 @@ ifNotExists : KW_IF KW_NOT KW_EXISTS ; -tableNameCreate: qualifiedName; +tableNameCreate + : qualifiedName + ; -databaseNameCreate: qualifiedName; +databaseNameCreate + : qualifiedName + ; -viewNameCreate: qualifiedName; +viewNameCreate + : qualifiedName + ; -functionNameCreate: qualifiedName; +functionNameCreate + : qualifiedName + ; -columnNamePathCreate: qualifiedName; +columnNamePathCreate + : qualifiedName + ; -databaseNamePath: qualifiedName; +databaseNamePath + : qualifiedName + ; -tableNamePath: identifier (DOT identifier)*; +tableNamePath + : identifier (DOT identifier)* + ; -viewNamePath: identifier (DOT identifier)*; +viewNamePath + : identifier (DOT identifier)* + ; -functionNamePath: reservedKeywordsUsedAsFuncName | qualifiedName; +functionNamePath + : reservedKeywordsUsedAsFuncName + | qualifiedName + ; -columnNamePath: qualifiedName; +columnNamePath + : qualifiedName + ; -tableOrViewPath: tableNamePath | viewNamePath; +tableOrViewPath + : tableNamePath + | viewNamePath + ; createCommonItem - : - (KW_SORT KW_BY columnAliases)? - (KW_COMMENT comment=stringLiteral)? - (KW_ROW KW_FORMAT rowFormat)? - (KW_WITH KW_SERDEPROPERTIES serdProp=properties)? - (KW_STORED KW_AS fileFormat)? - (KW_LOCATION location=stringLiteral)? - (KW_CACHED KW_IN cacheName=qualifiedName (KW_WITH KW_REPLICATION EQ INTEGER_VALUE )? | KW_UNCACHED)? - (KW_TBLPROPERTIES tblProp=properties)? + : (KW_SORT KW_BY columnAliases)? (KW_COMMENT comment=stringLiteral)? ( + KW_ROW KW_FORMAT rowFormat + )? (KW_WITH KW_SERDEPROPERTIES serdProp=properties)? (KW_STORED KW_AS fileFormat)? ( + KW_LOCATION location=stringLiteral + )? ( + KW_CACHED KW_IN cacheName=qualifiedName (KW_WITH KW_REPLICATION EQ INTEGER_VALUE)? + | KW_UNCACHED + )? (KW_TBLPROPERTIES tblProp=properties)? ; assignmentList - : assignmentItem (COMMA assignmentItem)* + : assignmentItem (COMMA assignmentItem)* ; assignmentItem - : qualifiedName EQ expression + : qualifiedName EQ expression ; viewColumns - : LPAREN columnNamePath (KW_COMMENT stringLiteral)? (COMMA identifier (KW_COMMENT stringLiteral)?)* RPAREN + : LPAREN columnNamePath (KW_COMMENT stringLiteral)? ( + COMMA identifier (KW_COMMENT stringLiteral)? + )* RPAREN ; queryStatement - : with? queryNoWith + : with? queryNoWith ; with @@ -415,13 +595,18 @@ with ; constraintSpecification - : - KW_PRIMARY KW_KEY columnAliases (KW_DISABLE)? (KW_NOVALIDATE | COMMA KW_NOVALIDATE)? (KW_RELY | COMMA KW_RELY)? ((COMMA foreignKeySpecification | foreignKeySpecification) (COMMA foreignKeySpecification)*?)? + : KW_PRIMARY KW_KEY columnAliases (KW_DISABLE)? (KW_NOVALIDATE | COMMA KW_NOVALIDATE)? ( + KW_RELY + | COMMA KW_RELY + )? ( + (COMMA foreignKeySpecification | foreignKeySpecification) (COMMA foreignKeySpecification)*? + )? ; foreignKeySpecification - : - KW_FOREIGN KW_KEY columnAliases KW_REFERENCES tableNamePath columnAliases (KW_DISABLE)? (KW_NOVALIDATE)? (KW_RELY)? + : KW_FOREIGN KW_KEY columnAliases KW_REFERENCES tableNamePath columnAliases (KW_DISABLE)? ( + KW_NOVALIDATE + )? (KW_RELY)? ; columnDefinition @@ -433,7 +618,9 @@ kuduTableElement ; kuduColumnDefinition - : columnNamePathCreate type (kuduAttributes kuduAttributes*?)? (KW_COMMENT stringLiteral)? (KW_PRIMARY KW_KEY )? + : columnNamePathCreate type (kuduAttributes kuduAttributes*?)? (KW_COMMENT stringLiteral)? ( + KW_PRIMARY KW_KEY + )? ; columnSpecWithKudu @@ -456,10 +643,10 @@ kuduStorageAttr ; statsKey - : STATS_NUMDVS - | STATS_NUMNULLS - | STATS_AVGSIZE - | STATS_MAXSIZE + : STATS_NUMDVS + | STATS_NUMNULLS + | STATS_AVGSIZE + | STATS_MAXSIZE ; fileFormat @@ -472,7 +659,8 @@ fileFormat ; kuduPartitionClause - : (hashClause (COMMA hashClause)*? (COMMA rangeClause)?) | rangeClause + : (hashClause (COMMA hashClause)*? (COMMA rangeClause)?) + | rangeClause ; hashClause @@ -480,11 +668,14 @@ hashClause ; rangeClause - : KW_RANGE columnAliases? LPAREN (KW_PARTITION kuduPartitionSpec (COMMA KW_PARTITION kuduPartitionSpec)*?) RPAREN + : KW_RANGE columnAliases? LPAREN ( + KW_PARTITION kuduPartitionSpec (COMMA KW_PARTITION kuduPartitionSpec)*? + ) RPAREN ; kuduPartitionSpec - : KW_VALUE partitionCol expression | (expression rangeOperator)? KW_VALUES (rangeOperator expression)? + : KW_VALUE partitionCol expression + | (expression rangeOperator)? KW_VALUES (rangeOperator expression)? ; cacheSpec @@ -528,30 +719,32 @@ sortedBy ; rowFormat - : KW_DELIMITED (KW_FIELDS KW_TERMINATED KW_BY stringLiteral (KW_ESCAPED KW_BY stringLiteral)?)? (KW_LINES KW_TERMINATED KW_BY stringLiteral)? + : KW_DELIMITED (KW_FIELDS KW_TERMINATED KW_BY stringLiteral (KW_ESCAPED KW_BY stringLiteral)?)? ( + KW_LINES KW_TERMINATED KW_BY stringLiteral + )? ; property : identifier (EQ expression)? ; -queryNoWith: - queryTerm - (KW_ORDER KW_BY sortItem (COMMA sortItem)*)? - (KW_LIMIT rows=expression (KW_OFFSET offset=INTEGER_VALUE )?)? +queryNoWith + : queryTerm (KW_ORDER KW_BY sortItem (COMMA sortItem)*)? ( + KW_LIMIT rows=expression (KW_OFFSET offset=INTEGER_VALUE)? + )? ; queryTerm - : queryPrimary #queryTermDefault - | left=queryTerm operator=KW_INTERSECT setQuantifier? right=queryTerm #setOperation - | left=queryTerm operator=(KW_UNION | KW_EXCEPT) setQuantifier? right=queryTerm #setOperation + : queryPrimary # queryTermDefault + | left=queryTerm operator=KW_INTERSECT setQuantifier? right=queryTerm # setOperation + | left=queryTerm operator=(KW_UNION | KW_EXCEPT) setQuantifier? right=queryTerm # setOperation ; queryPrimary - : querySpecification #queryPrimaryDefault - | KW_TABLE tableNamePath #table - | KW_VALUES expression (COMMA expression)* #inlineTable - | LPAREN queryNoWith RPAREN #subquery + : querySpecification # queryPrimaryDefault + | KW_TABLE tableNamePath # table + | KW_VALUES expression (COMMA expression)* # inlineTable + | LPAREN queryNoWith RPAREN # subquery ; sortItem @@ -559,11 +752,11 @@ sortItem ; querySpecification - : KW_SELECT setQuantifier? (KW_STRAIGHT_JOIN)? selectItem (COMMA selectItem)* - (KW_FROM relation (COMMA relation)*)? - (KW_WHERE where=booleanExpression)? - (KW_GROUP KW_BY groupBy)? - (KW_HAVING having=booleanExpression)? + : KW_SELECT setQuantifier? (KW_STRAIGHT_JOIN)? selectItem (COMMA selectItem)* ( + KW_FROM relation (COMMA relation)* + )? (KW_WHERE where=booleanExpression)? (KW_GROUP KW_BY groupBy)? ( + KW_HAVING having=booleanExpression + )? ; groupBy @@ -571,7 +764,7 @@ groupBy ; groupingElement - : groupingSet #singleGroupingSet + : groupingSet # singleGroupingSet ; groupingSet @@ -589,17 +782,17 @@ setQuantifier ; selectItem - : columnItem (KW_AS? identifier)? #selectSingle - | qualifiedName DOT ASTERISK #selectAll - | ASTERISK #selectAll + : columnItem (KW_AS? identifier)? # selectSingle + | qualifiedName DOT ASTERISK # selectAll + | ASTERISK # selectAll ; relation - : left=relation - ( KW_CROSS KW_JOIN right=sampledRelation - | joinType KW_JOIN rightRelation=relation joinCriteria - ) #joinRelation - | sampledRelation #relationDefault + : left=relation ( + KW_CROSS KW_JOIN right=sampledRelation + | joinType KW_JOIN rightRelation=relation joinCriteria + ) # joinRelation + | sampledRelation # relationDefault ; joinType @@ -622,8 +815,10 @@ joinCriteria sampledRelation : aliasedRelation ( - KW_TABLESAMPLE sampleType LPAREN percentage=expression RPAREN (KW_REPEATABLE LPAREN seed=expression RPAREN)? - )? + KW_TABLESAMPLE sampleType LPAREN percentage=expression RPAREN ( + KW_REPEATABLE LPAREN seed=expression RPAREN + )? + )? ; sampleType @@ -650,117 +845,151 @@ relationPrimary | parenthesizedRelation ; -subQueryRelation: LPAREN queryStatement RPAREN; +subQueryRelation + : LPAREN queryStatement RPAREN + ; -unnest: KW_UNNEST LPAREN expression (COMMA expression)* RPAREN (KW_WITH KW_ORDINALITY)?; +unnest + : KW_UNNEST LPAREN expression (COMMA expression)* RPAREN (KW_WITH KW_ORDINALITY)? + ; -parenthesizedRelation: LPAREN relation RPAREN; +parenthesizedRelation + : LPAREN relation RPAREN + ; -columnItem: columnNamePath | expression; +columnItem + : columnNamePath + | expression + ; expression : booleanExpression ; booleanExpression - : valueExpression predicate[$valueExpression.ctx]? #predicated - | KW_NOT booleanExpression #logicalNot - | left=booleanExpression operator=KW_AND right=booleanExpression #logicalBinary - | left=booleanExpression operator=KW_OR right=booleanExpression #logicalBinary + : valueExpression predicate[$valueExpression.ctx]? # predicated + | KW_NOT booleanExpression # logicalNot + | left=booleanExpression operator=KW_AND right=booleanExpression # logicalBinary + | left=booleanExpression operator=KW_OR right=booleanExpression # logicalBinary ; predicate[ParserRuleContext value] - : comparisonOperator right=valueExpression #comparison - | comparisonOperator comparisonQuantifier subQueryRelation #quantifiedComparison - | KW_NOT? KW_BETWEEN lower=valueExpression KW_AND upper=valueExpression #between - | KW_NOT? KW_IN LPAREN expression (COMMA expression)* RPAREN #inList - | KW_NOT? KW_IN subQueryRelation #inSubquery - | KW_NOT? (KW_LIKE | KW_ILIKE | KW_RLIKE) pattern=valueExpression (KW_ESCAPE escape=valueExpression)? #like - | (KW_REGEXP | KW_IREGEXP) pattern=valueExpression #REGEXP - | KW_IS KW_NOT? (KW_NULL | KW_UNKNOWN | KW_TRUE | KW_FALSE) #nullOrUnKnownOrBooleanPredicate - | KW_IS KW_NOT? KW_DISTINCT KW_FROM right=valueExpression #distinctFrom + : comparisonOperator right=valueExpression # comparison + | comparisonOperator comparisonQuantifier subQueryRelation # quantifiedComparison + | KW_NOT? KW_BETWEEN lower=valueExpression KW_AND upper=valueExpression # between + | KW_NOT? KW_IN LPAREN expression (COMMA expression)* RPAREN # inList + | KW_NOT? KW_IN subQueryRelation # inSubquery + | KW_NOT? (KW_LIKE | KW_ILIKE | KW_RLIKE) pattern=valueExpression ( + KW_ESCAPE escape=valueExpression + )? # like + | (KW_REGEXP | KW_IREGEXP) pattern=valueExpression # REGEXP + | KW_IS KW_NOT? (KW_NULL | KW_UNKNOWN | KW_TRUE | KW_FALSE) # nullOrUnKnownOrBooleanPredicate + | KW_IS KW_NOT? KW_DISTINCT KW_FROM right=valueExpression # distinctFrom ; valueExpression - : primaryExpression #valueExpressionDefault - | operator=(MINUS | PLUS) valueExpression #arithmeticUnary - | left=valueExpression operator=(ASTERISK | SLASH | PERCENT) right=valueExpression #arithmeticBinary - | left=valueExpression operator=(PLUS | MINUS) right=valueExpression #arithmeticBinary - | left=valueExpression CONCAT right=valueExpression #concatenation + : primaryExpression # valueExpressionDefault + | operator=(MINUS | PLUS) valueExpression # arithmeticUnary + | left=valueExpression operator=(ASTERISK | SLASH | PERCENT) right=valueExpression # arithmeticBinary + | left=valueExpression operator=(PLUS | MINUS) right=valueExpression # arithmeticBinary + | left=valueExpression CONCAT right=valueExpression # concatenation ; primaryExpression - : KW_NULL #nullLiteral - | interval #intervalLiteral - | identifier stringLiteral #typeConstructor - | DOUBLE_PRECISION stringLiteral #typeConstructor - | number #numericLiteral - | booleanValue #booleanLiteral - | stringLiteral #stringLiteralValues - | BINARY_LITERAL #binaryLiteral - | QUESTION #parameter - | KW_POSITION LPAREN valueExpression KW_IN valueExpression RPAREN #position - | LPAREN expression (KW_AS type)? (COMMA expression (KW_AS type)?)*? RPAREN #rowConstructor - | KW_ROW LPAREN expression (COMMA expression)* RPAREN #rowConstructor - | functionNamePath LPAREN ASTERISK RPAREN filter? over? #functionCall - | functionNamePath LPAREN (setQuantifier? expression (COMMA expression)*)? - (KW_ORDER KW_BY sortItem (COMMA sortItem)*)? RPAREN filter? over? #functionCall - | identifier RIGHT_ARROW expression #lambda - | LPAREN (identifier (COMMA identifier)*)? RPAREN RIGHT_ARROW expression #lambda - | LPAREN queryStatement RPAREN #subqueryExpression - | KW_EXISTS LPAREN queryStatement RPAREN #exists - | KW_CASE valueExpression whenClause+ (KW_ELSE elseExpression=expression)? KW_END #simpleCase - | KW_CASE whenClause+ (KW_ELSE elseExpression=expression)? KW_END #searchedCase - | KW_CAST LPAREN expression KW_AS type RPAREN #cast - | KW_TRY_CAST LPAREN expression KW_AS type RPAREN #cast - | KW_ARRAY LSQUARE (expression (COMMA expression)*)? RSQUARE #arrayConstructor - | value=primaryExpression LSQUARE index=valueExpression RSQUARE #subscript - | identifier #columnReference - | base=primaryExpression DOT fieldName=identifier #dereference - | name=KW_CURRENT_DATE #specialDateTimeFunction - | name=KW_CURRENT_TIME (LPAREN precision=INTEGER_VALUE RPAREN)? #specialDateTimeFunction - | name=KW_CURRENT_TIMESTAMP (LPAREN precision=INTEGER_VALUE RPAREN)? #specialDateTimeFunction - | name=KW_LOCALTIME (LPAREN precision=INTEGER_VALUE RPAREN)? #specialDateTimeFunction - | name=KW_LOCALTIMESTAMP (LPAREN precision=INTEGER_VALUE RPAREN)? #specialDateTimeFunction - | name=KW_CURRENT_USER #currentUser - | name=KW_CURRENT_PATH #currentPath - | KW_SUBSTRING LPAREN valueExpression KW_FROM valueExpression (KW_FOR valueExpression)? RPAREN #substring - | KW_NORMALIZE LPAREN valueExpression (COMMA normalForm)? RPAREN #normalize - | KW_EXTRACT LPAREN identifier KW_FROM valueExpression RPAREN #extract - | LPAREN expression RPAREN #parenthesizedExpression - | KW_GROUPING LPAREN (qualifiedName (COMMA qualifiedName)*)? RPAREN #groupingOperation + : KW_NULL # nullLiteral + | interval # intervalLiteral + | identifier stringLiteral # typeConstructor + | DOUBLE_PRECISION stringLiteral # typeConstructor + | number # numericLiteral + | booleanValue # booleanLiteral + | stringLiteral # stringLiteralValues + | BINARY_LITERAL # binaryLiteral + | QUESTION # parameter + | KW_POSITION LPAREN valueExpression KW_IN valueExpression RPAREN # position + | LPAREN expression (KW_AS type)? (COMMA expression (KW_AS type)?)*? RPAREN # rowConstructor + | KW_ROW LPAREN expression (COMMA expression)* RPAREN # rowConstructor + | functionNamePath LPAREN ASTERISK RPAREN filter? over? # functionCall + | functionNamePath LPAREN (setQuantifier? expression (COMMA expression)*)? ( + KW_ORDER KW_BY sortItem (COMMA sortItem)* + )? RPAREN filter? over? # functionCall + | identifier RIGHT_ARROW expression # lambda + | LPAREN (identifier (COMMA identifier)*)? RPAREN RIGHT_ARROW expression # lambda + | LPAREN queryStatement RPAREN # subqueryExpression + | KW_EXISTS LPAREN queryStatement RPAREN # exists + | KW_CASE valueExpression whenClause+ (KW_ELSE elseExpression=expression)? KW_END # simpleCase + | KW_CASE whenClause+ (KW_ELSE elseExpression=expression)? KW_END # searchedCase + | KW_CAST LPAREN expression KW_AS type RPAREN # cast + | KW_TRY_CAST LPAREN expression KW_AS type RPAREN # cast + | KW_ARRAY LSQUARE (expression (COMMA expression)*)? RSQUARE # arrayConstructor + | value=primaryExpression LSQUARE index=valueExpression RSQUARE # subscript + | identifier # columnReference + | base=primaryExpression DOT fieldName=identifier # dereference + | name=KW_CURRENT_DATE # specialDateTimeFunction + | name=KW_CURRENT_TIME (LPAREN precision=INTEGER_VALUE RPAREN)? # specialDateTimeFunction + | name=KW_CURRENT_TIMESTAMP (LPAREN precision=INTEGER_VALUE RPAREN)? # specialDateTimeFunction + | name=KW_LOCALTIME (LPAREN precision=INTEGER_VALUE RPAREN)? # specialDateTimeFunction + | name=KW_LOCALTIMESTAMP (LPAREN precision=INTEGER_VALUE RPAREN)? # specialDateTimeFunction + | name=KW_CURRENT_USER # currentUser + | name=KW_CURRENT_PATH # currentPath + | KW_SUBSTRING LPAREN valueExpression KW_FROM valueExpression (KW_FOR valueExpression)? RPAREN # substring + | KW_NORMALIZE LPAREN valueExpression (COMMA normalForm)? RPAREN # normalize + | KW_EXTRACT LPAREN identifier KW_FROM valueExpression RPAREN # extract + | LPAREN expression RPAREN # parenthesizedExpression + | KW_GROUPING LPAREN (qualifiedName (COMMA qualifiedName)*)? RPAREN # groupingOperation ; stringLiteral - : STRING #basicStringLiteral - | UNICODE_STRING (KW_UESCAPE STRING)? #unicodeStringLiteral + : STRING # basicStringLiteral + | UNICODE_STRING (KW_UESCAPE STRING)? # unicodeStringLiteral ; comparisonOperator - : EQ | NEQ | LT | LTE | GT | GTE + : EQ + | NEQ + | LT + | LTE + | GT + | GTE ; comparisonQuantifier - : KW_ALL | KW_SOME | KW_ANY + : KW_ALL + | KW_SOME + | KW_ANY ; booleanValue - : KW_TRUE | KW_FALSE + : KW_TRUE + | KW_FALSE ; interval - : INTEGER_VALUE intervalField - | LPAREN INTEGER_VALUE RPAREN intervalField - | KW_INTERVAL INTEGER_VALUE intervalField - | KW_INTERVAL LPAREN INTEGER_VALUE RPAREN intervalField + : INTEGER_VALUE intervalField + | LPAREN INTEGER_VALUE RPAREN intervalField + | KW_INTERVAL INTEGER_VALUE intervalField + | KW_INTERVAL LPAREN INTEGER_VALUE RPAREN intervalField ; intervalField - : KW_YEAR | KW_YEARS | KW_MONTH | KW_MONTHS | KW_DAY | KW_DAYS | KW_HOUR | KW_HOURS | KW_MINUTE | KW_MINUTES | KW_SECOND | KW_SECONDS + : KW_YEAR + | KW_YEARS + | KW_MONTH + | KW_MONTHS + | KW_DAY + | KW_DAYS + | KW_HOUR + | KW_HOURS + | KW_MINUTE + | KW_MINUTES + | KW_SECOND + | KW_SECONDS ; normalForm - : KW_NFD | KW_NFC | KW_NFKD | KW_NFKC + : KW_NFD + | KW_NFC + | KW_NFKD + | KW_NFKC ; type @@ -772,7 +1001,8 @@ type ; typeParameter - : INTEGER_VALUE | type + : INTEGER_VALUE + | type ; baseType @@ -791,11 +1021,9 @@ filter ; over - : KW_OVER LPAREN - (KW_PARTITION KW_BY partition+=expression (COMMA partition+=expression)*)? - (KW_ORDER KW_BY sortItem (COMMA sortItem)*)? - windowFrame? - RPAREN + : KW_OVER LPAREN (KW_PARTITION KW_BY partition+=expression (COMMA partition+=expression)*)? ( + KW_ORDER KW_BY sortItem (COMMA sortItem)* + )? windowFrame? RPAREN ; /** @@ -810,15 +1038,15 @@ windowFrame ; frameBound - : KW_UNBOUNDED boundType=KW_PRECEDING #unboundedFrame - | KW_UNBOUNDED boundType=KW_FOLLOWING #unboundedFrame - | KW_CURRENT KW_ROW #currentRowBound - | expression boundType=(KW_PRECEDING | KW_FOLLOWING) #boundedFrame + : KW_UNBOUNDED boundType=KW_PRECEDING # unboundedFrame + | KW_UNBOUNDED boundType=KW_FOLLOWING # unboundedFrame + | KW_CURRENT KW_ROW # currentRowBound + | expression boundType=(KW_PRECEDING | KW_FOLLOWING) # boundedFrame ; pathElement - : identifier DOT identifier #qualifiedArgument - | identifier #unqualifiedArgument + : identifier DOT identifier # qualifiedArgument + | identifier # unqualifiedArgument ; pathSpecification @@ -826,33 +1054,44 @@ pathSpecification ; privilege - : KW_ALL | KW_ALTER | KW_DROP | KW_CREATE | KW_INSERT | KW_REFRESH | KW_SELECT (LPAREN columnName=identifier RPAREN)? + : KW_ALL + | KW_ALTER + | KW_DROP + | KW_CREATE + | KW_INSERT + | KW_REFRESH + | KW_SELECT (LPAREN columnName=identifier RPAREN)? ; + objectType - : KW_SERVER | KW_URI | KW_DATABASE | KW_TABLE + : KW_SERVER + | KW_URI + | KW_DATABASE + | KW_TABLE ; + qualifiedName : identifier (DOT identifier)* ; principal - : KW_ROLE identifier #rolePrincipal - | KW_USER identifier #userPrincipal - | KW_GROUP identifier #groupPrincipal + : KW_ROLE identifier # rolePrincipal + | KW_USER identifier # userPrincipal + | KW_GROUP identifier # groupPrincipal ; identifier - : IDENTIFIER #unquotedIdentifier - | STRING #quotedIdentifier - | nonReserved #unquotedIdentifier - | BACKQUOTED_IDENTIFIER #backQuotedIdentifier - | DIGIT_IDENTIFIER #digitIdentifier + : IDENTIFIER # unquotedIdentifier + | STRING # quotedIdentifier + | nonReserved # unquotedIdentifier + | BACKQUOTED_IDENTIFIER # backQuotedIdentifier + | DIGIT_IDENTIFIER # digitIdentifier ; number - : MINUS? DECIMAL_VALUE #decimalLiteral - | MINUS? DOUBLE_VALUE #doubleLiteral - | MINUS? INTEGER_VALUE #integerLiteral + : MINUS? DECIMAL_VALUE # decimalLiteral + | MINUS? DOUBLE_VALUE # doubleLiteral + | MINUS? INTEGER_VALUE # integerLiteral ; reservedKeywordsUsedAsFuncName @@ -876,38 +1115,38 @@ reservedKeywordsUsedAsFuncName ; nonReserved -// IMPORTANT: this rule must only contain tokens. Nested rules are not supported. See SqlParser.exitNonReserved + // IMPORTANT: this rule must only contain tokens. Nested rules are not supported. See SqlParser.exitNonReserved : KW_BERNOULLI - | KW_DAY - | KW_DAYS - | KW_EXCLUDING - | KW_HOUR - | KW_INCLUDING - | KW_MINUTE - | KW_MINUTES - | KW_MONTH - | KW_MONTHS - | KW_NFC - | KW_NFD - | KW_NFKC - | KW_NFKD - | KW_OPTION - | KW_ORDINALITY - | KW_PRIVILEGES - | KW_PROPERTIES - | KW_SECOND - | KW_SECONDS - | KW_SUBSTRING - | KW_SYSTEM - | KW_TRY_CAST - | KW_USER - | KW_VIEWS - | KW_YEAR + | KW_DAY + | KW_DAYS + | KW_EXCLUDING + | KW_HOUR + | KW_INCLUDING + | KW_MINUTE + | KW_MINUTES + | KW_MONTH + | KW_MONTHS + | KW_NFC + | KW_NFD + | KW_NFKC + | KW_NFKD + | KW_OPTION + | KW_ORDINALITY + | KW_PRIVILEGES + | KW_PROPERTIES + | KW_SECOND + | KW_SECONDS + | KW_SUBSTRING + | KW_SYSTEM + | KW_TRY_CAST + | KW_USER + | KW_VIEWS + | KW_YEAR | KW_ORC - | KW_CURRENT_TIMESTAMP - | KW_CURRENT_USER - | KW_EXTRACT - | KW_KEY - | KW_LOCALTIME - | KW_SHUTDOWN + | KW_CURRENT_TIMESTAMP + | KW_CURRENT_USER + | KW_EXTRACT + | KW_KEY + | KW_LOCALTIME + | KW_SHUTDOWN ; \ No newline at end of file diff --git a/src/grammar/mysql/MySqlLexer.g4 b/src/grammar/mysql/MySqlLexer.g4 index d7f94ac..69ba5ab 100644 --- a/src/grammar/mysql/MySqlLexer.g4 +++ b/src/grammar/mysql/MySqlLexer.g4 @@ -25,1040 +25,1048 @@ THE SOFTWARE. // https://github.com/antlr/grammars-v4/blob/master/sql/mysql/Positive-Technologies/MySqlLexer.g4 +// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing +// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true +// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true + lexer grammar MySqlLexer; -options { caseInsensitive = true; } +options { + caseInsensitive=true; +} -channels { MYSQLCOMMENT, ERRORCHANNEL } - - -SPACE: [ \t\r\n]+ -> channel(HIDDEN); -SPEC_MYSQL_COMMENT: '/*!' .+? '*/' -> channel(MYSQLCOMMENT); -COMMENT_INPUT: '/*' .*? '*/' -> channel(HIDDEN); -LINE_COMMENT: ( - ('--' [ \t]* | '#') ~[\r\n]* ('\r'? '\n' | EOF) - | '--' ('\r'? '\n' | EOF) - ) -> channel(HIDDEN); +channels { + MYSQLCOMMENT, + ERRORCHANNEL +} +SPACE : [ \t\r\n]+ -> channel(HIDDEN); +SPEC_MYSQL_COMMENT : '/*!' .+? '*/' -> channel(MYSQLCOMMENT); +COMMENT_INPUT : '/*' .*? '*/' -> channel(HIDDEN); +LINE_COMMENT: (('--' [ \t]* | '#') ~[\r\n]* ('\r'? '\n' | EOF) | '--' ('\r'? '\n' | EOF)) -> channel(HIDDEN); // Keywords // Common Keywords -KW_ACTIVE: 'ACTIVE'; -KW_ADD: 'ADD'; -KW_ALL: 'ALL'; -KW_ALTER: 'ALTER'; -KW_ALWAYS: 'ALWAYS'; -KW_ANALYZE: 'ANALYZE'; -KW_AND: 'AND'; -KW_ARRAY: 'ARRAY'; -KW_AS: 'AS'; -KW_ASC: 'ASC'; -KW_ATTRIBUTE: 'ATTRIBUTE'; -KW_BEFORE: 'BEFORE'; -KW_BETWEEN: 'BETWEEN'; -KW_BOTH: 'BOTH'; -KW_BUCKETS: 'BUCKETS'; -KW_BY: 'BY'; -KW_CALL: 'CALL'; -KW_CASCADE: 'CASCADE'; -KW_CASE: 'CASE'; -KW_CAST: 'CAST'; -KW_CHANGE: 'CHANGE'; -KW_CHARACTER: 'CHARACTER'; -KW_CHECK: 'CHECK'; -KW_COLLATE: 'COLLATE'; -KW_COLUMN: 'COLUMN'; -KW_CONDITION: 'CONDITION'; -KW_CONSTRAINT: 'CONSTRAINT'; -KW_CONTINUE: 'CONTINUE'; -KW_CONVERT: 'CONVERT'; -KW_CREATE: 'CREATE'; -KW_CROSS: 'CROSS'; -KW_CURRENT: 'CURRENT'; -KW_CURRENT_USER: 'CURRENT_USER'; -KW_CURSOR: 'CURSOR'; -KW_DATABASE: 'DATABASE'; -KW_DATABASES: 'DATABASES'; -KW_DECLARE: 'DECLARE'; -KW_DEFAULT: 'DEFAULT'; -KW_DELAYED: 'DELAYED'; -KW_DELETE: 'DELETE'; -KW_DESC: 'DESC'; -KW_DESCRIBE: 'DESCRIBE'; -KW_DETERMINISTIC: 'DETERMINISTIC'; -KW_DIAGNOSTICS: 'DIAGNOSTICS'; -KW_DISTINCT: 'DISTINCT'; -KW_DISTINCTROW: 'DISTINCTROW'; -KW_DROP: 'DROP'; -KW_EACH: 'EACH'; -KW_ELSE: 'ELSE'; -KW_ELSEIF: 'ELSEIF'; -KW_EMPTY: 'EMPTY'; -KW_ENCLOSED: 'ENCLOSED'; -KW_ENFORCED: 'ENFORCED'; -KW_ESCAPED: 'ESCAPED'; -KW_EXCEPT: 'EXCEPT'; -KW_EXISTS: 'EXISTS'; -KW_EXIT: 'EXIT'; -KW_EXPLAIN: 'EXPLAIN'; -KW_FALSE: 'FALSE'; -KW_FETCH: 'FETCH'; -KW_FOR: 'FOR'; -KW_FORCE: 'FORCE'; -KW_FOREIGN: 'FOREIGN'; -KW_FROM: 'FROM'; -KW_FULLTEXT: 'FULLTEXT'; -KW_GENERATE: 'GENERATE'; -KW_GENERATED: 'GENERATED'; -KW_GET: 'GET'; -KW_GRANT: 'GRANT'; -KW_GROUP: 'GROUP'; -KW_HAVING: 'HAVING'; -KW_HIGH_PRIORITY: 'HIGH_PRIORITY'; -KW_HISTOGRAM: 'HISTOGRAM'; -KW_IF: 'IF'; -KW_IGNORE: 'IGNORE'; -KW_IN: 'IN'; -KW_INACTIVE: 'INACTIVE'; -KW_INDEX: 'INDEX'; -KW_INFILE: 'INFILE'; -KW_INNER: 'INNER'; -KW_INOUT: 'INOUT'; -KW_INSERT: 'INSERT'; -KW_INTERVAL: 'INTERVAL'; -KW_INTO: 'INTO'; -KW_IS: 'IS'; -KW_ITERATE: 'ITERATE'; -KW_JOIN: 'JOIN'; -KW_KEY: 'KEY'; -KW_KEYS: 'KEYS'; -KW_KILL: 'KILL'; -KW_LATERAL: 'LATERAL'; -KW_LEADING: 'LEADING'; -KW_LEAVE: 'LEAVE'; -KW_LEFT: 'LEFT'; -KW_LIKE: 'LIKE'; -KW_LIMIT: 'LIMIT'; -KW_LINEAR: 'LINEAR'; -KW_LINES: 'LINES'; -KW_LOAD: 'LOAD'; -KW_LOCK: 'LOCK'; -KW_LOCKED: 'LOCKED'; -KW_LOOP: 'LOOP'; -KW_LOW_PRIORITY: 'LOW_PRIORITY'; -KW_MASTER_BIND: 'MASTER_BIND'; -KW_MASTER_SSL_VERIFY_SERVER_CERT: 'MASTER_SSL_VERIFY_SERVER_CERT'; -KW_MATCH: 'MATCH'; -KW_MAXVALUE: 'MAXVALUE'; -KW_MODIFIES: 'MODIFIES'; -KW_NATURAL: 'NATURAL'; -KW_NOT: 'NOT'; -KW_NO_WRITE_TO_BINLOG: 'NO_WRITE_TO_BINLOG'; -KW_NULL_LITERAL: 'NULL'; -KW_NUMBER: 'NUMBER'; -KW_STREAM: 'STREAM'; -KW_ON: 'ON'; -KW_OPTIMIZE: 'OPTIMIZE'; -KW_OPTION: 'OPTION'; -KW_OPTIONAL: 'OPTIONAL'; -KW_OPTIONALLY: 'OPTIONALLY'; -KW_OR: 'OR'; -KW_ORDER: 'ORDER'; -KW_OUT: 'OUT'; -KW_OUTER: 'OUTER'; -KW_OUTFILE: 'OUTFILE'; -KW_OVER: 'OVER'; -KW_PARTITION: 'PARTITION'; -KW_PRIMARY: 'PRIMARY'; -KW_PROCEDURE: 'PROCEDURE'; -KW_PURGE: 'PURGE'; -KW_RANGE: 'RANGE'; -KW_READ: 'READ'; -KW_READS: 'READS'; -KW_REFERENCE: 'REFERENCE'; -KW_REFERENCES: 'REFERENCES'; -KW_REGEXP: 'REGEXP'; -KW_RELEASE: 'RELEASE'; -KW_RENAME: 'RENAME'; -KW_REPEAT: 'REPEAT'; -KW_REPLACE: 'REPLACE'; -KW_REQUIRE: 'REQUIRE'; -KW_RESIGNAL: 'RESIGNAL'; -KW_RESTRICT: 'RESTRICT'; -KW_RETAIN: 'RETAIN'; -KW_RETURN: 'RETURN'; -KW_REVOKE: 'REVOKE'; -KW_RIGHT: 'RIGHT'; -KW_RLIKE: 'RLIKE'; -KW_SCHEMA: 'SCHEMA'; -KW_SCHEMAS: 'SCHEMAS'; -KW_SELECT: 'SELECT'; -KW_SET: 'SET'; -KW_SEPARATOR: 'SEPARATOR'; -KW_SHOW: 'SHOW'; -KW_SIGNAL: 'SIGNAL'; -KW_SKIP: 'SKIP'; -KW_SKIP_QUERY_REWRITE: 'SKIP_QUERY_REWRITE'; -KW_SPATIAL: 'SPATIAL'; -KW_SQL: 'SQL'; -KW_SQLEXCEPTION: 'SQLEXCEPTION'; -KW_SQLSTATE: 'SQLSTATE'; -KW_SQLWARNING: 'SQLWARNING'; -KW_SQL_BIG_RESULT: 'SQL_BIG_RESULT'; -KW_SQL_CALC_FOUND_ROWS: 'SQL_CALC_FOUND_ROWS'; -KW_SQL_SMALL_RESULT: 'SQL_SMALL_RESULT'; -KW_SSL: 'SSL'; -KW_STACKED: 'STACKED'; -KW_STARTING: 'STARTING'; -KW_STRAIGHT_JOIN: 'STRAIGHT_JOIN'; -KW_TABLE: 'TABLE'; -KW_TERMINATED: 'TERMINATED'; -KW_THEN: 'THEN'; -KW_TO: 'TO'; -KW_TRAILING: 'TRAILING'; -KW_TRIGGER: 'TRIGGER'; -KW_TRUE: 'TRUE'; -KW_UNDO: 'UNDO'; -KW_UNION: 'UNION'; -KW_UNIQUE: 'UNIQUE'; -KW_UNLOCK: 'UNLOCK'; -KW_UNSIGNED: 'UNSIGNED'; -KW_UPDATE: 'UPDATE'; -KW_USAGE: 'USAGE'; -KW_USE: 'USE'; -KW_USING: 'USING'; -KW_VALUES: 'VALUES'; -KW_VCPU: 'VCPU'; -KW_WHEN: 'WHEN'; -KW_WHERE: 'WHERE'; -KW_WHILE: 'WHILE'; -KW_WITH: 'WITH'; -KW_WRITE: 'WRITE'; -KW_XOR: 'XOR'; -KW_ZEROFILL: 'ZEROFILL'; +KW_ACTIVE : 'ACTIVE'; +KW_ADD : 'ADD'; +KW_ALL : 'ALL'; +KW_ALTER : 'ALTER'; +KW_ALWAYS : 'ALWAYS'; +KW_ANALYZE : 'ANALYZE'; +KW_AND : 'AND'; +KW_ARRAY : 'ARRAY'; +KW_AS : 'AS'; +KW_ASC : 'ASC'; +KW_ATTRIBUTE : 'ATTRIBUTE'; +KW_BEFORE : 'BEFORE'; +KW_BETWEEN : 'BETWEEN'; +KW_BOTH : 'BOTH'; +KW_BUCKETS : 'BUCKETS'; +KW_BY : 'BY'; +KW_CALL : 'CALL'; +KW_CASCADE : 'CASCADE'; +KW_CASE : 'CASE'; +KW_CAST : 'CAST'; +KW_CHANGE : 'CHANGE'; +KW_CHARACTER : 'CHARACTER'; +KW_CHECK : 'CHECK'; +KW_COLLATE : 'COLLATE'; +KW_COLUMN : 'COLUMN'; +KW_CONDITION : 'CONDITION'; +KW_CONSTRAINT : 'CONSTRAINT'; +KW_CONTINUE : 'CONTINUE'; +KW_CONVERT : 'CONVERT'; +KW_CREATE : 'CREATE'; +KW_CROSS : 'CROSS'; +KW_CURRENT : 'CURRENT'; +KW_CURRENT_USER : 'CURRENT_USER'; +KW_CURSOR : 'CURSOR'; +KW_DATABASE : 'DATABASE'; +KW_DATABASES : 'DATABASES'; +KW_DECLARE : 'DECLARE'; +KW_DEFAULT : 'DEFAULT'; +KW_DELAYED : 'DELAYED'; +KW_DELETE : 'DELETE'; +KW_DESC : 'DESC'; +KW_DESCRIBE : 'DESCRIBE'; +KW_DETERMINISTIC : 'DETERMINISTIC'; +KW_DIAGNOSTICS : 'DIAGNOSTICS'; +KW_DISTINCT : 'DISTINCT'; +KW_DISTINCTROW : 'DISTINCTROW'; +KW_DROP : 'DROP'; +KW_EACH : 'EACH'; +KW_ELSE : 'ELSE'; +KW_ELSEIF : 'ELSEIF'; +KW_EMPTY : 'EMPTY'; +KW_ENCLOSED : 'ENCLOSED'; +KW_ENFORCED : 'ENFORCED'; +KW_ESCAPED : 'ESCAPED'; +KW_EXCEPT : 'EXCEPT'; +KW_EXISTS : 'EXISTS'; +KW_EXIT : 'EXIT'; +KW_EXPLAIN : 'EXPLAIN'; +KW_FALSE : 'FALSE'; +KW_FETCH : 'FETCH'; +KW_FOR : 'FOR'; +KW_FORCE : 'FORCE'; +KW_FOREIGN : 'FOREIGN'; +KW_FROM : 'FROM'; +KW_FULLTEXT : 'FULLTEXT'; +KW_GENERATE : 'GENERATE'; +KW_GENERATED : 'GENERATED'; +KW_GET : 'GET'; +KW_GRANT : 'GRANT'; +KW_GROUP : 'GROUP'; +KW_HAVING : 'HAVING'; +KW_HIGH_PRIORITY : 'HIGH_PRIORITY'; +KW_HISTOGRAM : 'HISTOGRAM'; +KW_IF : 'IF'; +KW_IGNORE : 'IGNORE'; +KW_IN : 'IN'; +KW_INACTIVE : 'INACTIVE'; +KW_INDEX : 'INDEX'; +KW_INFILE : 'INFILE'; +KW_INNER : 'INNER'; +KW_INOUT : 'INOUT'; +KW_INSERT : 'INSERT'; +KW_INTERVAL : 'INTERVAL'; +KW_INTO : 'INTO'; +KW_IS : 'IS'; +KW_ITERATE : 'ITERATE'; +KW_JOIN : 'JOIN'; +KW_KEY : 'KEY'; +KW_KEYS : 'KEYS'; +KW_KILL : 'KILL'; +KW_LATERAL : 'LATERAL'; +KW_LEADING : 'LEADING'; +KW_LEAVE : 'LEAVE'; +KW_LEFT : 'LEFT'; +KW_LIKE : 'LIKE'; +KW_LIMIT : 'LIMIT'; +KW_LINEAR : 'LINEAR'; +KW_LINES : 'LINES'; +KW_LOAD : 'LOAD'; +KW_LOCK : 'LOCK'; +KW_LOCKED : 'LOCKED'; +KW_LOOP : 'LOOP'; +KW_LOW_PRIORITY : 'LOW_PRIORITY'; +KW_MASTER_BIND : 'MASTER_BIND'; +KW_MASTER_SSL_VERIFY_SERVER_CERT : 'MASTER_SSL_VERIFY_SERVER_CERT'; +KW_MATCH : 'MATCH'; +KW_MAXVALUE : 'MAXVALUE'; +KW_MODIFIES : 'MODIFIES'; +KW_NATURAL : 'NATURAL'; +KW_NOT : 'NOT'; +KW_NO_WRITE_TO_BINLOG : 'NO_WRITE_TO_BINLOG'; +KW_NULL_LITERAL : 'NULL'; +KW_NUMBER : 'NUMBER'; +KW_STREAM : 'STREAM'; +KW_ON : 'ON'; +KW_OPTIMIZE : 'OPTIMIZE'; +KW_OPTION : 'OPTION'; +KW_OPTIONAL : 'OPTIONAL'; +KW_OPTIONALLY : 'OPTIONALLY'; +KW_OR : 'OR'; +KW_ORDER : 'ORDER'; +KW_OUT : 'OUT'; +KW_OUTER : 'OUTER'; +KW_OUTFILE : 'OUTFILE'; +KW_OVER : 'OVER'; +KW_PARTITION : 'PARTITION'; +KW_PRIMARY : 'PRIMARY'; +KW_PROCEDURE : 'PROCEDURE'; +KW_PURGE : 'PURGE'; +KW_RANGE : 'RANGE'; +KW_READ : 'READ'; +KW_READS : 'READS'; +KW_REFERENCE : 'REFERENCE'; +KW_REFERENCES : 'REFERENCES'; +KW_REGEXP : 'REGEXP'; +KW_RELEASE : 'RELEASE'; +KW_RENAME : 'RENAME'; +KW_REPEAT : 'REPEAT'; +KW_REPLACE : 'REPLACE'; +KW_REQUIRE : 'REQUIRE'; +KW_RESIGNAL : 'RESIGNAL'; +KW_RESTRICT : 'RESTRICT'; +KW_RETAIN : 'RETAIN'; +KW_RETURN : 'RETURN'; +KW_REVOKE : 'REVOKE'; +KW_RIGHT : 'RIGHT'; +KW_RLIKE : 'RLIKE'; +KW_SCHEMA : 'SCHEMA'; +KW_SCHEMAS : 'SCHEMAS'; +KW_SELECT : 'SELECT'; +KW_SET : 'SET'; +KW_SEPARATOR : 'SEPARATOR'; +KW_SHOW : 'SHOW'; +KW_SIGNAL : 'SIGNAL'; +KW_SKIP : 'SKIP'; +KW_SKIP_QUERY_REWRITE : 'SKIP_QUERY_REWRITE'; +KW_SPATIAL : 'SPATIAL'; +KW_SQL : 'SQL'; +KW_SQLEXCEPTION : 'SQLEXCEPTION'; +KW_SQLSTATE : 'SQLSTATE'; +KW_SQLWARNING : 'SQLWARNING'; +KW_SQL_BIG_RESULT : 'SQL_BIG_RESULT'; +KW_SQL_CALC_FOUND_ROWS : 'SQL_CALC_FOUND_ROWS'; +KW_SQL_SMALL_RESULT : 'SQL_SMALL_RESULT'; +KW_SSL : 'SSL'; +KW_STACKED : 'STACKED'; +KW_STARTING : 'STARTING'; +KW_STRAIGHT_JOIN : 'STRAIGHT_JOIN'; +KW_TABLE : 'TABLE'; +KW_TERMINATED : 'TERMINATED'; +KW_THEN : 'THEN'; +KW_TO : 'TO'; +KW_TRAILING : 'TRAILING'; +KW_TRIGGER : 'TRIGGER'; +KW_TRUE : 'TRUE'; +KW_UNDO : 'UNDO'; +KW_UNION : 'UNION'; +KW_UNIQUE : 'UNIQUE'; +KW_UNLOCK : 'UNLOCK'; +KW_UNSIGNED : 'UNSIGNED'; +KW_UPDATE : 'UPDATE'; +KW_USAGE : 'USAGE'; +KW_USE : 'USE'; +KW_USING : 'USING'; +KW_VALUES : 'VALUES'; +KW_VCPU : 'VCPU'; +KW_WHEN : 'WHEN'; +KW_WHERE : 'WHERE'; +KW_WHILE : 'WHILE'; +KW_WITH : 'WITH'; +KW_WRITE : 'WRITE'; +KW_XOR : 'XOR'; +KW_ZEROFILL : 'ZEROFILL'; // DATA TYPE Keywords -KW_TINYINT: 'TINYINT'; -KW_SMALLINT: 'SMALLINT'; -KW_MEDIUMINT: 'MEDIUMINT'; -KW_MIDDLEINT: 'MIDDLEINT'; -KW_INT: 'INT'; -KW_INT1: 'INT1'; -KW_INT2: 'INT2'; -KW_INT3: 'INT3'; -KW_INT4: 'INT4'; -KW_INT8: 'INT8'; -KW_INTEGER: 'INTEGER'; -KW_BIGINT: 'BIGINT'; -KW_REAL: 'REAL'; -KW_DOUBLE: 'DOUBLE'; -KW_PRECISION: 'PRECISION'; -KW_FLOAT: 'FLOAT'; -KW_FLOAT4: 'FLOAT4'; -KW_FLOAT8: 'FLOAT8'; -KW_DECIMAL: 'DECIMAL'; -KW_DEC: 'DEC'; -KW_NUMERIC: 'NUMERIC'; -KW_DATE: 'DATE'; -KW_TIME: 'TIME'; -KW_TIMESTAMP: 'TIMESTAMP'; -KW_DATETIME: 'DATETIME'; -KW_YEAR: 'YEAR'; -KW_CHAR: 'CHAR'; -KW_VARCHAR: 'VARCHAR'; -KW_NVARCHAR: 'NVARCHAR'; -KW_NATIONAL: 'NATIONAL'; -KW_BINARY: 'BINARY'; -KW_VARBINARY: 'VARBINARY'; -KW_TINYBLOB: 'TINYBLOB'; -KW_BLOB: 'BLOB'; -KW_MEDIUMBLOB: 'MEDIUMBLOB'; -KW_LONG: 'LONG'; -KW_LONGBLOB: 'LONGBLOB'; -KW_TINYTEXT: 'TINYTEXT'; -KW_TEXT: 'TEXT'; -KW_MEDIUMTEXT: 'MEDIUMTEXT'; -KW_LONGTEXT: 'LONGTEXT'; -KW_ENUM: 'ENUM'; -KW_VARYING: 'VARYING'; -KW_SERIAL: 'SERIAL'; - +KW_TINYINT : 'TINYINT'; +KW_SMALLINT : 'SMALLINT'; +KW_MEDIUMINT : 'MEDIUMINT'; +KW_MIDDLEINT : 'MIDDLEINT'; +KW_INT : 'INT'; +KW_INT1 : 'INT1'; +KW_INT2 : 'INT2'; +KW_INT3 : 'INT3'; +KW_INT4 : 'INT4'; +KW_INT8 : 'INT8'; +KW_INTEGER : 'INTEGER'; +KW_BIGINT : 'BIGINT'; +KW_REAL : 'REAL'; +KW_DOUBLE : 'DOUBLE'; +KW_PRECISION : 'PRECISION'; +KW_FLOAT : 'FLOAT'; +KW_FLOAT4 : 'FLOAT4'; +KW_FLOAT8 : 'FLOAT8'; +KW_DECIMAL : 'DECIMAL'; +KW_DEC : 'DEC'; +KW_NUMERIC : 'NUMERIC'; +KW_DATE : 'DATE'; +KW_TIME : 'TIME'; +KW_TIMESTAMP : 'TIMESTAMP'; +KW_DATETIME : 'DATETIME'; +KW_YEAR : 'YEAR'; +KW_CHAR : 'CHAR'; +KW_VARCHAR : 'VARCHAR'; +KW_NVARCHAR : 'NVARCHAR'; +KW_NATIONAL : 'NATIONAL'; +KW_BINARY : 'BINARY'; +KW_VARBINARY : 'VARBINARY'; +KW_TINYBLOB : 'TINYBLOB'; +KW_BLOB : 'BLOB'; +KW_MEDIUMBLOB : 'MEDIUMBLOB'; +KW_LONG : 'LONG'; +KW_LONGBLOB : 'LONGBLOB'; +KW_TINYTEXT : 'TINYTEXT'; +KW_TEXT : 'TEXT'; +KW_MEDIUMTEXT : 'MEDIUMTEXT'; +KW_LONGTEXT : 'LONGTEXT'; +KW_ENUM : 'ENUM'; +KW_VARYING : 'VARYING'; +KW_SERIAL : 'SERIAL'; // Interval type Keywords -KW_YEAR_MONTH: 'YEAR_MONTH'; -KW_DAY_HOUR: 'DAY_HOUR'; -KW_DAY_MINUTE: 'DAY_MINUTE'; -KW_DAY_SECOND: 'DAY_SECOND'; -KW_HOUR_MINUTE: 'HOUR_MINUTE'; -KW_HOUR_SECOND: 'HOUR_SECOND'; -KW_MINUTE_SECOND: 'MINUTE_SECOND'; -KW_SECOND_MICROSECOND: 'SECOND_MICROSECOND'; -KW_MINUTE_MICROSECOND: 'MINUTE_MICROSECOND'; -KW_HOUR_MICROSECOND: 'HOUR_MICROSECOND'; -KW_DAY_MICROSECOND: 'DAY_MICROSECOND'; +KW_YEAR_MONTH : 'YEAR_MONTH'; +KW_DAY_HOUR : 'DAY_HOUR'; +KW_DAY_MINUTE : 'DAY_MINUTE'; +KW_DAY_SECOND : 'DAY_SECOND'; +KW_HOUR_MINUTE : 'HOUR_MINUTE'; +KW_HOUR_SECOND : 'HOUR_SECOND'; +KW_MINUTE_SECOND : 'MINUTE_SECOND'; +KW_SECOND_MICROSECOND : 'SECOND_MICROSECOND'; +KW_MINUTE_MICROSECOND : 'MINUTE_MICROSECOND'; +KW_HOUR_MICROSECOND : 'HOUR_MICROSECOND'; +KW_DAY_MICROSECOND : 'DAY_MICROSECOND'; // JSON keywords -KW_JSON_TABLE: 'JSON_TABLE'; -KW_JSON_VALUE: 'JSON_VALUE'; -KW_NESTED: 'NESTED'; -KW_ORDINALITY: 'ORDINALITY'; -KW_PATH: 'PATH'; +KW_JSON_TABLE : 'JSON_TABLE'; +KW_JSON_VALUE : 'JSON_VALUE'; +KW_NESTED : 'NESTED'; +KW_ORDINALITY : 'ORDINALITY'; +KW_PATH : 'PATH'; // Group function Keywords -KW_AVG: 'AVG'; -KW_BIT_AND: 'BIT_AND'; -KW_BIT_OR: 'BIT_OR'; -KW_BIT_XOR: 'BIT_XOR'; -KW_COUNT: 'COUNT'; -KW_CUME_DIST: 'CUME_DIST'; -KW_DENSE_RANK: 'DENSE_RANK'; -KW_FIRST_VALUE: 'FIRST_VALUE'; -KW_GROUP_CONCAT: 'GROUP_CONCAT'; -KW_LAG: 'LAG'; -KW_LAST_VALUE: 'LAST_VALUE'; -KW_LEAD: 'LEAD'; -KW_MAX: 'MAX'; -KW_MIN: 'MIN'; -KW_NTILE: 'NTILE'; -KW_NTH_VALUE: 'NTH_VALUE'; -KW_PERCENT_RANK: 'PERCENT_RANK'; -KW_RANK: 'RANK'; -KW_ROW_NUMBER: 'ROW_NUMBER'; -KW_STD: 'STD'; -KW_STDDEV: 'STDDEV'; -KW_STDDEV_POP: 'STDDEV_POP'; -KW_STDDEV_SAMP: 'STDDEV_SAMP'; -KW_SUM: 'SUM'; -KW_VAR_POP: 'VAR_POP'; -KW_VAR_SAMP: 'VAR_SAMP'; -KW_VARIANCE: 'VARIANCE'; +KW_AVG : 'AVG'; +KW_BIT_AND : 'BIT_AND'; +KW_BIT_OR : 'BIT_OR'; +KW_BIT_XOR : 'BIT_XOR'; +KW_COUNT : 'COUNT'; +KW_CUME_DIST : 'CUME_DIST'; +KW_DENSE_RANK : 'DENSE_RANK'; +KW_FIRST_VALUE : 'FIRST_VALUE'; +KW_GROUP_CONCAT : 'GROUP_CONCAT'; +KW_LAG : 'LAG'; +KW_LAST_VALUE : 'LAST_VALUE'; +KW_LEAD : 'LEAD'; +KW_MAX : 'MAX'; +KW_MIN : 'MIN'; +KW_NTILE : 'NTILE'; +KW_NTH_VALUE : 'NTH_VALUE'; +KW_PERCENT_RANK : 'PERCENT_RANK'; +KW_RANK : 'RANK'; +KW_ROW_NUMBER : 'ROW_NUMBER'; +KW_STD : 'STD'; +KW_STDDEV : 'STDDEV'; +KW_STDDEV_POP : 'STDDEV_POP'; +KW_STDDEV_SAMP : 'STDDEV_SAMP'; +KW_SUM : 'SUM'; +KW_VAR_POP : 'VAR_POP'; +KW_VAR_SAMP : 'VAR_SAMP'; +KW_VARIANCE : 'VARIANCE'; // Common function Keywords -KW_CURRENT_DATE: 'CURRENT_DATE'; -KW_CURRENT_TIME: 'CURRENT_TIME'; -KW_CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; -KW_LOCALTIME: 'LOCALTIME'; -KW_CURDATE: 'CURDATE'; -KW_CURTIME: 'CURTIME'; -KW_DATE_ADD: 'DATE_ADD'; -KW_DATE_SUB: 'DATE_SUB'; -KW_EXTRACT: 'EXTRACT'; -KW_LOCALTIMESTAMP: 'LOCALTIMESTAMP'; -KW_NOW: 'NOW'; -KW_POSITION: 'POSITION'; -KW_SUBSTR: 'SUBSTR'; -KW_SUBSTRING: 'SUBSTRING'; -KW_SYSDATE: 'SYSDATE'; -KW_TRIM: 'TRIM'; -KW_UTC_DATE: 'UTC_DATE'; -KW_UTC_TIME: 'UTC_TIME'; -KW_UTC_TIMESTAMP: 'UTC_TIMESTAMP'; +KW_CURRENT_DATE : 'CURRENT_DATE'; +KW_CURRENT_TIME : 'CURRENT_TIME'; +KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; +KW_LOCALTIME : 'LOCALTIME'; +KW_CURDATE : 'CURDATE'; +KW_CURTIME : 'CURTIME'; +KW_DATE_ADD : 'DATE_ADD'; +KW_DATE_SUB : 'DATE_SUB'; +KW_EXTRACT : 'EXTRACT'; +KW_LOCALTIMESTAMP : 'LOCALTIMESTAMP'; +KW_NOW : 'NOW'; +KW_POSITION : 'POSITION'; +KW_SUBSTR : 'SUBSTR'; +KW_SUBSTRING : 'SUBSTRING'; +KW_SYSDATE : 'SYSDATE'; +KW_TRIM : 'TRIM'; +KW_UTC_DATE : 'UTC_DATE'; +KW_UTC_TIME : 'UTC_TIME'; +KW_UTC_TIMESTAMP : 'UTC_TIMESTAMP'; // Keywords, but can be ID // Common Keywords, but can be ID -KW_ACCOUNT: 'ACCOUNT'; -KW_ACTION: 'ACTION'; -KW_AFTER: 'AFTER'; -KW_AGGREGATE: 'AGGREGATE'; -KW_ALGORITHM: 'ALGORITHM'; -KW_ANY: 'ANY'; -KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: 'ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS'; -KW_AT: 'AT'; -KW_AUTHORS: 'AUTHORS'; -KW_AUTOCOMMIT: 'AUTOCOMMIT'; -KW_AUTOEXTEND_SIZE: 'AUTOEXTEND_SIZE'; -KW_AUTO_INCREMENT: 'AUTO_INCREMENT'; -KW_AVG_ROW_LENGTH: 'AVG_ROW_LENGTH'; -KW_BEGIN: 'BEGIN'; -KW_BINLOG: 'BINLOG'; -KW_BIT: 'BIT'; -KW_BLOCK: 'BLOCK'; -KW_BOOL: 'BOOL'; -KW_BOOLEAN: 'BOOLEAN'; -KW_BTREE: 'BTREE'; -KW_CACHE: 'CACHE'; -KW_CASCADED: 'CASCADED'; -KW_CHAIN: 'CHAIN'; -KW_CHANGED: 'CHANGED'; -KW_CHANNEL: 'CHANNEL'; -KW_CHECKSUM: 'CHECKSUM'; -KW_CHALLENGE_RESPONSE: 'CHALLENGE_RESPONSE'; -KW_CIPHER: 'CIPHER'; -KW_CLASS_ORIGIN: 'CLASS_ORIGIN'; -KW_CLIENT: 'CLIENT'; -KW_CLOSE: 'CLOSE'; -KW_COALESCE: 'COALESCE'; -KW_CODE: 'CODE'; -KW_COLUMNS: 'COLUMNS'; -KW_COLUMN_FORMAT: 'COLUMN_FORMAT'; -KW_COLUMN_NAME: 'COLUMN_NAME'; -KW_COMMENT: 'COMMENT'; -KW_COMMIT: 'COMMIT'; -KW_COMPACT: 'COMPACT'; -KW_COMPLETION: 'COMPLETION'; -KW_COMPONENT: 'COMPONENT'; -KW_COMPRESSED: 'COMPRESSED'; -KW_COMPRESSION: 'COMPRESSION'; -KW_CONCURRENT: 'CONCURRENT'; -KW_CONNECT: 'CONNECT'; -KW_CONNECTION: 'CONNECTION'; -KW_CONSISTENT: 'CONSISTENT'; -KW_CONSTRAINT_CATALOG: 'CONSTRAINT_CATALOG'; -KW_CONSTRAINT_SCHEMA: 'CONSTRAINT_SCHEMA'; -KW_CONSTRAINT_NAME: 'CONSTRAINT_NAME'; -KW_CONTAINS: 'CONTAINS'; -KW_CONTEXT: 'CONTEXT'; -KW_CONTRIBUTORS: 'CONTRIBUTORS'; -KW_COPY: 'COPY'; -KW_CPU: 'CPU'; -KW_CURSOR_NAME: 'CURSOR_NAME'; -KW_DATA: 'DATA'; -KW_DATAFILE: 'DATAFILE'; -KW_DEALLOCATE: 'DEALLOCATE'; -KW_DEFAULT_AUTH: 'DEFAULT_AUTH'; -KW_DEFINER: 'DEFINER'; -KW_DELAY_KEY_WRITE: 'DELAY_KEY_WRITE'; -KW_DES_KEY_FILE: 'DES_KEY_FILE'; -KW_DIRECTORY: 'DIRECTORY'; -KW_DISABLE: 'DISABLE'; -KW_DISCARD: 'DISCARD'; -KW_DISK: 'DISK'; -KW_DO: 'DO'; -KW_DUMPFILE: 'DUMPFILE'; -KW_DUPLICATE: 'DUPLICATE'; -KW_DYNAMIC: 'DYNAMIC'; -KW_ENABLE: 'ENABLE'; -KW_ENCRYPTION: 'ENCRYPTION'; -KW_ENCRYPTION_KEY_ID: 'ENCRYPTION_KEY_ID'; -KW_END: 'END'; -KW_ENDS: 'ENDS'; -KW_ENGINE: 'ENGINE'; -KW_ENGINES: 'ENGINES'; -KW_ERROR: 'ERROR'; -KW_ERRORS: 'ERRORS'; -KW_ESCAPE: 'ESCAPE'; -KW_EVENT: 'EVENT'; -KW_EVENTS: 'EVENTS'; -KW_EVERY: 'EVERY'; -KW_EXCHANGE: 'EXCHANGE'; -KW_EXCLUSIVE: 'EXCLUSIVE'; -KW_EXPIRE: 'EXPIRE'; -KW_EXPORT: 'EXPORT'; -KW_EXTENDED: 'EXTENDED'; -KW_EXTENT_SIZE: 'EXTENT_SIZE'; -KW_FACTOR: 'FACTOR'; -KW_FAILED_LOGIN_ATTEMPTS: 'FAILED_LOGIN_ATTEMPTS'; -KW_FAST: 'FAST'; -KW_FAULTS: 'FAULTS'; -KW_FIELDS: 'FIELDS'; -KW_FILE_BLOCK_SIZE: 'FILE_BLOCK_SIZE'; -KW_FILTER: 'FILTER'; -KW_FINISH: 'FINISH'; -KW_FIRST: 'FIRST'; -KW_FIXED: 'FIXED'; -KW_FLUSH: 'FLUSH'; -KW_FOLLOWING: 'FOLLOWING'; -KW_FOLLOWS: 'FOLLOWS'; -KW_FOUND: 'FOUND'; -KW_FULL: 'FULL'; -KW_FUNCTION: 'FUNCTION'; -KW_GENERAL: 'GENERAL'; -KW_GET_MASTER_PUBLIC_KEY: 'GET_MASTER_PUBLIC_KEY'; -KW_GET_SOURCE_PUBLIC_KEY: 'GET_SOURCE_PUBLIC_KEY'; -KW_GLOBAL: 'GLOBAL'; -KW_GRANTS: 'GRANTS'; -KW_GROUP_REPLICATION: 'GROUP_REPLICATION'; -KW_GTID_ONLY: 'GTID_ONLY'; -KW_HANDLER: 'HANDLER'; -KW_HASH: 'HASH'; -KW_HELP: 'HELP'; -KW_HISTORY: 'HISTORY'; -KW_HOST: 'HOST'; -KW_HOSTS: 'HOSTS'; -KW_IDENTIFIED: 'IDENTIFIED'; -KW_IGNORE_SERVER_IDS: 'IGNORE_SERVER_IDS'; -KW_IMPORT: 'IMPORT'; -KW_INDEXES: 'INDEXES'; -KW_INITIAL: 'INITIAL'; -KW_INITIAL_SIZE: 'INITIAL_SIZE'; -KW_INITIATE: 'INITIATE'; -KW_INPLACE: 'INPLACE'; -KW_INSERT_METHOD: 'INSERT_METHOD'; -KW_INSTALL: 'INSTALL'; -KW_INSTANCE: 'INSTANCE'; -KW_INSTANT: 'INSTANT'; -KW_INVISIBLE: 'INVISIBLE'; -KW_INVOKER: 'INVOKER'; -KW_IO: 'IO'; -KW_IO_THREAD: 'IO_THREAD'; -KW_IPC: 'IPC'; -KW_ISOLATION: 'ISOLATION'; -KW_ISSUER: 'ISSUER'; -KW_JSON: 'JSON'; -KW_KEY_BLOCK_SIZE: 'KEY_BLOCK_SIZE'; -KW_LANGUAGE: 'LANGUAGE'; -KW_LAST: 'LAST'; -KW_LEAVES: 'LEAVES'; -KW_LESS: 'LESS'; -KW_LEVEL: 'LEVEL'; -KW_LIST: 'LIST'; -KW_LOCAL: 'LOCAL'; -KW_LOGFILE: 'LOGFILE'; -KW_LOGS: 'LOGS'; -KW_MASTER: 'MASTER'; -KW_MASTER_AUTO_POSITION: 'MASTER_AUTO_POSITION'; -KW_MASTER_COMPRESSION_ALGORITHMS: 'MASTER_COMPRESSION_ALGORITHMS'; -KW_MASTER_CONNECT_RETRY: 'MASTER_CONNECT_RETRY'; -KW_MASTER_DELAY: 'MASTER_DELAY'; -KW_MASTER_HEARTBEAT_PERIOD: 'MASTER_HEARTBEAT_PERIOD'; -KW_MASTER_HOST: 'MASTER_HOST'; -KW_MASTER_LOG_FILE: 'MASTER_LOG_FILE'; -KW_MASTER_LOG_POS: 'MASTER_LOG_POS'; -KW_MASTER_PASSWORD: 'MASTER_PASSWORD'; -KW_MASTER_PORT: 'MASTER_PORT'; -KW_MASTER_PUBLIC_KEY_PATH: 'MASTER_PUBLIC_KEY_PATH'; -KW_MASTER_RETRY_COUNT: 'MASTER_RETRY_COUNT'; -KW_MASTER_SSL: 'MASTER_SSL'; -KW_MASTER_SSL_CA: 'MASTER_SSL_CA'; -KW_MASTER_SSL_CAPATH: 'MASTER_SSL_CAPATH'; -KW_MASTER_SSL_CERT: 'MASTER_SSL_CERT'; -KW_MASTER_SSL_CIPHER: 'MASTER_SSL_CIPHER'; -KW_MASTER_SSL_CRL: 'MASTER_SSL_CRL'; -KW_MASTER_SSL_CRLPATH: 'MASTER_SSL_CRLPATH'; -KW_MASTER_SSL_KEY: 'MASTER_SSL_KEY'; -KW_MASTER_TLS_CIPHERSUITES: 'MASTER_TLS_CIPHERSUITES'; -KW_MASTER_TLS_VERSION: 'MASTER_TLS_VERSION'; -KW_MASTER_USER: 'MASTER_USER'; -KW_MASTER_ZSTD_COMPRESSION_LEVEL: 'MASTER_ZSTD_COMPRESSION_LEVEL'; -KW_MAX_CONNECTIONS_PER_HOUR: 'MAX_CONNECTIONS_PER_HOUR'; -KW_MAX_QUERIES_PER_HOUR: 'MAX_QUERIES_PER_HOUR'; -KW_MAX_ROWS: 'MAX_ROWS'; -KW_MAX_SIZE: 'MAX_SIZE'; -KW_MAX_UPDATES_PER_HOUR: 'MAX_UPDATES_PER_HOUR'; -KW_MAX_USER_CONNECTIONS: 'MAX_USER_CONNECTIONS'; -KW_MEDIUM: 'MEDIUM'; -KW_MEMBER: 'MEMBER'; -KW_MERGE: 'MERGE'; -KW_MESSAGE_TEXT: 'MESSAGE_TEXT'; -KW_MID: 'MID'; -KW_MIGRATE: 'MIGRATE'; -KW_MIN_ROWS: 'MIN_ROWS'; -KW_MODE: 'MODE'; -KW_MODIFY: 'MODIFY'; -KW_MUTEX: 'MUTEX'; -KW_MYSQL: 'MYSQL'; -KW_MYSQL_ERRNO: 'MYSQL_ERRNO'; -KW_NAME: 'NAME'; -KW_NAMES: 'NAMES'; -KW_NCHAR: 'NCHAR'; -KW_NETWORK_NAMESPACE: 'NETWORK_NAMESPACE'; -KW_NEVER: 'NEVER'; -KW_NEXT: 'NEXT'; -KW_NO: 'NO'; -KW_NOWAIT: 'NOWAIT'; -KW_NODEGROUP: 'NODEGROUP'; -KW_NONE: 'NONE'; -KW_ODBC: 'ODBC'; -KW_OFF: 'OFF'; -KW_OFFLINE: 'OFFLINE'; -KW_OFFSET: 'OFFSET'; -KW_OF: 'OF'; -KW_OLD: 'OLD'; -KW_OLD_PASSWORD: 'OLD_PASSWORD'; -KW_ONE: 'ONE'; -KW_ONLINE: 'ONLINE'; -KW_ONLY: 'ONLY'; -KW_OPEN: 'OPEN'; -KW_OPTIMIZER_COSTS: 'OPTIMIZER_COSTS'; -KW_OPTIONS: 'OPTIONS'; -KW_OWNER: 'OWNER'; -KW_PACK_KEYS: 'PACK_KEYS'; -KW_PAGE: 'PAGE'; -KW_PAGE_CHECKSUM: 'PAGE_CHECKSUM'; -KW_PAGE_COMPRESSED: 'PAGE_COMPRESSED'; -KW_PAGE_COMPRESSION_LEVEL: 'PAGE_COMPRESSION_LEVEL'; -KW_PARSER: 'PARSER'; -KW_PARTIAL: 'PARTIAL'; -KW_PARTITIONING: 'PARTITIONING'; -KW_PARTITIONS: 'PARTITIONS'; -KW_PASSWORD: 'PASSWORD'; -KW_PASSWORD_LOCK_TIME: 'PASSWORD_LOCK_TIME'; -KW_PERSIST: 'PERSIST'; -KW_PERSIST_ONLY: 'PERSIST_ONLY'; -KW_PHASE: 'PHASE'; -KW_PLUGIN: 'PLUGIN'; -KW_PLUGIN_DIR: 'PLUGIN_DIR'; -KW_PLUGINS: 'PLUGINS'; -KW_PORT: 'PORT'; -KW_PRECEDES: 'PRECEDES'; -KW_PRECEDING: 'PRECEDING'; -KW_PREPARE: 'PREPARE'; -KW_PRESERVE: 'PRESERVE'; -KW_PREV: 'PREV'; -KW_PRIVILEGE_CHECKS_USER: 'PRIVILEGE_CHECKS_USER'; -KW_PROCESSLIST: 'PROCESSLIST'; -KW_PROFILE: 'PROFILE'; -KW_PROFILES: 'PROFILES'; -KW_PROXY: 'PROXY'; -KW_QUERY: 'QUERY'; -KW_QUICK: 'QUICK'; -KW_REBUILD: 'REBUILD'; -KW_RECOVER: 'RECOVER'; -KW_RECURSIVE: 'RECURSIVE'; -KW_REDO_BUFFER_SIZE: 'REDO_BUFFER_SIZE'; -KW_REDUNDANT: 'REDUNDANT'; -KW_REGISTRATION: 'REGISTRATION'; -KW_RELAY: 'RELAY'; -KW_RELAY_LOG_FILE: 'RELAY_LOG_FILE'; -KW_RELAY_LOG_POS: 'RELAY_LOG_POS'; -KW_RELAYLOG: 'RELAYLOG'; -KW_REMOVE: 'REMOVE'; -KW_REORGANIZE: 'REORGANIZE'; -KW_REPAIR: 'REPAIR'; -KW_REPLICA: 'REPLICA'; -KW_REPLICAS: 'REPLICAS'; -KW_REPLICATE_DO_DB: 'REPLICATE_DO_DB'; -KW_REPLICATE_DO_TABLE: 'REPLICATE_DO_TABLE'; -KW_REPLICATE_IGNORE_DB: 'REPLICATE_IGNORE_DB'; -KW_REPLICATE_IGNORE_TABLE: 'REPLICATE_IGNORE_TABLE'; -KW_REPLICATE_REWRITE_DB: 'REPLICATE_REWRITE_DB'; -KW_REPLICATE_WILD_DO_TABLE: 'REPLICATE_WILD_DO_TABLE'; -KW_REPLICATE_WILD_IGNORE_TABLE: 'REPLICATE_WILD_IGNORE_TABLE'; -KW_REPLICATION: 'REPLICATION'; -KW_REQUIRE_ROW_FORMAT: 'REQUIRE_ROW_FORMAT'; -KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: 'REQUIRE_TABLE_PRIMARY_KEY_CHECK'; -KW_RESET: 'RESET'; -KW_RESTART: 'RESTART'; -KW_RESUME: 'RESUME'; -KW_RETURNED_SQLSTATE: 'RETURNED_SQLSTATE'; -KW_RETURNING: 'RETURNING'; -KW_RETURNS: 'RETURNS'; -KW_REUSE: 'REUSE'; -KW_ROLE: 'ROLE'; -KW_ROLLBACK: 'ROLLBACK'; -KW_ROLLUP: 'ROLLUP'; -KW_ROTATE: 'ROTATE'; -KW_ROW: 'ROW'; -KW_ROWS: 'ROWS'; -KW_ROW_FORMAT: 'ROW_FORMAT'; -KW_SAVEPOINT: 'SAVEPOINT'; -KW_SCHEDULE: 'SCHEDULE'; -KW_SECURITY: 'SECURITY'; -KW_SERVER: 'SERVER'; -KW_SESSION: 'SESSION'; -KW_SHARE: 'SHARE'; -KW_SHARED: 'SHARED'; -KW_SIGNED: 'SIGNED'; -KW_SIMPLE: 'SIMPLE'; -KW_SLAVE: 'SLAVE'; -KW_SLOW: 'SLOW'; -KW_SNAPSHOT: 'SNAPSHOT'; -KW_SOCKET: 'SOCKET'; -KW_SOME: 'SOME'; -KW_SONAME: 'SONAME'; -KW_SOUNDS: 'SOUNDS'; -KW_SOURCE: 'SOURCE'; -KW_SOURCE_BIND: 'SOURCE_BIND'; -KW_SOURCE_HOST: 'SOURCE_HOST'; -KW_SOURCE_USER: 'SOURCE_USER'; -KW_SOURCE_PASSWORD: 'SOURCE_PASSWORD'; -KW_SOURCE_PORT: 'SOURCE_PORT'; -KW_SOURCE_LOG_FILE: 'SOURCE_LOG_FILE'; -KW_SOURCE_LOG_POS: 'SOURCE_LOG_POS'; -KW_SOURCE_AUTO_POSITION: 'SOURCE_AUTO_POSITION'; -KW_SOURCE_HEARTBEAT_PERIOD: 'SOURCE_HEARTBEAT_PERIOD'; -KW_SOURCE_CONNECT_RETRY: 'SOURCE_CONNECT_RETRY'; -KW_SOURCE_RETRY_COUNT: 'SOURCE_RETRY_COUNT'; -KW_SOURCE_CONNECTION_AUTO_FAILOVER: 'SOURCE_CONNECTION_AUTO_FAILOVER'; -KW_SOURCE_DELAY: 'SOURCE_DELAY'; -KW_SOURCE_COMPRESSION_ALGORITHMS: 'SOURCE_COMPRESSION_ALGORITHMS'; -KW_SOURCE_ZSTD_COMPRESSION_LEVEL: 'SOURCE_ZSTD_COMPRESSION_LEVEL'; -KW_SOURCE_SSL: 'SOURCE_SSL'; -KW_SOURCE_SSL_CA: 'SOURCE_SSL_CA'; -KW_SOURCE_SSL_CAPATH: 'SOURCE_SSL_CAPATH'; -KW_SOURCE_SSL_CERT: 'SOURCE_SSL_CERT'; -KW_SOURCE_SSL_CRL: 'SOURCE_SSL_CRL'; -KW_SOURCE_SSL_CRLPATH: 'SOURCE_SSL_CRLPATH'; -KW_SOURCE_SSL_KEY: 'SOURCE_SSL_KEY'; -KW_SOURCE_SSL_CIPHER: 'SOURCE_SSL_CIPHER'; -KW_SOURCE_SSL_VERIFY_SERVER_CERT: 'SOURCE_SSL_VERIFY_SERVER_CERT'; -KW_SOURCE_TLS_VERSION: 'SOURCE_TLS_VERSION'; -KW_SOURCE_TLS_CIPHERSUITES: 'SOURCE_TLS_CIPHERSUITES'; -KW_SOURCE_PUBLIC_KEY_PATH: 'SOURCE_PUBLIC_KEY_PATH'; -KW_SQL_AFTER_GTIDS: 'SQL_AFTER_GTIDS'; -KW_SQL_AFTER_MTS_GAPS: 'SQL_AFTER_MTS_GAPS'; -KW_SQL_BEFORE_GTIDS: 'SQL_BEFORE_GTIDS'; -KW_SQL_BUFFER_RESULT: 'SQL_BUFFER_RESULT'; -KW_SQL_CACHE: 'SQL_CACHE'; -KW_SQL_NO_CACHE: 'SQL_NO_CACHE'; -KW_SQL_THREAD: 'SQL_THREAD'; -KW_START: 'START'; -KW_STARTS: 'STARTS'; -KW_STATS_AUTO_RECALC: 'STATS_AUTO_RECALC'; -KW_STATS_PERSISTENT: 'STATS_PERSISTENT'; -KW_STATS_SAMPLE_PAGES: 'STATS_SAMPLE_PAGES'; -KW_STATUS: 'STATUS'; -KW_STOP: 'STOP'; -KW_STORAGE: 'STORAGE'; -KW_STORED: 'STORED'; -KW_STRING: 'STRING'; -KW_SUBCLASS_ORIGIN: 'SUBCLASS_ORIGIN'; -KW_SUBJECT: 'SUBJECT'; -KW_SUBPARTITION: 'SUBPARTITION'; -KW_SUBPARTITIONS: 'SUBPARTITIONS'; -KW_SUSPEND: 'SUSPEND'; -KW_SWAPS: 'SWAPS'; -KW_SWITCHES: 'SWITCHES'; -KW_TABLE_NAME: 'TABLE_NAME'; -KW_TABLESPACE: 'TABLESPACE'; -KW_TABLE_TYPE: 'TABLE_TYPE'; -KW_TEMPORARY: 'TEMPORARY'; -KW_TEMPTABLE: 'TEMPTABLE'; -KW_THAN: 'THAN'; -KW_TRADITIONAL: 'TRADITIONAL'; -KW_TRANSACTION: 'TRANSACTION'; -KW_TRANSACTIONAL: 'TRANSACTIONAL'; -KW_TREE: 'TREE'; -KW_TRIGGERS: 'TRIGGERS'; -KW_TRUNCATE: 'TRUNCATE'; -KW_UNBOUNDED: 'UNBOUNDED'; -KW_UNDEFINED: 'UNDEFINED'; -KW_UNDOFILE: 'UNDOFILE'; -KW_UNDO_BUFFER_SIZE: 'UNDO_BUFFER_SIZE'; -KW_UNINSTALL: 'UNINSTALL'; -KW_UNKNOWN: 'UNKNOWN'; -KW_UNREGISTER: 'UNREGISTER'; -KW_UNTIL: 'UNTIL'; -KW_UPGRADE: 'UPGRADE'; -KW_USER: 'USER'; -KW_USE_FRM: 'USE_FRM'; -KW_USER_RESOURCES: 'USER_RESOURCES'; -KW_VALIDATION: 'VALIDATION'; -KW_VALUE: 'VALUE'; -KW_VARIABLES: 'VARIABLES'; -KW_VIEW: 'VIEW'; -KW_VIRTUAL: 'VIRTUAL'; -KW_VISIBLE: 'VISIBLE'; -KW_WAIT: 'WAIT'; -KW_WARNINGS: 'WARNINGS'; -KW_WINDOW: 'WINDOW'; -KW_WITHOUT: 'WITHOUT'; -KW_WORK: 'WORK'; -KW_WRAPPER: 'WRAPPER'; -KW_X509: 'X509'; -KW_XA: 'XA'; -KW_XML: 'XML'; - +KW_ACCOUNT : 'ACCOUNT'; +KW_ACTION : 'ACTION'; +KW_AFTER : 'AFTER'; +KW_AGGREGATE : 'AGGREGATE'; +KW_ALGORITHM : 'ALGORITHM'; +KW_ANY : 'ANY'; +KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS : 'ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS'; +KW_AT : 'AT'; +KW_AUTHORS : 'AUTHORS'; +KW_AUTOCOMMIT : 'AUTOCOMMIT'; +KW_AUTOEXTEND_SIZE : 'AUTOEXTEND_SIZE'; +KW_AUTO_INCREMENT : 'AUTO_INCREMENT'; +KW_AVG_ROW_LENGTH : 'AVG_ROW_LENGTH'; +KW_BEGIN : 'BEGIN'; +KW_BINLOG : 'BINLOG'; +KW_BIT : 'BIT'; +KW_BLOCK : 'BLOCK'; +KW_BOOL : 'BOOL'; +KW_BOOLEAN : 'BOOLEAN'; +KW_BTREE : 'BTREE'; +KW_CACHE : 'CACHE'; +KW_CASCADED : 'CASCADED'; +KW_CHAIN : 'CHAIN'; +KW_CHANGED : 'CHANGED'; +KW_CHANNEL : 'CHANNEL'; +KW_CHECKSUM : 'CHECKSUM'; +KW_CHALLENGE_RESPONSE : 'CHALLENGE_RESPONSE'; +KW_CIPHER : 'CIPHER'; +KW_CLASS_ORIGIN : 'CLASS_ORIGIN'; +KW_CLIENT : 'CLIENT'; +KW_CLOSE : 'CLOSE'; +KW_COALESCE : 'COALESCE'; +KW_CODE : 'CODE'; +KW_COLUMNS : 'COLUMNS'; +KW_COLUMN_FORMAT : 'COLUMN_FORMAT'; +KW_COLUMN_NAME : 'COLUMN_NAME'; +KW_COMMENT : 'COMMENT'; +KW_COMMIT : 'COMMIT'; +KW_COMPACT : 'COMPACT'; +KW_COMPLETION : 'COMPLETION'; +KW_COMPONENT : 'COMPONENT'; +KW_COMPRESSED : 'COMPRESSED'; +KW_COMPRESSION : 'COMPRESSION'; +KW_CONCURRENT : 'CONCURRENT'; +KW_CONNECT : 'CONNECT'; +KW_CONNECTION : 'CONNECTION'; +KW_CONSISTENT : 'CONSISTENT'; +KW_CONSTRAINT_CATALOG : 'CONSTRAINT_CATALOG'; +KW_CONSTRAINT_SCHEMA : 'CONSTRAINT_SCHEMA'; +KW_CONSTRAINT_NAME : 'CONSTRAINT_NAME'; +KW_CONTAINS : 'CONTAINS'; +KW_CONTEXT : 'CONTEXT'; +KW_CONTRIBUTORS : 'CONTRIBUTORS'; +KW_COPY : 'COPY'; +KW_CPU : 'CPU'; +KW_CURSOR_NAME : 'CURSOR_NAME'; +KW_DATA : 'DATA'; +KW_DATAFILE : 'DATAFILE'; +KW_DEALLOCATE : 'DEALLOCATE'; +KW_DEFAULT_AUTH : 'DEFAULT_AUTH'; +KW_DEFINER : 'DEFINER'; +KW_DELAY_KEY_WRITE : 'DELAY_KEY_WRITE'; +KW_DES_KEY_FILE : 'DES_KEY_FILE'; +KW_DIRECTORY : 'DIRECTORY'; +KW_DISABLE : 'DISABLE'; +KW_DISCARD : 'DISCARD'; +KW_DISK : 'DISK'; +KW_DO : 'DO'; +KW_DUMPFILE : 'DUMPFILE'; +KW_DUPLICATE : 'DUPLICATE'; +KW_DYNAMIC : 'DYNAMIC'; +KW_ENABLE : 'ENABLE'; +KW_ENCRYPTION : 'ENCRYPTION'; +KW_ENCRYPTION_KEY_ID : 'ENCRYPTION_KEY_ID'; +KW_END : 'END'; +KW_ENDS : 'ENDS'; +KW_ENGINE : 'ENGINE'; +KW_ENGINES : 'ENGINES'; +KW_ERROR : 'ERROR'; +KW_ERRORS : 'ERRORS'; +KW_ESCAPE : 'ESCAPE'; +KW_EVENT : 'EVENT'; +KW_EVENTS : 'EVENTS'; +KW_EVERY : 'EVERY'; +KW_EXCHANGE : 'EXCHANGE'; +KW_EXCLUSIVE : 'EXCLUSIVE'; +KW_EXPIRE : 'EXPIRE'; +KW_EXPORT : 'EXPORT'; +KW_EXTENDED : 'EXTENDED'; +KW_EXTENT_SIZE : 'EXTENT_SIZE'; +KW_FACTOR : 'FACTOR'; +KW_FAILED_LOGIN_ATTEMPTS : 'FAILED_LOGIN_ATTEMPTS'; +KW_FAST : 'FAST'; +KW_FAULTS : 'FAULTS'; +KW_FIELDS : 'FIELDS'; +KW_FILE_BLOCK_SIZE : 'FILE_BLOCK_SIZE'; +KW_FILTER : 'FILTER'; +KW_FINISH : 'FINISH'; +KW_FIRST : 'FIRST'; +KW_FIXED : 'FIXED'; +KW_FLUSH : 'FLUSH'; +KW_FOLLOWING : 'FOLLOWING'; +KW_FOLLOWS : 'FOLLOWS'; +KW_FOUND : 'FOUND'; +KW_FULL : 'FULL'; +KW_FUNCTION : 'FUNCTION'; +KW_GENERAL : 'GENERAL'; +KW_GET_MASTER_PUBLIC_KEY : 'GET_MASTER_PUBLIC_KEY'; +KW_GET_SOURCE_PUBLIC_KEY : 'GET_SOURCE_PUBLIC_KEY'; +KW_GLOBAL : 'GLOBAL'; +KW_GRANTS : 'GRANTS'; +KW_GROUP_REPLICATION : 'GROUP_REPLICATION'; +KW_GTID_ONLY : 'GTID_ONLY'; +KW_HANDLER : 'HANDLER'; +KW_HASH : 'HASH'; +KW_HELP : 'HELP'; +KW_HISTORY : 'HISTORY'; +KW_HOST : 'HOST'; +KW_HOSTS : 'HOSTS'; +KW_IDENTIFIED : 'IDENTIFIED'; +KW_IGNORE_SERVER_IDS : 'IGNORE_SERVER_IDS'; +KW_IMPORT : 'IMPORT'; +KW_INDEXES : 'INDEXES'; +KW_INITIAL : 'INITIAL'; +KW_INITIAL_SIZE : 'INITIAL_SIZE'; +KW_INITIATE : 'INITIATE'; +KW_INPLACE : 'INPLACE'; +KW_INSERT_METHOD : 'INSERT_METHOD'; +KW_INSTALL : 'INSTALL'; +KW_INSTANCE : 'INSTANCE'; +KW_INSTANT : 'INSTANT'; +KW_INVISIBLE : 'INVISIBLE'; +KW_INVOKER : 'INVOKER'; +KW_IO : 'IO'; +KW_IO_THREAD : 'IO_THREAD'; +KW_IPC : 'IPC'; +KW_ISOLATION : 'ISOLATION'; +KW_ISSUER : 'ISSUER'; +KW_JSON : 'JSON'; +KW_KEY_BLOCK_SIZE : 'KEY_BLOCK_SIZE'; +KW_LANGUAGE : 'LANGUAGE'; +KW_LAST : 'LAST'; +KW_LEAVES : 'LEAVES'; +KW_LESS : 'LESS'; +KW_LEVEL : 'LEVEL'; +KW_LIST : 'LIST'; +KW_LOCAL : 'LOCAL'; +KW_LOGFILE : 'LOGFILE'; +KW_LOGS : 'LOGS'; +KW_MASTER : 'MASTER'; +KW_MASTER_AUTO_POSITION : 'MASTER_AUTO_POSITION'; +KW_MASTER_COMPRESSION_ALGORITHMS : 'MASTER_COMPRESSION_ALGORITHMS'; +KW_MASTER_CONNECT_RETRY : 'MASTER_CONNECT_RETRY'; +KW_MASTER_DELAY : 'MASTER_DELAY'; +KW_MASTER_HEARTBEAT_PERIOD : 'MASTER_HEARTBEAT_PERIOD'; +KW_MASTER_HOST : 'MASTER_HOST'; +KW_MASTER_LOG_FILE : 'MASTER_LOG_FILE'; +KW_MASTER_LOG_POS : 'MASTER_LOG_POS'; +KW_MASTER_PASSWORD : 'MASTER_PASSWORD'; +KW_MASTER_PORT : 'MASTER_PORT'; +KW_MASTER_PUBLIC_KEY_PATH : 'MASTER_PUBLIC_KEY_PATH'; +KW_MASTER_RETRY_COUNT : 'MASTER_RETRY_COUNT'; +KW_MASTER_SSL : 'MASTER_SSL'; +KW_MASTER_SSL_CA : 'MASTER_SSL_CA'; +KW_MASTER_SSL_CAPATH : 'MASTER_SSL_CAPATH'; +KW_MASTER_SSL_CERT : 'MASTER_SSL_CERT'; +KW_MASTER_SSL_CIPHER : 'MASTER_SSL_CIPHER'; +KW_MASTER_SSL_CRL : 'MASTER_SSL_CRL'; +KW_MASTER_SSL_CRLPATH : 'MASTER_SSL_CRLPATH'; +KW_MASTER_SSL_KEY : 'MASTER_SSL_KEY'; +KW_MASTER_TLS_CIPHERSUITES : 'MASTER_TLS_CIPHERSUITES'; +KW_MASTER_TLS_VERSION : 'MASTER_TLS_VERSION'; +KW_MASTER_USER : 'MASTER_USER'; +KW_MASTER_ZSTD_COMPRESSION_LEVEL : 'MASTER_ZSTD_COMPRESSION_LEVEL'; +KW_MAX_CONNECTIONS_PER_HOUR : 'MAX_CONNECTIONS_PER_HOUR'; +KW_MAX_QUERIES_PER_HOUR : 'MAX_QUERIES_PER_HOUR'; +KW_MAX_ROWS : 'MAX_ROWS'; +KW_MAX_SIZE : 'MAX_SIZE'; +KW_MAX_UPDATES_PER_HOUR : 'MAX_UPDATES_PER_HOUR'; +KW_MAX_USER_CONNECTIONS : 'MAX_USER_CONNECTIONS'; +KW_MEDIUM : 'MEDIUM'; +KW_MEMBER : 'MEMBER'; +KW_MERGE : 'MERGE'; +KW_MESSAGE_TEXT : 'MESSAGE_TEXT'; +KW_MID : 'MID'; +KW_MIGRATE : 'MIGRATE'; +KW_MIN_ROWS : 'MIN_ROWS'; +KW_MODE : 'MODE'; +KW_MODIFY : 'MODIFY'; +KW_MUTEX : 'MUTEX'; +KW_MYSQL : 'MYSQL'; +KW_MYSQL_ERRNO : 'MYSQL_ERRNO'; +KW_NAME : 'NAME'; +KW_NAMES : 'NAMES'; +KW_NCHAR : 'NCHAR'; +KW_NETWORK_NAMESPACE : 'NETWORK_NAMESPACE'; +KW_NEVER : 'NEVER'; +KW_NEXT : 'NEXT'; +KW_NO : 'NO'; +KW_NOWAIT : 'NOWAIT'; +KW_NODEGROUP : 'NODEGROUP'; +KW_NONE : 'NONE'; +KW_ODBC : 'ODBC'; +KW_OFF : 'OFF'; +KW_OFFLINE : 'OFFLINE'; +KW_OFFSET : 'OFFSET'; +KW_OF : 'OF'; +KW_OLD : 'OLD'; +KW_OLD_PASSWORD : 'OLD_PASSWORD'; +KW_ONE : 'ONE'; +KW_ONLINE : 'ONLINE'; +KW_ONLY : 'ONLY'; +KW_OPEN : 'OPEN'; +KW_OPTIMIZER_COSTS : 'OPTIMIZER_COSTS'; +KW_OPTIONS : 'OPTIONS'; +KW_OWNER : 'OWNER'; +KW_PACK_KEYS : 'PACK_KEYS'; +KW_PAGE : 'PAGE'; +KW_PAGE_CHECKSUM : 'PAGE_CHECKSUM'; +KW_PAGE_COMPRESSED : 'PAGE_COMPRESSED'; +KW_PAGE_COMPRESSION_LEVEL : 'PAGE_COMPRESSION_LEVEL'; +KW_PARSER : 'PARSER'; +KW_PARTIAL : 'PARTIAL'; +KW_PARTITIONING : 'PARTITIONING'; +KW_PARTITIONS : 'PARTITIONS'; +KW_PASSWORD : 'PASSWORD'; +KW_PASSWORD_LOCK_TIME : 'PASSWORD_LOCK_TIME'; +KW_PERSIST : 'PERSIST'; +KW_PERSIST_ONLY : 'PERSIST_ONLY'; +KW_PHASE : 'PHASE'; +KW_PLUGIN : 'PLUGIN'; +KW_PLUGIN_DIR : 'PLUGIN_DIR'; +KW_PLUGINS : 'PLUGINS'; +KW_PORT : 'PORT'; +KW_PRECEDES : 'PRECEDES'; +KW_PRECEDING : 'PRECEDING'; +KW_PREPARE : 'PREPARE'; +KW_PRESERVE : 'PRESERVE'; +KW_PREV : 'PREV'; +KW_PRIVILEGE_CHECKS_USER : 'PRIVILEGE_CHECKS_USER'; +KW_PROCESSLIST : 'PROCESSLIST'; +KW_PROFILE : 'PROFILE'; +KW_PROFILES : 'PROFILES'; +KW_PROXY : 'PROXY'; +KW_QUERY : 'QUERY'; +KW_QUICK : 'QUICK'; +KW_REBUILD : 'REBUILD'; +KW_RECOVER : 'RECOVER'; +KW_RECURSIVE : 'RECURSIVE'; +KW_REDO_BUFFER_SIZE : 'REDO_BUFFER_SIZE'; +KW_REDUNDANT : 'REDUNDANT'; +KW_REGISTRATION : 'REGISTRATION'; +KW_RELAY : 'RELAY'; +KW_RELAY_LOG_FILE : 'RELAY_LOG_FILE'; +KW_RELAY_LOG_POS : 'RELAY_LOG_POS'; +KW_RELAYLOG : 'RELAYLOG'; +KW_REMOVE : 'REMOVE'; +KW_REORGANIZE : 'REORGANIZE'; +KW_REPAIR : 'REPAIR'; +KW_REPLICA : 'REPLICA'; +KW_REPLICAS : 'REPLICAS'; +KW_REPLICATE_DO_DB : 'REPLICATE_DO_DB'; +KW_REPLICATE_DO_TABLE : 'REPLICATE_DO_TABLE'; +KW_REPLICATE_IGNORE_DB : 'REPLICATE_IGNORE_DB'; +KW_REPLICATE_IGNORE_TABLE : 'REPLICATE_IGNORE_TABLE'; +KW_REPLICATE_REWRITE_DB : 'REPLICATE_REWRITE_DB'; +KW_REPLICATE_WILD_DO_TABLE : 'REPLICATE_WILD_DO_TABLE'; +KW_REPLICATE_WILD_IGNORE_TABLE : 'REPLICATE_WILD_IGNORE_TABLE'; +KW_REPLICATION : 'REPLICATION'; +KW_REQUIRE_ROW_FORMAT : 'REQUIRE_ROW_FORMAT'; +KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK : 'REQUIRE_TABLE_PRIMARY_KEY_CHECK'; +KW_RESET : 'RESET'; +KW_RESTART : 'RESTART'; +KW_RESUME : 'RESUME'; +KW_RETURNED_SQLSTATE : 'RETURNED_SQLSTATE'; +KW_RETURNING : 'RETURNING'; +KW_RETURNS : 'RETURNS'; +KW_REUSE : 'REUSE'; +KW_ROLE : 'ROLE'; +KW_ROLLBACK : 'ROLLBACK'; +KW_ROLLUP : 'ROLLUP'; +KW_ROTATE : 'ROTATE'; +KW_ROW : 'ROW'; +KW_ROWS : 'ROWS'; +KW_ROW_FORMAT : 'ROW_FORMAT'; +KW_SAVEPOINT : 'SAVEPOINT'; +KW_SCHEDULE : 'SCHEDULE'; +KW_SECURITY : 'SECURITY'; +KW_SERVER : 'SERVER'; +KW_SESSION : 'SESSION'; +KW_SHARE : 'SHARE'; +KW_SHARED : 'SHARED'; +KW_SIGNED : 'SIGNED'; +KW_SIMPLE : 'SIMPLE'; +KW_SLAVE : 'SLAVE'; +KW_SLOW : 'SLOW'; +KW_SNAPSHOT : 'SNAPSHOT'; +KW_SOCKET : 'SOCKET'; +KW_SOME : 'SOME'; +KW_SONAME : 'SONAME'; +KW_SOUNDS : 'SOUNDS'; +KW_SOURCE : 'SOURCE'; +KW_SOURCE_BIND : 'SOURCE_BIND'; +KW_SOURCE_HOST : 'SOURCE_HOST'; +KW_SOURCE_USER : 'SOURCE_USER'; +KW_SOURCE_PASSWORD : 'SOURCE_PASSWORD'; +KW_SOURCE_PORT : 'SOURCE_PORT'; +KW_SOURCE_LOG_FILE : 'SOURCE_LOG_FILE'; +KW_SOURCE_LOG_POS : 'SOURCE_LOG_POS'; +KW_SOURCE_AUTO_POSITION : 'SOURCE_AUTO_POSITION'; +KW_SOURCE_HEARTBEAT_PERIOD : 'SOURCE_HEARTBEAT_PERIOD'; +KW_SOURCE_CONNECT_RETRY : 'SOURCE_CONNECT_RETRY'; +KW_SOURCE_RETRY_COUNT : 'SOURCE_RETRY_COUNT'; +KW_SOURCE_CONNECTION_AUTO_FAILOVER : 'SOURCE_CONNECTION_AUTO_FAILOVER'; +KW_SOURCE_DELAY : 'SOURCE_DELAY'; +KW_SOURCE_COMPRESSION_ALGORITHMS : 'SOURCE_COMPRESSION_ALGORITHMS'; +KW_SOURCE_ZSTD_COMPRESSION_LEVEL : 'SOURCE_ZSTD_COMPRESSION_LEVEL'; +KW_SOURCE_SSL : 'SOURCE_SSL'; +KW_SOURCE_SSL_CA : 'SOURCE_SSL_CA'; +KW_SOURCE_SSL_CAPATH : 'SOURCE_SSL_CAPATH'; +KW_SOURCE_SSL_CERT : 'SOURCE_SSL_CERT'; +KW_SOURCE_SSL_CRL : 'SOURCE_SSL_CRL'; +KW_SOURCE_SSL_CRLPATH : 'SOURCE_SSL_CRLPATH'; +KW_SOURCE_SSL_KEY : 'SOURCE_SSL_KEY'; +KW_SOURCE_SSL_CIPHER : 'SOURCE_SSL_CIPHER'; +KW_SOURCE_SSL_VERIFY_SERVER_CERT : 'SOURCE_SSL_VERIFY_SERVER_CERT'; +KW_SOURCE_TLS_VERSION : 'SOURCE_TLS_VERSION'; +KW_SOURCE_TLS_CIPHERSUITES : 'SOURCE_TLS_CIPHERSUITES'; +KW_SOURCE_PUBLIC_KEY_PATH : 'SOURCE_PUBLIC_KEY_PATH'; +KW_SQL_AFTER_GTIDS : 'SQL_AFTER_GTIDS'; +KW_SQL_AFTER_MTS_GAPS : 'SQL_AFTER_MTS_GAPS'; +KW_SQL_BEFORE_GTIDS : 'SQL_BEFORE_GTIDS'; +KW_SQL_BUFFER_RESULT : 'SQL_BUFFER_RESULT'; +KW_SQL_CACHE : 'SQL_CACHE'; +KW_SQL_NO_CACHE : 'SQL_NO_CACHE'; +KW_SQL_THREAD : 'SQL_THREAD'; +KW_START : 'START'; +KW_STARTS : 'STARTS'; +KW_STATS_AUTO_RECALC : 'STATS_AUTO_RECALC'; +KW_STATS_PERSISTENT : 'STATS_PERSISTENT'; +KW_STATS_SAMPLE_PAGES : 'STATS_SAMPLE_PAGES'; +KW_STATUS : 'STATUS'; +KW_STOP : 'STOP'; +KW_STORAGE : 'STORAGE'; +KW_STORED : 'STORED'; +KW_STRING : 'STRING'; +KW_SUBCLASS_ORIGIN : 'SUBCLASS_ORIGIN'; +KW_SUBJECT : 'SUBJECT'; +KW_SUBPARTITION : 'SUBPARTITION'; +KW_SUBPARTITIONS : 'SUBPARTITIONS'; +KW_SUSPEND : 'SUSPEND'; +KW_SWAPS : 'SWAPS'; +KW_SWITCHES : 'SWITCHES'; +KW_TABLE_NAME : 'TABLE_NAME'; +KW_TABLESPACE : 'TABLESPACE'; +KW_TABLE_TYPE : 'TABLE_TYPE'; +KW_TEMPORARY : 'TEMPORARY'; +KW_TEMPTABLE : 'TEMPTABLE'; +KW_THAN : 'THAN'; +KW_TRADITIONAL : 'TRADITIONAL'; +KW_TRANSACTION : 'TRANSACTION'; +KW_TRANSACTIONAL : 'TRANSACTIONAL'; +KW_TREE : 'TREE'; +KW_TRIGGERS : 'TRIGGERS'; +KW_TRUNCATE : 'TRUNCATE'; +KW_UNBOUNDED : 'UNBOUNDED'; +KW_UNDEFINED : 'UNDEFINED'; +KW_UNDOFILE : 'UNDOFILE'; +KW_UNDO_BUFFER_SIZE : 'UNDO_BUFFER_SIZE'; +KW_UNINSTALL : 'UNINSTALL'; +KW_UNKNOWN : 'UNKNOWN'; +KW_UNREGISTER : 'UNREGISTER'; +KW_UNTIL : 'UNTIL'; +KW_UPGRADE : 'UPGRADE'; +KW_USER : 'USER'; +KW_USE_FRM : 'USE_FRM'; +KW_USER_RESOURCES : 'USER_RESOURCES'; +KW_VALIDATION : 'VALIDATION'; +KW_VALUE : 'VALUE'; +KW_VARIABLES : 'VARIABLES'; +KW_VIEW : 'VIEW'; +KW_VIRTUAL : 'VIRTUAL'; +KW_VISIBLE : 'VISIBLE'; +KW_WAIT : 'WAIT'; +KW_WARNINGS : 'WARNINGS'; +KW_WINDOW : 'WINDOW'; +KW_WITHOUT : 'WITHOUT'; +KW_WORK : 'WORK'; +KW_WRAPPER : 'WRAPPER'; +KW_X509 : 'X509'; +KW_XA : 'XA'; +KW_XML : 'XML'; // Interval type Keywords -KW_QUARTER: 'QUARTER'; -KW_MONTH: 'MONTH'; -KW_DAY: 'DAY'; -KW_HOUR: 'HOUR'; -KW_MINUTE: 'MINUTE'; -KW_WEEK: 'WEEK'; -KW_SECOND: 'SECOND'; -KW_MICROSECOND: 'MICROSECOND'; - +KW_QUARTER : 'QUARTER'; +KW_MONTH : 'MONTH'; +KW_DAY : 'DAY'; +KW_HOUR : 'HOUR'; +KW_MINUTE : 'MINUTE'; +KW_WEEK : 'WEEK'; +KW_SECOND : 'SECOND'; +KW_MICROSECOND : 'MICROSECOND'; // PRIVILEGES -KW_ADMIN: 'ADMIN'; -KW_APPLICATION_PASSWORD_ADMIN: 'APPLICATION_PASSWORD_ADMIN'; -KW_AUDIT_ABORT_EXEMPT: 'AUDIT_ABORT_EXEMPT'; -KW_AUDIT_ADMIN: 'AUDIT_ADMIN'; -KW_AUTHENTICATION: 'AUTHENTICATION'; -KW_AUTHENTICATION_POLICY_ADMIN: 'AUTHENTICATION_POLICY_ADMIN'; -KW_BACKUP_ADMIN: 'BACKUP_ADMIN'; -KW_BINLOG_ADMIN: 'BINLOG_ADMIN'; -KW_BINLOG_ENCRYPTION_ADMIN: 'BINLOG_ENCRYPTION_ADMIN'; -KW_CLONE: 'CLONE'; -KW_CLONE_ADMIN: 'CLONE_ADMIN'; -KW_CONNECTION_ADMIN: 'CONNECTION_ADMIN'; -KW_ENCRYPTION_KEY_ADMIN: 'ENCRYPTION_KEY_ADMIN'; -KW_EXECUTE: 'EXECUTE'; -KW_FILE: 'FILE'; -KW_FIREWALL_ADMIN: 'FIREWALL_ADMIN'; -KW_FIREWALL_EXEMPT: 'FIREWALL_EXEMPT'; -KW_FIREWALL_USER: 'FIREWALL_USER'; -KW_FLUSH_OPTIMIZER_COSTS: 'FLUSH_OPTIMIZER_COSTS'; -KW_FLUSH_STATUS: 'FLUSH_STATUS'; -KW_FLUSH_TABLES: 'FLUSH_TABLES'; -KW_FLUSH_USER_RESOURCES: 'FLUSH_USER_RESOURCES'; -KW_GROUP_REPLICATION_ADMIN: 'GROUP_REPLICATION_ADMIN'; -KW_INNODB_REDO_LOG_ARCHIVE: 'INNODB_REDO_LOG_ARCHIVE'; -KW_INNODB_REDO_LOG_ENABLE: 'INNODB_REDO_LOG_ENABLE'; -KW_INVOKE: 'INVOKE'; -KW_LAMBDA: 'LAMBDA'; -KW_NDB_STORED_USER: 'NDB_STORED_USER'; -KW_PASSWORDLESS_USER_ADMIN: 'PASSWORDLESS_USER_ADMIN'; -KW_PERSIST_RO_VARIABLES_ADMIN: 'PERSIST_RO_VARIABLES_ADMIN'; -KW_PRIVILEGES: 'PRIVILEGES'; -KW_PROCESS: 'PROCESS'; -KW_RELOAD: 'RELOAD'; -KW_REPLICATION_APPLIER: 'REPLICATION_APPLIER'; -KW_REPLICATION_SLAVE_ADMIN: 'REPLICATION_SLAVE_ADMIN'; -KW_RESOURCE: 'RESOURCE'; -KW_RESOURCE_GROUP_ADMIN: 'RESOURCE_GROUP_ADMIN'; -KW_RESOURCE_GROUP_USER: 'RESOURCE_GROUP_USER'; -KW_ROLE_ADMIN: 'ROLE_ADMIN'; -KW_ROUTINE: 'ROUTINE'; -KW_S3: 'S3'; -KW_SERVICE_CONNECTION_ADMIN: 'SERVICE_CONNECTION_ADMIN'; -KW_SESSION_VARIABLES_ADMIN: QUOTE_SYMB? 'SESSION_VARIABLES_ADMIN' QUOTE_SYMB?; -KW_SET_USER_ID: 'SET_USER_ID'; -KW_SHOW_ROUTINE: 'SHOW_ROUTINE'; -KW_SHUTDOWN: 'SHUTDOWN'; -KW_SUPER: 'SUPER'; -KW_SYSTEM_VARIABLES_ADMIN: 'SYSTEM_VARIABLES_ADMIN'; -KW_TABLES: 'TABLES'; -KW_TABLE_ENCRYPTION_ADMIN: 'TABLE_ENCRYPTION_ADMIN'; -KW_VERSION_TOKEN_ADMIN: 'VERSION_TOKEN_ADMIN'; -KW_XA_RECOVER_ADMIN: 'XA_RECOVER_ADMIN'; - +KW_ADMIN : 'ADMIN'; +KW_APPLICATION_PASSWORD_ADMIN : 'APPLICATION_PASSWORD_ADMIN'; +KW_AUDIT_ABORT_EXEMPT : 'AUDIT_ABORT_EXEMPT'; +KW_AUDIT_ADMIN : 'AUDIT_ADMIN'; +KW_AUTHENTICATION : 'AUTHENTICATION'; +KW_AUTHENTICATION_POLICY_ADMIN : 'AUTHENTICATION_POLICY_ADMIN'; +KW_BACKUP_ADMIN : 'BACKUP_ADMIN'; +KW_BINLOG_ADMIN : 'BINLOG_ADMIN'; +KW_BINLOG_ENCRYPTION_ADMIN : 'BINLOG_ENCRYPTION_ADMIN'; +KW_CLONE : 'CLONE'; +KW_CLONE_ADMIN : 'CLONE_ADMIN'; +KW_CONNECTION_ADMIN : 'CONNECTION_ADMIN'; +KW_ENCRYPTION_KEY_ADMIN : 'ENCRYPTION_KEY_ADMIN'; +KW_EXECUTE : 'EXECUTE'; +KW_FILE : 'FILE'; +KW_FIREWALL_ADMIN : 'FIREWALL_ADMIN'; +KW_FIREWALL_EXEMPT : 'FIREWALL_EXEMPT'; +KW_FIREWALL_USER : 'FIREWALL_USER'; +KW_FLUSH_OPTIMIZER_COSTS : 'FLUSH_OPTIMIZER_COSTS'; +KW_FLUSH_STATUS : 'FLUSH_STATUS'; +KW_FLUSH_TABLES : 'FLUSH_TABLES'; +KW_FLUSH_USER_RESOURCES : 'FLUSH_USER_RESOURCES'; +KW_GROUP_REPLICATION_ADMIN : 'GROUP_REPLICATION_ADMIN'; +KW_INNODB_REDO_LOG_ARCHIVE : 'INNODB_REDO_LOG_ARCHIVE'; +KW_INNODB_REDO_LOG_ENABLE : 'INNODB_REDO_LOG_ENABLE'; +KW_INVOKE : 'INVOKE'; +KW_LAMBDA : 'LAMBDA'; +KW_NDB_STORED_USER : 'NDB_STORED_USER'; +KW_PASSWORDLESS_USER_ADMIN : 'PASSWORDLESS_USER_ADMIN'; +KW_PERSIST_RO_VARIABLES_ADMIN : 'PERSIST_RO_VARIABLES_ADMIN'; +KW_PRIVILEGES : 'PRIVILEGES'; +KW_PROCESS : 'PROCESS'; +KW_RELOAD : 'RELOAD'; +KW_REPLICATION_APPLIER : 'REPLICATION_APPLIER'; +KW_REPLICATION_SLAVE_ADMIN : 'REPLICATION_SLAVE_ADMIN'; +KW_RESOURCE : 'RESOURCE'; +KW_RESOURCE_GROUP_ADMIN : 'RESOURCE_GROUP_ADMIN'; +KW_RESOURCE_GROUP_USER : 'RESOURCE_GROUP_USER'; +KW_ROLE_ADMIN : 'ROLE_ADMIN'; +KW_ROUTINE : 'ROUTINE'; +KW_S3 : 'S3'; +KW_SERVICE_CONNECTION_ADMIN : 'SERVICE_CONNECTION_ADMIN'; +KW_SESSION_VARIABLES_ADMIN : QUOTE_SYMB? 'SESSION_VARIABLES_ADMIN' QUOTE_SYMB?; +KW_SET_USER_ID : 'SET_USER_ID'; +KW_SHOW_ROUTINE : 'SHOW_ROUTINE'; +KW_SHUTDOWN : 'SHUTDOWN'; +KW_SUPER : 'SUPER'; +KW_SYSTEM_VARIABLES_ADMIN : 'SYSTEM_VARIABLES_ADMIN'; +KW_TABLES : 'TABLES'; +KW_TABLE_ENCRYPTION_ADMIN : 'TABLE_ENCRYPTION_ADMIN'; +KW_VERSION_TOKEN_ADMIN : 'VERSION_TOKEN_ADMIN'; +KW_XA_RECOVER_ADMIN : 'XA_RECOVER_ADMIN'; // Charsets -KW_ARMSCII8: 'ARMSCII8'; -KW_ASCII: 'ASCII'; -KW_BIG5: 'BIG5'; -KW_CP1250: 'CP1250'; -KW_CP1251: 'CP1251'; -KW_CP1256: 'CP1256'; -KW_CP1257: 'CP1257'; -KW_CP850: 'CP850'; -KW_CP852: 'CP852'; -KW_CP866: 'CP866'; -KW_CP932: 'CP932'; -KW_DEC8: 'DEC8'; -KW_EUCJPMS: 'EUCJPMS'; -KW_EUCKR: 'EUCKR'; -KW_GB18030: 'GB18030'; -KW_GB2312: 'GB2312'; -KW_GBK: 'GBK'; -KW_GEOSTD8: 'GEOSTD8'; -KW_GREEK: 'GREEK'; -KW_HEBREW: 'HEBREW'; -KW_HP8: 'HP8'; -KW_KEYBCS2: 'KEYBCS2'; -KW_KOI8R: 'KOI8R'; -KW_KOI8U: 'KOI8U'; -KW_LATIN1: 'LATIN1'; -KW_LATIN2: 'LATIN2'; -KW_LATIN5: 'LATIN5'; -KW_LATIN7: 'LATIN7'; -KW_MACCE: 'MACCE'; -KW_MACROMAN: 'MACROMAN'; -KW_SJIS: 'SJIS'; -KW_SWE7: 'SWE7'; -KW_TIS620: 'TIS620'; -KW_UCS2: 'UCS2'; -KW_UJIS: 'UJIS'; -KW_UTF16: 'UTF16'; -KW_UTF16LE: 'UTF16LE'; -KW_UTF32: 'UTF32'; -KW_UTF8: 'UTF8'; -KW_UTF8MB3: 'UTF8MB3'; -KW_UTF8MB4: 'UTF8MB4'; - +KW_ARMSCII8 : 'ARMSCII8'; +KW_ASCII : 'ASCII'; +KW_BIG5 : 'BIG5'; +KW_CP1250 : 'CP1250'; +KW_CP1251 : 'CP1251'; +KW_CP1256 : 'CP1256'; +KW_CP1257 : 'CP1257'; +KW_CP850 : 'CP850'; +KW_CP852 : 'CP852'; +KW_CP866 : 'CP866'; +KW_CP932 : 'CP932'; +KW_DEC8 : 'DEC8'; +KW_EUCJPMS : 'EUCJPMS'; +KW_EUCKR : 'EUCKR'; +KW_GB18030 : 'GB18030'; +KW_GB2312 : 'GB2312'; +KW_GBK : 'GBK'; +KW_GEOSTD8 : 'GEOSTD8'; +KW_GREEK : 'GREEK'; +KW_HEBREW : 'HEBREW'; +KW_HP8 : 'HP8'; +KW_KEYBCS2 : 'KEYBCS2'; +KW_KOI8R : 'KOI8R'; +KW_KOI8U : 'KOI8U'; +KW_LATIN1 : 'LATIN1'; +KW_LATIN2 : 'LATIN2'; +KW_LATIN5 : 'LATIN5'; +KW_LATIN7 : 'LATIN7'; +KW_MACCE : 'MACCE'; +KW_MACROMAN : 'MACROMAN'; +KW_SJIS : 'SJIS'; +KW_SWE7 : 'SWE7'; +KW_TIS620 : 'TIS620'; +KW_UCS2 : 'UCS2'; +KW_UJIS : 'UJIS'; +KW_UTF16 : 'UTF16'; +KW_UTF16LE : 'UTF16LE'; +KW_UTF32 : 'UTF32'; +KW_UTF8 : 'UTF8'; +KW_UTF8MB3 : 'UTF8MB3'; +KW_UTF8MB4 : 'UTF8MB4'; // DB Engines -KW_ARCHIVE: 'ARCHIVE'; -KW_BLACKHOLE: 'BLACKHOLE'; -KW_CSV: 'CSV'; -KW_FEDERATED: 'FEDERATED'; -KW_INNODB: 'INNODB'; -KW_MEMORY: 'MEMORY'; -KW_MRG_MYISAM: 'MRG_MYISAM'; -KW_MYISAM: 'MYISAM'; -KW_NDB: 'NDB'; -KW_NDBCLUSTER: 'NDBCLUSTER'; -KW_PERFORMANCE_SCHEMA: 'PERFORMANCE_SCHEMA'; -KW_TOKUDB: 'TOKUDB'; - +KW_ARCHIVE : 'ARCHIVE'; +KW_BLACKHOLE : 'BLACKHOLE'; +KW_CSV : 'CSV'; +KW_FEDERATED : 'FEDERATED'; +KW_INNODB : 'INNODB'; +KW_MEMORY : 'MEMORY'; +KW_MRG_MYISAM : 'MRG_MYISAM'; +KW_MYISAM : 'MYISAM'; +KW_NDB : 'NDB'; +KW_NDBCLUSTER : 'NDBCLUSTER'; +KW_PERFORMANCE_SCHEMA : 'PERFORMANCE_SCHEMA'; +KW_TOKUDB : 'TOKUDB'; // Transaction Levels -KW_REPEATABLE: 'REPEATABLE'; -KW_COMMITTED: 'COMMITTED'; -KW_UNCOMMITTED: 'UNCOMMITTED'; -KW_SERIALIZABLE: 'SERIALIZABLE'; - +KW_REPEATABLE : 'REPEATABLE'; +KW_COMMITTED : 'COMMITTED'; +KW_UNCOMMITTED : 'UNCOMMITTED'; +KW_SERIALIZABLE : 'SERIALIZABLE'; // Spatial data types -KW_GEOMETRYCOLLECTION: 'GEOMETRYCOLLECTION'; -KW_GEOMCOLLECTION: 'GEOMCOLLECTION'; -KW_GEOMETRY: 'GEOMETRY'; -KW_LINESTRING: 'LINESTRING'; -KW_MULTILINESTRING: 'MULTILINESTRING'; -KW_MULTIPOINT: 'MULTIPOINT'; -KW_MULTIPOLYGON: 'MULTIPOLYGON'; -KW_POINT: 'POINT'; -KW_POLYGON: 'POLYGON'; - +KW_GEOMETRYCOLLECTION : 'GEOMETRYCOLLECTION'; +KW_GEOMCOLLECTION : 'GEOMCOLLECTION'; +KW_GEOMETRY : 'GEOMETRY'; +KW_LINESTRING : 'LINESTRING'; +KW_MULTILINESTRING : 'MULTILINESTRING'; +KW_MULTIPOINT : 'MULTIPOINT'; +KW_MULTIPOLYGON : 'MULTIPOLYGON'; +KW_POINT : 'POINT'; +KW_POLYGON : 'POLYGON'; // Common function names -KW_CATALOG_NAME: 'CATALOG_NAME'; -KW_CHARSET: 'CHARSET'; -KW_COLLATION: 'COLLATION'; -KW_ENGINE_ATTRIBUTE: 'ENGINE_ATTRIBUTE'; -KW_FORMAT: 'FORMAT'; -KW_GET_FORMAT: 'GET_FORMAT'; -KW_INTERSECT: 'INTERSECT'; -KW_RANDOM: 'RANDOM'; -KW_REVERSE: 'REVERSE'; -KW_ROW_COUNT: 'ROW_COUNT'; -KW_SCHEMA_NAME: 'SCHEMA_NAME'; -KW_SECONDARY_ENGINE_ATTRIBUTE: 'SECONDARY_ENGINE_ATTRIBUTE'; -KW_SRID: 'SRID'; -KW_SYSTEM: 'SYSTEM'; -KW_SYSTEM_USER: 'SYSTEM_USER'; -KW_THREAD_PRIORITY: 'THREAD_PRIORITY'; -KW_TP_CONNECTION_ADMIN: 'TP_CONNECTION_ADMIN'; -KW_TYPE: 'TYPE'; -KW_WEIGHT_STRING: 'WEIGHT_STRING'; - +KW_CATALOG_NAME : 'CATALOG_NAME'; +KW_CHARSET : 'CHARSET'; +KW_COLLATION : 'COLLATION'; +KW_ENGINE_ATTRIBUTE : 'ENGINE_ATTRIBUTE'; +KW_FORMAT : 'FORMAT'; +KW_GET_FORMAT : 'GET_FORMAT'; +KW_INTERSECT : 'INTERSECT'; +KW_RANDOM : 'RANDOM'; +KW_REVERSE : 'REVERSE'; +KW_ROW_COUNT : 'ROW_COUNT'; +KW_SCHEMA_NAME : 'SCHEMA_NAME'; +KW_SECONDARY_ENGINE_ATTRIBUTE : 'SECONDARY_ENGINE_ATTRIBUTE'; +KW_SRID : 'SRID'; +KW_SYSTEM : 'SYSTEM'; +KW_SYSTEM_USER : 'SYSTEM_USER'; +KW_THREAD_PRIORITY : 'THREAD_PRIORITY'; +KW_TP_CONNECTION_ADMIN : 'TP_CONNECTION_ADMIN'; +KW_TYPE : 'TYPE'; +KW_WEIGHT_STRING : 'WEIGHT_STRING'; // Operators // Operators. Assigns -VAR_ASSIGN: ':='; -PLUS_ASSIGN: '+='; -MINUS_ASSIGN: '-='; -MULT_ASSIGN: '*='; -DIV_ASSIGN: '/='; -MOD_ASSIGN: '%='; -AND_ASSIGN: '&='; -XOR_ASSIGN: '^='; -OR_ASSIGN: '|='; - +VAR_ASSIGN : ':='; +PLUS_ASSIGN : '+='; +MINUS_ASSIGN : '-='; +MULT_ASSIGN : '*='; +DIV_ASSIGN : '/='; +MOD_ASSIGN : '%='; +AND_ASSIGN : '&='; +XOR_ASSIGN : '^='; +OR_ASSIGN : '|='; // Operators. Arithmetics -STAR: '*'; -DIVIDE: '/'; -MODULE: '%'; -PLUS: '+'; -MINUS: '-'; -DIV: 'DIV'; -MOD: 'MOD'; - +STAR : '*'; +DIVIDE : '/'; +MODULE : '%'; +PLUS : '+'; +MINUS : '-'; +DIV : 'DIV'; +MOD : 'MOD'; // Operators. Comparation -EQUAL_SYMBOL: '='; -GREATER_SYMBOL: '>'; -LESS_SYMBOL: '<'; -EXCLAMATION_SYMBOL: '!'; - +EQUAL_SYMBOL : '='; +GREATER_SYMBOL : '>'; +LESS_SYMBOL : '<'; +EXCLAMATION_SYMBOL : '!'; // Operators. Bit -BIT_NOT_OP: '~'; -BIT_OR_OP: '|'; -BIT_AND_OP: '&'; -BIT_XOR_OP: '^'; - +BIT_NOT_OP : '~'; +BIT_OR_OP : '|'; +BIT_AND_OP : '&'; +BIT_XOR_OP : '^'; // Constructors symbols -DOT: '.'; -LR_BRACKET: '('; -RR_BRACKET: ')'; -COMMA: ','; -SEMI: ';'; -AT_SIGN: '@'; -ZERO_DECIMAL: '0'; -ONE_DECIMAL: '1'; -TWO_DECIMAL: '2'; -THREE_DECIMAL: '3'; -SINGLE_QUOTE_SYMB: '\''; -DOUBLE_QUOTE_SYMB: '"'; -REVERSE_QUOTE_SYMB: '`'; -COLON_SYMB: ':'; - -fragment QUOTE_SYMB - : SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB | REVERSE_QUOTE_SYMB - ; +DOT : '.'; +LR_BRACKET : '('; +RR_BRACKET : ')'; +COMMA : ','; +SEMI : ';'; +AT_SIGN : '@'; +ZERO_DECIMAL : '0'; +ONE_DECIMAL : '1'; +TWO_DECIMAL : '2'; +THREE_DECIMAL : '3'; +SINGLE_QUOTE_SYMB : '\''; +DOUBLE_QUOTE_SYMB : '"'; +REVERSE_QUOTE_SYMB : '`'; +COLON_SYMB : ':'; +fragment QUOTE_SYMB: SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB | REVERSE_QUOTE_SYMB; // Charsets -CHARSET_REVERSE_QOUTE_STRING: '`' CHARSET_NAME '`'; - +CHARSET_REVERSE_QOUTE_STRING: '`' CHARSET_NAME '`'; // File's sizes -FILESIZE_LITERAL: DEC_DIGIT+ ('K'|'M'|'G'|'T'); - +FILESIZE_LITERAL: DEC_DIGIT+ ('K' | 'M' | 'G' | 'T'); // Literal Primitives -START_NATIONAL_STRING_LITERAL: 'N' SQUOTA_STRING; -STRING_LITERAL: DQUOTA_STRING | SQUOTA_STRING | BQUOTA_STRING; -DECIMAL_LITERAL: DEC_DIGIT+; -HEXADECIMAL_LITERAL: 'X' '\'' (HEX_DIGIT HEX_DIGIT)+ '\'' - | '0X' HEX_DIGIT+; - -REAL_LITERAL: DEC_DIGIT* '.' DEC_DIGIT+ - | DEC_DIGIT+ '.' EXPONENT_NUM_PART - | DEC_DIGIT* '.' (DEC_DIGIT+ EXPONENT_NUM_PART) - | DEC_DIGIT+ EXPONENT_NUM_PART; -NULL_SPEC_LITERAL: '\\' 'N'; -BIT_STRING: BIT_STRING_L; -STRING_CHARSET_NAME: '_' CHARSET_NAME; +START_NATIONAL_STRING_LITERAL : 'N' SQUOTA_STRING; +STRING_LITERAL : DQUOTA_STRING | SQUOTA_STRING | BQUOTA_STRING; +DECIMAL_LITERAL : DEC_DIGIT+; +HEXADECIMAL_LITERAL : 'X' '\'' (HEX_DIGIT HEX_DIGIT)+ '\'' | '0X' HEX_DIGIT+; +REAL_LITERAL: + DEC_DIGIT* '.' DEC_DIGIT+ + | DEC_DIGIT+ '.' EXPONENT_NUM_PART + | DEC_DIGIT* '.' (DEC_DIGIT+ EXPONENT_NUM_PART) + | DEC_DIGIT+ EXPONENT_NUM_PART; +NULL_SPEC_LITERAL : '\\' 'N'; +BIT_STRING : BIT_STRING_L; +STRING_CHARSET_NAME : '_' CHARSET_NAME; // Identifiers -ID: ID_LITERAL; +ID: ID_LITERAL; // DOUBLE_QUOTE_ID: '"' ~'"'+ '"'; -REVERSE_QUOTE_ID: BQUOTA_STRING; -HOST_IP_ADDRESS: (AT_SIGN IP_ADDRESS); -LOCAL_ID: AT_SIGN - ( - STRING_LITERAL | [A-Z0-9._$\u0080-\uFFFF]+ - ); -GLOBAL_ID: AT_SIGN AT_SIGN - ( - [A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING - ); -PERSIST_ID: AT_SIGN AT_SIGN - ( - [A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING - ); - +REVERSE_QUOTE_ID : BQUOTA_STRING; +HOST_IP_ADDRESS : (AT_SIGN IP_ADDRESS); +LOCAL_ID : AT_SIGN ( STRING_LITERAL | [A-Z0-9._$\u0080-\uFFFF]+); +GLOBAL_ID : AT_SIGN AT_SIGN ( [A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING); +PERSIST_ID : AT_SIGN AT_SIGN ( [A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING); // Fragments for Literal primitives -fragment CHARSET_NAME: KW_ARMSCII8 | KW_ASCII | KW_BIG5 | KW_BINARY | KW_CP1250 - | KW_CP1251 | KW_CP1256 | KW_CP1257 | KW_CP850 - | KW_CP852 | KW_CP866 | KW_CP932 | KW_DEC8 | KW_EUCJPMS - | KW_EUCKR | KW_GB2312 | KW_GBK | KW_GEOSTD8 | KW_GREEK - | KW_HEBREW | KW_HP8 | KW_KEYBCS2 | KW_KOI8R | KW_KOI8U - | KW_LATIN1 | KW_LATIN2 | KW_LATIN5 | KW_LATIN7 - | KW_MACCE | KW_MACROMAN | KW_SJIS | KW_SWE7 | KW_TIS620 - | KW_UCS2 | KW_UJIS | KW_UTF16 | KW_UTF16LE | KW_UTF32 - | KW_UTF8 | KW_UTF8MB3 | KW_UTF8MB4; - -fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+; -fragment ID_LITERAL: [A-Z_$0-9\u0080-\uFFFF]*?[A-Z_$\u0080-\uFFFF]+?[A-Z_$0-9\u0080-\uFFFF]*; -fragment DQUOTA_STRING: '"' ( '\\'. | '""' | ~('"'| '\\') )* '"'; -fragment SQUOTA_STRING: '\'' ('\\'. | '\'\'' | ~('\'' | '\\'))* '\''; -fragment BQUOTA_STRING: '`' ( ~'`' | '``' )* '`'; -fragment HEX_DIGIT: [0-9A-F]; -fragment DEC_DIGIT: [0-9]; -fragment BIT_STRING_L: 'B' '\'' [01]+ '\''; -fragment IP_ADDRESS: [0-9]+ '.' [0-9.]+ | [0-9A-F]* ':' [0-9A-F]* ':' [0-9A-F:]+; +fragment CHARSET_NAME: + KW_ARMSCII8 + | KW_ASCII + | KW_BIG5 + | KW_BINARY + | KW_CP1250 + | KW_CP1251 + | KW_CP1256 + | KW_CP1257 + | KW_CP850 + | KW_CP852 + | KW_CP866 + | KW_CP932 + | KW_DEC8 + | KW_EUCJPMS + | KW_EUCKR + | KW_GB2312 + | KW_GBK + | KW_GEOSTD8 + | KW_GREEK + | KW_HEBREW + | KW_HP8 + | KW_KEYBCS2 + | KW_KOI8R + | KW_KOI8U + | KW_LATIN1 + | KW_LATIN2 + | KW_LATIN5 + | KW_LATIN7 + | KW_MACCE + | KW_MACROMAN + | KW_SJIS + | KW_SWE7 + | KW_TIS620 + | KW_UCS2 + | KW_UJIS + | KW_UTF16 + | KW_UTF16LE + | KW_UTF32 + | KW_UTF8 + | KW_UTF8MB3 + | KW_UTF8MB4; +fragment EXPONENT_NUM_PART : 'E' [-+]? DEC_DIGIT+; +fragment ID_LITERAL : [A-Z_$0-9\u0080-\uFFFF]*? [A-Z_$\u0080-\uFFFF]+? [A-Z_$0-9\u0080-\uFFFF]*; +fragment DQUOTA_STRING : '"' ( '\\' . | '""' | ~('"' | '\\'))* '"'; +fragment SQUOTA_STRING : '\'' ('\\' . | '\'\'' | ~('\'' | '\\'))* '\''; +fragment BQUOTA_STRING : '`' ( ~'`' | '``')* '`'; +fragment HEX_DIGIT : [0-9A-F]; +fragment DEC_DIGIT : [0-9]; +fragment BIT_STRING_L : 'B' '\'' [01]+ '\''; +fragment IP_ADDRESS : [0-9]+ '.' [0-9.]+ | [0-9A-F]* ':' [0-9A-F]* ':' [0-9A-F:]+; // Last tokens must generate Errors -ERROR_RECONGNIGION: . -> channel(ERRORCHANNEL); +ERROR_RECONGNIGION: . -> channel(ERRORCHANNEL); \ No newline at end of file diff --git a/src/grammar/mysql/MySqlParser.g4 b/src/grammar/mysql/MySqlParser.g4 index 7478502..9a14a86 100644 --- a/src/grammar/mysql/MySqlParser.g4 +++ b/src/grammar/mysql/MySqlParser.g4 @@ -27,11 +27,15 @@ THE SOFTWARE. // SQL Statements v8.0: https://dev.mysql.com/doc/refman/8.0/en/sql-statements.html // SQL Statements v5.7: https://dev.mysql.com/doc/refman/5.7/en/sql-statements.html +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging +// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true parser grammar MySqlParser; -options { tokenVocab = MySqlLexer; } - +options { + tokenVocab= MySqlLexer; +} // Top Level Description @@ -45,9 +49,13 @@ singleStatement ; sqlStatement - : ddlStatement | dmlStatement | transactionStatement - | replicationStatement | preparedStatement - | administrationStatement | utilityStatement + : ddlStatement + | dmlStatement + | transactionStatement + | replicationStatement + | preparedStatement + | administrationStatement + | utilityStatement ; emptyStatement_ @@ -55,123 +63,201 @@ emptyStatement_ ; ddlStatement - : createDatabase | createEvent | createIndex - | createLogfileGroup | createProcedure | createFunction - | createServer | createTable | createTablespaceInnodb - | createTablespaceNdb | createTrigger | createView | createRole - | alterDatabase | alterEvent | alterFunction - | alterInstance | alterLogfileGroup | alterProcedure - | alterServer | alterTable | alterTablespace | alterView - | dropDatabase | dropEvent | dropIndex - | dropLogfileGroup | dropProcedure | dropFunction - | dropServer | dropSpatial | dropTable | dropTablespace - | dropTrigger | dropView | dropRole | setRole - | renameTable | truncateTable + : createDatabase + | createEvent + | createIndex + | createLogfileGroup + | createProcedure + | createFunction + | createServer + | createTable + | createTablespaceInnodb + | createTablespaceNdb + | createTrigger + | createView + | createRole + | alterDatabase + | alterEvent + | alterFunction + | alterInstance + | alterLogfileGroup + | alterProcedure + | alterServer + | alterTable + | alterTablespace + | alterView + | dropDatabase + | dropEvent + | dropIndex + | dropLogfileGroup + | dropProcedure + | dropFunction + | dropServer + | dropSpatial + | dropTable + | dropTablespace + | dropTrigger + | dropView + | dropRole + | setRole + | renameTable + | truncateTable ; dmlStatement - : selectStatement | setOperations | insertStatement | updateStatement - | deleteStatement | replaceStatement | callStatement | interSectStatement - | loadDataStatement | loadXmlStatement | parenthesizedQuery | doStatement - | handlerStatement | importTableStatement | valuesStatement | withStatement + : selectStatement + | setOperations + | insertStatement + | updateStatement + | deleteStatement + | replaceStatement + | callStatement + | interSectStatement + | loadDataStatement + | loadXmlStatement + | parenthesizedQuery + | doStatement + | handlerStatement + | importTableStatement + | valuesStatement + | withStatement | tableStatement ; transactionStatement : startTransaction - | beginWork | commitWork | rollbackWork - | savepointStatement | rollbackStatement - | releaseStatement | lockTables | unlockTables + | beginWork + | commitWork + | rollbackWork + | savepointStatement + | rollbackStatement + | releaseStatement + | lockTables + | unlockTables ; replicationStatement - : changeMaster | changeReplicationFilter | changeReplicationSource | purgeBinaryLogs - | startSlaveOrReplica | stopSlaveOrReplica - | startGroupReplication | stopGroupReplication - | xaStartTransaction | xaEndTransaction | xaPrepareStatement - | xaCommitWork | xaRollbackWork | xaRecoverWork + : changeMaster + | changeReplicationFilter + | changeReplicationSource + | purgeBinaryLogs + | startSlaveOrReplica + | stopSlaveOrReplica + | startGroupReplication + | stopGroupReplication + | xaStartTransaction + | xaEndTransaction + | xaPrepareStatement + | xaCommitWork + | xaRollbackWork + | xaRecoverWork ; preparedStatement - : prepareStatement | executeStatement | deallocatePrepare + : prepareStatement + | executeStatement + | deallocatePrepare ; // remark: NOT INCLUDED IN sqlStatement, but include in body // of routine's statements compoundStatement : blockStatement - | caseStatement | ifStatement | leaveStatement - | loopStatement | repeatStatement | whileStatement - | iterateStatement | returnStatement | cursorStatement + | caseStatement + | ifStatement + | leaveStatement + | loopStatement + | repeatStatement + | whileStatement + | iterateStatement + | returnStatement + | cursorStatement ; administrationStatement - : alterUser | createUser | dropUser | grantStatement - | grantProxy | renameUser | revokeStatement - | alterResourceGroup | createResourceGroup | dropResourceGroup | setResourceGroup - | analyzeTable | checkTable - | checksumTable | optimizeTable | repairTable - | installComponent | uninstallComponent | installPlugin | uninstallPlugin - | cloneStatement | setStatement | showStatement | binlogStatement - | cacheIndexStatement | flushStatement | killStatement - | loadIndexIntoCache | resetStatement | resetPersist | resetAllChannel | reStartStatement + : alterUser + | createUser + | dropUser + | grantStatement + | grantProxy + | renameUser + | revokeStatement + | alterResourceGroup + | createResourceGroup + | dropResourceGroup + | setResourceGroup + | analyzeTable + | checkTable + | checksumTable + | optimizeTable + | repairTable + | installComponent + | uninstallComponent + | installPlugin + | uninstallPlugin + | cloneStatement + | setStatement + | showStatement + | binlogStatement + | cacheIndexStatement + | flushStatement + | killStatement + | loadIndexIntoCache + | resetStatement + | resetPersist + | resetAllChannel + | reStartStatement | shutdownStatement ; utilityStatement - : simpleDescribeStatement | fullDescribeStatement | analyzeDescribeStatement - | helpStatement | useStatement | signalStatement - | resignalStatement | diagnosticsStatement + : simpleDescribeStatement + | fullDescribeStatement + | analyzeDescribeStatement + | helpStatement + | useStatement + | signalStatement + | resignalStatement + | diagnosticsStatement ; - // Data Definition Language // Create statements createDatabase - : KW_CREATE dbFormat=(KW_DATABASE | KW_SCHEMA) - ifNotExists? databaseNameCreate createDatabaseOption* + : KW_CREATE dbFormat=(KW_DATABASE | KW_SCHEMA) ifNotExists? databaseNameCreate createDatabaseOption* ; createEvent - : KW_CREATE ownerStatement? KW_EVENT ifNotExists? event_name=fullId - KW_ON KW_SCHEDULE scheduleExpression - (KW_ON KW_COMPLETION KW_NOT? KW_PRESERVE)? enableType? - (KW_COMMENT STRING_LITERAL)? - KW_DO routineBody + : KW_CREATE ownerStatement? KW_EVENT ifNotExists? event_name=fullId KW_ON KW_SCHEDULE scheduleExpression ( + KW_ON KW_COMPLETION KW_NOT? KW_PRESERVE + )? enableType? (KW_COMMENT STRING_LITERAL)? KW_DO routineBody ; createIndex - : KW_CREATE - intimeAction=(KW_ONLINE | KW_OFFLINE)? - indexCategory=(KW_UNIQUE | KW_FULLTEXT | KW_SPATIAL)? KW_INDEX - indexNameCreate indexType? - KW_ON tableName indexColumnNames - indexOption* - ( + : KW_CREATE intimeAction=(KW_ONLINE | KW_OFFLINE)? indexCategory=( + KW_UNIQUE + | KW_FULLTEXT + | KW_SPATIAL + )? KW_INDEX indexNameCreate indexType? KW_ON tableName indexColumnNames indexOption* ( KW_ALGORITHM EQUAL_SYMBOL? algType=(KW_DEFAULT | KW_INPLACE | KW_COPY) | KW_LOCK EQUAL_SYMBOL? lockType=(KW_DEFAULT | KW_NONE | KW_SHARED | KW_EXCLUSIVE) - )* + )* ; createLogfileGroup - : KW_CREATE KW_LOGFILE KW_GROUP logfileGroupName=uid - KW_ADD KW_UNDOFILE undoFile=STRING_LITERAL - (KW_INITIAL_SIZE '='? initSize=fileSizeLiteral)? - (KW_UNDO_BUFFER_SIZE '='? undoSize=fileSizeLiteral)? - (KW_REDO_BUFFER_SIZE '='? redoSize=fileSizeLiteral)? - (KW_NODEGROUP '='? nodegroup=uid)? - KW_WAIT? - (KW_COMMENT '='? comment=STRING_LITERAL)? - KW_ENGINE '='? engineName + : KW_CREATE KW_LOGFILE KW_GROUP logfileGroupName=uid KW_ADD KW_UNDOFILE undoFile=STRING_LITERAL ( + KW_INITIAL_SIZE '='? initSize=fileSizeLiteral + )? (KW_UNDO_BUFFER_SIZE '='? undoSize=fileSizeLiteral)? ( + KW_REDO_BUFFER_SIZE '='? redoSize=fileSizeLiteral + )? (KW_NODEGROUP '='? nodegroup=uid)? KW_WAIT? (KW_COMMENT '='? comment=STRING_LITERAL)? KW_ENGINE '='? engineName ; createProcedure - : KW_CREATE ownerStatement? KW_PROCEDURE ifNotExists? sp_name=fullId - '(' procedureParameter? (',' procedureParameter)* ')' - routineOption* - routineBody + : KW_CREATE ownerStatement? KW_PROCEDURE ifNotExists? sp_name=fullId '(' procedureParameter? ( + ',' procedureParameter + )* ')' routineOption* routineBody ; createRole @@ -179,56 +265,51 @@ createRole ; createServer - : KW_CREATE KW_SERVER servername=uid - KW_FOREIGN KW_DATA KW_WRAPPER wrapperName=(KW_MYSQL | STRING_LITERAL) - KW_OPTIONS '(' serverOption (',' serverOption)* ')' + : KW_CREATE KW_SERVER servername=uid KW_FOREIGN KW_DATA KW_WRAPPER wrapperName=( + KW_MYSQL + | STRING_LITERAL + ) KW_OPTIONS '(' serverOption (',' serverOption)* ')' ; createTable - : KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tableNameCreate - createDefinitions - (tableOption (','? tableOption)* )? - partitionDefinitions? #copyCreateTable - | KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tableNameCreate - createDefinitions? - (tableOption (','? tableOption)*)? - partitionDefinitions? - (KW_IGNORE | KW_REPLACE)? - KW_AS? selectStatement #columnCreateTable - | KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tableNameCreate - (KW_LIKE tableName | '(' KW_LIKE tableName ')') #queryCreateTable + : KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tableNameCreate createDefinitions ( + tableOption (','? tableOption)* + )? partitionDefinitions? # copyCreateTable + | KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tableNameCreate createDefinitions? ( + tableOption (','? tableOption)* + )? partitionDefinitions? (KW_IGNORE | KW_REPLACE)? KW_AS? selectStatement # columnCreateTable + | KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tableNameCreate ( + KW_LIKE tableName + | '(' KW_LIKE tableName ')' + ) # queryCreateTable ; createTablespaceInnodb - : KW_CREATE KW_UNDO? KW_TABLESPACE tablespaceNameCreate - (KW_ADD KW_DATAFILE datafile=STRING_LITERAL)? - (KW_AUTOEXTEND_SIZE '='? autoextendSize=fileSizeLiteral)? - (KW_FILE_BLOCK_SIZE '=' fileBlockSize=fileSizeLiteral)? - (KW_ENGINE '='? engineName)? - (KW_ENGINE_ATTRIBUTE '='? STRING_LITERAL)? + : KW_CREATE KW_UNDO? KW_TABLESPACE tablespaceNameCreate ( + KW_ADD KW_DATAFILE datafile=STRING_LITERAL + )? (KW_AUTOEXTEND_SIZE '='? autoextendSize=fileSizeLiteral)? ( + KW_FILE_BLOCK_SIZE '=' fileBlockSize=fileSizeLiteral + )? (KW_ENGINE '='? engineName)? (KW_ENGINE_ATTRIBUTE '='? STRING_LITERAL)? ; createTablespaceNdb - : KW_CREATE KW_UNDO? KW_TABLESPACE tablespaceNameCreate - KW_ADD KW_DATAFILE datafile=STRING_LITERAL - KW_USE KW_LOGFILE KW_GROUP logfileGroupName=uid - (KW_EXTENT_SIZE '='? extentSize=fileSizeLiteral)? - (KW_INITIAL_SIZE '='? initialSize=fileSizeLiteral)? - (KW_AUTOEXTEND_SIZE '='? autoextendSize=fileSizeLiteral)? - (KW_MAX_SIZE '='? maxSize=fileSizeLiteral)? - (KW_NODEGROUP '='? nodegroup=uid)? - KW_WAIT? - (KW_COMMENT '='? comment=STRING_LITERAL)? - KW_ENGINE '='? engineName + : KW_CREATE KW_UNDO? KW_TABLESPACE tablespaceNameCreate KW_ADD KW_DATAFILE datafile=STRING_LITERAL KW_USE KW_LOGFILE KW_GROUP logfileGroupName=uid + ( + KW_EXTENT_SIZE '='? extentSize=fileSizeLiteral + )? (KW_INITIAL_SIZE '='? initialSize=fileSizeLiteral)? ( + KW_AUTOEXTEND_SIZE '='? autoextendSize=fileSizeLiteral + )? (KW_MAX_SIZE '='? maxSize=fileSizeLiteral)? (KW_NODEGROUP '='? nodegroup=uid)? KW_WAIT? ( + KW_COMMENT '='? comment=STRING_LITERAL + )? KW_ENGINE '='? engineName ; createTrigger - : KW_CREATE ownerStatement? KW_TRIGGER ifNotExists? trigger_name=fullId - triggerTime=(KW_BEFORE | KW_AFTER) - triggerEvent=(KW_INSERT | KW_UPDATE | KW_DELETE) - KW_ON tableName KW_FOR KW_EACH KW_ROW - (triggerPlace=(KW_FOLLOWS | KW_PRECEDES) other_trigger_name=fullId)? - routineBody + : KW_CREATE ownerStatement? KW_TRIGGER ifNotExists? trigger_name=fullId triggerTime=( + KW_BEFORE + | KW_AFTER + ) triggerEvent=(KW_INSERT | KW_UPDATE | KW_DELETE) KW_ON tableName KW_FOR KW_EACH KW_ROW ( + triggerPlace=(KW_FOLLOWS | KW_PRECEDES) other_trigger_name=fullId + )? routineBody ; withClause @@ -236,26 +317,22 @@ withClause ; commonTableExpressions - : cteName=uid ('(' cteColumnName=uid (',' cteColumnName=uid)* ')')? KW_AS '(' dmlStatement ')' - (',' commonTableExpressions)? + : cteName=uid ('(' cteColumnName=uid (',' cteColumnName=uid)* ')')? KW_AS '(' dmlStatement ')' ( + ',' commonTableExpressions + )? ; createView - : KW_CREATE orReplace? - ( - KW_ALGORITHM '=' algType=(KW_UNDEFINED | KW_MERGE | KW_TEMPTABLE) - )? - ownerStatement? - (KW_SQL KW_SECURITY secContext=(KW_DEFINER | KW_INVOKER))? - KW_VIEW viewNameCreate ('(' columnNames ')')? KW_AS - ( + : KW_CREATE orReplace? (KW_ALGORITHM '=' algType=(KW_UNDEFINED | KW_MERGE | KW_TEMPTABLE))? ownerStatement? ( + KW_SQL KW_SECURITY secContext=(KW_DEFINER | KW_INVOKER) + )? KW_VIEW viewNameCreate ('(' columnNames ')')? KW_AS ( '(' withClause? selectStatement ')' - | - withClause? selectStatement (KW_WITH checkOption=(KW_CASCADED | KW_LOCAL)? KW_CHECK KW_OPTION)? - ) + | withClause? selectStatement ( + KW_WITH checkOption=(KW_CASCADED | KW_LOCAL)? KW_CHECK KW_OPTION + )? + ) ; - // details createDatabaseOption @@ -272,7 +349,7 @@ charSet ; currentUserExpression - : (KW_CURRENT_USER | KW_USER) ( '(' ')')? + : (KW_CURRENT_USER | KW_USER) ('(' ')')? ; ownerStatement @@ -280,16 +357,10 @@ ownerStatement ; scheduleExpression - : KW_AT timestampValue intervalExpr* #preciseSchedule - | KW_EVERY (decimalLiteral | expression) intervalType - ( - KW_STARTS startTimestamp=timestampValue - (startIntervals+=intervalExpr)* - )? - ( - KW_ENDS endTimestamp=timestampValue - (endIntervals+=intervalExpr)* - )? #intervalSchedule + : KW_AT timestampValue intervalExpr* # preciseSchedule + | KW_EVERY (decimalLiteral | expression) intervalType ( + KW_STARTS startTimestamp=timestampValue (startIntervals+=intervalExpr)* + )? (KW_ENDS endTimestamp=timestampValue (endIntervals+=intervalExpr)*)? # intervalSchedule ; timestampValue @@ -305,14 +376,24 @@ intervalExpr intervalType : intervalTypeBase - | KW_YEAR | KW_YEAR_MONTH | KW_DAY_HOUR | KW_DAY_MINUTE - | KW_DAY_SECOND | KW_HOUR_MINUTE | KW_HOUR_SECOND | KW_MINUTE_SECOND - | KW_SECOND_MICROSECOND | KW_MINUTE_MICROSECOND - | KW_HOUR_MICROSECOND | KW_DAY_MICROSECOND + | KW_YEAR + | KW_YEAR_MONTH + | KW_DAY_HOUR + | KW_DAY_MINUTE + | KW_DAY_SECOND + | KW_HOUR_MINUTE + | KW_HOUR_SECOND + | KW_MINUTE_SECOND + | KW_SECOND_MICROSECOND + | KW_MINUTE_MICROSECOND + | KW_HOUR_MICROSECOND + | KW_DAY_MICROSECOND ; enableType - : KW_ENABLE | KW_DISABLE | KW_DISABLE KW_ON KW_SLAVE + : KW_ENABLE + | KW_DISABLE + | KW_DISABLE KW_ON KW_SLAVE ; indexType @@ -334,14 +415,11 @@ procedureParameter ; routineOption - : KW_COMMENT STRING_LITERAL #routineComment - | KW_LANGUAGE KW_SQL #routineLanguage - | KW_NOT? KW_DETERMINISTIC #routineBehavior - | ( - KW_CONTAINS KW_SQL | KW_NO KW_SQL | KW_READS KW_SQL KW_DATA - | KW_MODIFIES KW_SQL KW_DATA - ) #routineData - | KW_SQL KW_SECURITY context=(KW_DEFINER | KW_INVOKER) #routineSecurity + : KW_COMMENT STRING_LITERAL # routineComment + | KW_LANGUAGE KW_SQL # routineLanguage + | KW_NOT? KW_DETERMINISTIC # routineBehavior + | (KW_CONTAINS KW_SQL | KW_NO KW_SQL | KW_READS KW_SQL KW_DATA | KW_MODIFIES KW_SQL KW_DATA) # routineData + | KW_SQL KW_SECURITY context=(KW_DEFINER | KW_INVOKER) # routineSecurity ; serverOption @@ -382,89 +460,95 @@ columnDefinition ; columnConstraint - : nullNotnull #nullColumnConstraint - | KW_DEFAULT defaultValue #defaultColumnConstraint - | KW_VISIBLE #visibilityColumnConstraint - | KW_INVISIBLE #invisibilityColumnConstraint - | (KW_AUTO_INCREMENT | KW_ON KW_UPDATE currentTimestamp) #autoIncrementColumnConstraint - | KW_PRIMARY? KW_KEY #primaryKeyColumnConstraint - | KW_UNIQUE KW_KEY? #uniqueKeyColumnConstraint - | KW_COMMENT STRING_LITERAL #commentColumnConstraint - | KW_COLUMN_FORMAT colformat=(KW_FIXED | KW_DYNAMIC | KW_DEFAULT) #formatColumnConstraint - | KW_STORAGE storageval=(KW_DISK | KW_MEMORY | KW_DEFAULT) #storageColumnConstraint - | referenceDefinition #referenceColumnConstraint - | KW_COLLATE collationName #collateColumnConstraint - | (KW_GENERATED KW_ALWAYS)? KW_AS '(' expression ')' (KW_VIRTUAL | KW_STORED)? #generatedColumnConstraint - | KW_SERIAL KW_DEFAULT KW_VALUE #serialDefaultColumnConstraint - | checkConstraintDefinition #checkExpr + : nullNotnull # nullColumnConstraint + | KW_DEFAULT defaultValue # defaultColumnConstraint + | KW_VISIBLE # visibilityColumnConstraint + | KW_INVISIBLE # invisibilityColumnConstraint + | (KW_AUTO_INCREMENT | KW_ON KW_UPDATE currentTimestamp) # autoIncrementColumnConstraint + | KW_PRIMARY? KW_KEY # primaryKeyColumnConstraint + | KW_UNIQUE KW_KEY? # uniqueKeyColumnConstraint + | KW_COMMENT STRING_LITERAL # commentColumnConstraint + | KW_COLUMN_FORMAT colformat=(KW_FIXED | KW_DYNAMIC | KW_DEFAULT) # formatColumnConstraint + | KW_STORAGE storageval=(KW_DISK | KW_MEMORY | KW_DEFAULT) # storageColumnConstraint + | referenceDefinition # referenceColumnConstraint + | KW_COLLATE collationName # collateColumnConstraint + | (KW_GENERATED KW_ALWAYS)? KW_AS '(' expression ')' (KW_VIRTUAL | KW_STORED)? # generatedColumnConstraint + | KW_SERIAL KW_DEFAULT KW_VALUE # serialDefaultColumnConstraint + | checkConstraintDefinition # checkExpr ; referenceDefinition - : KW_REFERENCES tableName indexColumnNames? - (KW_MATCH matchType=(KW_FULL | KW_PARTIAL | KW_SIMPLE))? - referenceAction? + : KW_REFERENCES tableName indexColumnNames? ( + KW_MATCH matchType=(KW_FULL | KW_PARTIAL | KW_SIMPLE) + )? referenceAction? ; referenceAction - : KW_ON KW_DELETE onDelete=referenceControlType - ( + : KW_ON KW_DELETE onDelete=referenceControlType ( KW_ON KW_UPDATE onUpdate=referenceControlType - )? - | KW_ON KW_UPDATE onUpdate=referenceControlType - ( + )? + | KW_ON KW_UPDATE onUpdate=referenceControlType ( KW_ON KW_DELETE onDelete=referenceControlType - )? + )? ; referenceControlType - : KW_RESTRICT | KW_CASCADE | KW_SET KW_NULL_LITERAL | KW_NO KW_ACTION | KW_SET KW_DEFAULT + : KW_RESTRICT + | KW_CASCADE + | KW_SET KW_NULL_LITERAL + | KW_NO KW_ACTION + | KW_SET KW_DEFAULT ; - tableOption - : KW_ENGINE '='? engineName? #tableOptionEngine - | KW_ENGINE_ATTRIBUTE '='? STRING_LITERAL #tableOptionEngineAttribute - | KW_AUTOEXTEND_SIZE '='? decimalLiteral #tableOptionAutoextendSize - | KW_AUTO_INCREMENT '='? decimalLiteral #tableOptionAutoIncrement - | KW_AVG_ROW_LENGTH '='? decimalLiteral #tableOptionAverage - | KW_DEFAULT? charSet '='? (charsetName|KW_DEFAULT) #tableOptionCharset - | (KW_CHECKSUM | KW_PAGE_CHECKSUM) '='? boolValue=('0' | '1') #tableOptionChecksum - | KW_DEFAULT? KW_COLLATE '='? collationName #tableOptionCollate - | KW_COMMENT '='? STRING_LITERAL #tableOptionComment - | KW_COMPRESSION '='? (STRING_LITERAL | ID) #tableOptionCompression - | KW_CONNECTION '='? STRING_LITERAL #tableOptionConnection - | (KW_DATA | KW_INDEX) KW_DIRECTORY '='? STRING_LITERAL #tableOptionDataDirectory - | KW_DELAY_KEY_WRITE '='? boolValue=('0' | '1') #tableOptionDelay - | KW_ENCRYPTION '='? STRING_LITERAL #tableOptionEncryption - | (KW_PAGE_COMPRESSED | STRING_LITERAL) '='? ('0' | '1') #tableOptionPageCompressed - | (KW_PAGE_COMPRESSION_LEVEL | STRING_LITERAL) '='? decimalLiteral #tableOptionPageCompressionLevel - | KW_ENCRYPTION_KEY_ID '='? decimalLiteral #tableOptionEncryptionKeyId - | KW_INDEX KW_DIRECTORY '='? STRING_LITERAL #tableOptionIndexDirectory - | KW_INSERT_METHOD '='? insertMethod=(KW_NO | KW_FIRST | KW_LAST) #tableOptionInsertMethod - | KW_KEY_BLOCK_SIZE '='? fileSizeLiteral #tableOptionKeyBlockSize - | KW_MAX_ROWS '='? decimalLiteral #tableOptionMaxRows - | KW_MIN_ROWS '='? decimalLiteral #tableOptionMinRows - | KW_PACK_KEYS '='? extBoolValue=('0' | '1' | KW_DEFAULT) #tableOptionPackKeys - | KW_PASSWORD '='? STRING_LITERAL #tableOptionPassword - | KW_ROW_FORMAT '='? - rowFormat=( - KW_DEFAULT | KW_DYNAMIC | KW_FIXED | KW_COMPRESSED - | KW_REDUNDANT | KW_COMPACT | ID - ) #tableOptionRowFormat - | KW_START KW_TRANSACTION #tableOptionStartTransaction - | KW_SECONDARY_ENGINE_ATTRIBUTE '='? STRING_LITERAL #tableOptionSecondaryEngineAttribute - | KW_STATS_AUTO_RECALC '='? extBoolValue=(KW_DEFAULT | '0' | '1') #tableOptionRecalculation - | KW_STATS_PERSISTENT '='? extBoolValue=(KW_DEFAULT | '0' | '1') #tableOptionPersistent - | KW_STATS_SAMPLE_PAGES '='? (KW_DEFAULT | decimalLiteral) #tableOptionSamplePage - | KW_TABLESPACE tablespaceName tablespaceStorage? #tableOptionTablespace - | KW_TABLE_TYPE '=' tableType #tableOptionTableType - | tablespaceStorage #tableOptionTablespace - | KW_TRANSACTIONAL '='? ('0' | '1') #tableOptionTransactional - | KW_UNION '='? '(' tableNames ')' #tableOptionUnion + : KW_ENGINE '='? engineName? # tableOptionEngine + | KW_ENGINE_ATTRIBUTE '='? STRING_LITERAL # tableOptionEngineAttribute + | KW_AUTOEXTEND_SIZE '='? decimalLiteral # tableOptionAutoextendSize + | KW_AUTO_INCREMENT '='? decimalLiteral # tableOptionAutoIncrement + | KW_AVG_ROW_LENGTH '='? decimalLiteral # tableOptionAverage + | KW_DEFAULT? charSet '='? (charsetName | KW_DEFAULT) # tableOptionCharset + | (KW_CHECKSUM | KW_PAGE_CHECKSUM) '='? boolValue=('0' | '1') # tableOptionChecksum + | KW_DEFAULT? KW_COLLATE '='? collationName # tableOptionCollate + | KW_COMMENT '='? STRING_LITERAL # tableOptionComment + | KW_COMPRESSION '='? (STRING_LITERAL | ID) # tableOptionCompression + | KW_CONNECTION '='? STRING_LITERAL # tableOptionConnection + | (KW_DATA | KW_INDEX) KW_DIRECTORY '='? STRING_LITERAL # tableOptionDataDirectory + | KW_DELAY_KEY_WRITE '='? boolValue=('0' | '1') # tableOptionDelay + | KW_ENCRYPTION '='? STRING_LITERAL # tableOptionEncryption + | (KW_PAGE_COMPRESSED | STRING_LITERAL) '='? ('0' | '1') # tableOptionPageCompressed + | (KW_PAGE_COMPRESSION_LEVEL | STRING_LITERAL) '='? decimalLiteral # tableOptionPageCompressionLevel + | KW_ENCRYPTION_KEY_ID '='? decimalLiteral # tableOptionEncryptionKeyId + | KW_INDEX KW_DIRECTORY '='? STRING_LITERAL # tableOptionIndexDirectory + | KW_INSERT_METHOD '='? insertMethod=(KW_NO | KW_FIRST | KW_LAST) # tableOptionInsertMethod + | KW_KEY_BLOCK_SIZE '='? fileSizeLiteral # tableOptionKeyBlockSize + | KW_MAX_ROWS '='? decimalLiteral # tableOptionMaxRows + | KW_MIN_ROWS '='? decimalLiteral # tableOptionMinRows + | KW_PACK_KEYS '='? extBoolValue=('0' | '1' | KW_DEFAULT) # tableOptionPackKeys + | KW_PASSWORD '='? STRING_LITERAL # tableOptionPassword + | KW_ROW_FORMAT '='? rowFormat=( + KW_DEFAULT + | KW_DYNAMIC + | KW_FIXED + | KW_COMPRESSED + | KW_REDUNDANT + | KW_COMPACT + | ID + ) # tableOptionRowFormat + | KW_START KW_TRANSACTION # tableOptionStartTransaction + | KW_SECONDARY_ENGINE_ATTRIBUTE '='? STRING_LITERAL # tableOptionSecondaryEngineAttribute + | KW_STATS_AUTO_RECALC '='? extBoolValue=(KW_DEFAULT | '0' | '1') # tableOptionRecalculation + | KW_STATS_PERSISTENT '='? extBoolValue=(KW_DEFAULT | '0' | '1') # tableOptionPersistent + | KW_STATS_SAMPLE_PAGES '='? (KW_DEFAULT | decimalLiteral) # tableOptionSamplePage + | KW_TABLESPACE tablespaceName tablespaceStorage? # tableOptionTablespace + | KW_TABLE_TYPE '=' tableType # tableOptionTableType + | tablespaceStorage # tableOptionTablespace + | KW_TRANSACTIONAL '='? ('0' | '1') # tableOptionTransactional + | KW_UNION '='? '(' tableNames ')' # tableOptionUnion ; tableType - : KW_MYSQL | KW_ODBC + : KW_MYSQL + | KW_ODBC ; tablespaceStorage @@ -472,57 +556,47 @@ tablespaceStorage ; partitionDefinitions - : KW_PARTITION KW_BY partitionFunctionDefinition - (KW_PARTITIONS count=decimalLiteral)? - ( - KW_SUBPARTITION KW_BY subpartitionFunctionDefinition - (KW_SUBPARTITIONS subCount=decimalLiteral)? - )? - ('(' partitionDefinition (',' partitionDefinition)* ')')? + : KW_PARTITION KW_BY partitionFunctionDefinition (KW_PARTITIONS count=decimalLiteral)? ( + KW_SUBPARTITION KW_BY subpartitionFunctionDefinition ( + KW_SUBPARTITIONS subCount=decimalLiteral + )? + )? ('(' partitionDefinition (',' partitionDefinition)* ')')? ; partitionFunctionDefinition - : KW_LINEAR? KW_HASH '(' expression ')' #partitionFunctionHash - | KW_LINEAR? KW_KEY (KW_ALGORITHM '=' algType=('1' | '2'))? - '(' columnNames? ')' #partitionFunctionKey - | KW_RANGE ( '(' expression ')' | KW_COLUMNS '(' columnNames ')' ) #partitionFunctionRange - | KW_LIST ( '(' expression ')' | KW_COLUMNS '(' columnNames ')' ) #partitionFunctionList + : KW_LINEAR? KW_HASH '(' expression ')' # partitionFunctionHash + | KW_LINEAR? KW_KEY (KW_ALGORITHM '=' algType=('1' | '2'))? '(' columnNames? ')' # partitionFunctionKey + | KW_RANGE ('(' expression ')' | KW_COLUMNS '(' columnNames ')') # partitionFunctionRange + | KW_LIST ('(' expression ')' | KW_COLUMNS '(' columnNames ')') # partitionFunctionList ; subpartitionFunctionDefinition - : KW_LINEAR? KW_HASH '(' expression ')' #subPartitionFunctionHash - | KW_LINEAR? KW_KEY (KW_ALGORITHM '=' algType=('1' | '2'))? - '(' columnNames ')' #subPartitionFunctionKey + : KW_LINEAR? KW_HASH '(' expression ')' # subPartitionFunctionHash + | KW_LINEAR? KW_KEY (KW_ALGORITHM '=' algType=('1' | '2'))? '(' columnNames ')' # subPartitionFunctionKey ; partitionDefinition - : KW_PARTITION partitionName KW_VALUES KW_LESS KW_THAN - '(' - partitionDefinerAtom (',' partitionDefinerAtom)* - ')' - partitionOption* - ( '(' subpartitionDefinition (',' subpartitionDefinition)* ')' )? #partitionComparison - | KW_PARTITION partitionName KW_VALUES KW_LESS KW_THAN - partitionDefinerAtom partitionOption* - ( '(' subpartitionDefinition (',' subpartitionDefinition)* ')' )? #partitionComparison - | KW_PARTITION partitionName KW_VALUES KW_IN - '(' - partitionDefinerAtom (',' partitionDefinerAtom)* - ')' - partitionOption* - ( '(' subpartitionDefinition (',' subpartitionDefinition)* ')' )? #partitionListAtom - | KW_PARTITION partitionName KW_VALUES KW_IN - '(' - partitionDefinerVector (',' partitionDefinerVector)* - ')' - partitionOption* - ( '(' subpartitionDefinition (',' subpartitionDefinition)* ')' )? #partitionListVector - | KW_PARTITION partitionName partitionOption* - ( '(' subpartitionDefinition (',' subpartitionDefinition)* ')' )? #partitionSimple + : KW_PARTITION partitionName KW_VALUES KW_LESS KW_THAN '(' partitionDefinerAtom ( + ',' partitionDefinerAtom + )* ')' partitionOption* ('(' subpartitionDefinition (',' subpartitionDefinition)* ')')? # partitionComparison + | KW_PARTITION partitionName KW_VALUES KW_LESS KW_THAN partitionDefinerAtom partitionOption* ( + '(' subpartitionDefinition (',' subpartitionDefinition)* ')' + )? # partitionComparison + | KW_PARTITION partitionName KW_VALUES KW_IN '(' partitionDefinerAtom ( + ',' partitionDefinerAtom + )* ')' partitionOption* ('(' subpartitionDefinition (',' subpartitionDefinition)* ')')? # partitionListAtom + | KW_PARTITION partitionName KW_VALUES KW_IN '(' partitionDefinerVector ( + ',' partitionDefinerVector + )* ')' partitionOption* ('(' subpartitionDefinition (',' subpartitionDefinition)* ')')? # partitionListVector + | KW_PARTITION partitionName partitionOption* ( + '(' subpartitionDefinition (',' subpartitionDefinition)* ')' + )? # partitionSimple ; partitionDefinerAtom - : constant | expression | KW_MAXVALUE + : constant + | expression + | KW_MAXVALUE ; partitionDefinerVector @@ -534,33 +608,29 @@ subpartitionDefinition ; partitionOption - : KW_DEFAULT? KW_STORAGE? KW_ENGINE '='? engineName #partitionOptionEngine - | KW_COMMENT '='? comment=STRING_LITERAL #partitionOptionComment - | KW_DATA KW_DIRECTORY '='? dataDirectory=STRING_LITERAL #partitionOptionDataDirectory - | KW_INDEX KW_DIRECTORY '='? indexDirectory=STRING_LITERAL #partitionOptionIndexDirectory - | KW_MAX_ROWS '='? maxRows=decimalLiteral #partitionOptionMaxRows - | KW_MIN_ROWS '='? minRows=decimalLiteral #partitionOptionMinRows - | KW_TABLESPACE '='? tablespaceName #partitionOptionTablespace - | KW_NODEGROUP '='? nodegroup=uid #partitionOptionNodeGroup + : KW_DEFAULT? KW_STORAGE? KW_ENGINE '='? engineName # partitionOptionEngine + | KW_COMMENT '='? comment=STRING_LITERAL # partitionOptionComment + | KW_DATA KW_DIRECTORY '='? dataDirectory=STRING_LITERAL # partitionOptionDataDirectory + | KW_INDEX KW_DIRECTORY '='? indexDirectory=STRING_LITERAL # partitionOptionIndexDirectory + | KW_MAX_ROWS '='? maxRows=decimalLiteral # partitionOptionMaxRows + | KW_MIN_ROWS '='? minRows=decimalLiteral # partitionOptionMinRows + | KW_TABLESPACE '='? tablespaceName # partitionOptionTablespace + | KW_NODEGROUP '='? nodegroup=uid # partitionOptionNodeGroup ; // Alter statements alterDatabase - : KW_ALTER dbFormat=(KW_DATABASE | KW_SCHEMA) databaseName? - createDatabaseOption+ #alterSimpleDatabase - | KW_ALTER dbFormat=(KW_DATABASE | KW_SCHEMA) databaseName - KW_UPGRADE KW_DATA KW_DIRECTORY KW_NAME #alterUpgradeName + : KW_ALTER dbFormat=(KW_DATABASE | KW_SCHEMA) databaseName? createDatabaseOption+ # alterSimpleDatabase + | KW_ALTER dbFormat=(KW_DATABASE | KW_SCHEMA) databaseName KW_UPGRADE KW_DATA KW_DIRECTORY KW_NAME # alterUpgradeName ; alterEvent - : KW_ALTER ownerStatement? - KW_EVENT event_name=fullId - (KW_ON KW_SCHEDULE scheduleExpression)? - (KW_ON KW_COMPLETION KW_NOT? KW_PRESERVE)? - (KW_RENAME KW_TO new_event_name=fullId)? enableType? - (KW_COMMENT STRING_LITERAL)? - (KW_DO routineBody)? + : KW_ALTER ownerStatement? KW_EVENT event_name=fullId (KW_ON KW_SCHEDULE scheduleExpression)? ( + KW_ON KW_COMPLETION KW_NOT? KW_PRESERVE + )? (KW_RENAME KW_TO new_event_name=fullId)? enableType? (KW_COMMENT STRING_LITERAL)? ( + KW_DO routineBody + )? ; alterFunction @@ -572,10 +642,9 @@ alterInstance ; alterLogfileGroup - : KW_ALTER KW_LOGFILE KW_GROUP logfileGroupName=uid - KW_ADD KW_UNDOFILE STRING_LITERAL - (KW_INITIAL_SIZE '='? fileSizeLiteral)? - KW_WAIT? KW_ENGINE '='? engineName + : KW_ALTER KW_LOGFILE KW_GROUP logfileGroupName=uid KW_ADD KW_UNDOFILE STRING_LITERAL ( + KW_INITIAL_SIZE '='? fileSizeLiteral + )? KW_WAIT? KW_ENGINE '='? engineName ; alterProcedure @@ -583,91 +652,94 @@ alterProcedure ; alterServer - : KW_ALTER KW_SERVER serverName=uid KW_OPTIONS - '(' serverOption (',' serverOption)* ')' + : KW_ALTER KW_SERVER serverName=uid KW_OPTIONS '(' serverOption (',' serverOption)* ')' ; alterTable - : KW_ALTER KW_TABLE tableName - (alterOption (',' alterOption)*)? - (alterPartitionSpecification alterPartitionSpecification*)? + : KW_ALTER KW_TABLE tableName (alterOption (',' alterOption)*)? ( + alterPartitionSpecification alterPartitionSpecification* + )? ; alterTablespace - : KW_ALTER KW_UNDO? KW_TABLESPACE tablespaceName - (KW_ADD | KW_DROP) KW_DATAFILE STRING_LITERAL - (KW_INITIAL_SIZE '='? fileSizeLiteral)? - KW_WAIT? - (KW_RENAME KW_TO tablespaceNameCreate)? - (KW_AUTOEXTEND_SIZE '='? fileSizeLiteral)? - (KW_SET (KW_ACTIVE | KW_INACTIVE))? - (KW_ENCRYPTION '='? STRING_LITERAL)? // STRING_LITERAL is 'Y' or 'N' - (KW_ENGINE '='? engineName)? - (KW_ENGINE_ATTRIBUTE '='? STRING_LITERAL)? + : KW_ALTER KW_UNDO? KW_TABLESPACE tablespaceName (KW_ADD | KW_DROP) KW_DATAFILE STRING_LITERAL ( + KW_INITIAL_SIZE '='? fileSizeLiteral + )? KW_WAIT? (KW_RENAME KW_TO tablespaceNameCreate)? (KW_AUTOEXTEND_SIZE '='? fileSizeLiteral)? ( + KW_SET (KW_ACTIVE | KW_INACTIVE) + )? (KW_ENCRYPTION '='? STRING_LITERAL)? // STRING_LITERAL is 'Y' or 'N' + (KW_ENGINE '='? engineName)? (KW_ENGINE_ATTRIBUTE '='? STRING_LITERAL)? ; alterView - : KW_ALTER - ( - KW_ALGORITHM '=' algType=(KW_UNDEFINED | KW_MERGE | KW_TEMPTABLE) - )? - ownerStatement? - (KW_SQL KW_SECURITY secContext=(KW_DEFINER | KW_INVOKER))? - KW_VIEW viewName ('(' columnNames ')')? KW_AS selectStatement - (KW_WITH checkOpt=(KW_CASCADED | KW_LOCAL)? KW_CHECK KW_OPTION)? + : KW_ALTER (KW_ALGORITHM '=' algType=(KW_UNDEFINED | KW_MERGE | KW_TEMPTABLE))? ownerStatement? ( + KW_SQL KW_SECURITY secContext=(KW_DEFINER | KW_INVOKER) + )? KW_VIEW viewName ('(' columnNames ')')? KW_AS selectStatement ( + KW_WITH checkOpt=(KW_CASCADED | KW_LOCAL)? KW_CHECK KW_OPTION + )? ; alterOption - : tableOption (','? tableOption)* #alterByTableOption - | KW_ADD KW_COLUMN? columnName columnDefinition (KW_FIRST | KW_AFTER columnName)? #alterByAddColumn - | KW_ADD KW_COLUMN? '(' columnName columnDefinition ( ',' columnName columnDefinition)* ')' #alterByAddColumns - | KW_ADD (KW_INDEX | KW_KEY) indexName? indexType? indexColumnNames indexOption* #alterByAddIndex - | KW_ADD (KW_FULLTEXT | KW_SPATIAL) (KW_INDEX | KW_KEY)? indexName? indexColumnNames indexOption* #alterByAddSpecialIndex - | KW_ADD (KW_CONSTRAINT symbol=uid?)? KW_PRIMARY KW_KEY indexType? indexColumnNames indexOption* #alterByAddPrimaryKey - | KW_ADD (KW_CONSTRAINT symbol=uid?)? KW_UNIQUE (KW_INDEX | KW_KEY)? indexName? indexType? indexColumnNames indexOption* #alterByAddUniqueKey - | KW_ADD (KW_CONSTRAINT symbol=uid?)? KW_FOREIGN KW_KEY indexName? indexColumnNames referenceDefinition #alterByAddForeignKey - | KW_ADD checkConstraintDefinition? #alterByAddCheckTableConstraint - | KW_DROP (KW_CHECK | KW_CONSTRAINT) symbol=uid #alterByDropConstraintCheck - | KW_ALTER (KW_CHECK | KW_CONSTRAINT) symbol=uid KW_NOT? KW_ENFORCED? #alterByAlterCheckTableConstraint - | KW_ALGORITHM '='? (KW_DEFAULT | KW_INSTANT | KW_INPLACE | KW_COPY) #alterBySetAlgorithm - | KW_ALTER KW_COLUMN? columnName (KW_SET KW_DEFAULT defaultValue | KW_SET (KW_VISIBLE | KW_INVISIBLE) | KW_DROP KW_DEFAULT) #alterByAlterColumnDefault - | KW_ALTER KW_INDEX indexName (KW_VISIBLE | KW_INVISIBLE) #alterByAlterIndexVisibility - | KW_CHANGE KW_COLUMN? oldColumn=columnName newColumn=columnNameCreate columnDefinition (KW_FIRST | KW_AFTER columnName)? #alterByChangeColumn - | KW_DEFAULT? KW_CHARACTER KW_SET '=' charsetName (KW_COLLATE '='? collationName)? #alterByDefaultCharset - | KW_CONVERT KW_TO (KW_CHARSET | KW_CHARACTER KW_SET) charsetName (KW_COLLATE collationName)? #alterByConvertCharset - | (KW_DISABLE | KW_ENABLE) KW_KEYS #alterKeys - | (KW_DISCARD | KW_IMPORT) KW_TABLESPACE #alterTablespaceOption - | KW_DROP KW_COLUMN? columnName #alterByDropColumn - | KW_DROP (KW_INDEX | KW_KEY) indexName #alterByDropIndex - | KW_DROP KW_PRIMARY KW_KEY #alterByDropPrimaryKey - | KW_DROP KW_FOREIGN KW_KEY fk_symbol=uid #alterByDropForeignKey - | KW_FORCE #alterByForce - | KW_LOCK '='? lockType=(KW_DEFAULT | KW_NONE | KW_SHARED | KW_EXCLUSIVE) #alterByLock - | KW_MODIFY KW_COLUMN? columnName columnDefinition (KW_FIRST | KW_AFTER columnName)? #alterByModifyColumn - | KW_ORDER KW_BY columnNames #alterByOrder - | KW_RENAME KW_COLUMN olcdColumn=columnName KW_TO newColumn=columnNameCreate #alterByRenameColumn - | KW_RENAME indexFormat=(KW_INDEX | KW_KEY) indexName KW_TO indexNameCreate #alterByRenameIndex - | KW_RENAME renameFormat=(KW_TO | KW_AS)? tableNameCreate #alterByRename - | (KW_WITHOUT | KW_WITH) KW_VALIDATION #alterByValidate - | alterPartitionSpecification #alterPartition + : tableOption (','? tableOption)* # alterByTableOption + | KW_ADD KW_COLUMN? columnName columnDefinition (KW_FIRST | KW_AFTER columnName)? # alterByAddColumn + | KW_ADD KW_COLUMN? '(' columnName columnDefinition (',' columnName columnDefinition)* ')' # alterByAddColumns + | KW_ADD (KW_INDEX | KW_KEY) indexName? indexType? indexColumnNames indexOption* # alterByAddIndex + | KW_ADD (KW_FULLTEXT | KW_SPATIAL) (KW_INDEX | KW_KEY)? indexName? indexColumnNames indexOption* # alterByAddSpecialIndex + | KW_ADD (KW_CONSTRAINT symbol=uid?)? KW_PRIMARY KW_KEY indexType? indexColumnNames indexOption* # alterByAddPrimaryKey + | KW_ADD (KW_CONSTRAINT symbol=uid?)? KW_UNIQUE (KW_INDEX | KW_KEY)? indexName? indexType? indexColumnNames indexOption* # alterByAddUniqueKey + | KW_ADD (KW_CONSTRAINT symbol=uid?)? KW_FOREIGN KW_KEY indexName? indexColumnNames referenceDefinition # alterByAddForeignKey + | KW_ADD checkConstraintDefinition? # alterByAddCheckTableConstraint + | KW_DROP (KW_CHECK | KW_CONSTRAINT) symbol=uid # alterByDropConstraintCheck + | KW_ALTER (KW_CHECK | KW_CONSTRAINT) symbol=uid KW_NOT? KW_ENFORCED? # alterByAlterCheckTableConstraint + | KW_ALGORITHM '='? (KW_DEFAULT | KW_INSTANT | KW_INPLACE | KW_COPY) # alterBySetAlgorithm + | KW_ALTER KW_COLUMN? columnName ( + KW_SET KW_DEFAULT defaultValue + | KW_SET (KW_VISIBLE | KW_INVISIBLE) + | KW_DROP KW_DEFAULT + ) # alterByAlterColumnDefault + | KW_ALTER KW_INDEX indexName (KW_VISIBLE | KW_INVISIBLE) # alterByAlterIndexVisibility + | KW_CHANGE KW_COLUMN? oldColumn=columnName newColumn=columnNameCreate columnDefinition ( + KW_FIRST + | KW_AFTER columnName + )? # alterByChangeColumn + | KW_DEFAULT? KW_CHARACTER KW_SET '=' charsetName (KW_COLLATE '='? collationName)? # alterByDefaultCharset + | KW_CONVERT KW_TO (KW_CHARSET | KW_CHARACTER KW_SET) charsetName (KW_COLLATE collationName)? # alterByConvertCharset + | (KW_DISABLE | KW_ENABLE) KW_KEYS # alterKeys + | (KW_DISCARD | KW_IMPORT) KW_TABLESPACE # alterTablespaceOption + | KW_DROP KW_COLUMN? columnName # alterByDropColumn + | KW_DROP (KW_INDEX | KW_KEY) indexName # alterByDropIndex + | KW_DROP KW_PRIMARY KW_KEY # alterByDropPrimaryKey + | KW_DROP KW_FOREIGN KW_KEY fk_symbol=uid # alterByDropForeignKey + | KW_FORCE # alterByForce + | KW_LOCK '='? lockType=(KW_DEFAULT | KW_NONE | KW_SHARED | KW_EXCLUSIVE) # alterByLock + | KW_MODIFY KW_COLUMN? columnName columnDefinition (KW_FIRST | KW_AFTER columnName)? # alterByModifyColumn + | KW_ORDER KW_BY columnNames # alterByOrder + | KW_RENAME KW_COLUMN olcdColumn=columnName KW_TO newColumn=columnNameCreate # alterByRenameColumn + | KW_RENAME indexFormat=(KW_INDEX | KW_KEY) indexName KW_TO indexNameCreate # alterByRenameIndex + | KW_RENAME renameFormat=(KW_TO | KW_AS)? tableNameCreate # alterByRename + | (KW_WITHOUT | KW_WITH) KW_VALIDATION # alterByValidate + | alterPartitionSpecification # alterPartition ; alterPartitionSpecification - : KW_ADD KW_PARTITION '(' partitionDefinition (',' partitionDefinition)* ')' #alterByAddPartition - | KW_DROP KW_PARTITION partitionNames #alterByDropPartition - | KW_DISCARD KW_PARTITION (partitionNames | KW_ALL) KW_TABLESPACE #alterByDiscardPartition - | KW_IMPORT KW_PARTITION (partitionNames | KW_ALL) KW_TABLESPACE #alterByImportPartition - | KW_TRUNCATE KW_PARTITION (partitionNames | KW_ALL) #alterByTruncatePartition - | KW_COALESCE KW_PARTITION decimalLiteral #alterByCoalescePartition - | KW_REORGANIZE KW_PARTITION partitionNames KW_INTO '(' partitionDefinition (',' partitionDefinition)* ')' #alterByReorganizePartition - | KW_EXCHANGE KW_PARTITION partitionName KW_WITH KW_TABLE tableName (validationFormat=(KW_WITH | KW_WITHOUT) KW_VALIDATION)? #alterByExchangePartition - | KW_ANALYZE KW_PARTITION (partitionNames | KW_ALL) #alterByAnalyzePartition - | KW_CHECK KW_PARTITION (partitionNames | KW_ALL) #alterByCheckPartition - | KW_OPTIMIZE KW_PARTITION (partitionNames | KW_ALL) #alterByOptimizePartition - | KW_REBUILD KW_PARTITION (partitionNames | KW_ALL) #alterByRebuildPartition - | KW_REPAIR KW_PARTITION (partitionNames | KW_ALL) #alterByRepairPartition - | KW_REMOVE KW_PARTITIONING #alterByRemovePartitioning - | KW_UPGRADE KW_PARTITIONING #alterByUpgradePartitioning + : KW_ADD KW_PARTITION '(' partitionDefinition (',' partitionDefinition)* ')' # alterByAddPartition + | KW_DROP KW_PARTITION partitionNames # alterByDropPartition + | KW_DISCARD KW_PARTITION (partitionNames | KW_ALL) KW_TABLESPACE # alterByDiscardPartition + | KW_IMPORT KW_PARTITION (partitionNames | KW_ALL) KW_TABLESPACE # alterByImportPartition + | KW_TRUNCATE KW_PARTITION (partitionNames | KW_ALL) # alterByTruncatePartition + | KW_COALESCE KW_PARTITION decimalLiteral # alterByCoalescePartition + | KW_REORGANIZE KW_PARTITION partitionNames KW_INTO '(' partitionDefinition ( + ',' partitionDefinition + )* ')' # alterByReorganizePartition + | KW_EXCHANGE KW_PARTITION partitionName KW_WITH KW_TABLE tableName ( + validationFormat=(KW_WITH | KW_WITHOUT) KW_VALIDATION + )? # alterByExchangePartition + | KW_ANALYZE KW_PARTITION (partitionNames | KW_ALL) # alterByAnalyzePartition + | KW_CHECK KW_PARTITION (partitionNames | KW_ALL) # alterByCheckPartition + | KW_OPTIMIZE KW_PARTITION (partitionNames | KW_ALL) # alterByOptimizePartition + | KW_REBUILD KW_PARTITION (partitionNames | KW_ALL) # alterByRebuildPartition + | KW_REPAIR KW_PARTITION (partitionNames | KW_ALL) # alterByRepairPartition + | KW_REMOVE KW_PARTITIONING # alterByRemovePartitioning + | KW_UPGRADE KW_PARTITIONING # alterByUpgradePartitioning ; dropDatabase @@ -679,12 +751,10 @@ dropEvent ; dropIndex - : KW_DROP KW_INDEX intimeAction=(KW_ONLINE | KW_OFFLINE)? indexName KW_ON tableName - ( + : KW_DROP KW_INDEX intimeAction=(KW_ONLINE | KW_OFFLINE)? indexName KW_ON tableName ( KW_ALGORITHM '='? algType=(KW_DEFAULT | KW_INPLACE | KW_COPY) - | KW_LOCK '='? - lockType=(KW_DEFAULT | KW_NONE | KW_SHARED | KW_EXCLUSIVE) - )* + | KW_LOCK '='? lockType=(KW_DEFAULT | KW_NONE | KW_SHARED | KW_EXCLUSIVE) + )* ; dropLogfileGroup @@ -708,8 +778,7 @@ dropSpatial ; dropTable - : KW_DROP KW_TEMPORARY? KW_TABLE ifExists? - tableNames dropType=(KW_RESTRICT | KW_CASCADE)? + : KW_DROP KW_TEMPORARY? KW_TABLE ifExists? tableNames dropType=(KW_RESTRICT | KW_CASCADE)? ; dropTablespace @@ -721,8 +790,7 @@ dropTrigger ; dropView - : KW_DROP KW_VIEW ifExists? - viewName (',' viewName)* dropType=(KW_RESTRICT | KW_CASCADE)? + : KW_DROP KW_VIEW ifExists? viewName (',' viewName)* dropType=(KW_RESTRICT | KW_CASCADE)? ; dropRole @@ -730,8 +798,9 @@ dropRole ; setRole - : KW_SET KW_DEFAULT KW_ROLE (KW_NONE | KW_ALL | userOrRoleNames) - KW_TO (userOrRoleName) (',' (userOrRoleName))* + : KW_SET KW_DEFAULT KW_ROLE (KW_NONE | KW_ALL | userOrRoleNames) KW_TO (userOrRoleName) ( + ',' (userOrRoleName) + )* | KW_SET KW_ROLE roleOption ; @@ -752,7 +821,8 @@ callStatement ; deleteStatement - : singleDeleteStatement | multipleDeleteStatement + : singleDeleteStatement + | multipleDeleteStatement ; doStatement @@ -767,20 +837,20 @@ handlerStatement ; insertStatement - : KW_INSERT priority=(KW_LOW_PRIORITY | KW_DELAYED | KW_HIGH_PRIORITY)? - KW_IGNORE? KW_INTO? tableName - (KW_PARTITION '(' partitionNames? ')' )? - (fullColumnNames? (valuesOrValueList | selectOrTableOrValues)? asRowAlias? | setAssignmentList) - asRowAlias? - ( - KW_ON KW_DUPLICATE KW_KEY KW_UPDATE - duplicatedFirst=updatedElement - (',' duplicatedElements+=updatedElement)* - )? + : KW_INSERT priority=(KW_LOW_PRIORITY | KW_DELAYED | KW_HIGH_PRIORITY)? KW_IGNORE? KW_INTO? tableName ( + KW_PARTITION '(' partitionNames? ')' + )? ( + fullColumnNames? (valuesOrValueList | selectOrTableOrValues)? asRowAlias? + | setAssignmentList + ) asRowAlias? ( + KW_ON KW_DUPLICATE KW_KEY KW_UPDATE duplicatedFirst=updatedElement ( + ',' duplicatedElements+=updatedElement + )* + )? ; asRowAlias - : KW_AS rowAlias=uid(fullColumnNames)? + : KW_AS rowAlias=uid (fullColumnNames)? ; selectOrTableOrValues @@ -798,39 +868,27 @@ interSectQuery ; loadDataStatement - : KW_LOAD KW_DATA - priority=(KW_LOW_PRIORITY | KW_CONCURRENT)? - KW_LOCAL? KW_INFILE filename=STRING_LITERAL - violation=(KW_REPLACE | KW_IGNORE)? - KW_INTO KW_TABLE tableName - (KW_PARTITION '(' partitionNames ')' )? - (KW_CHARACTER KW_SET charset=charsetName)? - ( - fieldsFormat=(KW_FIELDS | KW_COLUMNS) - selectFieldsInto+ - )? - ( - KW_LINES - selectLinesInto+ - )? - ( + : KW_LOAD KW_DATA priority=(KW_LOW_PRIORITY | KW_CONCURRENT)? KW_LOCAL? KW_INFILE filename=STRING_LITERAL violation=( + KW_REPLACE + | KW_IGNORE + )? KW_INTO KW_TABLE tableName (KW_PARTITION '(' partitionNames ')')? ( + KW_CHARACTER KW_SET charset=charsetName + )? (fieldsFormat=(KW_FIELDS | KW_COLUMNS) selectFieldsInto+)? (KW_LINES selectLinesInto+)? ( KW_IGNORE decimalLiteral linesFormat=(KW_LINES | KW_ROWS) - )? - ( '(' assignmentField (',' assignmentField)* ')' )? - (KW_SET updatedElement (',' updatedElement)*)? + )? ('(' assignmentField (',' assignmentField)* ')')? ( + KW_SET updatedElement (',' updatedElement)* + )? ; loadXmlStatement - : KW_LOAD KW_XML - priority=(KW_LOW_PRIORITY | KW_CONCURRENT)? - KW_LOCAL? KW_INFILE filename=STRING_LITERAL - violation=(KW_REPLACE | KW_IGNORE)? - KW_INTO KW_TABLE tableName - (KW_CHARACTER KW_SET charset=charsetName)? - (KW_ROWS KW_IDENTIFIED KW_BY '<'? tag=STRING_LITERAL '>'?)? - ( KW_IGNORE decimalLiteral linesFormat=(KW_LINES | KW_ROWS) )? - ( '(' assignmentField (',' assignmentField)* ')' )? - (KW_SET updatedElement (',' updatedElement)*)? + : KW_LOAD KW_XML priority=(KW_LOW_PRIORITY | KW_CONCURRENT)? KW_LOCAL? KW_INFILE filename=STRING_LITERAL violation=( + KW_REPLACE + | KW_IGNORE + )? KW_INTO KW_TABLE tableName (KW_CHARACTER KW_SET charset=charsetName)? ( + KW_ROWS KW_IDENTIFIED KW_BY '<'? tag=STRING_LITERAL '>'? + )? (KW_IGNORE decimalLiteral linesFormat=(KW_LINES | KW_ROWS))? ( + '(' assignmentField (',' assignmentField)* ')' + )? (KW_SET updatedElement (',' updatedElement)*)? ; parenthesizedQuery @@ -838,33 +896,23 @@ parenthesizedQuery ; replaceStatement - : KW_REPLACE priority=(KW_LOW_PRIORITY | KW_DELAYED)? - KW_INTO? tableName - (KW_PARTITION '(' partitionNames ')' )? - ( - ('(' columnNames ')')? replaceStatementValuesOrSelectOrTable - | setAssignmentList - ) + : KW_REPLACE priority=(KW_LOW_PRIORITY | KW_DELAYED)? KW_INTO? tableName ( + KW_PARTITION '(' partitionNames ')' + )? (('(' columnNames ')')? replaceStatementValuesOrSelectOrTable | setAssignmentList) ; // into clause within a given statement can appear only once selectStatement - : querySpecification lockClause? #simpleSelect - | querySpecificationNointo lockClause? intoClause? #simpleSelect - | queryExpression lockClause? #parenthesisSelect - | querySpecificationNointo unionStatement+ - ( - KW_UNION unionType=(KW_ALL | KW_DISTINCT)? - (querySpecification | queryExpression) - )? - orderByClause? limitClause? lockClause? #unionSelect - | queryExpressionNointo unionParenthesis+ - ( - KW_UNION unionType=(KW_ALL | KW_DISTINCT)? - queryExpression - )? - orderByClause? limitClause? lockClause? #unionParenthesisSelect - | querySpecificationNointo (',' lateralStatement)+ #withLateralStatement + : querySpecification lockClause? # simpleSelect + | querySpecificationNointo lockClause? intoClause? # simpleSelect + | queryExpression lockClause? # parenthesisSelect + | querySpecificationNointo unionStatement+ ( + KW_UNION unionType=(KW_ALL | KW_DISTINCT)? (querySpecification | queryExpression) + )? orderByClause? limitClause? lockClause? # unionSelect + | queryExpressionNointo unionParenthesis+ ( + KW_UNION unionType=(KW_ALL | KW_DISTINCT)? queryExpression + )? orderByClause? limitClause? lockClause? # unionParenthesisSelect + | querySpecificationNointo (',' lateralStatement)+ # withLateralStatement ; // https://dev.mysql.com/doc/refman/8.0/en/set-operations.html @@ -877,17 +925,20 @@ queryExpressionBody | queryExpressionBody KW_UNION (KW_ALL | KW_DISTINCT)? queryItem | queryExpressionBody KW_EXCEPT (KW_ALL | KW_DISTINCT)? queryItem ; + queryItem : queryPrimary | queryItem KW_INTERSECT (KW_ALL | KW_DISTINCT)? queryPrimary ; + queryPrimary : queryBlock | '(' queryExpressionBody orderByClause? limitClause? intoClause? ')' ; updateStatement - : singleUpdateStatement | multipleUpdateStatement + : singleUpdateStatement + | multipleUpdateStatement ; // https://dev.mysql.com/doc/refman/8.0/en/values.html @@ -895,7 +946,6 @@ valuesStatement : rowValuesList (KW_ORDER KW_BY indexColumnName)? (KW_LIMIT limitClauseAtom)? ; - // Detailed DML Statements parenthesizedQueryExpression @@ -928,32 +978,30 @@ updatedElement ; assignmentField - : var_name=uid | LOCAL_ID + : var_name=uid + | LOCAL_ID ; lockClause - : KW_FOR (KW_UPDATE | KW_SHARE) (KW_OF tableName (',' tableName)*)? ((KW_NOWAIT | KW_SKIP) KW_LOCKED)? + : KW_FOR (KW_UPDATE | KW_SHARE) (KW_OF tableName (',' tableName)*)? ( + (KW_NOWAIT | KW_SKIP) KW_LOCKED + )? | KW_LOCK KW_IN KW_SHARE KW_MODE ; singleDeleteStatement - : KW_DELETE priority=KW_LOW_PRIORITY? KW_QUICK? KW_IGNORE? - KW_FROM tableName (KW_AS? table_alias=uid)? - (KW_PARTITION '(' partitionNames ')' )? - (KW_WHERE expression)? - orderByClause? (KW_LIMIT limitClauseAtom)? + : KW_DELETE priority=KW_LOW_PRIORITY? KW_QUICK? KW_IGNORE? KW_FROM tableName ( + KW_AS? table_alias=uid + )? (KW_PARTITION '(' partitionNames ')')? (KW_WHERE expression)? orderByClause? ( + KW_LIMIT limitClauseAtom + )? ; multipleDeleteStatement - : KW_DELETE priority=KW_LOW_PRIORITY? KW_QUICK? KW_IGNORE? - ( - tableName ('.' '*')? ( ',' tableName ('.' '*')? )* - KW_FROM tableSources - | KW_FROM - tableName ('.' '*')? ( ',' tableName ('.' '*')? )* - KW_USING tableSources - ) - (KW_WHERE expression)? + : KW_DELETE priority=KW_LOW_PRIORITY? KW_QUICK? KW_IGNORE? ( + tableName ('.' '*')? (',' tableName ('.' '*')?)* KW_FROM tableSources + | KW_FROM tableName ('.' '*')? (',' tableName ('.' '*')?)* KW_USING tableSources + ) (KW_WHERE expression)? ; handlerOpenStatement @@ -961,17 +1009,16 @@ handlerOpenStatement ; handlerReadIndexStatement - : KW_HANDLER tableName KW_READ indexName - ( + : KW_HANDLER tableName KW_READ indexName ( comparisonBase '(' constants ')' | moveOrder=(KW_FIRST | KW_NEXT | KW_PREV | KW_LAST) - ) - (KW_WHERE expression)? (KW_LIMIT limitClauseAtom)? + ) (KW_WHERE expression)? (KW_LIMIT limitClauseAtom)? ; handlerReadStatement - : KW_HANDLER tableName KW_READ moveOrder=(KW_FIRST | KW_NEXT) - (KW_WHERE expression)? (KW_LIMIT limitClauseAtom)? + : KW_HANDLER tableName KW_READ moveOrder=(KW_FIRST | KW_NEXT) (KW_WHERE expression)? ( + KW_LIMIT limitClauseAtom + )? ; handlerCloseStatement @@ -983,15 +1030,15 @@ importTableStatement ; singleUpdateStatement - : KW_UPDATE priority=KW_LOW_PRIORITY? KW_IGNORE? tableName (KW_AS? table_alias=uid)? - KW_SET updatedElement (',' updatedElement)* - (KW_WHERE expression)? orderByClause? limitClause? + : KW_UPDATE priority=KW_LOW_PRIORITY? KW_IGNORE? tableName (KW_AS? table_alias=uid)? KW_SET updatedElement ( + ',' updatedElement + )* (KW_WHERE expression)? orderByClause? limitClause? ; multipleUpdateStatement - : KW_UPDATE priority=KW_LOW_PRIORITY? KW_IGNORE? tableSources - KW_SET updatedElement (',' updatedElement)* - (KW_WHERE expression)? + : KW_UPDATE priority=KW_LOW_PRIORITY? KW_IGNORE? tableSources KW_SET updatedElement ( + ',' updatedElement + )* (KW_WHERE expression)? ; // details @@ -1009,17 +1056,17 @@ tableSources ; tableSource - : tableSourceItem joinPart* #tableSourceBase - | '(' tableSourceItem joinPart* ')' #tableSourceNested - | jsonTable #tableJson + : tableSourceItem joinPart* # tableSourceBase + | '(' tableSourceItem joinPart* ')' # tableSourceNested + | jsonTable # tableJson ; tableSourceItem - : tableName - (KW_PARTITION '(' partitionNames ')' )? (KW_AS? alias=uid)? - (indexHint (',' indexHint)* )? #atomTableItem - | KW_LATERAL? ( selectStatement | '(' parenthesisSubquery=selectStatement ')') KW_AS? alias=uid fullColumnNames? #subqueryTableItem - | '(' tableSources ')' #tableSourcesItem + : tableName (KW_PARTITION '(' partitionNames ')')? (KW_AS? alias=uid)? ( + indexHint (',' indexHint)* + )? # atomTableItem + | KW_LATERAL? (selectStatement | '(' parenthesisSubquery=selectStatement ')') KW_AS? alias=uid fullColumnNames? # subqueryTableItem + | '(' tableSources ')' # tableSourcesItem ; // (col_list) | (col_alias [, col_alias] ...) @@ -1028,24 +1075,24 @@ fullColumnNames ; indexHint - : indexHintAction=(KW_USE | KW_IGNORE | KW_FORCE) - keyFormat=(KW_INDEX | KW_KEY) ( KW_FOR indexHintType)? - '(' indexNames? ')' + : indexHintAction=(KW_USE | KW_IGNORE | KW_FORCE) keyFormat=(KW_INDEX | KW_KEY) ( + KW_FOR indexHintType + )? '(' indexNames? ')' ; indexHintType - : KW_JOIN | KW_ORDER KW_BY | KW_GROUP KW_BY + : KW_JOIN + | KW_ORDER KW_BY + | KW_GROUP KW_BY ; joinPart - : (KW_INNER | KW_CROSS)? KW_JOIN KW_LATERAL? tableSourceItem joinSpec* #innerJoin - | KW_STRAIGHT_JOIN tableSourceItem joinSpec* #straightJoin - | (KW_LEFT | KW_RIGHT) KW_OUTER? KW_JOIN KW_LATERAL? tableSourceItem joinSpec* #outerJoin - | KW_NATURAL ((KW_INNER | (KW_LEFT | KW_RIGHT)) KW_OUTER?)? KW_JOIN tableSourceItem #naturalJoin + : (KW_INNER | KW_CROSS)? KW_JOIN KW_LATERAL? tableSourceItem joinSpec* # innerJoin + | KW_STRAIGHT_JOIN tableSourceItem joinSpec* # straightJoin + | (KW_LEFT | KW_RIGHT) KW_OUTER? KW_JOIN KW_LATERAL? tableSourceItem joinSpec* # outerJoin + | KW_NATURAL ((KW_INNER | (KW_LEFT | KW_RIGHT)) KW_OUTER?)? KW_JOIN tableSourceItem # naturalJoin ; - - joinSpec : (KW_ON expression) | KW_USING '(' columnNames ')' @@ -1065,15 +1112,12 @@ queryExpressionNointo // into clause within a given statement can appear only once querySpecification - : KW_SELECT selectSpec* selectElements intoClause? - fromClause groupByClause? havingClause? windowClause? orderByClause? limitClause? - | KW_SELECT selectSpec* selectElements - fromClause groupByClause? havingClause? windowClause? orderByClause? limitClause? intoClause? + : KW_SELECT selectSpec* selectElements intoClause? fromClause groupByClause? havingClause? windowClause? orderByClause? limitClause? + | KW_SELECT selectSpec* selectElements fromClause groupByClause? havingClause? windowClause? orderByClause? limitClause? intoClause? ; querySpecificationNointo - : KW_SELECT selectSpec* selectElements - fromClause groupByClause? havingClause? windowClause? orderByClause? limitClause? + : KW_SELECT selectSpec* selectElements fromClause groupByClause? havingClause? windowClause? orderByClause? limitClause? ; unionParenthesis @@ -1081,26 +1125,24 @@ unionParenthesis ; unionStatement - : KW_UNION unionType=(KW_ALL | KW_DISTINCT)? - (querySpecificationNointo | queryExpressionNointo) + : KW_UNION unionType=(KW_ALL | KW_DISTINCT)? (querySpecificationNointo | queryExpressionNointo) ; lateralStatement - : KW_LATERAL (querySpecificationNointo | - queryExpressionNointo | - ('(' (querySpecificationNointo | queryExpressionNointo) ')' (KW_AS? alias=uid)?) - ) + : KW_LATERAL ( + querySpecificationNointo + | queryExpressionNointo + | ('(' (querySpecificationNointo | queryExpressionNointo) ')' (KW_AS? alias=uid)?) + ) ; // JSON // https://dev.mysql.com/doc/refman/8.0/en/json-table-functions.html jsonTable - : KW_JSON_TABLE '(' - STRING_LITERAL ',' - STRING_LITERAL - KW_COLUMNS '(' jsonColumnList ')' - ')' (KW_AS? alias=uid)? + : KW_JSON_TABLE '(' STRING_LITERAL ',' STRING_LITERAL KW_COLUMNS '(' jsonColumnList ')' ')' ( + KW_AS? alias=uid + )? ; jsonColumnList @@ -1108,9 +1150,13 @@ jsonColumnList ; jsonColumn - : columnName ( KW_FOR KW_ORDINALITY - | dataType ( KW_PATH STRING_LITERAL jsonOnEmpty? jsonOnError? - | KW_EXISTS KW_PATH STRING_LITERAL ) ) + : columnName ( + KW_FOR KW_ORDINALITY + | dataType ( + KW_PATH STRING_LITERAL jsonOnEmpty? jsonOnError? + | KW_EXISTS KW_PATH STRING_LITERAL + ) + ) | KW_NESTED KW_PATH? STRING_LITERAL KW_COLUMNS '(' jsonColumnList ')' ; @@ -1126,37 +1172,34 @@ jsonOnError selectSpec : (KW_ALL | KW_DISTINCT | KW_DISTINCTROW) - | KW_HIGH_PRIORITY | KW_STRAIGHT_JOIN | KW_SQL_SMALL_RESULT - | KW_SQL_BIG_RESULT | KW_SQL_BUFFER_RESULT + | KW_HIGH_PRIORITY + | KW_STRAIGHT_JOIN + | KW_SQL_SMALL_RESULT + | KW_SQL_BIG_RESULT + | KW_SQL_BUFFER_RESULT | (KW_SQL_CACHE | KW_SQL_NO_CACHE) | KW_SQL_CALC_FOUND_ROWS ; selectElements - : (star='*' | selectElement ) (',' selectElement)* + : (star='*' | selectElement) (',' selectElement)* ; selectElement - : select_element=fullId '.' '*' #selectStarElement - | columnName (KW_AS? alias=uid)? #selectColumnElement - | functionCall (KW_AS? alias=uid)? #selectFunctionElement - | (LOCAL_ID VAR_ASSIGN)? expression (KW_AS? alias=uid)? #selectExpressionElement + : select_element=fullId '.' '*' # selectStarElement + | columnName (KW_AS? alias=uid)? # selectColumnElement + | functionCall (KW_AS? alias=uid)? # selectFunctionElement + | (LOCAL_ID VAR_ASSIGN)? expression (KW_AS? alias=uid)? # selectExpressionElement ; intoClause - : KW_INTO assignmentField (',' assignmentField )* #selectIntoVariables - | KW_INTO KW_DUMPFILE STRING_LITERAL #selectIntoDumpFile + : KW_INTO assignmentField (',' assignmentField)* # selectIntoVariables + | KW_INTO KW_DUMPFILE STRING_LITERAL # selectIntoDumpFile | ( - KW_INTO KW_OUTFILE filename=STRING_LITERAL - (KW_CHARACTER KW_SET charset=charsetName)? - ( - fieldsFormat=(KW_FIELDS | KW_COLUMNS) - selectFieldsInto+ - )? - ( - KW_LINES selectLinesInto+ - )? - ) #selectIntoTextFile + KW_INTO KW_OUTFILE filename=STRING_LITERAL (KW_CHARACTER KW_SET charset=charsetName)? ( + fieldsFormat=(KW_FIELDS | KW_COLUMNS) selectFieldsInto+ + )? (KW_LINES selectLinesInto+)? + ) # selectIntoTextFile ; selectFieldsInto @@ -1171,22 +1214,19 @@ selectLinesInto ; fromClause - : (KW_FROM tableSources)? - (KW_WHERE whereExpr=expression)? + : (KW_FROM tableSources)? (KW_WHERE whereExpr=expression)? ; groupByClause - : KW_GROUP KW_BY - groupByItem (',' groupByItem)* - (KW_WITH KW_ROLLUP)? + : KW_GROUP KW_BY groupByItem (',' groupByItem)* (KW_WITH KW_ROLLUP)? ; havingClause - : KW_HAVING havingExpr=expression + : KW_HAVING havingExpr=expression ; windowClause - : KW_WINDOW windowName KW_AS '(' windowSpec ')' (',' windowName KW_AS '(' windowSpec ')')* + : KW_WINDOW windowName KW_AS '(' windowSpec ')' (',' windowName KW_AS '(' windowSpec ')')* ; groupByItem @@ -1194,22 +1234,22 @@ groupByItem ; limitClause - : KW_LIMIT - ( - (offset=limitClauseAtom ',')? limit=limitClauseAtom - | limit=limitClauseAtom KW_OFFSET offset=limitClauseAtom + : KW_LIMIT ( + (offset=limitClauseAtom ',')? limit=limitClauseAtom + | limit=limitClauseAtom KW_OFFSET offset=limitClauseAtom ) ; limitClauseAtom - : decimalLiteral | mysqlVariable | simpleId - ; - + : decimalLiteral + | mysqlVariable + | simpleId + ; // Transaction's Statements startTransaction - : KW_START KW_TRANSACTION (transactionMode (',' transactionMode)* )? + : KW_START KW_TRANSACTION (transactionMode (',' transactionMode)*)? ; beginWork @@ -1217,15 +1257,11 @@ beginWork ; commitWork - : KW_COMMIT KW_WORK? - (KW_AND nochain=KW_NO? KW_CHAIN)? - (norelease=KW_NO? KW_RELEASE)? + : KW_COMMIT KW_WORK? (KW_AND nochain=KW_NO? KW_CHAIN)? (norelease=KW_NO? KW_RELEASE)? ; rollbackWork - : KW_ROLLBACK KW_WORK? - (KW_AND nochain=KW_NO? KW_CHAIN)? - (norelease=KW_NO? KW_RELEASE)? + : KW_ROLLBACK KW_WORK? (KW_AND nochain=KW_NO? KW_CHAIN)? (norelease=KW_NO? KW_RELEASE)? ; savepointStatement @@ -1248,7 +1284,6 @@ unlockTables : KW_UNLOCK KW_TABLES ; - // details setAutocommitStatement @@ -1256,8 +1291,9 @@ setAutocommitStatement ; setTransactionStatement - : KW_SET transactionContext=(KW_GLOBAL | KW_SESSION)? KW_TRANSACTION - transactionOption (',' transactionOption)* + : KW_SET transactionContext=(KW_GLOBAL | KW_SESSION)? KW_TRANSACTION transactionOption ( + ',' transactionOption + )* ; transactionMode @@ -1271,7 +1307,8 @@ lockTableElement ; lockAction - : KW_READ KW_LOCAL? | KW_LOW_PRIORITY? KW_WRITE + : KW_READ KW_LOCAL? + | KW_LOW_PRIORITY? KW_WRITE ; transactionOption @@ -1287,7 +1324,6 @@ transactionLevel | KW_SERIALIZABLE ; - // Replication's Statements // Base Replication @@ -1301,21 +1337,20 @@ changeReplicationFilter ; changeReplicationSource - : KW_CHANGE KW_REPLICATION KW_SOURCE KW_TO replicationSourceOption (',' replicationSourceOption)* channelOption? + : KW_CHANGE KW_REPLICATION KW_SOURCE KW_TO replicationSourceOption ( + ',' replicationSourceOption + )* channelOption? ; purgeBinaryLogs - : KW_PURGE purgeFormat=(KW_BINARY | KW_MASTER) KW_LOGS - ( - KW_TO fileName=STRING_LITERAL - | KW_BEFORE timeValue=STRING_LITERAL - ) + : KW_PURGE purgeFormat=(KW_BINARY | KW_MASTER) KW_LOGS ( + KW_TO fileName=STRING_LITERAL + | KW_BEFORE timeValue=STRING_LITERAL + ) ; startSlaveOrReplica - : KW_START (KW_SLAVE | KW_REPLICA) (threadType (',' threadType)*)? - (KW_UNTIL untilOption)? - connectionOptions* channelOption? + : KW_START (KW_SLAVE | KW_REPLICA) (threadType (',' threadType)*)? (KW_UNTIL untilOption)? connectionOptions* channelOption? ; stopSlaveOrReplica @@ -1323,7 +1358,9 @@ stopSlaveOrReplica ; startGroupReplication - : KW_START KW_GROUP_REPLICATION (KW_USER '=' STRING_LITERAL)? (',' KW_PASSWORD '=' STRING_LITERAL)? (',' KW_DEFAULT_AUTH '=' STRING_LITERAL)? + : KW_START KW_GROUP_REPLICATION (KW_USER '=' STRING_LITERAL)? ( + ',' KW_PASSWORD '=' STRING_LITERAL + )? (',' KW_DEFAULT_AUTH '=' STRING_LITERAL)? ; stopGroupReplication @@ -1331,24 +1368,45 @@ stopGroupReplication ; masterOption - : stringMasterOption '=' STRING_LITERAL #masterStringOption - | decimalMasterOption '=' decimalLiteral #masterDecimalOption - | boolMasterOption '=' boolVal=('0' | '1') #masterBoolOption - | v8NewMasterOption #v8AddMasterOption - | KW_IGNORE_SERVER_IDS '=' '(' (server_id=uid (',' server_id=uid)*)? ')' #masterUidListOption + : stringMasterOption '=' STRING_LITERAL # masterStringOption + | decimalMasterOption '=' decimalLiteral # masterDecimalOption + | boolMasterOption '=' boolVal=('0' | '1') # masterBoolOption + | v8NewMasterOption # v8AddMasterOption + | KW_IGNORE_SERVER_IDS '=' '(' (server_id=uid (',' server_id=uid)*)? ')' # masterUidListOption ; + stringMasterOption - : KW_MASTER_BIND | KW_MASTER_HOST | KW_MASTER_USER | KW_MASTER_PASSWORD - | KW_MASTER_LOG_FILE | KW_RELAY_LOG_FILE | KW_MASTER_COMPRESSION_ALGORITHMS - | KW_MASTER_SSL_CA | KW_MASTER_SSL_CAPATH | KW_MASTER_SSL_CERT | KW_MASTER_SSL_CRL - | KW_MASTER_SSL_CRLPATH | KW_MASTER_SSL_KEY | KW_MASTER_SSL_CIPHER - | KW_MASTER_TLS_VERSION | KW_MASTER_TLS_CIPHERSUITES | KW_MASTER_PUBLIC_KEY_PATH + : KW_MASTER_BIND + | KW_MASTER_HOST + | KW_MASTER_USER + | KW_MASTER_PASSWORD + | KW_MASTER_LOG_FILE + | KW_RELAY_LOG_FILE + | KW_MASTER_COMPRESSION_ALGORITHMS + | KW_MASTER_SSL_CA + | KW_MASTER_SSL_CAPATH + | KW_MASTER_SSL_CERT + | KW_MASTER_SSL_CRL + | KW_MASTER_SSL_CRLPATH + | KW_MASTER_SSL_KEY + | KW_MASTER_SSL_CIPHER + | KW_MASTER_TLS_VERSION + | KW_MASTER_TLS_CIPHERSUITES + | KW_MASTER_PUBLIC_KEY_PATH | KW_NETWORK_NAMESPACE ; + decimalMasterOption - : KW_MASTER_PORT | KW_MASTER_LOG_POS | KW_RELAY_LOG_POS | KW_MASTER_HEARTBEAT_PERIOD - | KW_MASTER_CONNECT_RETRY | KW_MASTER_RETRY_COUNT | KW_MASTER_DELAY | KW_MASTER_ZSTD_COMPRESSION_LEVEL + : KW_MASTER_PORT + | KW_MASTER_LOG_POS + | KW_RELAY_LOG_POS + | KW_MASTER_HEARTBEAT_PERIOD + | KW_MASTER_CONNECT_RETRY + | KW_MASTER_RETRY_COUNT + | KW_MASTER_DELAY + | KW_MASTER_ZSTD_COMPRESSION_LEVEL ; + boolMasterOption : KW_REQUIRE_ROW_FORMAT | KW_MASTER_AUTO_POSITION @@ -1358,6 +1416,7 @@ boolMasterOption | KW_GET_MASTER_PUBLIC_KEY | KW_GTID_ONLY ; + // https://dev.mysql.com/doc/refman/8.0/en/change-master-to.html v8NewMasterOption : KW_PRIVILEGE_CHECKS_USER '=' (STRING_LITERAL | KW_NULL_LITERAL) @@ -1366,24 +1425,45 @@ v8NewMasterOption ; replicationSourceOption - : stringSourceOption '=' STRING_LITERAL #sourceStringOption - | decimalSourceOption '=' decimalLiteral #sourceDecimalOption - | boolSourceOption '=' boolVal=('0' | '1') #sourceBoolOption - | otherSourceOption #sourceOtherOption - | KW_IGNORE_SERVER_IDS '=' '(' (server_id=uid (',' server_id=uid)*)? ')' #sourceUidListOption + : stringSourceOption '=' STRING_LITERAL # sourceStringOption + | decimalSourceOption '=' decimalLiteral # sourceDecimalOption + | boolSourceOption '=' boolVal=('0' | '1') # sourceBoolOption + | otherSourceOption # sourceOtherOption + | KW_IGNORE_SERVER_IDS '=' '(' (server_id=uid (',' server_id=uid)*)? ')' # sourceUidListOption ; + stringSourceOption - : KW_SOURCE_BIND | KW_SOURCE_HOST | KW_SOURCE_USER | KW_SOURCE_PASSWORD - | KW_SOURCE_LOG_FILE | KW_RELAY_LOG_FILE | KW_SOURCE_COMPRESSION_ALGORITHMS - | KW_SOURCE_SSL_CA | KW_SOURCE_SSL_CAPATH | KW_SOURCE_SSL_CERT | KW_SOURCE_SSL_CRL - | KW_SOURCE_SSL_CRLPATH | KW_SOURCE_SSL_KEY | KW_SOURCE_SSL_CIPHER - | KW_SOURCE_TLS_VERSION | KW_SOURCE_TLS_CIPHERSUITES | KW_SOURCE_PUBLIC_KEY_PATH + : KW_SOURCE_BIND + | KW_SOURCE_HOST + | KW_SOURCE_USER + | KW_SOURCE_PASSWORD + | KW_SOURCE_LOG_FILE + | KW_RELAY_LOG_FILE + | KW_SOURCE_COMPRESSION_ALGORITHMS + | KW_SOURCE_SSL_CA + | KW_SOURCE_SSL_CAPATH + | KW_SOURCE_SSL_CERT + | KW_SOURCE_SSL_CRL + | KW_SOURCE_SSL_CRLPATH + | KW_SOURCE_SSL_KEY + | KW_SOURCE_SSL_CIPHER + | KW_SOURCE_TLS_VERSION + | KW_SOURCE_TLS_CIPHERSUITES + | KW_SOURCE_PUBLIC_KEY_PATH | KW_NETWORK_NAMESPACE ; + decimalSourceOption - : KW_SOURCE_PORT | KW_SOURCE_LOG_POS | KW_RELAY_LOG_POS | KW_SOURCE_HEARTBEAT_PERIOD - | KW_SOURCE_CONNECT_RETRY | KW_SOURCE_RETRY_COUNT | KW_SOURCE_DELAY | KW_SOURCE_ZSTD_COMPRESSION_LEVEL + : KW_SOURCE_PORT + | KW_SOURCE_LOG_POS + | KW_RELAY_LOG_POS + | KW_SOURCE_HEARTBEAT_PERIOD + | KW_SOURCE_CONNECT_RETRY + | KW_SOURCE_RETRY_COUNT + | KW_SOURCE_DELAY + | KW_SOURCE_ZSTD_COMPRESSION_LEVEL ; + boolSourceOption : KW_REQUIRE_ROW_FORMAT | KW_SOURCE_AUTO_POSITION @@ -1393,6 +1473,7 @@ boolSourceOption | KW_GET_SOURCE_PUBLIC_KEY | KW_GTID_ONLY ; + otherSourceOption : KW_PRIVILEGE_CHECKS_USER '=' (STRING_LITERAL | KW_NULL_LITERAL) | KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK '=' (KW_STREAM | KW_ON | KW_OFF | KW_GENERATE) @@ -1404,15 +1485,13 @@ channelOption ; replicationFilter - : KW_REPLICATE_DO_DB '=' '(' databaseName (',' databaseName)* ')' #doDbReplication - | KW_REPLICATE_IGNORE_DB '=' '(' databaseName (',' databaseName)* ')' #ignoreDbReplication - | KW_REPLICATE_DO_TABLE '=' '(' tableNames ')' #doTableReplication - | KW_REPLICATE_IGNORE_TABLE '=' '(' tableNames ')' #ignoreTableReplication - | KW_REPLICATE_WILD_DO_TABLE '=' '(' simpleStrings ')' #wildDoTableReplication - | KW_REPLICATE_WILD_IGNORE_TABLE - '=' '(' simpleStrings ')' #wildIgnoreTableReplication - | KW_REPLICATE_REWRITE_DB '=' - '(' tablePair (',' tablePair)* ')' #rewriteDbReplication + : KW_REPLICATE_DO_DB '=' '(' databaseName (',' databaseName)* ')' # doDbReplication + | KW_REPLICATE_IGNORE_DB '=' '(' databaseName (',' databaseName)* ')' # ignoreDbReplication + | KW_REPLICATE_DO_TABLE '=' '(' tableNames ')' # doTableReplication + | KW_REPLICATE_IGNORE_TABLE '=' '(' tableNames ')' # ignoreTableReplication + | KW_REPLICATE_WILD_DO_TABLE '=' '(' simpleStrings ')' # wildDoTableReplication + | KW_REPLICATE_WILD_IGNORE_TABLE '=' '(' simpleStrings ')' # wildIgnoreTableReplication + | KW_REPLICATE_REWRITE_DB '=' '(' tablePair (',' tablePair)* ')' # rewriteDbReplication ; tablePair @@ -1420,22 +1499,23 @@ tablePair ; threadType - : KW_IO_THREAD | KW_SQL_THREAD + : KW_IO_THREAD + | KW_SQL_THREAD ; untilOption - : gtids=(KW_SQL_BEFORE_GTIDS | KW_SQL_AFTER_GTIDS) '=' gtuidSet #gtidsUntilOption - | KW_MASTER_LOG_FILE '=' STRING_LITERAL ',' KW_MASTER_LOG_POS '=' decimalLiteral #masterLogUntilOption - | KW_SOURCE_LOG_FILE '=' STRING_LITERAL ',' KW_SOURCE_LOG_POS '=' decimalLiteral #sourceLogUntilOption - | KW_RELAY_LOG_FILE '=' STRING_LITERAL ',' KW_RELAY_LOG_POS '=' decimalLiteral #relayLogUntilOption - | KW_SQL_AFTER_MTS_GAPS #sqlGapsUntilOption + : gtids=(KW_SQL_BEFORE_GTIDS | KW_SQL_AFTER_GTIDS) '=' gtuidSet # gtidsUntilOption + | KW_MASTER_LOG_FILE '=' STRING_LITERAL ',' KW_MASTER_LOG_POS '=' decimalLiteral # masterLogUntilOption + | KW_SOURCE_LOG_FILE '=' STRING_LITERAL ',' KW_SOURCE_LOG_POS '=' decimalLiteral # sourceLogUntilOption + | KW_RELAY_LOG_FILE '=' STRING_LITERAL ',' KW_RELAY_LOG_POS '=' decimalLiteral # relayLogUntilOption + | KW_SQL_AFTER_MTS_GAPS # sqlGapsUntilOption ; connectionOptions - : KW_USER '=' conOptUser=STRING_LITERAL #userConnectionOption - | KW_PASSWORD '=' conOptPassword=STRING_LITERAL #passwordConnectionOption - | KW_DEFAULT_AUTH '=' conOptDefAuth=STRING_LITERAL #defaultAuthConnectionOption - | KW_PLUGIN_DIR '=' conOptPluginDir=STRING_LITERAL #pluginDirConnectionOption + : KW_USER '=' conOptUser=STRING_LITERAL # userConnectionOption + | KW_PASSWORD '=' conOptPassword=STRING_LITERAL # passwordConnectionOption + | KW_DEFAULT_AUTH '=' conOptDefAuth=STRING_LITERAL # defaultAuthConnectionOption + | KW_PLUGIN_DIR '=' conOptPluginDir=STRING_LITERAL # pluginDirConnectionOption ; gtuidSet @@ -1443,7 +1523,6 @@ gtuidSet | STRING_LITERAL ; - // XA Transactions xaStartTransaction @@ -1470,10 +1549,8 @@ xaRecoverWork : KW_XA KW_RECOVER (KW_CONVERT xid)? ; - prepareStatement - : KW_PREPARE stmt_name=uid KW_FROM - (query=STRING_LITERAL | variable=LOCAL_ID) + : KW_PREPARE stmt_name=uid KW_FROM (query=STRING_LITERAL | variable=LOCAL_ID) ; executeStatement @@ -1485,31 +1562,24 @@ deallocatePrepare ; routineBody - : blockStatement | sqlStatement + : blockStatement + | sqlStatement ; blockStatement - : (begin=uid ':')? KW_BEGIN - (declareVariable SEMI)* - (declareCondition SEMI)* - (declareCursor SEMI)* - (declareHandler SEMI)* - procedureSqlStatement* - KW_END end=uid? + : (begin=uid ':')? KW_BEGIN (declareVariable SEMI)* (declareCondition SEMI)* ( + declareCursor SEMI + )* (declareHandler SEMI)* procedureSqlStatement* KW_END end=uid? ; caseStatement - : KW_CASE (case_value=uid | expression)? caseAlternative+ - (KW_ELSE procedureSqlStatement+)? - KW_END KW_CASE + : KW_CASE (case_value=uid | expression)? caseAlternative+ (KW_ELSE procedureSqlStatement+)? KW_END KW_CASE ; ifStatement - : KW_IF expression - KW_THEN thenStatements+=procedureSqlStatement+ - elifAlternative* - (KW_ELSE elseStatements+=procedureSqlStatement+ )? - KW_END KW_IF + : KW_IF expression KW_THEN thenStatements+=procedureSqlStatement+ elifAlternative* ( + KW_ELSE elseStatements+=procedureSqlStatement+ + )? KW_END KW_IF ; iterateStatement @@ -1521,16 +1591,11 @@ leaveStatement ; loopStatement - : (begin_label=uid ':')? - KW_LOOP procedureSqlStatement+ - KW_END KW_LOOP end_label=uid? + : (begin_label=uid ':')? KW_LOOP procedureSqlStatement+ KW_END KW_LOOP end_label=uid? ; repeatStatement - : (begin_label=uid ':')? - KW_REPEAT procedureSqlStatement+ - KW_UNTIL expression - KW_END KW_REPEAT end_label=uid? + : (begin_label=uid ':')? KW_REPEAT procedureSqlStatement+ KW_UNTIL expression KW_END KW_REPEAT end_label=uid? ; returnStatement @@ -1538,16 +1603,13 @@ returnStatement ; whileStatement - : (begin_label=uid ':')? - KW_WHILE expression - KW_DO procedureSqlStatement+ - KW_END KW_WHILE end_label=uid? + : (begin_label=uid ':')? KW_WHILE expression KW_DO procedureSqlStatement+ KW_END KW_WHILE end_label=uid? ; cursorStatement - : KW_CLOSE cursor_name=uid #CloseCursor - | KW_FETCH (KW_NEXT? KW_FROM)? cursor_name=uid KW_INTO var_names=uidList #FetchCursor - | KW_OPEN cursor_name=uid #OpenCursor + : KW_CLOSE cursor_name=uid # CloseCursor + | KW_FETCH (KW_NEXT? KW_FROM)? cursor_name=uid KW_INTO var_names=uidList # FetchCursor + | KW_OPEN cursor_name=uid # OpenCursor ; declareVariable @@ -1555,8 +1617,10 @@ declareVariable ; declareCondition - : KW_DECLARE condition_name=uid KW_CONDITION KW_FOR - ( decimalLiteral | KW_SQLSTATE KW_VALUE? STRING_LITERAL) + : KW_DECLARE condition_name=uid KW_CONDITION KW_FOR ( + decimalLiteral + | KW_SQLSTATE KW_VALUE? STRING_LITERAL + ) ; declareCursor @@ -1564,19 +1628,18 @@ declareCursor ; declareHandler - : KW_DECLARE handlerAction=(KW_CONTINUE | KW_EXIT | KW_UNDO) - KW_HANDLER KW_FOR - handlerConditionValue (',' handlerConditionValue)* - routineBody + : KW_DECLARE handlerAction=(KW_CONTINUE | KW_EXIT | KW_UNDO) KW_HANDLER KW_FOR handlerConditionValue ( + ',' handlerConditionValue + )* routineBody ; handlerConditionValue - : decimalLiteral #handlerConditionCode - | KW_SQLSTATE KW_VALUE? STRING_LITERAL #handlerConditionState - | condition_name=uid #handlerConditionName - | KW_SQLWARNING #handlerConditionWarning - | KW_NOT KW_FOUND #handlerConditionNotfound - | KW_SQLEXCEPTION #handlerConditionException + : decimalLiteral # handlerConditionCode + | KW_SQLSTATE KW_VALUE? STRING_LITERAL # handlerConditionState + | condition_name=uid # handlerConditionName + | KW_SQLWARNING # handlerConditionWarning + | KW_NOT KW_FOUND # handlerConditionNotfound + | KW_SQLEXCEPTION # handlerConditionException ; procedureSqlStatement @@ -1584,13 +1647,11 @@ procedureSqlStatement ; caseAlternative - : KW_WHEN (constant | expression) - KW_THEN procedureSqlStatement+ + : KW_WHEN (constant | expression) KW_THEN procedureSqlStatement+ ; elifAlternative - : KW_ELSEIF expression - KW_THEN procedureSqlStatement+ + : KW_ELSEIF expression KW_THEN procedureSqlStatement+ ; // Administration Statements @@ -1599,25 +1660,24 @@ elifAlternative alterUser : KW_ALTER KW_USER ifExists? ( - (userSpecification (',' userSpecification)*) - | ( - alterUserAuthOption (',' alterUserAuthOption)* - (KW_REQUIRE (KW_NONE | tlsOption (KW_AND? tlsOption)* ))? - (KW_WITH userResourceOption+)? - (userPasswordOption | userLockOption)* - ((KW_COMMENT | KW_ATTRIBUTE) STRING_LITERAL)? - ) | ((userOrRoleName) KW_DEFAULT KW_ROLE roleOption) + (userSpecification (',' userSpecification)*) + | ( + alterUserAuthOption (',' alterUserAuthOption)* ( + KW_REQUIRE (KW_NONE | tlsOption (KW_AND? tlsOption)*) + )? (KW_WITH userResourceOption+)? (userPasswordOption | userLockOption)* ( + (KW_COMMENT | KW_ATTRIBUTE) STRING_LITERAL + )? + ) + | ((userOrRoleName) KW_DEFAULT KW_ROLE roleOption) ) ; createUser - : KW_CREATE KW_USER ifNotExists? - userName createUserAuthOption? (',' userName createUserAuthOption?)* - (KW_DEFAULT KW_ROLE roleOption)? - (KW_REQUIRE (KW_NONE | tlsOption (KW_AND? tlsOption)*))? - (KW_WITH userResourceOption+)? - (userPasswordOption | userLockOption)* - ((KW_COMMENT | KW_ATTRIBUTE) STRING_LITERAL)? + : KW_CREATE KW_USER ifNotExists? userName createUserAuthOption? ( + ',' userName createUserAuthOption? + )* (KW_DEFAULT KW_ROLE roleOption)? (KW_REQUIRE (KW_NONE | tlsOption (KW_AND? tlsOption)*))? ( + KW_WITH userResourceOption+ + )? (userPasswordOption | userLockOption)* ((KW_COMMENT | KW_ATTRIBUTE) STRING_LITERAL)? ; dropUser @@ -1625,15 +1685,15 @@ dropUser ; grantStatement - : KW_GRANT privelegeClause (',' privelegeClause)* - KW_ON privilegeObjectType? privilegeLevel - KW_TO ((userAuthOption (',' userAuthOption)*) | userOrRoleNames) - (KW_REQUIRE (tlsNone=KW_NONE | tlsOption (KW_AND? tlsOption)*))? - (KW_WITH (KW_GRANT KW_OPTION | userResourceOption)* )? - (KW_AS userName (KW_WITH KW_ROLE roleOption)?)? - | KW_GRANT (KW_PROXY KW_ON)? (userOrRoleName) (',' (userOrRoleName))* - KW_TO (userOrRoleName) (',' (userOrRoleName))* - (KW_WITH KW_ADMIN KW_OPTION)? + : KW_GRANT privelegeClause (',' privelegeClause)* KW_ON privilegeObjectType? privilegeLevel KW_TO ( + (userAuthOption (',' userAuthOption)*) + | userOrRoleNames + ) (KW_REQUIRE (tlsNone=KW_NONE | tlsOption (KW_AND? tlsOption)*))? ( + KW_WITH (KW_GRANT KW_OPTION | userResourceOption)* + )? (KW_AS userName (KW_WITH KW_ROLE roleOption)?)? + | KW_GRANT (KW_PROXY KW_ON)? (userOrRoleName) (',' (userOrRoleName))* KW_TO (userOrRoleName) ( + ',' (userOrRoleName) + )* (KW_WITH KW_ADMIN KW_OPTION)? ; roleOption @@ -1644,24 +1704,21 @@ roleOption ; grantProxy - : KW_GRANT KW_PROXY KW_ON fromFirst=userName - KW_TO toFirst=userName (',' toOther+=userName)* - (KW_WITH KW_GRANT KW_OPTION)? + : KW_GRANT KW_PROXY KW_ON fromFirst=userName KW_TO toFirst=userName (',' toOther+=userName)* ( + KW_WITH KW_GRANT KW_OPTION + )? ; alterResourceGroup - : KW_ALTER KW_RESOURCE KW_GROUP groupName - (KW_VCPU '='? resourceGroupVcpuSpec)? - (KW_THREAD_PRIORITY '='? decimalLiteral)? - ((KW_ENABLE | KW_DISABLE) KW_FORCE?)? + : KW_ALTER KW_RESOURCE KW_GROUP groupName (KW_VCPU '='? resourceGroupVcpuSpec)? ( + KW_THREAD_PRIORITY '='? decimalLiteral + )? ((KW_ENABLE | KW_DISABLE) KW_FORCE?)? ; createResourceGroup - : KW_CREATE KW_RESOURCE KW_GROUP groupNameCreate - KW_TYPE '=' (KW_SYSTEM | KW_USER) - (KW_VCPU '='? resourceGroupVcpuSpec)? - (KW_THREAD_PRIORITY '='? decimalLiteral)? - (KW_ENABLE | KW_DISABLE)? + : KW_CREATE KW_RESOURCE KW_GROUP groupNameCreate KW_TYPE '=' (KW_SYSTEM | KW_USER) ( + KW_VCPU '='? resourceGroupVcpuSpec + )? (KW_THREAD_PRIORITY '='? decimalLiteral)? (KW_ENABLE | KW_DISABLE)? ; dropResourceGroup @@ -1677,19 +1734,14 @@ resourceGroupVcpuSpec ; renameUser - : KW_RENAME KW_USER - renameUserClause (',' renameUserClause)* + : KW_RENAME KW_USER renameUserClause (',' renameUserClause)* ; revokeStatement - : KW_REVOKE ifExists? privelegeClause (',' privelegeClause)* - KW_ON privilegeObjectType? privilegeLevel - KW_FROM userOrRoleNames - ignoreUnknownUser? #detailRevoke - | KW_REVOKE ifExists? KW_ALL KW_PRIVILEGES? ',' KW_GRANT KW_OPTION - KW_FROM userOrRoleNames ignoreUnknownUser? #shortRevoke - | KW_REVOKE ifExists? (KW_PROXY KW_ON)? userOrRoleNames - KW_FROM userOrRoleNames ignoreUnknownUser? #proxyAndRoleRevoke + : KW_REVOKE ifExists? privelegeClause (',' privelegeClause)* KW_ON privilegeObjectType? privilegeLevel KW_FROM userOrRoleNames ignoreUnknownUser? # + detailRevoke + | KW_REVOKE ifExists? KW_ALL KW_PRIVILEGES? ',' KW_GRANT KW_OPTION KW_FROM userOrRoleNames ignoreUnknownUser? # shortRevoke + | KW_REVOKE ifExists? (KW_PROXY KW_ON)? userOrRoleNames KW_FROM userOrRoleNames ignoreUnknownUser? # proxyAndRoleRevoke ; ignoreUnknownUser @@ -1697,12 +1749,16 @@ ignoreUnknownUser ; privilegeObjectType - : KW_TABLE | KW_FUNCTION | KW_PROCEDURE + : KW_TABLE + | KW_FUNCTION + | KW_PROCEDURE ; setPasswordStatement - : KW_SET KW_PASSWORD (KW_FOR userName)? '=' ( passwordFunctionClause | STRING_LITERAL) #v57 - | KW_SET KW_PASSWORD (KW_FOR userName)? (KW_TO KW_RANDOM | '=' STRING_LITERAL) (KW_REPLACE STRING_LITERAL)? (KW_RETAIN KW_CURRENT KW_PASSWORD)? #v80 + : KW_SET KW_PASSWORD (KW_FOR userName)? '=' (passwordFunctionClause | STRING_LITERAL) # v57 + | KW_SET KW_PASSWORD (KW_FOR userName)? (KW_TO KW_RANDOM | '=' STRING_LITERAL) ( + KW_REPLACE STRING_LITERAL + )? (KW_RETAIN KW_CURRENT KW_PASSWORD)? # v80 ; userSpecification @@ -1721,21 +1777,27 @@ alterUserAuthOption // createUser auth_option, 2fa_auth_option, 3fa_auth_option createUserAuthOption - : KW_IDENTIFIED KW_BY (STRING_LITERAL | (KW_RANDOM KW_PASSWORD) | (KW_PASSWORD STRING_LITERAL)) (KW_AND createUserAuthOption)? - | KW_IDENTIFIED KW_WITH authPlugin=uid ((KW_BY (STRING_LITERAL | (KW_RANDOM KW_PASSWORD))) | KW_AS STRING_LITERAL)? (KW_AND createUserAuthOption)? + : KW_IDENTIFIED KW_BY (STRING_LITERAL | (KW_RANDOM KW_PASSWORD) | (KW_PASSWORD STRING_LITERAL)) ( + KW_AND createUserAuthOption + )? + | KW_IDENTIFIED KW_WITH authPlugin=uid ( + (KW_BY (STRING_LITERAL | (KW_RANDOM KW_PASSWORD))) + | KW_AS STRING_LITERAL + )? (KW_AND createUserAuthOption)? | KW_IDENTIFIED KW_WITH authPlugin=uid createUserInitialAuthOption? ; + createUserInitialAuthOption : KW_INITIAL KW_AUTHENTICATION KW_IDENTIFIED KW_BY ((KW_RANDOM KW_PASSWORD) | STRING_LITERAL) | KW_INITIAL KW_AUTHENTICATION KW_IDENTIFIED KW_WITH authPlugin=uid KW_AS STRING_LITERAL ; userAuthOption - : userName KW_IDENTIFIED KW_BY KW_PASSWORD hashed=STRING_LITERAL #hashAuthOption - | userName KW_IDENTIFIED KW_BY KW_RANDOM KW_PASSWORD authOptionClause #randomAuthOption - | userName KW_IDENTIFIED KW_BY STRING_LITERAL authOptionClause #stringAuthOption - | userName KW_IDENTIFIED KW_WITH authenticationRule #moduleAuthOption - | userName #simpleAuthOption + : userName KW_IDENTIFIED KW_BY KW_PASSWORD hashed=STRING_LITERAL # hashAuthOption + | userName KW_IDENTIFIED KW_BY KW_RANDOM KW_PASSWORD authOptionClause # randomAuthOption + | userName KW_IDENTIFIED KW_BY STRING_LITERAL authOptionClause # stringAuthOption + | userName KW_IDENTIFIED KW_WITH authenticationRule # moduleAuthOption + | userName # simpleAuthOption ; authOptionClause @@ -1743,11 +1805,10 @@ authOptionClause ; authenticationRule - : authPlugin=uid - ((KW_BY | KW_USING | KW_AS) (STRING_LITERAL | KW_RANDOM KW_PASSWORD) - authOptionClause)? #module - | authPlugin=uid - KW_USING passwordFunctionClause #passwordModuleOption + : authPlugin=uid ( + (KW_BY | KW_USING | KW_AS) (STRING_LITERAL | KW_RANDOM KW_PASSWORD) authOptionClause + )? # module + | authPlugin=uid KW_USING passwordFunctionClause # passwordModuleOption ; tlsOption @@ -1766,11 +1827,11 @@ userResourceOption ; userPasswordOption - : KW_PASSWORD KW_EXPIRE - (expireType=KW_DEFAULT - | expireType=KW_NEVER - | expireType=KW_INTERVAL decimalLiteral KW_DAY - )? + : KW_PASSWORD KW_EXPIRE ( + expireType=KW_DEFAULT + | expireType=KW_NEVER + | expireType=KW_INTERVAL decimalLiteral KW_DAY + )? | KW_PASSWORD KW_HISTORY (KW_DEFAULT | decimalLiteral) | KW_PASSWORD KW_REUSE KW_INTERVAL (KW_DEFAULT | decimalLiteral KW_DAY) | KW_PASSWORD KW_REQUIRE KW_CURRENT (KW_OPTIONAL | KW_DEFAULT)? @@ -1783,7 +1844,10 @@ userLockOption ; factorAuthOption - : KW_IDENTIFIED (KW_WITH authPlugin=uid)? ((KW_BY (STRING_LITERAL | (KW_RANDOM KW_PASSWORD))) | KW_AS STRING_LITERAL) + : KW_IDENTIFIED (KW_WITH authPlugin=uid)? ( + (KW_BY (STRING_LITERAL | (KW_RANDOM KW_PASSWORD))) + | KW_AS STRING_LITERAL + ) ; registrationOption @@ -1797,40 +1861,86 @@ factor ; privelegeClause - : privilege ( '(' columnNames ')' )? + : privilege ('(' columnNames ')')? ; privilege : KW_ALL KW_PRIVILEGES? | KW_ALTER KW_ROUTINE? - | KW_CREATE - (KW_TEMPORARY KW_TABLES | KW_ROUTINE | KW_VIEW | KW_USER | KW_TABLESPACE | KW_ROLE)? - | KW_DELETE | KW_DROP (KW_ROLE)? | KW_EVENT | KW_EXECUTE | KW_FILE | KW_GRANT KW_OPTION - | KW_INDEX | KW_INSERT | KW_LOCK KW_TABLES | KW_PROCESS | KW_PROXY - | KW_REFERENCES | KW_RELOAD + | KW_CREATE (KW_TEMPORARY KW_TABLES | KW_ROUTINE | KW_VIEW | KW_USER | KW_TABLESPACE | KW_ROLE)? + | KW_DELETE + | KW_DROP (KW_ROLE)? + | KW_EVENT + | KW_EXECUTE + | KW_FILE + | KW_GRANT KW_OPTION + | KW_INDEX + | KW_INSERT + | KW_LOCK KW_TABLES + | KW_PROCESS + | KW_PROXY + | KW_REFERENCES + | KW_RELOAD | KW_REPLICATION (KW_CLIENT | KW_SLAVE) | KW_SELECT | KW_SHOW (KW_VIEW | KW_DATABASES) - | KW_SHUTDOWN | KW_SUPER | KW_TRIGGER | KW_UPDATE | KW_USAGE - | KW_APPLICATION_PASSWORD_ADMIN | KW_AUDIT_ABORT_EXEMPT | KW_AUDIT_ADMIN | KW_AUTHENTICATION_POLICY_ADMIN | KW_BACKUP_ADMIN | KW_BINLOG_ADMIN | KW_BINLOG_ENCRYPTION_ADMIN | KW_CLONE_ADMIN - | KW_CONNECTION_ADMIN | KW_ENCRYPTION_KEY_ADMIN | KW_FIREWALL_ADMIN | KW_FIREWALL_EXEMPT | KW_FIREWALL_USER | KW_FLUSH_OPTIMIZER_COSTS - | KW_FLUSH_STATUS | KW_FLUSH_TABLES | KW_FLUSH_USER_RESOURCES | KW_GROUP_REPLICATION_ADMIN - | KW_INNODB_REDO_LOG_ARCHIVE | KW_INNODB_REDO_LOG_ENABLE | KW_NDB_STORED_USER | KW_PASSWORDLESS_USER_ADMIN | KW_PERSIST_RO_VARIABLES_ADMIN | KW_REPLICATION_APPLIER - | KW_REPLICATION_SLAVE_ADMIN | KW_RESOURCE_GROUP_ADMIN | KW_RESOURCE_GROUP_USER | KW_ROLE_ADMIN + | KW_SHUTDOWN + | KW_SUPER + | KW_TRIGGER + | KW_UPDATE + | KW_USAGE + | KW_APPLICATION_PASSWORD_ADMIN + | KW_AUDIT_ABORT_EXEMPT + | KW_AUDIT_ADMIN + | KW_AUTHENTICATION_POLICY_ADMIN + | KW_BACKUP_ADMIN + | KW_BINLOG_ADMIN + | KW_BINLOG_ENCRYPTION_ADMIN + | KW_CLONE_ADMIN + | KW_CONNECTION_ADMIN + | KW_ENCRYPTION_KEY_ADMIN + | KW_FIREWALL_ADMIN + | KW_FIREWALL_EXEMPT + | KW_FIREWALL_USER + | KW_FLUSH_OPTIMIZER_COSTS + | KW_FLUSH_STATUS + | KW_FLUSH_TABLES + | KW_FLUSH_USER_RESOURCES + | KW_GROUP_REPLICATION_ADMIN + | KW_INNODB_REDO_LOG_ARCHIVE + | KW_INNODB_REDO_LOG_ENABLE + | KW_NDB_STORED_USER + | KW_PASSWORDLESS_USER_ADMIN + | KW_PERSIST_RO_VARIABLES_ADMIN + | KW_REPLICATION_APPLIER + | KW_REPLICATION_SLAVE_ADMIN + | KW_RESOURCE_GROUP_ADMIN + | KW_RESOURCE_GROUP_USER + | KW_ROLE_ADMIN | KW_SERVICE_CONNECTION_ADMIN - | KW_SESSION_VARIABLES_ADMIN | KW_SET_USER_ID | KW_SKIP_QUERY_REWRITE | KW_SHOW_ROUTINE | KW_SYSTEM_USER | KW_SYSTEM_VARIABLES_ADMIN - | KW_TABLE_ENCRYPTION_ADMIN | KW_TP_CONNECTION_ADMIN | KW_VERSION_TOKEN_ADMIN | KW_XA_RECOVER_ADMIN + | KW_SESSION_VARIABLES_ADMIN + | KW_SET_USER_ID + | KW_SKIP_QUERY_REWRITE + | KW_SHOW_ROUTINE + | KW_SYSTEM_USER + | KW_SYSTEM_VARIABLES_ADMIN + | KW_TABLE_ENCRYPTION_ADMIN + | KW_TP_CONNECTION_ADMIN + | KW_VERSION_TOKEN_ADMIN + | KW_XA_RECOVER_ADMIN // MySQL on Amazon RDS - | KW_LOAD KW_FROM KW_S3 | KW_SELECT KW_INTO KW_S3 | KW_INVOKE KW_LAMBDA + | KW_LOAD KW_FROM KW_S3 + | KW_SELECT KW_INTO KW_S3 + | KW_INVOKE KW_LAMBDA ; privilegeLevel - : '*' #currentSchemaPriviLevel - | '*' '.' '*' #globalPrivLevel - | uid '.' '*' #definiteSchemaPrivLevel - | uid '.' uid #definiteFullTablePrivLevel - | uid dottedId #definiteFullTablePrivLevel2 - | uid #definiteTablePrivLevel + : '*' # currentSchemaPriviLevel + | '*' '.' '*' # globalPrivLevel + | uid '.' '*' # definiteSchemaPrivLevel + | uid '.' uid # definiteFullTablePrivLevel + | uid dottedId # definiteFullTablePrivLevel2 + | uid # definiteTablePrivLevel ; renameUserClause @@ -1841,8 +1951,12 @@ renameUserClause analyzeTable : KW_ANALYZE tableActionOption? KW_TABLE tableNames - | KW_ANALYZE tableActionOption? KW_TABLE tableName KW_UPDATE KW_HISTOGRAM KW_ON columnNames (KW_WITH decimalLiteral KW_BUCKETS)? - | KW_ANALYZE tableActionOption? KW_TABLE tableName KW_UPDATE KW_HISTOGRAM KW_ON columnName (KW_USING KW_DATA STRING_LITERAL)? + | KW_ANALYZE tableActionOption? KW_TABLE tableName KW_UPDATE KW_HISTOGRAM KW_ON columnNames ( + KW_WITH decimalLiteral KW_BUCKETS + )? + | KW_ANALYZE tableActionOption? KW_TABLE tableName KW_UPDATE KW_HISTOGRAM KW_ON columnName ( + KW_USING KW_DATA STRING_LITERAL + )? | KW_ANALYZE tableActionOption? KW_TABLE tableName KW_DROP KW_HISTOGRAM KW_ON columnNames ; @@ -1855,33 +1969,42 @@ checksumTable ; optimizeTable - : KW_OPTIMIZE tableActionOption? - (KW_TABLE | KW_TABLES) tableNames + : KW_OPTIMIZE tableActionOption? (KW_TABLE | KW_TABLES) tableNames ; repairTable - : KW_REPAIR tableActionOption? - KW_TABLE tableNames - KW_QUICK? KW_EXTENDED? KW_USE_FRM? + : KW_REPAIR tableActionOption? KW_TABLE tableNames KW_QUICK? KW_EXTENDED? KW_USE_FRM? ; tableActionOption - : KW_NO_WRITE_TO_BINLOG | KW_LOCAL + : KW_NO_WRITE_TO_BINLOG + | KW_LOCAL ; checkTableOption - : KW_FOR KW_UPGRADE | KW_QUICK | KW_FAST | KW_MEDIUM | KW_EXTENDED | KW_CHANGED + : KW_FOR KW_UPGRADE + | KW_QUICK + | KW_FAST + | KW_MEDIUM + | KW_EXTENDED + | KW_CHANGED ; createFunction - : KW_CREATE KW_AGGREGATE? KW_FUNCTION ifNotExists? functionNameCreate - KW_RETURNS returnType=(KW_STRING | KW_INTEGER | KW_REAL | KW_DECIMAL) - KW_SONAME STRING_LITERAL + : KW_CREATE KW_AGGREGATE? KW_FUNCTION ifNotExists? functionNameCreate KW_RETURNS returnType=( + KW_STRING + | KW_INTEGER + | KW_REAL + | KW_DECIMAL + ) KW_SONAME STRING_LITERAL ; installComponent - : KW_INSTALL KW_COMPONENT component_name=uid (',' component_name=uid)* (KW_SET variableExpr (',' variableExpr)*)? + : KW_INSTALL KW_COMPONENT component_name=uid (',' component_name=uid)* ( + KW_SET variableExpr (',' variableExpr)* + )? ; + variableExpr : (KW_GLOBAL | GLOBAL_ID | KW_PERSIST | PERSIST_ID) system_var_name=fullId '=' expression ; @@ -1898,76 +2021,81 @@ uninstallPlugin : KW_UNINSTALL KW_PLUGIN pluginName=uid ; - cloneStatement : KW_CLONE KW_LOCAL KW_DATA KW_DIRECTORY '='? STRING_LITERAL - | KW_CLONE KW_INSTANCE KW_FROM userHostPort - KW_IDENTIFIED KW_BY STRING_LITERAL - (KW_DATA KW_DIRECTORY '='? STRING_LITERAL)? - (KW_REQUIRE KW_NO? KW_SSL)? + | KW_CLONE KW_INSTANCE KW_FROM userHostPort KW_IDENTIFIED KW_BY STRING_LITERAL ( + KW_DATA KW_DIRECTORY '='? STRING_LITERAL + )? (KW_REQUIRE KW_NO? KW_SSL)? ; setStatement - : KW_SET variableClause ('=' | ':=') (expression | KW_ON) - (',' variableClause ('=' | ':=') (expression | KW_ON))* #setVariable - | KW_SET charSet (charsetName | KW_DEFAULT) #setCharset - | KW_SET KW_NAMES - (charsetName (KW_COLLATE collationName)? | KW_DEFAULT) #setNames - | setPasswordStatement #setPassword - | setTransactionStatement #setTransaction - | setAutocommitStatement #setAutocommit - | KW_SET system_var_name=fullId ('=' | ':=') expression (',' system_var_name=fullId ('=' | ':=') expression)* #setNewValueInsideTrigger + : KW_SET variableClause ('=' | ':=') (expression | KW_ON) ( + ',' variableClause ('=' | ':=') (expression | KW_ON) + )* # setVariable + | KW_SET charSet (charsetName | KW_DEFAULT) # setCharset + | KW_SET KW_NAMES (charsetName (KW_COLLATE collationName)? | KW_DEFAULT) # setNames + | setPasswordStatement # setPassword + | setTransactionStatement # setTransaction + | setAutocommitStatement # setAutocommit + | KW_SET system_var_name=fullId ('=' | ':=') expression ( + ',' system_var_name=fullId ('=' | ':=') expression + )* # setNewValueInsideTrigger ; showStatement - : KW_SHOW logFormat=(KW_BINARY | KW_MASTER) KW_LOGS #showMasterLogs - | KW_SHOW logFormat=(KW_BINLOG | KW_RELAYLOG) KW_EVENTS - (KW_IN filename=STRING_LITERAL)? - (KW_FROM fromPosition=decimalLiteral)? - (KW_LIMIT (offset=decimalLiteral ',')? rowCount=decimalLiteral)? - channelOption? #showLogEvents - | KW_SHOW showCommonEntity showFilter? #showObjectFilter - | KW_SHOW KW_EXTENDED? KW_FULL? columnsFormat=(KW_COLUMNS | KW_FIELDS) - tableFormat=(KW_FROM | KW_IN) tableName - (schemaFormat=(KW_FROM | KW_IN) databaseName)? showFilter? #showColumns - | KW_SHOW KW_CREATE (KW_DATABASE | KW_SCHEMA) ifNotExists? databaseNameCreate #showCreateDb - | KW_SHOW KW_CREATE (KW_EVENT | KW_PROCEDURE | KW_TRIGGER) fullId #showCreateFullIdObject - | KW_SHOW KW_CREATE KW_FUNCTION functionNameCreate #showCreateFunction - | KW_SHOW KW_CREATE KW_VIEW viewNameCreate #showCreateView - | KW_SHOW KW_CREATE KW_TABLE tableNameCreate #showCreateTable - | KW_SHOW KW_CREATE KW_USER userName #showCreateUser - | KW_SHOW KW_ENGINE engineName engineOption=(KW_STATUS | KW_MUTEX) #showEngine - | KW_SHOW showGlobalInfoClause #showGlobalInfo - | KW_SHOW errorFormat=(KW_ERRORS | KW_WARNINGS) - (KW_LIMIT - (offset=decimalLiteral ',')? - rowCount=decimalLiteral - )? #showErrors - | KW_SHOW KW_COUNT '(' '*' ')' errorFormat=(KW_ERRORS | KW_WARNINGS) #showCountErrors - | KW_SHOW showSchemaEntity (schemaFormat=(KW_FROM | KW_IN) databaseName)? showFilter? #showSchemaFilter - | KW_SHOW KW_PROCEDURE KW_CODE proc_name=fullId #showPercedureCode - | KW_SHOW KW_FUNCTION KW_CODE functionName #showFunctionCode - | KW_SHOW KW_GRANTS (KW_FOR userOrRoleName (KW_USING userOrRoleNames)?)? #showGrants - | KW_SHOW KW_EXTENDED? indexFormat=(KW_INDEX | KW_INDEXES | KW_KEYS) - tableFormat=(KW_FROM | KW_IN) tableName - (schemaFormat=(KW_FROM | KW_IN) databaseName)? (KW_WHERE expression)? #showIndexes - | KW_SHOW KW_OPEN KW_TABLES ((KW_FROM | KW_IN) databaseName)? showFilter? #showOpenTables - | KW_SHOW KW_PROFILE (showProfileType (',' showProfileType)*)? - (KW_FOR KW_QUERY queryCount=decimalLiteral)? - (KW_LIMIT rowCount=decimalLiteral (KW_OFFSET offset=decimalLiteral)?)? #showProfile - | KW_SHOW (KW_REPLICA | KW_SLAVE) KW_STATUS channelOption? #showSlaveStatus - | KW_SHOW KW_REPLICAS #showReplicas + : KW_SHOW logFormat=(KW_BINARY | KW_MASTER) KW_LOGS # showMasterLogs + | KW_SHOW logFormat=(KW_BINLOG | KW_RELAYLOG) KW_EVENTS (KW_IN filename=STRING_LITERAL)? ( + KW_FROM fromPosition=decimalLiteral + )? (KW_LIMIT (offset=decimalLiteral ',')? rowCount=decimalLiteral)? channelOption? # showLogEvents + | KW_SHOW showCommonEntity showFilter? # showObjectFilter + | KW_SHOW KW_EXTENDED? KW_FULL? columnsFormat=(KW_COLUMNS | KW_FIELDS) tableFormat=( + KW_FROM + | KW_IN + ) tableName (schemaFormat=(KW_FROM | KW_IN) databaseName)? showFilter? # showColumns + | KW_SHOW KW_CREATE (KW_DATABASE | KW_SCHEMA) ifNotExists? databaseNameCreate # showCreateDb + | KW_SHOW KW_CREATE (KW_EVENT | KW_PROCEDURE | KW_TRIGGER) fullId # showCreateFullIdObject + | KW_SHOW KW_CREATE KW_FUNCTION functionNameCreate # showCreateFunction + | KW_SHOW KW_CREATE KW_VIEW viewNameCreate # showCreateView + | KW_SHOW KW_CREATE KW_TABLE tableNameCreate # showCreateTable + | KW_SHOW KW_CREATE KW_USER userName # showCreateUser + | KW_SHOW KW_ENGINE engineName engineOption=(KW_STATUS | KW_MUTEX) # showEngine + | KW_SHOW showGlobalInfoClause # showGlobalInfo + | KW_SHOW errorFormat=(KW_ERRORS | KW_WARNINGS) ( + KW_LIMIT (offset=decimalLiteral ',')? rowCount=decimalLiteral + )? # showErrors + | KW_SHOW KW_COUNT '(' '*' ')' errorFormat=(KW_ERRORS | KW_WARNINGS) # showCountErrors + | KW_SHOW showSchemaEntity (schemaFormat=(KW_FROM | KW_IN) databaseName)? showFilter? # showSchemaFilter + | KW_SHOW KW_PROCEDURE KW_CODE proc_name=fullId # showPercedureCode + | KW_SHOW KW_FUNCTION KW_CODE functionName # showFunctionCode + | KW_SHOW KW_GRANTS (KW_FOR userOrRoleName (KW_USING userOrRoleNames)?)? # showGrants + | KW_SHOW KW_EXTENDED? indexFormat=(KW_INDEX | KW_INDEXES | KW_KEYS) tableFormat=( + KW_FROM + | KW_IN + ) tableName (schemaFormat=(KW_FROM | KW_IN) databaseName)? (KW_WHERE expression)? # showIndexes + | KW_SHOW KW_OPEN KW_TABLES ((KW_FROM | KW_IN) databaseName)? showFilter? # showOpenTables + | KW_SHOW KW_PROFILE (showProfileType (',' showProfileType)*)? ( + KW_FOR KW_QUERY queryCount=decimalLiteral + )? (KW_LIMIT rowCount=decimalLiteral (KW_OFFSET offset=decimalLiteral)?)? # showProfile + | KW_SHOW (KW_REPLICA | KW_SLAVE) KW_STATUS channelOption? # showSlaveStatus + | KW_SHOW KW_REPLICAS # showReplicas ; // details variableClause - : LOCAL_ID | GLOBAL_ID | (('@' '@')? (KW_GLOBAL | KW_PERSIST | KW_PERSIST_ONLY | KW_SESSION | KW_LOCAL))? target=uid + : LOCAL_ID + | GLOBAL_ID + | (('@' '@')? (KW_GLOBAL | KW_PERSIST | KW_PERSIST_ONLY | KW_SESSION | KW_LOCAL))? target=uid ; showCommonEntity - : KW_CHARACTER KW_SET | KW_CHARSET | KW_COLLATION | KW_DATABASES | KW_SCHEMAS - | KW_FUNCTION KW_STATUS | KW_PROCEDURE KW_STATUS + : KW_CHARACTER KW_SET + | KW_CHARSET + | KW_COLLATION + | KW_DATABASES + | KW_SCHEMAS + | KW_FUNCTION KW_STATUS + | KW_PROCEDURE KW_STATUS | (KW_GLOBAL | KW_SESSION)? (KW_STATUS | KW_VARIABLES) ; @@ -1977,21 +2105,36 @@ showFilter ; showGlobalInfoClause - : KW_STORAGE? KW_ENGINES | KW_MASTER KW_STATUS | KW_PLUGINS - | KW_PRIVILEGES | KW_FULL? KW_PROCESSLIST | KW_PROFILES - | KW_SLAVE KW_HOSTS | KW_AUTHORS | KW_CONTRIBUTORS + : KW_STORAGE? KW_ENGINES + | KW_MASTER KW_STATUS + | KW_PLUGINS + | KW_PRIVILEGES + | KW_FULL? KW_PROCESSLIST + | KW_PROFILES + | KW_SLAVE KW_HOSTS + | KW_AUTHORS + | KW_CONTRIBUTORS ; showSchemaEntity - : KW_EVENTS | KW_TABLE KW_STATUS | KW_EXTENDED? KW_FULL? KW_TABLES | KW_TRIGGERS + : KW_EVENTS + | KW_TABLE KW_STATUS + | KW_EXTENDED? KW_FULL? KW_TABLES + | KW_TRIGGERS ; showProfileType - : KW_ALL | KW_BLOCK KW_IO | KW_CONTEXT KW_SWITCHES | KW_CPU | KW_IPC | KW_MEMORY - | KW_PAGE KW_FAULTS | KW_SOURCE | KW_SWAPS + : KW_ALL + | KW_BLOCK KW_IO + | KW_CONTEXT KW_SWITCHES + | KW_CPU + | KW_IPC + | KW_MEMORY + | KW_PAGE KW_FAULTS + | KW_SOURCE + | KW_SWAPS ; - // Other administrative statements binlogStatement @@ -1999,14 +2142,14 @@ binlogStatement ; cacheIndexStatement - : KW_CACHE KW_INDEX - (tableIndex (',' tableIndex)* | tableName KW_PARTITION '(' (partitionNames | KW_ALL) ')') - KW_IN databaseName + : KW_CACHE KW_INDEX ( + tableIndex (',' tableIndex)* + | tableName KW_PARTITION '(' (partitionNames | KW_ALL) ')' + ) KW_IN databaseName ; flushStatement - : KW_FLUSH tableActionOption? - flushOption (',' flushOption)* + : KW_FLUSH tableActionOption? flushOption (',' flushOption)* ; killStatement @@ -2014,8 +2157,7 @@ killStatement ; loadIndexIntoCache - : KW_LOAD KW_INDEX KW_INTO KW_CACHE - loadedTableIndexes (',' loadedTableIndexes)* + : KW_LOAD KW_INDEX KW_INTO KW_CACHE loadedTableIndexes (',' loadedTableIndexes)* ; resetStatement @@ -2023,7 +2165,10 @@ resetStatement ; resetOption - : KW_MASTER | KW_REPLICA | KW_QUERY KW_CACHE | KW_SLAVE + : KW_MASTER + | KW_REPLICA + | KW_QUERY KW_CACHE + | KW_SLAVE ; resetPersist @@ -2048,15 +2193,18 @@ tableIndex flushOption : ( - KW_DES_KEY_FILE | KW_HOSTS - | ( - KW_BINARY | KW_ENGINE | KW_ERROR | KW_GENERAL | KW_RELAY | KW_SLOW - )? KW_LOGS - | KW_OPTIMIZER_COSTS | KW_PRIVILEGES | KW_QUERY KW_CACHE | KW_STATUS - | KW_USER_RESOURCES | KW_TABLES (KW_WITH KW_READ KW_LOCK)? - ) #simpleFlushOption - | KW_RELAY KW_LOGS channelOption? #channelFlushOption - | (KW_TABLE | KW_TABLES) tableNames? flushTableOption? #tableFlushOption + KW_DES_KEY_FILE + | KW_HOSTS + | (KW_BINARY | KW_ENGINE | KW_ERROR | KW_GENERAL | KW_RELAY | KW_SLOW)? KW_LOGS + | KW_OPTIMIZER_COSTS + | KW_PRIVILEGES + | KW_QUERY KW_CACHE + | KW_STATUS + | KW_USER_RESOURCES + | KW_TABLES (KW_WITH KW_READ KW_LOCK)? + ) # simpleFlushOption + | KW_RELAY KW_LOGS channelOption? # channelFlushOption + | (KW_TABLE | KW_TABLES) tableNames? flushTableOption? # tableFlushOption ; flushTableOption @@ -2065,21 +2213,24 @@ flushTableOption ; loadedTableIndexes - : tableName - ( KW_PARTITION '(' (partitionNames | KW_ALL) ')' )? - ( indexFormat=(KW_INDEX | KW_KEY)? '(' indexNames ')' )? - (KW_IGNORE KW_LEAVES)? + : tableName (KW_PARTITION '(' (partitionNames | KW_ALL) ')')? ( + indexFormat=(KW_INDEX | KW_KEY)? '(' indexNames ')' + )? (KW_IGNORE KW_LEAVES)? ; simpleDescribeStatement - : command=(KW_EXPLAIN | KW_DESCRIBE | KW_DESC) tableName - (column=columnName | pattern=STRING_LITERAL)? + : command=(KW_EXPLAIN | KW_DESCRIBE | KW_DESC) tableName ( + column=columnName + | pattern=STRING_LITERAL + )? ; fullDescribeStatement - : command=(KW_EXPLAIN | KW_DESCRIBE | KW_DESC) - (KW_EXTENDED | KW_PARTITIONS | KW_FORMAT '=' (KW_TRADITIONAL | KW_JSON | KW_TREE))? - describeObjectClause + : command=(KW_EXPLAIN | KW_DESCRIBE | KW_DESC) ( + KW_EXTENDED + | KW_PARTITIONS + | KW_FORMAT '=' (KW_TRADITIONAL | KW_JSON | KW_TREE) + )? describeObjectClause ; analyzeDescribeStatement @@ -2095,44 +2246,55 @@ useStatement ; signalStatement - : KW_SIGNAL ( ( KW_SQLSTATE KW_VALUE? stringLiteral ) | ID | REVERSE_QUOTE_ID ) - ( KW_SET signalConditionInformation ( ',' signalConditionInformation)* )? + : KW_SIGNAL (( KW_SQLSTATE KW_VALUE? stringLiteral) | ID | REVERSE_QUOTE_ID) ( + KW_SET signalConditionInformation ( ',' signalConditionInformation)* + )? ; resignalStatement - : KW_RESIGNAL ( ( KW_SQLSTATE KW_VALUE? stringLiteral ) | ID | REVERSE_QUOTE_ID )? - ( KW_SET signalConditionInformation ( ',' signalConditionInformation)* )? + : KW_RESIGNAL (( KW_SQLSTATE KW_VALUE? stringLiteral) | ID | REVERSE_QUOTE_ID)? ( + KW_SET signalConditionInformation ( ',' signalConditionInformation)* + )? ; signalConditionInformation - : ( KW_CLASS_ORIGIN - | KW_SUBCLASS_ORIGIN - | KW_MESSAGE_TEXT - | KW_MYSQL_ERRNO - | KW_CONSTRAINT_CATALOG - | KW_CONSTRAINT_SCHEMA - | KW_CONSTRAINT_NAME - | KW_CATALOG_NAME - | KW_SCHEMA_NAME - | KW_TABLE_NAME - | KW_COLUMN_NAME - | KW_CURSOR_NAME - ) '=' ( stringLiteral | DECIMAL_LITERAL | mysqlVariable | simpleId ) + : ( + KW_CLASS_ORIGIN + | KW_SUBCLASS_ORIGIN + | KW_MESSAGE_TEXT + | KW_MYSQL_ERRNO + | KW_CONSTRAINT_CATALOG + | KW_CONSTRAINT_SCHEMA + | KW_CONSTRAINT_NAME + | KW_CATALOG_NAME + | KW_SCHEMA_NAME + | KW_TABLE_NAME + | KW_COLUMN_NAME + | KW_CURSOR_NAME + ) '=' (stringLiteral | DECIMAL_LITERAL | mysqlVariable | simpleId) ; withStatement - : KW_WITH KW_RECURSIVE? commonTableExpressions (',' commonTableExpressions)* - ; + : KW_WITH KW_RECURSIVE? commonTableExpressions (',' commonTableExpressions)* + ; tableStatement - : KW_TABLE tableName orderByClause? limitClause? - ; + : KW_TABLE tableName orderByClause? limitClause? + ; diagnosticsStatement - : KW_GET ( KW_CURRENT | KW_STACKED )? KW_DIAGNOSTICS ( - ( variableClause '=' ( KW_NUMBER | KW_ROW_COUNT ) ( ',' variableClause '=' ( KW_NUMBER | KW_ROW_COUNT ) )* ) - | ( KW_CONDITION ( decimalLiteral | variableClause ) variableClause '=' diagnosticsConditionInformationName ( ',' variableClause '=' diagnosticsConditionInformationName )* ) - ) + : KW_GET (KW_CURRENT | KW_STACKED)? KW_DIAGNOSTICS ( + ( + variableClause '=' (KW_NUMBER | KW_ROW_COUNT) ( + ',' variableClause '=' ( KW_NUMBER | KW_ROW_COUNT) + )* + ) + | ( + KW_CONDITION (decimalLiteral | variableClause) variableClause '=' diagnosticsConditionInformationName ( + ',' variableClause '=' diagnosticsConditionInformationName + )* + ) + ) ; diagnosticsConditionInformationName @@ -2152,14 +2314,14 @@ diagnosticsConditionInformationName ; describeObjectClause - : (selectStatement | deleteStatement | insertStatement | replaceStatement | updateStatement) #describeStatements - | KW_FOR KW_CONNECTION connection_id=uid #describeConnection + : (selectStatement | deleteStatement | insertStatement | replaceStatement | updateStatement) # describeStatements + | KW_FOR KW_CONNECTION connection_id=uid # describeConnection ; - databaseNameCreate : fullId ; + databaseName : fullId ; @@ -2167,6 +2329,7 @@ databaseName functionNameCreate : fullId ; + functionName : fullId ; @@ -2174,6 +2337,7 @@ functionName viewNameCreate : fullId ; + viewName : fullId ; @@ -2181,9 +2345,11 @@ viewName indexNameCreate : uid ; + indexNames : indexName (',' indexName)* ; + indexName : uid ; @@ -2191,6 +2357,7 @@ indexName groupNameCreate : uid ; + groupName : uid ; @@ -2198,9 +2365,11 @@ groupName tableNameCreate : fullId ; + tableNames : tableName (',' tableName)* ; + tableName : fullId ; @@ -2208,25 +2377,30 @@ tableName userOrRoleNames : userOrRoleName (',' userOrRoleName)* ; + userOrRoleName - : userName | uid + : userName + | uid ; columnNameCreate - : uid (dottedId dottedId? )? + : uid (dottedId dottedId?)? | .? dottedId dottedId? ; + columnNames : columnName (',' columnName)* ; + columnName - : uid (dottedId dottedId? )? + : uid (dottedId dottedId?)? | .? dottedId dottedId? ; tablespaceNameCreate : uid ; + tablespaceName : uid ; @@ -2234,9 +2408,11 @@ tablespaceName partitionNameCreate : uid ; + partitionNames : partitionName (',' partitionName)* ; + partitionName : uid ; @@ -2248,6 +2424,7 @@ indexColumnName userHostPort : userAtHost COLON_SYMB decimalLiteral ; + userAtHost : simpleUserName HOST_IP_ADDRESS ; @@ -2256,11 +2433,17 @@ simpleUserName : STRING_LITERAL | ID | KW_ADMIN - | keywordsCanBeId; -hostName: (LOCAL_ID | HOST_IP_ADDRESS | '@' ); + | keywordsCanBeId + ; + +hostName + : (LOCAL_ID | HOST_IP_ADDRESS | '@') + ; + userName : simpleUserName hostName? - | currentUserExpression; + | currentUserExpression + ; mysqlVariable : LOCAL_ID @@ -2275,7 +2458,8 @@ charsetName ; collationName - : uid; + : uid + ; engineName : engineNameBase @@ -2284,22 +2468,29 @@ engineName ; engineNameBase - : KW_ARCHIVE | KW_BLACKHOLE | KW_CONNECT | KW_CSV | KW_FEDERATED | KW_INNODB | KW_MEMORY - | KW_MRG_MYISAM | KW_MYISAM | KW_NDB | KW_NDBCLUSTER | KW_PERFORMANCE_SCHEMA | KW_TOKUDB + : KW_ARCHIVE + | KW_BLACKHOLE + | KW_CONNECT + | KW_CSV + | KW_FEDERATED + | KW_INNODB + | KW_MEMORY + | KW_MRG_MYISAM + | KW_MYISAM + | KW_NDB + | KW_NDBCLUSTER + | KW_PERFORMANCE_SCHEMA + | KW_TOKUDB ; uuidSet - : decimalLiteral '-' decimalLiteral '-' decimalLiteral - '-' decimalLiteral '-' decimalLiteral - (':' decimalLiteral '-' decimalLiteral)+ + : decimalLiteral '-' decimalLiteral '-' decimalLiteral '-' decimalLiteral '-' decimalLiteral ( + ':' decimalLiteral '-' decimalLiteral + )+ ; xid - : globalTableUid=xuidStringId - ( - ',' qualifier=xuidStringId - (',' idFormat=decimalLiteral)? - )? + : globalTableUid=xuidStringId (',' qualifier=xuidStringId (',' idFormat=decimalLiteral)?)? ; xuidStringId @@ -2315,6 +2506,7 @@ fullId uidList : uid (',' uid)* ; + uid : simpleId //| DOUBLE_QUOTE_ID @@ -2341,91 +2533,127 @@ dottedId ; decimalLiteral - : DECIMAL_LITERAL | ZERO_DECIMAL | ONE_DECIMAL | TWO_DECIMAL | THREE_DECIMAL | REAL_LITERAL + : DECIMAL_LITERAL + | ZERO_DECIMAL + | ONE_DECIMAL + | TWO_DECIMAL + | THREE_DECIMAL + | REAL_LITERAL ; fileSizeLiteral - : FILESIZE_LITERAL | decimalLiteral; + : FILESIZE_LITERAL + | decimalLiteral + ; stringLiteral - : ( - STRING_CHARSET_NAME? STRING_LITERAL - | START_NATIONAL_STRING_LITERAL - ) STRING_LITERAL+ - | ( - STRING_CHARSET_NAME? STRING_LITERAL - | START_NATIONAL_STRING_LITERAL - ) (KW_COLLATE collationName)? + : (STRING_CHARSET_NAME? STRING_LITERAL | START_NATIONAL_STRING_LITERAL) STRING_LITERAL+ + | (STRING_CHARSET_NAME? STRING_LITERAL | START_NATIONAL_STRING_LITERAL) ( + KW_COLLATE collationName + )? ; booleanLiteral - : KW_TRUE | KW_FALSE; + : KW_TRUE + | KW_FALSE + ; hexadecimalLiteral - : STRING_CHARSET_NAME? HEXADECIMAL_LITERAL; + : STRING_CHARSET_NAME? HEXADECIMAL_LITERAL + ; nullNotnull : KW_NOT? (KW_NULL_LITERAL | NULL_SPEC_LITERAL) ; constant - : stringLiteral | decimalLiteral + : stringLiteral + | decimalLiteral | '-' decimalLiteral - | hexadecimalLiteral | booleanLiteral - | REAL_LITERAL | BIT_STRING + | hexadecimalLiteral + | booleanLiteral + | REAL_LITERAL + | BIT_STRING | KW_NOT? nullLiteral=(KW_NULL_LITERAL | NULL_SPEC_LITERAL) ; - // Data Types dataType : typeName=( - KW_CHAR | KW_CHARACTER | KW_VARCHAR | KW_TINYTEXT | KW_TEXT | KW_MEDIUMTEXT | KW_LONGTEXT - | KW_NCHAR | KW_NVARCHAR | KW_LONG - ) - KW_VARYING? - lengthOneDimension? KW_BINARY? - (charSet charsetName)? - (KW_COLLATE collationName | KW_BINARY)? #stringDataType - | KW_NATIONAL typeName=(KW_CHAR | KW_CHARACTER) KW_VARYING - lengthOneDimension? KW_BINARY? #nationalVaryingStringDataType - | KW_NATIONAL typeName=(KW_VARCHAR | KW_CHARACTER | KW_CHAR) - lengthOneDimension? KW_BINARY? #nationalStringDataType - | KW_NCHAR typeName=KW_VARCHAR - lengthOneDimension? KW_BINARY? #nationalStringDataType + KW_CHAR + | KW_CHARACTER + | KW_VARCHAR + | KW_TINYTEXT + | KW_TEXT + | KW_MEDIUMTEXT + | KW_LONGTEXT + | KW_NCHAR + | KW_NVARCHAR + | KW_LONG + ) KW_VARYING? lengthOneDimension? KW_BINARY? (charSet charsetName)? ( + KW_COLLATE collationName + | KW_BINARY + )? # stringDataType + | KW_NATIONAL typeName=(KW_CHAR | KW_CHARACTER) KW_VARYING lengthOneDimension? KW_BINARY? # nationalVaryingStringDataType + | KW_NATIONAL typeName=(KW_VARCHAR | KW_CHARACTER | KW_CHAR) lengthOneDimension? KW_BINARY? # nationalStringDataType + | KW_NCHAR typeName=KW_VARCHAR lengthOneDimension? KW_BINARY? # nationalStringDataType | typeName=( - KW_TINYINT | KW_SMALLINT | KW_MEDIUMINT | KW_INT | KW_INTEGER | KW_BIGINT - | KW_MIDDLEINT | KW_INT1 | KW_INT2 | KW_INT3 | KW_INT4 | KW_INT8 - ) - lengthOneDimension? (KW_SIGNED | KW_UNSIGNED | KW_ZEROFILL)* #dimensionDataType - | typeName=KW_REAL - lengthTwoDimension? (KW_SIGNED | KW_UNSIGNED | KW_ZEROFILL)* #dimensionDataType - | typeName=KW_DOUBLE KW_PRECISION? - lengthTwoDimension? (KW_SIGNED | KW_UNSIGNED | KW_ZEROFILL)* #dimensionDataType - | typeName=(KW_DECIMAL | KW_DEC | KW_FIXED | KW_NUMERIC | KW_FLOAT | KW_FLOAT4 | KW_FLOAT8) - lengthTwoOptionalDimension? (KW_SIGNED | KW_UNSIGNED | KW_ZEROFILL)* #dimensionDataType + KW_TINYINT + | KW_SMALLINT + | KW_MEDIUMINT + | KW_INT + | KW_INTEGER + | KW_BIGINT + | KW_MIDDLEINT + | KW_INT1 + | KW_INT2 + | KW_INT3 + | KW_INT4 + | KW_INT8 + ) lengthOneDimension? (KW_SIGNED | KW_UNSIGNED | KW_ZEROFILL)* # dimensionDataType + | typeName=KW_REAL lengthTwoDimension? (KW_SIGNED | KW_UNSIGNED | KW_ZEROFILL)* # dimensionDataType + | typeName=KW_DOUBLE KW_PRECISION? lengthTwoDimension? (KW_SIGNED | KW_UNSIGNED | KW_ZEROFILL)* # dimensionDataType + | typeName=(KW_DECIMAL | KW_DEC | KW_FIXED | KW_NUMERIC | KW_FLOAT | KW_FLOAT4 | KW_FLOAT8) lengthTwoOptionalDimension? ( + KW_SIGNED + | KW_UNSIGNED + | KW_ZEROFILL + )* # dimensionDataType | typeName=( - KW_DATE | KW_TINYBLOB | KW_MEDIUMBLOB | KW_LONGBLOB - | KW_BOOL | KW_BOOLEAN | KW_SERIAL - ) #simpleDataType + KW_DATE + | KW_TINYBLOB + | KW_MEDIUMBLOB + | KW_LONGBLOB + | KW_BOOL + | KW_BOOLEAN + | KW_SERIAL + ) # simpleDataType | typeName=( - KW_BIT | KW_TIME | KW_TIMESTAMP | KW_DATETIME | KW_BINARY - | KW_VARBINARY | KW_BLOB | KW_YEAR - ) - lengthOneDimension? #dimensionDataType - | typeName=(KW_ENUM | KW_SET) - collectionOptions KW_BINARY? - (charSet charsetName)? #collectionDataType + KW_BIT + | KW_TIME + | KW_TIMESTAMP + | KW_DATETIME + | KW_BINARY + | KW_VARBINARY + | KW_BLOB + | KW_YEAR + ) lengthOneDimension? # dimensionDataType + | typeName=(KW_ENUM | KW_SET) collectionOptions KW_BINARY? (charSet charsetName)? # collectionDataType | typeName=( - KW_GEOMETRYCOLLECTION | KW_GEOMCOLLECTION | KW_LINESTRING | KW_MULTILINESTRING - | KW_MULTIPOINT | KW_MULTIPOLYGON | KW_POINT | KW_POLYGON | KW_JSON | KW_GEOMETRY - ) (KW_SRID decimalLiteral)? #spatialDataType - | typeName=KW_LONG KW_VARCHAR? - KW_BINARY? - (charSet charsetName)? - (KW_COLLATE collationName)? #longVarcharDataType // LONG VARCHAR is the same as LONG - | KW_LONG KW_VARBINARY #longVarbinaryDataType + KW_GEOMETRYCOLLECTION + | KW_GEOMCOLLECTION + | KW_LINESTRING + | KW_MULTILINESTRING + | KW_MULTIPOINT + | KW_MULTIPOLYGON + | KW_POINT + | KW_POLYGON + | KW_JSON + | KW_GEOMETRY + ) (KW_SRID decimalLiteral)? # spatialDataType + | typeName=KW_LONG KW_VARCHAR? KW_BINARY? (charSet charsetName)? (KW_COLLATE collationName)? # longVarcharDataType + // LONG VARCHAR is the same as LONG + | KW_LONG KW_VARBINARY # longVarbinaryDataType ; collectionOptions @@ -2433,13 +2661,12 @@ collectionOptions ; convertedDataType - : - ( - typeName=(KW_BINARY| KW_NCHAR) lengthOneDimension? - | typeName=KW_CHAR lengthOneDimension? (charSet charsetName)? - | typeName=(KW_DATE | KW_DATETIME | KW_TIME | KW_JSON | KW_INT | KW_INTEGER) - | typeName=(KW_DECIMAL | KW_DEC) lengthTwoOptionalDimension? - | (KW_SIGNED | KW_UNSIGNED) (KW_INTEGER | KW_INT)? + : ( + typeName=(KW_BINARY | KW_NCHAR) lengthOneDimension? + | typeName=KW_CHAR lengthOneDimension? (charSet charsetName)? + | typeName=(KW_DATE | KW_DATETIME | KW_TIME | KW_JSON | KW_INT | KW_INTEGER) + | typeName=(KW_DECIMAL | KW_DEC) lengthTwoOptionalDimension? + | (KW_SIGNED | KW_UNSIGNED) (KW_INTEGER | KW_INT)? ) KW_ARRAY? ; @@ -2455,8 +2682,6 @@ lengthTwoOptionalDimension : '(' decimalLiteral (',' decimalLiteral)? ')' ; - - indexColumnNames : '(' indexColumnName (',' indexColumnName)* ')' ; @@ -2476,7 +2701,8 @@ expressionsWithDefaults // value expressionOrDefault - : expression | KW_DEFAULT + : expression + | KW_DEFAULT ; constants @@ -2491,7 +2717,6 @@ userVariables : LOCAL_ID (',' LOCAL_ID)* ; - // Common Expressons defaultValue @@ -2504,11 +2729,9 @@ defaultValue ; currentTimestamp - : - ( - (KW_CURRENT_TIMESTAMP | KW_LOCALTIME | KW_LOCALTIMESTAMP) - ('(' decimalLiteral? ')')? - | KW_NOW '(' decimalLiteral? ')' + : ( + (KW_CURRENT_TIMESTAMP | KW_LOCALTIME | KW_LOCALTIMESTAMP) ('(' decimalLiteral? ')')? + | KW_NOW '(' decimalLiteral? ')' ) ; @@ -2527,44 +2750,65 @@ orReplace // Functions functionCall - : specificFunction #specificFunctionCall - | aggregateWindowedFunction #aggregateFunctionCall - | nonAggregateWindowedFunction #nonAggregateFunctionCall - | scalarFunctionName '(' functionArgs? ')' #scalarFunctionCall - | functionName '(' functionArgs? ')' #udfFunctionCall - | passwordFunctionClause #passwordFunctionCall + : specificFunction # specificFunctionCall + | aggregateWindowedFunction # aggregateFunctionCall + | nonAggregateWindowedFunction # nonAggregateFunctionCall + | scalarFunctionName '(' functionArgs? ')' # scalarFunctionCall + | functionName '(' functionArgs? ')' # udfFunctionCall + | passwordFunctionClause # passwordFunctionCall ; specificFunction - : (KW_CURRENT_DATE | KW_CURRENT_TIME | KW_CURRENT_TIMESTAMP | KW_LOCALTIME | KW_UTC_TIMESTAMP | KW_SCHEMA) ('(' ')')? #simpleFunctionCall - | currentUserExpression #currentUser - | KW_CONVERT '(' expression separator=',' convertedDataType ')' #dataTypeFunctionCall - | KW_CONVERT '(' expression KW_USING charsetName ')' #dataTypeFunctionCall - | KW_CAST '(' expression KW_AS convertedDataType ')' #dataTypeFunctionCall - | KW_VALUES '(' columnName ')' #valuesFunctionCall - | KW_CASE expression caseFuncAlternative+ (KW_ELSE elseArg=functionArg)? KW_END #caseExpressionFunctionCall - | KW_CASE caseFuncAlternative+ (KW_ELSE elseArg=functionArg)? KW_END #caseFunctionCall - | KW_CHAR '(' functionArgs (KW_USING charsetName)? ')' #charFunctionCall - | KW_POSITION '(' (positionString=stringLiteral | positionExpression=expression) KW_IN ( inString=stringLiteral | inExpression=expression)')' #positionFunctionCall - | (KW_SUBSTR | KW_SUBSTRING) '(' (sourceString=stringLiteral | sourceExpression=expression) KW_FROM - (fromDecimal=decimalLiteral | fromExpression=expression) (KW_FOR (forDecimal=decimalLiteral | forExpression=expression))? ')' #substrFunctionCall - | KW_TRIM '(' positioinForm=(KW_BOTH | KW_LEADING | KW_TRAILING) (sourceString=stringLiteral | sourceExpression=expression)? KW_FROM - (fromString=stringLiteral | fromExpression=expression) ')' #trimFunctionCall - | KW_TRIM '(' (sourceString=stringLiteral | sourceExpression=expression) KW_FROM (fromString=stringLiteral | fromExpression=expression) ')' #trimFunctionCall - | KW_WEIGHT_STRING '(' (stringLiteral | expression) (KW_AS stringFormat=(KW_CHAR | KW_BINARY) '(' decimalLiteral ')' )? levelsInWeightString? ')' #weightFunctionCall - | KW_EXTRACT '(' intervalType KW_FROM (sourceString=stringLiteral | sourceExpression=expression) ')' #extractFunctionCall - | KW_GET_FORMAT '(' datetimeFormat=(KW_DATE | KW_TIME | KW_DATETIME) ',' stringLiteral ')' #getFormatFunctionCall - | KW_JSON_VALUE '(' expression ',' expression (KW_RETURNING convertedDataType)? jsonOnEmpty? jsonOnError? ')' #jsonValueFunctionCall + : ( + KW_CURRENT_DATE + | KW_CURRENT_TIME + | KW_CURRENT_TIMESTAMP + | KW_LOCALTIME + | KW_UTC_TIMESTAMP + | KW_SCHEMA + ) ('(' ')')? # simpleFunctionCall + | currentUserExpression # currentUser + | KW_CONVERT '(' expression separator=',' convertedDataType ')' # dataTypeFunctionCall + | KW_CONVERT '(' expression KW_USING charsetName ')' # dataTypeFunctionCall + | KW_CAST '(' expression KW_AS convertedDataType ')' # dataTypeFunctionCall + | KW_VALUES '(' columnName ')' # valuesFunctionCall + | KW_CASE expression caseFuncAlternative+ (KW_ELSE elseArg=functionArg)? KW_END # caseExpressionFunctionCall + | KW_CASE caseFuncAlternative+ (KW_ELSE elseArg=functionArg)? KW_END # caseFunctionCall + | KW_CHAR '(' functionArgs (KW_USING charsetName)? ')' # charFunctionCall + | KW_POSITION '(' (positionString=stringLiteral | positionExpression=expression) KW_IN ( + inString=stringLiteral + | inExpression=expression + ) ')' # positionFunctionCall + | (KW_SUBSTR | KW_SUBSTRING) '(' (sourceString=stringLiteral | sourceExpression=expression) KW_FROM ( + fromDecimal=decimalLiteral + | fromExpression=expression + ) (KW_FOR (forDecimal=decimalLiteral | forExpression=expression))? ')' # substrFunctionCall + | KW_TRIM '(' positioinForm=(KW_BOTH | KW_LEADING | KW_TRAILING) ( + sourceString=stringLiteral + | sourceExpression=expression + )? KW_FROM (fromString=stringLiteral | fromExpression=expression) ')' # trimFunctionCall + | KW_TRIM '(' (sourceString=stringLiteral | sourceExpression=expression) KW_FROM ( + fromString=stringLiteral + | fromExpression=expression + ) ')' # trimFunctionCall + | KW_WEIGHT_STRING '(' (stringLiteral | expression) ( + KW_AS stringFormat=(KW_CHAR | KW_BINARY) '(' decimalLiteral ')' + )? levelsInWeightString? ')' # weightFunctionCall + | KW_EXTRACT '(' intervalType KW_FROM ( + sourceString=stringLiteral + | sourceExpression=expression + ) ')' # extractFunctionCall + | KW_GET_FORMAT '(' datetimeFormat=(KW_DATE | KW_TIME | KW_DATETIME) ',' stringLiteral ')' # getFormatFunctionCall + | KW_JSON_VALUE '(' expression ',' expression (KW_RETURNING convertedDataType)? jsonOnEmpty? jsonOnError? ')' # jsonValueFunctionCall ; caseFuncAlternative - : KW_WHEN condition=functionArg - KW_THEN consequent=functionArg + : KW_WHEN condition=functionArg KW_THEN consequent=functionArg ; levelsInWeightString - : KW_LEVEL levelInWeightListElement (',' levelInWeightListElement)* #levelWeightList - | KW_LEVEL firstLevel=decimalLiteral '-' lastLevel=decimalLiteral #levelWeightRange + : KW_LEVEL levelInWeightListElement (',' levelInWeightListElement)* # levelWeightList + | KW_LEVEL firstLevel=decimalLiteral '-' lastLevel=decimalLiteral # levelWeightRange ; levelInWeightListElement @@ -2572,25 +2816,33 @@ levelInWeightListElement ; aggregateWindowedFunction - : (KW_AVG | KW_MAX | KW_MIN | KW_SUM) - '(' aggregator=(KW_ALL | KW_DISTINCT)? functionArg ')' overClause? - | KW_COUNT '(' (starArg='*' | aggregator=KW_ALL? functionArg | aggregator=KW_DISTINCT functionArgs) ')' overClause? + : (KW_AVG | KW_MAX | KW_MIN | KW_SUM) '(' aggregator=(KW_ALL | KW_DISTINCT)? functionArg ')' overClause? + | KW_COUNT '(' ( + starArg='*' + | aggregator=KW_ALL? functionArg + | aggregator=KW_DISTINCT functionArgs + ) ')' overClause? | ( - KW_BIT_AND | KW_BIT_OR | KW_BIT_XOR | KW_STD | KW_STDDEV | KW_STDDEV_POP - | KW_STDDEV_SAMP | KW_VAR_POP | KW_VAR_SAMP | KW_VARIANCE - ) '(' aggregator=KW_ALL? functionArg ')' overClause? - | KW_GROUP_CONCAT '(' - aggregator=KW_DISTINCT? functionArgs - (KW_ORDER KW_BY - orderByExpression (',' orderByExpression)* - )? (KW_SEPARATOR separator=STRING_LITERAL)? - ')' + KW_BIT_AND + | KW_BIT_OR + | KW_BIT_XOR + | KW_STD + | KW_STDDEV + | KW_STDDEV_POP + | KW_STDDEV_SAMP + | KW_VAR_POP + | KW_VAR_SAMP + | KW_VARIANCE + ) '(' aggregator=KW_ALL? functionArg ')' overClause? + | KW_GROUP_CONCAT '(' aggregator=KW_DISTINCT? functionArgs ( + KW_ORDER KW_BY orderByExpression (',' orderByExpression)* + )? (KW_SEPARATOR separator=STRING_LITERAL)? ')' ; nonAggregateWindowedFunction : (KW_LAG | KW_LEAD) '(' expression (',' decimalLiteral)? (',' decimalLiteral)? ')' overClause | (KW_FIRST_VALUE | KW_LAST_VALUE) '(' expression ')' overClause - | (KW_CUME_DIST | KW_DENSE_RANK | KW_PERCENT_RANK | KW_RANK | KW_ROW_NUMBER) '('')' overClause + | (KW_CUME_DIST | KW_DENSE_RANK | KW_PERCENT_RANK | KW_RANK | KW_ROW_NUMBER) '(' ')' overClause | KW_NTH_VALUE '(' expression ',' decimalLiteral ')' overClause | KW_NTILE '(' decimalLiteral ')' overClause ; @@ -2612,11 +2864,13 @@ frameClause ; frameUnits - : KW_ROWS | KW_RANGE + : KW_ROWS + | KW_RANGE ; frameExtent - : frameRange | frameBetween + : frameRange + | frameBetween ; frameBetween @@ -2635,11 +2889,29 @@ partitionClause scalarFunctionName : functionNameBase - | KW_ASCII | KW_CURDATE | KW_CURRENT_DATE | KW_CURRENT_TIME - | KW_CURRENT_TIMESTAMP | KW_CURTIME | KW_DATE_ADD | KW_DATE_SUB - | KW_IF | KW_INSERT | KW_LOCALTIME | KW_LOCALTIMESTAMP | KW_MID | KW_NOW - | KW_REPEAT | KW_REPLACE | KW_SUBSTR | KW_SUBSTRING | KW_SYSDATE | KW_TRIM - | KW_UTC_DATE | KW_UTC_TIME | KW_UTC_TIMESTAMP + | KW_ASCII + | KW_CURDATE + | KW_CURRENT_DATE + | KW_CURRENT_TIME + | KW_CURRENT_TIMESTAMP + | KW_CURTIME + | KW_DATE_ADD + | KW_DATE_SUB + | KW_IF + | KW_INSERT + | KW_LOCALTIME + | KW_LOCALTIMESTAMP + | KW_MID + | KW_NOW + | KW_REPEAT + | KW_REPLACE + | KW_SUBSTR + | KW_SUBSTRING + | KW_SYSDATE + | KW_TRIM + | KW_UTC_DATE + | KW_UTC_TIME + | KW_UTC_TIMESTAMP ; passwordFunctionClause @@ -2651,191 +2923,656 @@ functionArgs ; functionArg - : constant | columnName | functionCall | expression + : constant + | columnName + | functionCall + | expression ; - // Expressions, predicates // Simplified approach for expression expression - : notOperator=(KW_NOT | '!') expression #notExpression - | expression logicalOperator expression #logicalExpression - | predicate KW_IS KW_NOT? testValue=(KW_TRUE | KW_FALSE | KW_UNKNOWN) #isExpression - | predicate #predicateExpression + : notOperator=(KW_NOT | '!') expression # notExpression + | expression logicalOperator expression # logicalExpression + | predicate KW_IS KW_NOT? testValue=(KW_TRUE | KW_FALSE | KW_UNKNOWN) # isExpression + | predicate # predicateExpression ; predicate - : predicate KW_NOT? KW_IN '(' (selectStatement | expressions) ')' #inPredicate - | predicate KW_IS nullNotnull #isNullPredicate - | left=predicate comparisonOperator right=predicate #binaryComparisonPredicate - | predicate comparisonOperator - quantifier=(KW_ALL | KW_ANY | KW_SOME) '(' selectStatement ')' #subqueryComparisonPredicate - | predicate KW_NOT? KW_BETWEEN predicate KW_AND predicate #betweenPredicate - | predicate KW_SOUNDS KW_LIKE predicate #soundsLikePredicate - | predicate KW_NOT? KW_LIKE predicate (KW_ESCAPE STRING_LITERAL)? #likePredicate - | predicate KW_NOT? regex=(KW_REGEXP | KW_RLIKE) predicate #regexpPredicate - | predicate KW_MEMBER KW_OF '(' predicate ')' #jsonMemberOfPredicate - | expressionAtom #expressionAtomPredicate + : predicate KW_NOT? KW_IN '(' (selectStatement | expressions) ')' # inPredicate + | predicate KW_IS nullNotnull # isNullPredicate + | left=predicate comparisonOperator right=predicate # binaryComparisonPredicate + | predicate comparisonOperator quantifier=(KW_ALL | KW_ANY | KW_SOME) '(' selectStatement ')' # subqueryComparisonPredicate + | predicate KW_NOT? KW_BETWEEN predicate KW_AND predicate # betweenPredicate + | predicate KW_SOUNDS KW_LIKE predicate # soundsLikePredicate + | predicate KW_NOT? KW_LIKE predicate (KW_ESCAPE STRING_LITERAL)? # likePredicate + | predicate KW_NOT? regex=(KW_REGEXP | KW_RLIKE) predicate # regexpPredicate + | predicate KW_MEMBER KW_OF '(' predicate ')' # jsonMemberOfPredicate + | expressionAtom # expressionAtomPredicate ; - // Add in ASTVisitor nullNotnull in constant expressionAtom - : constant #constantExpressionAtom - | columnName #columnNameExpressionAtom - | functionCall #functionCallExpressionAtom - | expressionAtom KW_COLLATE collationName #collateExpressionAtom - | mysqlVariable #mysqlVariableExpressionAtom - | unaryOperator expressionAtom #unaryExpressionAtom - | KW_BINARY expressionAtom #binaryExpressionAtom - | LOCAL_ID VAR_ASSIGN expressionAtom #variableAssignExpressionAtom - | '(' expression (',' expression)* ')' #nestedExpressionAtom - | KW_ROW '(' expression (',' expression)+ ')' #nestedRowExpressionAtom - | KW_EXISTS '(' selectStatement ')' #existsExpressionAtom - | '(' selectStatement ')' #subqueryExpressionAtom - | KW_INTERVAL expression intervalType #intervalExpressionAtom - | left=expressionAtom bitOperator right=expressionAtom #bitExpressionAtom - | left=expressionAtom mathOperator right=expressionAtom #mathExpressionAtom - | left=expressionAtom jsonOperator right=expressionAtom #jsonExpressionAtom + : constant # constantExpressionAtom + | columnName # columnNameExpressionAtom + | functionCall # functionCallExpressionAtom + | expressionAtom KW_COLLATE collationName # collateExpressionAtom + | mysqlVariable # mysqlVariableExpressionAtom + | unaryOperator expressionAtom # unaryExpressionAtom + | KW_BINARY expressionAtom # binaryExpressionAtom + | LOCAL_ID VAR_ASSIGN expressionAtom # variableAssignExpressionAtom + | '(' expression (',' expression)* ')' # nestedExpressionAtom + | KW_ROW '(' expression (',' expression)+ ')' # nestedRowExpressionAtom + | KW_EXISTS '(' selectStatement ')' # existsExpressionAtom + | '(' selectStatement ')' # subqueryExpressionAtom + | KW_INTERVAL expression intervalType # intervalExpressionAtom + | left=expressionAtom bitOperator right=expressionAtom # bitExpressionAtom + | left=expressionAtom mathOperator right=expressionAtom # mathExpressionAtom + | left=expressionAtom jsonOperator right=expressionAtom # jsonExpressionAtom ; unaryOperator - : '!' | '~' | '+' | '-' | KW_NOT + : '!' + | '~' + | '+' + | '-' + | KW_NOT ; comparisonOperator : comparisonBase - | '<' '>' | '!' '=' | '<' '=' '>' + | '<' '>' + | '!' '=' + | '<' '=' '>' ; comparisonBase - : '=' | '>' | '<' | '<' '=' | '>' '=' + : '=' + | '>' + | '<' + | '<' '=' + | '>' '=' ; logicalOperator - : KW_AND | '&' '&' | KW_XOR | KW_OR | '|' '|' + : KW_AND + | '&' '&' + | KW_XOR + | KW_OR + | '|' '|' ; bitOperator - : '<' '<' | '>' '>' | '&' | '^' | '|' + : '<' '<' + | '>' '>' + | '&' + | '^' + | '|' ; mathOperator - : '*' | '/' | '%' | DIV | MOD | '+' | '-' + : '*' + | '/' + | '%' + | DIV + | MOD + | '+' + | '-' ; jsonOperator - : '-' '>' | '-' '>' '>' + : '-' '>' + | '-' '>' '>' ; // Simple id sets // (that keyword, which can be id) charsetNameBase - : KW_ARMSCII8 | KW_ASCII | KW_BIG5 | KW_BINARY | KW_CP1250 | KW_CP1251 | KW_CP1256 | KW_CP1257 - | KW_CP850 | KW_CP852 | KW_CP866 | KW_CP932 | KW_DEC8 | KW_EUCJPMS | KW_EUCKR - | KW_GB18030 | KW_GB2312 | KW_GBK | KW_GEOSTD8 | KW_GREEK | KW_HEBREW | KW_HP8 | KW_KEYBCS2 - | KW_KOI8R | KW_KOI8U | KW_LATIN1 | KW_LATIN2 | KW_LATIN5 | KW_LATIN7 | KW_MACCE - | KW_MACROMAN | KW_SJIS | KW_SWE7 | KW_TIS620 | KW_UCS2 | KW_UJIS | KW_UTF16 - | KW_UTF16LE | KW_UTF32 | KW_UTF8 | KW_UTF8MB3 | KW_UTF8MB4 + : KW_ARMSCII8 + | KW_ASCII + | KW_BIG5 + | KW_BINARY + | KW_CP1250 + | KW_CP1251 + | KW_CP1256 + | KW_CP1257 + | KW_CP850 + | KW_CP852 + | KW_CP866 + | KW_CP932 + | KW_DEC8 + | KW_EUCJPMS + | KW_EUCKR + | KW_GB18030 + | KW_GB2312 + | KW_GBK + | KW_GEOSTD8 + | KW_GREEK + | KW_HEBREW + | KW_HP8 + | KW_KEYBCS2 + | KW_KOI8R + | KW_KOI8U + | KW_LATIN1 + | KW_LATIN2 + | KW_LATIN5 + | KW_LATIN7 + | KW_MACCE + | KW_MACROMAN + | KW_SJIS + | KW_SWE7 + | KW_TIS620 + | KW_UCS2 + | KW_UJIS + | KW_UTF16 + | KW_UTF16LE + | KW_UTF32 + | KW_UTF8 + | KW_UTF8MB3 + | KW_UTF8MB4 ; transactionLevelBase - : KW_REPEATABLE | KW_COMMITTED | KW_UNCOMMITTED | KW_SERIALIZABLE + : KW_REPEATABLE + | KW_COMMITTED + | KW_UNCOMMITTED + | KW_SERIALIZABLE ; privilegesBase - : KW_TABLES | KW_ROUTINE | KW_EXECUTE | KW_FILE | KW_PROCESS - | KW_RELOAD | KW_SHUTDOWN | KW_SUPER | KW_PRIVILEGES + : KW_TABLES + | KW_ROUTINE + | KW_EXECUTE + | KW_FILE + | KW_PROCESS + | KW_RELOAD + | KW_SHUTDOWN + | KW_SUPER + | KW_PRIVILEGES ; intervalTypeBase - : KW_QUARTER | KW_MONTH | KW_DAY | KW_HOUR - | KW_MINUTE | KW_WEEK | KW_SECOND | KW_MICROSECOND + : KW_QUARTER + | KW_MONTH + | KW_DAY + | KW_HOUR + | KW_MINUTE + | KW_WEEK + | KW_SECOND + | KW_MICROSECOND ; dataTypeBase - : KW_DATE | KW_TIME | KW_TIMESTAMP | KW_DATETIME | KW_YEAR | KW_ENUM | KW_TEXT + : KW_DATE + | KW_TIME + | KW_TIMESTAMP + | KW_DATETIME + | KW_YEAR + | KW_ENUM + | KW_TEXT ; keywordsCanBeId - : KW_ACCOUNT | KW_ACTION | KW_ADMIN | KW_AFTER | KW_AGGREGATE | KW_ALGORITHM | KW_ANY | KW_ARRAY - | KW_AT | KW_AUDIT_ADMIN | KW_AUDIT_ABORT_EXEMPT | KW_AUTHORS | KW_AUTOCOMMIT | KW_AUTOEXTEND_SIZE - | KW_AUTO_INCREMENT | KW_AUTHENTICATION_POLICY_ADMIN | KW_AVG | KW_AVG_ROW_LENGTH | KW_ATTRIBUTE - | KW_BACKUP_ADMIN | KW_BEGIN | KW_BINLOG | KW_BINLOG_ADMIN | KW_BINLOG_ENCRYPTION_ADMIN | KW_BIT | KW_BIT_AND | KW_BIT_OR | KW_BIT_XOR - | KW_BLOCK | KW_BOOL | KW_BOOLEAN | KW_BTREE | KW_BUCKETS | KW_CACHE | KW_CASCADED | KW_CHAIN | KW_CHANGED - | KW_CHANNEL | KW_CHECKSUM | KW_PAGE_CHECKSUM | KW_CATALOG_NAME | KW_CIPHER - | KW_CLASS_ORIGIN | KW_CLIENT | KW_CLONE_ADMIN | KW_CLOSE | KW_COALESCE | KW_CODE - | KW_COLUMNS | KW_COLUMN_FORMAT | KW_COLUMN_NAME | KW_COMMENT | KW_COMMIT | KW_COMPACT - | KW_COMPLETION | KW_COMPRESSED | KW_COMPRESSION | KW_CONCURRENT | KW_CONDITION | KW_CONNECT - | KW_CONNECTION | KW_CONNECTION_ADMIN | KW_CONSISTENT | KW_CONSTRAINT_CATALOG | KW_CONSTRAINT_NAME - | KW_CONSTRAINT_SCHEMA | KW_CONTAINS | KW_CONTEXT - | KW_CONTRIBUTORS | KW_COPY | KW_COUNT | KW_CPU | KW_CURRENT | KW_CURRENT_USER | KW_CURSOR_NAME - | KW_DATA | KW_DATAFILE | KW_DEALLOCATE - | KW_DEFAULT | KW_DEFAULT_AUTH | KW_DEFINER | KW_DELAY_KEY_WRITE | KW_DES_KEY_FILE | KW_DIAGNOSTICS | KW_DIRECTORY - | KW_DISABLE | KW_DISCARD | KW_DISK | KW_DO | KW_DUMPFILE | KW_DUPLICATE - | KW_DYNAMIC | KW_EMPTY | KW_ENABLE | KW_ENCRYPTION | KW_ENCRYPTION_KEY_ADMIN | KW_END | KW_ENDS | KW_ENGINE | KW_ENGINE_ATTRIBUTE | KW_ENGINES | KW_ENFORCED - | KW_ERROR | KW_ERRORS | KW_ESCAPE | KW_EVENT | KW_EVENTS | KW_EVERY | KW_EXCEPT - | KW_EXCHANGE | KW_EXCLUSIVE | KW_EXPIRE | KW_EXPORT | KW_EXTENDED | KW_EXTENT_SIZE | KW_FAILED_LOGIN_ATTEMPTS | KW_FAST | KW_FAULTS - | KW_FIELDS | KW_FILE_BLOCK_SIZE | KW_FILTER | KW_FIREWALL_ADMIN | KW_FIREWALL_EXEMPT | KW_FIREWALL_USER | KW_FIRST | KW_FIXED | KW_FLUSH - | KW_FOLLOWS | KW_FOUND | KW_FULL | KW_FUNCTION | KW_GENERAL | KW_GLOBAL | KW_GRANTS | KW_GROUP | KW_GROUP_CONCAT - | KW_GROUP_REPLICATION | KW_GROUP_REPLICATION_ADMIN | KW_HANDLER | KW_HASH | KW_HELP | KW_HISTORY | KW_HOST | KW_HOSTS | KW_IDENTIFIED - | KW_IGNORE_SERVER_IDS | KW_IMPORT | KW_INDEXES | KW_INITIAL_SIZE | KW_INNODB_REDO_LOG_ARCHIVE - | KW_INPLACE | KW_INSERT_METHOD | KW_INSTALL | KW_INSTANCE | KW_INSTANT | KW_INVOKE | KW_INVOKER | KW_IO - | KW_IO_THREAD | KW_IPC | KW_ISOLATION | KW_ISSUER | KW_JSON | KW_KEY_BLOCK_SIZE - | KW_LAMBDA | KW_LANGUAGE | KW_LAST | KW_LATERAL | KW_LEAVES | KW_LESS | KW_LEVEL | KW_LIST | KW_LOCAL - | KW_LOGFILE | KW_LOGS | KW_MASTER | KW_MASTER_AUTO_POSITION - | KW_MASTER_CONNECT_RETRY | KW_MASTER_DELAY - | KW_MASTER_HEARTBEAT_PERIOD | KW_MASTER_HOST | KW_MASTER_LOG_FILE - | KW_MASTER_LOG_POS | KW_MASTER_PASSWORD | KW_MASTER_PORT - | KW_MASTER_RETRY_COUNT | KW_MASTER_SSL | KW_MASTER_SSL_CA - | KW_MASTER_SSL_CAPATH | KW_MASTER_SSL_CERT | KW_MASTER_SSL_CIPHER - | KW_MASTER_SSL_CRL | KW_MASTER_SSL_CRLPATH | KW_MASTER_SSL_KEY - | KW_MASTER_TLS_VERSION | KW_MASTER_USER - | KW_MAX_CONNECTIONS_PER_HOUR | KW_MAX_QUERIES_PER_HOUR - | KW_MAX | KW_MAX_ROWS | KW_MAX_SIZE | KW_MAX_UPDATES_PER_HOUR - | KW_MAX_USER_CONNECTIONS | KW_MEDIUM | KW_MEMBER | KW_MEMORY | KW_MERGE | KW_MESSAGE_TEXT - | KW_MID | KW_MIGRATE - | KW_MIN | KW_MIN_ROWS | KW_MODE | KW_MODIFY | KW_MUTEX | KW_MYSQL | KW_MYSQL_ERRNO | KW_NAME | KW_NAMES - | KW_NCHAR | KW_NDB_STORED_USER | KW_NESTED | KW_NEVER | KW_NEXT | KW_NO | KW_NODEGROUP | KW_NONE | KW_NOWAIT | KW_NUMBER | KW_ODBC | KW_OFFLINE | KW_OFFSET - | KW_OF | KW_OLD_PASSWORD | KW_ONE | KW_ONLINE | KW_ONLY | KW_OPEN | KW_OPTIMIZER_COSTS - | KW_OPTIONAL | KW_OPTIONS | KW_ORDER | KW_ORDINALITY | KW_OWNER | KW_PACK_KEYS | KW_PAGE | KW_PARSER | KW_PARTIAL - | KW_PARTITIONING | KW_PARTITIONS | KW_PASSWORD | KW_PASSWORDLESS_USER_ADMIN | KW_PASSWORD_LOCK_TIME | KW_PATH | KW_PERSIST_RO_VARIABLES_ADMIN | KW_PHASE | KW_PLUGINS - | KW_PLUGIN_DIR | KW_PLUGIN | KW_PORT | KW_PRECEDES | KW_PREPARE | KW_PRESERVE | KW_PREV | KW_PRIMARY - | KW_PROCESSLIST | KW_PROFILE | KW_PROFILES | KW_PROXY | KW_QUERY | KW_QUICK - | KW_REBUILD | KW_RECOVER | KW_RECURSIVE | KW_REDO_BUFFER_SIZE | KW_REDUNDANT - | KW_RELAY | KW_RELAYLOG | KW_RELAY_LOG_FILE | KW_RELAY_LOG_POS | KW_REMOVE - | KW_REORGANIZE | KW_REPAIR | KW_REPLICATE_DO_DB | KW_REPLICATE_DO_TABLE - | KW_REPLICATE_IGNORE_DB | KW_REPLICATE_IGNORE_TABLE - | KW_REPLICATE_REWRITE_DB | KW_REPLICATE_WILD_DO_TABLE - | KW_REPLICATE_WILD_IGNORE_TABLE | KW_REPLICATION | KW_REPLICATION_APPLIER | KW_REPLICATION_SLAVE_ADMIN | KW_RESET - | KW_RESOURCE_GROUP_ADMIN | KW_RESOURCE_GROUP_USER | KW_RESUME - | KW_RETURNED_SQLSTATE | KW_RETURNS | KW_REUSE | KW_ROLE | KW_ROLE_ADMIN | KW_ROLLBACK | KW_ROLLUP | KW_ROTATE | KW_ROW | KW_ROWS - | KW_ROW_FORMAT | KW_S3 | KW_SAVEPOINT | KW_SCHEDULE | KW_SCHEMA_NAME | KW_SECURITY | KW_SECONDARY_ENGINE_ATTRIBUTE | KW_SERIAL | KW_SERVER - | KW_SESSION | KW_SESSION_VARIABLES_ADMIN | KW_SET_USER_ID | KW_SHARE | KW_SHARED | KW_SHOW_ROUTINE | KW_SIGNED | KW_SIMPLE | KW_SLAVE - | KW_SLOW | KW_SKIP_QUERY_REWRITE | KW_SNAPSHOT | KW_SOCKET | KW_SOME | KW_SONAME | KW_SOUNDS | KW_SOURCE - | KW_SQL_AFTER_GTIDS | KW_SQL_AFTER_MTS_GAPS | KW_SQL_BEFORE_GTIDS - | KW_SQL_BUFFER_RESULT | KW_SQL_CACHE | KW_SQL_NO_CACHE | KW_SQL_THREAD - | KW_STACKED | KW_START | KW_STARTS | KW_STATS_AUTO_RECALC | KW_STATS_PERSISTENT - | KW_STATS_SAMPLE_PAGES | KW_STATUS | KW_STD | KW_STDDEV | KW_STDDEV_POP | KW_STDDEV_SAMP | KW_STOP | KW_STORAGE | KW_STRING - | KW_SUBCLASS_ORIGIN | KW_SUBJECT | KW_SUBPARTITION | KW_SUBPARTITIONS | KW_SUM | KW_SUSPEND | KW_SWAPS - | KW_SWITCHES | KW_SYSTEM_VARIABLES_ADMIN | KW_TABLE_NAME | KW_TABLESPACE | KW_TABLE_ENCRYPTION_ADMIN | KW_TABLE_TYPE - | KW_TEMPORARY | KW_TEMPTABLE | KW_THAN | KW_TP_CONNECTION_ADMIN | KW_TRADITIONAL - | KW_TRANSACTION | KW_TRANSACTIONAL | KW_TRIGGERS | KW_TRUNCATE | KW_UNBOUNDED | KW_UNDEFINED | KW_UNDOFILE - | KW_UNDO_BUFFER_SIZE | KW_UNINSTALL | KW_UNKNOWN | KW_UNTIL | KW_UPGRADE | KW_USER | KW_USE_FRM | KW_USER_RESOURCES - | KW_VALIDATION | KW_VALUE | KW_VAR_POP | KW_VAR_SAMP | KW_VARIABLES | KW_VARIANCE | KW_VERSION_TOKEN_ADMIN | KW_VIEW | KW_VIRTUAL - | KW_WAIT | KW_WARNINGS | KW_WITHOUT | KW_WORK | KW_WRAPPER | KW_X509 | KW_XA | KW_XA_RECOVER_ADMIN | KW_XML + : KW_ACCOUNT + | KW_ACTION + | KW_ADMIN + | KW_AFTER + | KW_AGGREGATE + | KW_ALGORITHM + | KW_ANY + | KW_ARRAY + | KW_AT + | KW_AUDIT_ADMIN + | KW_AUDIT_ABORT_EXEMPT + | KW_AUTHORS + | KW_AUTOCOMMIT + | KW_AUTOEXTEND_SIZE + | KW_AUTO_INCREMENT + | KW_AUTHENTICATION_POLICY_ADMIN + | KW_AVG + | KW_AVG_ROW_LENGTH + | KW_ATTRIBUTE + | KW_BACKUP_ADMIN + | KW_BEGIN + | KW_BINLOG + | KW_BINLOG_ADMIN + | KW_BINLOG_ENCRYPTION_ADMIN + | KW_BIT + | KW_BIT_AND + | KW_BIT_OR + | KW_BIT_XOR + | KW_BLOCK + | KW_BOOL + | KW_BOOLEAN + | KW_BTREE + | KW_BUCKETS + | KW_CACHE + | KW_CASCADED + | KW_CHAIN + | KW_CHANGED + | KW_CHANNEL + | KW_CHECKSUM + | KW_PAGE_CHECKSUM + | KW_CATALOG_NAME + | KW_CIPHER + | KW_CLASS_ORIGIN + | KW_CLIENT + | KW_CLONE_ADMIN + | KW_CLOSE + | KW_COALESCE + | KW_CODE + | KW_COLUMNS + | KW_COLUMN_FORMAT + | KW_COLUMN_NAME + | KW_COMMENT + | KW_COMMIT + | KW_COMPACT + | KW_COMPLETION + | KW_COMPRESSED + | KW_COMPRESSION + | KW_CONCURRENT + | KW_CONDITION + | KW_CONNECT + | KW_CONNECTION + | KW_CONNECTION_ADMIN + | KW_CONSISTENT + | KW_CONSTRAINT_CATALOG + | KW_CONSTRAINT_NAME + | KW_CONSTRAINT_SCHEMA + | KW_CONTAINS + | KW_CONTEXT + | KW_CONTRIBUTORS + | KW_COPY + | KW_COUNT + | KW_CPU + | KW_CURRENT + | KW_CURRENT_USER + | KW_CURSOR_NAME + | KW_DATA + | KW_DATAFILE + | KW_DEALLOCATE + | KW_DEFAULT + | KW_DEFAULT_AUTH + | KW_DEFINER + | KW_DELAY_KEY_WRITE + | KW_DES_KEY_FILE + | KW_DIAGNOSTICS + | KW_DIRECTORY + | KW_DISABLE + | KW_DISCARD + | KW_DISK + | KW_DO + | KW_DUMPFILE + | KW_DUPLICATE + | KW_DYNAMIC + | KW_EMPTY + | KW_ENABLE + | KW_ENCRYPTION + | KW_ENCRYPTION_KEY_ADMIN + | KW_END + | KW_ENDS + | KW_ENGINE + | KW_ENGINE_ATTRIBUTE + | KW_ENGINES + | KW_ENFORCED + | KW_ERROR + | KW_ERRORS + | KW_ESCAPE + | KW_EVENT + | KW_EVENTS + | KW_EVERY + | KW_EXCEPT + | KW_EXCHANGE + | KW_EXCLUSIVE + | KW_EXPIRE + | KW_EXPORT + | KW_EXTENDED + | KW_EXTENT_SIZE + | KW_FAILED_LOGIN_ATTEMPTS + | KW_FAST + | KW_FAULTS + | KW_FIELDS + | KW_FILE_BLOCK_SIZE + | KW_FILTER + | KW_FIREWALL_ADMIN + | KW_FIREWALL_EXEMPT + | KW_FIREWALL_USER + | KW_FIRST + | KW_FIXED + | KW_FLUSH + | KW_FOLLOWS + | KW_FOUND + | KW_FULL + | KW_FUNCTION + | KW_GENERAL + | KW_GLOBAL + | KW_GRANTS + | KW_GROUP + | KW_GROUP_CONCAT + | KW_GROUP_REPLICATION + | KW_GROUP_REPLICATION_ADMIN + | KW_HANDLER + | KW_HASH + | KW_HELP + | KW_HISTORY + | KW_HOST + | KW_HOSTS + | KW_IDENTIFIED + | KW_IGNORE_SERVER_IDS + | KW_IMPORT + | KW_INDEXES + | KW_INITIAL_SIZE + | KW_INNODB_REDO_LOG_ARCHIVE + | KW_INPLACE + | KW_INSERT_METHOD + | KW_INSTALL + | KW_INSTANCE + | KW_INSTANT + | KW_INVOKE + | KW_INVOKER + | KW_IO + | KW_IO_THREAD + | KW_IPC + | KW_ISOLATION + | KW_ISSUER + | KW_JSON + | KW_KEY_BLOCK_SIZE + | KW_LAMBDA + | KW_LANGUAGE + | KW_LAST + | KW_LATERAL + | KW_LEAVES + | KW_LESS + | KW_LEVEL + | KW_LIST + | KW_LOCAL + | KW_LOGFILE + | KW_LOGS + | KW_MASTER + | KW_MASTER_AUTO_POSITION + | KW_MASTER_CONNECT_RETRY + | KW_MASTER_DELAY + | KW_MASTER_HEARTBEAT_PERIOD + | KW_MASTER_HOST + | KW_MASTER_LOG_FILE + | KW_MASTER_LOG_POS + | KW_MASTER_PASSWORD + | KW_MASTER_PORT + | KW_MASTER_RETRY_COUNT + | KW_MASTER_SSL + | KW_MASTER_SSL_CA + | KW_MASTER_SSL_CAPATH + | KW_MASTER_SSL_CERT + | KW_MASTER_SSL_CIPHER + | KW_MASTER_SSL_CRL + | KW_MASTER_SSL_CRLPATH + | KW_MASTER_SSL_KEY + | KW_MASTER_TLS_VERSION + | KW_MASTER_USER + | KW_MAX_CONNECTIONS_PER_HOUR + | KW_MAX_QUERIES_PER_HOUR + | KW_MAX + | KW_MAX_ROWS + | KW_MAX_SIZE + | KW_MAX_UPDATES_PER_HOUR + | KW_MAX_USER_CONNECTIONS + | KW_MEDIUM + | KW_MEMBER + | KW_MEMORY + | KW_MERGE + | KW_MESSAGE_TEXT + | KW_MID + | KW_MIGRATE + | KW_MIN + | KW_MIN_ROWS + | KW_MODE + | KW_MODIFY + | KW_MUTEX + | KW_MYSQL + | KW_MYSQL_ERRNO + | KW_NAME + | KW_NAMES + | KW_NCHAR + | KW_NDB_STORED_USER + | KW_NESTED + | KW_NEVER + | KW_NEXT + | KW_NO + | KW_NODEGROUP + | KW_NONE + | KW_NOWAIT + | KW_NUMBER + | KW_ODBC + | KW_OFFLINE + | KW_OFFSET + | KW_OF + | KW_OLD_PASSWORD + | KW_ONE + | KW_ONLINE + | KW_ONLY + | KW_OPEN + | KW_OPTIMIZER_COSTS + | KW_OPTIONAL + | KW_OPTIONS + | KW_ORDER + | KW_ORDINALITY + | KW_OWNER + | KW_PACK_KEYS + | KW_PAGE + | KW_PARSER + | KW_PARTIAL + | KW_PARTITIONING + | KW_PARTITIONS + | KW_PASSWORD + | KW_PASSWORDLESS_USER_ADMIN + | KW_PASSWORD_LOCK_TIME + | KW_PATH + | KW_PERSIST_RO_VARIABLES_ADMIN + | KW_PHASE + | KW_PLUGINS + | KW_PLUGIN_DIR + | KW_PLUGIN + | KW_PORT + | KW_PRECEDES + | KW_PREPARE + | KW_PRESERVE + | KW_PREV + | KW_PRIMARY + | KW_PROCESSLIST + | KW_PROFILE + | KW_PROFILES + | KW_PROXY + | KW_QUERY + | KW_QUICK + | KW_REBUILD + | KW_RECOVER + | KW_RECURSIVE + | KW_REDO_BUFFER_SIZE + | KW_REDUNDANT + | KW_RELAY + | KW_RELAYLOG + | KW_RELAY_LOG_FILE + | KW_RELAY_LOG_POS + | KW_REMOVE + | KW_REORGANIZE + | KW_REPAIR + | KW_REPLICATE_DO_DB + | KW_REPLICATE_DO_TABLE + | KW_REPLICATE_IGNORE_DB + | KW_REPLICATE_IGNORE_TABLE + | KW_REPLICATE_REWRITE_DB + | KW_REPLICATE_WILD_DO_TABLE + | KW_REPLICATE_WILD_IGNORE_TABLE + | KW_REPLICATION + | KW_REPLICATION_APPLIER + | KW_REPLICATION_SLAVE_ADMIN + | KW_RESET + | KW_RESOURCE_GROUP_ADMIN + | KW_RESOURCE_GROUP_USER + | KW_RESUME + | KW_RETURNED_SQLSTATE + | KW_RETURNS + | KW_REUSE + | KW_ROLE + | KW_ROLE_ADMIN + | KW_ROLLBACK + | KW_ROLLUP + | KW_ROTATE + | KW_ROW + | KW_ROWS + | KW_ROW_FORMAT + | KW_S3 + | KW_SAVEPOINT + | KW_SCHEDULE + | KW_SCHEMA_NAME + | KW_SECURITY + | KW_SECONDARY_ENGINE_ATTRIBUTE + | KW_SERIAL + | KW_SERVER + | KW_SESSION + | KW_SESSION_VARIABLES_ADMIN + | KW_SET_USER_ID + | KW_SHARE + | KW_SHARED + | KW_SHOW_ROUTINE + | KW_SIGNED + | KW_SIMPLE + | KW_SLAVE + | KW_SLOW + | KW_SKIP_QUERY_REWRITE + | KW_SNAPSHOT + | KW_SOCKET + | KW_SOME + | KW_SONAME + | KW_SOUNDS + | KW_SOURCE + | KW_SQL_AFTER_GTIDS + | KW_SQL_AFTER_MTS_GAPS + | KW_SQL_BEFORE_GTIDS + | KW_SQL_BUFFER_RESULT + | KW_SQL_CACHE + | KW_SQL_NO_CACHE + | KW_SQL_THREAD + | KW_STACKED + | KW_START + | KW_STARTS + | KW_STATS_AUTO_RECALC + | KW_STATS_PERSISTENT + | KW_STATS_SAMPLE_PAGES + | KW_STATUS + | KW_STD + | KW_STDDEV + | KW_STDDEV_POP + | KW_STDDEV_SAMP + | KW_STOP + | KW_STORAGE + | KW_STRING + | KW_SUBCLASS_ORIGIN + | KW_SUBJECT + | KW_SUBPARTITION + | KW_SUBPARTITIONS + | KW_SUM + | KW_SUSPEND + | KW_SWAPS + | KW_SWITCHES + | KW_SYSTEM_VARIABLES_ADMIN + | KW_TABLE_NAME + | KW_TABLESPACE + | KW_TABLE_ENCRYPTION_ADMIN + | KW_TABLE_TYPE + | KW_TEMPORARY + | KW_TEMPTABLE + | KW_THAN + | KW_TP_CONNECTION_ADMIN + | KW_TRADITIONAL + | KW_TRANSACTION + | KW_TRANSACTIONAL + | KW_TRIGGERS + | KW_TRUNCATE + | KW_UNBOUNDED + | KW_UNDEFINED + | KW_UNDOFILE + | KW_UNDO_BUFFER_SIZE + | KW_UNINSTALL + | KW_UNKNOWN + | KW_UNTIL + | KW_UPGRADE + | KW_USER + | KW_USE_FRM + | KW_USER_RESOURCES + | KW_VALIDATION + | KW_VALUE + | KW_VAR_POP + | KW_VAR_SAMP + | KW_VARIABLES + | KW_VARIANCE + | KW_VERSION_TOKEN_ADMIN + | KW_VIEW + | KW_VIRTUAL + | KW_WAIT + | KW_WARNINGS + | KW_WITHOUT + | KW_WORK + | KW_WRAPPER + | KW_X509 + | KW_XA + | KW_XA_RECOVER_ADMIN + | KW_XML ; functionNameBase - : KW_CHARSET | KW_COLLATION | KW_COUNT | KW_CUME_DIST | KW_DATABASE | KW_DATE | KW_DAY - | KW_DENSE_RANK | KW_FIRST_VALUE | KW_FORMAT - | KW_GEOMETRYCOLLECTION | KW_GET_FORMAT | KW_HOUR | KW_INVISIBLE | KW_LAG | KW_LAST_VALUE - | KW_LEAD | KW_LEFT | KW_LINESTRING | KW_MICROSECOND | KW_MINUTE | MOD | KW_MONTH - | KW_MULTILINESTRING | KW_MULTIPOINT | KW_MULTIPOLYGON | KW_NTH_VALUE | KW_NTILE - | KW_PERCENT_RANK | KW_POINT | KW_POLYGON | KW_POSITION | KW_QUARTER | KW_RANDOM | KW_RANK - | KW_REVERSE | KW_RIGHT | KW_ROW_COUNT | KW_ROW_NUMBER | KW_SCHEMA | KW_SECOND - | KW_SESSION_VARIABLES_ADMIN | KW_SRID | KW_SYSTEM_USER | KW_TIME | KW_TIMESTAMP - | KW_VISIBLE | KW_WEEK | KW_WEIGHT_STRING | KW_YEAR | KW_JSON_VALUE | KW_JSON_TABLE - ; + : KW_CHARSET + | KW_COLLATION + | KW_COUNT + | KW_CUME_DIST + | KW_DATABASE + | KW_DATE + | KW_DAY + | KW_DENSE_RANK + | KW_FIRST_VALUE + | KW_FORMAT + | KW_GEOMETRYCOLLECTION + | KW_GET_FORMAT + | KW_HOUR + | KW_INVISIBLE + | KW_LAG + | KW_LAST_VALUE + | KW_LEAD + | KW_LEFT + | KW_LINESTRING + | KW_MICROSECOND + | KW_MINUTE + | MOD + | KW_MONTH + | KW_MULTILINESTRING + | KW_MULTIPOINT + | KW_MULTIPOLYGON + | KW_NTH_VALUE + | KW_NTILE + | KW_PERCENT_RANK + | KW_POINT + | KW_POLYGON + | KW_POSITION + | KW_QUARTER + | KW_RANDOM + | KW_RANK + | KW_REVERSE + | KW_RIGHT + | KW_ROW_COUNT + | KW_ROW_NUMBER + | KW_SCHEMA + | KW_SECOND + | KW_SESSION_VARIABLES_ADMIN + | KW_SRID + | KW_SYSTEM_USER + | KW_TIME + | KW_TIMESTAMP + | KW_VISIBLE + | KW_WEEK + | KW_WEIGHT_STRING + | KW_YEAR + | KW_JSON_VALUE + | KW_JSON_TABLE + ; \ No newline at end of file diff --git a/src/grammar/pgsql/PostgreSQLLexer.g4 b/src/grammar/pgsql/PostgreSQLLexer.g4 index 6743427..87d32bb 100644 --- a/src/grammar/pgsql/PostgreSQLLexer.g4 +++ b/src/grammar/pgsql/PostgreSQLLexer.g4 @@ -24,12 +24,16 @@ * written authorization from Tunnel Vision Laboratories, LLC. */ - /** * This file is an adaptation of antlr's sql/postgresql/PostgreSQLLexer.g4 grammar. * Reference: https://github.com/antlr/grammars-v4/blob/master/sql/postgresql/PostgreSQLLexer.g4 */ +// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing +// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true +// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true + lexer grammar PostgreSQLLexer; /** @@ -43,35 +47,35 @@ lexer grammar PostgreSQLLexer; // that are not expressions. -Dollar: '$'; -OPEN_PAREN: '('; -CLOSE_PAREN: ')'; -OPEN_BRACKET: '['; -CLOSE_BRACKET: ']'; -COMMA: ','; -SEMI: ';'; -COLON: ':'; -STAR: '*'; -EQUAL: '='; -DOT: '.'; +Dollar : '$'; +OPEN_PAREN : '('; +CLOSE_PAREN : ')'; +OPEN_BRACKET : '['; +CLOSE_BRACKET : ']'; +COMMA : ','; +SEMI : ';'; +COLON : ':'; +STAR : '*'; +EQUAL : '='; +DOT : '.'; //NamedArgument : ':='; -PLUS: '+'; -MINUS: '-'; -SLASH: '/'; -CARET: '^'; -LT: '<'; -GT: '>'; -LESS_LESS: '<<'; -GREATER_GREATER: '>>'; -COLON_EQUALS: ':='; -LESS_EQUALS: '<='; -EQUALS_GREATER: '=>'; -GREATER_EQUALS: '>='; -DOT_DOT: '..'; -NOT_EQUALS: '<>'; -TYPECAST: '::'; -PERCENT: '%'; -PARAM: '$' ([0-9])+; +PLUS : '+'; +MINUS : '-'; +SLASH : '/'; +CARET : '^'; +LT : '<'; +GT : '>'; +LESS_LESS : '<<'; +GREATER_GREATER : '>>'; +COLON_EQUALS : ':='; +LESS_EQUALS : '<='; +EQUALS_GREATER : '=>'; +GREATER_EQUALS : '>='; +DOT_DOT : '..'; +NOT_EQUALS : '<>'; +TYPECAST : '::'; +PERCENT : '%'; +PARAM : '$' ([0-9])+; // // OPERATORS (4.1.3) @@ -81,28 +85,15 @@ PARAM: '$' ([0-9])+; // this rule does not allow + or - at the end of a multi-character operator Operator: ( - ( - OperatorCharacter - | ('+' | '-')+ ( - OperatorCharacter - | '/' ? - ) - | '/' - )+ - | // special handling for the single-character operators + and - - [+-] - ) - //TODO somehow rewrite this part without using Actions - ; + (OperatorCharacter | ('+' | '-')+ ( OperatorCharacter | '/'?) | '/')+ + | // special handling for the single-character operators + and - + [+-] + ); //TODO somehow rewrite this part without using Actions -OperatorEndingWithPlusMinus: ( - OperatorCharacterNotAllowPlusMinusAtEnd - | '-' - | '/' - )* OperatorCharacterAllowPlusMinusAtEnd Operator? ( - '+' - | '-' - )+ -> type (Operator); +OperatorEndingWithPlusMinus: (OperatorCharacterNotAllowPlusMinusAtEnd | '-' | '/')* OperatorCharacterAllowPlusMinusAtEnd Operator? ( + '+' + | '-' + )+ -> type (Operator); // Each of the following fragment rules omits the +, -, and / characters, which must always be handled in a special way // by the operator rules above. @@ -126,553 +117,553 @@ fragment OperatorCharacterAllowPlusMinusAtEnd: [~!@%^&|`?#]; // -KW_ALL: 'ALL'; -KW_ANALYSE: 'ANALYSE'; -KW_ANALYZE: 'ANALYZE'; -KW_AND: 'AND'; -KW_ANY: 'ANY'; -KW_ARRAY: 'ARRAY'; -KW_AS: 'AS'; -KW_ASC: 'ASC'; -KW_ASYMMETRIC: 'ASYMMETRIC'; -KW_BOTH: 'BOTH'; -KW_CASE: 'CASE'; -KW_CAST: 'CAST'; -KW_CHECK: 'CHECK'; -KW_COLLATE: 'COLLATE'; -KW_COLUMN: 'COLUMN'; -KW_CONSTRAINT: 'CONSTRAINT'; -KW_CREATE: 'CREATE'; -KW_CURRENT_CATALOG: 'CURRENT_CATALOG'; -KW_CURRENT_DATE: 'CURRENT_DATE'; -KW_CURRENT_ROLE: 'CURRENT_ROLE'; -KW_CURRENT_TIME: 'CURRENT_TIME'; -KW_CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; -KW_CURRENT_USER: 'CURRENT_USER'; -KW_DEFAULT: 'DEFAULT'; -KW_DEFERRABLE: 'DEFERRABLE'; -KW_DESC: 'DESC'; -KW_DISTINCT: 'DISTINCT'; -KW_DO: 'DO'; -KW_ELSE: 'ELSE'; -KW_EXCEPT: 'EXCEPT'; -KW_FALSE: 'FALSE'; -KW_FETCH: 'FETCH'; -KW_FOR: 'FOR'; -KW_FOREIGN: 'FOREIGN'; -KW_FROM: 'FROM'; -KW_GRANT: 'GRANT'; -KW_GROUP: 'GROUP'; -KW_HAVING: 'HAVING'; -KW_IN: 'IN'; -KW_INITIALLY: 'INITIALLY'; -KW_INTERSECT: 'INTERSECT'; -KW_INTO: 'INTO'; -KW_LATERAL: 'LATERAL'; -KW_LEADING: 'LEADING'; -KW_LIMIT: 'LIMIT'; -KW_LOCALTIME: 'LOCALTIME'; -KW_LOCALTIMESTAMP: 'LOCALTIMESTAMP'; -KW_NOT: 'NOT'; -KW_NULL: 'NULL'; -KW_OFFSET: 'OFFSET'; -KW_ON: 'ON'; -KW_ONLY: 'ONLY'; -KW_OR: 'OR'; -KW_ORDER: 'ORDER'; -KW_PLACING: 'PLACING'; -KW_PRIMARY: 'PRIMARY'; -KW_REFERENCES: 'REFERENCES'; -KW_RETURNING: 'RETURNING'; -KW_SELECT: 'SELECT'; -KW_SESSION_USER: 'SESSION_USER'; -KW_SOME: 'SOME'; -KW_SYMMETRIC: 'SYMMETRIC'; -KW_TABLE: 'TABLE'; -KW_THEN: 'THEN'; -KW_TO: 'TO'; -KW_TRAILING: 'TRAILING'; -KW_TRUE: 'TRUE'; -KW_UNION: 'UNION'; -KW_UNIQUE: 'UNIQUE'; -KW_USER: 'USER'; -KW_USING: 'USING'; -KW_VARIADIC: 'VARIADIC'; -KW_WHEN: 'WHEN'; -KW_WHERE: 'WHERE'; -KW_WINDOW: 'WINDOW'; -KW_WITH: 'WITH'; +KW_ALL : 'ALL'; +KW_ANALYSE : 'ANALYSE'; +KW_ANALYZE : 'ANALYZE'; +KW_AND : 'AND'; +KW_ANY : 'ANY'; +KW_ARRAY : 'ARRAY'; +KW_AS : 'AS'; +KW_ASC : 'ASC'; +KW_ASYMMETRIC : 'ASYMMETRIC'; +KW_BOTH : 'BOTH'; +KW_CASE : 'CASE'; +KW_CAST : 'CAST'; +KW_CHECK : 'CHECK'; +KW_COLLATE : 'COLLATE'; +KW_COLUMN : 'COLUMN'; +KW_CONSTRAINT : 'CONSTRAINT'; +KW_CREATE : 'CREATE'; +KW_CURRENT_CATALOG : 'CURRENT_CATALOG'; +KW_CURRENT_DATE : 'CURRENT_DATE'; +KW_CURRENT_ROLE : 'CURRENT_ROLE'; +KW_CURRENT_TIME : 'CURRENT_TIME'; +KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; +KW_CURRENT_USER : 'CURRENT_USER'; +KW_DEFAULT : 'DEFAULT'; +KW_DEFERRABLE : 'DEFERRABLE'; +KW_DESC : 'DESC'; +KW_DISTINCT : 'DISTINCT'; +KW_DO : 'DO'; +KW_ELSE : 'ELSE'; +KW_EXCEPT : 'EXCEPT'; +KW_FALSE : 'FALSE'; +KW_FETCH : 'FETCH'; +KW_FOR : 'FOR'; +KW_FOREIGN : 'FOREIGN'; +KW_FROM : 'FROM'; +KW_GRANT : 'GRANT'; +KW_GROUP : 'GROUP'; +KW_HAVING : 'HAVING'; +KW_IN : 'IN'; +KW_INITIALLY : 'INITIALLY'; +KW_INTERSECT : 'INTERSECT'; +KW_INTO : 'INTO'; +KW_LATERAL : 'LATERAL'; +KW_LEADING : 'LEADING'; +KW_LIMIT : 'LIMIT'; +KW_LOCALTIME : 'LOCALTIME'; +KW_LOCALTIMESTAMP : 'LOCALTIMESTAMP'; +KW_NOT : 'NOT'; +KW_NULL : 'NULL'; +KW_OFFSET : 'OFFSET'; +KW_ON : 'ON'; +KW_ONLY : 'ONLY'; +KW_OR : 'OR'; +KW_ORDER : 'ORDER'; +KW_PLACING : 'PLACING'; +KW_PRIMARY : 'PRIMARY'; +KW_REFERENCES : 'REFERENCES'; +KW_RETURNING : 'RETURNING'; +KW_SELECT : 'SELECT'; +KW_SESSION_USER : 'SESSION_USER'; +KW_SOME : 'SOME'; +KW_SYMMETRIC : 'SYMMETRIC'; +KW_TABLE : 'TABLE'; +KW_THEN : 'THEN'; +KW_TO : 'TO'; +KW_TRAILING : 'TRAILING'; +KW_TRUE : 'TRUE'; +KW_UNION : 'UNION'; +KW_UNIQUE : 'UNIQUE'; +KW_USER : 'USER'; +KW_USING : 'USING'; +KW_VARIADIC : 'VARIADIC'; +KW_WHEN : 'WHEN'; +KW_WHERE : 'WHERE'; +KW_WINDOW : 'WINDOW'; +KW_WITH : 'WITH'; // // reserved keywords (can be function or type) // -KW_AUTHORIZATION: 'AUTHORIZATION'; -KW_BINARY: 'BINARY'; -KW_COLLATION: 'COLLATION'; -KW_CONCURRENTLY: 'CONCURRENTLY'; -KW_CROSS: 'CROSS'; -KW_CURRENT_SCHEMA: 'CURRENT_SCHEMA'; -KW_FREEZE: 'FREEZE'; -KW_FULL: 'FULL'; -KW_ILIKE: 'ILIKE'; -KW_INNER: 'INNER'; -KW_IS: 'IS'; -KW_ISNULL: 'ISNULL'; -KW_JOIN: 'JOIN'; -KW_LEFT: 'LEFT'; -KW_LIKE: 'LIKE'; -KW_NATURAL: 'NATURAL'; -KW_NOTNULL: 'NOTNULL'; -KW_OUTER: 'OUTER'; -KW_OVER: 'OVER'; -KW_OVERLAPS: 'OVERLAPS'; -KW_RIGHT: 'RIGHT'; -KW_SIMILAR: 'SIMILAR'; -KW_VERBOSE: 'VERBOSE'; +KW_AUTHORIZATION : 'AUTHORIZATION'; +KW_BINARY : 'BINARY'; +KW_COLLATION : 'COLLATION'; +KW_CONCURRENTLY : 'CONCURRENTLY'; +KW_CROSS : 'CROSS'; +KW_CURRENT_SCHEMA : 'CURRENT_SCHEMA'; +KW_FREEZE : 'FREEZE'; +KW_FULL : 'FULL'; +KW_ILIKE : 'ILIKE'; +KW_INNER : 'INNER'; +KW_IS : 'IS'; +KW_ISNULL : 'ISNULL'; +KW_JOIN : 'JOIN'; +KW_LEFT : 'LEFT'; +KW_LIKE : 'LIKE'; +KW_NATURAL : 'NATURAL'; +KW_NOTNULL : 'NOTNULL'; +KW_OUTER : 'OUTER'; +KW_OVER : 'OVER'; +KW_OVERLAPS : 'OVERLAPS'; +KW_RIGHT : 'RIGHT'; +KW_SIMILAR : 'SIMILAR'; +KW_VERBOSE : 'VERBOSE'; // // non-reserved keywords // -KW_ABORT: 'ABORT'; -KW_ABSOLUTE: 'ABSOLUTE'; -KW_ACCESS: 'ACCESS'; -KW_ACTION: 'ACTION'; -KW_ADD: 'ADD'; -KW_ADMIN: 'ADMIN'; -KW_AFTER: 'AFTER'; -KW_AGGREGATE: 'AGGREGATE'; -KW_ALSO: 'ALSO'; -KW_ALTER: 'ALTER'; -KW_ALWAYS: 'ALWAYS'; -KW_ASSERTION: 'ASSERTION'; -KW_ASSIGNMENT: 'ASSIGNMENT'; -KW_AT: 'AT'; -KW_ATTRIBUTE: 'ATTRIBUTE'; -KW_BACKWARD: 'BACKWARD'; -KW_BEFORE: 'BEFORE'; -KW_BEGIN: 'BEGIN'; -KW_BY: 'BY'; -KW_CACHE: 'CACHE'; -KW_CALLED: 'CALLED'; -KW_CASCADE: 'CASCADE'; -KW_CASCADED: 'CASCADED'; -KW_CATALOG: 'CATALOG'; -KW_CHAIN: 'CHAIN'; -KW_CHARACTERISTICS: 'CHARACTERISTICS'; -KW_CHECKPOINT: 'CHECKPOINT'; -KW_CLASS: 'CLASS'; -KW_CLOSE: 'CLOSE'; -KW_CLUSTER: 'CLUSTER'; -KW_COMMENT: 'COMMENT'; -KW_COMMENTS: 'COMMENTS'; -KW_COMMIT: 'COMMIT'; -KW_COMMITTED: 'COMMITTED'; -KW_CONFIGURATION: 'CONFIGURATION'; -KW_CONNECTION: 'CONNECTION'; -KW_CONSTRAINTS: 'CONSTRAINTS'; -KW_CONTENT: 'CONTENT'; -KW_CONTINUE: 'CONTINUE'; -KW_CONVERSION: 'CONVERSION'; -KW_COPY: 'COPY'; -KW_COST: 'COST'; -KW_CSV: 'CSV'; -KW_CURSOR: 'CURSOR'; -KW_CYCLE: 'CYCLE'; -KW_DATA: 'DATA'; -KW_DATABASE: 'DATABASE'; -KW_DAY: 'DAY'; -KW_DEALLOCATE: 'DEALLOCATE'; -KW_DECLARE: 'DECLARE'; -KW_DEFAULTS: 'DEFAULTS'; -KW_DEFERRED: 'DEFERRED'; -KW_DEFINER: 'DEFINER'; -KW_DELETE: 'DELETE'; -KW_DELIMITER: 'DELIMITER'; -KW_DELIMITERS: 'DELIMITERS'; -KW_DICTIONARY: 'DICTIONARY'; -KW_DISABLE: 'DISABLE'; -KW_DISCARD: 'DISCARD'; -KW_DOCUMENT: 'DOCUMENT'; -KW_DOMAIN: 'DOMAIN'; -KW_DOUBLE: 'DOUBLE'; -KW_DROP: 'DROP'; -KW_EACH: 'EACH'; -KW_ENABLE: 'ENABLE'; -KW_ENCODING: 'ENCODING'; -KW_ENCRYPTED: 'ENCRYPTED'; -KW_ENUM: 'ENUM'; -KW_ESCAPE: 'ESCAPE'; -KW_EVENT: 'EVENT'; -KW_EXCLUDE: 'EXCLUDE'; -KW_EXCLUDING: 'EXCLUDING'; -KW_EXCLUSIVE: 'EXCLUSIVE'; -KW_EXECUTE: 'EXECUTE'; -KW_EXPLAIN: 'EXPLAIN'; -KW_EXTENSION: 'EXTENSION'; -KW_EXTERNAL: 'EXTERNAL'; -KW_FAMILY: 'FAMILY'; -KW_FIRST: 'FIRST'; -KW_FOLLOWING: 'FOLLOWING'; -KW_FORCE: 'FORCE'; -KW_FORWARD: 'FORWARD'; -KW_FUNCTION: 'FUNCTION'; -KW_FUNCTIONS: 'FUNCTIONS'; -KW_GLOBAL: 'GLOBAL'; -KW_GRANTED: 'GRANTED'; -KW_HANDLER: 'HANDLER'; -KW_HEADER: 'HEADER'; -KW_HOLD: 'HOLD'; -KW_HOUR: 'HOUR'; -KW_IDENTITY: 'IDENTITY'; -KW_IF: 'IF'; -KW_IMMEDIATE: 'IMMEDIATE'; -KW_IMMUTABLE: 'IMMUTABLE'; -KW_IMPLICIT: 'IMPLICIT'; -KW_INCLUDING: 'INCLUDING'; -KW_INCREMENT: 'INCREMENT'; -KW_INDEX: 'INDEX'; -KW_INDEXES: 'INDEXES'; -KW_INHERIT: 'INHERIT'; -KW_NOINHERIT: 'NOINHERIT'; -KW_SUPERUSER: 'SUPERUSER'; -KW_NOSUPERUSER: 'NOSUPERUSER'; -KW_CREATEDB: 'CREATEDB'; -KW_NOCREATEDB: 'NOCREATEDB'; -KW_CREATEROLE: 'CREATEROLE'; -KW_NOCREATEROLE: 'NOCREATEROLE'; -KW_CREATEUSER: 'CREATEUSER'; -KW_NOCREATEUSER: 'NOCREATEUSER'; -KW_INHERITS: 'INHERITS'; -KW_INLINE: 'INLINE'; -KW_INSENSITIVE: 'INSENSITIVE'; -KW_INSERT: 'INSERT'; -KW_INSTEAD: 'INSTEAD'; -KW_INVOKER: 'INVOKER'; -KW_ISOLATION: 'ISOLATION'; -KW_KEY: 'KEY'; -KW_LABEL: 'LABEL'; -KW_LANGUAGE: 'LANGUAGE'; -KW_LARGE: 'LARGE'; -KW_LAST: 'LAST'; +KW_ABORT : 'ABORT'; +KW_ABSOLUTE : 'ABSOLUTE'; +KW_ACCESS : 'ACCESS'; +KW_ACTION : 'ACTION'; +KW_ADD : 'ADD'; +KW_ADMIN : 'ADMIN'; +KW_AFTER : 'AFTER'; +KW_AGGREGATE : 'AGGREGATE'; +KW_ALSO : 'ALSO'; +KW_ALTER : 'ALTER'; +KW_ALWAYS : 'ALWAYS'; +KW_ASSERTION : 'ASSERTION'; +KW_ASSIGNMENT : 'ASSIGNMENT'; +KW_AT : 'AT'; +KW_ATTRIBUTE : 'ATTRIBUTE'; +KW_BACKWARD : 'BACKWARD'; +KW_BEFORE : 'BEFORE'; +KW_BEGIN : 'BEGIN'; +KW_BY : 'BY'; +KW_CACHE : 'CACHE'; +KW_CALLED : 'CALLED'; +KW_CASCADE : 'CASCADE'; +KW_CASCADED : 'CASCADED'; +KW_CATALOG : 'CATALOG'; +KW_CHAIN : 'CHAIN'; +KW_CHARACTERISTICS : 'CHARACTERISTICS'; +KW_CHECKPOINT : 'CHECKPOINT'; +KW_CLASS : 'CLASS'; +KW_CLOSE : 'CLOSE'; +KW_CLUSTER : 'CLUSTER'; +KW_COMMENT : 'COMMENT'; +KW_COMMENTS : 'COMMENTS'; +KW_COMMIT : 'COMMIT'; +KW_COMMITTED : 'COMMITTED'; +KW_CONFIGURATION : 'CONFIGURATION'; +KW_CONNECTION : 'CONNECTION'; +KW_CONSTRAINTS : 'CONSTRAINTS'; +KW_CONTENT : 'CONTENT'; +KW_CONTINUE : 'CONTINUE'; +KW_CONVERSION : 'CONVERSION'; +KW_COPY : 'COPY'; +KW_COST : 'COST'; +KW_CSV : 'CSV'; +KW_CURSOR : 'CURSOR'; +KW_CYCLE : 'CYCLE'; +KW_DATA : 'DATA'; +KW_DATABASE : 'DATABASE'; +KW_DAY : 'DAY'; +KW_DEALLOCATE : 'DEALLOCATE'; +KW_DECLARE : 'DECLARE'; +KW_DEFAULTS : 'DEFAULTS'; +KW_DEFERRED : 'DEFERRED'; +KW_DEFINER : 'DEFINER'; +KW_DELETE : 'DELETE'; +KW_DELIMITER : 'DELIMITER'; +KW_DELIMITERS : 'DELIMITERS'; +KW_DICTIONARY : 'DICTIONARY'; +KW_DISABLE : 'DISABLE'; +KW_DISCARD : 'DISCARD'; +KW_DOCUMENT : 'DOCUMENT'; +KW_DOMAIN : 'DOMAIN'; +KW_DOUBLE : 'DOUBLE'; +KW_DROP : 'DROP'; +KW_EACH : 'EACH'; +KW_ENABLE : 'ENABLE'; +KW_ENCODING : 'ENCODING'; +KW_ENCRYPTED : 'ENCRYPTED'; +KW_ENUM : 'ENUM'; +KW_ESCAPE : 'ESCAPE'; +KW_EVENT : 'EVENT'; +KW_EXCLUDE : 'EXCLUDE'; +KW_EXCLUDING : 'EXCLUDING'; +KW_EXCLUSIVE : 'EXCLUSIVE'; +KW_EXECUTE : 'EXECUTE'; +KW_EXPLAIN : 'EXPLAIN'; +KW_EXTENSION : 'EXTENSION'; +KW_EXTERNAL : 'EXTERNAL'; +KW_FAMILY : 'FAMILY'; +KW_FIRST : 'FIRST'; +KW_FOLLOWING : 'FOLLOWING'; +KW_FORCE : 'FORCE'; +KW_FORWARD : 'FORWARD'; +KW_FUNCTION : 'FUNCTION'; +KW_FUNCTIONS : 'FUNCTIONS'; +KW_GLOBAL : 'GLOBAL'; +KW_GRANTED : 'GRANTED'; +KW_HANDLER : 'HANDLER'; +KW_HEADER : 'HEADER'; +KW_HOLD : 'HOLD'; +KW_HOUR : 'HOUR'; +KW_IDENTITY : 'IDENTITY'; +KW_IF : 'IF'; +KW_IMMEDIATE : 'IMMEDIATE'; +KW_IMMUTABLE : 'IMMUTABLE'; +KW_IMPLICIT : 'IMPLICIT'; +KW_INCLUDING : 'INCLUDING'; +KW_INCREMENT : 'INCREMENT'; +KW_INDEX : 'INDEX'; +KW_INDEXES : 'INDEXES'; +KW_INHERIT : 'INHERIT'; +KW_NOINHERIT : 'NOINHERIT'; +KW_SUPERUSER : 'SUPERUSER'; +KW_NOSUPERUSER : 'NOSUPERUSER'; +KW_CREATEDB : 'CREATEDB'; +KW_NOCREATEDB : 'NOCREATEDB'; +KW_CREATEROLE : 'CREATEROLE'; +KW_NOCREATEROLE : 'NOCREATEROLE'; +KW_CREATEUSER : 'CREATEUSER'; +KW_NOCREATEUSER : 'NOCREATEUSER'; +KW_INHERITS : 'INHERITS'; +KW_INLINE : 'INLINE'; +KW_INSENSITIVE : 'INSENSITIVE'; +KW_INSERT : 'INSERT'; +KW_INSTEAD : 'INSTEAD'; +KW_INVOKER : 'INVOKER'; +KW_ISOLATION : 'ISOLATION'; +KW_KEY : 'KEY'; +KW_LABEL : 'LABEL'; +KW_LANGUAGE : 'LANGUAGE'; +KW_LARGE : 'LARGE'; +KW_LAST : 'LAST'; //LC_COLLATE : 'LC'_'COLLATE; //LC_CTYPE : 'LC'_'CTYPE; -KW_LEAKPROOF: 'LEAKPROOF'; -KW_LEVEL: 'LEVEL'; -KW_LISTEN: 'LISTEN'; -KW_LOAD: 'LOAD'; -KW_LOCAL: 'LOCAL'; -KW_LOCATION: 'LOCATION'; -KW_LOCK: 'LOCK'; -KW_MAPPING: 'MAPPING'; -KW_MATCH: 'MATCH'; -KW_MATERIALIZED: 'MATERIALIZED'; -KW_MAXVALUE: 'MAXVALUE'; -KW_MINUTE: 'MINUTE'; -KW_MINVALUE: 'MINVALUE'; -KW_MODE: 'MODE'; -KW_MONTH: 'MONTH'; -KW_MOVE: 'MOVE'; -KW_NAME: 'NAME'; -KW_NAMES: 'NAMES'; -KW_NEXT: 'NEXT'; -KW_NO: 'NO'; -KW_NOTHING: 'NOTHING'; -KW_NOTIFY: 'NOTIFY'; -KW_NOWAIT: 'NOWAIT'; -KW_NULLS: 'NULLS'; -KW_OBJECT: 'OBJECT'; -KW_OF: 'OF'; -KW_OFF: 'OFF'; -KW_OIDS: 'OIDS'; -KW_OPERATOR: 'OPERATOR'; -KW_OPTION: 'OPTION'; -KW_OPTIONS: 'OPTIONS'; -KW_OWNED: 'OWNED'; -KW_OWNER: 'OWNER'; -KW_PARSER: 'PARSER'; -KW_PARTIAL: 'PARTIAL'; -KW_PARTITION: 'PARTITION'; -KW_PASSING: 'PASSING'; -KW_PASSWORD: 'PASSWORD'; -KW_PLANS: 'PLANS'; -KW_PRECEDING: 'PRECEDING'; -KW_PREPARE: 'PREPARE'; -KW_PREPARED: 'PREPARED'; -KW_PRESERVE: 'PRESERVE'; -KW_PRIOR: 'PRIOR'; -KW_PRIVILEGES: 'PRIVILEGES'; -KW_PROCEDURAL: 'PROCEDURAL'; -KW_PROCEDURE: 'PROCEDURE'; -KW_PROGRAM: 'PROGRAM'; -KW_QUOTE: 'QUOTE'; -KW_RANGE: 'RANGE'; -KW_READ: 'READ'; -KW_REASSIGN: 'REASSIGN'; -KW_RECHECK: 'RECHECK'; -KW_RECURSIVE: 'RECURSIVE'; -KW_REF: 'REF'; -KW_REFRESH: 'REFRESH'; -KW_REINDEX: 'REINDEX'; -KW_RELATIVE: 'RELATIVE'; -KW_RELEASE: 'RELEASE'; -KW_RENAME: 'RENAME'; -KW_REPEATABLE: 'REPEATABLE'; -KW_REPLACE: 'REPLACE'; -KW_REPLICA: 'REPLICA'; -KW_RESET: 'RESET'; -KW_RESTART: 'RESTART'; -KW_RESTRICT: 'RESTRICT'; -KW_RETURNS: 'RETURNS'; -KW_REVOKE: 'REVOKE'; -KW_ROLE: 'ROLE'; -KW_ROLLBACK: 'ROLLBACK'; -KW_ROWS: 'ROWS'; -KW_RULE: 'RULE'; -KW_SAVEPOINT: 'SAVEPOINT'; -KW_SCHEMA: 'SCHEMA'; -KW_SCROLL: 'SCROLL'; -KW_SEARCH: 'SEARCH'; -KW_SECOND: 'SECOND'; -KW_SECURITY: 'SECURITY'; -KW_SEQUENCE: 'SEQUENCE'; -KW_SEQUENCES: 'SEQUENCES'; -KW_SERIALIZABLE: 'SERIALIZABLE'; -KW_SERVER: 'SERVER'; -KW_SESSION: 'SESSION'; -KW_SET: 'SET'; -KW_SHARE: 'SHARE'; -KW_SHOW: 'SHOW'; -KW_SIMPLE: 'SIMPLE'; -KW_SNAPSHOT: 'SNAPSHOT'; -KW_STABLE: 'STABLE'; -KW_STANDALONE: 'STANDALONE'; -KW_START: 'START'; -KW_STATEMENT: 'STATEMENT'; -KW_STATISTICS: 'STATISTICS'; -KW_STDIN: 'STDIN'; -KW_STDOUT: 'STDOUT'; -KW_STORAGE: 'STORAGE'; -KW_STRICT: 'STRICT'; -KW_STRIP: 'STRIP'; -KW_SYSID: 'SYSID'; -KW_SYSTEM: 'SYSTEM'; -KW_TABLES: 'TABLES'; -KW_TABLESPACE: 'TABLESPACE'; -KW_TEMP: 'TEMP'; -KW_TEMPLATE: 'TEMPLATE'; -KW_TEMPORARY: 'TEMPORARY'; -KW_TEXT: 'TEXT'; -KW_TRANSACTION: 'TRANSACTION'; -KW_TRIGGER: 'TRIGGER'; -KW_TRUNCATE: 'TRUNCATE'; -KW_TRUSTED: 'TRUSTED'; -KW_TYPE: 'TYPE'; -KW_TYPES: 'TYPES'; -KW_UNBOUNDED: 'UNBOUNDED'; -KW_UNCOMMITTED: 'UNCOMMITTED'; -KW_UNENCRYPTED: 'UNENCRYPTED'; -KW_UNKNOWN: 'UNKNOWN'; -KW_UNLISTEN: 'UNLISTEN'; -KW_UNLOGGED: 'UNLOGGED'; -KW_UNTIL: 'UNTIL'; -KW_UPDATE: 'UPDATE'; -KW_VACUUM: 'VACUUM'; -KW_VALID: 'VALID'; -KW_VALIDATE: 'VALIDATE'; -KW_VALIDATOR: 'VALIDATOR'; +KW_LEAKPROOF : 'LEAKPROOF'; +KW_LEVEL : 'LEVEL'; +KW_LISTEN : 'LISTEN'; +KW_LOAD : 'LOAD'; +KW_LOCAL : 'LOCAL'; +KW_LOCATION : 'LOCATION'; +KW_LOCK : 'LOCK'; +KW_MAPPING : 'MAPPING'; +KW_MATCH : 'MATCH'; +KW_MATERIALIZED : 'MATERIALIZED'; +KW_MAXVALUE : 'MAXVALUE'; +KW_MINUTE : 'MINUTE'; +KW_MINVALUE : 'MINVALUE'; +KW_MODE : 'MODE'; +KW_MONTH : 'MONTH'; +KW_MOVE : 'MOVE'; +KW_NAME : 'NAME'; +KW_NAMES : 'NAMES'; +KW_NEXT : 'NEXT'; +KW_NO : 'NO'; +KW_NOTHING : 'NOTHING'; +KW_NOTIFY : 'NOTIFY'; +KW_NOWAIT : 'NOWAIT'; +KW_NULLS : 'NULLS'; +KW_OBJECT : 'OBJECT'; +KW_OF : 'OF'; +KW_OFF : 'OFF'; +KW_OIDS : 'OIDS'; +KW_OPERATOR : 'OPERATOR'; +KW_OPTION : 'OPTION'; +KW_OPTIONS : 'OPTIONS'; +KW_OWNED : 'OWNED'; +KW_OWNER : 'OWNER'; +KW_PARSER : 'PARSER'; +KW_PARTIAL : 'PARTIAL'; +KW_PARTITION : 'PARTITION'; +KW_PASSING : 'PASSING'; +KW_PASSWORD : 'PASSWORD'; +KW_PLANS : 'PLANS'; +KW_PRECEDING : 'PRECEDING'; +KW_PREPARE : 'PREPARE'; +KW_PREPARED : 'PREPARED'; +KW_PRESERVE : 'PRESERVE'; +KW_PRIOR : 'PRIOR'; +KW_PRIVILEGES : 'PRIVILEGES'; +KW_PROCEDURAL : 'PROCEDURAL'; +KW_PROCEDURE : 'PROCEDURE'; +KW_PROGRAM : 'PROGRAM'; +KW_QUOTE : 'QUOTE'; +KW_RANGE : 'RANGE'; +KW_READ : 'READ'; +KW_REASSIGN : 'REASSIGN'; +KW_RECHECK : 'RECHECK'; +KW_RECURSIVE : 'RECURSIVE'; +KW_REF : 'REF'; +KW_REFRESH : 'REFRESH'; +KW_REINDEX : 'REINDEX'; +KW_RELATIVE : 'RELATIVE'; +KW_RELEASE : 'RELEASE'; +KW_RENAME : 'RENAME'; +KW_REPEATABLE : 'REPEATABLE'; +KW_REPLACE : 'REPLACE'; +KW_REPLICA : 'REPLICA'; +KW_RESET : 'RESET'; +KW_RESTART : 'RESTART'; +KW_RESTRICT : 'RESTRICT'; +KW_RETURNS : 'RETURNS'; +KW_REVOKE : 'REVOKE'; +KW_ROLE : 'ROLE'; +KW_ROLLBACK : 'ROLLBACK'; +KW_ROWS : 'ROWS'; +KW_RULE : 'RULE'; +KW_SAVEPOINT : 'SAVEPOINT'; +KW_SCHEMA : 'SCHEMA'; +KW_SCROLL : 'SCROLL'; +KW_SEARCH : 'SEARCH'; +KW_SECOND : 'SECOND'; +KW_SECURITY : 'SECURITY'; +KW_SEQUENCE : 'SEQUENCE'; +KW_SEQUENCES : 'SEQUENCES'; +KW_SERIALIZABLE : 'SERIALIZABLE'; +KW_SERVER : 'SERVER'; +KW_SESSION : 'SESSION'; +KW_SET : 'SET'; +KW_SHARE : 'SHARE'; +KW_SHOW : 'SHOW'; +KW_SIMPLE : 'SIMPLE'; +KW_SNAPSHOT : 'SNAPSHOT'; +KW_STABLE : 'STABLE'; +KW_STANDALONE : 'STANDALONE'; +KW_START : 'START'; +KW_STATEMENT : 'STATEMENT'; +KW_STATISTICS : 'STATISTICS'; +KW_STDIN : 'STDIN'; +KW_STDOUT : 'STDOUT'; +KW_STORAGE : 'STORAGE'; +KW_STRICT : 'STRICT'; +KW_STRIP : 'STRIP'; +KW_SYSID : 'SYSID'; +KW_SYSTEM : 'SYSTEM'; +KW_TABLES : 'TABLES'; +KW_TABLESPACE : 'TABLESPACE'; +KW_TEMP : 'TEMP'; +KW_TEMPLATE : 'TEMPLATE'; +KW_TEMPORARY : 'TEMPORARY'; +KW_TEXT : 'TEXT'; +KW_TRANSACTION : 'TRANSACTION'; +KW_TRIGGER : 'TRIGGER'; +KW_TRUNCATE : 'TRUNCATE'; +KW_TRUSTED : 'TRUSTED'; +KW_TYPE : 'TYPE'; +KW_TYPES : 'TYPES'; +KW_UNBOUNDED : 'UNBOUNDED'; +KW_UNCOMMITTED : 'UNCOMMITTED'; +KW_UNENCRYPTED : 'UNENCRYPTED'; +KW_UNKNOWN : 'UNKNOWN'; +KW_UNLISTEN : 'UNLISTEN'; +KW_UNLOGGED : 'UNLOGGED'; +KW_UNTIL : 'UNTIL'; +KW_UPDATE : 'UPDATE'; +KW_VACUUM : 'VACUUM'; +KW_VALID : 'VALID'; +KW_VALIDATE : 'VALIDATE'; +KW_VALIDATOR : 'VALIDATOR'; //VALUE : 'VALUE; -KW_VARYING: 'VARYING'; -KW_VERSION: 'VERSION'; -KW_VIEW: 'VIEW'; -KW_VOLATILE: 'VOLATILE'; -KW_WHITESPACE: 'WHITESPACE'; -KW_WITHOUT: 'WITHOUT'; -KW_WORK: 'WORK'; -KW_WRAPPER: 'WRAPPER'; -KW_WRITE: 'WRITE'; -KW_XML: 'XML'; -KW_YEAR: 'YEAR'; -KW_YES: 'YES'; -KW_ZONE: 'ZONE'; +KW_VARYING : 'VARYING'; +KW_VERSION : 'VERSION'; +KW_VIEW : 'VIEW'; +KW_VOLATILE : 'VOLATILE'; +KW_WHITESPACE : 'WHITESPACE'; +KW_WITHOUT : 'WITHOUT'; +KW_WORK : 'WORK'; +KW_WRAPPER : 'WRAPPER'; +KW_WRITE : 'WRITE'; +KW_XML : 'XML'; +KW_YEAR : 'YEAR'; +KW_YES : 'YES'; +KW_ZONE : 'ZONE'; // // non-reserved keywords (can not be function or type) // -KW_BETWEEN: 'BETWEEN'; -KW_BIGINT: 'BIGINT'; -KW_BIT: 'BIT'; -KW_BOOLEAN: 'BOOLEAN'; -KW_CHAR: 'CHAR'; -KW_CHARACTER: 'CHARACTER'; -KW_COALESCE: 'COALESCE'; -KW_DEC: 'DEC'; -KW_DECIMAL: 'DECIMAL'; -KW_EXISTS: 'EXISTS'; -KW_EXTRACT: 'EXTRACT'; -KW_FLOAT: 'FLOAT'; -KW_GREATEST: 'GREATEST'; -KW_INOUT: 'INOUT'; -KW_INT: 'INT'; -KW_INTEGER: 'INTEGER'; -KW_INTERVAL: 'INTERVAL'; -KW_LEAST: 'LEAST'; -KW_NATIONAL: 'NATIONAL'; -KW_NCHAR: 'NCHAR'; -KW_NONE: 'NONE'; -KW_NULLIF: 'NULLIF'; -KW_NUMERIC: 'NUMERIC'; -KW_OVERLAY: 'OVERLAY'; -KW_POSITION: 'POSITION'; -KW_PRECISION: 'PRECISION'; -KW_REAL: 'REAL'; -KW_ROW: 'ROW'; -KW_SETOF: 'SETOF'; -KW_SMALLINT: 'SMALLINT'; -KW_SUBSTRING: 'SUBSTRING'; -KW_TIME: 'TIME'; -KW_TIMESTAMP: 'TIMESTAMP'; -KW_TREAT: 'TREAT'; -KW_TRIM: 'TRIM'; -KW_VALUES: 'VALUES'; -KW_VARCHAR: 'VARCHAR'; -KW_XMLATTRIBUTES: 'XMLATTRIBUTES'; -KW_XMLCONCAT: 'XMLCONCAT'; -KW_XMLELEMENT: 'XMLELEMENT'; -KW_XMLEXISTS: 'XMLEXISTS'; -KW_XMLFOREST: 'XMLFOREST'; -KW_XMLPARSE: 'XMLPARSE'; -KW_XMLPI: 'XMLPI'; -KW_XMLROOT: 'XMLROOT'; -KW_XMLSERIALIZE: 'XMLSERIALIZE'; +KW_BETWEEN : 'BETWEEN'; +KW_BIGINT : 'BIGINT'; +KW_BIT : 'BIT'; +KW_BOOLEAN : 'BOOLEAN'; +KW_CHAR : 'CHAR'; +KW_CHARACTER : 'CHARACTER'; +KW_COALESCE : 'COALESCE'; +KW_DEC : 'DEC'; +KW_DECIMAL : 'DECIMAL'; +KW_EXISTS : 'EXISTS'; +KW_EXTRACT : 'EXTRACT'; +KW_FLOAT : 'FLOAT'; +KW_GREATEST : 'GREATEST'; +KW_INOUT : 'INOUT'; +KW_INT : 'INT'; +KW_INTEGER : 'INTEGER'; +KW_INTERVAL : 'INTERVAL'; +KW_LEAST : 'LEAST'; +KW_NATIONAL : 'NATIONAL'; +KW_NCHAR : 'NCHAR'; +KW_NONE : 'NONE'; +KW_NULLIF : 'NULLIF'; +KW_NUMERIC : 'NUMERIC'; +KW_OVERLAY : 'OVERLAY'; +KW_POSITION : 'POSITION'; +KW_PRECISION : 'PRECISION'; +KW_REAL : 'REAL'; +KW_ROW : 'ROW'; +KW_SETOF : 'SETOF'; +KW_SMALLINT : 'SMALLINT'; +KW_SUBSTRING : 'SUBSTRING'; +KW_TIME : 'TIME'; +KW_TIMESTAMP : 'TIMESTAMP'; +KW_TREAT : 'TREAT'; +KW_TRIM : 'TRIM'; +KW_VALUES : 'VALUES'; +KW_VARCHAR : 'VARCHAR'; +KW_XMLATTRIBUTES : 'XMLATTRIBUTES'; +KW_XMLCONCAT : 'XMLCONCAT'; +KW_XMLELEMENT : 'XMLELEMENT'; +KW_XMLEXISTS : 'XMLEXISTS'; +KW_XMLFOREST : 'XMLFOREST'; +KW_XMLPARSE : 'XMLPARSE'; +KW_XMLPI : 'XMLPI'; +KW_XMLROOT : 'XMLROOT'; +KW_XMLSERIALIZE : 'XMLSERIALIZE'; //MISSED -KW_CALL: 'CALL'; -KW_CURRENT: 'CURRENT'; -KW_ATTACH: 'ATTACH'; -KW_DETACH: 'DETACH'; -KW_EXPRESSION: 'EXPRESSION'; -KW_GENERATED: 'GENERATED'; -KW_LOGGED: 'LOGGED'; -KW_STORED: 'STORED'; -KW_INCLUDE: 'INCLUDE'; -KW_ROUTINE: 'ROUTINE'; -KW_TRANSFORM: 'TRANSFORM'; -KW_IMPORT: 'IMPORT'; -KW_POLICY: 'POLICY'; -KW_METHOD: 'METHOD'; -KW_REFERENCING: 'REFERENCING'; -KW_NEW: 'NEW'; -KW_OLD: 'OLD'; -KW_VALUE: 'VALUE'; -KW_SUBSCRIPTION: 'SUBSCRIPTION'; -KW_PUBLICATION: 'PUBLICATION'; -KW_OUT: 'OUT'; -KW_END: 'END'; -KW_ROUTINES: 'ROUTINES'; -KW_SCHEMAS: 'SCHEMAS'; -KW_PROCEDURES: 'PROCEDURES'; -KW_INPUT: 'INPUT'; -KW_SUPPORT: 'SUPPORT'; -KW_PARALLEL: 'PARALLEL'; -KW_SQL: 'SQL'; -KW_DEPENDS: 'DEPENDS'; -KW_OVERRIDING: 'OVERRIDING'; -KW_CONFLICT: 'CONFLICT'; -KW_SKIP: 'SKIP'; -KW_LOCKED: 'LOCKED'; -KW_TIES: 'TIES'; -KW_ROLLUP: 'ROLLUP'; -KW_CUBE: 'CUBE'; -KW_GROUPING: 'GROUPING'; -KW_SETS: 'SETS'; -KW_TABLESAMPLE: 'TABLESAMPLE'; -KW_ORDINALITY: 'ORDINALITY'; -KW_XMLTABLE: 'XMLTABLE'; -KW_COLUMNS: 'COLUMNS'; -KW_XMLNAMESPACES: 'XMLNAMESPACES'; -KW_ROWTYPE: 'ROWTYPE'; -KW_NORMALIZED: 'NORMALIZED'; -KW_WITHIN: 'WITHIN'; -KW_FILTER: 'FILTER'; -KW_GROUPS: 'GROUPS'; -KW_OTHERS: 'OTHERS'; -KW_NFC: 'NFC'; -KW_NFD: 'NFD'; -KW_NFKC: 'NFKC'; -KW_NFKD: 'NFKD'; -KW_UESCAPE: 'UESCAPE'; -KW_VIEWS: 'VIEWS'; -KW_NORMALIZE: 'NORMALIZE'; -KW_DUMP: 'DUMP'; -KW_PRINT_STRICT_PARAMS: 'PRINT_STRICT_PARAMS'; -KW_VARIABLE_CONFLICT: 'VARIABLE_CONFLICT'; -KW_ERROR: 'ERROR'; -KW_USE_VARIABLE: 'USE_VARIABLE'; -KW_USE_COLUMN: 'USE_COLUMN'; -KW_ALIAS: 'ALIAS'; -KW_CONSTANT: 'CONSTANT'; -KW_PERFORM: 'PERFORM'; -KW_GET: 'GET'; -KW_DIAGNOSTICS: 'DIAGNOSTICS'; -KW_STACKED: 'STACKED'; -KW_ELSIF: 'ELSIF'; -KW_WHILE: 'WHILE'; -KW_REVERSE: 'REVERSE'; -KW_FOREACH: 'FOREACH'; -KW_SLICE: 'SLICE'; -KW_EXIT: 'EXIT'; -KW_RETURN: 'RETURN'; -KW_QUERY: 'QUERY'; -KW_RAISE: 'RAISE'; -KW_SQLSTATE: 'SQLSTATE'; -KW_DEBUG: 'DEBUG'; -KW_LOG: 'LOG'; -KW_INFO: 'INFO'; -KW_NOTICE: 'NOTICE'; -KW_WARNING: 'WARNING'; -KW_EXCEPTION: 'EXCEPTION'; -KW_ASSERT: 'ASSERT'; -KW_LOOP: 'LOOP'; -KW_OPEN: 'OPEN'; +KW_CALL : 'CALL'; +KW_CURRENT : 'CURRENT'; +KW_ATTACH : 'ATTACH'; +KW_DETACH : 'DETACH'; +KW_EXPRESSION : 'EXPRESSION'; +KW_GENERATED : 'GENERATED'; +KW_LOGGED : 'LOGGED'; +KW_STORED : 'STORED'; +KW_INCLUDE : 'INCLUDE'; +KW_ROUTINE : 'ROUTINE'; +KW_TRANSFORM : 'TRANSFORM'; +KW_IMPORT : 'IMPORT'; +KW_POLICY : 'POLICY'; +KW_METHOD : 'METHOD'; +KW_REFERENCING : 'REFERENCING'; +KW_NEW : 'NEW'; +KW_OLD : 'OLD'; +KW_VALUE : 'VALUE'; +KW_SUBSCRIPTION : 'SUBSCRIPTION'; +KW_PUBLICATION : 'PUBLICATION'; +KW_OUT : 'OUT'; +KW_END : 'END'; +KW_ROUTINES : 'ROUTINES'; +KW_SCHEMAS : 'SCHEMAS'; +KW_PROCEDURES : 'PROCEDURES'; +KW_INPUT : 'INPUT'; +KW_SUPPORT : 'SUPPORT'; +KW_PARALLEL : 'PARALLEL'; +KW_SQL : 'SQL'; +KW_DEPENDS : 'DEPENDS'; +KW_OVERRIDING : 'OVERRIDING'; +KW_CONFLICT : 'CONFLICT'; +KW_SKIP : 'SKIP'; +KW_LOCKED : 'LOCKED'; +KW_TIES : 'TIES'; +KW_ROLLUP : 'ROLLUP'; +KW_CUBE : 'CUBE'; +KW_GROUPING : 'GROUPING'; +KW_SETS : 'SETS'; +KW_TABLESAMPLE : 'TABLESAMPLE'; +KW_ORDINALITY : 'ORDINALITY'; +KW_XMLTABLE : 'XMLTABLE'; +KW_COLUMNS : 'COLUMNS'; +KW_XMLNAMESPACES : 'XMLNAMESPACES'; +KW_ROWTYPE : 'ROWTYPE'; +KW_NORMALIZED : 'NORMALIZED'; +KW_WITHIN : 'WITHIN'; +KW_FILTER : 'FILTER'; +KW_GROUPS : 'GROUPS'; +KW_OTHERS : 'OTHERS'; +KW_NFC : 'NFC'; +KW_NFD : 'NFD'; +KW_NFKC : 'NFKC'; +KW_NFKD : 'NFKD'; +KW_UESCAPE : 'UESCAPE'; +KW_VIEWS : 'VIEWS'; +KW_NORMALIZE : 'NORMALIZE'; +KW_DUMP : 'DUMP'; +KW_PRINT_STRICT_PARAMS : 'PRINT_STRICT_PARAMS'; +KW_VARIABLE_CONFLICT : 'VARIABLE_CONFLICT'; +KW_ERROR : 'ERROR'; +KW_USE_VARIABLE : 'USE_VARIABLE'; +KW_USE_COLUMN : 'USE_COLUMN'; +KW_ALIAS : 'ALIAS'; +KW_CONSTANT : 'CONSTANT'; +KW_PERFORM : 'PERFORM'; +KW_GET : 'GET'; +KW_DIAGNOSTICS : 'DIAGNOSTICS'; +KW_STACKED : 'STACKED'; +KW_ELSIF : 'ELSIF'; +KW_WHILE : 'WHILE'; +KW_REVERSE : 'REVERSE'; +KW_FOREACH : 'FOREACH'; +KW_SLICE : 'SLICE'; +KW_EXIT : 'EXIT'; +KW_RETURN : 'RETURN'; +KW_QUERY : 'QUERY'; +KW_RAISE : 'RAISE'; +KW_SQLSTATE : 'SQLSTATE'; +KW_DEBUG : 'DEBUG'; +KW_LOG : 'LOG'; +KW_INFO : 'INFO'; +KW_NOTICE : 'NOTICE'; +KW_WARNING : 'WARNING'; +KW_EXCEPTION : 'EXCEPTION'; +KW_ASSERT : 'ASSERT'; +KW_LOOP : 'LOOP'; +KW_OPEN : 'OPEN'; //16.x new keywords -KW_PEFERENCES: 'PEFERENCES'; -KW_USAGE: 'USAGE'; -KW_CONNECT: 'CONNECT'; -KW_PUBLIC: 'PUBLIC'; -KW_MERGE: 'MERGE'; -KW_MATCHED: 'MATCHED'; -KW_BREADTH: 'BREADTH'; -KW_DEPTH: 'DEPTH'; -KW_UNSAFE: 'UNSAFE'; -KW_RESTRICTED: 'RESTRICTED'; -KW_SAFE: 'SAFE'; -KW_FINALIZE: 'FINALIZE'; -KW_MODULUS: 'MODULUS'; -KW_REMAINDER: 'REMAINDER'; -KW_LOGIN: 'LOGIN'; -KW_NOLOGIN: 'NOLOGIN'; -KW_REPLICATION: 'REPLICATION'; -KW_NOREPLICATION: 'NOREPLICATION'; -KW_BYPASSRLS: 'BYPASSRLS'; -KW_NOBYPASSRLS: 'NOBYPASSRLS'; -KW_PERMISSIVE: 'PERMISSIVE'; -KW_RESTRICTIVE: 'RESTRICTIVE'; -KW_COMPRESSION: 'COMPRESSION'; -KW_PLAIN: 'PLAIN'; -KW_EXTENDED: 'EXTENDED'; -KW_MAIN: 'MAIN'; -KW_SKIP_LOCKED: 'SKIP_LOCKED'; -KW_BUFFER_USAGE_LIMIT: 'BUFFER_USAGE_LIMIT'; +KW_PEFERENCES : 'PEFERENCES'; +KW_USAGE : 'USAGE'; +KW_CONNECT : 'CONNECT'; +KW_PUBLIC : 'PUBLIC'; +KW_MERGE : 'MERGE'; +KW_MATCHED : 'MATCHED'; +KW_BREADTH : 'BREADTH'; +KW_DEPTH : 'DEPTH'; +KW_UNSAFE : 'UNSAFE'; +KW_RESTRICTED : 'RESTRICTED'; +KW_SAFE : 'SAFE'; +KW_FINALIZE : 'FINALIZE'; +KW_MODULUS : 'MODULUS'; +KW_REMAINDER : 'REMAINDER'; +KW_LOGIN : 'LOGIN'; +KW_NOLOGIN : 'NOLOGIN'; +KW_REPLICATION : 'REPLICATION'; +KW_NOREPLICATION : 'NOREPLICATION'; +KW_BYPASSRLS : 'BYPASSRLS'; +KW_NOBYPASSRLS : 'NOBYPASSRLS'; +KW_PERMISSIVE : 'PERMISSIVE'; +KW_RESTRICTIVE : 'RESTRICTIVE'; +KW_COMPRESSION : 'COMPRESSION'; +KW_PLAIN : 'PLAIN'; +KW_EXTENDED : 'EXTENDED'; +KW_MAIN : 'MAIN'; +KW_SKIP_LOCKED : 'SKIP_LOCKED'; +KW_BUFFER_USAGE_LIMIT : 'BUFFER_USAGE_LIMIT'; // // IDENTIFIERS (4.1.1) @@ -682,13 +673,13 @@ KW_BUFFER_USAGE_LIMIT: 'BUFFER_USAGE_LIMIT'; Identifier: IdentifierStartChar IdentifierChar*; fragment IdentifierStartChar: // these are the valid identifier start characters below 0x7F - [a-zA-Z_] - | // these are the valid characters from 0x80 to 0xFF - [\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF] - | // these are the letters above 0xFF which only need a single UTF-16 code unit - [\u0100-\uD7FF\uE000-\uFFFF] - | // letters which require multiple UTF-16 code units - [\uD800-\uDBFF] [\uDC00-\uDFFF]; + [a-zA-Z_] + | // these are the valid characters from 0x80 to 0xFF + [\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF] + | // these are the letters above 0xFF which only need a single UTF-16 code unit + [\u0100-\uD7FF\uE000-\uFFFF] + | // letters which require multiple UTF-16 code units + [\uD800-\uDBFF] [\uDC00-\uDFFF]; fragment IdentifierChar: StrictIdentifierChar | '$'; @@ -706,8 +697,7 @@ QuotedIdentifier: UnterminatedQuotedIdentifier '"'; UnterminatedQuotedIdentifier: '"' ('""' | ~ [\u0000"])*; // This is a quoted identifier which is terminated but contains a \u0000 character -InvalidQuotedIdentifier: - InvalidUnterminatedQuotedIdentifier '"'; +InvalidQuotedIdentifier: InvalidUnterminatedQuotedIdentifier '"'; // This is a quoted identifier which is unterminated and contains a \u0000 character InvalidUnterminatedQuotedIdentifier: '"' ('""' | ~ '"')*; @@ -725,15 +715,13 @@ InvalidUnterminatedQuotedIdentifier: '"' ('""' | ~ '"')*; UnicodeQuotedIdentifier: 'U' '&' QuotedIdentifier; // This is a Unicode quoted identifier which only contains valid characters but is not terminated -UnterminatedUnicodeQuotedIdentifier: - 'U' '&' UnterminatedQuotedIdentifier; +UnterminatedUnicodeQuotedIdentifier: 'U' '&' UnterminatedQuotedIdentifier; // This is a Unicode quoted identifier which is terminated but contains a \u0000 character InvalidUnicodeQuotedIdentifier: 'U' '&' InvalidQuotedIdentifier; // This is a Unicode quoted identifier which is unterminated and contains a \u0000 character -InvalidUnterminatedUnicodeQuotedIdentifier: - 'U' '&' InvalidUnterminatedQuotedIdentifier; +InvalidUnterminatedUnicodeQuotedIdentifier: 'U' '&' InvalidUnterminatedQuotedIdentifier; // // CONSTANTS (4.1.2) @@ -747,8 +735,7 @@ StringConstant: UnterminatedStringConstant '\''; UnterminatedStringConstant: '\'' ('\'\'' | ~ '\'')*; // String Constants with C-style Escapes (4.1.2.2) -BeginEscapeStringConstant: - 'E' '\'' -> more, pushMode (EscapeStringConstantMode); +BeginEscapeStringConstant: 'E' '\'' -> more, pushMode (EscapeStringConstantMode); // String Constants with Unicode Escapes (4.1.2.3) // @@ -761,15 +748,12 @@ BeginEscapeStringConstant: // TODO: these rules assume '' is still a valid escape sequence within a Unicode string constant. -UnicodeEscapeStringConstant: - UnterminatedUnicodeEscapeStringConstant '\''; +UnicodeEscapeStringConstant: UnterminatedUnicodeEscapeStringConstant '\''; -UnterminatedUnicodeEscapeStringConstant: - 'U' '&' UnterminatedStringConstant; +UnterminatedUnicodeEscapeStringConstant: 'U' '&' UnterminatedStringConstant; // Dollar-quoted String Constants (4.1.2.4) -BeginDollarStringConstant: - '$' Tag? '$' -> pushMode (DollarQuotedStringMode); +BeginDollarStringConstant: '$' Tag? '$' -> pushMode (DollarQuotedStringMode); /* "The tag, if any, of a dollar-quoted string follows the same rules as an unquoted identifier, * except that it cannot contain a dollar sign." */ @@ -781,22 +765,17 @@ BinaryStringConstant: UnterminatedBinaryStringConstant '\''; UnterminatedBinaryStringConstant: 'B' '\'' [01]*; -InvalidBinaryStringConstant: - InvalidUnterminatedBinaryStringConstant '\''; +InvalidBinaryStringConstant: InvalidUnterminatedBinaryStringConstant '\''; -InvalidUnterminatedBinaryStringConstant: - 'B' UnterminatedStringConstant; +InvalidUnterminatedBinaryStringConstant: 'B' UnterminatedStringConstant; -HexadecimalStringConstant: - UnterminatedHexadecimalStringConstant '\''; +HexadecimalStringConstant: UnterminatedHexadecimalStringConstant '\''; UnterminatedHexadecimalStringConstant: 'X' '\'' [0-9a-fA-F]*; -InvalidHexadecimalStringConstant: - InvalidUnterminatedHexadecimalStringConstant '\''; +InvalidHexadecimalStringConstant: InvalidUnterminatedHexadecimalStringConstant '\''; -InvalidUnterminatedHexadecimalStringConstant: - 'X' UnterminatedStringConstant; +InvalidUnterminatedHexadecimalStringConstant: 'X' UnterminatedStringConstant; // Numeric Constants (4.1.2.6) Integral: Digits; @@ -804,12 +783,11 @@ Integral: Digits; NumericFail: Digits '..'; Numeric: - Digits '.' Digits? /*? replaced with + to solve problem with DOT_DOT .. but this surely must be rewriten */ - ( - 'E' [+-]? Digits - )? - | '.' Digits ('E' [+-]? Digits)? - | Digits 'E' [+-]? Digits; + Digits '.' Digits? /*? replaced with + to solve problem with DOT_DOT .. but this surely must be rewriten */ ( + 'E' [+-]? Digits + )? + | '.' Digits ('E' [+-]? Digits)? + | Digits 'E' [+-]? Digits; fragment Digits: [0-9]+; @@ -833,28 +811,19 @@ Newline: ('\r' '\n'? | '\n') -> channel (HIDDEN); LineComment: '--' ~ [\r\n]* -> channel (HIDDEN); -BlockComment: ( - '/*' ( - '/'* BlockComment - | ~ [/*] - | '/'+ ~ [/*] - | '*'+ ~ [/*] - )* '*'* '*/' - ) -> channel (HIDDEN); +BlockComment: ('/*' ( '/'* BlockComment | ~ [/*] | '/'+ ~ [/*] | '*'+ ~ [/*])* '*'* '*/') -> channel (HIDDEN); UnterminatedBlockComment: - '/*' ( - '/'* BlockComment - | // these characters are not part of special sequences in a block comment - ~ [/*] - | - // handle / or * characters which are not part of /* or */ and do not appear at the end of the file - ('/'+ ~ [/*] | '*'+ ~ [/*]) - )* - // Handle the case of / or * characters at the end of the file, or a nested unterminated block comment - ('/'+ | '*'+ | '/'* UnterminatedBlockComment)? - // Optional assertion to make sure this rule is working as intended - ; + '/*' ( + '/'* BlockComment + | // these characters are not part of special sequences in a block comment + ~ [/*] + | + // handle / or * characters which are not part of /* or */ and do not appear at the end of the file + ('/'+ ~ [/*] | '*'+ ~ [/*]) + )* + // Handle the case of / or * characters at the end of the file, or a nested unterminated block comment + ('/'+ | '*'+ | '/'* UnterminatedBlockComment)?; // Optional assertion to make sure this rule is working as intended // // META-COMMANDS @@ -863,8 +832,7 @@ UnterminatedBlockComment: // http://www.postgresql.org/docs/9.3/static/app-psql.html -MetaCommand: - '\\' (~ [\r\n\\"] | '"' ~ [\r\n"]* '"')* ('"' ~ [\r\n"]*)?; +MetaCommand: '\\' (~ [\r\n\\"] | '"' ~ [\r\n"]* '"')* ('"' ~ [\r\n"]*)?; EndMetaCommand: '\\\\'; // @@ -882,69 +850,64 @@ EndMetaCommand: '\\\\'; ErrorCharacter: .; mode EscapeStringConstantMode; -EscapeStringConstant: - EscapeStringText '\'' -> mode (AfterEscapeStringConstantMode); +EscapeStringConstant: EscapeStringText '\'' -> mode (AfterEscapeStringConstantMode); UnterminatedEscapeStringConstant: - EscapeStringText - // Handle a final unmatched \ character appearing at the end of the file - '\\'? EOF; + EscapeStringText + // Handle a final unmatched \ character appearing at the end of the file + '\\'? EOF; fragment EscapeStringText: ( - '\'\'' - | '\\' ( - // two-digit hex escapes are still valid when treated as single-digit escapes - 'x' [0-9a-fA-F] - | 'u' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] - | 'U' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] - [0-9a-fA-F] [0-9a-fA-F] - | - // Any character other than the Unicode escapes can follow a backslash. Some have - // special meaning, but that doesn't affect the syntax. - ~ [xuU] - ) - | ~ ['\\] - )*; + '\'\'' + | '\\' ( + // two-digit hex escapes are still valid when treated as single-digit escapes + 'x' [0-9a-fA-F] + | 'u' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] + | 'U' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] + | + // Any character other than the Unicode escapes can follow a backslash. Some have + // special meaning, but that doesn't affect the syntax. + ~ [xuU] + ) + | ~ ['\\] + )*; -InvalidEscapeStringConstant: - InvalidEscapeStringText '\'' -> mode (AfterEscapeStringConstantMode); +InvalidEscapeStringConstant: InvalidEscapeStringText '\'' -> mode (AfterEscapeStringConstantMode); InvalidUnterminatedEscapeStringConstant: - InvalidEscapeStringText - // Handle a final unmatched \ character appearing at the end of the file - '\\'? EOF; + InvalidEscapeStringText + // Handle a final unmatched \ character appearing at the end of the file + '\\'? EOF; fragment InvalidEscapeStringText: ('\'\'' | '\\' . | ~ ['\\])*; mode AfterEscapeStringConstantMode; -AfterEscapeStringConstantMode_Whitespace: - Whitespace -> type (Whitespace), channel (HIDDEN); +AfterEscapeStringConstantMode_Whitespace: Whitespace -> type (Whitespace), channel (HIDDEN); AfterEscapeStringConstantMode_Newline: - Newline -> type (Newline), channel (HIDDEN), mode (AfterEscapeStringConstantWithNewlineMode); + Newline -> type (Newline), channel (HIDDEN), mode (AfterEscapeStringConstantWithNewlineMode); // // AfterEscapeStringConstantMode_NotContinued: '\\' ~[\r\n] -> skip, popMode; mode AfterEscapeStringConstantWithNewlineMode; AfterEscapeStringConstantWithNewlineMode_Whitespace: - Whitespace -> type (Whitespace), channel (HIDDEN); + Whitespace -> type (Whitespace), channel (HIDDEN); -AfterEscapeStringConstantWithNewlineMode_Newline: - Newline -> type (Newline), channel (HIDDEN); +AfterEscapeStringConstantWithNewlineMode_Newline: Newline -> type (Newline), channel (HIDDEN); AfterEscapeStringConstantWithNewlineMode_Continued: - '\'' -> more, mode (EscapeStringConstantMode); + '\'' -> more, mode (EscapeStringConstantMode); // AfterEscapeStringConstantWithNewlineMode_NotContinued: '\\' ~[\r\n] -> skip, popMode; mode DollarQuotedStringMode; DollarText: - ~ '$'+ - //| '$'([0-9])+ - | - // this alternative improves the efficiency of handling $ characters within a dollar-quoted string which are + ~ '$'+ + //| '$'([0-9])+ + | + // this alternative improves the efficiency of handling $ characters within a dollar-quoted string which are - // not part of the ending tag. - '$' ~ '$'*; + // not part of the ending tag. + '$' ~ '$'*; -EndDollarStringConstant: ('$' Tag? '$') -> popMode; +EndDollarStringConstant: ('$' Tag? '$') -> popMode; \ No newline at end of file diff --git a/src/grammar/pgsql/PostgreSQLParser.g4 b/src/grammar/pgsql/PostgreSQLParser.g4 index fd92ebb..f225980 100644 --- a/src/grammar/pgsql/PostgreSQLParser.g4 +++ b/src/grammar/pgsql/PostgreSQLParser.g4 @@ -33,2114 +33,2965 @@ * Reference Doc: https://www.postgresql.org/docs/16.1/sql-commands.html */ +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging +// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true + parser grammar PostgreSQLParser; - options { - tokenVocab = PostgreSQLLexer; + tokenVocab= PostgreSQLLexer; } -program: singleStmt* EOF; +program + : singleStmt* EOF + ; -plsqlroot: pl_function; +plsqlroot + : pl_function + ; -singleStmt: stmt SEMI?; +singleStmt + : stmt SEMI? + ; -stmt: - altereventtrigstmt - | altercollationstmt - | alterdatabasestmt - | alterdatabasesetstmt - | alterdefaultprivilegesstmt - | alterdomainstmt - | alterenumstmt - | alterextensionstmt - | alterextensioncontentsstmt - | alterfdwstmt - | alterforeignserverstmt - | alterfunctionstmt - | altergroupstmt - | alterobjectdependsstmt - | alterobjectschemastmt - | alterownerstmt - | alteroperatorstmt - | altertypestmt - | alterpolicystmt - | alterprocedurestmt - | alterseqstmt - | altersystemstmt - | altertablestmt - | altertblspcstmt - | altercompositetypestmt - | alterpublicationstmt - | alterrolesetstmt - | alterroutinestmt - | alterrolestmt - | altersubscriptionstmt - | alterstatsstmt - | altertsconfigurationstmt - | altertsdictionarystmt - | alterusermappingstmt - | analyzestmt - | callstmt - | checkpointstmt - | closeportalstmt - | clusterstmt - | commentstmt - | constraintssetstmt - | copystmt - | createamstmt - | createasstmt - | createassertionstmt - | createcaststmt - | createconversionstmt - | createdomainstmt - | createextensionstmt - | createfdwstmt - | createforeignserverstmt - | createforeigntablestmt - | createfunctionstmt - | creategroupstmt - | creatematviewstmt - | createopclassstmt - | createopfamilystmt - | createpublicationstmt - | alteropfamilystmt - | createpolicystmt - | createplangstmt - | createschemastmt - | createseqstmt - | createstmt - | createsubscriptionstmt - | createstatsstmt - | createtablespacestmt - | createtransformstmt - | createtrigstmt - | createeventtrigstmt - | createrolestmt - | createuserstmt - | createusermappingstmt - | createdbstmt - | deallocatestmt - | declarecursorstmt - | definestmt - | deletestmt - | discardstmt - | dostmt - | dropstmt - | executestmt - | explainstmt - | fetchstmt - | grantstmt - | grantrolestmt - | mergestmt - | importforeignschemastmt - | indexstmt - | insertstmt - | listenstmt - | refreshmatviewstmt - | loadstmt - | lockstmt - | notifystmt - | preparestmt - | reassignownedstmt - | reindexstmt - | removeaggrstmt - | removefuncstmt - | removeoperstmt - | renamestmt - | revokestmt - | revokerolestmt - | rulestmt - | seclabelstmt - | selectstmt - | transactionstmt - | truncatestmt - | unlistenstmt - | updatestmt - | vacuumstmt - | variableresetstmt - | variablesetstmt - | variableshowstmt - | viewstmt - | plsqlconsolecommand; +stmt + : altereventtrigstmt + | altercollationstmt + | alterdatabasestmt + | alterdatabasesetstmt + | alterdefaultprivilegesstmt + | alterdomainstmt + | alterenumstmt + | alterextensionstmt + | alterextensioncontentsstmt + | alterfdwstmt + | alterforeignserverstmt + | alterfunctionstmt + | altergroupstmt + | alterobjectdependsstmt + | alterobjectschemastmt + | alterownerstmt + | alteroperatorstmt + | altertypestmt + | alterpolicystmt + | alterprocedurestmt + | alterseqstmt + | altersystemstmt + | altertablestmt + | altertblspcstmt + | altercompositetypestmt + | alterpublicationstmt + | alterrolesetstmt + | alterroutinestmt + | alterrolestmt + | altersubscriptionstmt + | alterstatsstmt + | altertsconfigurationstmt + | altertsdictionarystmt + | alterusermappingstmt + | analyzestmt + | callstmt + | checkpointstmt + | closeportalstmt + | clusterstmt + | commentstmt + | constraintssetstmt + | copystmt + | createamstmt + | createasstmt + | createassertionstmt + | createcaststmt + | createconversionstmt + | createdomainstmt + | createextensionstmt + | createfdwstmt + | createforeignserverstmt + | createforeigntablestmt + | createfunctionstmt + | creategroupstmt + | creatematviewstmt + | createopclassstmt + | createopfamilystmt + | createpublicationstmt + | alteropfamilystmt + | createpolicystmt + | createplangstmt + | createschemastmt + | createseqstmt + | createstmt + | createsubscriptionstmt + | createstatsstmt + | createtablespacestmt + | createtransformstmt + | createtrigstmt + | createeventtrigstmt + | createrolestmt + | createuserstmt + | createusermappingstmt + | createdbstmt + | deallocatestmt + | declarecursorstmt + | definestmt + | deletestmt + | discardstmt + | dostmt + | dropstmt + | executestmt + | explainstmt + | fetchstmt + | grantstmt + | grantrolestmt + | mergestmt + | importforeignschemastmt + | indexstmt + | insertstmt + | listenstmt + | refreshmatviewstmt + | loadstmt + | lockstmt + | notifystmt + | preparestmt + | reassignownedstmt + | reindexstmt + | removeaggrstmt + | removefuncstmt + | removeoperstmt + | renamestmt + | revokestmt + | revokerolestmt + | rulestmt + | seclabelstmt + | selectstmt + | transactionstmt + | truncatestmt + | unlistenstmt + | updatestmt + | vacuumstmt + | variableresetstmt + | variablesetstmt + | variableshowstmt + | viewstmt + | plsqlconsolecommand + ; -plsqlconsolecommand: MetaCommand EndMetaCommand?; +plsqlconsolecommand + : MetaCommand EndMetaCommand? + ; -callstmt: KW_CALL func_application; +callstmt + : KW_CALL func_application + ; -createrolestmt: KW_CREATE KW_ROLE roleid opt_with? optrolelist; +createrolestmt + : KW_CREATE KW_ROLE roleid opt_with? optrolelist + ; -opt_with: - KW_WITH - ; //| WITH_LA +opt_with + : KW_WITH + ; //| WITH_LA -optrolelist: createoptroleelem*; +optrolelist + : createoptroleelem* + ; -alteroptrolelist: alteroptroleelem*; +alteroptrolelist + : alteroptroleelem* + ; -alteroptroleelem: - KW_PASSWORD (sconst | KW_NULL) - | (KW_ENCRYPTED | KW_UNENCRYPTED) KW_PASSWORD sconst - | (KW_INHERIT | KW_NOINHERIT) - | (KW_CREATEUSER | KW_NOCREATEUSER) - | (KW_CREATEROLE | KW_NOCREATEROLE) - | (KW_CREATEDB | KW_NOCREATEDB) - | (KW_SUPERUSER | KW_NOSUPERUSER) - | (KW_LOGIN | KW_NOLOGIN) - | (KW_REPLICATION | KW_NOREPLICATION) - | (KW_BYPASSRLS | KW_NOBYPASSRLS) - | KW_CONNECTION KW_LIMIT signediconst - | KW_VALID KW_UNTIL sconst - | KW_IN KW_ROLE name_list +alteroptroleelem + : KW_PASSWORD (sconst | KW_NULL) + | (KW_ENCRYPTED | KW_UNENCRYPTED) KW_PASSWORD sconst + | (KW_INHERIT | KW_NOINHERIT) + | (KW_CREATEUSER | KW_NOCREATEUSER) + | (KW_CREATEROLE | KW_NOCREATEROLE) + | (KW_CREATEDB | KW_NOCREATEDB) + | (KW_SUPERUSER | KW_NOSUPERUSER) + | (KW_LOGIN | KW_NOLOGIN) + | (KW_REPLICATION | KW_NOREPLICATION) + | (KW_BYPASSRLS | KW_NOBYPASSRLS) + | KW_CONNECTION KW_LIMIT signediconst + | KW_VALID KW_UNTIL sconst + | KW_IN KW_ROLE name_list | KW_IN KW_GROUP name_list | KW_ROLE role_list | KW_ADMIN name_list - | KW_USER role_list - | identifier; + | KW_USER role_list + | identifier + ; -createoptroleelem: - alteroptroleelem - | KW_SYSID iconst - | KW_ADMIN role_list - | KW_ROLE role_list - | KW_IN (KW_ROLE | KW_GROUP) role_list; +createoptroleelem + : alteroptroleelem + | KW_SYSID iconst + | KW_ADMIN role_list + | KW_ROLE role_list + | KW_IN (KW_ROLE | KW_GROUP) role_list + ; -createuserstmt: KW_CREATE KW_USER roleid opt_with? optrolelist; +createuserstmt + : KW_CREATE KW_USER roleid opt_with? optrolelist + ; -alterrolestmt: - KW_ALTER (KW_ROLE | KW_USER) rolespec opt_with? alteroptrolelist; +alterrolestmt + : KW_ALTER (KW_ROLE | KW_USER) rolespec opt_with? alteroptrolelist + ; -opt_in_database: | KW_IN KW_DATABASE database_name; +opt_in_database + : + | KW_IN KW_DATABASE database_name + ; -alterrolesetstmt: - KW_ALTER (KW_ROLE | KW_USER) (KW_ALL | rolespec) opt_in_database setresetclause; +alterrolesetstmt + : KW_ALTER (KW_ROLE | KW_USER) (KW_ALL | rolespec) opt_in_database setresetclause + ; -alterroutinestmt: - KW_ALTER KW_ROUTINE routine_name func_args? alter_routine_cluase; +alterroutinestmt + : KW_ALTER KW_ROUTINE routine_name func_args? alter_routine_cluase + ; -alter_routine_cluase: - routine_action_list KW_RESTRICT? - | KW_RENAME KW_TO routine_name_create - | KW_OWNER KW_TO rolespec - | KW_SET KW_SCHEMA schema_name_create - | KW_NO? KW_DEPENDS KW_ON KW_EXTENSION name; +alter_routine_cluase + : routine_action_list KW_RESTRICT? + | KW_RENAME KW_TO routine_name_create + | KW_OWNER KW_TO rolespec + | KW_SET KW_SCHEMA schema_name_create + | KW_NO? KW_DEPENDS KW_ON KW_EXTENSION name + ; -routine_action_list: routine_action (routine_action)*; +routine_action_list + : routine_action (routine_action)* + ; -routine_action: KW_IMMUTABLE | KW_STABLE | KW_VOLATILE +routine_action + : KW_IMMUTABLE + | KW_STABLE + | KW_VOLATILE | KW_NOT? KW_LEAKPROOF | (KW_EXTERNAL? KW_SECURITY KW_INVOKER | KW_EXTERNAL? KW_SECURITY KW_DEFINER) - | KW_PARALLEL (KW_UNSAFE | KW_RESTRICTED | KW_SAFE ) + | KW_PARALLEL (KW_UNSAFE | KW_RESTRICTED | KW_SAFE) | KW_COST attr_name | KW_ROWS name | KW_SET name (KW_TO | EQUAL) (name | KW_DEFAULT) | KW_SET name KW_FROM KW_CURRENT | KW_RESET name - | KW_RESET KW_ALL; - -creategroupstmt: KW_CREATE KW_GROUP groupname opt_with? optrolelist; - -altergroupstmt: KW_ALTER KW_GROUP rolespec add_drop KW_USER role_list; - -add_drop: KW_ADD | KW_DROP; - -createschemastmt: - KW_CREATE KW_SCHEMA opt_if_not_exists? ( - schema_name_create? KW_AUTHORIZATION rolespec - | schema_name_create - ) optschemaeltlist; - -schema_name_create: colid attrs?; - -optschemaeltlist: schema_stmt*; - -schema_stmt: - createstmt - | indexstmt - | createseqstmt - | createtrigstmt - | grantstmt - | viewstmt; - -variablesetstmt: KW_SET (KW_LOCAL | KW_SESSION)? set_rest; - -set_rest: - KW_TRANSACTION transaction_mode_list - | KW_SESSION KW_CHARACTERISTICS KW_AS KW_TRANSACTION transaction_mode_list - | set_rest_more; - -generic_set: (var_name | KW_ALL) (KW_TO | EQUAL)? (var_list | KW_DEFAULT)?; - -set_rest_more: - generic_set - | var_name KW_FROM KW_CURRENT - | KW_TIME KW_ZONE zone_value - | KW_CATALOG sconst - | KW_SCHEMA schema_name - | KW_NAMES opt_encoding? - | KW_ROLE nonreservedword_or_sconst - | KW_SESSION KW_AUTHORIZATION nonreservedword_or_sconst - | KW_XML KW_OPTION document_or_content - | KW_TRANSACTION KW_SNAPSHOT sconst; - -var_name: colid (DOT colid)*; - -var_list: var_value (COMMA var_value)*; - -var_value: opt_boolean_or_string | numericonly; - -iso_level: - KW_READ (KW_UNCOMMITTED | KW_COMMITTED) - | KW_REPEATABLE KW_READ - | KW_SERIALIZABLE; - -opt_boolean_or_string_column: - KW_TRUE - | KW_FALSE - | KW_ON - | nonreservedword_or_sconst_column; - -opt_boolean_or_string: - KW_TRUE - | KW_FALSE - | KW_ON - | nonreservedword_or_sconst; - -zone_value: - sconst - | identifier - | constinterval sconst opt_interval? - | constinterval OPEN_PAREN iconst CLOSE_PAREN sconst - | numericonly - | KW_DEFAULT - | KW_LOCAL; - -opt_encoding: sconst | KW_DEFAULT; - -nonreservedword_or_sconst_column: nonreservedword_column | sconst; - -nonreservedword_or_sconst: nonreservedword | sconst; - -variableresetstmt: KW_RESET reset_rest; - -reset_rest: - generic_reset - | KW_TIME KW_ZONE - | KW_TRANSACTION KW_ISOLATION KW_LEVEL - | KW_SESSION KW_AUTHORIZATION; - -generic_reset: var_name | KW_ALL; - -setresetclause: KW_SET set_rest | variableresetstmt; - -functionsetresetclause: KW_SET set_rest_more | variableresetstmt; - -variableshowstmt: - KW_SHOW ( - var_name - | KW_TIME KW_ZONE - | KW_TRANSACTION KW_ISOLATION KW_LEVEL - | KW_SESSION KW_AUTHORIZATION - | KW_ALL - ); - -constraintssetstmt: - KW_SET KW_CONSTRAINTS constraints_set_list constraints_set_mode; - -constraints_set_list: KW_ALL | qualified_name_list; - -constraints_set_mode: KW_DEFERRED | KW_IMMEDIATE; - -checkpointstmt: KW_CHECKPOINT; - -discardstmt: - KW_DISCARD (KW_ALL | KW_TEMP | KW_TEMPORARY | KW_PLANS | KW_SEQUENCES); - -altertablestmt: - KW_ALTER KW_TABLE opt_if_exists? relation_expr ( - alter_table_cmds - | partition_cmd - ) - | KW_ALTER KW_TABLE KW_ALL KW_IN KW_TABLESPACE tablespace_name (KW_OWNED KW_BY role_list)? KW_SET KW_TABLESPACE tablespace_name_create opt_nowait? - | KW_ALTER KW_TABLE opt_if_exists? table_name KW_ATTACH KW_PARTITION qualified_name (KW_FOR KW_VALUES partition_bound_spec | KW_DEFAULT) - | KW_ALTER KW_TABLE opt_if_exists? table_name KW_DETACH KW_PARTITION qualified_name (KW_CONCURRENTLY | KW_FINALIZE)? - | KW_ALTER KW_INDEX opt_if_exists? qualified_name ( - alter_table_cmds - | index_partition_cmd - ) - | KW_ALTER KW_INDEX KW_ALL KW_IN KW_TABLESPACE tablespace_name (KW_OWNED KW_BY role_list)? KW_SET KW_TABLESPACE tablespace_name_create opt_nowait? - | KW_ALTER KW_SEQUENCE opt_if_exists? qualified_name alter_table_cmds - | KW_ALTER KW_VIEW opt_if_exists? view_name alter_table_cmds - | KW_ALTER KW_MATERIALIZED KW_VIEW opt_if_exists? view_name alter_table_cmds - | KW_ALTER KW_MATERIALIZED KW_VIEW KW_ALL KW_IN KW_TABLESPACE tablespace_name ( - KW_OWNED KW_BY role_list - )? KW_SET KW_TABLESPACE tablespace_name_create opt_nowait? - | KW_ALTER KW_FOREIGN KW_TABLE opt_if_exists? relation_expr alter_table_cmds; - -alter_table_cmds: alter_table_cmd (COMMA alter_table_cmd)*; - -partition_bound_spec: KW_IN opt_type_modifiers | -KW_FROM partition_bound_cluase KW_TO partition_bound_cluase | -KW_WITH partition_with_cluase; - -partition_bound_cluase: OPEN_PAREN partition_bound_choose (COMMA partition_bound_choose)* CLOSE_PAREN; - -partition_bound_choose: opt_type_modifiers | KW_MINVALUE | KW_MAXVALUE; - -partition_with_cluase: OPEN_PAREN KW_MODULUS numericonly COMMA KW_REMAINDER numericonly CLOSE_PAREN; - -partition_cmd: - KW_ATTACH KW_PARTITION qualified_name partitionboundspec - | KW_DETACH KW_PARTITION qualified_name; - -index_partition_cmd: KW_ATTACH KW_PARTITION qualified_name; - -alter_table_cmd: - KW_ADD opt_column? opt_if_not_exists? columnDefCluase - | KW_ALTER opt_column? column_name alter_column_default - | KW_ALTER opt_column? column_name KW_DROP KW_NOT KW_NULL - | KW_ALTER opt_column? column_name KW_SET KW_NOT KW_NULL - | KW_ALTER opt_column? column_name KW_DROP KW_EXPRESSION opt_if_exists? - | KW_ALTER opt_column? column_name KW_SET KW_STATISTICS signediconst - | KW_ALTER opt_column? column_name KW_SET KW_STATISTICS signediconst - | KW_ALTER opt_column? column_name KW_SET reloptions - | KW_ALTER opt_column? column_name KW_RESET reloptions - | KW_ALTER opt_column? column_name KW_SET KW_STORAGE colid - | KW_ALTER opt_column? column_name KW_ADD KW_GENERATED generated_when KW_AS KW_IDENTITY - optparenthesizedseqoptlist? - | KW_ALTER opt_column? column_name alter_identity_column_option_list - | KW_ALTER opt_column? column_name KW_DROP KW_IDENTITY opt_if_exists? - | KW_DROP opt_column? opt_if_exists? column_name opt_drop_behavior? - | KW_ALTER opt_column? column_name opt_set_data? KW_TYPE typename opt_collate_clause? alter_using? - | KW_ALTER opt_column? column_name alter_generic_options - | KW_ADD tableconstraint - | KW_ALTER KW_CONSTRAINT name constraintattributespec - | KW_VALIDATE KW_CONSTRAINT name - | KW_DROP KW_CONSTRAINT opt_if_exists? name opt_drop_behavior? - | KW_SET KW_WITHOUT KW_OIDS - | KW_CLUSTER KW_ON name - | KW_SET KW_WITHOUT KW_CLUSTER - | KW_SET KW_LOGGED - | KW_SET KW_UNLOGGED - | KW_ENABLE KW_TRIGGER name - | KW_ENABLE KW_ALWAYS KW_TRIGGER name - | KW_ENABLE KW_REPLICA KW_TRIGGER name - | KW_ENABLE KW_TRIGGER KW_ALL - | KW_ENABLE KW_TRIGGER KW_USER - | KW_DISABLE KW_TRIGGER name - | KW_DISABLE KW_TRIGGER KW_ALL - | KW_DISABLE KW_TRIGGER KW_USER - | KW_ENABLE KW_RULE name - | KW_ENABLE KW_ALWAYS KW_RULE name - | KW_ENABLE KW_REPLICA KW_RULE name - | KW_DISABLE KW_RULE name - | KW_INHERIT qualified_name - | KW_NO KW_INHERIT qualified_name - | KW_OF any_name - | KW_NOT KW_OF - | KW_OWNER KW_TO rolespec - | KW_SET KW_TABLESPACE tablespace_name_create - | KW_SET reloptions - | KW_RESET reloptions - | KW_REPLICA KW_IDENTITY replica_identity - | KW_ENABLE KW_ROW KW_LEVEL KW_SECURITY - | KW_DISABLE KW_ROW KW_LEVEL KW_SECURITY - | KW_FORCE KW_ROW KW_LEVEL KW_SECURITY - | KW_NO KW_FORCE KW_ROW KW_LEVEL KW_SECURITY - | alter_generic_options; - -alter_column_default: KW_SET KW_DEFAULT a_expr | KW_DROP KW_DEFAULT; - -opt_drop_behavior: KW_CASCADE | KW_RESTRICT; - -opt_collate_clause: KW_COLLATE any_name; - -alter_using: KW_USING a_expr; - -replica_identity: KW_NOTHING | KW_FULL | KW_DEFAULT | KW_USING KW_INDEX name; - -reloptions: OPEN_PAREN reloption_list CLOSE_PAREN; - -opt_reloptions: KW_WITH reloptions; - -reloption_list: reloption_elem (COMMA reloption_elem)*; - -reloption_elem: - collabel (EQUAL def_arg | DOT collabel (EQUAL def_arg)?)?; - -alter_identity_column_option_list: - alter_identity_column_option+; - -alter_identity_column_option: - KW_RESTART (opt_with? numericonly)? - | KW_SET (seqoptelem | KW_GENERATED generated_when); - -partitionboundspec: - KW_FOR KW_VALUES KW_WITH OPEN_PAREN hash_partbound CLOSE_PAREN - | KW_FOR KW_VALUES KW_IN OPEN_PAREN expr_list CLOSE_PAREN - | KW_FOR KW_VALUES KW_FROM OPEN_PAREN expr_list CLOSE_PAREN KW_TO OPEN_PAREN expr_list CLOSE_PAREN - | KW_DEFAULT; - -hash_partbound_elem: nonreservedword iconst; - -hash_partbound: - hash_partbound_elem (COMMA hash_partbound_elem)*; - -altercompositetypestmt: KW_ALTER KW_TYPE any_name alter_type_cmds; - -alter_type_cmds: alter_type_cmd (COMMA alter_type_cmd)*; - -alter_type_cmd: - KW_ADD KW_ATTRIBUTE tablefuncelement opt_drop_behavior? - | KW_DROP KW_ATTRIBUTE opt_if_exists? colid opt_drop_behavior? - | KW_ALTER KW_ATTRIBUTE colid opt_set_data? KW_TYPE typename opt_collate_clause? opt_drop_behavior?; - -closeportalstmt: KW_CLOSE (cursor_name | KW_ALL); - -copystmt: - KW_COPY opt_binary? table_name opt_column_list? copy_from opt_program? copy_file_name - copy_delimiter? opt_with? copy_options where_clause? - | KW_COPY OPEN_PAREN preparablestmt CLOSE_PAREN KW_TO opt_program? copy_file_name opt_with? - copy_options; - -copy_from: KW_FROM | KW_TO; - -opt_program: KW_PROGRAM; - -copy_file_name: sconst | KW_STDIN | KW_STDOUT; - -copy_options: - copy_opt_list - | OPEN_PAREN copy_generic_opt_list CLOSE_PAREN; - -copy_opt_list: copy_opt_item*; - -copy_opt_item: - KW_BINARY - | KW_FREEZE - | KW_DELIMITER opt_as? sconst - | KW_NULL opt_as? sconst - | KW_CSV - | KW_HEADER - | KW_QUOTE opt_as? sconst - | KW_ESCAPE opt_as? sconst - | KW_FORCE KW_QUOTE columnlist - | KW_FORCE KW_QUOTE STAR - | KW_FORCE KW_NOT KW_NULL columnlist - | KW_FORCE KW_NULL columnlist - | KW_ENCODING sconst; - -opt_binary: KW_BINARY; - -copy_delimiter: opt_using? KW_DELIMITERS sconst; - -opt_using: KW_USING; - -copy_generic_opt_list: - copy_generic_opt_elem (COMMA copy_generic_opt_elem)*; - -copy_generic_opt_elem: collabel copy_generic_opt_arg?; - -copy_generic_opt_arg: - opt_boolean_or_string - | numericonly - | STAR - | OPEN_PAREN copy_generic_opt_arg_list CLOSE_PAREN; - -copy_generic_opt_arg_list: - copy_generic_opt_arg_list_item ( - COMMA copy_generic_opt_arg_list_item - )*; - -copy_generic_opt_arg_list_item: opt_boolean_or_string_column; - -createstmt: - KW_CREATE opttemp? KW_TABLE opt_if_not_exists? table_name_create ( - OPEN_PAREN table_column_list? CLOSE_PAREN optinherit? optpartitionspec? - table_access_method_clause? optwith? oncommitoption? opttablespace? - | KW_OF any_name opttypedtableelementlist? optpartitionspec? table_access_method_clause? - optwith? oncommitoption? opttablespace? - | KW_PARTITION KW_OF qualified_name opttypedtableelementlist? partitionboundspec optpartitionspec? - table_access_method_clause? optwith? oncommitoption? opttablespace? - ); - -opttemp: - KW_TEMPORARY - | KW_TEMP - | KW_LOCAL (KW_TEMPORARY | KW_TEMP) - | KW_GLOBAL (KW_TEMPORARY | KW_TEMP) - | KW_UNLOGGED; - -table_column_list: tableelementlist; - -opttableelementlist: tableelementlist; - -opttypedtableelementlist: - OPEN_PAREN typedtableelementlist CLOSE_PAREN; - -tableelementlist: tableelement (COMMA tableelement)*; - -typedtableelementlist: - typedtableelement (COMMA typedtableelement)*; - -tableelement: columnDef | tablelikeclause | tableconstraint; - -typedtableelement: columnOptions | tableconstraint; - -columnDefCluase: column_name typename create_generic_options? storageCluase? compressionCluase? (KW_COLLATE any_name)? (KW_WITH KW_OPTIONS)? colquallist; - -columnDef: column_name typename create_generic_options? storageCluase? compressionCluase? (KW_COLLATE any_name)? (KW_WITH KW_OPTIONS)? colquallist; - -compressionCluase: KW_COMPRESSION colid; - -storageCluase: KW_STORAGE (KW_PLAIN | KW_EXTERNAL | KW_EXTENDED | KW_MAIN | KW_DEFAULT | colid); - -columnOptions: column_name (KW_WITH KW_OPTIONS)? colquallist; - -colquallist: colconstraint*; - -colconstraint: - (KW_CONSTRAINT name)? colconstraintelem deferrable_trigger? initially_trigger? - | colconstraintelem deferrable_trigger? initially_trigger? - ; - -colconstraintelem: - KW_NOT KW_NULL - | KW_NULL - | KW_UNIQUE opt_definition? optconstablespace? - | KW_UNIQUE nulls_distinct? index_paramenters_create - | KW_PRIMARY KW_KEY opt_definition? optconstablespace? - | KW_CHECK OPEN_PAREN a_expr CLOSE_PAREN opt_no_inherit? - | KW_DEFAULT b_expr - | KW_GENERATED generated_when KW_AS ( - KW_IDENTITY optparenthesizedseqoptlist? - | OPEN_PAREN a_expr CLOSE_PAREN KW_STORED - ) - | KW_REFERENCES qualified_name opt_column_list? key_match? key_actions? - | opt_collate; - -nulls_distinct: KW_NULLS KW_NOT? KW_DISTINCT; - -generated_when: KW_ALWAYS | KW_BY KW_DEFAULT; - -deferrable_trigger: - KW_DEFERRABLE - | KW_NOT KW_DEFERRABLE; - -initially_trigger: - KW_INITIALLY (KW_DEFERRED | KW_IMMEDIATE); - -tablelikeclause: KW_LIKE qualified_name tablelikeoptionlist; - -tablelikeoptionlist: ((KW_INCLUDING | KW_EXCLUDING) tablelikeoption)*; - -tablelikeoption: - KW_COMMENTS - | KW_CONSTRAINTS - | KW_DEFAULTS - | KW_IDENTITY - | KW_GENERATED - | KW_INDEXES - | KW_STATISTICS - | KW_STORAGE - | KW_ALL; - -tableconstraint: - KW_CONSTRAINT name constraintelem - | constraintelem; - -constraintelem: - KW_CHECK OPEN_PAREN a_expr CLOSE_PAREN constraintattributespec - | KW_UNIQUE ( - OPEN_PAREN columnlist CLOSE_PAREN opt_c_include? opt_definition? optconstablespace? - constraintattributespec - | existingindex constraintattributespec - ) - | KW_PRIMARY KW_KEY ( - OPEN_PAREN columnlist CLOSE_PAREN opt_c_include? opt_definition? optconstablespace? - constraintattributespec - | existingindex constraintattributespec - ) - | KW_EXCLUDE access_method_clause? OPEN_PAREN exclusionconstraintlist CLOSE_PAREN opt_c_include? - opt_definition? optconstablespace? exclusionwhereclause? constraintattributespec - | KW_FOREIGN KW_KEY OPEN_PAREN columnlist CLOSE_PAREN KW_REFERENCES qualified_name opt_column_list? - key_match? key_actions? constraintattributespec; - -opt_no_inherit: KW_NO KW_INHERIT; - -opt_column_list: OPEN_PAREN columnlist CLOSE_PAREN; - -columnlist: column_name (COMMA column_name)*; - -opt_c_include: KW_INCLUDE OPEN_PAREN columnlist CLOSE_PAREN; - -key_match: KW_MATCH (KW_FULL | KW_PARTIAL | KW_SIMPLE); - -exclusionconstraintlist: - exclusionconstraintelem (COMMA exclusionconstraintelem)*; - -exclusionconstraintelem: - index_elem KW_WITH ( - any_operator - | KW_OPERATOR OPEN_PAREN any_operator CLOSE_PAREN - ); - -exclusionwhereclause: KW_WHERE OPEN_PAREN a_expr CLOSE_PAREN; - -key_actions: - key_update - | key_delete - | key_update key_delete - | key_delete key_update; - -key_update: KW_ON KW_UPDATE key_action; - -key_delete: KW_ON KW_DELETE key_action; - -key_action: - KW_NO KW_ACTION - | KW_RESTRICT - | KW_CASCADE - | KW_SET (KW_NULL | KW_DEFAULT) columnlist?; - -optinherit: KW_INHERITS OPEN_PAREN qualified_name_list CLOSE_PAREN; - -optpartitionspec: partitionspec; - -partitionspec: - KW_PARTITION KW_BY colid OPEN_PAREN part_params CLOSE_PAREN; - -part_params: part_elem (COMMA part_elem)*; - -part_elem: - column_name opt_collate? opt_class? - | func_expr_windowless opt_collate? opt_class? - | OPEN_PAREN a_expr CLOSE_PAREN opt_collate? opt_class?; - -table_access_method_clause: KW_USING name; - -optwith: KW_WITH reloptions | KW_WITHOUT KW_OIDS | KW_WITH KW_OIDS; - -oncommitoption: - KW_ON KW_COMMIT (KW_DROP | KW_DELETE KW_ROWS | KW_PRESERVE KW_ROWS); - -opttablespace: KW_TABLESPACE tablespace_name; - -index_paramenters_create: opt_include? with_clause? optconstablespace?; - -optconstablespace: KW_USING KW_INDEX KW_TABLESPACE tablespace_name; - -existingindex: KW_USING KW_INDEX name; - -createstatsstmt: - KW_CREATE KW_STATISTICS (opt_if_not_exists? any_name )? opt_name_list? KW_ON (column_expr_list | expr_list) KW_FROM from_list; - -alterstatsstmt: - KW_ALTER KW_STATISTICS opt_if_exists? any_name KW_SET KW_STATISTICS signediconst; - -createasstmt: - KW_CREATE opttemp? KW_TABLE opt_if_not_exists? create_as_target KW_AS selectstmt opt_with_data?; - -create_as_target: - table_name_create opt_column_list? table_access_method_clause? optwith? oncommitoption? - opttablespace?; - -opt_with_data: KW_WITH (KW_DATA | KW_NO KW_DATA); - -creatematviewstmt: - KW_CREATE optnolog? KW_MATERIALIZED KW_VIEW opt_if_not_exists? create_mv_target KW_AS selectstmt - opt_with_data?; - -create_mv_target: - view_name_create opt_column_list? table_access_method_clause? opt_reloptions? opttablespace?; - -optnolog: KW_UNLOGGED; - -refreshmatviewstmt: - KW_REFRESH KW_MATERIALIZED KW_VIEW opt_concurrently? view_name opt_with_data?; - -createseqstmt: - KW_CREATE opttemp? KW_SEQUENCE opt_if_not_exists? qualified_name optseqoptlist?; - -alterseqstmt: - KW_ALTER KW_SEQUENCE opt_if_exists? qualified_name seqoptlist; - -optseqoptlist: seqoptlist; - -optparenthesizedseqoptlist: OPEN_PAREN seqoptlist CLOSE_PAREN; - -seqoptlist: seqoptelem+; - -seqoptelem: - KW_AS simpletypename - | KW_CACHE numericonly - | KW_CYCLE - | KW_INCREMENT opt_by? numericonly - | KW_MAXVALUE numericonly - | KW_MINVALUE numericonly - | KW_NO (KW_MAXVALUE | KW_MINVALUE | KW_CYCLE) - | KW_OWNED KW_BY table_column_name - | KW_SEQUENCE KW_NAME any_name - | KW_START opt_with? numericonly - | KW_RESTART opt_with? numericonly?; - -opt_by: KW_BY; - -numericonly: fconst | PLUS fconst | MINUS fconst | signediconst; - -numericonly_list: numericonly (COMMA numericonly)*; - -createplangstmt: - KW_CREATE opt_or_replace? opt_trusted? opt_procedural? KW_LANGUAGE name ( - KW_HANDLER handler_name opt_inline_handler? opt_validator? - )?; - -opt_trusted: KW_TRUSTED; - -handler_name: name attrs?; - -opt_inline_handler: KW_INLINE handler_name; - -validator_clause: KW_VALIDATOR handler_name | KW_NO KW_VALIDATOR; - -opt_validator: validator_clause; - -opt_procedural: KW_PROCEDURAL; - -createtablespacestmt: - KW_CREATE KW_TABLESPACE tablespace_name opttablespaceowner? KW_LOCATION sconst opt_reloptions?; - -opttablespaceowner: KW_OWNER rolespec; - -createextensionstmt: - KW_CREATE KW_EXTENSION opt_if_not_exists? name opt_with? create_extension_opt_list; - -create_extension_opt_list: create_extension_opt_item*; - -create_extension_opt_item: - KW_SCHEMA schema_name - | KW_VERSION nonreservedword_or_sconst - | KW_FROM nonreservedword_or_sconst - | KW_CASCADE; - -alterextensionstmt: - KW_ALTER KW_EXTENSION name KW_UPDATE alter_extension_opt_list; - -alter_extension_opt_list: alter_extension_opt_item*; - -alter_extension_opt_item: KW_TO nonreservedword_or_sconst; - -alterextensioncontentsstmt: - KW_ALTER KW_EXTENSION name add_drop object_type_name - | KW_ALTER KW_EXTENSION name add_drop object_type_any_name - | KW_ALTER KW_EXTENSION name add_drop KW_AGGREGATE aggregate_with_argtypes - | KW_ALTER KW_EXTENSION name add_drop KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN - | KW_ALTER KW_EXTENSION name add_drop KW_DOMAIN typename - | KW_ALTER KW_EXTENSION name add_drop KW_FUNCTION function_with_argtypes - | KW_ALTER KW_EXTENSION name add_drop KW_OPERATOR operator_with_argtypes - | KW_ALTER KW_EXTENSION name add_drop KW_OPERATOR KW_CLASS any_name KW_USING name - | KW_ALTER KW_EXTENSION name add_drop KW_OPERATOR KW_FAMILY any_name KW_USING name - | KW_ALTER KW_EXTENSION name add_drop KW_PROCEDURE procedure_with_argtypes - | KW_ALTER KW_EXTENSION name add_drop KW_ROUTINE routine_with_argtypes - | KW_ALTER KW_EXTENSION name add_drop KW_TRANSFORM KW_FOR typename KW_LANGUAGE name - | KW_ALTER KW_EXTENSION name add_drop KW_TYPE typename; - -createfdwstmt: - KW_CREATE KW_FOREIGN KW_DATA KW_WRAPPER name opt_fdw_options? create_generic_options?; - -fdw_option: - KW_HANDLER handler_name - | KW_NO KW_HANDLER - | KW_VALIDATOR handler_name - | KW_NO KW_VALIDATOR; - -fdw_options: fdw_option+; - -opt_fdw_options: fdw_options; - -alterfdwstmt: - KW_ALTER KW_FOREIGN KW_DATA KW_WRAPPER name opt_fdw_options? alter_generic_options - | KW_ALTER KW_FOREIGN KW_DATA KW_WRAPPER name fdw_options; - -create_generic_options: - KW_OPTIONS OPEN_PAREN generic_option_list CLOSE_PAREN; - -generic_option_list: - generic_option_elem (COMMA generic_option_elem)*; - -alter_generic_options: - KW_OPTIONS OPEN_PAREN alter_generic_option_list CLOSE_PAREN; - -alter_generic_option_list: - alter_generic_option_elem (COMMA alter_generic_option_elem)*; - -alter_generic_option_elem: - generic_option_elem - | KW_SET generic_option_elem - | KW_ADD generic_option_elem - | KW_DROP generic_option_elem; - -generic_option_elem: generic_option_name generic_option_arg; - -generic_option_name: collabel; - -generic_option_arg: sconst; - -createforeignserverstmt: - KW_CREATE KW_SERVER opt_if_not_exists? name opt_type? opt_foreign_server_version? KW_FOREIGN KW_DATA - KW_WRAPPER name create_generic_options?; - -opt_type: KW_TYPE sconst; - -foreign_server_version: KW_VERSION (sconst | KW_NULL); - -opt_foreign_server_version: foreign_server_version; - -alterforeignserverstmt: - KW_ALTER KW_SERVER name ( - alter_generic_options - | foreign_server_version alter_generic_options? - ); - -createforeigntablestmt: - KW_CREATE KW_FOREIGN KW_TABLE opt_if_not_exists? table_name_create OPEN_PAREN opttableelementlist? - CLOSE_PAREN optinherit? KW_SERVER name create_generic_options? - | KW_CREATE KW_FOREIGN KW_TABLE opt_if_not_exists? table_name_create KW_PARTITION KW_OF table_name - opttypedtableelementlist? partitionboundspec KW_SERVER name create_generic_options?; - -importforeignschemastmt: - KW_IMPORT KW_FOREIGN KW_SCHEMA schema_name import_qualification? KW_FROM KW_SERVER name KW_INTO name - create_generic_options?; - -import_qualification_type: KW_LIMIT KW_TO | KW_EXCEPT; - -import_qualification: - import_qualification_type OPEN_PAREN relation_expr_list CLOSE_PAREN; - -createusermappingstmt: - KW_CREATE KW_USER KW_MAPPING opt_if_not_exists? KW_FOR auth_ident KW_SERVER name create_generic_options?; - -auth_ident: rolespec | KW_USER; - -alterusermappingstmt: - KW_ALTER KW_USER KW_MAPPING KW_FOR auth_ident KW_SERVER name alter_generic_options; - -createpolicystmt: - KW_CREATE KW_POLICY name KW_ON qualified_name rowsecuritydefaultpermissive? rowsecuritydefaultforcmd? - rowsecuritydefaulttorole? rowsecurityoptionalexpr? rowsecurityoptionalwithcheck?; - -alterpolicystmt: - KW_ALTER KW_POLICY name KW_ON qualified_name rowsecurityoptionaltorole? rowsecurityoptionalexpr? - rowsecurityoptionalwithcheck?; - -alterprocedurestmt: KW_ALTER KW_PROCEDURE procedure_name func_args? procedure_cluase; - -procedure_cluase: - procedure_action (procedure_action)* KW_RESTRICT? - | KW_RENAME KW_TO procedure_name_create - | KW_OWNER KW_TO rolespec - | KW_SET KW_SCHEMA schema_name_create - | KW_NO? KW_DEPENDS KW_ON KW_EXTENSION name - ; - -procedure_action: - (KW_EXTERNAL? KW_SECURITY KW_INVOKER | KW_EXTERNAL? KW_SECURITY KW_DEFINER) - | KW_SET name (KW_TO | STAR) (name | KW_DEFAULT ) + | KW_RESET KW_ALL + ; + +creategroupstmt + : KW_CREATE KW_GROUP groupname opt_with? optrolelist + ; + +altergroupstmt + : KW_ALTER KW_GROUP rolespec add_drop KW_USER role_list + ; + +add_drop + : KW_ADD + | KW_DROP + ; + +createschemastmt + : KW_CREATE KW_SCHEMA opt_if_not_exists? ( + schema_name_create? KW_AUTHORIZATION rolespec + | schema_name_create + ) optschemaeltlist + ; + +schema_name_create + : colid attrs? + ; + +optschemaeltlist + : schema_stmt* + ; + +schema_stmt + : createstmt + | indexstmt + | createseqstmt + | createtrigstmt + | grantstmt + | viewstmt + ; + +variablesetstmt + : KW_SET (KW_LOCAL | KW_SESSION)? set_rest + ; + +set_rest + : KW_TRANSACTION transaction_mode_list + | KW_SESSION KW_CHARACTERISTICS KW_AS KW_TRANSACTION transaction_mode_list + | set_rest_more + ; + +generic_set + : (var_name | KW_ALL) (KW_TO | EQUAL)? (var_list | KW_DEFAULT)? + ; + +set_rest_more + : generic_set + | var_name KW_FROM KW_CURRENT + | KW_TIME KW_ZONE zone_value + | KW_CATALOG sconst + | KW_SCHEMA schema_name + | KW_NAMES opt_encoding? + | KW_ROLE nonreservedword_or_sconst + | KW_SESSION KW_AUTHORIZATION nonreservedword_or_sconst + | KW_XML KW_OPTION document_or_content + | KW_TRANSACTION KW_SNAPSHOT sconst + ; + +var_name + : colid (DOT colid)* + ; + +var_list + : var_value (COMMA var_value)* + ; + +var_value + : opt_boolean_or_string + | numericonly + ; + +iso_level + : KW_READ (KW_UNCOMMITTED | KW_COMMITTED) + | KW_REPEATABLE KW_READ + | KW_SERIALIZABLE + ; + +opt_boolean_or_string_column + : KW_TRUE + | KW_FALSE + | KW_ON + | nonreservedword_or_sconst_column + ; + +opt_boolean_or_string + : KW_TRUE + | KW_FALSE + | KW_ON + | nonreservedword_or_sconst + ; + +zone_value + : sconst + | identifier + | constinterval sconst opt_interval? + | constinterval OPEN_PAREN iconst CLOSE_PAREN sconst + | numericonly + | KW_DEFAULT + | KW_LOCAL + ; + +opt_encoding + : sconst + | KW_DEFAULT + ; + +nonreservedword_or_sconst_column + : nonreservedword_column + | sconst + ; + +nonreservedword_or_sconst + : nonreservedword + | sconst + ; + +variableresetstmt + : KW_RESET reset_rest + ; + +reset_rest + : generic_reset + | KW_TIME KW_ZONE + | KW_TRANSACTION KW_ISOLATION KW_LEVEL + | KW_SESSION KW_AUTHORIZATION + ; + +generic_reset + : var_name + | KW_ALL + ; + +setresetclause + : KW_SET set_rest + | variableresetstmt + ; + +functionsetresetclause + : KW_SET set_rest_more + | variableresetstmt + ; + +variableshowstmt + : KW_SHOW ( + var_name + | KW_TIME KW_ZONE + | KW_TRANSACTION KW_ISOLATION KW_LEVEL + | KW_SESSION KW_AUTHORIZATION + | KW_ALL + ) + ; + +constraintssetstmt + : KW_SET KW_CONSTRAINTS constraints_set_list constraints_set_mode + ; + +constraints_set_list + : KW_ALL + | qualified_name_list + ; + +constraints_set_mode + : KW_DEFERRED + | KW_IMMEDIATE + ; + +checkpointstmt + : KW_CHECKPOINT + ; + +discardstmt + : KW_DISCARD (KW_ALL | KW_TEMP | KW_TEMPORARY | KW_PLANS | KW_SEQUENCES) + ; + +altertablestmt + : KW_ALTER KW_TABLE opt_if_exists? relation_expr (alter_table_cmds | partition_cmd) + | KW_ALTER KW_TABLE KW_ALL KW_IN KW_TABLESPACE tablespace_name (KW_OWNED KW_BY role_list)? KW_SET KW_TABLESPACE tablespace_name_create opt_nowait? + | KW_ALTER KW_TABLE opt_if_exists? table_name KW_ATTACH KW_PARTITION qualified_name ( + KW_FOR KW_VALUES partition_bound_spec + | KW_DEFAULT + ) + | KW_ALTER KW_TABLE opt_if_exists? table_name KW_DETACH KW_PARTITION qualified_name ( + KW_CONCURRENTLY + | KW_FINALIZE + )? + | KW_ALTER KW_INDEX opt_if_exists? qualified_name (alter_table_cmds | index_partition_cmd) + | KW_ALTER KW_INDEX KW_ALL KW_IN KW_TABLESPACE tablespace_name (KW_OWNED KW_BY role_list)? KW_SET KW_TABLESPACE tablespace_name_create opt_nowait? + | KW_ALTER KW_SEQUENCE opt_if_exists? qualified_name alter_table_cmds + | KW_ALTER KW_VIEW opt_if_exists? view_name alter_table_cmds + | KW_ALTER KW_MATERIALIZED KW_VIEW opt_if_exists? view_name alter_table_cmds + | KW_ALTER KW_MATERIALIZED KW_VIEW KW_ALL KW_IN KW_TABLESPACE tablespace_name ( + KW_OWNED KW_BY role_list + )? KW_SET KW_TABLESPACE tablespace_name_create opt_nowait? + | KW_ALTER KW_FOREIGN KW_TABLE opt_if_exists? relation_expr alter_table_cmds + ; + +alter_table_cmds + : alter_table_cmd (COMMA alter_table_cmd)* + ; + +partition_bound_spec + : KW_IN opt_type_modifiers + | KW_FROM partition_bound_cluase KW_TO partition_bound_cluase + | KW_WITH partition_with_cluase + ; + +partition_bound_cluase + : OPEN_PAREN partition_bound_choose (COMMA partition_bound_choose)* CLOSE_PAREN + ; + +partition_bound_choose + : opt_type_modifiers + | KW_MINVALUE + | KW_MAXVALUE + ; + +partition_with_cluase + : OPEN_PAREN KW_MODULUS numericonly COMMA KW_REMAINDER numericonly CLOSE_PAREN + ; + +partition_cmd + : KW_ATTACH KW_PARTITION qualified_name partitionboundspec + | KW_DETACH KW_PARTITION qualified_name + ; + +index_partition_cmd + : KW_ATTACH KW_PARTITION qualified_name + ; + +alter_table_cmd + : KW_ADD opt_column? opt_if_not_exists? columnDefCluase + | KW_ALTER opt_column? column_name alter_column_default + | KW_ALTER opt_column? column_name KW_DROP KW_NOT KW_NULL + | KW_ALTER opt_column? column_name KW_SET KW_NOT KW_NULL + | KW_ALTER opt_column? column_name KW_DROP KW_EXPRESSION opt_if_exists? + | KW_ALTER opt_column? column_name KW_SET KW_STATISTICS signediconst + | KW_ALTER opt_column? column_name KW_SET KW_STATISTICS signediconst + | KW_ALTER opt_column? column_name KW_SET reloptions + | KW_ALTER opt_column? column_name KW_RESET reloptions + | KW_ALTER opt_column? column_name KW_SET KW_STORAGE colid + | KW_ALTER opt_column? column_name KW_ADD KW_GENERATED generated_when KW_AS KW_IDENTITY optparenthesizedseqoptlist? + | KW_ALTER opt_column? column_name alter_identity_column_option_list + | KW_ALTER opt_column? column_name KW_DROP KW_IDENTITY opt_if_exists? + | KW_DROP opt_column? opt_if_exists? column_name opt_drop_behavior? + | KW_ALTER opt_column? column_name opt_set_data? KW_TYPE typename opt_collate_clause? alter_using? + | KW_ALTER opt_column? column_name alter_generic_options + | KW_ADD tableconstraint + | KW_ALTER KW_CONSTRAINT name constraintattributespec + | KW_VALIDATE KW_CONSTRAINT name + | KW_DROP KW_CONSTRAINT opt_if_exists? name opt_drop_behavior? + | KW_SET KW_WITHOUT KW_OIDS + | KW_CLUSTER KW_ON name + | KW_SET KW_WITHOUT KW_CLUSTER + | KW_SET KW_LOGGED + | KW_SET KW_UNLOGGED + | KW_ENABLE KW_TRIGGER name + | KW_ENABLE KW_ALWAYS KW_TRIGGER name + | KW_ENABLE KW_REPLICA KW_TRIGGER name + | KW_ENABLE KW_TRIGGER KW_ALL + | KW_ENABLE KW_TRIGGER KW_USER + | KW_DISABLE KW_TRIGGER name + | KW_DISABLE KW_TRIGGER KW_ALL + | KW_DISABLE KW_TRIGGER KW_USER + | KW_ENABLE KW_RULE name + | KW_ENABLE KW_ALWAYS KW_RULE name + | KW_ENABLE KW_REPLICA KW_RULE name + | KW_DISABLE KW_RULE name + | KW_INHERIT qualified_name + | KW_NO KW_INHERIT qualified_name + | KW_OF any_name + | KW_NOT KW_OF + | KW_OWNER KW_TO rolespec + | KW_SET KW_TABLESPACE tablespace_name_create + | KW_SET reloptions + | KW_RESET reloptions + | KW_REPLICA KW_IDENTITY replica_identity + | KW_ENABLE KW_ROW KW_LEVEL KW_SECURITY + | KW_DISABLE KW_ROW KW_LEVEL KW_SECURITY + | KW_FORCE KW_ROW KW_LEVEL KW_SECURITY + | KW_NO KW_FORCE KW_ROW KW_LEVEL KW_SECURITY + | alter_generic_options + ; + +alter_column_default + : KW_SET KW_DEFAULT a_expr + | KW_DROP KW_DEFAULT + ; + +opt_drop_behavior + : KW_CASCADE + | KW_RESTRICT + ; + +opt_collate_clause + : KW_COLLATE any_name + ; + +alter_using + : KW_USING a_expr + ; + +replica_identity + : KW_NOTHING + | KW_FULL + | KW_DEFAULT + | KW_USING KW_INDEX name + ; + +reloptions + : OPEN_PAREN reloption_list CLOSE_PAREN + ; + +opt_reloptions + : KW_WITH reloptions + ; + +reloption_list + : reloption_elem (COMMA reloption_elem)* + ; + +reloption_elem + : collabel (EQUAL def_arg | DOT collabel (EQUAL def_arg)?)? + ; + +alter_identity_column_option_list + : alter_identity_column_option+ + ; + +alter_identity_column_option + : KW_RESTART (opt_with? numericonly)? + | KW_SET (seqoptelem | KW_GENERATED generated_when) + ; + +partitionboundspec + : KW_FOR KW_VALUES KW_WITH OPEN_PAREN hash_partbound CLOSE_PAREN + | KW_FOR KW_VALUES KW_IN OPEN_PAREN expr_list CLOSE_PAREN + | KW_FOR KW_VALUES KW_FROM OPEN_PAREN expr_list CLOSE_PAREN KW_TO OPEN_PAREN expr_list CLOSE_PAREN + | KW_DEFAULT + ; + +hash_partbound_elem + : nonreservedword iconst + ; + +hash_partbound + : hash_partbound_elem (COMMA hash_partbound_elem)* + ; + +altercompositetypestmt + : KW_ALTER KW_TYPE any_name alter_type_cmds + ; + +alter_type_cmds + : alter_type_cmd (COMMA alter_type_cmd)* + ; + +alter_type_cmd + : KW_ADD KW_ATTRIBUTE tablefuncelement opt_drop_behavior? + | KW_DROP KW_ATTRIBUTE opt_if_exists? colid opt_drop_behavior? + | KW_ALTER KW_ATTRIBUTE colid opt_set_data? KW_TYPE typename opt_collate_clause? opt_drop_behavior? + ; + +closeportalstmt + : KW_CLOSE (cursor_name | KW_ALL) + ; + +copystmt + : KW_COPY opt_binary? table_name opt_column_list? copy_from opt_program? copy_file_name copy_delimiter? opt_with? copy_options where_clause? + | KW_COPY OPEN_PAREN preparablestmt CLOSE_PAREN KW_TO opt_program? copy_file_name opt_with? copy_options + ; + +copy_from + : KW_FROM + | KW_TO + ; + +opt_program + : KW_PROGRAM + ; + +copy_file_name + : sconst + | KW_STDIN + | KW_STDOUT + ; + +copy_options + : copy_opt_list + | OPEN_PAREN copy_generic_opt_list CLOSE_PAREN + ; + +copy_opt_list + : copy_opt_item* + ; + +copy_opt_item + : KW_BINARY + | KW_FREEZE + | KW_DELIMITER opt_as? sconst + | KW_NULL opt_as? sconst + | KW_CSV + | KW_HEADER + | KW_QUOTE opt_as? sconst + | KW_ESCAPE opt_as? sconst + | KW_FORCE KW_QUOTE columnlist + | KW_FORCE KW_QUOTE STAR + | KW_FORCE KW_NOT KW_NULL columnlist + | KW_FORCE KW_NULL columnlist + | KW_ENCODING sconst + ; + +opt_binary + : KW_BINARY + ; + +copy_delimiter + : opt_using? KW_DELIMITERS sconst + ; + +opt_using + : KW_USING + ; + +copy_generic_opt_list + : copy_generic_opt_elem (COMMA copy_generic_opt_elem)* + ; + +copy_generic_opt_elem + : collabel copy_generic_opt_arg? + ; + +copy_generic_opt_arg + : opt_boolean_or_string + | numericonly + | STAR + | OPEN_PAREN copy_generic_opt_arg_list CLOSE_PAREN + ; + +copy_generic_opt_arg_list + : copy_generic_opt_arg_list_item (COMMA copy_generic_opt_arg_list_item)* + ; + +copy_generic_opt_arg_list_item + : opt_boolean_or_string_column + ; + +createstmt + : KW_CREATE opttemp? KW_TABLE opt_if_not_exists? table_name_create ( + OPEN_PAREN table_column_list? CLOSE_PAREN optinherit? optpartitionspec? table_access_method_clause? optwith? oncommitoption? opttablespace? + | KW_OF any_name opttypedtableelementlist? optpartitionspec? table_access_method_clause? optwith? oncommitoption? opttablespace? + | KW_PARTITION KW_OF qualified_name opttypedtableelementlist? partitionboundspec optpartitionspec? table_access_method_clause? optwith? + oncommitoption? opttablespace? + ) + ; + +opttemp + : KW_TEMPORARY + | KW_TEMP + | KW_LOCAL (KW_TEMPORARY | KW_TEMP) + | KW_GLOBAL (KW_TEMPORARY | KW_TEMP) + | KW_UNLOGGED + ; + +table_column_list + : tableelementlist + ; + +opttableelementlist + : tableelementlist + ; + +opttypedtableelementlist + : OPEN_PAREN typedtableelementlist CLOSE_PAREN + ; + +tableelementlist + : tableelement (COMMA tableelement)* + ; + +typedtableelementlist + : typedtableelement (COMMA typedtableelement)* + ; + +tableelement + : columnDef + | tablelikeclause + | tableconstraint + ; + +typedtableelement + : columnOptions + | tableconstraint + ; + +columnDefCluase + : column_name typename create_generic_options? storageCluase? compressionCluase? ( + KW_COLLATE any_name + )? (KW_WITH KW_OPTIONS)? colquallist + ; + +columnDef + : column_name typename create_generic_options? storageCluase? compressionCluase? ( + KW_COLLATE any_name + )? (KW_WITH KW_OPTIONS)? colquallist + ; + +compressionCluase + : KW_COMPRESSION colid + ; + +storageCluase + : KW_STORAGE (KW_PLAIN | KW_EXTERNAL | KW_EXTENDED | KW_MAIN | KW_DEFAULT | colid) + ; + +columnOptions + : column_name (KW_WITH KW_OPTIONS)? colquallist + ; + +colquallist + : colconstraint* + ; + +colconstraint + : (KW_CONSTRAINT name)? colconstraintelem deferrable_trigger? initially_trigger? + | colconstraintelem deferrable_trigger? initially_trigger? + ; + +colconstraintelem + : KW_NOT KW_NULL + | KW_NULL + | KW_UNIQUE opt_definition? optconstablespace? + | KW_UNIQUE nulls_distinct? index_paramenters_create + | KW_PRIMARY KW_KEY opt_definition? optconstablespace? + | KW_CHECK OPEN_PAREN a_expr CLOSE_PAREN opt_no_inherit? + | KW_DEFAULT b_expr + | KW_GENERATED generated_when KW_AS ( + KW_IDENTITY optparenthesizedseqoptlist? + | OPEN_PAREN a_expr CLOSE_PAREN KW_STORED + ) + | KW_REFERENCES qualified_name opt_column_list? key_match? key_actions? + | opt_collate + ; + +nulls_distinct + : KW_NULLS KW_NOT? KW_DISTINCT + ; + +generated_when + : KW_ALWAYS + | KW_BY KW_DEFAULT + ; + +deferrable_trigger + : KW_DEFERRABLE + | KW_NOT KW_DEFERRABLE + ; + +initially_trigger + : KW_INITIALLY (KW_DEFERRED | KW_IMMEDIATE) + ; + +tablelikeclause + : KW_LIKE qualified_name tablelikeoptionlist + ; + +tablelikeoptionlist + : ((KW_INCLUDING | KW_EXCLUDING) tablelikeoption)* + ; + +tablelikeoption + : KW_COMMENTS + | KW_CONSTRAINTS + | KW_DEFAULTS + | KW_IDENTITY + | KW_GENERATED + | KW_INDEXES + | KW_STATISTICS + | KW_STORAGE + | KW_ALL + ; + +tableconstraint + : KW_CONSTRAINT name constraintelem + | constraintelem + ; + +constraintelem + : KW_CHECK OPEN_PAREN a_expr CLOSE_PAREN constraintattributespec + | KW_UNIQUE ( + OPEN_PAREN columnlist CLOSE_PAREN opt_c_include? opt_definition? optconstablespace? constraintattributespec + | existingindex constraintattributespec + ) + | KW_PRIMARY KW_KEY ( + OPEN_PAREN columnlist CLOSE_PAREN opt_c_include? opt_definition? optconstablespace? constraintattributespec + | existingindex constraintattributespec + ) + | KW_EXCLUDE access_method_clause? OPEN_PAREN exclusionconstraintlist CLOSE_PAREN opt_c_include? opt_definition? optconstablespace? + exclusionwhereclause? constraintattributespec + | KW_FOREIGN KW_KEY OPEN_PAREN columnlist CLOSE_PAREN KW_REFERENCES qualified_name opt_column_list? key_match? key_actions? + constraintattributespec + ; + +opt_no_inherit + : KW_NO KW_INHERIT + ; + +opt_column_list + : OPEN_PAREN columnlist CLOSE_PAREN + ; + +columnlist + : column_name (COMMA column_name)* + ; + +opt_c_include + : KW_INCLUDE OPEN_PAREN columnlist CLOSE_PAREN + ; + +key_match + : KW_MATCH (KW_FULL | KW_PARTIAL | KW_SIMPLE) + ; + +exclusionconstraintlist + : exclusionconstraintelem (COMMA exclusionconstraintelem)* + ; + +exclusionconstraintelem + : index_elem KW_WITH (any_operator | KW_OPERATOR OPEN_PAREN any_operator CLOSE_PAREN) + ; + +exclusionwhereclause + : KW_WHERE OPEN_PAREN a_expr CLOSE_PAREN + ; + +key_actions + : key_update + | key_delete + | key_update key_delete + | key_delete key_update + ; + +key_update + : KW_ON KW_UPDATE key_action + ; + +key_delete + : KW_ON KW_DELETE key_action + ; + +key_action + : KW_NO KW_ACTION + | KW_RESTRICT + | KW_CASCADE + | KW_SET (KW_NULL | KW_DEFAULT) columnlist? + ; + +optinherit + : KW_INHERITS OPEN_PAREN qualified_name_list CLOSE_PAREN + ; + +optpartitionspec + : partitionspec + ; + +partitionspec + : KW_PARTITION KW_BY colid OPEN_PAREN part_params CLOSE_PAREN + ; + +part_params + : part_elem (COMMA part_elem)* + ; + +part_elem + : column_name opt_collate? opt_class? + | func_expr_windowless opt_collate? opt_class? + | OPEN_PAREN a_expr CLOSE_PAREN opt_collate? opt_class? + ; + +table_access_method_clause + : KW_USING name + ; + +optwith + : KW_WITH reloptions + | KW_WITHOUT KW_OIDS + | KW_WITH KW_OIDS + ; + +oncommitoption + : KW_ON KW_COMMIT (KW_DROP | KW_DELETE KW_ROWS | KW_PRESERVE KW_ROWS) + ; + +opttablespace + : KW_TABLESPACE tablespace_name + ; + +index_paramenters_create + : opt_include? with_clause? optconstablespace? + ; + +optconstablespace + : KW_USING KW_INDEX KW_TABLESPACE tablespace_name + ; + +existingindex + : KW_USING KW_INDEX name + ; + +createstatsstmt + : KW_CREATE KW_STATISTICS (opt_if_not_exists? any_name)? opt_name_list? KW_ON ( + column_expr_list + | expr_list + ) KW_FROM from_list + ; + +alterstatsstmt + : KW_ALTER KW_STATISTICS opt_if_exists? any_name KW_SET KW_STATISTICS signediconst + ; + +createasstmt + : KW_CREATE opttemp? KW_TABLE opt_if_not_exists? create_as_target KW_AS selectstmt opt_with_data? + ; + +create_as_target + : table_name_create opt_column_list? table_access_method_clause? optwith? oncommitoption? opttablespace? + ; + +opt_with_data + : KW_WITH (KW_DATA | KW_NO KW_DATA) + ; + +creatematviewstmt + : KW_CREATE optnolog? KW_MATERIALIZED KW_VIEW opt_if_not_exists? create_mv_target KW_AS selectstmt opt_with_data? + ; + +create_mv_target + : view_name_create opt_column_list? table_access_method_clause? opt_reloptions? opttablespace? + ; + +optnolog + : KW_UNLOGGED + ; + +refreshmatviewstmt + : KW_REFRESH KW_MATERIALIZED KW_VIEW opt_concurrently? view_name opt_with_data? + ; + +createseqstmt + : KW_CREATE opttemp? KW_SEQUENCE opt_if_not_exists? qualified_name optseqoptlist? + ; + +alterseqstmt + : KW_ALTER KW_SEQUENCE opt_if_exists? qualified_name seqoptlist + ; + +optseqoptlist + : seqoptlist + ; + +optparenthesizedseqoptlist + : OPEN_PAREN seqoptlist CLOSE_PAREN + ; + +seqoptlist + : seqoptelem+ + ; + +seqoptelem + : KW_AS simpletypename + | KW_CACHE numericonly + | KW_CYCLE + | KW_INCREMENT opt_by? numericonly + | KW_MAXVALUE numericonly + | KW_MINVALUE numericonly + | KW_NO (KW_MAXVALUE | KW_MINVALUE | KW_CYCLE) + | KW_OWNED KW_BY table_column_name + | KW_SEQUENCE KW_NAME any_name + | KW_START opt_with? numericonly + | KW_RESTART opt_with? numericonly? + ; + +opt_by + : KW_BY + ; + +numericonly + : fconst + | PLUS fconst + | MINUS fconst + | signediconst + ; + +numericonly_list + : numericonly (COMMA numericonly)* + ; + +createplangstmt + : KW_CREATE opt_or_replace? opt_trusted? opt_procedural? KW_LANGUAGE name ( + KW_HANDLER handler_name opt_inline_handler? opt_validator? + )? + ; + +opt_trusted + : KW_TRUSTED + ; + +handler_name + : name attrs? + ; + +opt_inline_handler + : KW_INLINE handler_name + ; + +validator_clause + : KW_VALIDATOR handler_name + | KW_NO KW_VALIDATOR + ; + +opt_validator + : validator_clause + ; + +opt_procedural + : KW_PROCEDURAL + ; + +createtablespacestmt + : KW_CREATE KW_TABLESPACE tablespace_name opttablespaceowner? KW_LOCATION sconst opt_reloptions? + ; + +opttablespaceowner + : KW_OWNER rolespec + ; + +createextensionstmt + : KW_CREATE KW_EXTENSION opt_if_not_exists? name opt_with? create_extension_opt_list + ; + +create_extension_opt_list + : create_extension_opt_item* + ; + +create_extension_opt_item + : KW_SCHEMA schema_name + | KW_VERSION nonreservedword_or_sconst + | KW_FROM nonreservedword_or_sconst + | KW_CASCADE + ; + +alterextensionstmt + : KW_ALTER KW_EXTENSION name KW_UPDATE alter_extension_opt_list + ; + +alter_extension_opt_list + : alter_extension_opt_item* + ; + +alter_extension_opt_item + : KW_TO nonreservedword_or_sconst + ; + +alterextensioncontentsstmt + : KW_ALTER KW_EXTENSION name add_drop object_type_name + | KW_ALTER KW_EXTENSION name add_drop object_type_any_name + | KW_ALTER KW_EXTENSION name add_drop KW_AGGREGATE aggregate_with_argtypes + | KW_ALTER KW_EXTENSION name add_drop KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN + | KW_ALTER KW_EXTENSION name add_drop KW_DOMAIN typename + | KW_ALTER KW_EXTENSION name add_drop KW_FUNCTION function_with_argtypes + | KW_ALTER KW_EXTENSION name add_drop KW_OPERATOR operator_with_argtypes + | KW_ALTER KW_EXTENSION name add_drop KW_OPERATOR KW_CLASS any_name KW_USING name + | KW_ALTER KW_EXTENSION name add_drop KW_OPERATOR KW_FAMILY any_name KW_USING name + | KW_ALTER KW_EXTENSION name add_drop KW_PROCEDURE procedure_with_argtypes + | KW_ALTER KW_EXTENSION name add_drop KW_ROUTINE routine_with_argtypes + | KW_ALTER KW_EXTENSION name add_drop KW_TRANSFORM KW_FOR typename KW_LANGUAGE name + | KW_ALTER KW_EXTENSION name add_drop KW_TYPE typename + ; + +createfdwstmt + : KW_CREATE KW_FOREIGN KW_DATA KW_WRAPPER name opt_fdw_options? create_generic_options? + ; + +fdw_option + : KW_HANDLER handler_name + | KW_NO KW_HANDLER + | KW_VALIDATOR handler_name + | KW_NO KW_VALIDATOR + ; + +fdw_options + : fdw_option+ + ; + +opt_fdw_options + : fdw_options + ; + +alterfdwstmt + : KW_ALTER KW_FOREIGN KW_DATA KW_WRAPPER name opt_fdw_options? alter_generic_options + | KW_ALTER KW_FOREIGN KW_DATA KW_WRAPPER name fdw_options + ; + +create_generic_options + : KW_OPTIONS OPEN_PAREN generic_option_list CLOSE_PAREN + ; + +generic_option_list + : generic_option_elem (COMMA generic_option_elem)* + ; + +alter_generic_options + : KW_OPTIONS OPEN_PAREN alter_generic_option_list CLOSE_PAREN + ; + +alter_generic_option_list + : alter_generic_option_elem (COMMA alter_generic_option_elem)* + ; + +alter_generic_option_elem + : generic_option_elem + | KW_SET generic_option_elem + | KW_ADD generic_option_elem + | KW_DROP generic_option_elem + ; + +generic_option_elem + : generic_option_name generic_option_arg + ; + +generic_option_name + : collabel + ; + +generic_option_arg + : sconst + ; + +createforeignserverstmt + : KW_CREATE KW_SERVER opt_if_not_exists? name opt_type? opt_foreign_server_version? KW_FOREIGN KW_DATA KW_WRAPPER name create_generic_options? + ; + +opt_type + : KW_TYPE sconst + ; + +foreign_server_version + : KW_VERSION (sconst | KW_NULL) + ; + +opt_foreign_server_version + : foreign_server_version + ; + +alterforeignserverstmt + : KW_ALTER KW_SERVER name ( + alter_generic_options + | foreign_server_version alter_generic_options? + ) + ; + +createforeigntablestmt + : KW_CREATE KW_FOREIGN KW_TABLE opt_if_not_exists? table_name_create OPEN_PAREN opttableelementlist? CLOSE_PAREN optinherit? KW_SERVER name + create_generic_options? + | KW_CREATE KW_FOREIGN KW_TABLE opt_if_not_exists? table_name_create KW_PARTITION KW_OF table_name opttypedtableelementlist? partitionboundspec + KW_SERVER name create_generic_options? + ; + +importforeignschemastmt + : KW_IMPORT KW_FOREIGN KW_SCHEMA schema_name import_qualification? KW_FROM KW_SERVER name KW_INTO name create_generic_options? + ; + +import_qualification_type + : KW_LIMIT KW_TO + | KW_EXCEPT + ; + +import_qualification + : import_qualification_type OPEN_PAREN relation_expr_list CLOSE_PAREN + ; + +createusermappingstmt + : KW_CREATE KW_USER KW_MAPPING opt_if_not_exists? KW_FOR auth_ident KW_SERVER name create_generic_options? + ; + +auth_ident + : rolespec + | KW_USER + ; + +alterusermappingstmt + : KW_ALTER KW_USER KW_MAPPING KW_FOR auth_ident KW_SERVER name alter_generic_options + ; + +createpolicystmt + : KW_CREATE KW_POLICY name KW_ON qualified_name rowsecuritydefaultpermissive? rowsecuritydefaultforcmd? rowsecuritydefaulttorole? + rowsecurityoptionalexpr? rowsecurityoptionalwithcheck? + ; + +alterpolicystmt + : KW_ALTER KW_POLICY name KW_ON qualified_name rowsecurityoptionaltorole? rowsecurityoptionalexpr? rowsecurityoptionalwithcheck? + ; + +alterprocedurestmt + : KW_ALTER KW_PROCEDURE procedure_name func_args? procedure_cluase + ; + +procedure_cluase + : procedure_action (procedure_action)* KW_RESTRICT? + | KW_RENAME KW_TO procedure_name_create + | KW_OWNER KW_TO rolespec + | KW_SET KW_SCHEMA schema_name_create + | KW_NO? KW_DEPENDS KW_ON KW_EXTENSION name + ; + +procedure_action + : (KW_EXTERNAL? KW_SECURITY KW_INVOKER | KW_EXTERNAL? KW_SECURITY KW_DEFINER) + | KW_SET name (KW_TO | STAR) (name | KW_DEFAULT) | KW_SET name KW_FROM KW_CURRENT | KW_RESET name - | KW_RESET KW_ALL; + | KW_RESET KW_ALL + ; + +rowsecurityoptionalexpr + : KW_USING OPEN_PAREN a_expr CLOSE_PAREN + ; + +rowsecurityoptionalwithcheck + : KW_WITH KW_CHECK OPEN_PAREN a_expr CLOSE_PAREN + ; + +rowsecuritydefaulttorole + : KW_TO role_list + ; + +rowsecurityoptionaltorole + : KW_TO role_list + ; + +rowsecuritydefaultpermissive + : KW_AS (KW_PERMISSIVE | KW_RESTRICTIVE | identifier) + ; + +rowsecuritydefaultforcmd + : KW_FOR row_security_cmd + ; + +row_security_cmd + : KW_ALL + | KW_SELECT + | KW_INSERT + | KW_UPDATE + | KW_DELETE + ; + +createamstmt + : KW_CREATE KW_ACCESS KW_METHOD name KW_TYPE am_type KW_HANDLER handler_name + ; + +am_type + : KW_INDEX + | KW_TABLE + ; + +createtrigstmt + : KW_CREATE opt_or_replace? KW_TRIGGER name triggeractiontime triggerevents KW_ON table_name triggerreferencing? triggerforspec? triggerwhen? + KW_EXECUTE function_or_procedure OPEN_PAREN triggerfuncargs CLOSE_PAREN + | KW_CREATE opt_or_replace? KW_CONSTRAINT? KW_TRIGGER name triggeractiontime triggerevents KW_ON table_name optconstrfromtable? + constraintattributespec foreachrow? triggerwhen? KW_EXECUTE function_or_procedure OPEN_PAREN triggerfuncargs CLOSE_PAREN + ; + +triggeractiontime + : KW_BEFORE + | KW_AFTER + | KW_INSTEAD KW_OF + ; + +foreachrow + : KW_FOR KW_EACH? roworstatment + ; + +roworstatment + : KW_ROW + | KW_STATEMENT + ; + +triggerevents + : triggeroneevent (KW_OR triggeroneevent)* + ; + +triggeroneevent + : KW_INSERT + | KW_DELETE + | KW_UPDATE + | KW_UPDATE KW_OF columnlist + | KW_TRUNCATE + ; + +triggerreferencing + : KW_REFERENCING triggertransitions + ; + +triggertransitions + : triggertransition+ + ; + +triggertransition + : transitionoldornew transitionrowortable opt_as? transitionrelname + ; + +transitionoldornew + : KW_NEW + | KW_OLD + ; + +transitionrowortable + : KW_TABLE + | KW_ROW + ; + +transitionrelname + : colid + ; + +triggerforspec + : KW_FOR triggerforopteach? triggerfortype + ; + +triggerforopteach + : KW_EACH + ; + +triggerfortype + : KW_ROW + | KW_STATEMENT + ; + +triggerwhen + : KW_WHEN OPEN_PAREN a_expr CLOSE_PAREN + ; + +function_or_procedure + : KW_FUNCTION function_name + | KW_PROCEDURE procedure_name + ; + +triggerfuncargs + : (triggerfuncarg |) (COMMA triggerfuncarg)* + ; + +triggerfuncarg + : iconst + | fconst + | sconst + | collabel + ; + +optconstrfromtable + : KW_FROM qualified_name + ; + +constraintattributespec + : constraintattributeElem* + ; + +constraintattributeElem + : KW_NOT KW_DEFERRABLE + | KW_DEFERRABLE + | KW_INITIALLY KW_IMMEDIATE + | KW_INITIALLY KW_DEFERRED + | KW_NOT KW_VALID + | KW_NO KW_INHERIT + ; + +createeventtrigstmt + : KW_CREATE KW_EVENT KW_TRIGGER name KW_ON collabel KW_EXECUTE function_or_procedure OPEN_PAREN CLOSE_PAREN + | KW_CREATE KW_EVENT KW_TRIGGER name KW_ON collabel KW_WHEN event_trigger_when_list KW_EXECUTE function_or_procedure OPEN_PAREN CLOSE_PAREN + ; + +event_trigger_when_list + : event_trigger_when_item (KW_AND event_trigger_when_item)* + ; + +event_trigger_when_item + : colid KW_IN OPEN_PAREN event_trigger_value_list CLOSE_PAREN + ; + +event_trigger_value_list + : sconst (COMMA sconst)* + ; + +altereventtrigstmt + : KW_ALTER KW_EVENT KW_TRIGGER name enable_trigger + ; + +enable_trigger + : KW_ENABLE + | KW_ENABLE KW_REPLICA + | KW_ENABLE KW_ALWAYS + | KW_DISABLE + ; + +createassertionstmt + : KW_CREATE KW_ASSERTION any_name KW_CHECK OPEN_PAREN a_expr CLOSE_PAREN constraintattributespec + ; + +definestmt + : KW_CREATE opt_or_replace? KW_AGGREGATE function_name aggr_args definition + | KW_CREATE opt_or_replace? KW_AGGREGATE function_name old_aggr_definition + | KW_CREATE KW_OPERATOR any_operator definition + | KW_CREATE KW_TYPE any_name definition + | KW_CREATE KW_TYPE any_name + | KW_CREATE KW_TYPE any_name KW_AS OPEN_PAREN opttablefuncelementlist? CLOSE_PAREN + | KW_CREATE KW_TYPE any_name KW_AS KW_ENUM OPEN_PAREN opt_enum_val_list? CLOSE_PAREN + | KW_CREATE KW_TYPE any_name KW_AS KW_RANGE definition + | KW_CREATE KW_TEXT KW_SEARCH KW_PARSER any_name definition + | KW_CREATE KW_TEXT KW_SEARCH KW_DICTIONARY any_name definition + | KW_CREATE KW_TEXT KW_SEARCH KW_TEMPLATE any_name definition + | KW_CREATE KW_TEXT KW_SEARCH KW_CONFIGURATION any_name definition + | KW_CREATE KW_COLLATION opt_if_not_exists? any_name definition + | KW_CREATE KW_COLLATION opt_if_not_exists? any_name KW_FROM any_name + ; + +definition + : OPEN_PAREN def_list CLOSE_PAREN + ; + +def_list + : def_elem (COMMA def_elem)* + ; + +def_elem + : collabel (EQUAL def_arg)? + ; + +def_arg + : func_type + | reserved_keyword + | qual_all_op + | numericonly + | sconst + | KW_NONE + ; + +old_aggr_definition + : OPEN_PAREN old_aggr_list CLOSE_PAREN + ; + +old_aggr_list + : old_aggr_elem (COMMA old_aggr_elem)* + ; + +old_aggr_elem + : identifier EQUAL def_arg + ; + +opt_enum_val_list + : enum_val_list + ; + +enum_val_list + : sconst (COMMA sconst)* + ; + +alterenumstmt + : KW_ALTER KW_TYPE any_name KW_ADD KW_VALUE opt_if_not_exists? sconst + | KW_ALTER KW_TYPE any_name KW_ADD KW_VALUE opt_if_not_exists? sconst KW_BEFORE sconst + | KW_ALTER KW_TYPE any_name KW_ADD KW_VALUE opt_if_not_exists? sconst KW_AFTER sconst + | KW_ALTER KW_TYPE any_name KW_RENAME KW_VALUE sconst KW_TO sconst + ; + +opt_if_not_exists + : KW_IF KW_NOT KW_EXISTS + ; + +createopclassstmt + : KW_CREATE KW_OPERATOR KW_CLASS any_name opt_default? KW_FOR KW_TYPE typename KW_USING name opt_opfamily? KW_AS opclass_item_list + ; + +opclass_item_list + : opclass_item (COMMA opclass_item)* + ; + +opclass_item + : KW_OPERATOR iconst any_operator opclass_purpose? opt_recheck? + | KW_OPERATOR iconst operator_with_argtypes opclass_purpose? opt_recheck? + | KW_FUNCTION iconst function_with_argtypes + | KW_FUNCTION iconst OPEN_PAREN type_list CLOSE_PAREN function_with_argtypes + | KW_STORAGE typename + ; + +opt_default + : KW_DEFAULT + ; + +opt_opfamily + : KW_FAMILY any_name + ; + +opclass_purpose + : KW_FOR KW_SEARCH + | KW_FOR KW_ORDER KW_BY any_name + ; + +opt_recheck + : KW_RECHECK + ; + +createopfamilystmt + : KW_CREATE KW_OPERATOR KW_FAMILY any_name KW_USING name + ; + +alteropfamilystmt + : KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_ADD opclass_item_list + | KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_DROP opclass_drop_list + ; + +opclass_drop_list + : opclass_drop (COMMA opclass_drop)* + ; + +opclass_drop + : KW_OPERATOR iconst OPEN_PAREN type_list CLOSE_PAREN + | KW_FUNCTION iconst OPEN_PAREN type_list CLOSE_PAREN + ; + +reassignownedstmt + : KW_REASSIGN KW_OWNED KW_BY role_list KW_TO rolespec + ; + +dropstmt + : KW_DROP KW_TABLE opt_if_exists? table_name_list opt_drop_behavior? + | KW_DROP KW_SEQUENCE opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_VIEW opt_if_exists? view_nameList opt_drop_behavior? + | KW_DROP KW_MATERIALIZED KW_VIEW opt_if_exists? view_nameList opt_drop_behavior? + | KW_DROP KW_INDEX opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_FOREIGN KW_TABLE opt_if_exists? table_name_list opt_drop_behavior? + | KW_DROP KW_COLLATION opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_CONVERSION opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_STATISTICS opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_TEXT KW_SEARCH KW_PARSER opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_TEXT KW_SEARCH KW_DICTIONARY opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_TEXT KW_SEARCH KW_TEMPLATE opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_TEXT KW_SEARCH KW_CONFIGURATION opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_ACCESS KW_METHOD opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_EVENT KW_TRIGGER opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_EXTENSION opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_FOREIGN KW_DATA KW_WRAPPER opt_if_exists? name_list opt_drop_behavior? + | KW_DROP opt_procedural? KW_LANGUAGE opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_PUBLICATION opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_SERVER opt_if_exists? name_list opt_drop_behavior? + | KW_DROP KW_SCHEMA opt_if_exists? schema_name_list opt_drop_behavior? + | KW_DROP KW_POLICY opt_if_exists? name KW_ON any_name opt_drop_behavior? + | KW_DROP KW_RULE opt_if_exists? name KW_ON any_name opt_drop_behavior? + | KW_DROP KW_TRIGGER opt_if_exists? name KW_ON any_name opt_drop_behavior? + | KW_DROP KW_TYPE opt_if_exists? type_name_list opt_drop_behavior? + | KW_DROP KW_DOMAIN opt_if_exists? type_name_list opt_drop_behavior? + | KW_DROP KW_INDEX KW_CONCURRENTLY opt_if_exists? any_name_list opt_drop_behavior? + | KW_DROP KW_CAST opt_if_exists? OPEN_PAREN typename KW_AS typename CLOSE_PAREN opt_drop_behavior? + | KW_DROP KW_OPERATOR KW_CLASS opt_if_exists? any_name KW_USING name opt_drop_behavior? + | KW_DROP KW_OPERATOR KW_FAMILY opt_if_exists? any_name KW_USING name opt_drop_behavior? + | KW_DROP KW_OWNED KW_BY role_list opt_drop_behavior? + | KW_DROP KW_VIEW opt_if_exists? view_nameList opt_drop_behavior? + | KW_DROP KW_SUBSCRIPTION opt_if_exists? name opt_drop_behavior? + | KW_DROP KW_TABLESPACE opt_if_exists? tablespace_name + | KW_DROP KW_TRANSFORM opt_if_exists? KW_FOR typename KW_LANGUAGE name opt_drop_behavior? + | KW_DROP (KW_ROLE | KW_USER | KW_GROUP) opt_if_exists? role_list + | KW_DROP KW_USER KW_MAPPING opt_if_exists? KW_FOR auth_ident KW_SERVER name + | KW_DROP KW_DATABASE opt_if_exists? database_name ( + opt_with? OPEN_PAREN drop_option_list CLOSE_PAREN + )? + ; + +view_nameList + : view_name (COMMA view_name)* + ; + +object_type_any_name + : KW_TABLE table_name + | KW_SEQUENCE any_name + | KW_VIEW view_name + | KW_MATERIALIZED KW_VIEW view_name + | KW_INDEX any_name + | KW_FOREIGN KW_TABLE table_name + | KW_COLLATION any_name + | KW_CONVERSION any_name + | KW_STATISTICS any_name + | KW_TEXT KW_SEARCH KW_PARSER any_name + | KW_TEXT KW_SEARCH KW_DICTIONARY any_name + | KW_TEXT KW_SEARCH KW_TEMPLATE any_name + | KW_TEXT KW_SEARCH KW_CONFIGURATION any_name + ; + +object_type_name + : (KW_ACCESS KW_METHOD name) + | (KW_EVENT KW_TRIGGER name) + | (KW_EXTENSION name) + | (KW_FOREIGN KW_DATA KW_WRAPPER name) + | (opt_procedural? KW_LANGUAGE name) + | (KW_PUBLICATION name) + | (KW_SCHEMA schema_name) + | (KW_SERVER name) + | (KW_DATABASE database_name) + | (KW_ROLE name) + | (KW_SUBSCRIPTION name) + | (KW_TABLESPACE tablespace_name) + ; + +object_type_name_on_any_name + : KW_POLICY + | KW_RULE + | KW_TRIGGER + ; + +any_name_list + : any_name (COMMA any_name)* + ; + +table_column_name + : table_name DOT column_name + ; + +relation_column_name + : relation_name DOT column_name + ; + +relation_name + : colid attrs? + ; + +any_name + : colid attrs? + ; + +attrs + : (DOT attr_name)+ + ; + +type_name_list + : typename (COMMA typename)* + ; + +truncatestmt + : KW_TRUNCATE opt_table? relation_expr_list opt_restart_seqs? opt_drop_behavior? + ; + +opt_restart_seqs + : KW_CONTINUE KW_IDENTITY + | KW_RESTART KW_IDENTITY + ; + +commentstmt + : KW_COMMENT KW_ON object_type_any_name KW_IS comment_text + | KW_COMMENT KW_ON KW_COLUMN relation_column_name KW_IS comment_text + | KW_COMMENT KW_ON object_type_name KW_IS comment_text + | KW_COMMENT KW_ON KW_TYPE typename KW_IS comment_text + | KW_COMMENT KW_ON KW_DOMAIN typename KW_IS comment_text + | KW_COMMENT KW_ON KW_AGGREGATE aggregate_with_argtypes KW_IS comment_text + | KW_COMMENT KW_ON KW_FUNCTION function_with_argtypes KW_IS comment_text + | KW_COMMENT KW_ON KW_OPERATOR operator_with_argtypes KW_IS comment_text + | KW_COMMENT KW_ON KW_CONSTRAINT name KW_ON table_name KW_IS comment_text + | KW_COMMENT KW_ON KW_CONSTRAINT name KW_ON KW_DOMAIN? any_name KW_IS comment_text + | KW_COMMENT KW_ON KW_POLICY name KW_ON any_name KW_IS comment_text + | KW_COMMENT KW_ON KW_RULE name KW_ON any_name KW_IS comment_text + | KW_COMMENT KW_ON KW_TRIGGER name KW_ON any_name KW_IS comment_text + | KW_COMMENT KW_ON KW_PROCEDURE procedure_with_argtypes KW_IS comment_text + | KW_COMMENT KW_ON KW_ROUTINE routine_with_argtypes KW_IS comment_text + | KW_COMMENT KW_ON KW_TRANSFORM KW_FOR typename KW_LANGUAGE name KW_IS comment_text + | KW_COMMENT KW_ON KW_OPERATOR KW_CLASS any_name KW_USING name KW_IS comment_text + | KW_COMMENT KW_ON KW_OPERATOR KW_FAMILY any_name KW_USING name KW_IS comment_text + | KW_COMMENT KW_ON KW_LARGE KW_OBJECT numericonly KW_IS comment_text + | KW_COMMENT KW_ON KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN KW_IS comment_text + ; + +comment_text + : sconst + | KW_NULL + ; + +seclabelstmt + : KW_SECURITY KW_LABEL opt_provider? KW_ON object_type_any_name KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_COLUMN table_column_name KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON object_type_name KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_TYPE typename KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_DOMAIN typename KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_AGGREGATE aggregate_with_argtypes KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_FUNCTION function_with_argtypes KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_LARGE KW_OBJECT numericonly KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_PROCEDURE procedure_with_argtypes KW_IS security_label + | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_ROUTINE routine_with_argtypes KW_IS security_label + ; + +opt_provider + : KW_FOR nonreservedword_or_sconst + ; + +security_label + : sconst + | KW_NULL + ; + +fetchstmt + : KW_FETCH fetch_args + | KW_MOVE fetch_args + ; + +fetch_args + : cursor_name + | from_in cursor_name + | KW_NEXT opt_from_in? cursor_name + | KW_PRIOR opt_from_in? cursor_name + | KW_FIRST opt_from_in? cursor_name + | KW_LAST opt_from_in? cursor_name + | KW_ABSOLUTE signediconst opt_from_in? cursor_name + | KW_RELATIVE signediconst opt_from_in? cursor_name + | signediconst opt_from_in? cursor_name + | KW_ALL opt_from_in? cursor_name + | KW_FORWARD opt_from_in? cursor_name + | KW_FORWARD signediconst opt_from_in? cursor_name + | KW_FORWARD KW_ALL opt_from_in? cursor_name + | KW_BACKWARD opt_from_in? cursor_name + | KW_BACKWARD signediconst opt_from_in? cursor_name + | KW_BACKWARD KW_ALL opt_from_in? cursor_name + ; + +from_in + : KW_FROM + | KW_IN + ; + +opt_from_in + : from_in + ; + +grantstmt + : KW_GRANT privileges KW_ON privilege_target KW_TO grantee_list opt_grant_grant_option? + ; + +revokestmt + : KW_REVOKE privileges KW_ON privilege_target KW_FROM grantee_list opt_drop_behavior? + | KW_REVOKE KW_GRANT KW_OPTION KW_FOR privileges KW_ON privilege_target KW_FROM grantee_list opt_drop_behavior? + ; + +privileges + : privilege_list + | KW_ALL + | KW_ALL KW_PRIVILEGES + | KW_ALL OPEN_PAREN columnlist CLOSE_PAREN + | KW_ALL KW_PRIVILEGES OPEN_PAREN columnlist CLOSE_PAREN + | beforeprivilegeselectlist + ; + +beforeprivilegeselectlist + : beforeprivilegeselect (COMMA beforeprivilegeselect)* + ; + +beforeprivilegeselect + : KW_SELECT + | KW_INSERT + | KW_UPDATE + | KW_DELETE + | KW_TRUNCATE + | KW_PEFERENCES + | KW_TRIGGER + | KW_USAGE + | KW_CREATE + | KW_CONNECT + | KW_TEMPORARY + | KW_TEMP + | KW_EXECUTE + ; + +privilege_list + : privilege (COMMA privilege)* + ; + +privilege + : KW_SELECT opt_column_list? + | KW_REFERENCES opt_column_list? + | KW_CREATE opt_column_list? + | colid opt_column_list? + ; + +privilege_target + : qualified_name_list + | KW_TABLE table_name_list + | KW_SEQUENCE qualified_name_list + | KW_FOREIGN KW_DATA KW_WRAPPER name_list + | KW_FOREIGN KW_SERVER name_list + | KW_FUNCTION function_with_argtypes_list + | KW_PROCEDURE procedure_with_argtypes_list + | KW_ROUTINE routine_with_argtypes_list + | KW_DATABASE database_nameList + | KW_DOMAIN any_name_list + | KW_LANGUAGE name_list + | KW_LARGE KW_OBJECT numericonly_list + | KW_SCHEMA schema_name_list + | KW_TABLESPACE tablespace_name_list + | KW_TYPE any_name_list + | KW_ALL KW_TABLES KW_IN KW_SCHEMA schema_name_list + | KW_ALL KW_SEQUENCES KW_IN KW_SCHEMA schema_name_list + | KW_ALL KW_FUNCTIONS KW_IN KW_SCHEMA schema_name_list + | KW_ALL KW_PROCEDURES KW_IN KW_SCHEMA schema_name_list + | KW_ALL KW_ROUTINES KW_IN KW_SCHEMA schema_name_list + ; + +grantee_list + : grantee (COMMA grantee)* + ; + +grantee + : rolespec + | KW_GROUP rolespec + ; + +opt_grant_grant_option + : KW_WITH KW_GRANT KW_OPTION + ; + +grantrolestmt + : KW_GRANT privilege_list KW_TO role_list opt_grant_admin_option? opt_granted_by? + ; + +revokerolestmt + : KW_REVOKE privilege_list KW_FROM role_list opt_granted_by? opt_drop_behavior? + | KW_REVOKE KW_ADMIN KW_OPTION KW_FOR privilege_list KW_FROM role_list opt_granted_by? opt_drop_behavior? + ; + +opt_grant_admin_option + : KW_WITH KW_ADMIN KW_OPTION + ; + +opt_granted_by + : KW_GRANTED KW_BY rolespec + ; + +alterdefaultprivilegesstmt + : KW_ALTER KW_DEFAULT KW_PRIVILEGES defacloptionlist defaclaction + ; + +defacloptionlist + : defacloption* + ; + +defacloption + : KW_IN KW_SCHEMA schema_name_list + | KW_FOR KW_ROLE role_list + | KW_FOR KW_USER role_list + ; + +defaclaction + : KW_GRANT privileges KW_ON defacl_privilege_target KW_TO grantee_list opt_grant_grant_option? + | KW_REVOKE privileges KW_ON defacl_privilege_target KW_FROM grantee_list opt_drop_behavior? + | KW_REVOKE KW_GRANT KW_OPTION KW_FOR privileges KW_ON defacl_privilege_target KW_FROM grantee_list opt_drop_behavior? + ; + +defacl_privilege_target + : KW_TABLES + | KW_FUNCTIONS + | KW_ROUTINES + | KW_SEQUENCES + | KW_TYPES + | KW_SCHEMAS + ; -rowsecurityoptionalexpr: KW_USING OPEN_PAREN a_expr CLOSE_PAREN; - -rowsecurityoptionalwithcheck: - KW_WITH KW_CHECK OPEN_PAREN a_expr CLOSE_PAREN; - -rowsecuritydefaulttorole: KW_TO role_list; - -rowsecurityoptionaltorole: KW_TO role_list; - -rowsecuritydefaultpermissive: KW_AS (KW_PERMISSIVE | KW_RESTRICTIVE |identifier); - -rowsecuritydefaultforcmd: KW_FOR row_security_cmd; - -row_security_cmd: KW_ALL | KW_SELECT | KW_INSERT | KW_UPDATE | KW_DELETE; - -createamstmt: - KW_CREATE KW_ACCESS KW_METHOD name KW_TYPE am_type KW_HANDLER handler_name; - -am_type: KW_INDEX | KW_TABLE; - -createtrigstmt: - KW_CREATE opt_or_replace? KW_TRIGGER name triggeractiontime triggerevents KW_ON table_name triggerreferencing? - triggerforspec? triggerwhen? KW_EXECUTE function_or_procedure OPEN_PAREN - triggerfuncargs CLOSE_PAREN - | KW_CREATE opt_or_replace? KW_CONSTRAINT? KW_TRIGGER name triggeractiontime triggerevents KW_ON table_name optconstrfromtable? - constraintattributespec foreachrow? triggerwhen? KW_EXECUTE function_or_procedure - OPEN_PAREN triggerfuncargs CLOSE_PAREN; - -triggeractiontime: KW_BEFORE | KW_AFTER | KW_INSTEAD KW_OF; - -foreachrow: KW_FOR KW_EACH? roworstatment; - -roworstatment: KW_ROW | KW_STATEMENT; - -triggerevents: triggeroneevent (KW_OR triggeroneevent)*; - -triggeroneevent: - KW_INSERT - | KW_DELETE - | KW_UPDATE - | KW_UPDATE KW_OF columnlist - | KW_TRUNCATE; - -triggerreferencing: KW_REFERENCING triggertransitions; - -triggertransitions: triggertransition+; - -triggertransition: - transitionoldornew transitionrowortable opt_as? transitionrelname; - -transitionoldornew: KW_NEW | KW_OLD; - -transitionrowortable: KW_TABLE | KW_ROW; - -transitionrelname: colid; - -triggerforspec: KW_FOR triggerforopteach? triggerfortype; - -triggerforopteach: KW_EACH; - -triggerfortype: KW_ROW | KW_STATEMENT; - -triggerwhen: KW_WHEN OPEN_PAREN a_expr CLOSE_PAREN; - -function_or_procedure: KW_FUNCTION function_name | KW_PROCEDURE procedure_name; - -triggerfuncargs: (triggerfuncarg |) (COMMA triggerfuncarg)*; - -triggerfuncarg: iconst | fconst | sconst | collabel; - -optconstrfromtable: KW_FROM qualified_name; - -constraintattributespec: constraintattributeElem*; - -constraintattributeElem: - KW_NOT KW_DEFERRABLE - | KW_DEFERRABLE - | KW_INITIALLY KW_IMMEDIATE - | KW_INITIALLY KW_DEFERRED - | KW_NOT KW_VALID - | KW_NO KW_INHERIT; - -createeventtrigstmt: - KW_CREATE KW_EVENT KW_TRIGGER name KW_ON collabel KW_EXECUTE function_or_procedure OPEN_PAREN - CLOSE_PAREN - | KW_CREATE KW_EVENT KW_TRIGGER name KW_ON collabel KW_WHEN event_trigger_when_list KW_EXECUTE - function_or_procedure OPEN_PAREN CLOSE_PAREN; - -event_trigger_when_list: - event_trigger_when_item (KW_AND event_trigger_when_item)*; - -event_trigger_when_item: - colid KW_IN OPEN_PAREN event_trigger_value_list CLOSE_PAREN; - -event_trigger_value_list: sconst (COMMA sconst)*; - -altereventtrigstmt: KW_ALTER KW_EVENT KW_TRIGGER name enable_trigger; - -enable_trigger: - KW_ENABLE - | KW_ENABLE KW_REPLICA - | KW_ENABLE KW_ALWAYS - | KW_DISABLE; - -createassertionstmt: - KW_CREATE KW_ASSERTION any_name KW_CHECK OPEN_PAREN a_expr CLOSE_PAREN constraintattributespec; - -definestmt: - KW_CREATE opt_or_replace? KW_AGGREGATE function_name aggr_args definition - | KW_CREATE opt_or_replace? KW_AGGREGATE function_name old_aggr_definition - | KW_CREATE KW_OPERATOR any_operator definition - | KW_CREATE KW_TYPE any_name definition - | KW_CREATE KW_TYPE any_name - | KW_CREATE KW_TYPE any_name KW_AS OPEN_PAREN opttablefuncelementlist? CLOSE_PAREN - | KW_CREATE KW_TYPE any_name KW_AS KW_ENUM OPEN_PAREN opt_enum_val_list? CLOSE_PAREN - | KW_CREATE KW_TYPE any_name KW_AS KW_RANGE definition - | KW_CREATE KW_TEXT KW_SEARCH KW_PARSER any_name definition - | KW_CREATE KW_TEXT KW_SEARCH KW_DICTIONARY any_name definition - | KW_CREATE KW_TEXT KW_SEARCH KW_TEMPLATE any_name definition - | KW_CREATE KW_TEXT KW_SEARCH KW_CONFIGURATION any_name definition - | KW_CREATE KW_COLLATION opt_if_not_exists? any_name definition - | KW_CREATE KW_COLLATION opt_if_not_exists? any_name KW_FROM any_name; - -definition: OPEN_PAREN def_list CLOSE_PAREN; - -def_list: def_elem (COMMA def_elem)*; - -def_elem: collabel (EQUAL def_arg)?; - -def_arg: - func_type - | reserved_keyword - | qual_all_op - | numericonly - | sconst - | KW_NONE; - -old_aggr_definition: OPEN_PAREN old_aggr_list CLOSE_PAREN; - -old_aggr_list: old_aggr_elem (COMMA old_aggr_elem)*; - -old_aggr_elem: identifier EQUAL def_arg; - -opt_enum_val_list: enum_val_list; - -enum_val_list: sconst (COMMA sconst)*; - -alterenumstmt: - KW_ALTER KW_TYPE any_name KW_ADD KW_VALUE opt_if_not_exists? sconst - | KW_ALTER KW_TYPE any_name KW_ADD KW_VALUE opt_if_not_exists? sconst KW_BEFORE sconst - | KW_ALTER KW_TYPE any_name KW_ADD KW_VALUE opt_if_not_exists? sconst KW_AFTER sconst - | KW_ALTER KW_TYPE any_name KW_RENAME KW_VALUE sconst KW_TO sconst; - -opt_if_not_exists: KW_IF KW_NOT KW_EXISTS; - -createopclassstmt: - KW_CREATE KW_OPERATOR KW_CLASS any_name opt_default? KW_FOR KW_TYPE typename KW_USING name opt_opfamily? KW_AS - opclass_item_list; - -opclass_item_list: opclass_item (COMMA opclass_item)*; - -opclass_item: - KW_OPERATOR iconst any_operator opclass_purpose? opt_recheck? - | KW_OPERATOR iconst operator_with_argtypes opclass_purpose? opt_recheck? - | KW_FUNCTION iconst function_with_argtypes - | KW_FUNCTION iconst OPEN_PAREN type_list CLOSE_PAREN function_with_argtypes - | KW_STORAGE typename; - -opt_default: KW_DEFAULT; - -opt_opfamily: KW_FAMILY any_name; - -opclass_purpose: KW_FOR KW_SEARCH | KW_FOR KW_ORDER KW_BY any_name; - -opt_recheck: KW_RECHECK; - -createopfamilystmt: KW_CREATE KW_OPERATOR KW_FAMILY any_name KW_USING name; - -alteropfamilystmt: - KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_ADD opclass_item_list - | KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_DROP opclass_drop_list; - -opclass_drop_list: opclass_drop (COMMA opclass_drop)*; - -opclass_drop: - KW_OPERATOR iconst OPEN_PAREN type_list CLOSE_PAREN - | KW_FUNCTION iconst OPEN_PAREN type_list CLOSE_PAREN; - -reassignownedstmt: KW_REASSIGN KW_OWNED KW_BY role_list KW_TO rolespec; - -dropstmt: - KW_DROP KW_TABLE opt_if_exists? table_name_list opt_drop_behavior? - | KW_DROP KW_SEQUENCE opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_VIEW opt_if_exists? view_nameList opt_drop_behavior? - | KW_DROP KW_MATERIALIZED KW_VIEW opt_if_exists? view_nameList opt_drop_behavior? - | KW_DROP KW_INDEX opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_FOREIGN KW_TABLE opt_if_exists? table_name_list opt_drop_behavior? - | KW_DROP KW_COLLATION opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_CONVERSION opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_STATISTICS opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_TEXT KW_SEARCH KW_PARSER opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_TEXT KW_SEARCH KW_DICTIONARY opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_TEXT KW_SEARCH KW_TEMPLATE opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_TEXT KW_SEARCH KW_CONFIGURATION opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_ACCESS KW_METHOD opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_EVENT KW_TRIGGER opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_EXTENSION opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_FOREIGN KW_DATA KW_WRAPPER opt_if_exists? name_list opt_drop_behavior? - | KW_DROP opt_procedural? KW_LANGUAGE opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_PUBLICATION opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_SERVER opt_if_exists? name_list opt_drop_behavior? - | KW_DROP KW_SCHEMA opt_if_exists? schema_name_list opt_drop_behavior? - | KW_DROP KW_POLICY opt_if_exists? name KW_ON any_name opt_drop_behavior? - | KW_DROP KW_RULE opt_if_exists? name KW_ON any_name opt_drop_behavior? - | KW_DROP KW_TRIGGER opt_if_exists? name KW_ON any_name opt_drop_behavior? - | KW_DROP KW_TYPE opt_if_exists? type_name_list opt_drop_behavior? - | KW_DROP KW_DOMAIN opt_if_exists? type_name_list opt_drop_behavior? - | KW_DROP KW_INDEX KW_CONCURRENTLY opt_if_exists? any_name_list opt_drop_behavior? - | KW_DROP KW_CAST opt_if_exists? OPEN_PAREN typename KW_AS typename CLOSE_PAREN opt_drop_behavior? - | KW_DROP KW_OPERATOR KW_CLASS opt_if_exists? any_name KW_USING name opt_drop_behavior? - | KW_DROP KW_OPERATOR KW_FAMILY opt_if_exists? any_name KW_USING name opt_drop_behavior? - | KW_DROP KW_OWNED KW_BY role_list opt_drop_behavior? - | KW_DROP KW_VIEW opt_if_exists? view_nameList opt_drop_behavior? - | KW_DROP KW_SUBSCRIPTION opt_if_exists? name opt_drop_behavior? - | KW_DROP KW_TABLESPACE opt_if_exists? tablespace_name - | KW_DROP KW_TRANSFORM opt_if_exists? KW_FOR typename KW_LANGUAGE name opt_drop_behavior? - | KW_DROP (KW_ROLE | KW_USER | KW_GROUP) opt_if_exists? role_list - | KW_DROP KW_USER KW_MAPPING opt_if_exists? KW_FOR auth_ident KW_SERVER name - | KW_DROP KW_DATABASE opt_if_exists? database_name ( - opt_with? OPEN_PAREN drop_option_list CLOSE_PAREN - )?; - -view_nameList: view_name (COMMA view_name)*; - -object_type_any_name: - KW_TABLE table_name - | KW_SEQUENCE any_name - | KW_VIEW view_name - | KW_MATERIALIZED KW_VIEW view_name - | KW_INDEX any_name - | KW_FOREIGN KW_TABLE table_name - | KW_COLLATION any_name - | KW_CONVERSION any_name - | KW_STATISTICS any_name - | KW_TEXT KW_SEARCH KW_PARSER any_name - | KW_TEXT KW_SEARCH KW_DICTIONARY any_name - | KW_TEXT KW_SEARCH KW_TEMPLATE any_name - | KW_TEXT KW_SEARCH KW_CONFIGURATION any_name; - -object_type_name: - (KW_ACCESS KW_METHOD name) - | (KW_EVENT KW_TRIGGER name) - | (KW_EXTENSION name) - | (KW_FOREIGN KW_DATA KW_WRAPPER name) - | (opt_procedural? KW_LANGUAGE name) - | (KW_PUBLICATION name) - | (KW_SCHEMA schema_name) - | (KW_SERVER name) - | (KW_DATABASE database_name) - | (KW_ROLE name) - | (KW_SUBSCRIPTION name) - | (KW_TABLESPACE tablespace_name); - -object_type_name_on_any_name: KW_POLICY | KW_RULE | KW_TRIGGER; - -any_name_list: any_name (COMMA any_name)*; - -table_column_name: table_name DOT column_name; - -relation_column_name: relation_name DOT column_name; - -relation_name: colid attrs?; - -any_name: colid attrs?; - -attrs: (DOT attr_name)+; - -type_name_list: typename (COMMA typename)*; - -truncatestmt: - KW_TRUNCATE opt_table? relation_expr_list opt_restart_seqs? opt_drop_behavior?; - -opt_restart_seqs: KW_CONTINUE KW_IDENTITY | KW_RESTART KW_IDENTITY; - -commentstmt: - KW_COMMENT KW_ON object_type_any_name KW_IS comment_text - | KW_COMMENT KW_ON KW_COLUMN relation_column_name KW_IS comment_text - | KW_COMMENT KW_ON object_type_name KW_IS comment_text - | KW_COMMENT KW_ON KW_TYPE typename KW_IS comment_text - | KW_COMMENT KW_ON KW_DOMAIN typename KW_IS comment_text - | KW_COMMENT KW_ON KW_AGGREGATE aggregate_with_argtypes KW_IS comment_text - | KW_COMMENT KW_ON KW_FUNCTION function_with_argtypes KW_IS comment_text - | KW_COMMENT KW_ON KW_OPERATOR operator_with_argtypes KW_IS comment_text - | KW_COMMENT KW_ON KW_CONSTRAINT name KW_ON table_name KW_IS comment_text - | KW_COMMENT KW_ON KW_CONSTRAINT name KW_ON KW_DOMAIN? any_name KW_IS comment_text - | KW_COMMENT KW_ON KW_POLICY name KW_ON any_name KW_IS comment_text - | KW_COMMENT KW_ON KW_RULE name KW_ON any_name KW_IS comment_text - | KW_COMMENT KW_ON KW_TRIGGER name KW_ON any_name KW_IS comment_text - | KW_COMMENT KW_ON KW_PROCEDURE procedure_with_argtypes KW_IS comment_text - | KW_COMMENT KW_ON KW_ROUTINE routine_with_argtypes KW_IS comment_text - | KW_COMMENT KW_ON KW_TRANSFORM KW_FOR typename KW_LANGUAGE name KW_IS comment_text - | KW_COMMENT KW_ON KW_OPERATOR KW_CLASS any_name KW_USING name KW_IS comment_text - | KW_COMMENT KW_ON KW_OPERATOR KW_FAMILY any_name KW_USING name KW_IS comment_text - | KW_COMMENT KW_ON KW_LARGE KW_OBJECT numericonly KW_IS comment_text - | KW_COMMENT KW_ON KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN KW_IS comment_text; - -comment_text: sconst | KW_NULL; - -seclabelstmt: - KW_SECURITY KW_LABEL opt_provider? KW_ON object_type_any_name KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_COLUMN table_column_name KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON object_type_name KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_TYPE typename KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_DOMAIN typename KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_AGGREGATE aggregate_with_argtypes KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_FUNCTION function_with_argtypes KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_LARGE KW_OBJECT numericonly KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_PROCEDURE procedure_with_argtypes KW_IS security_label - | KW_SECURITY KW_LABEL opt_provider? KW_ON KW_ROUTINE routine_with_argtypes KW_IS security_label; - -opt_provider: KW_FOR nonreservedword_or_sconst; - -security_label: sconst | KW_NULL; - -fetchstmt: KW_FETCH fetch_args | KW_MOVE fetch_args; - -fetch_args: - cursor_name - | from_in cursor_name - | KW_NEXT opt_from_in? cursor_name - | KW_PRIOR opt_from_in? cursor_name - | KW_FIRST opt_from_in? cursor_name - | KW_LAST opt_from_in? cursor_name - | KW_ABSOLUTE signediconst opt_from_in? cursor_name - | KW_RELATIVE signediconst opt_from_in? cursor_name - | signediconst opt_from_in? cursor_name - | KW_ALL opt_from_in? cursor_name - | KW_FORWARD opt_from_in? cursor_name - | KW_FORWARD signediconst opt_from_in? cursor_name - | KW_FORWARD KW_ALL opt_from_in? cursor_name - | KW_BACKWARD opt_from_in? cursor_name - | KW_BACKWARD signediconst opt_from_in? cursor_name - | KW_BACKWARD KW_ALL opt_from_in? cursor_name; - -from_in: KW_FROM | KW_IN; - -opt_from_in: from_in; - -grantstmt: - KW_GRANT privileges KW_ON privilege_target KW_TO grantee_list opt_grant_grant_option?; - -revokestmt: - KW_REVOKE privileges KW_ON privilege_target KW_FROM grantee_list opt_drop_behavior? - | KW_REVOKE KW_GRANT KW_OPTION KW_FOR privileges KW_ON privilege_target KW_FROM grantee_list opt_drop_behavior?; - -privileges: - privilege_list - | KW_ALL - | KW_ALL KW_PRIVILEGES - | KW_ALL OPEN_PAREN columnlist CLOSE_PAREN - | KW_ALL KW_PRIVILEGES OPEN_PAREN columnlist CLOSE_PAREN - | beforeprivilegeselectlist - ; - -beforeprivilegeselectlist: beforeprivilegeselect (COMMA beforeprivilegeselect)*; - -beforeprivilegeselect: - KW_SELECT - | KW_INSERT - | KW_UPDATE - | KW_DELETE - | KW_TRUNCATE - | KW_PEFERENCES - | KW_TRIGGER - | KW_USAGE - | KW_CREATE - | KW_CONNECT - | KW_TEMPORARY - | KW_TEMP - | KW_EXECUTE - ; - -privilege_list: privilege (COMMA privilege)*; - -privilege: - KW_SELECT opt_column_list? - | KW_REFERENCES opt_column_list? - | KW_CREATE opt_column_list? - | colid opt_column_list?; - -privilege_target: - qualified_name_list - | KW_TABLE table_name_list - | KW_SEQUENCE qualified_name_list - | KW_FOREIGN KW_DATA KW_WRAPPER name_list - | KW_FOREIGN KW_SERVER name_list - | KW_FUNCTION function_with_argtypes_list - | KW_PROCEDURE procedure_with_argtypes_list - | KW_ROUTINE routine_with_argtypes_list - | KW_DATABASE database_nameList - | KW_DOMAIN any_name_list - | KW_LANGUAGE name_list - | KW_LARGE KW_OBJECT numericonly_list - | KW_SCHEMA schema_name_list - | KW_TABLESPACE tablespace_name_list - | KW_TYPE any_name_list - | KW_ALL KW_TABLES KW_IN KW_SCHEMA schema_name_list - | KW_ALL KW_SEQUENCES KW_IN KW_SCHEMA schema_name_list - | KW_ALL KW_FUNCTIONS KW_IN KW_SCHEMA schema_name_list - | KW_ALL KW_PROCEDURES KW_IN KW_SCHEMA schema_name_list - | KW_ALL KW_ROUTINES KW_IN KW_SCHEMA schema_name_list; - -grantee_list: grantee (COMMA grantee)*; - -grantee: rolespec | KW_GROUP rolespec; - -opt_grant_grant_option: KW_WITH KW_GRANT KW_OPTION; - -grantrolestmt: - KW_GRANT privilege_list KW_TO role_list opt_grant_admin_option? opt_granted_by?; - -revokerolestmt: - KW_REVOKE privilege_list KW_FROM role_list opt_granted_by? opt_drop_behavior? - | KW_REVOKE KW_ADMIN KW_OPTION KW_FOR privilege_list KW_FROM role_list opt_granted_by? opt_drop_behavior?; - -opt_grant_admin_option: KW_WITH KW_ADMIN KW_OPTION; - -opt_granted_by: KW_GRANTED KW_BY rolespec; - -alterdefaultprivilegesstmt: - KW_ALTER KW_DEFAULT KW_PRIVILEGES defacloptionlist defaclaction; - -defacloptionlist: defacloption*; - -defacloption: - KW_IN KW_SCHEMA schema_name_list - | KW_FOR KW_ROLE role_list - | KW_FOR KW_USER role_list; - -defaclaction: - KW_GRANT privileges KW_ON defacl_privilege_target KW_TO grantee_list opt_grant_grant_option? - | KW_REVOKE privileges KW_ON defacl_privilege_target KW_FROM grantee_list opt_drop_behavior? - | KW_REVOKE KW_GRANT KW_OPTION KW_FOR privileges KW_ON defacl_privilege_target KW_FROM grantee_list - opt_drop_behavior?; - -defacl_privilege_target: - KW_TABLES - | KW_FUNCTIONS - | KW_ROUTINES - | KW_SEQUENCES - | KW_TYPES - | KW_SCHEMAS; //create index -indexstmt: - KW_CREATE opt_unique? KW_INDEX opt_concurrently? opt_if_not_exists? opt_index_name? KW_ON relation_expr access_method_clause - ? OPEN_PAREN index_params CLOSE_PAREN opt_include? nulls_distinct? opt_reloptions? opttablespace? - where_clause?; +indexstmt + : KW_CREATE opt_unique? KW_INDEX opt_concurrently? opt_if_not_exists? opt_index_name? KW_ON relation_expr access_method_clause? OPEN_PAREN + index_params CLOSE_PAREN opt_include? nulls_distinct? opt_reloptions? opttablespace? where_clause? + ; -opt_unique: KW_UNIQUE; +opt_unique + : KW_UNIQUE + ; -opt_concurrently: KW_CONCURRENTLY; +opt_concurrently + : KW_CONCURRENTLY + ; -opt_index_name: name; +opt_index_name + : name + ; -access_method_clause: KW_USING name; +access_method_clause + : KW_USING name + ; -index_params: index_elem (COMMA index_elem)*; +index_params + : index_elem (COMMA index_elem)* + ; -index_elem_options: - opt_collate? opt_class? opt_asc_desc? opt_nulls_order? - | opt_collate? any_name reloptions opt_asc_desc? opt_nulls_order?; +index_elem_options + : opt_collate? opt_class? opt_asc_desc? opt_nulls_order? + | opt_collate? any_name reloptions opt_asc_desc? opt_nulls_order? + ; -index_elem: - column_name index_elem_options - | func_expr_windowless index_elem_options - | OPEN_PAREN a_expr CLOSE_PAREN index_elem_options; +index_elem + : column_name index_elem_options + | func_expr_windowless index_elem_options + | OPEN_PAREN a_expr CLOSE_PAREN index_elem_options + ; -opt_include: - KW_INCLUDE OPEN_PAREN index_including_params CLOSE_PAREN; +opt_include + : KW_INCLUDE OPEN_PAREN index_including_params CLOSE_PAREN + ; -index_including_params: index_elem (COMMA index_elem)*; +index_including_params + : index_elem (COMMA index_elem)* + ; -opt_collate: KW_COLLATE any_name; +opt_collate + : KW_COLLATE any_name + ; -opt_class: any_name; +opt_class + : any_name + ; -opt_asc_desc: KW_ASC | KW_DESC; +opt_asc_desc + : KW_ASC + | KW_DESC + ; -opt_nulls_order: KW_NULLS KW_FIRST | KW_NULLS KW_LAST; +opt_nulls_order + : KW_NULLS KW_FIRST + | KW_NULLS KW_LAST + ; -createfunctionstmt: - KW_CREATE opt_or_replace? (KW_FUNCTION function_name_create | KW_PROCEDURE procedure_name_create) func_args_with_defaults ( - KW_RETURNS ( - func_return - | KW_TABLE OPEN_PAREN table_func_column_list CLOSE_PAREN - ) - )? createfunc_opt_list (KW_WITH attrilist)?; +createfunctionstmt + : KW_CREATE opt_or_replace? ( + KW_FUNCTION function_name_create + | KW_PROCEDURE procedure_name_create + ) func_args_with_defaults ( + KW_RETURNS (func_return | KW_TABLE OPEN_PAREN table_func_column_list CLOSE_PAREN) + )? createfunc_opt_list (KW_WITH attrilist)? + ; -attrilist: OPEN_PAREN colid (COMMA colid)* CLOSE_PAREN; +attrilist + : OPEN_PAREN colid (COMMA colid)* CLOSE_PAREN + ; -opt_or_replace: KW_OR KW_REPLACE; +opt_or_replace + : KW_OR KW_REPLACE + ; -func_args: OPEN_PAREN func_args_list? CLOSE_PAREN; +func_args + : OPEN_PAREN func_args_list? CLOSE_PAREN + ; -func_args_list: func_arg (COMMA func_arg)*; +func_args_list + : func_arg (COMMA func_arg)* + ; -routine_with_argtypes_list: - routine_with_argtypes (COMMA routine_with_argtypes)*; +routine_with_argtypes_list + : routine_with_argtypes (COMMA routine_with_argtypes)* + ; -routine_with_argtypes: - routine_name func_args - | type_func_name_keyword - | colid indirection?; +routine_with_argtypes + : routine_name func_args + | type_func_name_keyword + | colid indirection? + ; -procedure_with_argtypes_list: - procedure_with_argtypes (COMMA procedure_with_argtypes)*; +procedure_with_argtypes_list + : procedure_with_argtypes (COMMA procedure_with_argtypes)* + ; -procedure_with_argtypes: - procedure_name func_args - | type_func_name_keyword - | colid indirection?; +procedure_with_argtypes + : procedure_name func_args + | type_func_name_keyword + | colid indirection? + ; -function_with_argtypes_list: - function_with_argtypes (COMMA function_with_argtypes)*; +function_with_argtypes_list + : function_with_argtypes (COMMA function_with_argtypes)* + ; -function_with_argtypes: - function_name func_args - | type_func_name_keyword - | colid indirection?; +function_with_argtypes + : function_name func_args + | type_func_name_keyword + | colid indirection? + ; -func_args_with_defaults: - OPEN_PAREN func_args_with_defaults_list? CLOSE_PAREN; +func_args_with_defaults + : OPEN_PAREN func_args_with_defaults_list? CLOSE_PAREN + ; -func_args_with_defaults_list: - func_arg_with_default (COMMA func_arg_with_default)*; +func_args_with_defaults_list + : func_arg_with_default (COMMA func_arg_with_default)* + ; -func_arg: - arg_class param_name? func_type - | param_name arg_class? func_type - | func_type; +func_arg + : arg_class param_name? func_type + | param_name arg_class? func_type + | func_type + ; -arg_class: KW_IN KW_OUT? | KW_OUT | KW_INOUT | KW_VARIADIC; +arg_class + : KW_IN KW_OUT? + | KW_OUT + | KW_INOUT + | KW_VARIADIC + ; -param_name: type_function_name; +param_name + : type_function_name + ; -func_return: func_type; +func_return + : func_type + ; -func_type: - typename - | type_function_name attrs PERCENT KW_TYPE - | KW_SETOF type_function_name attrs PERCENT KW_TYPE; +func_type + : typename + | type_function_name attrs PERCENT KW_TYPE + | KW_SETOF type_function_name attrs PERCENT KW_TYPE + ; -func_arg_with_default: func_arg ((KW_DEFAULT | EQUAL) a_expr)?; +func_arg_with_default + : func_arg ((KW_DEFAULT | EQUAL) a_expr)? + ; -aggr_arg: func_arg; +aggr_arg + : func_arg + ; -aggr_args: - OPEN_PAREN ( - STAR - | aggr_args_list - | KW_ORDER KW_BY aggr_args_list - | aggr_args_list KW_ORDER KW_BY aggr_args_list - ) CLOSE_PAREN; +aggr_args + : OPEN_PAREN ( + STAR + | aggr_args_list + | KW_ORDER KW_BY aggr_args_list + | aggr_args_list KW_ORDER KW_BY aggr_args_list + ) CLOSE_PAREN + ; -aggr_args_list: aggr_arg (COMMA aggr_arg)*; +aggr_args_list + : aggr_arg (COMMA aggr_arg)* + ; -aggregate_with_argtypes: function_name aggr_args; +aggregate_with_argtypes + : function_name aggr_args + ; -aggregate_with_argtypes_list: - aggregate_with_argtypes (COMMA aggregate_with_argtypes)*; +aggregate_with_argtypes_list + : aggregate_with_argtypes (COMMA aggregate_with_argtypes)* + ; -createfunc_opt_list: - createfunc_opt_item+ ; +createfunc_opt_list + : createfunc_opt_item+ + ; -common_func_opt_item: - KW_CALLED KW_ON KW_NULL KW_INPUT - | KW_RETURNS KW_NULL KW_ON KW_NULL KW_INPUT - | KW_STRICT - | KW_IMMUTABLE - | KW_STABLE - | KW_VOLATILE - | KW_EXTERNAL KW_SECURITY KW_DEFINER - | KW_EXTERNAL KW_SECURITY KW_INVOKER - | KW_SECURITY KW_DEFINER - | KW_SECURITY KW_INVOKER - | KW_LEAKPROOF - | KW_NOT KW_LEAKPROOF - | KW_COST numericonly - | KW_ROWS numericonly - | KW_SUPPORT any_name - | functionsetresetclause - | KW_PARALLEL colid; +common_func_opt_item + : KW_CALLED KW_ON KW_NULL KW_INPUT + | KW_RETURNS KW_NULL KW_ON KW_NULL KW_INPUT + | KW_STRICT + | KW_IMMUTABLE + | KW_STABLE + | KW_VOLATILE + | KW_EXTERNAL KW_SECURITY KW_DEFINER + | KW_EXTERNAL KW_SECURITY KW_INVOKER + | KW_SECURITY KW_DEFINER + | KW_SECURITY KW_INVOKER + | KW_LEAKPROOF + | KW_NOT KW_LEAKPROOF + | KW_COST numericonly + | KW_ROWS numericonly + | KW_SUPPORT any_name + | functionsetresetclause + | KW_PARALLEL colid + ; + +createfunc_opt_item + : KW_AS sconst COMMA sconst + | KW_LANGUAGE nonreservedword_or_sconst + | KW_TRANSFORM transform_type_list + | KW_WINDOW + | KW_SET colid (KW_TO colid | EQUAL colid | KW_FROM KW_CURRENT) + | KW_AS colid + | stmt + | common_func_opt_item + | colid + ; -createfunc_opt_item: - KW_AS sconst COMMA sconst - | KW_LANGUAGE nonreservedword_or_sconst - | KW_TRANSFORM transform_type_list - | KW_WINDOW - | KW_SET colid (KW_TO colid | EQUAL colid | KW_FROM KW_CURRENT ) - | KW_AS colid - | stmt - | common_func_opt_item - | colid; //https://www.postgresql.org/docs/9.1/sql-createfunction.html // | KW_AS 'definition' // | KW_AS 'obj_file', 'link_symbol' -transform_type_list: - KW_FOR KW_TYPE typename (COMMA KW_FOR KW_TYPE typename)*; +transform_type_list + : KW_FOR KW_TYPE typename (COMMA KW_FOR KW_TYPE typename)* + ; + +opt_definition + : KW_WITH definition + ; + +table_func_column + : column_name func_type + ; + +table_func_column_list + : table_func_column (COMMA table_func_column)* + ; + +alterfunctionstmt + : KW_ALTER alterFunctionTypeClause alterfunc_opt_list opt_restrict? + ; + +alterFunctionTypeClause + : KW_FUNCTION function_with_argtypes + | KW_PROCEDURE procedure_with_argtypes + | KW_ROUTINE routine_with_argtypes + ; + +alterfunc_opt_list + : common_func_opt_item+ + ; + +opt_restrict + : KW_RESTRICT + ; + +removefuncstmt + : KW_DROP KW_FUNCTION opt_if_exists? function_with_argtypes_list opt_drop_behavior? + | KW_DROP KW_PROCEDURE opt_if_exists? procedure_with_argtypes_list opt_drop_behavior? + | KW_DROP KW_ROUTINE opt_if_exists? routine_with_argtypes_list opt_drop_behavior? + ; + +removeaggrstmt + : KW_DROP KW_AGGREGATE opt_if_exists? aggregate_with_argtypes_list opt_drop_behavior? + ; + +removeoperstmt + : KW_DROP KW_OPERATOR opt_if_exists? operator_with_argtypes_list opt_drop_behavior? + ; + +oper_argtypes + : OPEN_PAREN typename CLOSE_PAREN + | OPEN_PAREN typename COMMA typename CLOSE_PAREN + | OPEN_PAREN KW_NONE COMMA typename CLOSE_PAREN + | OPEN_PAREN typename COMMA KW_NONE CLOSE_PAREN + ; + +any_operator + : (colid DOT)* all_op + ; + +operator_with_argtypes_list + : operator_with_argtypes (COMMA operator_with_argtypes)* + ; + +operator_with_argtypes + : any_operator oper_argtypes + ; + +dostmt + : KW_DO dostmt_opt_list + ; + +dostmt_opt_list + : dostmt_opt_item+ + ; + +dostmt_opt_item + : sconst + | KW_LANGUAGE nonreservedword_or_sconst + ; + +createcaststmt + : KW_CREATE KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN KW_WITH KW_FUNCTION function_with_argtypes cast_context? + | KW_CREATE KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN KW_WITHOUT KW_FUNCTION cast_context? + | KW_CREATE KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN KW_WITH KW_INOUT cast_context? + ; + +cast_context + : KW_AS KW_IMPLICIT + | KW_AS KW_ASSIGNMENT + ; + +opt_if_exists + : KW_IF KW_EXISTS + ; + +createtransformstmt + : KW_CREATE opt_or_replace? KW_TRANSFORM KW_FOR typename KW_LANGUAGE name OPEN_PAREN transform_element_list CLOSE_PAREN + ; + +transform_element_list + : KW_FROM KW_SQL KW_WITH KW_FUNCTION function_with_argtypes COMMA KW_TO KW_SQL KW_WITH KW_FUNCTION function_with_argtypes + | KW_TO KW_SQL KW_WITH KW_FUNCTION function_with_argtypes COMMA KW_FROM KW_SQL KW_WITH KW_FUNCTION function_with_argtypes + | KW_FROM KW_SQL KW_WITH KW_FUNCTION function_with_argtypes + | KW_TO KW_SQL KW_WITH KW_FUNCTION function_with_argtypes + ; + +reindexstmt + : KW_REINDEX reindex_target_type + | KW_REINDEX reindex_target_multitable + | KW_REINDEX OPEN_PAREN reindex_option_list CLOSE_PAREN reindex_target_type + | KW_REINDEX OPEN_PAREN reindex_option_list CLOSE_PAREN reindex_target_multitable + ; + +reindex_target_type + : (KW_INDEX opt_concurrently? qualified_name) + | (KW_TABLE opt_concurrently? table_name) + ; + +reindex_target_multitable + : (KW_SCHEMA opt_concurrently? schema_name) + | (KW_SYSTEM opt_concurrently? name) + | (KW_DATABASE opt_concurrently? database_name) + ; + +reindex_option_list + : reindex_option_elem (COMMA reindex_option_elem)* + ; + +reindex_option_elem + : KW_VERBOSE + ; + +altertblspcstmt + : KW_ALTER KW_TABLESPACE tablespace_name KW_SET reloptions + | KW_ALTER KW_TABLESPACE tablespace_name KW_RESET reloptions + ; + +renamestmt + : KW_ALTER KW_AGGREGATE aggregate_with_argtypes KW_RENAME KW_TO name + | KW_ALTER KW_COLLATION any_name KW_RENAME KW_TO name + | KW_ALTER KW_CONVERSION any_name KW_RENAME KW_TO name + | KW_ALTER KW_DATABASE database_name KW_RENAME KW_TO database_name_create + | KW_ALTER KW_DOMAIN any_name KW_RENAME KW_TO name + | KW_ALTER KW_DOMAIN any_name KW_RENAME KW_CONSTRAINT name KW_TO name + | KW_ALTER KW_FOREIGN KW_DATA KW_WRAPPER name KW_RENAME KW_TO name + | KW_ALTER KW_FUNCTION function_with_argtypes KW_RENAME KW_TO function_name_create + | KW_ALTER KW_GROUP roleid KW_RENAME KW_TO roleid + | KW_ALTER opt_procedural? KW_LANGUAGE name KW_RENAME KW_TO name + | KW_ALTER KW_OPERATOR KW_CLASS any_name KW_USING name KW_RENAME KW_TO name + | KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_RENAME KW_TO name + | KW_ALTER KW_POLICY opt_if_exists? name KW_ON qualified_name KW_RENAME KW_TO name + | KW_ALTER KW_PROCEDURE procedure_with_argtypes KW_RENAME KW_TO procedure_name_create + | KW_ALTER KW_PUBLICATION name KW_RENAME KW_TO name + | KW_ALTER KW_ROUTINE routine_with_argtypes KW_RENAME KW_TO name + | KW_ALTER KW_SCHEMA schema_name KW_RENAME KW_TO schema_name_create + | KW_ALTER KW_SERVER name KW_RENAME KW_TO name + | KW_ALTER KW_SUBSCRIPTION name KW_RENAME KW_TO name + | KW_ALTER KW_TABLE opt_if_exists? relation_expr KW_RENAME KW_TO table_name_create + | KW_ALTER KW_SEQUENCE opt_if_exists? qualified_name KW_RENAME KW_TO name + | KW_ALTER KW_VIEW opt_if_exists? view_name KW_RENAME KW_TO view_name_create + | KW_ALTER KW_MATERIALIZED KW_VIEW opt_if_exists? view_name KW_RENAME KW_TO view_name_create + | KW_ALTER KW_INDEX opt_if_exists? qualified_name KW_RENAME KW_TO name + | KW_ALTER KW_FOREIGN KW_TABLE opt_if_exists? relation_expr KW_RENAME KW_TO table_name_create + | KW_ALTER KW_TABLE opt_if_exists? relation_expr KW_RENAME opt_column? column_name KW_TO column_name_create + | KW_ALTER KW_VIEW opt_if_exists? view_name KW_RENAME opt_column? column_name KW_TO column_name_create + | KW_ALTER KW_MATERIALIZED KW_VIEW opt_if_exists? view_name KW_RENAME opt_column? column_name KW_TO column_name_create + | KW_ALTER KW_TABLE opt_if_exists? relation_expr KW_RENAME KW_CONSTRAINT name KW_TO name + | KW_ALTER KW_FOREIGN KW_TABLE opt_if_exists? relation_expr KW_RENAME opt_column? column_name KW_TO column_name_create + | KW_ALTER KW_RULE name KW_ON qualified_name KW_RENAME KW_TO name + | KW_ALTER KW_TRIGGER name KW_ON qualified_name KW_RENAME KW_TO name + | KW_ALTER KW_EVENT KW_TRIGGER name KW_RENAME KW_TO name + | KW_ALTER KW_ROLE roleid KW_RENAME KW_TO roleid + | KW_ALTER KW_USER roleid KW_RENAME KW_TO roleid + | KW_ALTER KW_TABLESPACE tablespace_name KW_RENAME KW_TO tablespace_name_create + | KW_ALTER KW_STATISTICS any_name KW_RENAME KW_TO name + | KW_ALTER KW_TEXT KW_SEARCH KW_PARSER any_name KW_RENAME KW_TO name + | KW_ALTER KW_TEXT KW_SEARCH KW_DICTIONARY any_name KW_RENAME KW_TO name + | KW_ALTER KW_TEXT KW_SEARCH KW_TEMPLATE any_name KW_RENAME KW_TO name + | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_RENAME KW_TO name + | KW_ALTER KW_TYPE any_name KW_RENAME KW_TO name + | KW_ALTER KW_TYPE any_name KW_RENAME KW_ATTRIBUTE name KW_TO name opt_drop_behavior? + ; + +opt_column + : KW_COLUMN + ; + +opt_set_data + : KW_SET KW_DATA + ; + +alterobjectdependsstmt + : KW_ALTER KW_FUNCTION function_with_argtypes opt_no? KW_DEPENDS KW_ON KW_EXTENSION name + | KW_ALTER KW_PROCEDURE procedure_with_argtypes opt_no? KW_DEPENDS KW_ON KW_EXTENSION name + | KW_ALTER KW_ROUTINE routine_with_argtypes opt_no? KW_DEPENDS KW_ON KW_EXTENSION name + | KW_ALTER KW_TRIGGER name KW_ON qualified_name opt_no? KW_DEPENDS KW_ON KW_EXTENSION name + | KW_ALTER KW_MATERIALIZED KW_VIEW view_name opt_no? KW_DEPENDS KW_ON KW_EXTENSION name + | KW_ALTER KW_INDEX qualified_name opt_no? KW_DEPENDS KW_ON KW_EXTENSION name + ; + +opt_no + : KW_NO + ; + +alterobjectschemastmt + : KW_ALTER KW_AGGREGATE aggregate_with_argtypes KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_COLLATION any_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_CONVERSION any_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_DOMAIN any_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_EXTENSION name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_FUNCTION function_with_argtypes KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_OPERATOR operator_with_argtypes KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_OPERATOR KW_CLASS any_name KW_USING name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_PROCEDURE procedure_with_argtypes KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_ROUTINE routine_with_argtypes KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_TABLE opt_if_exists? relation_expr KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_STATISTICS any_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_TEXT KW_SEARCH KW_PARSER any_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_TEXT KW_SEARCH KW_DICTIONARY any_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_TEXT KW_SEARCH KW_TEMPLATE any_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_SEQUENCE opt_if_exists? qualified_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_VIEW opt_if_exists? view_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_MATERIALIZED KW_VIEW opt_if_exists? view_name KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_FOREIGN KW_TABLE opt_if_exists? relation_expr KW_SET KW_SCHEMA schema_name_create + | KW_ALTER KW_TYPE any_name KW_SET KW_SCHEMA schema_name_create + ; + +alteroperatorstmt + : KW_ALTER KW_OPERATOR operator_with_argtypes KW_SET OPEN_PAREN operator_def_list CLOSE_PAREN + ; + +operator_def_list + : operator_def_elem (COMMA operator_def_elem)* + ; + +operator_def_elem + : collabel EQUAL KW_NONE + | collabel EQUAL operator_def_arg + ; + +operator_def_arg + : func_type + | reserved_keyword + | qual_all_op + | numericonly + | sconst + ; + +altertypestmt + : KW_ALTER KW_TYPE any_name KW_SET OPEN_PAREN operator_def_list CLOSE_PAREN + ; + +alterownerstmt + : KW_ALTER KW_AGGREGATE aggregate_with_argtypes KW_OWNER KW_TO rolespec + | KW_ALTER KW_COLLATION any_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_CONVERSION any_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_DATABASE database_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_DOMAIN any_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_FUNCTION function_with_argtypes KW_OWNER KW_TO rolespec + | KW_ALTER opt_procedural? KW_LANGUAGE name KW_OWNER KW_TO rolespec + | KW_ALTER KW_LARGE KW_OBJECT numericonly KW_OWNER KW_TO rolespec + | KW_ALTER KW_OPERATOR operator_with_argtypes KW_OWNER KW_TO rolespec + | KW_ALTER KW_OPERATOR KW_CLASS any_name KW_USING name KW_OWNER KW_TO rolespec + | KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_OWNER KW_TO rolespec + | KW_ALTER KW_PROCEDURE procedure_with_argtypes KW_OWNER KW_TO rolespec + | KW_ALTER KW_ROUTINE routine_with_argtypes KW_OWNER KW_TO rolespec + | KW_ALTER KW_SCHEMA schema_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_TYPE any_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_TABLESPACE tablespace_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_STATISTICS any_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_TEXT KW_SEARCH KW_DICTIONARY any_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_OWNER KW_TO rolespec + | KW_ALTER KW_FOREIGN KW_DATA KW_WRAPPER name KW_OWNER KW_TO rolespec + | KW_ALTER KW_SERVER name KW_OWNER KW_TO rolespec + | KW_ALTER KW_EVENT KW_TRIGGER name KW_OWNER KW_TO rolespec + | KW_ALTER KW_PUBLICATION name KW_OWNER KW_TO rolespec + | KW_ALTER KW_SUBSCRIPTION name KW_OWNER KW_TO rolespec + ; + +createpublicationstmt + : KW_CREATE KW_PUBLICATION name opt_publication_for_tables? opt_definition? + ; + +opt_publication_for_tables + : publication_for_tables + ; + +publication_for_tables + : KW_FOR KW_TABLE relation_expr_list + | KW_FOR KW_ALL KW_TABLES + ; + +alterpublicationstmt + : KW_ALTER KW_PUBLICATION name KW_SET definition + | KW_ALTER KW_PUBLICATION name KW_ADD publication_relation_expr_list + | KW_ALTER KW_PUBLICATION name KW_SET publication_relation_expr_list + | KW_ALTER KW_PUBLICATION name KW_DROP publication_relation_expr_list + | KW_ALTER KW_PUBLICATION name KW_OWNER KW_TO rolespec + | KW_ALTER KW_PUBLICATION name KW_RENAME KW_TO name + ; + +createsubscriptionstmt + : KW_CREATE KW_SUBSCRIPTION name KW_CONNECTION sconst KW_PUBLICATION publication_name_list opt_definition? + ; + +publication_name_list + : publication_name_item (COMMA publication_name_item)* + ; + +publication_name_item + : collabel + ; + +altersubscriptionstmt + : KW_ALTER KW_SUBSCRIPTION name KW_SET definition + | KW_ALTER KW_SUBSCRIPTION name KW_CONNECTION sconst + | KW_ALTER KW_SUBSCRIPTION name KW_REFRESH KW_PUBLICATION opt_definition? + | KW_ALTER KW_SUBSCRIPTION name KW_SET KW_PUBLICATION publication_name_list opt_definition? + | KW_ALTER KW_SUBSCRIPTION name KW_ADD KW_PUBLICATION publication_name_list opt_definition? + | KW_ALTER KW_SUBSCRIPTION name KW_DROP KW_PUBLICATION publication_name_list opt_definition? + | KW_ALTER KW_SUBSCRIPTION name KW_ENABLE + | KW_ALTER KW_SUBSCRIPTION name KW_DISABLE + | KW_ALTER KW_SUBSCRIPTION name KW_SET definition + | KW_ALTER KW_SUBSCRIPTION name KW_SKIP OPEN_PAREN old_aggr_elem CLOSE_PAREN + | KW_ALTER KW_SUBSCRIPTION name KW_OWNER KW_TO rolespec + ; + +rulestmt + : KW_CREATE opt_or_replace? KW_RULE name KW_AS KW_ON event KW_TO qualified_name where_clause? KW_DO opt_instead? ruleactionlist + ; + +ruleactionlist + : KW_NOTHING + | ruleactionstmt + | OPEN_PAREN ruleactionmulti CLOSE_PAREN + ; + +ruleactionmulti + : ruleactionstmtOrEmpty? (SEMI ruleactionstmtOrEmpty?)* + ; + +ruleactionstmt + : selectstmt + | insertstmt + | updatestmt + | deletestmt + | notifystmt + ; + +ruleactionstmtOrEmpty + : ruleactionstmt + ; + +event + : KW_SELECT + | KW_UPDATE + | KW_DELETE + | KW_INSERT + ; + +opt_instead + : KW_INSTEAD + | KW_ALSO + ; + +notifystmt + : KW_NOTIFY colid notify_payload? + ; + +notify_payload + : COMMA sconst + ; + +listenstmt + : KW_LISTEN colid + ; + +unlistenstmt + : KW_UNLISTEN colid + | KW_UNLISTEN STAR + ; + +transactionstmt + : KW_ABORT opt_transaction? opt_transaction_chain? + | KW_BEGIN opt_transaction? transaction_mode_list_or_empty? + | KW_START KW_TRANSACTION transaction_mode_list_or_empty? + | KW_COMMIT opt_transaction? opt_transaction_chain? + | KW_END opt_transaction? opt_transaction_chain? + | KW_ROLLBACK opt_transaction? opt_transaction_chain? + | KW_SAVEPOINT colid + | KW_RELEASE KW_SAVEPOINT colid + | KW_RELEASE colid + | KW_ROLLBACK opt_transaction? KW_TO KW_SAVEPOINT colid + | KW_ROLLBACK opt_transaction? KW_TO colid + | KW_PREPARE KW_TRANSACTION sconst + | KW_COMMIT KW_PREPARED sconst + | KW_ROLLBACK KW_PREPARED sconst + ; + +opt_transaction + : KW_WORK + | KW_TRANSACTION + ; + +transaction_mode_item + : KW_ISOLATION KW_LEVEL iso_level + | KW_READ KW_ONLY + | KW_READ KW_WRITE + | KW_DEFERRABLE + | KW_NOT KW_DEFERRABLE + ; + +transaction_mode_list + : transaction_mode_item (COMMA? transaction_mode_item)* + ; + +transaction_mode_list_or_empty + : transaction_mode_list + ; + +opt_transaction_chain + : KW_AND KW_NO? KW_CHAIN + ; + +viewstmt + : KW_CREATE (KW_OR KW_REPLACE)? opttemp? ( + KW_VIEW view_name_create opt_column_list? opt_reloptions? + | KW_RECURSIVE KW_VIEW view_name_create OPEN_PAREN columnlist CLOSE_PAREN opt_reloptions? + ) KW_AS selectstmt opt_check_option? + ; + +opt_check_option + : KW_WITH (KW_CASCADED | KW_LOCAL)? KW_CHECK KW_OPTION + ; + +loadstmt + : KW_LOAD file_name + ; + +createdbstmt + : KW_CREATE KW_DATABASE database_name_create opt_with? createdb_opt_list? + ; + +createdb_opt_list + : createdb_opt_items + ; + +createdb_opt_items + : createdb_opt_item+ + ; + +createdb_opt_item + : createdb_opt_name opt_equal? (signediconst | opt_boolean_or_string | KW_DEFAULT) + ; + +createdb_opt_name + : identifier + | KW_CONNECTION KW_LIMIT + | KW_ENCODING + | KW_LOCATION + | KW_OWNER + | KW_TABLESPACE + | KW_TEMPLATE + ; + +opt_equal + : EQUAL + ; + +alterdatabasestmt + : KW_ALTER KW_DATABASE database_name ( + (KW_WITH? createdb_opt_list)? + | createdb_opt_list? + | (KW_SET KW_TABLESPACE tablespace_name_create)? + ) + ; + +alterdatabasesetstmt + : KW_ALTER KW_DATABASE database_name setresetclause? + ; + +drop_option_list + : drop_option (COMMA drop_option)* + ; + +drop_option + : KW_FORCE + ; + +altercollationstmt + : KW_ALTER KW_COLLATION any_name KW_REFRESH KW_VERSION + ; + +altersystemstmt + : KW_ALTER KW_SYSTEM (KW_SET | KW_RESET) generic_set + ; + +createdomainstmt + : KW_CREATE KW_DOMAIN any_name opt_as? typename colquallist + ; + +alterdomainstmt + : KW_ALTER KW_DOMAIN any_name ( + alter_column_default + | KW_DROP KW_NOT KW_NULL + | KW_SET KW_NOT KW_NULL + | KW_ADD tableconstraint + | KW_DROP KW_CONSTRAINT opt_if_exists? name opt_drop_behavior? + | KW_VALIDATE KW_CONSTRAINT name + ) + ; + +opt_as + : KW_AS + ; + +altertsdictionarystmt + : KW_ALTER KW_TEXT KW_SEARCH KW_DICTIONARY any_name definition + ; + +altertsconfigurationstmt + : KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_ADD KW_MAPPING KW_FOR name_list any_with any_name_list + | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_ALTER KW_MAPPING KW_FOR name_list any_with any_name_list + | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_ALTER KW_MAPPING KW_REPLACE any_name any_with any_name + | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_ALTER KW_MAPPING KW_FOR name_list KW_REPLACE any_name any_with any_name + | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_DROP KW_MAPPING opt_if_exists? KW_FOR name_list + ; + +any_with + : KW_WITH + ; // | WITH_LA + +createconversionstmt + : KW_CREATE opt_default? KW_CONVERSION any_name KW_FOR sconst KW_TO sconst KW_FROM any_name + ; + +clusterstmt + : KW_CLUSTER opt_verbose? table_name cluster_index_specification? + | KW_CLUSTER opt_verbose? + | KW_CLUSTER opt_verbose_list table_name cluster_index_specification? + ; + +opt_verbose_list + : OPEN_PAREN opt_verbose (COMMA opt_verbose)* CLOSE_PAREN + ; + +cluster_index_specification + : KW_USING name + ; + +vacuumstmt + : KW_VACUUM opt_full? opt_freeze? opt_verbose? opt_analyze? opt_vacuum_relation_list? + | KW_VACUUM (OPEN_PAREN vac_analyze_option_list CLOSE_PAREN)? opt_vacuum_relation_list? + ; + +analyzestmt + : analyze_keyword opt_verbose? opt_vacuum_relation_list? + | analyze_keyword OPEN_PAREN analyze_options_list CLOSE_PAREN opt_vacuum_relation_list? + ; + +vac_analyze_option_list + : vac_analyze_option_elem (COMMA vac_analyze_option_elem)* + ; + +analyze_keyword + : KW_ANALYZE + | KW_ANALYSE + ; + +vac_analyze_option_elem + : vac_analyze_option_name vac_analyze_option_arg? + ; + +vac_analyze_option_name + : nonreservedword + | analyze_keyword + ; + +vac_analyze_option_arg + : opt_boolean_or_string + | numericonly + ; + +opt_analyze + : analyze_keyword + ; + +analyze_options_list + : analyze_option_elem (COMMA analyze_option_elem)* + ; + +analyze_option_elem + : opt_verbose + | opt_skiplock + | opt_buffer_usage_limit + ; // support on v12+ + +opt_verbose + : KW_VERBOSE (KW_FALSE | KW_TRUE)? + ; + +opt_skiplock + : KW_SKIP_LOCKED (KW_FALSE | KW_TRUE)? + ; + +opt_buffer_usage_limit + : KW_BUFFER_USAGE_LIMIT (numericonly | sconst) + ; + +opt_full + : KW_FULL + ; + +opt_freeze + : KW_FREEZE + ; + +opt_name_list + : OPEN_PAREN columnlist CLOSE_PAREN + ; + +vacuum_relation + : table_name opt_name_list? + ; + +vacuum_relation_list + : vacuum_relation (COMMA vacuum_relation)* + ; + +opt_vacuum_relation_list + : vacuum_relation_list + ; + +explainstmt + : KW_EXPLAIN explainablestmt + | KW_EXPLAIN analyze_keyword opt_verbose? explainablestmt + | KW_EXPLAIN KW_VERBOSE explainablestmt + | KW_EXPLAIN OPEN_PAREN explain_option_list CLOSE_PAREN explainablestmt + ; + +explainablestmt + : selectstmt + | insertstmt + | updatestmt + | deletestmt + | declarecursorstmt + | createasstmt + | creatematviewstmt + | refreshmatviewstmt + | executestmt + ; + +explain_option_list + : explain_option_elem (COMMA explain_option_elem)* + ; + +explain_option_elem + : explain_option_name explain_option_arg? + ; + +explain_option_name + : nonreservedword + | analyze_keyword + ; + +explain_option_arg + : opt_boolean_or_string + | numericonly + ; + +preparestmt + : KW_PREPARE name prep_type_clause? KW_AS preparablestmt + ; + +prep_type_clause + : OPEN_PAREN type_list CLOSE_PAREN + ; + +preparablestmt + : selectstmt + | insertstmt + | updatestmt + | deletestmt + ; + +executestmt + : KW_EXECUTE name execute_param_clause? + | KW_CREATE opttemp? KW_TABLE opt_if_not_exists? create_as_target KW_AS KW_EXECUTE name execute_param_clause? opt_with_data? + ; + +execute_param_clause + : OPEN_PAREN expr_list CLOSE_PAREN + ; + +deallocatestmt + : KW_DEALLOCATE name + | KW_DEALLOCATE KW_PREPARE name + | KW_DEALLOCATE KW_ALL + | KW_DEALLOCATE KW_PREPARE KW_ALL + ; + +insertstmt + : opt_with_clause? KW_INSERT KW_INTO insert_target insert_rest opt_on_conflict? returning_clause? + ; + +insert_target + : table_name (KW_AS colid)? + ; + +insert_rest + : (OPEN_PAREN insert_column_list CLOSE_PAREN)? (KW_OVERRIDING override_kind KW_VALUE)? ( + default_values_or_values + | selectstmt + ) + ; + +override_kind + : KW_USER + | KW_SYSTEM + ; + +insert_column_list + : insert_column_item (COMMA insert_column_item)* + ; + +insert_column_item + : column_name opt_indirection + ; + +opt_on_conflict + : KW_ON KW_CONFLICT opt_conf_expr? KW_DO ( + KW_UPDATE KW_SET set_clause_list where_clause? + | KW_NOTHING + ) + ; + +opt_conf_expr + : OPEN_PAREN index_params CLOSE_PAREN where_clause? + | KW_ON KW_CONSTRAINT name + ; + +returning_clause + : KW_RETURNING target_list + ; + +deletestmt + : opt_with_clause? KW_DELETE KW_FROM relation_expr_opt_alias using_clause? where_or_current_clause? returning_clause? + ; + +using_clause + : KW_USING from_list + ; + +lockstmt + : KW_LOCK opt_table? relation_expr_list opt_lock? opt_nowait? + ; + +opt_lock + : KW_IN lock_type KW_MODE + ; + +lock_type + : KW_ACCESS (KW_SHARE | KW_EXCLUSIVE) + | KW_ROW (KW_SHARE | KW_EXCLUSIVE) + | KW_SHARE (KW_UPDATE KW_EXCLUSIVE | KW_ROW KW_EXCLUSIVE)? + | KW_EXCLUSIVE + ; + +opt_nowait + : KW_NOWAIT + ; + +opt_nowait_or_skip + : KW_NOWAIT + | KW_SKIP KW_LOCKED + ; + +updatestmt + : opt_with_clause? KW_UPDATE relation_expr_opt_alias KW_SET set_clause_list from_clause? where_or_current_clause? returning_clause? + ; + +set_clause_list + : set_clause (COMMA set_clause)* + ; + +set_clause + : set_target EQUAL a_expr + | OPEN_PAREN set_target_list CLOSE_PAREN EQUAL ( + KW_ROW? a_expr + | OPEN_PAREN select_clause CLOSE_PAREN + ) + ; + +set_target + : column_name opt_indirection + ; + +set_target_list + : set_target (COMMA set_target)* + ; + +declarecursorstmt + : KW_DECLARE cursor_name cursor_options KW_CURSOR opt_hold KW_FOR selectstmt + ; + +cursor_name + : name + ; + +cursor_options + : (KW_NO KW_SCROLL | KW_SCROLL | KW_BINARY | KW_INSENSITIVE)* + ; + +opt_hold + : + | KW_WITH KW_HOLD + | KW_WITHOUT KW_HOLD + ; -opt_definition: KW_WITH definition; - -table_func_column: column_name func_type; - -table_func_column_list: - table_func_column (COMMA table_func_column)*; - -alterfunctionstmt: - KW_ALTER alterFunctionTypeClause alterfunc_opt_list opt_restrict?; - -alterFunctionTypeClause: KW_FUNCTION function_with_argtypes | KW_PROCEDURE procedure_with_argtypes | KW_ROUTINE routine_with_argtypes; - -alterfunc_opt_list: common_func_opt_item+; - -opt_restrict: KW_RESTRICT; - -removefuncstmt: - KW_DROP KW_FUNCTION opt_if_exists? function_with_argtypes_list opt_drop_behavior? - | KW_DROP KW_PROCEDURE opt_if_exists? procedure_with_argtypes_list opt_drop_behavior? - | KW_DROP KW_ROUTINE opt_if_exists? routine_with_argtypes_list opt_drop_behavior?; - -removeaggrstmt: - KW_DROP KW_AGGREGATE opt_if_exists? aggregate_with_argtypes_list opt_drop_behavior?; - -removeoperstmt: - KW_DROP KW_OPERATOR opt_if_exists? operator_with_argtypes_list opt_drop_behavior?; - -oper_argtypes: - OPEN_PAREN typename CLOSE_PAREN - | OPEN_PAREN typename COMMA typename CLOSE_PAREN - | OPEN_PAREN KW_NONE COMMA typename CLOSE_PAREN - | OPEN_PAREN typename COMMA KW_NONE CLOSE_PAREN; - -any_operator: (colid DOT)* all_op; - -operator_with_argtypes_list: - operator_with_argtypes (COMMA operator_with_argtypes)*; - -operator_with_argtypes: any_operator oper_argtypes; - -dostmt: KW_DO dostmt_opt_list; - -dostmt_opt_list: dostmt_opt_item+; - -dostmt_opt_item: sconst | KW_LANGUAGE nonreservedword_or_sconst; - -createcaststmt: - KW_CREATE KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN KW_WITH KW_FUNCTION function_with_argtypes - cast_context? - | KW_CREATE KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN KW_WITHOUT KW_FUNCTION cast_context? - | KW_CREATE KW_CAST OPEN_PAREN typename KW_AS typename CLOSE_PAREN KW_WITH KW_INOUT cast_context?; - -cast_context: KW_AS KW_IMPLICIT | KW_AS KW_ASSIGNMENT; - -opt_if_exists: KW_IF KW_EXISTS; - -createtransformstmt: - KW_CREATE opt_or_replace? KW_TRANSFORM KW_FOR typename KW_LANGUAGE name OPEN_PAREN transform_element_list - CLOSE_PAREN; - -transform_element_list: - KW_FROM KW_SQL KW_WITH KW_FUNCTION function_with_argtypes COMMA KW_TO KW_SQL KW_WITH KW_FUNCTION - function_with_argtypes - | KW_TO KW_SQL KW_WITH KW_FUNCTION function_with_argtypes COMMA KW_FROM KW_SQL KW_WITH KW_FUNCTION - function_with_argtypes - | KW_FROM KW_SQL KW_WITH KW_FUNCTION function_with_argtypes - | KW_TO KW_SQL KW_WITH KW_FUNCTION function_with_argtypes; - -reindexstmt: - KW_REINDEX reindex_target_type - | KW_REINDEX reindex_target_multitable - | KW_REINDEX OPEN_PAREN reindex_option_list CLOSE_PAREN reindex_target_type - | KW_REINDEX OPEN_PAREN reindex_option_list CLOSE_PAREN reindex_target_multitable; - -reindex_target_type: (KW_INDEX opt_concurrently? qualified_name) | (KW_TABLE opt_concurrently? table_name); - -reindex_target_multitable: (KW_SCHEMA opt_concurrently? schema_name) | (KW_SYSTEM opt_concurrently? name) | (KW_DATABASE opt_concurrently? database_name); - -reindex_option_list: - reindex_option_elem (COMMA reindex_option_elem)*; - -reindex_option_elem: KW_VERBOSE; - -altertblspcstmt: - KW_ALTER KW_TABLESPACE tablespace_name KW_SET reloptions - | KW_ALTER KW_TABLESPACE tablespace_name KW_RESET reloptions; - -renamestmt: - KW_ALTER KW_AGGREGATE aggregate_with_argtypes KW_RENAME KW_TO name - | KW_ALTER KW_COLLATION any_name KW_RENAME KW_TO name - | KW_ALTER KW_CONVERSION any_name KW_RENAME KW_TO name - | KW_ALTER KW_DATABASE database_name KW_RENAME KW_TO database_name_create - | KW_ALTER KW_DOMAIN any_name KW_RENAME KW_TO name - | KW_ALTER KW_DOMAIN any_name KW_RENAME KW_CONSTRAINT name KW_TO name - | KW_ALTER KW_FOREIGN KW_DATA KW_WRAPPER name KW_RENAME KW_TO name - | KW_ALTER KW_FUNCTION function_with_argtypes KW_RENAME KW_TO function_name_create - | KW_ALTER KW_GROUP roleid KW_RENAME KW_TO roleid - | KW_ALTER opt_procedural? KW_LANGUAGE name KW_RENAME KW_TO name - | KW_ALTER KW_OPERATOR KW_CLASS any_name KW_USING name KW_RENAME KW_TO name - | KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_RENAME KW_TO name - | KW_ALTER KW_POLICY opt_if_exists? name KW_ON qualified_name KW_RENAME KW_TO name - | KW_ALTER KW_PROCEDURE procedure_with_argtypes KW_RENAME KW_TO procedure_name_create - | KW_ALTER KW_PUBLICATION name KW_RENAME KW_TO name - | KW_ALTER KW_ROUTINE routine_with_argtypes KW_RENAME KW_TO name - | KW_ALTER KW_SCHEMA schema_name KW_RENAME KW_TO schema_name_create - | KW_ALTER KW_SERVER name KW_RENAME KW_TO name - | KW_ALTER KW_SUBSCRIPTION name KW_RENAME KW_TO name - | KW_ALTER KW_TABLE opt_if_exists? relation_expr KW_RENAME KW_TO table_name_create - | KW_ALTER KW_SEQUENCE opt_if_exists? qualified_name KW_RENAME KW_TO name - | KW_ALTER KW_VIEW opt_if_exists? view_name KW_RENAME KW_TO view_name_create - | KW_ALTER KW_MATERIALIZED KW_VIEW opt_if_exists? view_name KW_RENAME KW_TO view_name_create - | KW_ALTER KW_INDEX opt_if_exists? qualified_name KW_RENAME KW_TO name - | KW_ALTER KW_FOREIGN KW_TABLE opt_if_exists? relation_expr KW_RENAME KW_TO table_name_create - | KW_ALTER KW_TABLE opt_if_exists? relation_expr KW_RENAME opt_column? column_name KW_TO column_name_create - | KW_ALTER KW_VIEW opt_if_exists? view_name KW_RENAME opt_column? column_name KW_TO column_name_create - | KW_ALTER KW_MATERIALIZED KW_VIEW opt_if_exists? view_name KW_RENAME opt_column? column_name KW_TO column_name_create - | KW_ALTER KW_TABLE opt_if_exists? relation_expr KW_RENAME KW_CONSTRAINT name KW_TO name - | KW_ALTER KW_FOREIGN KW_TABLE opt_if_exists? relation_expr KW_RENAME opt_column? column_name KW_TO column_name_create - | KW_ALTER KW_RULE name KW_ON qualified_name KW_RENAME KW_TO name - | KW_ALTER KW_TRIGGER name KW_ON qualified_name KW_RENAME KW_TO name - | KW_ALTER KW_EVENT KW_TRIGGER name KW_RENAME KW_TO name - | KW_ALTER KW_ROLE roleid KW_RENAME KW_TO roleid - | KW_ALTER KW_USER roleid KW_RENAME KW_TO roleid - | KW_ALTER KW_TABLESPACE tablespace_name KW_RENAME KW_TO tablespace_name_create - | KW_ALTER KW_STATISTICS any_name KW_RENAME KW_TO name - | KW_ALTER KW_TEXT KW_SEARCH KW_PARSER any_name KW_RENAME KW_TO name - | KW_ALTER KW_TEXT KW_SEARCH KW_DICTIONARY any_name KW_RENAME KW_TO name - | KW_ALTER KW_TEXT KW_SEARCH KW_TEMPLATE any_name KW_RENAME KW_TO name - | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_RENAME KW_TO name - | KW_ALTER KW_TYPE any_name KW_RENAME KW_TO name - | KW_ALTER KW_TYPE any_name KW_RENAME KW_ATTRIBUTE name KW_TO name opt_drop_behavior?; - -opt_column: KW_COLUMN; - -opt_set_data: KW_SET KW_DATA; - -alterobjectdependsstmt: - KW_ALTER KW_FUNCTION function_with_argtypes opt_no? KW_DEPENDS KW_ON KW_EXTENSION name - | KW_ALTER KW_PROCEDURE procedure_with_argtypes opt_no? KW_DEPENDS KW_ON KW_EXTENSION name - | KW_ALTER KW_ROUTINE routine_with_argtypes opt_no? KW_DEPENDS KW_ON KW_EXTENSION name - | KW_ALTER KW_TRIGGER name KW_ON qualified_name opt_no? KW_DEPENDS KW_ON KW_EXTENSION name - | KW_ALTER KW_MATERIALIZED KW_VIEW view_name opt_no? KW_DEPENDS KW_ON KW_EXTENSION name - | KW_ALTER KW_INDEX qualified_name opt_no? KW_DEPENDS KW_ON KW_EXTENSION name; - -opt_no: KW_NO; - -alterobjectschemastmt: - KW_ALTER KW_AGGREGATE aggregate_with_argtypes KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_COLLATION any_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_CONVERSION any_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_DOMAIN any_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_EXTENSION name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_FUNCTION function_with_argtypes KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_OPERATOR operator_with_argtypes KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_OPERATOR KW_CLASS any_name KW_USING name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_PROCEDURE procedure_with_argtypes KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_ROUTINE routine_with_argtypes KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_TABLE opt_if_exists? relation_expr KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_STATISTICS any_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_TEXT KW_SEARCH KW_PARSER any_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_TEXT KW_SEARCH KW_DICTIONARY any_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_TEXT KW_SEARCH KW_TEMPLATE any_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_SEQUENCE opt_if_exists? qualified_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_VIEW opt_if_exists? view_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_MATERIALIZED KW_VIEW opt_if_exists? view_name KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_FOREIGN KW_TABLE opt_if_exists? relation_expr KW_SET KW_SCHEMA schema_name_create - | KW_ALTER KW_TYPE any_name KW_SET KW_SCHEMA schema_name_create; - -alteroperatorstmt: - KW_ALTER KW_OPERATOR operator_with_argtypes KW_SET OPEN_PAREN operator_def_list CLOSE_PAREN; - -operator_def_list: operator_def_elem (COMMA operator_def_elem)*; - -operator_def_elem: - collabel EQUAL KW_NONE - | collabel EQUAL operator_def_arg; - -operator_def_arg: - func_type - | reserved_keyword - | qual_all_op - | numericonly - | sconst; - -altertypestmt: - KW_ALTER KW_TYPE any_name KW_SET OPEN_PAREN operator_def_list CLOSE_PAREN; - -alterownerstmt: - KW_ALTER KW_AGGREGATE aggregate_with_argtypes KW_OWNER KW_TO rolespec - | KW_ALTER KW_COLLATION any_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_CONVERSION any_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_DATABASE database_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_DOMAIN any_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_FUNCTION function_with_argtypes KW_OWNER KW_TO rolespec - | KW_ALTER opt_procedural? KW_LANGUAGE name KW_OWNER KW_TO rolespec - | KW_ALTER KW_LARGE KW_OBJECT numericonly KW_OWNER KW_TO rolespec - | KW_ALTER KW_OPERATOR operator_with_argtypes KW_OWNER KW_TO rolespec - | KW_ALTER KW_OPERATOR KW_CLASS any_name KW_USING name KW_OWNER KW_TO rolespec - | KW_ALTER KW_OPERATOR KW_FAMILY any_name KW_USING name KW_OWNER KW_TO rolespec - | KW_ALTER KW_PROCEDURE procedure_with_argtypes KW_OWNER KW_TO rolespec - | KW_ALTER KW_ROUTINE routine_with_argtypes KW_OWNER KW_TO rolespec - | KW_ALTER KW_SCHEMA schema_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_TYPE any_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_TABLESPACE tablespace_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_STATISTICS any_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_TEXT KW_SEARCH KW_DICTIONARY any_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_OWNER KW_TO rolespec - | KW_ALTER KW_FOREIGN KW_DATA KW_WRAPPER name KW_OWNER KW_TO rolespec - | KW_ALTER KW_SERVER name KW_OWNER KW_TO rolespec - | KW_ALTER KW_EVENT KW_TRIGGER name KW_OWNER KW_TO rolespec - | KW_ALTER KW_PUBLICATION name KW_OWNER KW_TO rolespec - | KW_ALTER KW_SUBSCRIPTION name KW_OWNER KW_TO rolespec; - -createpublicationstmt: - KW_CREATE KW_PUBLICATION name opt_publication_for_tables? opt_definition?; - -opt_publication_for_tables: publication_for_tables; - -publication_for_tables: - KW_FOR KW_TABLE relation_expr_list - | KW_FOR KW_ALL KW_TABLES; - -alterpublicationstmt: - KW_ALTER KW_PUBLICATION name KW_SET definition - | KW_ALTER KW_PUBLICATION name KW_ADD publication_relation_expr_list - | KW_ALTER KW_PUBLICATION name KW_SET publication_relation_expr_list - | KW_ALTER KW_PUBLICATION name KW_DROP publication_relation_expr_list - | KW_ALTER KW_PUBLICATION name KW_OWNER KW_TO rolespec - | KW_ALTER KW_PUBLICATION name KW_RENAME KW_TO name; - -createsubscriptionstmt: - KW_CREATE KW_SUBSCRIPTION name KW_CONNECTION sconst KW_PUBLICATION publication_name_list opt_definition?; - -publication_name_list: - publication_name_item (COMMA publication_name_item)*; - -publication_name_item: collabel; - -altersubscriptionstmt: - KW_ALTER KW_SUBSCRIPTION name KW_SET definition - | KW_ALTER KW_SUBSCRIPTION name KW_CONNECTION sconst - | KW_ALTER KW_SUBSCRIPTION name KW_REFRESH KW_PUBLICATION opt_definition? - | KW_ALTER KW_SUBSCRIPTION name KW_SET KW_PUBLICATION publication_name_list opt_definition? - | KW_ALTER KW_SUBSCRIPTION name KW_ADD KW_PUBLICATION publication_name_list opt_definition? - | KW_ALTER KW_SUBSCRIPTION name KW_DROP KW_PUBLICATION publication_name_list opt_definition? - | KW_ALTER KW_SUBSCRIPTION name KW_ENABLE - | KW_ALTER KW_SUBSCRIPTION name KW_DISABLE - | KW_ALTER KW_SUBSCRIPTION name KW_SET definition - | KW_ALTER KW_SUBSCRIPTION name KW_SKIP OPEN_PAREN old_aggr_elem CLOSE_PAREN - | KW_ALTER KW_SUBSCRIPTION name KW_OWNER KW_TO rolespec; - - -rulestmt: - KW_CREATE opt_or_replace? KW_RULE name KW_AS KW_ON event KW_TO qualified_name where_clause? KW_DO opt_instead? - ruleactionlist; - -ruleactionlist: - KW_NOTHING - | ruleactionstmt - | OPEN_PAREN ruleactionmulti CLOSE_PAREN; - -ruleactionmulti: - ruleactionstmtOrEmpty? (SEMI ruleactionstmtOrEmpty?)*; - -ruleactionstmt: - selectstmt - | insertstmt - | updatestmt - | deletestmt - | notifystmt; - -ruleactionstmtOrEmpty: ruleactionstmt; - -event: KW_SELECT | KW_UPDATE | KW_DELETE | KW_INSERT; - -opt_instead: KW_INSTEAD | KW_ALSO; - -notifystmt: KW_NOTIFY colid notify_payload?; - -notify_payload: COMMA sconst; - -listenstmt: KW_LISTEN colid; - -unlistenstmt: KW_UNLISTEN colid | KW_UNLISTEN STAR; - -transactionstmt: - KW_ABORT opt_transaction? opt_transaction_chain? - | KW_BEGIN opt_transaction? transaction_mode_list_or_empty? - | KW_START KW_TRANSACTION transaction_mode_list_or_empty? - | KW_COMMIT opt_transaction? opt_transaction_chain? - | KW_END opt_transaction? opt_transaction_chain? - | KW_ROLLBACK opt_transaction? opt_transaction_chain? - | KW_SAVEPOINT colid - | KW_RELEASE KW_SAVEPOINT colid - | KW_RELEASE colid - | KW_ROLLBACK opt_transaction? KW_TO KW_SAVEPOINT colid - | KW_ROLLBACK opt_transaction? KW_TO colid - | KW_PREPARE KW_TRANSACTION sconst - | KW_COMMIT KW_PREPARED sconst - | KW_ROLLBACK KW_PREPARED sconst; - -opt_transaction: KW_WORK | KW_TRANSACTION; - -transaction_mode_item: - KW_ISOLATION KW_LEVEL iso_level - | KW_READ KW_ONLY - | KW_READ KW_WRITE - | KW_DEFERRABLE - | KW_NOT KW_DEFERRABLE; - -transaction_mode_list: - transaction_mode_item (COMMA? transaction_mode_item)*; - -transaction_mode_list_or_empty: transaction_mode_list; - -opt_transaction_chain: KW_AND KW_NO? KW_CHAIN; - -viewstmt: - KW_CREATE (KW_OR KW_REPLACE)? opttemp? ( - KW_VIEW view_name_create opt_column_list? opt_reloptions? - | KW_RECURSIVE KW_VIEW view_name_create OPEN_PAREN columnlist CLOSE_PAREN opt_reloptions? - ) KW_AS selectstmt opt_check_option?; - -opt_check_option: KW_WITH (KW_CASCADED | KW_LOCAL)? KW_CHECK KW_OPTION; - -loadstmt: KW_LOAD file_name; - -createdbstmt: KW_CREATE KW_DATABASE database_name_create opt_with? createdb_opt_list?; - -createdb_opt_list: createdb_opt_items; - -createdb_opt_items: createdb_opt_item+; - -createdb_opt_item: - createdb_opt_name opt_equal? ( - signediconst - | opt_boolean_or_string - | KW_DEFAULT - ); - -createdb_opt_name: - identifier - | KW_CONNECTION KW_LIMIT - | KW_ENCODING - | KW_LOCATION - | KW_OWNER - | KW_TABLESPACE - | KW_TEMPLATE; - -opt_equal: EQUAL; - -alterdatabasestmt: - KW_ALTER KW_DATABASE database_name ( - (KW_WITH? createdb_opt_list)? - | createdb_opt_list? - | (KW_SET KW_TABLESPACE tablespace_name_create)? - ); - -alterdatabasesetstmt: KW_ALTER KW_DATABASE database_name setresetclause?; - -drop_option_list: drop_option (COMMA drop_option)*; - -drop_option: KW_FORCE; - -altercollationstmt: KW_ALTER KW_COLLATION any_name KW_REFRESH KW_VERSION; - -altersystemstmt: KW_ALTER KW_SYSTEM (KW_SET | KW_RESET) generic_set; - -createdomainstmt: - KW_CREATE KW_DOMAIN any_name opt_as? typename colquallist; - -alterdomainstmt: - KW_ALTER KW_DOMAIN any_name ( - alter_column_default - | KW_DROP KW_NOT KW_NULL - | KW_SET KW_NOT KW_NULL - | KW_ADD tableconstraint - | KW_DROP KW_CONSTRAINT opt_if_exists? name opt_drop_behavior? - | KW_VALIDATE KW_CONSTRAINT name - ); - -opt_as: KW_AS; - -altertsdictionarystmt: - KW_ALTER KW_TEXT KW_SEARCH KW_DICTIONARY any_name definition; - -altertsconfigurationstmt: - KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_ADD KW_MAPPING KW_FOR name_list any_with any_name_list - | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_ALTER KW_MAPPING KW_FOR name_list any_with any_name_list - | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_ALTER KW_MAPPING KW_REPLACE any_name any_with any_name - | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_ALTER KW_MAPPING KW_FOR name_list KW_REPLACE any_name - any_with any_name - | KW_ALTER KW_TEXT KW_SEARCH KW_CONFIGURATION any_name KW_DROP KW_MAPPING opt_if_exists? KW_FOR name_list; - -any_with: - KW_WITH - ; // | WITH_LA - -createconversionstmt: - KW_CREATE opt_default? KW_CONVERSION any_name KW_FOR sconst KW_TO sconst KW_FROM any_name; - -clusterstmt: - KW_CLUSTER opt_verbose? table_name cluster_index_specification? - | KW_CLUSTER opt_verbose? - | KW_CLUSTER opt_verbose_list table_name cluster_index_specification?; - -opt_verbose_list: OPEN_PAREN opt_verbose (COMMA opt_verbose)* CLOSE_PAREN; - -cluster_index_specification: KW_USING name; - -vacuumstmt: - KW_VACUUM opt_full? opt_freeze? opt_verbose? opt_analyze? opt_vacuum_relation_list? - | KW_VACUUM (OPEN_PAREN vac_analyze_option_list CLOSE_PAREN)? opt_vacuum_relation_list?; - -analyzestmt: - analyze_keyword opt_verbose? opt_vacuum_relation_list? - | analyze_keyword OPEN_PAREN analyze_options_list CLOSE_PAREN opt_vacuum_relation_list?; - -vac_analyze_option_list: - vac_analyze_option_elem (COMMA vac_analyze_option_elem)*; - -analyze_keyword: KW_ANALYZE | KW_ANALYSE; - -vac_analyze_option_elem: - vac_analyze_option_name vac_analyze_option_arg?; - -vac_analyze_option_name: nonreservedword | analyze_keyword; - -vac_analyze_option_arg: opt_boolean_or_string | numericonly; - -opt_analyze: analyze_keyword; - -analyze_options_list: analyze_option_elem (COMMA analyze_option_elem)*; - -analyze_option_elem: opt_verbose | opt_skiplock | opt_buffer_usage_limit; // support on v12+ - -opt_verbose: KW_VERBOSE (KW_FALSE | KW_TRUE)?; - -opt_skiplock: KW_SKIP_LOCKED (KW_FALSE | KW_TRUE)?; - -opt_buffer_usage_limit: KW_BUFFER_USAGE_LIMIT (numericonly | sconst); - -opt_full: KW_FULL; - -opt_freeze: KW_FREEZE; - -opt_name_list: OPEN_PAREN columnlist CLOSE_PAREN; - -vacuum_relation: table_name opt_name_list?; - -vacuum_relation_list: vacuum_relation (COMMA vacuum_relation)*; - -opt_vacuum_relation_list: vacuum_relation_list; - -explainstmt: - KW_EXPLAIN explainablestmt - | KW_EXPLAIN analyze_keyword opt_verbose? explainablestmt - | KW_EXPLAIN KW_VERBOSE explainablestmt - | KW_EXPLAIN OPEN_PAREN explain_option_list CLOSE_PAREN explainablestmt; - -explainablestmt: - selectstmt - | insertstmt - | updatestmt - | deletestmt - | declarecursorstmt - | createasstmt - | creatematviewstmt - | refreshmatviewstmt - | executestmt; - -explain_option_list: - explain_option_elem (COMMA explain_option_elem)*; - -explain_option_elem: explain_option_name explain_option_arg?; - -explain_option_name: nonreservedword | analyze_keyword; - -explain_option_arg: opt_boolean_or_string | numericonly; - -preparestmt: KW_PREPARE name prep_type_clause? KW_AS preparablestmt; - -prep_type_clause: OPEN_PAREN type_list CLOSE_PAREN; - -preparablestmt: - selectstmt - | insertstmt - | updatestmt - | deletestmt; - -executestmt: - KW_EXECUTE name execute_param_clause? - | KW_CREATE opttemp? KW_TABLE opt_if_not_exists? create_as_target KW_AS KW_EXECUTE name execute_param_clause? - opt_with_data?; - -execute_param_clause: OPEN_PAREN expr_list CLOSE_PAREN; - -deallocatestmt: - KW_DEALLOCATE name - | KW_DEALLOCATE KW_PREPARE name - | KW_DEALLOCATE KW_ALL - | KW_DEALLOCATE KW_PREPARE KW_ALL; - -insertstmt: - opt_with_clause? KW_INSERT KW_INTO insert_target insert_rest opt_on_conflict? returning_clause?; - -insert_target: table_name (KW_AS colid)?; - -insert_rest: - (OPEN_PAREN insert_column_list CLOSE_PAREN)? ( - KW_OVERRIDING override_kind KW_VALUE - )? (default_values_or_values | selectstmt); - -override_kind: KW_USER | KW_SYSTEM; - -insert_column_list: - insert_column_item (COMMA insert_column_item)*; - -insert_column_item: column_name opt_indirection; - -opt_on_conflict: - KW_ON KW_CONFLICT opt_conf_expr? KW_DO ( - KW_UPDATE KW_SET set_clause_list where_clause? - | KW_NOTHING - ); - -opt_conf_expr: - OPEN_PAREN index_params CLOSE_PAREN where_clause? - | KW_ON KW_CONSTRAINT name; - -returning_clause: KW_RETURNING target_list; - -deletestmt: - opt_with_clause? KW_DELETE KW_FROM relation_expr_opt_alias using_clause? where_or_current_clause? - returning_clause?; - -using_clause: KW_USING from_list; - -lockstmt: - KW_LOCK opt_table? relation_expr_list opt_lock? opt_nowait?; - -opt_lock: KW_IN lock_type KW_MODE; - -lock_type: - KW_ACCESS (KW_SHARE | KW_EXCLUSIVE) - | KW_ROW (KW_SHARE | KW_EXCLUSIVE) - | KW_SHARE (KW_UPDATE KW_EXCLUSIVE | KW_ROW KW_EXCLUSIVE)? - | KW_EXCLUSIVE; - -opt_nowait: KW_NOWAIT; - -opt_nowait_or_skip: KW_NOWAIT | KW_SKIP KW_LOCKED; - -updatestmt: - opt_with_clause? KW_UPDATE relation_expr_opt_alias KW_SET set_clause_list from_clause? - where_or_current_clause? returning_clause?; - -set_clause_list: set_clause (COMMA set_clause)*; - -set_clause: - set_target EQUAL a_expr - | OPEN_PAREN set_target_list CLOSE_PAREN EQUAL (KW_ROW? a_expr | OPEN_PAREN select_clause CLOSE_PAREN); - -set_target: column_name opt_indirection; - -set_target_list: set_target (COMMA set_target)*; - -declarecursorstmt: - KW_DECLARE cursor_name cursor_options KW_CURSOR opt_hold KW_FOR selectstmt; - -cursor_name: name; - -cursor_options: (KW_NO KW_SCROLL | KW_SCROLL | KW_BINARY | KW_INSENSITIVE)*; - -opt_hold: | KW_WITH KW_HOLD | KW_WITHOUT KW_HOLD; /* TODO: why select_with_parens alternative is needed at all? i guess it because original byson grammar can choose selectstmt(2)->select_with_parens on only OPEN_PARENT/SELECT kewords at the @@ -2151,375 +3002,536 @@ opt_hold: | KW_WITH KW_HOLD | KW_WITHOUT KW_HOLD; all standard tests passed on both variants */ -selectstmt: select_no_parens | select_with_parens; +selectstmt + : select_no_parens + | select_with_parens + ; + +select_with_parens + : OPEN_PAREN select_no_parens CLOSE_PAREN + | OPEN_PAREN select_with_parens CLOSE_PAREN + ; + +select_no_parens + : select_clause opt_sort_clause? ( + for_locking_clause opt_select_limit? + | select_limit opt_for_locking_clause? + )? + | with_clause select_clause opt_sort_clause? ( + for_locking_clause opt_select_limit? + | select_limit opt_for_locking_clause? + )? + ; + +select_clause + : simple_select + | select_with_parens + ; + +simple_select + : ( + KW_SELECT (opt_all_clause? into_clause? opt_target_list? | distinct_clause? target_list?) into_clause? from_clause? where_clause? group_clause + ? having_clause? window_clause? + | values_clause + | KW_TABLE relation_expr + | select_with_parens set_operator_with_all_or_distinct (simple_select | select_with_parens) + ) (set_operator_with_all_or_distinct ( simple_select | select_with_parens))* + ; + +set_operator + : KW_UNION # union + | KW_INTERSECT # intersect + | KW_EXCEPT # except + ; + +set_operator_with_all_or_distinct + : set_operator all_or_distinct? + ; + +with_clause + : KW_WITH KW_RECURSIVE? cte_list + ; + +cte_list + : common_table_expr (COMMA common_table_expr)* + ; + +common_table_expr + : name opt_name_list? KW_AS opt_materialized? OPEN_PAREN preparablestmt CLOSE_PAREN search_cluase? cycle_cluase? + ; + +search_cluase + : KW_SEARCH (KW_BREADTH | KW_DEPTH) KW_FIRST KW_BY columnlist KW_SET column_name + ; + +cycle_cluase + : KW_CYCLE columnlist KW_SET column_name (KW_TO name KW_DEFAULT name)? KW_USING column_name + ; + +opt_materialized + : KW_MATERIALIZED + | KW_NOT KW_MATERIALIZED + ; + +opt_with_clause + : with_clause + ; + +into_clause + : KW_INTO (opt_strict opttempTableName | into_target) + ; + +opt_strict + : + | KW_STRICT + ; + +opttempTableName + : (KW_LOCAL | KW_GLOBAL)? (KW_TEMPORARY | KW_TEMP) opt_table? table_name_create + | KW_UNLOGGED opt_table? table_name_create + | KW_TABLE table_name_create + | table_name_create + ; + +opt_table + : KW_TABLE + ; + +all_or_distinct + : KW_ALL + | KW_DISTINCT + ; + +distinct_clause + : KW_DISTINCT (KW_ON OPEN_PAREN expr_list CLOSE_PAREN)? + ; + +opt_all_clause + : KW_ALL + ; + +opt_sort_clause + : sort_clause + ; + +sort_clause + : KW_ORDER KW_BY sortby_list + ; + +sortby_list + : sortby (COMMA sortby)* + ; + +sortby + : column_expr_noparen (KW_USING qual_all_op | opt_asc_desc)? opt_nulls_order? + ; + +select_limit + : // https://www.postgresql.org/docs/16/sql-select.html#SQL-LIMIT + limit_clause offset_clause? + | offset_clause fetch_clause? + | fetch_clause offset_clause? + ; + +opt_select_limit + : select_limit + ; + +limit_clause + : KW_LIMIT select_limit_value (COMMA select_offset_value)? + ; + +fetch_clause + : KW_FETCH first_or_next ( + select_fetch_first_value row_or_rows (KW_ONLY | KW_WITH KW_TIES) + | row_or_rows (KW_ONLY | KW_WITH KW_TIES) + ) + ; + +offset_clause + : KW_OFFSET (select_offset_value | select_fetch_first_value row_or_rows) + ; + +select_limit_value + : a_expr + | KW_ALL + ; + +select_offset_value + : a_expr + ; + +select_fetch_first_value + : c_expr + | PLUS i_or_f_const + | MINUS i_or_f_const + ; + +i_or_f_const + : iconst + | fconst + ; + +row_or_rows + : KW_ROW + | KW_ROWS + ; + +first_or_next + : KW_FIRST + | KW_NEXT + ; + +group_clause + : KW_GROUP KW_BY (all_or_distinct)? group_by_list + ; + +group_by_list + : group_by_item (COMMA group_by_item)* + ; + +group_by_item + : column_expr_noparen + | empty_grouping_set + | cube_clause + | rollup_clause + | grouping_sets_clause + | OPEN_PAREN column_expr_list_noparen CLOSE_PAREN + ; + +empty_grouping_set + : OPEN_PAREN CLOSE_PAREN + ; + +rollup_clause + : KW_ROLLUP OPEN_PAREN column_expr_list_noparen CLOSE_PAREN + ; + +cube_clause + : KW_CUBE OPEN_PAREN column_expr_list_noparen CLOSE_PAREN + ; + +grouping_sets_clause + : KW_GROUPING KW_SETS OPEN_PAREN group_by_list CLOSE_PAREN + ; + +having_clause + : KW_HAVING a_expr + ; + +for_locking_clause + : for_locking_items + | KW_FOR KW_READ KW_ONLY + ; + +opt_for_locking_clause + : for_locking_clause + ; + +for_locking_items + : for_locking_item+ + ; + +for_locking_item + : for_locking_strength locked_rels_list? opt_nowait_or_skip? + ; + +for_locking_strength + : KW_FOR ((KW_NO KW_KEY)? KW_UPDATE | KW_KEY? KW_SHARE) + ; + +locked_rels_list + : KW_OF qualified_name_list + ; + +values_clause + : KW_VALUES OPEN_PAREN expr_list CLOSE_PAREN (COMMA OPEN_PAREN expr_list CLOSE_PAREN)* + ; + +from_clause + : KW_FROM from_list + ; + +from_list + : table_ref (COMMA table_ref)* + ; + +table_ref + : ( + relation_expr opt_alias_clause? tablesample_clause? + | func_table func_alias_clause? + | xmltable opt_alias_clause? + | select_with_parens opt_alias_clause? + | KW_LATERAL ( + xmltable opt_alias_clause? + | func_table func_alias_clause? + | select_with_parens opt_alias_clause? + ) + | OPEN_PAREN table_ref ( + KW_CROSS KW_JOIN table_ref + | KW_NATURAL join_type? KW_JOIN table_ref + | join_type? KW_JOIN table_ref join_qual + )? CLOSE_PAREN opt_alias_clause? + ) ( + KW_CROSS KW_JOIN table_ref + | KW_NATURAL join_type? KW_JOIN table_ref + | join_type? KW_JOIN table_ref join_qual + )* + ; + +alias_clause + : KW_AS? colid (OPEN_PAREN name_list CLOSE_PAREN)? + ; + +opt_alias_clause + : alias_clause + ; + +func_alias_clause + : alias_clause + | (KW_AS colid? | colid) OPEN_PAREN tablefuncelementlist CLOSE_PAREN + ; + +join_type + : (KW_FULL | KW_LEFT | KW_RIGHT | KW_INNER) KW_OUTER? + ; + +join_qual + : KW_USING OPEN_PAREN columnlist CLOSE_PAREN + | KW_ON a_expr + ; + +relation_expr + : KW_ONLY? table_name STAR? columnlist? where_clause? + | KW_ONLY ( table_name | OPEN_PAREN table_name CLOSE_PAREN) + | KW_IN KW_SCHEMA (schema_name | KW_CURRENT_SCHEMA) + ; + +publication_relation_expr + : KW_TABLE KW_ONLY? table_name STAR? (OPEN_PAREN columnlist CLOSE_PAREN)? where_clause? + | KW_TABLE KW_ONLY ( table_name | OPEN_PAREN table_name CLOSE_PAREN) + | KW_TABLES KW_IN KW_SCHEMA (schema_name | KW_CURRENT_SCHEMA) + ; + +relation_expr_list + : relation_expr (COMMA relation_expr)* + ; + +publication_relation_expr_list + : publication_relation_expr (COMMA publication_relation_expr)* + ; + +relation_expr_opt_alias + : relation_expr (KW_AS? colid)? + ; + +tablesample_clause + : KW_TABLESAMPLE function_name OPEN_PAREN expr_list CLOSE_PAREN opt_repeatable_clause? + ; + +opt_repeatable_clause + : KW_REPEATABLE OPEN_PAREN a_expr CLOSE_PAREN + ; + +func_table + : func_expr_windowless opt_ordinality? + | KW_ROWS KW_FROM OPEN_PAREN rowsfrom_list CLOSE_PAREN opt_ordinality? + ; + +rowsfrom_item + : func_expr_windowless opt_col_def_list? + ; + +rowsfrom_list + : rowsfrom_item (COMMA rowsfrom_item)* + ; + +opt_col_def_list + : KW_AS OPEN_PAREN tablefuncelementlist CLOSE_PAREN + ; + +opt_ordinality + : KW_WITH KW_ORDINALITY + ; + +where_clause + : KW_WHERE column_expr_noparen + ; + +where_or_current_clause + : KW_WHERE (KW_CURRENT KW_OF cursor_name | a_expr) + ; + +opttablefuncelementlist + : tablefuncelementlist + ; + +tablefuncelementlist + : tablefuncelement (COMMA tablefuncelement)* + ; + +tablefuncelement + : colid typename opt_collate_clause? + ; + +xmltable + : KW_XMLTABLE OPEN_PAREN ( + c_expr xmlexists_argument KW_COLUMNS xmltable_column_list + | KW_XMLNAMESPACES OPEN_PAREN xml_namespace_list CLOSE_PAREN COMMA c_expr xmlexists_argument KW_COLUMNS xmltable_column_list + ) CLOSE_PAREN + ; + +xmltable_column_list + : xmltable_column_el (COMMA xmltable_column_el)* + ; + +xmltable_column_el + : colid (typename xmltable_column_option_list? | KW_FOR KW_ORDINALITY) + ; + +xmltable_column_option_list + : xmltable_column_option_el+ + ; + +xmltable_column_option_el + : KW_DEFAULT a_expr + | identifier a_expr + | KW_NOT KW_NULL + | KW_NULL + ; + +xml_namespace_list + : xml_namespace_el (COMMA xml_namespace_el)* + ; + +xml_namespace_el + : b_expr KW_AS collabel + | KW_DEFAULT b_expr + ; + +typename + : KW_SETOF? simpletypename (opt_array_bounds | KW_ARRAY (OPEN_BRACKET iconst CLOSE_BRACKET)?) + | qualified_name PERCENT (KW_ROWTYPE | KW_TYPE) + ; + +opt_array_bounds + : (OPEN_BRACKET iconst? CLOSE_BRACKET)* + ; + +simpletypename + : generictype + | numeric + | bit + | character + | constdatetime + | constinterval ( opt_interval? | OPEN_PAREN iconst CLOSE_PAREN) + ; + +consttypename + : numeric + | constbit + | constcharacter + | constdatetime + ; + +generictype + : type_function_name attrs? opt_type_modifiers? + ; + +opt_type_modifiers + : OPEN_PAREN expr_list CLOSE_PAREN + ; + +numeric + : KW_INT + | KW_INTEGER + | KW_SMALLINT + | KW_BIGINT + | KW_REAL + | KW_FLOAT opt_float? + | KW_DOUBLE KW_PRECISION + | KW_DECIMAL opt_type_modifiers? + | KW_DEC opt_type_modifiers? + | KW_NUMERIC opt_type_modifiers? + | KW_BOOLEAN + ; + +opt_float + : OPEN_PAREN iconst CLOSE_PAREN + ; + +bit + : bitwithlength + | bitwithoutlength + ; + +constbit + : bitwithlength + | bitwithoutlength + ; + +bitwithlength + : KW_BIT opt_varying? OPEN_PAREN expr_list CLOSE_PAREN + ; + +bitwithoutlength + : KW_BIT opt_varying? + ; + +character + : character_c (OPEN_PAREN iconst CLOSE_PAREN)? + ; + +constcharacter + : character_c (OPEN_PAREN iconst CLOSE_PAREN)? + ; + +character_c + : (KW_CHARACTER | KW_CHAR | KW_NCHAR) opt_varying? + | KW_VARCHAR + | KW_NATIONAL (KW_CHARACTER | KW_CHAR) opt_varying? + ; + +opt_varying + : KW_VARYING + ; + +constdatetime + : (KW_TIMESTAMP | KW_TIME) (OPEN_PAREN iconst CLOSE_PAREN)? opt_timezone? + ; + +constinterval + : KW_INTERVAL + ; -select_with_parens: - OPEN_PAREN select_no_parens CLOSE_PAREN - | OPEN_PAREN select_with_parens CLOSE_PAREN; - -select_no_parens: - select_clause opt_sort_clause? ( - for_locking_clause opt_select_limit? - | select_limit opt_for_locking_clause? - )? - | with_clause select_clause opt_sort_clause? ( - for_locking_clause opt_select_limit? - | select_limit opt_for_locking_clause? - )?; - -select_clause: simple_select | select_with_parens; - -simple_select: ( - KW_SELECT ( - opt_all_clause? into_clause? opt_target_list? - | distinct_clause? target_list? - ) into_clause? from_clause? where_clause? group_clause? having_clause? window_clause? - | values_clause - | KW_TABLE relation_expr - | select_with_parens set_operator_with_all_or_distinct ( - simple_select - | select_with_parens - ) - ) ( - set_operator_with_all_or_distinct ( - simple_select - | select_with_parens - ) - )*; - -set_operator: - KW_UNION # union - | KW_INTERSECT # intersect - | KW_EXCEPT # except; - -set_operator_with_all_or_distinct: - set_operator all_or_distinct?; - -with_clause: KW_WITH KW_RECURSIVE? cte_list; - -cte_list: common_table_expr (COMMA common_table_expr)*; - -common_table_expr: - name opt_name_list? KW_AS opt_materialized? OPEN_PAREN preparablestmt CLOSE_PAREN search_cluase? cycle_cluase?; - -search_cluase: - KW_SEARCH (KW_BREADTH | KW_DEPTH) KW_FIRST KW_BY columnlist KW_SET column_name; - -cycle_cluase: KW_CYCLE columnlist KW_SET column_name (KW_TO name KW_DEFAULT name)? KW_USING column_name; - -opt_materialized: KW_MATERIALIZED | KW_NOT KW_MATERIALIZED; - -opt_with_clause: with_clause; - -into_clause: KW_INTO (opt_strict opttempTableName | into_target); - -opt_strict: | KW_STRICT; - -opttempTableName: (KW_LOCAL | KW_GLOBAL)? (KW_TEMPORARY | KW_TEMP) opt_table? table_name_create - | KW_UNLOGGED opt_table? table_name_create - | KW_TABLE table_name_create - | table_name_create; - -opt_table: KW_TABLE; - -all_or_distinct: KW_ALL | KW_DISTINCT; - -distinct_clause: - KW_DISTINCT (KW_ON OPEN_PAREN expr_list CLOSE_PAREN)?; - -opt_all_clause: KW_ALL; - -opt_sort_clause: sort_clause; - -sort_clause: KW_ORDER KW_BY sortby_list; - -sortby_list: sortby (COMMA sortby)*; - -sortby: - column_expr_noparen (KW_USING qual_all_op | opt_asc_desc)? opt_nulls_order?; - -select_limit: // https://www.postgresql.org/docs/16/sql-select.html#SQL-LIMIT - limit_clause offset_clause? - | offset_clause fetch_clause? - | fetch_clause offset_clause? - ; - -opt_select_limit: select_limit; - -limit_clause: - KW_LIMIT select_limit_value (COMMA select_offset_value)?; - -fetch_clause: - KW_FETCH first_or_next ( - select_fetch_first_value row_or_rows (KW_ONLY | KW_WITH KW_TIES) - | row_or_rows (KW_ONLY | KW_WITH KW_TIES) - ); - -offset_clause: - KW_OFFSET ( - select_offset_value - | select_fetch_first_value row_or_rows - ); - -select_limit_value: a_expr | KW_ALL; - -select_offset_value: a_expr; - -select_fetch_first_value: - c_expr - | PLUS i_or_f_const - | MINUS i_or_f_const; - -i_or_f_const: iconst | fconst; - -row_or_rows: KW_ROW | KW_ROWS; - -first_or_next: KW_FIRST | KW_NEXT; - -group_clause: KW_GROUP KW_BY (all_or_distinct)? group_by_list; - -group_by_list: group_by_item (COMMA group_by_item)*; - -group_by_item: - column_expr_noparen - | empty_grouping_set - | cube_clause - | rollup_clause - | grouping_sets_clause - | OPEN_PAREN column_expr_list_noparen CLOSE_PAREN; - -empty_grouping_set: OPEN_PAREN CLOSE_PAREN; - -rollup_clause: KW_ROLLUP OPEN_PAREN column_expr_list_noparen CLOSE_PAREN; - -cube_clause: KW_CUBE OPEN_PAREN column_expr_list_noparen CLOSE_PAREN; - -grouping_sets_clause: - KW_GROUPING KW_SETS OPEN_PAREN group_by_list CLOSE_PAREN; - -having_clause: KW_HAVING a_expr; - -for_locking_clause: for_locking_items | KW_FOR KW_READ KW_ONLY; - -opt_for_locking_clause: for_locking_clause; - -for_locking_items: for_locking_item+; - -for_locking_item: - for_locking_strength locked_rels_list? opt_nowait_or_skip?; - -for_locking_strength: KW_FOR ((KW_NO KW_KEY)? KW_UPDATE | KW_KEY? KW_SHARE); - -locked_rels_list: KW_OF qualified_name_list; - -values_clause: - KW_VALUES OPEN_PAREN expr_list CLOSE_PAREN ( - COMMA OPEN_PAREN expr_list CLOSE_PAREN - )*; - -from_clause: KW_FROM from_list; - -from_list: table_ref (COMMA table_ref)*; - -table_ref: ( - relation_expr opt_alias_clause? tablesample_clause? - | func_table func_alias_clause? - | xmltable opt_alias_clause? - | select_with_parens opt_alias_clause? - | KW_LATERAL ( - xmltable opt_alias_clause? - | func_table func_alias_clause? - | select_with_parens opt_alias_clause? - ) - | OPEN_PAREN table_ref ( - KW_CROSS KW_JOIN table_ref - | KW_NATURAL join_type? KW_JOIN table_ref - | join_type? KW_JOIN table_ref join_qual - )? CLOSE_PAREN opt_alias_clause? - ) ( - KW_CROSS KW_JOIN table_ref - | KW_NATURAL join_type? KW_JOIN table_ref - | join_type? KW_JOIN table_ref join_qual - )*; - -alias_clause: KW_AS? colid (OPEN_PAREN name_list CLOSE_PAREN)?; - -opt_alias_clause: alias_clause; - -func_alias_clause: - alias_clause - | (KW_AS colid? | colid) OPEN_PAREN tablefuncelementlist CLOSE_PAREN; - -join_type: (KW_FULL | KW_LEFT | KW_RIGHT | KW_INNER) KW_OUTER?; - -join_qual: KW_USING OPEN_PAREN columnlist CLOSE_PAREN | KW_ON a_expr; - -relation_expr: - KW_ONLY? table_name STAR? columnlist? where_clause? - | KW_ONLY ( - table_name - | OPEN_PAREN table_name CLOSE_PAREN - ) - | KW_IN KW_SCHEMA (schema_name | KW_CURRENT_SCHEMA); - -publication_relation_expr: - KW_TABLE KW_ONLY? table_name STAR? (OPEN_PAREN columnlist CLOSE_PAREN)? where_clause? - | KW_TABLE KW_ONLY ( - table_name - | OPEN_PAREN table_name CLOSE_PAREN - ) - | KW_TABLES KW_IN KW_SCHEMA (schema_name | KW_CURRENT_SCHEMA); - -relation_expr_list: relation_expr (COMMA relation_expr)*; - -publication_relation_expr_list: publication_relation_expr (COMMA publication_relation_expr)*; - -relation_expr_opt_alias: relation_expr (KW_AS? colid)?; - -tablesample_clause: - KW_TABLESAMPLE function_name OPEN_PAREN expr_list CLOSE_PAREN opt_repeatable_clause?; - -opt_repeatable_clause: KW_REPEATABLE OPEN_PAREN a_expr CLOSE_PAREN; - -func_table: - func_expr_windowless opt_ordinality? - | KW_ROWS KW_FROM OPEN_PAREN rowsfrom_list CLOSE_PAREN opt_ordinality?; - -rowsfrom_item: func_expr_windowless opt_col_def_list?; - -rowsfrom_list: rowsfrom_item (COMMA rowsfrom_item)*; - -opt_col_def_list: - KW_AS OPEN_PAREN tablefuncelementlist CLOSE_PAREN; - -opt_ordinality: KW_WITH KW_ORDINALITY; - -where_clause: KW_WHERE column_expr_noparen; - -where_or_current_clause: - KW_WHERE (KW_CURRENT KW_OF cursor_name | a_expr); - -opttablefuncelementlist: tablefuncelementlist; - -tablefuncelementlist: - tablefuncelement (COMMA tablefuncelement)*; - -tablefuncelement: colid typename opt_collate_clause?; - -xmltable: - KW_XMLTABLE OPEN_PAREN ( - c_expr xmlexists_argument KW_COLUMNS xmltable_column_list - | KW_XMLNAMESPACES OPEN_PAREN xml_namespace_list CLOSE_PAREN COMMA c_expr xmlexists_argument - KW_COLUMNS xmltable_column_list - ) CLOSE_PAREN; - -xmltable_column_list: - xmltable_column_el (COMMA xmltable_column_el)*; - -xmltable_column_el: - colid ( - typename xmltable_column_option_list? - | KW_FOR KW_ORDINALITY - ); - -xmltable_column_option_list: xmltable_column_option_el+; - -xmltable_column_option_el: - KW_DEFAULT a_expr - | identifier a_expr - | KW_NOT KW_NULL - | KW_NULL; - -xml_namespace_list: xml_namespace_el (COMMA xml_namespace_el)*; - -xml_namespace_el: b_expr KW_AS collabel | KW_DEFAULT b_expr; - -typename: - KW_SETOF? simpletypename ( - opt_array_bounds - | KW_ARRAY (OPEN_BRACKET iconst CLOSE_BRACKET)? - ) - | qualified_name PERCENT (KW_ROWTYPE | KW_TYPE); - -opt_array_bounds: (OPEN_BRACKET iconst? CLOSE_BRACKET)*; - -simpletypename: - generictype - | numeric - | bit - | character - | constdatetime - | constinterval ( - opt_interval? - | OPEN_PAREN iconst CLOSE_PAREN - ); - -consttypename: - numeric - | constbit - | constcharacter - | constdatetime; - -generictype: type_function_name attrs? opt_type_modifiers?; - -opt_type_modifiers: OPEN_PAREN expr_list CLOSE_PAREN; - -numeric: - KW_INT - | KW_INTEGER - | KW_SMALLINT - | KW_BIGINT - | KW_REAL - | KW_FLOAT opt_float? - | KW_DOUBLE KW_PRECISION - | KW_DECIMAL opt_type_modifiers? - | KW_DEC opt_type_modifiers? - | KW_NUMERIC opt_type_modifiers? - | KW_BOOLEAN; - -opt_float: OPEN_PAREN iconst CLOSE_PAREN; - -bit: bitwithlength | bitwithoutlength; - -constbit: bitwithlength | bitwithoutlength; - -bitwithlength: - KW_BIT opt_varying? OPEN_PAREN expr_list CLOSE_PAREN; - -bitwithoutlength: KW_BIT opt_varying?; - -character: character_c (OPEN_PAREN iconst CLOSE_PAREN)?; - -constcharacter: character_c (OPEN_PAREN iconst CLOSE_PAREN)?; - -character_c: (KW_CHARACTER | KW_CHAR | KW_NCHAR) opt_varying? - | KW_VARCHAR - | KW_NATIONAL (KW_CHARACTER | KW_CHAR) opt_varying?; - -opt_varying: KW_VARYING; - -constdatetime: (KW_TIMESTAMP | KW_TIME) (OPEN_PAREN iconst CLOSE_PAREN)? opt_timezone?; - -constinterval: KW_INTERVAL; //TODO with_la was used -opt_timezone: KW_WITH KW_TIME KW_ZONE | KW_WITHOUT KW_TIME KW_ZONE; +opt_timezone + : KW_WITH KW_TIME KW_ZONE + | KW_WITHOUT KW_TIME KW_ZONE + ; -opt_interval: - KW_YEAR - | KW_MONTH - | KW_DAY - | KW_HOUR - | KW_MINUTE - | interval_second - | KW_YEAR KW_TO KW_MONTH - | KW_DAY KW_TO (KW_HOUR | KW_MINUTE | interval_second) - | KW_HOUR KW_TO (KW_MINUTE | interval_second) - | KW_MINUTE KW_TO interval_second; +opt_interval + : KW_YEAR + | KW_MONTH + | KW_DAY + | KW_HOUR + | KW_MINUTE + | interval_second + | KW_YEAR KW_TO KW_MONTH + | KW_DAY KW_TO (KW_HOUR | KW_MINUTE | interval_second) + | KW_HOUR KW_TO (KW_MINUTE | interval_second) + | KW_MINUTE KW_TO interval_second + ; -interval_second: KW_SECOND (OPEN_PAREN iconst CLOSE_PAREN)?; +interval_second + : KW_SECOND (OPEN_PAREN iconst CLOSE_PAREN)? + ; + +opt_escape + : KW_ESCAPE a_expr + ; -opt_escape: KW_ESCAPE a_expr; //precendence accroding to Table 4.2. Operator Precedence (highest to lowest) //https://www.postgresql.org/docs/12/sql-syntax-lexical.html#SQL-PRECEDENCE @@ -2543,7 +3555,10 @@ opt_escape: KW_ESCAPE a_expr; CLOSE_PAREN) -- 21 | UNIQUE select_with_parens -- 22 | KW_DEFAULT -- 23 ; */ -a_expr: a_expr_qual; +a_expr + : a_expr_qual + ; + /*23*/ /*moved to c_expr*/ @@ -2554,1019 +3569,1277 @@ a_expr: a_expr_qual; /*19*/ -a_expr_qual: a_expr_lessless qual_op?; +a_expr_qual + : a_expr_lessless qual_op? + ; + /*18*/ -a_expr_lessless: - a_expr_or ((LESS_LESS | GREATER_GREATER) a_expr_or)*; +a_expr_lessless + : a_expr_or ((LESS_LESS | GREATER_GREATER) a_expr_or)* + ; + /*17*/ -a_expr_or: a_expr_and (KW_OR a_expr_and)*; +a_expr_or + : a_expr_and (KW_OR a_expr_and)* + ; + /*16*/ -a_expr_and: a_expr_in (KW_AND a_expr_in)*; +a_expr_and + : a_expr_in (KW_AND a_expr_in)* + ; + /*20*/ -a_expr_in: a_expr_unary_not (KW_NOT? KW_IN in_expr)?; +a_expr_in + : a_expr_unary_not (KW_NOT? KW_IN in_expr)? + ; + /*15*/ -a_expr_unary_not: KW_NOT? a_expr_isnull; +a_expr_unary_not + : KW_NOT? a_expr_isnull + ; + /*14*/ /*moved to c_expr*/ /*13*/ -a_expr_isnull: a_expr_is_not (KW_ISNULL | KW_NOTNULL)?; +a_expr_isnull + : a_expr_is_not (KW_ISNULL | KW_NOTNULL)? + ; + /*12*/ -a_expr_is_not: - a_expr_compare ( - KW_IS KW_NOT? ( - KW_NULL - | KW_TRUE - | KW_FALSE - | KW_UNKNOWN - | KW_DISTINCT KW_FROM a_expr - | KW_OF OPEN_PAREN type_list CLOSE_PAREN - | KW_DOCUMENT - | unicode_normal_form? KW_NORMALIZED - ) - )?; +a_expr_is_not + : a_expr_compare ( + KW_IS KW_NOT? ( + KW_NULL + | KW_TRUE + | KW_FALSE + | KW_UNKNOWN + | KW_DISTINCT KW_FROM a_expr + | KW_OF OPEN_PAREN type_list CLOSE_PAREN + | KW_DOCUMENT + | unicode_normal_form? KW_NORMALIZED + ) + )? + ; + /*11*/ -a_expr_compare: - a_expr_like ( - ( - LT - | GT - | EQUAL - | LESS_EQUALS - | GREATER_EQUALS - | NOT_EQUALS - ) a_expr_like - | subquery_Op sub_type ( - select_with_parens - | OPEN_PAREN a_expr CLOSE_PAREN - ) /*21*/ - )?; +a_expr_compare + : a_expr_like ( + (LT | GT | EQUAL | LESS_EQUALS | GREATER_EQUALS | NOT_EQUALS) a_expr_like + | subquery_Op sub_type (select_with_parens | OPEN_PAREN a_expr CLOSE_PAREN) /*21*/ + )? + ; + /*10*/ -a_expr_like: - a_expr_qual_op ( - KW_NOT? (KW_LIKE | KW_ILIKE | KW_SIMILAR KW_TO | KW_BETWEEN KW_SYMMETRIC?) a_expr_qual_op opt_escape? - )?; +a_expr_like + : a_expr_qual_op ( + KW_NOT? (KW_LIKE | KW_ILIKE | KW_SIMILAR KW_TO | KW_BETWEEN KW_SYMMETRIC?) a_expr_qual_op opt_escape? + )? + ; + /* 8*/ -a_expr_qual_op: - a_expr_unary_qualop (qual_op a_expr_unary_qualop)*; +a_expr_qual_op + : a_expr_unary_qualop (qual_op a_expr_unary_qualop)* + ; + /* 9*/ -a_expr_unary_qualop: qual_op? a_expr_add; +a_expr_unary_qualop + : qual_op? a_expr_add + ; + /* 7*/ -a_expr_add: a_expr_mul ((MINUS | PLUS) a_expr_mul)*; +a_expr_add + : a_expr_mul ((MINUS | PLUS) a_expr_mul)* + ; + /* 6*/ -a_expr_mul: - a_expr_caret ((STAR | SLASH | PERCENT) a_expr_caret)*; +a_expr_mul + : a_expr_caret ((STAR | SLASH | PERCENT) a_expr_caret)* + ; + /* 5*/ -a_expr_caret: a_expr_unary_sign (CARET a_expr)?; +a_expr_caret + : a_expr_unary_sign (CARET a_expr)? + ; + /* 4*/ -a_expr_unary_sign: (MINUS | PLUS)? a_expr_at_time_zone /* */; +a_expr_unary_sign + : (MINUS | PLUS)? a_expr_at_time_zone /* */ + ; + /* 3*/ -a_expr_at_time_zone: a_expr_collate (KW_AT KW_TIME KW_ZONE a_expr)?; +a_expr_at_time_zone + : a_expr_collate (KW_AT KW_TIME KW_ZONE a_expr)? + ; + /* 2*/ -a_expr_collate: a_expr_typecast (KW_COLLATE any_name)?; +a_expr_collate + : a_expr_typecast (KW_COLLATE any_name)? + ; + /* 1*/ -a_expr_typecast: c_expr (TYPECAST typename)*; - -b_expr: - c_expr - | b_expr TYPECAST typename - //right unary plus, unary minus - | (PLUS | MINUS) b_expr - //^ left exponentiation - | b_expr CARET b_expr - //* / % left multiplication, division, modulo - | b_expr (STAR | SLASH | PERCENT) b_expr - //+ - left addition, subtraction - | b_expr (PLUS | MINUS) b_expr - //(any other operator) left all other native and user-defined operators - | b_expr qual_op b_expr - //< > = <= >= <> comparison operators - | b_expr ( - LT - | GT - | EQUAL - | LESS_EQUALS - | GREATER_EQUALS - | NOT_EQUALS - ) b_expr - | qual_op b_expr - | b_expr qual_op - //S ISNULL NOTNULL IS TRUE, IS FALSE, IS NULL, IS KW_DISTINCT FROM, etc - | b_expr KW_IS KW_NOT? ( - KW_DISTINCT KW_FROM b_expr - | KW_OF OPEN_PAREN type_list CLOSE_PAREN - | KW_DOCUMENT - ); - -c_expr: - KW_EXISTS select_with_parens # c_expr_exists - | KW_ARRAY (select_with_parens | array_expr) # c_expr_expr - | PARAM opt_indirection # c_expr_expr - | KW_GROUPING OPEN_PAREN expr_list CLOSE_PAREN # c_expr_expr - | /*22*/ KW_UNIQUE select_with_parens # c_expr_expr - | columnref # c_expr_expr - | aexprconst # c_expr_expr - | plsqlvariablename # c_expr_expr - | OPEN_PAREN a_expr_in_parens = a_expr CLOSE_PAREN opt_indirection # c_expr_expr - | case_expr # c_expr_case - | func_expr # c_expr_expr - | select_with_parens indirection? # c_expr_expr - | explicit_row # c_expr_expr - | implicit_row # c_expr_expr - | row KW_OVERLAPS row /* 14*/ # c_expr_expr; - -plsqlvariablename: PLSQLVARIABLENAME; - -func_application: - function_name (OPEN_PAREN ( - func_arg_list (COMMA KW_VARIADIC func_arg_expr)? opt_sort_clause? - | KW_VARIADIC func_arg_expr opt_sort_clause? - | (KW_ALL | KW_DISTINCT) func_arg_list opt_sort_clause? - | STAR - | - ) CLOSE_PAREN)?; - -func_expr: - func_application within_group_clause? filter_clause? over_clause? - | func_expr_common_subexpr; - -func_expr_windowless: - func_application - | func_expr_common_subexpr; - -func_expr_common_subexpr: - KW_COLLATION KW_FOR OPEN_PAREN a_expr CLOSE_PAREN - | KW_CURRENT_DATE - | KW_CURRENT_TIME (OPEN_PAREN iconst CLOSE_PAREN)? - | KW_CURRENT_TIMESTAMP (OPEN_PAREN iconst CLOSE_PAREN)? - | KW_LOCALTIME (OPEN_PAREN iconst CLOSE_PAREN)? - | KW_LOCALTIMESTAMP (OPEN_PAREN iconst CLOSE_PAREN)? - | KW_CURRENT_ROLE - | KW_CURRENT_USER - | KW_SESSION_USER - | KW_USER - | KW_CURRENT_CATALOG - | KW_CURRENT_SCHEMA - | KW_CAST OPEN_PAREN a_expr KW_AS typename CLOSE_PAREN - | KW_EXTRACT OPEN_PAREN extract_list? CLOSE_PAREN - | KW_NORMALIZE OPEN_PAREN a_expr (COMMA unicode_normal_form)? CLOSE_PAREN - | KW_OVERLAY OPEN_PAREN overlay_list CLOSE_PAREN - | KW_POSITION OPEN_PAREN position_list? CLOSE_PAREN - | KW_SUBSTRING OPEN_PAREN substr_list? CLOSE_PAREN - | KW_TREAT OPEN_PAREN a_expr KW_AS typename CLOSE_PAREN - | KW_TRIM OPEN_PAREN (KW_BOTH | KW_LEADING | KW_TRAILING)? trim_list CLOSE_PAREN - | KW_NULLIF OPEN_PAREN a_expr COMMA a_expr CLOSE_PAREN - | KW_COALESCE OPEN_PAREN expr_list CLOSE_PAREN - | KW_GREATEST OPEN_PAREN expr_list CLOSE_PAREN - | KW_LEAST OPEN_PAREN expr_list CLOSE_PAREN - | KW_XMLCONCAT OPEN_PAREN expr_list CLOSE_PAREN - | KW_XMLELEMENT OPEN_PAREN KW_NAME collabel ( - COMMA (xml_attributes | expr_list) - )? CLOSE_PAREN - | KW_XMLEXISTS OPEN_PAREN c_expr xmlexists_argument CLOSE_PAREN - | KW_XMLFOREST OPEN_PAREN xml_attribute_list CLOSE_PAREN - | KW_XMLPARSE OPEN_PAREN document_or_content a_expr xml_whitespace_option? CLOSE_PAREN - | KW_XMLPI OPEN_PAREN KW_NAME collabel (COMMA a_expr)? CLOSE_PAREN - | KW_XMLROOT OPEN_PAREN KW_XML a_expr COMMA xml_root_version opt_xml_root_standalone? CLOSE_PAREN - | KW_XMLSERIALIZE OPEN_PAREN document_or_content a_expr KW_AS simpletypename CLOSE_PAREN; - -xml_root_version: KW_VERSION a_expr | KW_VERSION KW_NO KW_VALUE; - -opt_xml_root_standalone: - COMMA KW_STANDALONE KW_YES - | COMMA KW_STANDALONE KW_NO - | COMMA KW_STANDALONE KW_NO KW_VALUE; - -xml_attributes: - KW_XMLATTRIBUTES OPEN_PAREN xml_attribute_list CLOSE_PAREN; - -xml_attribute_list: xml_attribute_el (COMMA xml_attribute_el)*; - -xml_attribute_el: a_expr (KW_AS collabel)?; - -document_or_content: KW_DOCUMENT | KW_CONTENT; - -xml_whitespace_option: - KW_PRESERVE KW_WHITESPACE - | KW_STRIP KW_WHITESPACE; - -xmlexists_argument: - KW_PASSING c_expr - | KW_PASSING c_expr xml_passing_mech - | KW_PASSING xml_passing_mech c_expr - | KW_PASSING xml_passing_mech c_expr xml_passing_mech; - -xml_passing_mech: KW_BY (KW_REF | KW_VALUE); - -within_group_clause: - KW_WITHIN KW_GROUP OPEN_PAREN sort_clause CLOSE_PAREN; - -filter_clause: KW_FILTER OPEN_PAREN KW_WHERE a_expr CLOSE_PAREN; - -window_clause: KW_WINDOW window_definition_list; - -window_definition_list: - window_definition (COMMA window_definition)*; - -window_definition: colid KW_AS window_specification; - -over_clause: KW_OVER (window_specification | colid); - -window_specification: - OPEN_PAREN opt_existing_window_name? opt_partition_clause? opt_sort_clause? opt_frame_clause? - CLOSE_PAREN; - -opt_existing_window_name: colid; - -opt_partition_clause: KW_PARTITION KW_BY expr_list; - -opt_frame_clause: - KW_RANGE frame_extent opt_window_exclusion_clause? - | KW_ROWS frame_extent opt_window_exclusion_clause? - | KW_GROUPS frame_extent opt_window_exclusion_clause?; - -frame_extent: frame_bound | KW_BETWEEN frame_bound KW_AND frame_bound; - -frame_bound: - KW_UNBOUNDED (KW_PRECEDING | KW_FOLLOWING) - | KW_CURRENT KW_ROW - | a_expr (KW_PRECEDING | KW_FOLLOWING); - -opt_window_exclusion_clause: - KW_EXCLUDE (KW_CURRENT KW_ROW | KW_GROUP | KW_TIES | KW_NO KW_OTHERS); - -row: - KW_ROW OPEN_PAREN expr_list? CLOSE_PAREN - | OPEN_PAREN expr_list COMMA a_expr CLOSE_PAREN; - -explicit_row: KW_ROW OPEN_PAREN expr_list? CLOSE_PAREN; - -implicit_row: OPEN_PAREN expr_list COMMA a_expr CLOSE_PAREN; - -sub_type: KW_ANY | KW_SOME | KW_ALL; - -all_op: Operator | mathop; - -mathop: - PLUS - | MINUS - | STAR - | SLASH - | PERCENT - | CARET - | LT - | GT - | EQUAL - | LESS_EQUALS - | GREATER_EQUALS - | NOT_EQUALS; - -qual_op: - Operator - | KW_OPERATOR OPEN_PAREN any_operator CLOSE_PAREN; - -qual_all_op: - all_op - | KW_OPERATOR OPEN_PAREN any_operator CLOSE_PAREN; - -subquery_Op: - all_op - | KW_OPERATOR OPEN_PAREN any_operator CLOSE_PAREN - | KW_LIKE - | KW_NOT KW_LIKE - | KW_ILIKE - | KW_NOT KW_ILIKE; - -expr_list: a_expr (COMMA a_expr)*; - -column_expr_list_noparen: column_expr_noparen (COMMA column_expr_noparen)*; - -column_expr_list: column_expr (COMMA column_expr)*; - -column_expr: column_name | (OPEN_PAREN a_expr CLOSE_PAREN); - -column_expr_noparen: column_name | a_expr; - -func_arg_list: func_arg_expr (COMMA func_arg_expr)*; - -func_arg_expr: - a_expr - | param_name (COLON_EQUALS | EQUALS_GREATER) a_expr; - -type_list: typename (COMMA typename)*; - -array_expr: - OPEN_BRACKET (expr_list | array_expr_list)? CLOSE_BRACKET; - -array_expr_list: array_expr (COMMA array_expr)*; - -extract_list: extract_arg KW_FROM a_expr; - -extract_arg: - identifier - | KW_YEAR - | KW_MONTH - | KW_DAY - | KW_HOUR - | KW_MINUTE - | KW_SECOND - | sconst; - -unicode_normal_form: KW_NFC | KW_NFD | KW_NFKC | KW_NFKD; - -overlay_list: a_expr KW_PLACING a_expr KW_FROM a_expr (KW_FOR a_expr)?; - -position_list: b_expr KW_IN b_expr; - -substr_list: - a_expr KW_FROM a_expr KW_FOR a_expr - | a_expr KW_FOR a_expr KW_FROM a_expr - | a_expr KW_FROM a_expr - | a_expr KW_FOR a_expr - | a_expr KW_SIMILAR a_expr KW_ESCAPE a_expr - | expr_list; - -trim_list: a_expr KW_FROM expr_list | KW_FROM expr_list | expr_list; - -in_expr: - select_with_parens # in_expr_select - | OPEN_PAREN expr_list CLOSE_PAREN # in_expr_list; - -case_expr: KW_CASE case_arg? when_clause_list case_default? KW_END; - -when_clause_list: when_clause+; - -when_clause: KW_WHEN a_expr KW_THEN a_expr; - -case_default: KW_ELSE a_expr; - -case_arg: a_expr; - -columnref: colid indirection?; - -indirection_el: - DOT (attr_name | STAR) - | OPEN_BRACKET ( - a_expr - | opt_slice_bound? COLON opt_slice_bound? - ) CLOSE_BRACKET; - -opt_slice_bound: a_expr; - -indirection: indirection_el+; - -opt_indirection: indirection_el*; - -opt_target_list: target_list; - -target_list: target_el (COMMA target_el)*; - -target_el: - column_expr_noparen (KW_AS collabel | identifier |) # target_label - | STAR # target_star; - -qualified_name_list: qualified_name (COMMA qualified_name)*; - -table_name_list: table_name (COMMA table_name)*; - -schema_name_list: schema_name (COMMA schema_name)*; - -database_nameList: database_name (COMMA database_name)*; - -procedure_name_list: procedure_name (COMMA procedure_name)*; - -tablespace_name_create: colid indirection?; - -tablespace_name: colid indirection?; - -table_name_create: colid indirection?; - -table_name: colid indirection?; - -view_name_create: colid indirection?; - -view_name: colid attrs?; - -qualified_name: colid indirection?; - -tablespace_name_list: tablespace_name (COMMA tablespace_name)*; - -name_list: name (COMMA name)*; - -database_name_create: colid attrs?; - -database_name: colid attrs?; - -schema_name: colid attrs?; - -routine_name_create: colid; - -routine_name: colid; - -procedure_name: type_function_name | colid indirection; - -procedure_name_create: type_function_name | colid indirection; - -column_name: colid; - -column_name_create: colid; - -name: colid; - -attr_name: collabel; - -file_name: sconst; - -function_name_create: type_function_name | colid indirection; - -function_name: type_function_name | colid indirection; - -usual_name: type_usual_name | colid indirection; - -aexprconst: - iconst - | fconst - | sconst - | bconst - | xconst - | function_name ( - sconst - | OPEN_PAREN func_arg_list opt_sort_clause? CLOSE_PAREN sconst - ) - | consttypename sconst - | constinterval ( - sconst opt_interval? - | OPEN_PAREN iconst CLOSE_PAREN sconst - ) - | KW_TRUE - | KW_FALSE - | KW_NULL; - -xconst: HexadecimalStringConstant; - -bconst: BinaryStringConstant; - -fconst: Numeric; - -iconst: Integral; - -sconst: anysconst opt_uescape?; - -anysconst: - StringConstant - | UnicodeEscapeStringConstant - | BeginDollarStringConstant DollarText* EndDollarStringConstant - | EscapeStringConstant; - -opt_uescape: KW_UESCAPE anysconst; - -signediconst: iconst | PLUS iconst | MINUS iconst; - -groupname: rolespec; - -roleid: rolespec; - -rolespec: nonreservedword | KW_CURRENT_USER | KW_CURRENT_ROLE | KW_SESSION_USER | KW_PUBLIC; - -role_list: rolespec (COMMA rolespec)*; - -colid: - identifier - | unreserved_keyword - | col_name_keyword - | plsql_unreserved_keyword; - -index_method_choices: - identifier; - -exclude_element: - opt_definition | (OPEN_PAREN a_expr CLOSE_PAREN) identifier opt_asc_desc? opt_nulls_order?; - -index_paramenters: - (KW_WITH reloptions)? optconstablespace?; - -type_function_name: - identifier - | unreserved_keyword - | plsql_unreserved_keyword - | type_func_name_keyword; - -type_usual_name: - identifier - | unreserved_keyword - | plsql_unreserved_keyword - | type_func_name_keyword; - -nonreservedword_column: column_name | type_func_name_keyword; - -nonreservedword: - identifier - | unreserved_keyword - | col_name_keyword - | type_func_name_keyword; - -collabel: - identifier - | plsql_unreserved_keyword - | unreserved_keyword - | col_name_keyword - | type_func_name_keyword - | reserved_keyword; - -identifier: - Identifier opt_uescape? - | sconst - | QuotedIdentifier - | UnicodeQuotedIdentifier - | plsqlvariablename - | plsqlidentifier - | plsql_unreserved_keyword; - -plsqlidentifier: PLSQLIDENTIFIER; - -unreserved_keyword: - KW_ABORT - | KW_ABSOLUTE - | KW_ACCESS - | KW_ACTION - | KW_ADD - | KW_ADMIN - | KW_AFTER - | KW_AGGREGATE - | KW_ALSO - | KW_ALTER - | KW_ALWAYS - | KW_ASSERTION - | KW_ASSIGNMENT - | KW_AT - | KW_ATTACH - | KW_ATTRIBUTE - | KW_BACKWARD - | KW_BEFORE - | KW_BEGIN - | KW_BUFFER_USAGE_LIMIT - | KW_BY - | KW_CACHE - | KW_CALL - | KW_CALLED - | KW_CASCADE - | KW_CASCADED - | KW_CATALOG - | KW_CHAIN - | KW_CHARACTERISTICS - | KW_CHECKPOINT - | KW_CLASS - | KW_CLOSE - | KW_CLUSTER - | KW_COLUMNS - | KW_COMMENT - | KW_COMMENTS - | KW_COMMIT - | KW_COMMITTED - | KW_CONFIGURATION - | KW_CONFLICT - | KW_CONNECTION - | KW_CONSTRAINTS - | KW_CONTENT - | KW_CONTINUE - | KW_CONVERSION - | KW_COPY - | KW_COST - | KW_CSV - | KW_CUBE - | KW_CURRENT - | KW_CURSOR - | KW_CYCLE - | KW_DATA - | KW_DATABASE - | KW_DAY - | KW_DEALLOCATE - | KW_DECLARE - | KW_DEFAULTS - | KW_DEFERRED - | KW_DEFINER - | KW_DELETE - | KW_DELIMITER - | KW_DELIMITERS - | KW_DEPENDS - | KW_DETACH - | KW_DICTIONARY - | KW_DISABLE - | KW_DISCARD - | KW_DOCUMENT - | KW_DOMAIN - | KW_DOUBLE - | KW_DROP - | KW_EACH - | KW_ENABLE - | KW_ENCODING - | KW_ENCRYPTED - | KW_ENUM - | KW_ESCAPE - | KW_EVENT - | KW_EXCLUDE - | KW_EXCLUDING - | KW_EXCLUSIVE - | KW_EXECUTE - | KW_EXPLAIN - | KW_EXPRESSION - | KW_EXTENSION - | KW_EXTERNAL - | KW_FAMILY - | KW_FILTER - | KW_FIRST - | KW_FOLLOWING - | KW_FORCE - | KW_FORWARD - | KW_FUNCTION - | KW_FUNCTIONS - | KW_GENERATED - | KW_GLOBAL - | KW_GRANTED - | KW_GROUPS - | KW_HANDLER - | KW_HEADER - | KW_HOLD - | KW_HOUR - | KW_IDENTITY - | KW_IF - | KW_IMMEDIATE - | KW_IMMUTABLE - | KW_IMPLICIT - | KW_IMPORT - | KW_INCLUDE - | KW_INCLUDING - | KW_INCREMENT - | KW_INDEX - | KW_INDEXES - | KW_INHERIT - | KW_INHERITS - | KW_INLINE - | KW_INPUT - | KW_INSENSITIVE - | KW_INSERT - | KW_INSTEAD - | KW_INVOKER - | KW_ISOLATION - | KW_KEY - | KW_LABEL - | KW_LANGUAGE - | KW_LARGE - | KW_LAST - | KW_LEAKPROOF - | KW_LEVEL - | KW_LISTEN - | KW_LOAD - | KW_LOCAL - | KW_LOCATION - | KW_LOCK - | KW_LOCKED - | KW_LOGGED - | KW_MAPPING - | KW_MATCH - | KW_MATERIALIZED - | KW_MAXVALUE - | KW_METHOD - | KW_MINUTE - | KW_MINVALUE - | KW_MODE - | KW_MONTH - | KW_MOVE - | KW_NAME - | KW_NAMES - | KW_NEW - | KW_NEXT - | KW_NFC - | KW_NFD - | KW_NFKC - | KW_NFKD - | KW_NO - | KW_NORMALIZED - | KW_NOTHING - | KW_NOTIFY - | KW_NOWAIT - | KW_NULLS - | KW_OBJECT - | KW_OF - | KW_OFF - | KW_OIDS - | KW_OLD - | KW_OPERATOR - | KW_OPTION - | KW_OPTIONS - | KW_ORDINALITY - | KW_OTHERS - | KW_OVER - | KW_OVERRIDING - | KW_OWNED - | KW_OWNER - | KW_PARALLEL - | KW_PARSER - | KW_PARTIAL - | KW_PARTITION - | KW_PASSING - | KW_PASSWORD - | KW_PLANS - | KW_POLICY - | KW_PRECEDING - | KW_PREPARE - | KW_PREPARED - | KW_PRESERVE - | KW_PRIOR - | KW_PRIVILEGES - | KW_PROCEDURAL - | KW_PROCEDURE - | KW_PROCEDURES - | KW_PROGRAM - | KW_PUBLICATION - | KW_QUOTE - | KW_RANGE - | KW_READ - | KW_REASSIGN - | KW_RECHECK - | KW_RECURSIVE - | KW_REF - | KW_REFERENCING - | KW_REFRESH - | KW_REINDEX - | KW_RELATIVE - | KW_RELEASE - | KW_RENAME - | KW_REPEATABLE - | KW_REPLACE - | KW_REPLICA - | KW_RESET - | KW_RESTART - | KW_RESTRICT - | KW_RETURNS - | KW_REVOKE - | KW_ROLE - | KW_ROLLBACK - | KW_ROLLUP - | KW_ROUTINE - | KW_ROUTINES - | KW_ROWS - | KW_RULE - | KW_SAVEPOINT - | KW_SCHEMA - | KW_SCHEMAS - | KW_SCROLL - | KW_SEARCH - | KW_SECOND - | KW_SECURITY - | KW_SEQUENCE - | KW_SEQUENCES - | KW_SERIALIZABLE - | KW_SERVER - | KW_SESSION - | KW_SET - | KW_SETS - | KW_SHARE - | KW_SHOW - | KW_SIMPLE - | KW_SKIP - | KW_SKIP_LOCKED - | KW_SNAPSHOT - | KW_SQL - | KW_STABLE - | KW_STANDALONE - | KW_START - | KW_STATEMENT - | KW_STATISTICS - | KW_STDIN - | KW_STDOUT - | KW_STORAGE - | KW_STORED - | KW_STRICT - | KW_STRIP - | KW_SUBSCRIPTION - | KW_SUPPORT - | KW_SYSID - | KW_SYSTEM - | KW_TABLES - | KW_TABLESPACE - | KW_TEMP - | KW_TEMPLATE - | KW_TEMPORARY - | KW_TEXT - | KW_TIES - | KW_TRANSACTION - | KW_TRANSFORM - | KW_TRIGGER - | KW_TRUNCATE - | KW_TRUSTED - | KW_TYPE - | KW_TYPES - | KW_UESCAPE - | KW_UNBOUNDED - | KW_UNCOMMITTED - | KW_UNENCRYPTED - | KW_UNKNOWN - | KW_UNLISTEN - | KW_UNLOGGED - | KW_UNTIL - | KW_UPDATE - | KW_VACUUM - | KW_VALID - | KW_VALIDATE - | KW_VALIDATOR - | KW_VALUE - | KW_VARYING - | KW_VERSION - | KW_VIEW - | KW_VIEWS - | KW_VOLATILE - | KW_WHITESPACE - | KW_WITHIN - | KW_WITHOUT - | KW_WORK - | KW_WRAPPER - | KW_WRITE - | KW_XML - | KW_YEAR - | KW_YES - | KW_ZONE; - -col_name_keyword: - KW_BETWEEN - | KW_BIGINT - | bit - | KW_BOOLEAN - | KW_CHAR - | character - | KW_COALESCE - | KW_DEC - | KW_DECIMAL - | KW_EXISTS - | KW_EXTRACT - | KW_FLOAT - | KW_GREATEST - | KW_GROUPING - | KW_INOUT - | KW_INT - | KW_INTEGER - | KW_INTERVAL - | KW_LEAST - | KW_NATIONAL - | KW_NCHAR - | KW_NONE - | KW_NORMALIZE - | KW_NULLIF - | numeric - | KW_OUT - | KW_OVERLAY - | KW_POSITION - | KW_PRECISION - | KW_REAL - | KW_ROW - | KW_SETOF - | KW_SMALLINT - | KW_SUBSTRING - | KW_TIME - | KW_TIMESTAMP - | KW_TREAT - | KW_TRIM - | KW_VALUES - | KW_VARCHAR - | KW_XMLATTRIBUTES - | KW_XMLCONCAT - | KW_XMLELEMENT - | KW_XMLEXISTS - | KW_XMLFOREST - | KW_XMLNAMESPACES - | KW_XMLPARSE - | KW_XMLPI - | KW_XMLROOT - | KW_XMLSERIALIZE - | KW_XMLTABLE; - -type_func_name_keyword: - KW_AUTHORIZATION - | KW_BINARY - | KW_COLLATION - | KW_CONCURRENTLY - | KW_CROSS - | KW_CURRENT_SCHEMA - | KW_FREEZE - | KW_FULL - | KW_ILIKE - | KW_INNER - | KW_IS - | KW_ISNULL - | KW_JOIN - | KW_LEFT - | KW_LIKE - | KW_NATURAL - | KW_NOTNULL - | KW_OUTER - | KW_OVERLAPS - | KW_RIGHT - | KW_SIMILAR - | KW_TABLESAMPLE - | KW_VERBOSE; - -reserved_keyword: - KW_ALL - | KW_ANALYSE - | KW_ANALYZE - | KW_AND - | KW_ANY - | KW_ARRAY - | KW_AS - | KW_ASC - | KW_ASYMMETRIC - | KW_BOTH - | KW_CASE - | KW_CAST - | KW_CHECK - | KW_COLLATE - | KW_COLUMN - | KW_CONSTRAINT - | KW_CREATE - | KW_CURRENT_CATALOG - | KW_CURRENT_DATE - | KW_CURRENT_ROLE - | KW_CURRENT_TIME - | KW_CURRENT_TIMESTAMP - | KW_CURRENT_USER - // | KW_DEFAULT - | KW_DEFERRABLE - | KW_DESC - | KW_DISTINCT - | KW_DO - | KW_ELSE - | KW_END - | KW_EXCEPT - | KW_FALSE - | KW_FETCH - | KW_FOR - | KW_FOREIGN - | KW_FROM - | KW_GRANT - | KW_GROUP - | KW_HAVING - | KW_IN - | KW_INITIALLY - | KW_INTERSECT - /* +a_expr_typecast + : c_expr (TYPECAST typename)* + ; + +b_expr + : c_expr + | b_expr TYPECAST typename + //right unary plus, unary minus + | (PLUS | MINUS) b_expr + //^ left exponentiation + | b_expr CARET b_expr + //* / % left multiplication, division, modulo + | b_expr (STAR | SLASH | PERCENT) b_expr + //+ - left addition, subtraction + | b_expr (PLUS | MINUS) b_expr + //(any other operator) left all other native and user-defined operators + | b_expr qual_op b_expr + //< > = <= >= <> comparison operators + | b_expr ( LT | GT | EQUAL | LESS_EQUALS | GREATER_EQUALS | NOT_EQUALS) b_expr + | qual_op b_expr + | b_expr qual_op + //S ISNULL NOTNULL IS TRUE, IS FALSE, IS NULL, IS KW_DISTINCT FROM, etc + | b_expr KW_IS KW_NOT? ( + KW_DISTINCT KW_FROM b_expr + | KW_OF OPEN_PAREN type_list CLOSE_PAREN + | KW_DOCUMENT + ) + ; + +c_expr + : KW_EXISTS select_with_parens # c_expr_exists + | KW_ARRAY (select_with_parens | array_expr) # c_expr_expr + | PARAM opt_indirection # c_expr_expr + | KW_GROUPING OPEN_PAREN expr_list CLOSE_PAREN # c_expr_expr + | /*22*/ KW_UNIQUE select_with_parens # c_expr_expr + | columnref # c_expr_expr + | aexprconst # c_expr_expr + | plsqlvariablename # c_expr_expr + | OPEN_PAREN a_expr_in_parens= a_expr CLOSE_PAREN opt_indirection # c_expr_expr + | case_expr # c_expr_case + | func_expr # c_expr_expr + | select_with_parens indirection? # c_expr_expr + | explicit_row # c_expr_expr + | implicit_row # c_expr_expr + | row KW_OVERLAPS row /* 14*/ # c_expr_expr + ; + +plsqlvariablename + : PLSQLVARIABLENAME + ; + +func_application + : function_name ( + OPEN_PAREN ( + func_arg_list (COMMA KW_VARIADIC func_arg_expr)? opt_sort_clause? + | KW_VARIADIC func_arg_expr opt_sort_clause? + | (KW_ALL | KW_DISTINCT) func_arg_list opt_sort_clause? + | STAR + | + ) CLOSE_PAREN + )? + ; + +func_expr + : func_application within_group_clause? filter_clause? over_clause? + | func_expr_common_subexpr + ; + +func_expr_windowless + : func_application + | func_expr_common_subexpr + ; + +func_expr_common_subexpr + : KW_COLLATION KW_FOR OPEN_PAREN a_expr CLOSE_PAREN + | KW_CURRENT_DATE + | KW_CURRENT_TIME (OPEN_PAREN iconst CLOSE_PAREN)? + | KW_CURRENT_TIMESTAMP (OPEN_PAREN iconst CLOSE_PAREN)? + | KW_LOCALTIME (OPEN_PAREN iconst CLOSE_PAREN)? + | KW_LOCALTIMESTAMP (OPEN_PAREN iconst CLOSE_PAREN)? + | KW_CURRENT_ROLE + | KW_CURRENT_USER + | KW_SESSION_USER + | KW_USER + | KW_CURRENT_CATALOG + | KW_CURRENT_SCHEMA + | KW_CAST OPEN_PAREN a_expr KW_AS typename CLOSE_PAREN + | KW_EXTRACT OPEN_PAREN extract_list? CLOSE_PAREN + | KW_NORMALIZE OPEN_PAREN a_expr (COMMA unicode_normal_form)? CLOSE_PAREN + | KW_OVERLAY OPEN_PAREN overlay_list CLOSE_PAREN + | KW_POSITION OPEN_PAREN position_list? CLOSE_PAREN + | KW_SUBSTRING OPEN_PAREN substr_list? CLOSE_PAREN + | KW_TREAT OPEN_PAREN a_expr KW_AS typename CLOSE_PAREN + | KW_TRIM OPEN_PAREN (KW_BOTH | KW_LEADING | KW_TRAILING)? trim_list CLOSE_PAREN + | KW_NULLIF OPEN_PAREN a_expr COMMA a_expr CLOSE_PAREN + | KW_COALESCE OPEN_PAREN expr_list CLOSE_PAREN + | KW_GREATEST OPEN_PAREN expr_list CLOSE_PAREN + | KW_LEAST OPEN_PAREN expr_list CLOSE_PAREN + | KW_XMLCONCAT OPEN_PAREN expr_list CLOSE_PAREN + | KW_XMLELEMENT OPEN_PAREN KW_NAME collabel (COMMA (xml_attributes | expr_list))? CLOSE_PAREN + | KW_XMLEXISTS OPEN_PAREN c_expr xmlexists_argument CLOSE_PAREN + | KW_XMLFOREST OPEN_PAREN xml_attribute_list CLOSE_PAREN + | KW_XMLPARSE OPEN_PAREN document_or_content a_expr xml_whitespace_option? CLOSE_PAREN + | KW_XMLPI OPEN_PAREN KW_NAME collabel (COMMA a_expr)? CLOSE_PAREN + | KW_XMLROOT OPEN_PAREN KW_XML a_expr COMMA xml_root_version opt_xml_root_standalone? CLOSE_PAREN + | KW_XMLSERIALIZE OPEN_PAREN document_or_content a_expr KW_AS simpletypename CLOSE_PAREN + ; + +xml_root_version + : KW_VERSION a_expr + | KW_VERSION KW_NO KW_VALUE + ; + +opt_xml_root_standalone + : COMMA KW_STANDALONE KW_YES + | COMMA KW_STANDALONE KW_NO + | COMMA KW_STANDALONE KW_NO KW_VALUE + ; + +xml_attributes + : KW_XMLATTRIBUTES OPEN_PAREN xml_attribute_list CLOSE_PAREN + ; + +xml_attribute_list + : xml_attribute_el (COMMA xml_attribute_el)* + ; + +xml_attribute_el + : a_expr (KW_AS collabel)? + ; + +document_or_content + : KW_DOCUMENT + | KW_CONTENT + ; + +xml_whitespace_option + : KW_PRESERVE KW_WHITESPACE + | KW_STRIP KW_WHITESPACE + ; + +xmlexists_argument + : KW_PASSING c_expr + | KW_PASSING c_expr xml_passing_mech + | KW_PASSING xml_passing_mech c_expr + | KW_PASSING xml_passing_mech c_expr xml_passing_mech + ; + +xml_passing_mech + : KW_BY (KW_REF | KW_VALUE) + ; + +within_group_clause + : KW_WITHIN KW_GROUP OPEN_PAREN sort_clause CLOSE_PAREN + ; + +filter_clause + : KW_FILTER OPEN_PAREN KW_WHERE a_expr CLOSE_PAREN + ; + +window_clause + : KW_WINDOW window_definition_list + ; + +window_definition_list + : window_definition (COMMA window_definition)* + ; + +window_definition + : colid KW_AS window_specification + ; + +over_clause + : KW_OVER (window_specification | colid) + ; + +window_specification + : OPEN_PAREN opt_existing_window_name? opt_partition_clause? opt_sort_clause? opt_frame_clause? CLOSE_PAREN + ; + +opt_existing_window_name + : colid + ; + +opt_partition_clause + : KW_PARTITION KW_BY expr_list + ; + +opt_frame_clause + : KW_RANGE frame_extent opt_window_exclusion_clause? + | KW_ROWS frame_extent opt_window_exclusion_clause? + | KW_GROUPS frame_extent opt_window_exclusion_clause? + ; + +frame_extent + : frame_bound + | KW_BETWEEN frame_bound KW_AND frame_bound + ; + +frame_bound + : KW_UNBOUNDED (KW_PRECEDING | KW_FOLLOWING) + | KW_CURRENT KW_ROW + | a_expr (KW_PRECEDING | KW_FOLLOWING) + ; + +opt_window_exclusion_clause + : KW_EXCLUDE (KW_CURRENT KW_ROW | KW_GROUP | KW_TIES | KW_NO KW_OTHERS) + ; + +row + : KW_ROW OPEN_PAREN expr_list? CLOSE_PAREN + | OPEN_PAREN expr_list COMMA a_expr CLOSE_PAREN + ; + +explicit_row + : KW_ROW OPEN_PAREN expr_list? CLOSE_PAREN + ; + +implicit_row + : OPEN_PAREN expr_list COMMA a_expr CLOSE_PAREN + ; + +sub_type + : KW_ANY + | KW_SOME + | KW_ALL + ; + +all_op + : Operator + | mathop + ; + +mathop + : PLUS + | MINUS + | STAR + | SLASH + | PERCENT + | CARET + | LT + | GT + | EQUAL + | LESS_EQUALS + | GREATER_EQUALS + | NOT_EQUALS + ; + +qual_op + : Operator + | KW_OPERATOR OPEN_PAREN any_operator CLOSE_PAREN + ; + +qual_all_op + : all_op + | KW_OPERATOR OPEN_PAREN any_operator CLOSE_PAREN + ; + +subquery_Op + : all_op + | KW_OPERATOR OPEN_PAREN any_operator CLOSE_PAREN + | KW_LIKE + | KW_NOT KW_LIKE + | KW_ILIKE + | KW_NOT KW_ILIKE + ; + +expr_list + : a_expr (COMMA a_expr)* + ; + +column_expr_list_noparen + : column_expr_noparen (COMMA column_expr_noparen)* + ; + +column_expr_list + : column_expr (COMMA column_expr)* + ; + +column_expr + : column_name + | (OPEN_PAREN a_expr CLOSE_PAREN) + ; + +column_expr_noparen + : column_name + | a_expr + ; + +func_arg_list + : func_arg_expr (COMMA func_arg_expr)* + ; + +func_arg_expr + : a_expr + | param_name (COLON_EQUALS | EQUALS_GREATER) a_expr + ; + +type_list + : typename (COMMA typename)* + ; + +array_expr + : OPEN_BRACKET (expr_list | array_expr_list)? CLOSE_BRACKET + ; + +array_expr_list + : array_expr (COMMA array_expr)* + ; + +extract_list + : extract_arg KW_FROM a_expr + ; + +extract_arg + : identifier + | KW_YEAR + | KW_MONTH + | KW_DAY + | KW_HOUR + | KW_MINUTE + | KW_SECOND + | sconst + ; + +unicode_normal_form + : KW_NFC + | KW_NFD + | KW_NFKC + | KW_NFKD + ; + +overlay_list + : a_expr KW_PLACING a_expr KW_FROM a_expr (KW_FOR a_expr)? + ; + +position_list + : b_expr KW_IN b_expr + ; + +substr_list + : a_expr KW_FROM a_expr KW_FOR a_expr + | a_expr KW_FOR a_expr KW_FROM a_expr + | a_expr KW_FROM a_expr + | a_expr KW_FOR a_expr + | a_expr KW_SIMILAR a_expr KW_ESCAPE a_expr + | expr_list + ; + +trim_list + : a_expr KW_FROM expr_list + | KW_FROM expr_list + | expr_list + ; + +in_expr + : select_with_parens # in_expr_select + | OPEN_PAREN expr_list CLOSE_PAREN # in_expr_list + ; + +case_expr + : KW_CASE case_arg? when_clause_list case_default? KW_END + ; + +when_clause_list + : when_clause+ + ; + +when_clause + : KW_WHEN a_expr KW_THEN a_expr + ; + +case_default + : KW_ELSE a_expr + ; + +case_arg + : a_expr + ; + +columnref + : colid indirection? + ; + +indirection_el + : DOT (attr_name | STAR) + | OPEN_BRACKET (a_expr | opt_slice_bound? COLON opt_slice_bound?) CLOSE_BRACKET + ; + +opt_slice_bound + : a_expr + ; + +indirection + : indirection_el+ + ; + +opt_indirection + : indirection_el* + ; + +opt_target_list + : target_list + ; + +target_list + : target_el (COMMA target_el)* + ; + +target_el + : column_expr_noparen (KW_AS collabel | identifier |) # target_label + | STAR # target_star + ; + +qualified_name_list + : qualified_name (COMMA qualified_name)* + ; + +table_name_list + : table_name (COMMA table_name)* + ; + +schema_name_list + : schema_name (COMMA schema_name)* + ; + +database_nameList + : database_name (COMMA database_name)* + ; + +procedure_name_list + : procedure_name (COMMA procedure_name)* + ; + +tablespace_name_create + : colid indirection? + ; + +tablespace_name + : colid indirection? + ; + +table_name_create + : colid indirection? + ; + +table_name + : colid indirection? + ; + +view_name_create + : colid indirection? + ; + +view_name + : colid attrs? + ; + +qualified_name + : colid indirection? + ; + +tablespace_name_list + : tablespace_name (COMMA tablespace_name)* + ; + +name_list + : name (COMMA name)* + ; + +database_name_create + : colid attrs? + ; + +database_name + : colid attrs? + ; + +schema_name + : colid attrs? + ; + +routine_name_create + : colid + ; + +routine_name + : colid + ; + +procedure_name + : type_function_name + | colid indirection + ; + +procedure_name_create + : type_function_name + | colid indirection + ; + +column_name + : colid + ; + +column_name_create + : colid + ; + +name + : colid + ; + +attr_name + : collabel + ; + +file_name + : sconst + ; + +function_name_create + : type_function_name + | colid indirection + ; + +function_name + : type_function_name + | colid indirection + ; + +usual_name + : type_usual_name + | colid indirection + ; + +aexprconst + : iconst + | fconst + | sconst + | bconst + | xconst + | function_name (sconst | OPEN_PAREN func_arg_list opt_sort_clause? CLOSE_PAREN sconst) + | consttypename sconst + | constinterval ( sconst opt_interval? | OPEN_PAREN iconst CLOSE_PAREN sconst) + | KW_TRUE + | KW_FALSE + | KW_NULL + ; + +xconst + : HexadecimalStringConstant + ; + +bconst + : BinaryStringConstant + ; + +fconst + : Numeric + ; + +iconst + : Integral + ; + +sconst + : anysconst opt_uescape? + ; + +anysconst + : StringConstant + | UnicodeEscapeStringConstant + | BeginDollarStringConstant DollarText* EndDollarStringConstant + | EscapeStringConstant + ; + +opt_uescape + : KW_UESCAPE anysconst + ; + +signediconst + : iconst + | PLUS iconst + | MINUS iconst + ; + +groupname + : rolespec + ; + +roleid + : rolespec + ; + +rolespec + : nonreservedword + | KW_CURRENT_USER + | KW_CURRENT_ROLE + | KW_SESSION_USER + | KW_PUBLIC + ; + +role_list + : rolespec (COMMA rolespec)* + ; + +colid + : identifier + | unreserved_keyword + | col_name_keyword + | plsql_unreserved_keyword + ; + +index_method_choices + : identifier + ; + +exclude_element + : opt_definition + | (OPEN_PAREN a_expr CLOSE_PAREN) identifier opt_asc_desc? opt_nulls_order? + ; + +index_paramenters + : (KW_WITH reloptions)? optconstablespace? + ; + +type_function_name + : identifier + | unreserved_keyword + | plsql_unreserved_keyword + | type_func_name_keyword + ; + +type_usual_name + : identifier + | unreserved_keyword + | plsql_unreserved_keyword + | type_func_name_keyword + ; + +nonreservedword_column + : column_name + | type_func_name_keyword + ; + +nonreservedword + : identifier + | unreserved_keyword + | col_name_keyword + | type_func_name_keyword + ; + +collabel + : identifier + | plsql_unreserved_keyword + | unreserved_keyword + | col_name_keyword + | type_func_name_keyword + | reserved_keyword + ; + +identifier + : Identifier opt_uescape? + | sconst + | QuotedIdentifier + | UnicodeQuotedIdentifier + | plsqlvariablename + | plsqlidentifier + | plsql_unreserved_keyword + ; + +plsqlidentifier + : PLSQLIDENTIFIER + ; + +unreserved_keyword + : KW_ABORT + | KW_ABSOLUTE + | KW_ACCESS + | KW_ACTION + | KW_ADD + | KW_ADMIN + | KW_AFTER + | KW_AGGREGATE + | KW_ALSO + | KW_ALTER + | KW_ALWAYS + | KW_ASSERTION + | KW_ASSIGNMENT + | KW_AT + | KW_ATTACH + | KW_ATTRIBUTE + | KW_BACKWARD + | KW_BEFORE + | KW_BEGIN + | KW_BUFFER_USAGE_LIMIT + | KW_BY + | KW_CACHE + | KW_CALL + | KW_CALLED + | KW_CASCADE + | KW_CASCADED + | KW_CATALOG + | KW_CHAIN + | KW_CHARACTERISTICS + | KW_CHECKPOINT + | KW_CLASS + | KW_CLOSE + | KW_CLUSTER + | KW_COLUMNS + | KW_COMMENT + | KW_COMMENTS + | KW_COMMIT + | KW_COMMITTED + | KW_CONFIGURATION + | KW_CONFLICT + | KW_CONNECTION + | KW_CONSTRAINTS + | KW_CONTENT + | KW_CONTINUE + | KW_CONVERSION + | KW_COPY + | KW_COST + | KW_CSV + | KW_CUBE + | KW_CURRENT + | KW_CURSOR + | KW_CYCLE + | KW_DATA + | KW_DATABASE + | KW_DAY + | KW_DEALLOCATE + | KW_DECLARE + | KW_DEFAULTS + | KW_DEFERRED + | KW_DEFINER + | KW_DELETE + | KW_DELIMITER + | KW_DELIMITERS + | KW_DEPENDS + | KW_DETACH + | KW_DICTIONARY + | KW_DISABLE + | KW_DISCARD + | KW_DOCUMENT + | KW_DOMAIN + | KW_DOUBLE + | KW_DROP + | KW_EACH + | KW_ENABLE + | KW_ENCODING + | KW_ENCRYPTED + | KW_ENUM + | KW_ESCAPE + | KW_EVENT + | KW_EXCLUDE + | KW_EXCLUDING + | KW_EXCLUSIVE + | KW_EXECUTE + | KW_EXPLAIN + | KW_EXPRESSION + | KW_EXTENSION + | KW_EXTERNAL + | KW_FAMILY + | KW_FILTER + | KW_FIRST + | KW_FOLLOWING + | KW_FORCE + | KW_FORWARD + | KW_FUNCTION + | KW_FUNCTIONS + | KW_GENERATED + | KW_GLOBAL + | KW_GRANTED + | KW_GROUPS + | KW_HANDLER + | KW_HEADER + | KW_HOLD + | KW_HOUR + | KW_IDENTITY + | KW_IF + | KW_IMMEDIATE + | KW_IMMUTABLE + | KW_IMPLICIT + | KW_IMPORT + | KW_INCLUDE + | KW_INCLUDING + | KW_INCREMENT + | KW_INDEX + | KW_INDEXES + | KW_INHERIT + | KW_INHERITS + | KW_INLINE + | KW_INPUT + | KW_INSENSITIVE + | KW_INSERT + | KW_INSTEAD + | KW_INVOKER + | KW_ISOLATION + | KW_KEY + | KW_LABEL + | KW_LANGUAGE + | KW_LARGE + | KW_LAST + | KW_LEAKPROOF + | KW_LEVEL + | KW_LISTEN + | KW_LOAD + | KW_LOCAL + | KW_LOCATION + | KW_LOCK + | KW_LOCKED + | KW_LOGGED + | KW_MAPPING + | KW_MATCH + | KW_MATERIALIZED + | KW_MAXVALUE + | KW_METHOD + | KW_MINUTE + | KW_MINVALUE + | KW_MODE + | KW_MONTH + | KW_MOVE + | KW_NAME + | KW_NAMES + | KW_NEW + | KW_NEXT + | KW_NFC + | KW_NFD + | KW_NFKC + | KW_NFKD + | KW_NO + | KW_NORMALIZED + | KW_NOTHING + | KW_NOTIFY + | KW_NOWAIT + | KW_NULLS + | KW_OBJECT + | KW_OF + | KW_OFF + | KW_OIDS + | KW_OLD + | KW_OPERATOR + | KW_OPTION + | KW_OPTIONS + | KW_ORDINALITY + | KW_OTHERS + | KW_OVER + | KW_OVERRIDING + | KW_OWNED + | KW_OWNER + | KW_PARALLEL + | KW_PARSER + | KW_PARTIAL + | KW_PARTITION + | KW_PASSING + | KW_PASSWORD + | KW_PLANS + | KW_POLICY + | KW_PRECEDING + | KW_PREPARE + | KW_PREPARED + | KW_PRESERVE + | KW_PRIOR + | KW_PRIVILEGES + | KW_PROCEDURAL + | KW_PROCEDURE + | KW_PROCEDURES + | KW_PROGRAM + | KW_PUBLICATION + | KW_QUOTE + | KW_RANGE + | KW_READ + | KW_REASSIGN + | KW_RECHECK + | KW_RECURSIVE + | KW_REF + | KW_REFERENCING + | KW_REFRESH + | KW_REINDEX + | KW_RELATIVE + | KW_RELEASE + | KW_RENAME + | KW_REPEATABLE + | KW_REPLACE + | KW_REPLICA + | KW_RESET + | KW_RESTART + | KW_RESTRICT + | KW_RETURNS + | KW_REVOKE + | KW_ROLE + | KW_ROLLBACK + | KW_ROLLUP + | KW_ROUTINE + | KW_ROUTINES + | KW_ROWS + | KW_RULE + | KW_SAVEPOINT + | KW_SCHEMA + | KW_SCHEMAS + | KW_SCROLL + | KW_SEARCH + | KW_SECOND + | KW_SECURITY + | KW_SEQUENCE + | KW_SEQUENCES + | KW_SERIALIZABLE + | KW_SERVER + | KW_SESSION + | KW_SET + | KW_SETS + | KW_SHARE + | KW_SHOW + | KW_SIMPLE + | KW_SKIP + | KW_SKIP_LOCKED + | KW_SNAPSHOT + | KW_SQL + | KW_STABLE + | KW_STANDALONE + | KW_START + | KW_STATEMENT + | KW_STATISTICS + | KW_STDIN + | KW_STDOUT + | KW_STORAGE + | KW_STORED + | KW_STRICT + | KW_STRIP + | KW_SUBSCRIPTION + | KW_SUPPORT + | KW_SYSID + | KW_SYSTEM + | KW_TABLES + | KW_TABLESPACE + | KW_TEMP + | KW_TEMPLATE + | KW_TEMPORARY + | KW_TEXT + | KW_TIES + | KW_TRANSACTION + | KW_TRANSFORM + | KW_TRIGGER + | KW_TRUNCATE + | KW_TRUSTED + | KW_TYPE + | KW_TYPES + | KW_UESCAPE + | KW_UNBOUNDED + | KW_UNCOMMITTED + | KW_UNENCRYPTED + | KW_UNKNOWN + | KW_UNLISTEN + | KW_UNLOGGED + | KW_UNTIL + | KW_UPDATE + | KW_VACUUM + | KW_VALID + | KW_VALIDATE + | KW_VALIDATOR + | KW_VALUE + | KW_VARYING + | KW_VERSION + | KW_VIEW + | KW_VIEWS + | KW_VOLATILE + | KW_WHITESPACE + | KW_WITHIN + | KW_WITHOUT + | KW_WORK + | KW_WRAPPER + | KW_WRITE + | KW_XML + | KW_YEAR + | KW_YES + | KW_ZONE + ; + +col_name_keyword + : KW_BETWEEN + | KW_BIGINT + | bit + | KW_BOOLEAN + | KW_CHAR + | character + | KW_COALESCE + | KW_DEC + | KW_DECIMAL + | KW_EXISTS + | KW_EXTRACT + | KW_FLOAT + | KW_GREATEST + | KW_GROUPING + | KW_INOUT + | KW_INT + | KW_INTEGER + | KW_INTERVAL + | KW_LEAST + | KW_NATIONAL + | KW_NCHAR + | KW_NONE + | KW_NORMALIZE + | KW_NULLIF + | numeric + | KW_OUT + | KW_OVERLAY + | KW_POSITION + | KW_PRECISION + | KW_REAL + | KW_ROW + | KW_SETOF + | KW_SMALLINT + | KW_SUBSTRING + | KW_TIME + | KW_TIMESTAMP + | KW_TREAT + | KW_TRIM + | KW_VALUES + | KW_VARCHAR + | KW_XMLATTRIBUTES + | KW_XMLCONCAT + | KW_XMLELEMENT + | KW_XMLEXISTS + | KW_XMLFOREST + | KW_XMLNAMESPACES + | KW_XMLPARSE + | KW_XMLPI + | KW_XMLROOT + | KW_XMLSERIALIZE + | KW_XMLTABLE + ; + +type_func_name_keyword + : KW_AUTHORIZATION + | KW_BINARY + | KW_COLLATION + | KW_CONCURRENTLY + | KW_CROSS + | KW_CURRENT_SCHEMA + | KW_FREEZE + | KW_FULL + | KW_ILIKE + | KW_INNER + | KW_IS + | KW_ISNULL + | KW_JOIN + | KW_LEFT + | KW_LIKE + | KW_NATURAL + | KW_NOTNULL + | KW_OUTER + | KW_OVERLAPS + | KW_RIGHT + | KW_SIMILAR + | KW_TABLESAMPLE + | KW_VERBOSE + ; + +reserved_keyword + : KW_ALL + | KW_ANALYSE + | KW_ANALYZE + | KW_AND + | KW_ANY + | KW_ARRAY + | KW_AS + | KW_ASC + | KW_ASYMMETRIC + | KW_BOTH + | KW_CASE + | KW_CAST + | KW_CHECK + | KW_COLLATE + | KW_COLUMN + | KW_CONSTRAINT + | KW_CREATE + | KW_CURRENT_CATALOG + | KW_CURRENT_DATE + | KW_CURRENT_ROLE + | KW_CURRENT_TIME + | KW_CURRENT_TIMESTAMP + | KW_CURRENT_USER + // | KW_DEFAULT + | KW_DEFERRABLE + | KW_DESC + | KW_DISTINCT + | KW_DO + | KW_ELSE + | KW_END + | KW_EXCEPT + | KW_FALSE + | KW_FETCH + | KW_FOR + | KW_FOREIGN + | KW_FROM + | KW_GRANT + | KW_GROUP + | KW_HAVING + | KW_IN + | KW_INITIALLY + | KW_INTERSECT + /* from pl_gram.y, line ~2982 Fortunately, INTO is a fully reserved word in the main grammar, so at least we need not worry about it appearing as an identifier. */ - // | INTO - | KW_LATERAL - | KW_LEADING - | KW_LIMIT - | KW_LOCALTIME - | KW_LOCALTIMESTAMP - | KW_NOT - | KW_NULL - | KW_OFFSET - | KW_ON - | KW_ONLY - | KW_OR - | KW_ORDER - | KW_PLACING - | KW_PRIMARY - | KW_REFERENCES - | KW_RETURNING - | KW_SELECT - | KW_SESSION_USER - | KW_SOME - | KW_SYMMETRIC - | KW_TABLE - | KW_THEN - | KW_TO - | KW_TRAILING - | KW_TRUE - | KW_UNION - | KW_UNIQUE - | KW_USER - | KW_USING - | KW_VARIADIC - | KW_WHEN - | KW_WHERE - | KW_WINDOW - | KW_WITH; + // | INTO + | KW_LATERAL + | KW_LEADING + | KW_LIMIT + | KW_LOCALTIME + | KW_LOCALTIMESTAMP + | KW_NOT + | KW_NULL + | KW_OFFSET + | KW_ON + | KW_ONLY + | KW_OR + | KW_ORDER + | KW_PLACING + | KW_PRIMARY + | KW_REFERENCES + | KW_RETURNING + | KW_SELECT + | KW_SESSION_USER + | KW_SOME + | KW_SYMMETRIC + | KW_TABLE + | KW_THEN + | KW_TO + | KW_TRAILING + | KW_TRUE + | KW_UNION + | KW_UNIQUE + | KW_USER + | KW_USING + | KW_VARIADIC + | KW_WHEN + | KW_WHERE + | KW_WINDOW + | KW_WITH + ; /************************************************************************************************************************************************************/ /*PL/SQL GRAMMAR */ @@ -3574,200 +4847,341 @@ reserved_keyword: /*PLSQL grammar */ /************************************************************************************************************************************************************/ - pl_function: comp_options pl_block opt_semi; +pl_function + : comp_options pl_block opt_semi + ; -comp_options: comp_option*; +comp_options + : comp_option* + ; -comp_option: - sharp KW_OPTION KW_DUMP - | sharp KW_PRINT_STRICT_PARAMS option_value - | sharp KW_VARIABLE_CONFLICT KW_ERROR - | sharp KW_VARIABLE_CONFLICT KW_USE_VARIABLE - | sharp KW_VARIABLE_CONFLICT KW_USE_COLUMN; +comp_option + : sharp KW_OPTION KW_DUMP + | sharp KW_PRINT_STRICT_PARAMS option_value + | sharp KW_VARIABLE_CONFLICT KW_ERROR + | sharp KW_VARIABLE_CONFLICT KW_USE_VARIABLE + | sharp KW_VARIABLE_CONFLICT KW_USE_COLUMN + ; -sharp: Operator; +sharp + : Operator + ; -option_value: - sconst - | reserved_keyword - | plsql_unreserved_keyword - | unreserved_keyword; +option_value + : sconst + | reserved_keyword + | plsql_unreserved_keyword + | unreserved_keyword + ; + +opt_semi + : + | SEMI + ; -opt_semi: | SEMI; // exception_sect means opt_exception_sect in original grammar, don't be confused! -pl_block: - decl_sect KW_BEGIN proc_sect exception_sect KW_END opt_label; +pl_block + : decl_sect KW_BEGIN proc_sect exception_sect KW_END opt_label + ; -decl_sect: opt_block_label (decl_start decl_stmts?)?; +decl_sect + : opt_block_label (decl_start decl_stmts?)? + ; -decl_start: KW_DECLARE; +decl_start + : KW_DECLARE + ; -decl_stmts: decl_stmt+; +decl_stmts + : decl_stmt+ + ; -label_decl: LESS_LESS any_identifier GREATER_GREATER; +label_decl + : LESS_LESS any_identifier GREATER_GREATER + ; -decl_stmt: decl_statement | KW_DECLARE | label_decl; +decl_stmt + : decl_statement + | KW_DECLARE + | label_decl + ; -decl_statement: - decl_varname ( - KW_ALIAS KW_FOR decl_aliasitem - | decl_const decl_datatype decl_collate decl_notnull decl_defval - | opt_scrollable KW_CURSOR decl_cursor_args decl_is_for decl_cursor_query - ) SEMI; +decl_statement + : decl_varname ( + KW_ALIAS KW_FOR decl_aliasitem + | decl_const decl_datatype decl_collate decl_notnull decl_defval + | opt_scrollable KW_CURSOR decl_cursor_args decl_is_for decl_cursor_query + ) SEMI + ; -opt_scrollable: | KW_NO KW_SCROLL | KW_SCROLL; +opt_scrollable + : + | KW_NO KW_SCROLL + | KW_SCROLL + ; -decl_cursor_query: selectstmt; +decl_cursor_query + : selectstmt + ; -decl_cursor_args: | OPEN_PAREN decl_cursor_arglist CLOSE_PAREN; +decl_cursor_args + : + | OPEN_PAREN decl_cursor_arglist CLOSE_PAREN + ; -decl_cursor_arglist: decl_cursor_arg (COMMA decl_cursor_arg)*; +decl_cursor_arglist + : decl_cursor_arg (COMMA decl_cursor_arg)* + ; -decl_cursor_arg: decl_varname decl_datatype; +decl_cursor_arg + : decl_varname decl_datatype + ; -decl_is_for: KW_IS | KW_FOR; +decl_is_for + : KW_IS + | KW_FOR + ; -decl_aliasitem: PARAM | colid; +decl_aliasitem + : PARAM + | colid + ; -decl_varname: any_identifier; +decl_varname + : any_identifier + ; -decl_const: | KW_CONSTANT; +decl_const + : + | KW_CONSTANT + ; -decl_datatype: typename; //TODO: $$ = read_datatype(yychar); +decl_datatype + : typename + ; //TODO: $$ = read_datatype(yychar); -decl_collate: | KW_COLLATE any_name; +decl_collate + : + | KW_COLLATE any_name + ; -decl_notnull: | KW_NOT KW_NULL; +decl_notnull + : + | KW_NOT KW_NULL + ; -decl_defval: | decl_defkey sql_expression; +decl_defval + : + | decl_defkey sql_expression + ; -decl_defkey: assign_operator | KW_DEFAULT; +decl_defkey + : assign_operator + | KW_DEFAULT + ; -assign_operator: EQUAL | COLON_EQUALS; +assign_operator + : EQUAL + | COLON_EQUALS + ; -proc_sect: proc_stmt*; +proc_sect + : proc_stmt* + ; -proc_stmt: - pl_block SEMI - | stmt_return - | stmt_raise - | stmt_assign - | stmt_if - | stmt_case - | stmt_loop - | stmt_while - | stmt_for - | stmt_foreach_a - | stmt_exit - | stmt_assert - | stmt_execsql - | stmt_dynexecute - | stmt_perform - | stmt_call - | stmt_getdiag - | stmt_open - | stmt_fetch - | stmt_move - | stmt_close - | stmt_null - | stmt_commit - | stmt_rollback - | stmt_set; +proc_stmt + : pl_block SEMI + | stmt_return + | stmt_raise + | stmt_assign + | stmt_if + | stmt_case + | stmt_loop + | stmt_while + | stmt_for + | stmt_foreach_a + | stmt_exit + | stmt_assert + | stmt_execsql + | stmt_dynexecute + | stmt_perform + | stmt_call + | stmt_getdiag + | stmt_open + | stmt_fetch + | stmt_move + | stmt_close + | stmt_null + | stmt_commit + | stmt_rollback + | stmt_set + ; -stmt_perform: KW_PERFORM expr_until_semi SEMI; +stmt_perform + : KW_PERFORM expr_until_semi SEMI + ; -stmt_call: - KW_CALL any_identifier (OPEN_PAREN opt_expr_list CLOSE_PAREN SEMI)? - | KW_DO any_identifier OPEN_PAREN opt_expr_list CLOSE_PAREN SEMI; +stmt_call + : KW_CALL any_identifier (OPEN_PAREN opt_expr_list CLOSE_PAREN SEMI)? + | KW_DO any_identifier OPEN_PAREN opt_expr_list CLOSE_PAREN SEMI + ; -opt_expr_list: | expr_list; +opt_expr_list + : + | expr_list + ; -stmt_assign: assign_var assign_operator sql_expression SEMI; +stmt_assign + : assign_var assign_operator sql_expression SEMI + ; -stmt_getdiag: - KW_GET getdiag_area_opt KW_DIAGNOSTICS getdiag_list SEMI; +stmt_getdiag + : KW_GET getdiag_area_opt KW_DIAGNOSTICS getdiag_list SEMI + ; -getdiag_area_opt: | KW_CURRENT | KW_STACKED; +getdiag_area_opt + : + | KW_CURRENT + | KW_STACKED + ; -getdiag_list: getdiag_list_item (COMMA getdiag_list_item)*; +getdiag_list + : getdiag_list_item (COMMA getdiag_list_item)* + ; -getdiag_list_item: getdiag_target assign_operator getdiag_item; +getdiag_list_item + : getdiag_target assign_operator getdiag_item + ; -getdiag_item: colid; +getdiag_item + : colid + ; -getdiag_target: assign_var; +getdiag_target + : assign_var + ; -assign_var: (any_name | PARAM) ( - OPEN_BRACKET expr_until_rightbracket CLOSE_BRACKET - )*; +assign_var + : (any_name | PARAM) (OPEN_BRACKET expr_until_rightbracket CLOSE_BRACKET)* + ; -stmt_if: - KW_IF expr_until_then KW_THEN proc_sect stmt_elsifs stmt_else KW_END KW_IF SEMI; +stmt_if + : KW_IF expr_until_then KW_THEN proc_sect stmt_elsifs stmt_else KW_END KW_IF SEMI + ; -stmt_elsifs: (KW_ELSIF a_expr KW_THEN proc_sect)*; +stmt_elsifs + : (KW_ELSIF a_expr KW_THEN proc_sect)* + ; -stmt_else: | KW_ELSE proc_sect; +stmt_else + : + | KW_ELSE proc_sect + ; -stmt_case: - KW_CASE opt_expr_until_when case_when_list opt_case_else KW_END KW_CASE SEMI; +stmt_case + : KW_CASE opt_expr_until_when case_when_list opt_case_else KW_END KW_CASE SEMI + ; -opt_expr_until_when: | sql_expression; +opt_expr_until_when + : + | sql_expression + ; -case_when_list: case_when+; +case_when_list + : case_when+ + ; -case_when: KW_WHEN expr_list KW_THEN proc_sect; +case_when + : KW_WHEN expr_list KW_THEN proc_sect + ; -opt_case_else: | KW_ELSE proc_sect; +opt_case_else + : + | KW_ELSE proc_sect + ; -stmt_loop: opt_loop_label loop_body; +stmt_loop + : opt_loop_label loop_body + ; -stmt_while: opt_loop_label KW_WHILE expr_until_loop loop_body; +stmt_while + : opt_loop_label KW_WHILE expr_until_loop loop_body + ; + +stmt_for + : opt_loop_label KW_FOR for_control loop_body + ; -stmt_for: opt_loop_label KW_FOR for_control loop_body; //TODO: rewrite using read_sql_expression logic? -for_control: - for_variable KW_IN ( - cursor_name opt_cursor_parameters - | selectstmt - | explainstmt - | KW_EXECUTE a_expr opt_for_using_expression - | opt_reverse a_expr DOT_DOT a_expr opt_by_expression - ); +for_control + : for_variable KW_IN ( + cursor_name opt_cursor_parameters + | selectstmt + | explainstmt + | KW_EXECUTE a_expr opt_for_using_expression + | opt_reverse a_expr DOT_DOT a_expr opt_by_expression + ) + ; -opt_for_using_expression: | KW_USING expr_list; +opt_for_using_expression + : + | KW_USING expr_list + ; -opt_cursor_parameters: - | OPEN_PAREN a_expr (COMMA a_expr)* CLOSE_PAREN; +opt_cursor_parameters + : + | OPEN_PAREN a_expr (COMMA a_expr)* CLOSE_PAREN + ; -opt_reverse: | KW_REVERSE; +opt_reverse + : + | KW_REVERSE + ; -opt_by_expression: | KW_BY a_expr; +opt_by_expression + : + | KW_BY a_expr + ; -for_variable: any_name_list; +for_variable + : any_name_list + ; -stmt_foreach_a: - opt_loop_label KW_FOREACH for_variable foreach_slice KW_IN KW_ARRAY a_expr loop_body; +stmt_foreach_a + : opt_loop_label KW_FOREACH for_variable foreach_slice KW_IN KW_ARRAY a_expr loop_body + ; -foreach_slice: | KW_SLICE iconst; +foreach_slice + : + | KW_SLICE iconst + ; -stmt_exit: exit_type opt_label opt_exitcond? SEMI; +stmt_exit + : exit_type opt_label opt_exitcond? SEMI + ; + +exit_type + : KW_EXIT + | KW_CONTINUE + ; -exit_type: KW_EXIT | KW_CONTINUE; //todo implement RETURN statement according to initial grammar line 1754 -stmt_return: - KW_RETURN ( - KW_NEXT sql_expression - | KW_QUERY ( - KW_EXECUTE a_expr opt_for_using_expression - | selectstmt - ) - | opt_return_result - ) SEMI; +stmt_return + : KW_RETURN ( + KW_NEXT sql_expression + | KW_QUERY ( KW_EXECUTE a_expr opt_for_using_expression | selectstmt) + | opt_return_result + ) SEMI + ; + +opt_return_result + : + | sql_expression + ; -opt_return_result: | sql_expression; //https://www.postgresql.org/docs/current/plpgsql-errors-and-messages.html //RAISE [ level ] 'format' [, expression [, ... ]] [ USING option = expression [, ... ] ]; @@ -3780,63 +5194,93 @@ opt_return_result: | sql_expression; //RAISE ; -stmt_raise: - KW_RAISE opt_stmt_raise_level? sconst opt_raise_list opt_raise_using SEMI - | KW_RAISE opt_stmt_raise_level? identifier opt_raise_using SEMI - | KW_RAISE opt_stmt_raise_level? KW_SQLSTATE sconst opt_raise_using SEMI - | KW_RAISE opt_stmt_raise_level? opt_raise_using SEMI - | KW_RAISE; +stmt_raise + : KW_RAISE opt_stmt_raise_level? sconst opt_raise_list opt_raise_using SEMI + | KW_RAISE opt_stmt_raise_level? identifier opt_raise_using SEMI + | KW_RAISE opt_stmt_raise_level? KW_SQLSTATE sconst opt_raise_using SEMI + | KW_RAISE opt_stmt_raise_level? opt_raise_using SEMI + | KW_RAISE + ; -opt_stmt_raise_level: - KW_DEBUG - | KW_LOG - | KW_INFO - | KW_NOTICE - | KW_WARNING - | KW_EXCEPTION; +opt_stmt_raise_level + : KW_DEBUG + | KW_LOG + | KW_INFO + | KW_NOTICE + | KW_WARNING + | KW_EXCEPTION + ; -opt_raise_list: | (COMMA a_expr)+; +opt_raise_list + : + | (COMMA a_expr)+ + ; -opt_raise_using: | KW_USING opt_raise_using_elem_list; +opt_raise_using + : + | KW_USING opt_raise_using_elem_list + ; -opt_raise_using_elem: identifier EQUAL a_expr; +opt_raise_using_elem + : identifier EQUAL a_expr + ; + +opt_raise_using_elem_list + : opt_raise_using_elem (COMMA opt_raise_using_elem)* + ; -opt_raise_using_elem_list: - opt_raise_using_elem (COMMA opt_raise_using_elem)*; //todo imnplement -stmt_assert: KW_ASSERT sql_expression opt_stmt_assert_message SEMI; +stmt_assert + : KW_ASSERT sql_expression opt_stmt_assert_message SEMI + ; -opt_stmt_assert_message: | COMMA sql_expression; +opt_stmt_assert_message + : + | COMMA sql_expression + ; + +loop_body + : KW_LOOP proc_sect KW_END KW_LOOP opt_label SEMI + ; -loop_body: KW_LOOP proc_sect KW_END KW_LOOP opt_label SEMI; //TODO: looks like all other statements like INSERT/SELECT/UPDATE/DELETE are handled here; - //pls take a look at original grammar -stmt_execsql: - make_execsql_stmt SEMI - /*K_IMPORT +stmt_execsql + : make_execsql_stmt SEMI + /*K_IMPORT | K_INSERT | t_word | t_cword - */; + */ + ; + //https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-NORESULT //EXECUTE command-string [ INTO [STRICT] target ] [ USING expression [, ... ] ]; -stmt_dynexecute: - KW_EXECUTE a_expr ( - /*this is silly, but i have to time to find nice way to code */ opt_execute_into - opt_execute_using - | opt_execute_using opt_execute_into - | - ) SEMI; +stmt_dynexecute + : KW_EXECUTE a_expr ( + /*this is silly, but i have to time to find nice way to code */ opt_execute_into opt_execute_using + | opt_execute_using opt_execute_into + | + ) SEMI + ; -opt_execute_using: | KW_USING opt_execute_using_list; +opt_execute_using + : + | KW_USING opt_execute_using_list + ; -opt_execute_using_list: a_expr (COMMA a_expr)*; +opt_execute_using_list + : a_expr (COMMA a_expr)* + ; + +opt_execute_into + : + | KW_INTO KW_STRICT? into_target + ; -opt_execute_into: | KW_INTO KW_STRICT? into_target; //https://www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-OPENING //OPEN unbound_cursorvar [ [ NO ] SCROLL ] KW_FOR query; @@ -3847,101 +5291,172 @@ opt_execute_into: | KW_INTO KW_STRICT? into_target; //OPEN bound_cursorvar [ ( [ argument_name := ] argument_value [, ...] ) ]; -stmt_open: - KW_OPEN ( - cursor_variable opt_scroll_option KW_FOR ( - selectstmt - | KW_EXECUTE sql_expression opt_open_using - ) - | colid (OPEN_PAREN opt_open_bound_list CLOSE_PAREN)? - ) SEMI; +stmt_open + : KW_OPEN ( + cursor_variable opt_scroll_option KW_FOR ( + selectstmt + | KW_EXECUTE sql_expression opt_open_using + ) + | colid (OPEN_PAREN opt_open_bound_list CLOSE_PAREN)? + ) SEMI + ; -opt_open_bound_list_item: colid COLON_EQUALS a_expr | a_expr; +opt_open_bound_list_item + : colid COLON_EQUALS a_expr + | a_expr + ; -opt_open_bound_list: - opt_open_bound_list_item (COMMA opt_open_bound_list_item)*; +opt_open_bound_list + : opt_open_bound_list_item (COMMA opt_open_bound_list_item)* + ; -opt_open_using: | KW_USING expr_list; +opt_open_using + : + | KW_USING expr_list + ; -opt_scroll_option: | opt_scroll_option_no KW_SCROLL; +opt_scroll_option + : + | opt_scroll_option_no KW_SCROLL + ; + +opt_scroll_option_no + : + | KW_NO + ; -opt_scroll_option_no: | KW_NO; //https://www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-OPENING //FETCH [ direction { KW_FROM | IN } ] cursor INTO target; -stmt_fetch: - KW_FETCH direction = opt_fetch_direction? opt_cursor_from cursor_variable KW_INTO into_target SEMI; +stmt_fetch + : KW_FETCH direction= opt_fetch_direction? opt_cursor_from cursor_variable KW_INTO into_target SEMI + ; -into_target: expr_list; +into_target + : expr_list + ; -opt_cursor_from: | KW_FROM | KW_IN; +opt_cursor_from + : + | KW_FROM + | KW_IN + ; + +opt_fetch_direction + : KW_NEXT + | KW_PRIOR + | KW_FIRST + | KW_LAST + | KW_ABSOLUTE a_expr + | KW_RELATIVE a_expr + | a_expr + | KW_ALL + | (KW_FORWARD | KW_BACKWARD) (a_expr | KW_ALL)? + ; -opt_fetch_direction: - KW_NEXT - | KW_PRIOR - | KW_FIRST - | KW_LAST - | KW_ABSOLUTE a_expr - | KW_RELATIVE a_expr - | a_expr - | KW_ALL - | (KW_FORWARD | KW_BACKWARD) (a_expr | KW_ALL)?; //https://www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-OPENING //MOVE [ direction { KW_FROM | IN } ] cursor; -stmt_move: KW_MOVE opt_fetch_direction? cursor_variable SEMI; +stmt_move + : KW_MOVE opt_fetch_direction? cursor_variable SEMI + ; -mergestmt: with_clause? KW_MERGE KW_INTO (KW_ONLY)? table_name (STAR)? (KW_AS? colid)? KW_USING data_source KW_ON join_condition merge_when_clause+; +mergestmt + : with_clause? KW_MERGE KW_INTO (KW_ONLY)? table_name (STAR)? (KW_AS? colid)? KW_USING data_source KW_ON join_condition merge_when_clause+ + ; -data_source: ((KW_ONLY)? table_name (STAR)? | ( select_no_parens | values_clause ) )(KW_AS? colid)?; +data_source + : ((KW_ONLY)? table_name (STAR)? | ( select_no_parens | values_clause)) (KW_AS? colid)? + ; -join_condition: a_expr; +join_condition + : a_expr + ; -merge_when_clause: - KW_WHEN KW_MATCHED (KW_AND a_expr)? KW_THEN (merge_update | KW_DELETE | KW_DO KW_NOTHING) - | KW_WHEN KW_NOT KW_MATCHED (KW_AND a_expr)? KW_THEN (merge_insert | KW_DO KW_NOTHING); +merge_when_clause + : KW_WHEN KW_MATCHED (KW_AND a_expr)? KW_THEN (merge_update | KW_DELETE | KW_DO KW_NOTHING) + | KW_WHEN KW_NOT KW_MATCHED (KW_AND a_expr)? KW_THEN (merge_insert | KW_DO KW_NOTHING) + ; -merge_insert: - KW_INSERT (OPEN_PAREN columnlist CLOSE_PAREN)? (KW_OVERRIDING (KW_SYSTEM | KW_USER) KW_VALUE)? default_values_or_values ; +merge_insert + : KW_INSERT (OPEN_PAREN columnlist CLOSE_PAREN)? (KW_OVERRIDING (KW_SYSTEM | KW_USER) KW_VALUE)? default_values_or_values + ; -merge_update: - KW_UPDATE KW_SET (column_name EQUAL exprofdefault - | OPEN_PAREN columnlist CLOSE_PAREN EQUAL OPEN_PAREN exprofdefaultlist CLOSE_PAREN)+ - ; +merge_update + : KW_UPDATE KW_SET ( + column_name EQUAL exprofdefault + | OPEN_PAREN columnlist CLOSE_PAREN EQUAL OPEN_PAREN exprofdefaultlist CLOSE_PAREN + )+ + ; -default_values_or_values: KW_VALUES exprofdefaultlist | KW_DEFAULT KW_VALUES; +default_values_or_values + : KW_VALUES exprofdefaultlist + | KW_DEFAULT KW_VALUES + ; -exprofdefaultlist: OPEN_PAREN exprofdefault (COMMA exprofdefault)* CLOSE_PAREN; +exprofdefaultlist + : OPEN_PAREN exprofdefault (COMMA exprofdefault)* CLOSE_PAREN + ; -exprofdefault: sortby | KW_DEFAULT; +exprofdefault + : sortby + | KW_DEFAULT + ; -stmt_close: KW_CLOSE cursor_variable SEMI; +stmt_close + : KW_CLOSE cursor_variable SEMI + ; -stmt_null: KW_NULL SEMI; +stmt_null + : KW_NULL SEMI + ; -stmt_commit: KW_COMMIT plsql_opt_transaction_chain? SEMI; +stmt_commit + : KW_COMMIT plsql_opt_transaction_chain? SEMI + ; -stmt_rollback: KW_ROLLBACK plsql_opt_transaction_chain? SEMI; +stmt_rollback + : KW_ROLLBACK plsql_opt_transaction_chain? SEMI + ; -plsql_opt_transaction_chain: KW_AND KW_NO? KW_CHAIN; +plsql_opt_transaction_chain + : KW_AND KW_NO? KW_CHAIN + ; -stmt_set: - KW_SET any_name KW_TO KW_DEFAULT SEMI - | KW_RESET (any_name | KW_ALL) SEMI; +stmt_set + : KW_SET any_name KW_TO KW_DEFAULT SEMI + | KW_RESET (any_name | KW_ALL) SEMI + ; -cursor_variable: colid | PARAM; +cursor_variable + : colid + | PARAM + ; -exception_sect: | KW_EXCEPTION proc_exceptions; +exception_sect + : + | KW_EXCEPTION proc_exceptions + ; -proc_exceptions: proc_exception+; +proc_exceptions + : proc_exception+ + ; -proc_exception: KW_WHEN proc_conditions KW_THEN proc_sect; +proc_exception + : KW_WHEN proc_conditions KW_THEN proc_sect + ; -proc_conditions: proc_condition (KW_OR proc_condition)*; +proc_conditions + : proc_condition (KW_OR proc_condition)* + ; + +proc_condition + : any_identifier + | KW_SQLSTATE sconst + ; -proc_condition: any_identifier | KW_SQLSTATE sconst; //expr_until_semi: //; @@ -3954,119 +5469,146 @@ proc_condition: any_identifier | KW_SQLSTATE sconst; //; -opt_block_label: | label_decl; +opt_block_label + : + | label_decl + ; -opt_loop_label: | label_decl; +opt_loop_label + : + | label_decl + ; -opt_label: | any_identifier; +opt_label + : + | any_identifier + ; -opt_exitcond: KW_WHEN expr_until_semi; +opt_exitcond + : KW_WHEN expr_until_semi + ; -any_identifier: colid | plsql_unreserved_keyword; +any_identifier + : colid + | plsql_unreserved_keyword + ; -plsql_unreserved_keyword: - KW_ABSOLUTE - | KW_ALIAS - | KW_AND - | KW_ARRAY - | KW_ASSERT - | KW_BACKWARD - | KW_CALL - | KW_CHAIN - | KW_CLOSE - | KW_COLLATE - | KW_COLUMN - //| COLUMN_NAME - | KW_COMMIT - | KW_CONSTANT - | KW_CONSTRAINT - //| CONSTRAINT_NAME - | KW_CONTINUE - | KW_CURRENT - | KW_CURSOR - //| DATATYPE - | KW_DEBUG - | KW_DEFAULT - //| DETAIL - | KW_DIAGNOSTICS - | KW_DO - | KW_DUMP - | KW_ELSIF - //| ERRCODE - | KW_ERROR - | KW_EXCEPTION - | KW_EXIT - | KW_FETCH - | KW_FIRST - | KW_FORWARD - | KW_GET - //| HINT +plsql_unreserved_keyword + : KW_ABSOLUTE + | KW_ALIAS + | KW_AND + | KW_ARRAY + | KW_ASSERT + | KW_BACKWARD + | KW_CALL + | KW_CHAIN + | KW_CLOSE + | KW_COLLATE + | KW_COLUMN + //| COLUMN_NAME + | KW_COMMIT + | KW_CONSTANT + | KW_CONSTRAINT + //| CONSTRAINT_NAME + | KW_CONTINUE + | KW_CURRENT + | KW_CURSOR + //| DATATYPE + | KW_DEBUG + | KW_DEFAULT + //| DETAIL + | KW_DIAGNOSTICS + | KW_DO + | KW_DUMP + | KW_ELSIF + //| ERRCODE + | KW_ERROR + | KW_EXCEPTION + | KW_EXIT + | KW_FETCH + | KW_FIRST + | KW_FORWARD + | KW_GET + //| HINT - //| IMPORT - | KW_INFO - | KW_INSERT - | KW_IS - | KW_LAST - | KW_LOG - //| MESSAGE + //| IMPORT + | KW_INFO + | KW_INSERT + | KW_IS + | KW_LAST + | KW_LOG + //| MESSAGE - //| MESSAGE_TEXT - | KW_MOVE - | KW_NEXT - | KW_NO - | KW_NOTICE - | KW_OPEN - | KW_OPTION - | KW_PERFORM - //| PG_CONTEXT + //| MESSAGE_TEXT + | KW_MOVE + | KW_NEXT + | KW_NO + | KW_NOTICE + | KW_OPEN + | KW_OPTION + | KW_PERFORM + //| PG_CONTEXT - //| PG_DATATYPE_NAME + //| PG_DATATYPE_NAME - //| PG_EXCEPTION_CONTEXT + //| PG_EXCEPTION_CONTEXT - //| PG_EXCEPTION_DETAIL + //| PG_EXCEPTION_DETAIL - //| PG_EXCEPTION_HINT - | KW_PRINT_STRICT_PARAMS - | KW_PRIOR - | KW_QUERY - | KW_RAISE - | KW_RELATIVE - | KW_RESET - | KW_RETURN - //| RETURNED_SQLSTATE - | KW_REVERSE - | KW_ROLLBACK - //| ROW_COUNT - | KW_ROWTYPE - | KW_SCHEMA - //| SCHEMA_NAME - | KW_SCROLL - | KW_SET - | KW_SLICE - | KW_SQLSTATE - | KW_STACKED - | KW_TABLE - //| TABLE_NAME - | KW_TYPE - | KW_USE_COLUMN - | KW_USE_VARIABLE - | KW_VARIABLE_CONFLICT - | KW_WARNING - | KW_OUTER; + //| PG_EXCEPTION_HINT + | KW_PRINT_STRICT_PARAMS + | KW_PRIOR + | KW_QUERY + | KW_RAISE + | KW_RELATIVE + | KW_RESET + | KW_RETURN + //| RETURNED_SQLSTATE + | KW_REVERSE + | KW_ROLLBACK + //| ROW_COUNT + | KW_ROWTYPE + | KW_SCHEMA + //| SCHEMA_NAME + | KW_SCROLL + | KW_SET + | KW_SLICE + | KW_SQLSTATE + | KW_STACKED + | KW_TABLE + //| TABLE_NAME + | KW_TYPE + | KW_USE_COLUMN + | KW_USE_VARIABLE + | KW_VARIABLE_CONFLICT + | KW_WARNING + | KW_OUTER + ; -sql_expression: - opt_target_list? into_clause? from_clause? where_clause? group_clause? having_clause? - window_clause?; +sql_expression + : opt_target_list? into_clause? from_clause? where_clause? group_clause? having_clause? window_clause? + ; -expr_until_then: sql_expression; +expr_until_then + : sql_expression + ; -expr_until_semi: sql_expression; +expr_until_semi + : sql_expression + ; -expr_until_rightbracket: a_expr; +expr_until_rightbracket + : a_expr + ; -expr_until_loop: a_expr; +expr_until_loop + : a_expr + ; -make_execsql_stmt: stmt opt_returning_clause_into?; +make_execsql_stmt + : stmt opt_returning_clause_into? + ; -opt_returning_clause_into: KW_INTO opt_strict into_target; +opt_returning_clause_into + : KW_INTO opt_strict into_target + ; \ No newline at end of file diff --git a/src/grammar/plsql/PlSqlLexer.g4 b/src/grammar/plsql/PlSqlLexer.g4 index 36a8c01..2adeb21 100644 --- a/src/grammar/plsql/PlSqlLexer.g4 +++ b/src/grammar/plsql/PlSqlLexer.g4 @@ -23,2335 +23,2340 @@ * Reference: https://github.com/antlr/grammars-v4/blob/master/sql/plsql/PlSqlLexer.g4 */ +// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing +// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true +// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true + lexer grammar PlSqlLexer; options { superClass=PlSqlBaseLexer; - caseInsensitive = true; + caseInsensitive= true; } @lexer::header { import PlSqlBaseLexer from "./PlSqlBaseLexer"; } -ABORT: 'ABORT'; -ABS: 'ABS'; -ABSENT: 'ABSENT'; -ACCESS: 'ACCESS'; -ACCESSED: 'ACCESSED'; -ACCOUNT: 'ACCOUNT'; -ACL: 'ACL'; -ACOS: 'ACOS'; -ACROSS: 'ACROSS'; -ACTION: 'ACTION'; -ACTIONS: 'ACTIONS'; -ACTIVATE: 'ACTIVATE'; -ACTIVE: 'ACTIVE'; -ACTIVE_COMPONENT: 'ACTIVE_COMPONENT'; -ACTIVE_DATA: 'ACTIVE_DATA'; -ACTIVE_FUNCTION: 'ACTIVE_FUNCTION'; -ACTIVE_TAG: 'ACTIVE_TAG'; -ACTIVITY: 'ACTIVITY'; -ADAPTIVE_PLAN: 'ADAPTIVE_PLAN'; -ADD: 'ADD'; -ADD_COLUMN: 'ADD_COLUMN'; -ADD_GROUP: 'ADD_GROUP'; -ADD_MONTHS: 'ADD_MONTHS'; -ADJ_DATE: 'ADJ_DATE'; -ADMIN: 'ADMIN'; -ADMINISTER: 'ADMINISTER'; -ADMINISTRATOR: 'ADMINISTRATOR'; -ADVANCED: 'ADVANCED'; -ADVISE: 'ADVISE'; -ADVISOR: 'ADVISOR'; -AFD_DISKSTRING: 'AFD_DISKSTRING'; -AFTER: 'AFTER'; -AGENT: 'AGENT'; -AGGREGATE: 'AGGREGATE'; -A_LETTER: 'A'; -ALIAS: 'ALIAS'; -ALL: 'ALL'; -ALLOCATE: 'ALLOCATE'; -ALLOW: 'ALLOW'; -ALL_ROWS: 'ALL_ROWS'; -ALTER: 'ALTER'; -ALTERNATE: 'ALTERNATE'; -ALWAYS: 'ALWAYS'; -ANALYTIC: 'ANALYTIC'; -ANALYZE: 'ANALYZE'; -ANCESTOR: 'ANCESTOR'; -ANCILLARY: 'ANCILLARY'; -AND: 'AND'; -AND_EQUAL: 'AND_EQUAL'; -ANOMALY: 'ANOMALY'; -ANSI_REARCH: 'ANSI_REARCH'; -ANTIJOIN: 'ANTIJOIN'; -ANY: 'ANY'; -ANYSCHEMA: 'ANYSCHEMA'; -APPEND: 'APPEND'; -APPENDCHILDXML: 'APPENDCHILDXML'; -APPEND_VALUES: 'APPEND_VALUES'; -APPLICATION: 'APPLICATION'; -APPLY: 'APPLY'; -APPROX_COUNT_DISTINCT: 'APPROX_COUNT_DISTINCT'; -ARCHIVAL: 'ARCHIVAL'; -ARCHIVE: 'ARCHIVE'; -ARCHIVED: 'ARCHIVED'; -ARCHIVELOG: 'ARCHIVELOG'; -ARRAY: 'ARRAY'; -AS: 'AS'; -ASC: 'ASC'; -ASCII: 'ASCII'; -ASCIISTR: 'ASCIISTR'; -ASIN: 'ASIN'; -ASIS: 'ASIS'; -ASSEMBLY: 'ASSEMBLY'; -ASSIGN: 'ASSIGN'; -ASSOCIATE: 'ASSOCIATE'; -ASYNC: 'ASYNC'; -ASYNCHRONOUS: 'ASYNCHRONOUS'; -ATAN2: 'ATAN2'; -ATAN: 'ATAN'; -AT: 'AT'; -ATTRIBUTE: 'ATTRIBUTE'; -ATTRIBUTES: 'ATTRIBUTES'; -AUDIT: 'AUDIT'; -AUTHENTICATED: 'AUTHENTICATED'; -AUTHENTICATION: 'AUTHENTICATION'; -AUTHID: 'AUTHID'; -AUTHORIZATION: 'AUTHORIZATION'; -AUTOALLOCATE: 'AUTOALLOCATE'; -AUTO: 'AUTO'; -AUTOBACKUP: 'AUTOBACKUP'; -AUTOEXTEND: 'AUTOEXTEND'; -AUTO_LOGIN: 'AUTO_LOGIN'; -AUTOMATIC: 'AUTOMATIC'; -AUTONOMOUS_TRANSACTION: 'AUTONOMOUS_TRANSACTION'; -AUTO_REOPTIMIZE: 'AUTO_REOPTIMIZE'; -AVAILABILITY: 'AVAILABILITY'; -AVRO: 'AVRO'; -BACKGROUND: 'BACKGROUND'; -BACKINGFILE: 'BACKINGFILE'; -BACKUP: 'BACKUP'; -BACKUPS: 'BACKUPS'; -BACKUPSET: 'BACKUPSET'; -BASIC: 'BASIC'; -BASICFILE: 'BASICFILE'; -BATCH: 'BATCH'; -BATCHSIZE: 'BATCHSIZE'; -BATCH_TABLE_ACCESS_BY_ROWID: 'BATCH_TABLE_ACCESS_BY_ROWID'; -BECOME: 'BECOME'; -BEFORE: 'BEFORE'; -BEGIN: 'BEGIN'; -BEGINNING: 'BEGINNING'; -BEGIN_OUTLINE_DATA: 'BEGIN_OUTLINE_DATA'; -BEHALF: 'BEHALF'; -BEQUEATH: 'BEQUEATH'; -BETWEEN: 'BETWEEN'; -BFILE: 'BFILE'; -BFILENAME: 'BFILENAME'; -BIGFILE: 'BIGFILE'; -BINARY: 'BINARY'; -BINARY_DOUBLE: 'BINARY_DOUBLE'; -BINARY_DOUBLE_INFINITY: 'BINARY_DOUBLE_INFINITY'; -BINARY_DOUBLE_NAN: 'BINARY_DOUBLE_NAN'; -BINARY_FLOAT: 'BINARY_FLOAT'; -BINARY_FLOAT_INFINITY: 'BINARY_FLOAT_INFINITY'; -BINARY_FLOAT_NAN: 'BINARY_FLOAT_NAN'; -BINARY_INTEGER: 'BINARY_INTEGER'; -BIND_AWARE: 'BIND_AWARE'; -BINDING: 'BINDING'; -BIN_TO_NUM: 'BIN_TO_NUM'; -BITAND: 'BITAND'; -BITMAP_AND: 'BITMAP_AND'; -BITMAP: 'BITMAP'; -BITMAPS: 'BITMAPS'; -BITMAP_TREE: 'BITMAP_TREE'; -BITS: 'BITS'; -BLOB: 'BLOB'; -BLOCK: 'BLOCK'; -BLOCK_RANGE: 'BLOCK_RANGE'; -BLOCKS: 'BLOCKS'; -BLOCKSIZE: 'BLOCKSIZE'; -BODY: 'BODY'; -BOOLEAN: 'BOOLEAN'; -BOTH: 'BOTH'; -BOUND: 'BOUND'; -BRANCH: 'BRANCH'; -BREADTH: 'BREADTH'; -BROADCAST: 'BROADCAST'; -BSON: 'BSON'; -BUFFER: 'BUFFER'; -BUFFER_CACHE: 'BUFFER_CACHE'; -BUFFER_POOL: 'BUFFER_POOL'; -BUILD: 'BUILD'; -BULK: 'BULK'; -BY: 'BY'; -BYPASS_RECURSIVE_CHECK: 'BYPASS_RECURSIVE_CHECK'; -BYPASS_UJVC: 'BYPASS_UJVC'; -BYTE: 'BYTE'; -CACHE: 'CACHE'; -CACHE_CB: 'CACHE_CB'; -CACHE_INSTANCES: 'CACHE_INSTANCES'; -CACHE_TEMP_TABLE: 'CACHE_TEMP_TABLE'; -CACHING: 'CACHING'; -CALCULATED: 'CALCULATED'; -CALLBACK: 'CALLBACK'; -CALL: 'CALL'; -CANCEL: 'CANCEL'; -CANONICAL: 'CANONICAL'; -CAPACITY: 'CAPACITY'; -CAPTION: 'CAPTION'; -CARDINALITY: 'CARDINALITY'; -CASCADE: 'CASCADE'; -CASE: 'CASE'; -CAST: 'CAST'; -CASESENSITIVE: 'CASE-SENSITIVE'; -CATEGORY: 'CATEGORY'; -CDBDEFAULT: 'CDB$DEFAULT'; -CEIL: 'CEIL'; -CELL_FLASH_CACHE: 'CELL_FLASH_CACHE'; -CERTIFICATE: 'CERTIFICATE'; -CFILE: 'CFILE'; -CHAINED: 'CHAINED'; -CHANGE: 'CHANGE'; -CHANGETRACKING: 'CHANGETRACKING'; -CHANGE_DUPKEY_ERROR_INDEX: 'CHANGE_DUPKEY_ERROR_INDEX'; -CHARACTER: 'CHARACTER'; -CHAR: 'CHAR'; -CHAR_CS: 'CHAR_CS'; -CHARTOROWID: 'CHARTOROWID'; -CHECK_ACL_REWRITE: 'CHECK_ACL_REWRITE'; -CHECK: 'CHECK'; -CHECKPOINT: 'CHECKPOINT'; -CHILD: 'CHILD'; -CHOOSE: 'CHOOSE'; -CHR: 'CHR'; -CHUNK: 'CHUNK'; -CLASS: 'CLASS'; -CLASSIFICATION: 'CLASSIFICATION'; -CLASSIFIER: 'CLASSIFIER'; -CLAUSE: 'CLAUSE'; -CLEAN: 'CLEAN'; -CLEANUP: 'CLEANUP'; -CLEAR: 'CLEAR'; -C_LETTER: 'C'; -CLIENT: 'CLIENT'; -CLOB: 'CLOB'; -CLONE: 'CLONE'; -CLOSE_CACHED_OPEN_CURSORS: 'CLOSE_CACHED_OPEN_CURSORS'; -CLOSE: 'CLOSE'; -CLUSTER_BY_ROWID: 'CLUSTER_BY_ROWID'; -CLUSTER: 'CLUSTER'; -CLUSTER_DETAILS: 'CLUSTER_DETAILS'; -CLUSTER_DISTANCE: 'CLUSTER_DISTANCE'; -CLUSTER_ID: 'CLUSTER_ID'; -CLUSTERING: 'CLUSTERING'; -CLUSTERING_FACTOR: 'CLUSTERING_FACTOR'; -CLUSTER_PROBABILITY: 'CLUSTER_PROBABILITY'; -CLUSTER_SET: 'CLUSTER_SET'; -COALESCE: 'COALESCE'; -COALESCE_SQ: 'COALESCE_SQ'; -COARSE: 'COARSE'; -CO_AUTH_IND: 'CO_AUTH_IND'; -COLD: 'COLD'; -COLLECT: 'COLLECT'; -COLUMNAR: 'COLUMNAR'; -COLUMN_AUTH_INDICATOR: 'COLUMN_AUTH_INDICATOR'; -COLUMN: 'COLUMN'; -COLUMNS: 'COLUMNS'; -COLUMN_STATS: 'COLUMN_STATS'; -COLUMN_VALUE: 'COLUMN_VALUE'; -COMMENT: 'COMMENT'; -COMMIT: 'COMMIT'; -COMMITTED: 'COMMITTED'; -COMMON: 'COMMON'; -COMMON_DATA: 'COMMON_DATA'; -COMPACT: 'COMPACT'; -COMPATIBILITY: 'COMPATIBILITY'; -COMPILE: 'COMPILE'; -COMPLETE: 'COMPLETE'; -COMPLIANCE: 'COMPLIANCE'; -COMPONENT: 'COMPONENT'; -COMPONENTS: 'COMPONENTS'; -COMPOSE: 'COMPOSE'; -COMPOSITE: 'COMPOSITE'; -COMPOSITE_LIMIT: 'COMPOSITE_LIMIT'; -COMPOUND: 'COMPOUND'; -COMPRESS: 'COMPRESS'; -COMPUTE: 'COMPUTE'; -CONCAT: 'CONCAT'; -CON_DBID_TO_ID: 'CON_DBID_TO_ID'; -CONDITIONAL: 'CONDITIONAL'; -CONDITION: 'CONDITION'; -CONFIRM: 'CONFIRM'; -CONFORMING: 'CONFORMING'; -CON_GUID_TO_ID: 'CON_GUID_TO_ID'; -CON_ID: 'CON_ID'; -CON_NAME_TO_ID: 'CON_NAME_TO_ID'; -CONNECT_BY_CB_WHR_ONLY: 'CONNECT_BY_CB_WHR_ONLY'; -CONNECT_BY_COMBINE_SW: 'CONNECT_BY_COMBINE_SW'; -CONNECT_BY_COST_BASED: 'CONNECT_BY_COST_BASED'; -CONNECT_BY_ELIM_DUPS: 'CONNECT_BY_ELIM_DUPS'; -CONNECT_BY_FILTERING: 'CONNECT_BY_FILTERING'; -CONNECT_BY_ISCYCLE: 'CONNECT_BY_ISCYCLE'; -CONNECT_BY_ISLEAF: 'CONNECT_BY_ISLEAF'; -CONNECT_BY_ROOT: 'CONNECT_BY_ROOT'; -CONNECT: 'CONNECT'; -CONNECT_TIME: 'CONNECT_TIME'; -CONSIDER: 'CONSIDER'; -CONSISTENT: 'CONSISTENT'; -CONSTANT: 'CONSTANT'; -CONST: 'CONST'; -CONSTRAINT: 'CONSTRAINT'; -CONSTRAINTS: 'CONSTRAINTS'; -CONSTRUCTOR: 'CONSTRUCTOR'; -CONTAINER: 'CONTAINER'; -CONTAINERS: 'CONTAINERS'; -CONTAINERS_DEFAULT: 'CONTAINERS_DEFAULT'; -CONTAINER_DATA: 'CONTAINER_DATA'; -CONTAINER_MAP: 'CONTAINER_MAP'; -CONTENT: 'CONTENT'; -CONTENTS: 'CONTENTS'; -CONTEXT: 'CONTEXT'; -CONTINUE: 'CONTINUE'; -CONTROLFILE: 'CONTROLFILE'; -CON_UID_TO_ID: 'CON_UID_TO_ID'; -CONVERT: 'CONVERT'; -CONVERSION: 'CONVERSION'; -COOKIE: 'COOKIE'; -COPY: 'COPY'; -CORR_K: 'CORR_K'; -CORR_S: 'CORR_S'; -CORRUPTION: 'CORRUPTION'; -CORRUPT_XID_ALL: 'CORRUPT_XID_ALL'; -CORRUPT_XID: 'CORRUPT_XID'; -COS: 'COS'; -COSH: 'COSH'; -COST: 'COST'; -COST_XML_QUERY_REWRITE: 'COST_XML_QUERY_REWRITE'; -COUNT: 'COUNT'; -COVAR_POP: 'COVAR_POP'; -COVAR_SAMP: 'COVAR_SAMP'; -CPU_COSTING: 'CPU_COSTING'; -CPU_PER_CALL: 'CPU_PER_CALL'; -CPU_PER_SESSION: 'CPU_PER_SESSION'; -CRASH: 'CRASH'; -CREATE: 'CREATE'; -CREATE_FILE_DEST: 'CREATE_FILE_DEST'; -CREATE_STORED_OUTLINES: 'CREATE_STORED_OUTLINES'; -CREATION: 'CREATION'; -CREDENTIAL: 'CREDENTIAL'; -CRITICAL: 'CRITICAL'; -CROSS: 'CROSS'; -CROSSEDITION: 'CROSSEDITION'; -CSCONVERT: 'CSCONVERT'; -CUBE_AJ: 'CUBE_AJ'; -CUBE: 'CUBE'; -CUBE_GB: 'CUBE_GB'; -CUBE_SJ: 'CUBE_SJ'; -CUME_DISTM: 'CUME_DISTM'; -CURRENT: 'CURRENT'; -CURRENT_DATE: 'CURRENT_DATE'; -CURRENT_SCHEMA: 'CURRENT_SCHEMA'; -CURRENT_TIME: 'CURRENT_TIME'; -CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; -CURRENT_USER: 'CURRENT_USER'; -CURRENTV: 'CURRENTV'; -CURSOR: 'CURSOR'; -CURSOR_SHARING_EXACT: 'CURSOR_SHARING_EXACT'; -CURSOR_SPECIFIC_SEGMENT: 'CURSOR_SPECIFIC_SEGMENT'; -CUSTOMDATUM: 'CUSTOMDATUM'; -CV: 'CV'; -CYCLE: 'CYCLE'; -DANGLING: 'DANGLING'; -DATABASE: 'DATABASE'; -DATA: 'DATA'; -DATAFILE: 'DATAFILE'; -DATAFILES: 'DATAFILES'; -DATAGUARDCONFIG: 'DATAGUARDCONFIG'; -DATAMOVEMENT: 'DATAMOVEMENT'; -DATAOBJNO: 'DATAOBJNO'; -DATAOBJ_TO_MAT_PARTITION: 'DATAOBJ_TO_MAT_PARTITION'; -DATAOBJ_TO_PARTITION: 'DATAOBJ_TO_PARTITION'; -DATAPUMP: 'DATAPUMP'; -DATA_SECURITY_REWRITE_LIMIT: 'DATA_SECURITY_REWRITE_LIMIT'; -DATE: 'DATE'; -DATE_MODE: 'DATE_MODE'; -DAY: 'DAY'; -DAYS: 'DAYS'; -DBA: 'DBA'; -DBA_RECYCLEBIN: 'DBA_RECYCLEBIN'; -DBMS_STATS: 'DBMS_STATS'; -DB_ROLE_CHANGE: 'DB_ROLE_CHANGE'; -DBTIMEZONE: 'DBTIMEZONE'; -DB_UNIQUE_NAME: 'DB_UNIQUE_NAME'; -DB_VERSION: 'DB_VERSION'; -DDL: 'DDL'; -DEALLOCATE: 'DEALLOCATE'; -DEBUG: 'DEBUG'; -DEBUGGER: 'DEBUGGER'; -DEC: 'DEC'; -DECIMAL: 'DECIMAL'; -DECLARE: 'DECLARE'; -DECOMPOSE: 'DECOMPOSE'; -DECORRELATE: 'DECORRELATE'; -DECR: 'DECR'; -DECREMENT: 'DECREMENT'; -DECRYPT: 'DECRYPT'; -DEDUPLICATE: 'DEDUPLICATE'; -DEFAULT: 'DEFAULT'; -DEFAULTS: 'DEFAULTS'; -DEFAULT_COLLATION: 'DEFAULT_COLLATION'; -DEFAULT_CREDENTIAL: 'DEFAULT_CREDENTIAL'; -DEFERRABLE: 'DEFERRABLE'; -DEFERRED: 'DEFERRED'; -DEFINED: 'DEFINED'; -DEFINE: 'DEFINE'; -DEFINER: 'DEFINER'; -DEGREE: 'DEGREE'; -DELAY: 'DELAY'; -DELEGATE: 'DELEGATE'; -DELETE_ALL: 'DELETE_ALL'; -DELETE: 'DELETE'; -DELETEXML: 'DELETEXML'; -DEMAND: 'DEMAND'; -DENSE_RANKM: 'DENSE_RANKM'; -DEPENDENT: 'DEPENDENT'; -DEPTH: 'DEPTH'; -DEQUEUE: 'DEQUEUE'; -DEREF: 'DEREF'; -DEREF_NO_REWRITE: 'DEREF_NO_REWRITE'; -DESC: 'DESC'; -DESCRIPTION: 'DESCRIPTION'; -DESTROY: 'DESTROY'; -DETACHED: 'DETACHED'; -DETERMINES: 'DETERMINES'; -DETERMINISTIC: 'DETERMINISTIC'; -DICTIONARY: 'DICTIONARY'; -DIMENSION: 'DIMENSION'; -DIMENSIONS: 'DIMENSIONS'; -DIRECT_LOAD: 'DIRECT_LOAD'; -DIRECTORY: 'DIRECTORY'; -DIRECT_PATH: 'DIRECT_PATH'; -DISABLE_ALL: 'DISABLE_ALL'; -DISABLE: 'DISABLE'; -DISABLE_PARALLEL_DML: 'DISABLE_PARALLEL_DML'; -DISABLE_PRESET: 'DISABLE_PRESET'; -DISABLE_RPKE: 'DISABLE_RPKE'; -DISALLOW: 'DISALLOW'; -DISASSOCIATE: 'DISASSOCIATE'; -DISCARD: 'DISCARD'; -DISCONNECT: 'DISCONNECT'; -DISK: 'DISK'; -DISKGROUP: 'DISKGROUP'; -DISKGROUP_PLUS: '\'+ DISKGROUP'; -DISKS: 'DISKS'; -DISMOUNT: 'DISMOUNT'; -DISTINCT: 'DISTINCT'; -DISTINGUISHED: 'DISTINGUISHED'; -DISTRIBUTED: 'DISTRIBUTED'; -DISTRIBUTE: 'DISTRIBUTE'; -DML: 'DML'; -DML_UPDATE: 'DML_UPDATE'; -DOCFIDELITY: 'DOCFIDELITY'; -DOCUMENT: 'DOCUMENT'; -DOMAIN_INDEX_FILTER: 'DOMAIN_INDEX_FILTER'; -DOMAIN_INDEX_NO_SORT: 'DOMAIN_INDEX_NO_SORT'; -DOMAIN_INDEX_SORT: 'DOMAIN_INDEX_SORT'; -DOUBLE: 'DOUBLE'; -DOWNGRADE: 'DOWNGRADE'; -DRIVING_SITE: 'DRIVING_SITE'; -DROP_COLUMN: 'DROP_COLUMN'; -DROP: 'DROP'; -DROP_GROUP: 'DROP_GROUP'; -DSINTERVAL_UNCONSTRAINED: 'DSINTERVAL_UNCONSTRAINED'; -DST_UPGRADE_INSERT_CONV: 'DST_UPGRADE_INSERT_CONV'; -DUMP: 'DUMP'; -DUMPSET: 'DUMPSET'; -DUPLICATE: 'DUPLICATE'; -DV: 'DV'; -DYNAMIC: 'DYNAMIC'; -DYNAMIC_SAMPLING: 'DYNAMIC_SAMPLING'; -DYNAMIC_SAMPLING_EST_CDN: 'DYNAMIC_SAMPLING_EST_CDN'; -E_LETTER: 'E'; -EACH: 'EACH'; -EDITIONABLE: 'EDITIONABLE'; -EDITION: 'EDITION'; -EDITIONING: 'EDITIONING'; -EDITIONS: 'EDITIONS'; -ELEMENT: 'ELEMENT'; -ELIM_GROUPBY: 'ELIM_GROUPBY'; -ELIMINATE_JOIN: 'ELIMINATE_JOIN'; -ELIMINATE_OBY: 'ELIMINATE_OBY'; -ELIMINATE_OUTER_JOIN: 'ELIMINATE_OUTER_JOIN'; -ELSE: 'ELSE'; -ELSIF: 'ELSIF'; -EM: 'EM'; -EMPTY_BLOB: 'EMPTY_BLOB'; -EMPTY_CLOB: 'EMPTY_CLOB'; -EMPTY: 'EMPTY'; -ENABLE_ALL: 'ENABLE_ALL'; -ENABLE: 'ENABLE'; -ENABLE_PARALLEL_DML: 'ENABLE_PARALLEL_DML'; -ENABLE_PRESET: 'ENABLE_PRESET'; -ENCODING: 'ENCODING'; -ENCRYPT: 'ENCRYPT'; -ENCRYPTION: 'ENCRYPTION'; -END: 'END'; -END_OUTLINE_DATA: 'END_OUTLINE_DATA'; -ENFORCED: 'ENFORCED'; -ENFORCE: 'ENFORCE'; -ENQUEUE: 'ENQUEUE'; -ENTERPRISE: 'ENTERPRISE'; -ENTITYESCAPING: 'ENTITYESCAPING'; -ENTRY: 'ENTRY'; -EQUIPART: 'EQUIPART'; -ERR: 'ERR'; -ERROR_ARGUMENT: 'ERROR_ARGUMENT'; -ERROR: 'ERROR'; -ERROR_ON_OVERLAP_TIME: 'ERROR_ON_OVERLAP_TIME'; -ERRORS: 'ERRORS'; -ESCAPE: 'ESCAPE'; -ESTIMATE: 'ESTIMATE'; -EVAL: 'EVAL'; -EVALNAME: 'EVALNAME'; -EVALUATE: 'EVALUATE'; -EVALUATION: 'EVALUATION'; -EVENTS: 'EVENTS'; -EVERY: 'EVERY'; -EXCEPT: 'EXCEPT'; -EXCEPTION: 'EXCEPTION'; -EXCEPTION_INIT: 'EXCEPTION_INIT'; -EXCEPTIONS: 'EXCEPTIONS'; -EXCHANGE: 'EXCHANGE'; -EXCLUDE: 'EXCLUDE'; -EXCLUDING: 'EXCLUDING'; -EXCLUSIVE: 'EXCLUSIVE'; -EXECUTE: 'EXECUTE'; -EXEMPT: 'EXEMPT'; -EXISTING: 'EXISTING'; -EXISTS: 'EXISTS'; -EXISTSNODE: 'EXISTSNODE'; -EXIT: 'EXIT'; -EXPAND_GSET_TO_UNION: 'EXPAND_GSET_TO_UNION'; -EXPAND_TABLE: 'EXPAND_TABLE'; -EXP: 'EXP'; -EXPIRE: 'EXPIRE'; -EXPLAIN: 'EXPLAIN'; -EXPLOSION: 'EXPLOSION'; -EXPORT: 'EXPORT'; -EXPR_CORR_CHECK: 'EXPR_CORR_CHECK'; -EXPRESS: 'EXPRESS'; -EXTENDS: 'EXTENDS'; -EXTENT: 'EXTENT'; -EXTENTS: 'EXTENTS'; -EXTERNAL: 'EXTERNAL'; -EXTERNALLY: 'EXTERNALLY'; -EXTRACTCLOBXML: 'EXTRACTCLOBXML'; -EXTRACT: 'EXTRACT'; -EXTRACTVALUE: 'EXTRACTVALUE'; -EXTRA: 'EXTRA'; -FACILITY: 'FACILITY'; -FACT: 'FACT'; -FACTOR: 'FACTOR'; -FACTORIZE_JOIN: 'FACTORIZE_JOIN'; -FAILED: 'FAILED'; -FAILED_LOGIN_ATTEMPTS: 'FAILED_LOGIN_ATTEMPTS'; -FAILGROUP: 'FAILGROUP'; -FAILOVER: 'FAILOVER'; -FAILURE: 'FAILURE'; -FALSE: 'FALSE'; -FAMILY: 'FAMILY'; -FAR: 'FAR'; -FAST: 'FAST'; -FASTSTART: 'FASTSTART'; -FBTSCAN: 'FBTSCAN'; -FEATURE: 'FEATURE'; -FEATURE_DETAILS: 'FEATURE_DETAILS'; -FEATURE_ID: 'FEATURE_ID'; -FEATURE_SET: 'FEATURE_SET'; -FEATURE_VALUE: 'FEATURE_VALUE'; -FETCH: 'FETCH'; -FILE: 'FILE'; -FILE_NAME_CONVERT: 'FILE_NAME_CONVERT'; -FILEGROUP: 'FILEGROUP'; -FILESTORE: 'FILESTORE'; -FILESYSTEM_LIKE_LOGGING: 'FILESYSTEM_LIKE_LOGGING'; -FILTER: 'FILTER'; -FINAL: 'FINAL'; -FINE: 'FINE'; -FINISH: 'FINISH'; -FIRST: 'FIRST'; -FIRSTM: 'FIRSTM'; -FIRST_ROWS: 'FIRST_ROWS'; -FIRST_VALUE: 'FIRST_VALUE'; -FIXED_VIEW_DATA: 'FIXED_VIEW_DATA'; -FLAGGER: 'FLAGGER'; -FLASHBACK: 'FLASHBACK'; -FLASH_CACHE: 'FLASH_CACHE'; -FLOAT: 'FLOAT'; -FLOB: 'FLOB'; -FLEX: 'FLEX'; -FLOOR: 'FLOOR'; -FLUSH: 'FLUSH'; -FOLDER: 'FOLDER'; -FOLLOWING: 'FOLLOWING'; -FOLLOWS: 'FOLLOWS'; -FORALL: 'FORALL'; -FORCE: 'FORCE'; -FORCE_XML_QUERY_REWRITE: 'FORCE_XML_QUERY_REWRITE'; -FOREIGN: 'FOREIGN'; -FOREVER: 'FOREVER'; -FOR: 'FOR'; -FORMAT: 'FORMAT'; -FORWARD: 'FORWARD'; -FRAGMENT_NUMBER: 'FRAGMENT_NUMBER'; -FREELIST: 'FREELIST'; -FREELISTS: 'FREELISTS'; -FREEPOOLS: 'FREEPOOLS'; -FRESH: 'FRESH'; -FROM: 'FROM'; -FROM_TZ: 'FROM_TZ'; -FULL: 'FULL'; -FULL_OUTER_JOIN_TO_OUTER: 'FULL_OUTER_JOIN_TO_OUTER'; -FUNCTION: 'FUNCTION'; -FUNCTIONS: 'FUNCTIONS'; -FTP: 'FTP'; -G_LETTER: 'G'; -GATHER_OPTIMIZER_STATISTICS: 'GATHER_OPTIMIZER_STATISTICS'; -GATHER_PLAN_STATISTICS: 'GATHER_PLAN_STATISTICS'; -GBY_CONC_ROLLUP: 'GBY_CONC_ROLLUP'; -GBY_PUSHDOWN: 'GBY_PUSHDOWN'; -GENERATED: 'GENERATED'; -GET: 'GET'; -GLOBAL: 'GLOBAL'; -GLOBALLY: 'GLOBALLY'; -GLOBAL_NAME: 'GLOBAL_NAME'; -GLOBAL_TOPIC_ENABLED: 'GLOBAL_TOPIC_ENABLED'; -GOTO: 'GOTO'; -GRANT: 'GRANT'; -GROUP_BY: 'GROUP_BY'; -GROUP: 'GROUP'; -GROUP_ID: 'GROUP_ID'; -GROUPING: 'GROUPING'; -GROUPING_ID: 'GROUPING_ID'; -GROUPS: 'GROUPS'; -GUARANTEED: 'GUARANTEED'; -GUARANTEE: 'GUARANTEE'; -GUARD: 'GUARD'; -HALF_YEARS: 'HALF_YEARS'; -HASH_AJ: 'HASH_AJ'; -HASH: 'HASH'; -HASHKEYS: 'HASHKEYS'; -HASH_SJ: 'HASH_SJ'; -HAVING: 'HAVING'; -HEADER: 'HEADER'; -HEAP: 'HEAP'; -HELP: 'HELP'; -HEXTORAW: 'HEXTORAW'; -HEXTOREF: 'HEXTOREF'; -HIDDEN_KEYWORD: 'HIDDEN'; -HIDE: 'HIDE'; -HIER_ORDER: 'HIER_ORDER'; -HIERARCHICAL: 'HIERARCHICAL'; -HIERARCHIES: 'HIERARCHIES'; -HIERARCHY: 'HIERARCHY'; -HIGH: 'HIGH'; -HINTSET_BEGIN: 'HINTSET_BEGIN'; -HINTSET_END: 'HINTSET_END'; -HOT: 'HOT'; -HOUR: 'HOUR'; -HOURS: 'HOURS'; -HTTP: 'HTTP'; -HWM_BROKERED: 'HWM_BROKERED'; -HYBRID: 'HYBRID'; -H_LETTER: 'H'; -IDENTIFIED: 'IDENTIFIED'; -IDENTIFIER: 'IDENTIFIER'; -IDENTITY: 'IDENTITY'; -IDGENERATORS: 'IDGENERATORS'; -ID: 'ID'; -IDLE_TIME: 'IDLE_TIME'; -IF: 'IF'; -IGNORE: 'IGNORE'; -IGNORE_OPTIM_EMBEDDED_HINTS: 'IGNORE_OPTIM_EMBEDDED_HINTS'; -IGNORE_ROW_ON_DUPKEY_INDEX: 'IGNORE_ROW_ON_DUPKEY_INDEX'; -IGNORE_WHERE_CLAUSE: 'IGNORE_WHERE_CLAUSE'; -ILM: 'ILM'; -IMMEDIATE: 'IMMEDIATE'; -IMPACT: 'IMPACT'; -IMPORT: 'IMPORT'; -INACTIVE: 'INACTIVE'; -INACTIVE_ACCOUNT_TIME: 'INACTIVE_ACCOUNT_TIME'; -INCLUDE: 'INCLUDE'; -INCLUDE_VERSION: 'INCLUDE_VERSION'; -INCLUDING: 'INCLUDING'; -INCREMENTAL: 'INCREMENTAL'; -INCREMENT: 'INCREMENT'; -INCR: 'INCR'; -INDENT: 'INDENT'; -INDEX_ASC: 'INDEX_ASC'; -INDEX_COMBINE: 'INDEX_COMBINE'; -INDEX_DESC: 'INDEX_DESC'; -INDEXED: 'INDEXED'; -INDEXES: 'INDEXES'; -INDEX_FFS: 'INDEX_FFS'; -INDEX_FILTER: 'INDEX_FILTER'; -INDEX: 'INDEX'; -INDEXING: 'INDEXING'; -INDEX_JOIN: 'INDEX_JOIN'; -INDEX_ROWS: 'INDEX_ROWS'; -INDEX_RRS: 'INDEX_RRS'; -INDEX_RS_ASC: 'INDEX_RS_ASC'; -INDEX_RS_DESC: 'INDEX_RS_DESC'; -INDEX_RS: 'INDEX_RS'; -INDEX_SCAN: 'INDEX_SCAN'; -INDEX_SKIP_SCAN: 'INDEX_SKIP_SCAN'; -INDEX_SS_ASC: 'INDEX_SS_ASC'; -INDEX_SS_DESC: 'INDEX_SS_DESC'; -INDEX_SS: 'INDEX_SS'; -INDEX_STATS: 'INDEX_STATS'; -INDEXTYPE: 'INDEXTYPE'; -INDEXTYPES: 'INDEXTYPES'; -INDICATOR: 'INDICATOR'; -INDICES: 'INDICES'; -INFINITE: 'INFINITE'; -INFORMATIONAL: 'INFORMATIONAL'; -INHERIT: 'INHERIT'; -IN: 'IN'; -INITCAP: 'INITCAP'; -INITIAL: 'INITIAL'; -INITIALIZED: 'INITIALIZED'; -INITIALLY: 'INITIALLY'; -INITRANS: 'INITRANS'; -INLINE: 'INLINE'; -INLINE_XMLTYPE_NT: 'INLINE_XMLTYPE_NT'; -INMEMORY: 'INMEMORY'; -IN_MEMORY_METADATA: 'IN_MEMORY_METADATA'; -INMEMORY_PRUNING: 'INMEMORY_PRUNING'; -INNER: 'INNER'; -INOUT: 'INOUT'; -INPLACE: 'INPLACE'; -INSERTCHILDXMLAFTER: 'INSERTCHILDXMLAFTER'; -INSERTCHILDXMLBEFORE: 'INSERTCHILDXMLBEFORE'; -INSERTCHILDXML: 'INSERTCHILDXML'; -INSERT: 'INSERT'; -INSERTXMLAFTER: 'INSERTXMLAFTER'; -INSERTXMLBEFORE: 'INSERTXMLBEFORE'; -INSTANCE: 'INSTANCE'; -INSTANCES: 'INSTANCES'; -INSTANTIABLE: 'INSTANTIABLE'; -INSTANTLY: 'INSTANTLY'; -INSTEAD: 'INSTEAD'; -INSTR2: 'INSTR2'; -INSTR4: 'INSTR4'; -INSTRB: 'INSTRB'; -INSTRC: 'INSTRC'; -INSTR: 'INSTR'; -INTEGER: 'INTEGER'; -INTERLEAVED: 'INTERLEAVED'; -INTERMEDIATE: 'INTERMEDIATE'; -INTERNAL_CONVERT: 'INTERNAL_CONVERT'; -INTERNAL_USE: 'INTERNAL_USE'; -INTERPRETED: 'INTERPRETED'; -INTERSECT: 'INTERSECT'; -INTERVAL: 'INTERVAL'; -INT: 'INT'; -INTO: 'INTO'; -INVALIDATE: 'INVALIDATE'; -INVISIBLE: 'INVISIBLE'; -IN_XQUERY: 'IN_XQUERY'; -IS: 'IS'; -IS_LEAF: 'IS_LEAF'; -ISOLATION: 'ISOLATION'; -ISOLATION_LEVEL: 'ISOLATION_LEVEL'; -ITERATE: 'ITERATE'; -ITERATION_NUMBER: 'ITERATION_NUMBER'; -JAVA: 'JAVA'; -JOB: 'JOB'; -JOIN: 'JOIN'; -JSON_ARRAYAGG: 'JSON_ARRAYAGG'; -JSON_ARRAY: 'JSON_ARRAY'; -JSON_EQUAL: 'JSON_EQUAL'; -JSON_EXISTS2: 'JSON_EXISTS2'; -JSON_EXISTS: 'JSON_EXISTS'; -JSONGET: 'JSONGET'; -JSON: 'JSON'; -JSON_OBJECTAGG: 'JSON_OBJECTAGG'; -JSON_OBJECT: 'JSON_OBJECT'; -JSONPARSE: 'JSONPARSE'; -JSON_QUERY: 'JSON_QUERY'; -JSON_SERIALIZE: 'JSON_SERIALIZE'; -JSON_TABLE: 'JSON_TABLE'; -JSON_TEXTCONTAINS2: 'JSON_TEXTCONTAINS2'; -JSON_TEXTCONTAINS: 'JSON_TEXTCONTAINS'; -JSON_TRANSFORM: 'JSON_TRANSFORM'; -JSON_VALUE: 'JSON_VALUE'; -K_LETTER: 'K'; -KEEP_DUPLICATES: 'KEEP_DUPLICATES'; -KEEP: 'KEEP'; -KERBEROS: 'KERBEROS'; -KEY: 'KEY'; -KEY_LENGTH: 'KEY_LENGTH'; -KEYSIZE: 'KEYSIZE'; -KEYS: 'KEYS'; -KEYSTORE: 'KEYSTORE'; -KILL: 'KILL'; -LABEL: 'LABEL'; -LANGUAGE: 'LANGUAGE'; -LAST_DAY: 'LAST_DAY'; -LAST: 'LAST'; -LAST_VALUE: 'LAST_VALUE'; -LATERAL: 'LATERAL'; -LAX: 'LAX'; -LAYER: 'LAYER'; -LDAP_REGISTRATION_ENABLED: 'LDAP_REGISTRATION_ENABLED'; -LDAP_REGISTRATION: 'LDAP_REGISTRATION'; -LDAP_REG_SYNC_INTERVAL: 'LDAP_REG_SYNC_INTERVAL'; -LEAF: 'LEAF'; -LEAD_CDB: 'LEAD_CDB'; -LEAD_CDB_URI: 'LEAD_CDB_URI'; -LEADING: 'LEADING'; -LEFT: 'LEFT'; -LENGTH2: 'LENGTH2'; -LENGTH4: 'LENGTH4'; -LENGTHB: 'LENGTHB'; -LENGTHC: 'LENGTHC'; -LENGTH: 'LENGTH'; -LESS: 'LESS'; -LEVEL: 'LEVEL'; -LEVEL_NAME: 'LEVEL_NAME'; -LEVELS: 'LEVELS'; -LIBRARY: 'LIBRARY'; -LIFECYCLE: 'LIFECYCLE'; -LIFE: 'LIFE'; -LIFETIME: 'LIFETIME'; -LIKE2: 'LIKE2'; -LIKE4: 'LIKE4'; -LIKEC: 'LIKEC'; -LIKE_EXPAND: 'LIKE_EXPAND'; -LIKE: 'LIKE'; -LIMIT: 'LIMIT'; -LINEAR: 'LINEAR'; -LINK: 'LINK'; -LIST: 'LIST'; -LN: 'LN'; -LNNVL: 'LNNVL'; -LOAD: 'LOAD'; -LOB: 'LOB'; -LOBNVL: 'LOBNVL'; -LOBS: 'LOBS'; -LOCAL_INDEXES: 'LOCAL_INDEXES'; -LOCAL: 'LOCAL'; -LOCALTIME: 'LOCALTIME'; -LOCALTIMESTAMP: 'LOCALTIMESTAMP'; -LOCATION: 'LOCATION'; -LOCATOR: 'LOCATOR'; -LOCKDOWN: 'LOCKDOWN'; -LOCKED: 'LOCKED'; -LOCKING: 'LOCKING'; -LOCK: 'LOCK'; -LOGFILE: 'LOGFILE'; -LOGFILES: 'LOGFILES'; -LOGGING: 'LOGGING'; -LOGICAL: 'LOGICAL'; -LOGICAL_READS_PER_CALL: 'LOGICAL_READS_PER_CALL'; -LOGICAL_READS_PER_SESSION: 'LOGICAL_READS_PER_SESSION'; -LOG: 'LOG'; -LOGMINING: 'LOGMINING'; -LOGOFF: 'LOGOFF'; -LOGON: 'LOGON'; -LOG_READ_ONLY_VIOLATIONS: 'LOG_READ_ONLY_VIOLATIONS'; -LONG: 'LONG'; -LOOP: 'LOOP'; -LOST: 'LOST'; -LOWER: 'LOWER'; -LOW: 'LOW'; -LPAD: 'LPAD'; -LTRIM: 'LTRIM'; -M_LETTER: 'M'; -MAIN: 'MAIN'; -MAKE_REF: 'MAKE_REF'; -MANAGED: 'MANAGED'; -MANAGE: 'MANAGE'; -MANAGEMENT: 'MANAGEMENT'; -MANAGER: 'MANAGER'; -MANDATORY: 'MANDATORY'; -MANUAL: 'MANUAL'; -MAP: 'MAP'; -MAPPING: 'MAPPING'; -MASTER: 'MASTER'; -MATCHED: 'MATCHED'; -MATCHES: 'MATCHES'; -MATCH: 'MATCH'; -MATCH_NUMBER: 'MATCH_NUMBER'; -MATCH_RECOGNIZE: 'MATCH_RECOGNIZE'; -MATERIALIZED: 'MATERIALIZED'; -MATERIALIZE: 'MATERIALIZE'; -MAXARCHLOGS: 'MAXARCHLOGS'; -MAXDATAFILES: 'MAXDATAFILES'; -MAXEXTENTS: 'MAXEXTENTS'; -MAXIMIZE: 'MAXIMIZE'; -MAXINSTANCES: 'MAXINSTANCES'; -MAXLOGFILES: 'MAXLOGFILES'; -MAXLOGHISTORY: 'MAXLOGHISTORY'; -MAXLOGMEMBERS: 'MAXLOGMEMBERS'; -MAX_SHARED_TEMP_SIZE: 'MAX_SHARED_TEMP_SIZE'; -MAXSIZE: 'MAXSIZE'; -MAXTRANS: 'MAXTRANS'; -MAXVALUE: 'MAXVALUE'; -MEASURE: 'MEASURE'; -MEASURES: 'MEASURES'; -MEDIUM: 'MEDIUM'; -MEMBER: 'MEMBER'; -MEMBER_CAPTION: 'MEMBER_CAPTION'; -MEMBER_DESCRIPTION: 'MEMBER_DESCRIPTION'; -MEMBER_NAME: 'MEMBER_NAME'; -MEMBER_UNIQUE_NAME: 'MEMBER_UNIQUE_NAME'; -MEMCOMPRESS: 'MEMCOMPRESS'; -MEMORY: 'MEMORY'; -MERGEACTIONS: 'MERGE$ACTIONS'; -MERGE_AJ: 'MERGE_AJ'; -MERGE_CONST_ON: 'MERGE_CONST_ON'; -MERGE: 'MERGE'; -MERGE_SJ: 'MERGE_SJ'; -METADATA: 'METADATA'; -METHOD: 'METHOD'; -MIGRATE: 'MIGRATE'; -MIGRATION: 'MIGRATION'; -MINEXTENTS: 'MINEXTENTS'; -MINIMIZE: 'MINIMIZE'; -MINIMUM: 'MINIMUM'; -MINING: 'MINING'; -MINUS: 'MINUS'; -MINUS_NULL: 'MINUS_NULL'; -MINUTE: 'MINUTE'; -MINUTES: 'MINUTES'; -MINVALUE: 'MINVALUE'; -MIRRORCOLD: 'MIRRORCOLD'; -MIRRORHOT: 'MIRRORHOT'; -MIRROR: 'MIRROR'; -MISSING: 'MISSING'; -MISMATCH: 'MISMATCH'; -MLSLABEL: 'MLSLABEL'; -MODEL_COMPILE_SUBQUERY: 'MODEL_COMPILE_SUBQUERY'; -MODEL_DONTVERIFY_UNIQUENESS: 'MODEL_DONTVERIFY_UNIQUENESS'; -MODEL_DYNAMIC_SUBQUERY: 'MODEL_DYNAMIC_SUBQUERY'; -MODEL_MIN_ANALYSIS: 'MODEL_MIN_ANALYSIS'; -MODEL: 'MODEL'; -MODEL_NB: 'MODEL_NB'; -MODEL_NO_ANALYSIS: 'MODEL_NO_ANALYSIS'; -MODEL_PBY: 'MODEL_PBY'; -MODEL_PUSH_REF: 'MODEL_PUSH_REF'; -MODEL_SV: 'MODEL_SV'; -MODE: 'MODE'; -MODIFICATION: 'MODIFICATION'; -MODIFY_COLUMN_TYPE: 'MODIFY_COLUMN_TYPE'; -MODIFY: 'MODIFY'; -MOD: 'MOD'; -MODULE: 'MODULE'; -MONITORING: 'MONITORING'; -MONITOR: 'MONITOR'; -MONTH: 'MONTH'; -MONTHS_BETWEEN: 'MONTHS_BETWEEN'; -MONTHS: 'MONTHS'; -MOUNT: 'MOUNT'; -MOUNTPATH: 'MOUNTPATH'; -MOUNTPOINT: 'MOUNTPOINT'; -MOVEMENT: 'MOVEMENT'; -MOVE: 'MOVE'; -MULTIDIMENSIONAL: 'MULTIDIMENSIONAL'; -MULTISET: 'MULTISET'; -MV_MERGE: 'MV_MERGE'; -NAMED: 'NAMED'; -NAME: 'NAME'; -NAMESPACE: 'NAMESPACE'; -NAN: 'NAN'; -NANVL: 'NANVL'; -NATIONAL: 'NATIONAL'; -NATIVE_FULL_OUTER_JOIN: 'NATIVE_FULL_OUTER_JOIN'; -NATIVE: 'NATIVE'; -NATURAL: 'NATURAL'; -NATURALN: 'NATURALN'; -NAV: 'NAV'; -NCHAR_CS: 'NCHAR_CS'; -NCHAR: 'NCHAR'; -NCHR: 'NCHR'; -NCLOB: 'NCLOB'; -NEEDED: 'NEEDED'; -NEG: 'NEG'; -NESTED: 'NESTED'; -NESTED_TABLE_FAST_INSERT: 'NESTED_TABLE_FAST_INSERT'; -NESTED_TABLE_GET_REFS: 'NESTED_TABLE_GET_REFS'; -NESTED_TABLE_ID: 'NESTED_TABLE_ID'; -NESTED_TABLE_SET_REFS: 'NESTED_TABLE_SET_REFS'; -NESTED_TABLE_SET_SETID: 'NESTED_TABLE_SET_SETID'; -NETWORK: 'NETWORK'; -NEVER: 'NEVER'; -NEW: 'NEW'; -NEW_TIME: 'NEW_TIME'; -NEXT_DAY: 'NEXT_DAY'; -NEXT: 'NEXT'; -NL_AJ: 'NL_AJ'; -NLJ_BATCHING: 'NLJ_BATCHING'; -NLJ_INDEX_FILTER: 'NLJ_INDEX_FILTER'; -NLJ_INDEX_SCAN: 'NLJ_INDEX_SCAN'; -NLJ_PREFETCH: 'NLJ_PREFETCH'; -NLS_CALENDAR: 'NLS_CALENDAR'; -NLS_CHARACTERSET: 'NLS_CHARACTERSET'; -NLS_CHARSET_DECL_LEN: 'NLS_CHARSET_DECL_LEN'; -NLS_CHARSET_ID: 'NLS_CHARSET_ID'; -NLS_CHARSET_NAME: 'NLS_CHARSET_NAME'; -NLS_COMP: 'NLS_COMP'; -NLS_CURRENCY: 'NLS_CURRENCY'; -NLS_DATE_FORMAT: 'NLS_DATE_FORMAT'; -NLS_DATE_LANGUAGE: 'NLS_DATE_LANGUAGE'; -NLS_INITCAP: 'NLS_INITCAP'; -NLS_ISO_CURRENCY: 'NLS_ISO_CURRENCY'; -NL_SJ: 'NL_SJ'; -NLS_LANG: 'NLS_LANG'; -NLS_LANGUAGE: 'NLS_LANGUAGE'; -NLS_LENGTH_SEMANTICS: 'NLS_LENGTH_SEMANTICS'; -NLS_LOWER: 'NLS_LOWER'; -NLS_NCHAR_CONV_EXCP: 'NLS_NCHAR_CONV_EXCP'; -NLS_NUMERIC_CHARACTERS: 'NLS_NUMERIC_CHARACTERS'; -NLS_SORT: 'NLS_SORT'; -NLSSORT: 'NLSSORT'; -NLS_SPECIAL_CHARS: 'NLS_SPECIAL_CHARS'; -NLS_TERRITORY: 'NLS_TERRITORY'; -NLS_UPPER: 'NLS_UPPER'; -NO_ACCESS: 'NO_ACCESS'; -NO_ADAPTIVE_PLAN: 'NO_ADAPTIVE_PLAN'; -NO_ANSI_REARCH: 'NO_ANSI_REARCH'; -NOAPPEND: 'NOAPPEND'; -NOARCHIVELOG: 'NOARCHIVELOG'; -NOAUDIT: 'NOAUDIT'; -NO_AUTO_REOPTIMIZE: 'NO_AUTO_REOPTIMIZE'; -NO_BASETABLE_MULTIMV_REWRITE: 'NO_BASETABLE_MULTIMV_REWRITE'; -NO_BATCH_TABLE_ACCESS_BY_ROWID: 'NO_BATCH_TABLE_ACCESS_BY_ROWID'; -NO_BIND_AWARE: 'NO_BIND_AWARE'; -NO_BUFFER: 'NO_BUFFER'; -NOCACHE: 'NOCACHE'; -NO_CARTESIAN: 'NO_CARTESIAN'; -NO_CHECK_ACL_REWRITE: 'NO_CHECK_ACL_REWRITE'; -NO_CLUSTER_BY_ROWID: 'NO_CLUSTER_BY_ROWID'; -NO_CLUSTERING: 'NO_CLUSTERING'; -NO_COALESCE_SQ: 'NO_COALESCE_SQ'; -NO_COMMON_DATA: 'NO_COMMON_DATA'; -NOCOMPRESS: 'NOCOMPRESS'; -NO_CONNECT_BY_CB_WHR_ONLY: 'NO_CONNECT_BY_CB_WHR_ONLY'; -NO_CONNECT_BY_COMBINE_SW: 'NO_CONNECT_BY_COMBINE_SW'; -NO_CONNECT_BY_COST_BASED: 'NO_CONNECT_BY_COST_BASED'; -NO_CONNECT_BY_ELIM_DUPS: 'NO_CONNECT_BY_ELIM_DUPS'; -NO_CONNECT_BY_FILTERING: 'NO_CONNECT_BY_FILTERING'; -NOCOPY: 'NOCOPY'; -NO_COST_XML_QUERY_REWRITE: 'NO_COST_XML_QUERY_REWRITE'; -NO_CPU_COSTING: 'NO_CPU_COSTING'; -NOCPU_COSTING: 'NOCPU_COSTING'; -NOCYCLE: 'NOCYCLE'; -NO_DATA_SECURITY_REWRITE: 'NO_DATA_SECURITY_REWRITE'; -NO_DECORRELATE: 'NO_DECORRELATE'; -NODELAY: 'NODELAY'; -NO_DOMAIN_INDEX_FILTER: 'NO_DOMAIN_INDEX_FILTER'; -NO_DST_UPGRADE_INSERT_CONV: 'NO_DST_UPGRADE_INSERT_CONV'; -NO_ELIM_GROUPBY: 'NO_ELIM_GROUPBY'; -NO_ELIMINATE_JOIN: 'NO_ELIMINATE_JOIN'; -NO_ELIMINATE_OBY: 'NO_ELIMINATE_OBY'; -NO_ELIMINATE_OUTER_JOIN: 'NO_ELIMINATE_OUTER_JOIN'; -NOENTITYESCAPING: 'NOENTITYESCAPING'; -NO_EXPAND_GSET_TO_UNION: 'NO_EXPAND_GSET_TO_UNION'; -NO_EXPAND: 'NO_EXPAND'; -NO_EXPAND_TABLE: 'NO_EXPAND_TABLE'; -NO_FACT: 'NO_FACT'; -NO_FACTORIZE_JOIN: 'NO_FACTORIZE_JOIN'; -NO_FILTERING: 'NO_FILTERING'; -NOFORCE: 'NOFORCE'; -NO_FULL_OUTER_JOIN_TO_OUTER: 'NO_FULL_OUTER_JOIN_TO_OUTER'; -NO_GATHER_OPTIMIZER_STATISTICS: 'NO_GATHER_OPTIMIZER_STATISTICS'; -NO_GBY_PUSHDOWN: 'NO_GBY_PUSHDOWN'; -NOGUARANTEE: 'NOGUARANTEE'; -NO_INDEX_FFS: 'NO_INDEX_FFS'; -NO_INDEX: 'NO_INDEX'; -NO_INDEX_SS: 'NO_INDEX_SS'; -NO_INMEMORY: 'NO_INMEMORY'; -NO_INMEMORY_PRUNING: 'NO_INMEMORY_PRUNING'; -NOKEEP: 'NOKEEP'; -NO_LOAD: 'NO_LOAD'; -NOLOCAL: 'NOLOCAL'; -NOLOGGING: 'NOLOGGING'; -NOMAPPING: 'NOMAPPING'; -NOMAXVALUE: 'NOMAXVALUE'; -NO_MERGE: 'NO_MERGE'; -NOMINIMIZE: 'NOMINIMIZE'; -NOMINVALUE: 'NOMINVALUE'; -NO_MODEL_PUSH_REF: 'NO_MODEL_PUSH_REF'; -NO_MONITORING: 'NO_MONITORING'; -NOMONITORING: 'NOMONITORING'; -NO_MONITOR: 'NO_MONITOR'; -NO_MULTIMV_REWRITE: 'NO_MULTIMV_REWRITE'; -NO_NATIVE_FULL_OUTER_JOIN: 'NO_NATIVE_FULL_OUTER_JOIN'; -NONBLOCKING: 'NONBLOCKING'; -NONEDITIONABLE: 'NONEDITIONABLE'; -NONE: 'NONE'; -NO_NLJ_BATCHING: 'NO_NLJ_BATCHING'; -NO_NLJ_PREFETCH: 'NO_NLJ_PREFETCH'; -NO: 'NO'; -NONSCHEMA: 'NONSCHEMA'; -NO_OBJECT_LINK: 'NO_OBJECT_LINK'; -NOORDER: 'NOORDER'; -NO_ORDER_ROLLUPS: 'NO_ORDER_ROLLUPS'; -NO_OUTER_JOIN_TO_ANTI: 'NO_OUTER_JOIN_TO_ANTI'; -NO_OUTER_JOIN_TO_INNER: 'NO_OUTER_JOIN_TO_INNER'; -NOOVERRIDE: 'NOOVERRIDE'; -NO_PARALLEL_INDEX: 'NO_PARALLEL_INDEX'; -NOPARALLEL_INDEX: 'NOPARALLEL_INDEX'; -NO_PARALLEL: 'NO_PARALLEL'; -NOPARALLEL: 'NOPARALLEL'; -NO_PARTIAL_COMMIT: 'NO_PARTIAL_COMMIT'; -NO_PARTIAL_JOIN: 'NO_PARTIAL_JOIN'; -NO_PARTIAL_ROLLUP_PUSHDOWN: 'NO_PARTIAL_ROLLUP_PUSHDOWN'; -NOPARTITION: 'NOPARTITION'; -NO_PLACE_DISTINCT: 'NO_PLACE_DISTINCT'; -NO_PLACE_GROUP_BY: 'NO_PLACE_GROUP_BY'; -NO_PQ_CONCURRENT_UNION: 'NO_PQ_CONCURRENT_UNION'; -NO_PQ_MAP: 'NO_PQ_MAP'; -NOPROMPT: 'NOPROMPT'; -NO_PQ_REPLICATE: 'NO_PQ_REPLICATE'; -NO_PQ_SKEW: 'NO_PQ_SKEW'; -NO_PRUNE_GSETS: 'NO_PRUNE_GSETS'; -NO_PULL_PRED: 'NO_PULL_PRED'; -NO_PUSH_PRED: 'NO_PUSH_PRED'; -NO_PUSH_SUBQ: 'NO_PUSH_SUBQ'; -NO_PX_FAULT_TOLERANCE: 'NO_PX_FAULT_TOLERANCE'; -NO_PX_JOIN_FILTER: 'NO_PX_JOIN_FILTER'; -NO_QKN_BUFF: 'NO_QKN_BUFF'; -NO_QUERY_TRANSFORMATION: 'NO_QUERY_TRANSFORMATION'; -NO_REF_CASCADE: 'NO_REF_CASCADE'; -NORELOCATE: 'NORELOCATE'; -NORELY: 'NORELY'; -NOREPAIR: 'NOREPAIR'; -NOREPLAY: 'NOREPLAY'; -NORESETLOGS: 'NORESETLOGS'; -NO_RESULT_CACHE: 'NO_RESULT_CACHE'; -NOREVERSE: 'NOREVERSE'; -NO_REWRITE: 'NO_REWRITE'; -NOREWRITE: 'NOREWRITE'; -NORMAL: 'NORMAL'; -NO_ROOT_SW_FOR_LOCAL: 'NO_ROOT_SW_FOR_LOCAL'; -NOROWDEPENDENCIES: 'NOROWDEPENDENCIES'; -NOSCHEMACHECK: 'NOSCHEMACHECK'; -NOSEGMENT: 'NOSEGMENT'; -NO_SEMIJOIN: 'NO_SEMIJOIN'; -NO_SEMI_TO_INNER: 'NO_SEMI_TO_INNER'; -NO_SET_TO_JOIN: 'NO_SET_TO_JOIN'; -NOSORT: 'NOSORT'; -NO_SQL_TRANSLATION: 'NO_SQL_TRANSLATION'; -NO_SQL_TUNE: 'NO_SQL_TUNE'; -NO_STAR_TRANSFORMATION: 'NO_STAR_TRANSFORMATION'; -NO_STATEMENT_QUEUING: 'NO_STATEMENT_QUEUING'; -NO_STATS_GSETS: 'NO_STATS_GSETS'; -NOSTRICT: 'NOSTRICT'; -NO_SUBQUERY_PRUNING: 'NO_SUBQUERY_PRUNING'; -NO_SUBSTRB_PAD: 'NO_SUBSTRB_PAD'; -NO_SWAP_JOIN_INPUTS: 'NO_SWAP_JOIN_INPUTS'; -NOSWITCH: 'NOSWITCH'; -NO_TABLE_LOOKUP_BY_NL: 'NO_TABLE_LOOKUP_BY_NL'; -NO_TEMP_TABLE: 'NO_TEMP_TABLE'; -NOTHING: 'NOTHING'; -NOTIFICATION: 'NOTIFICATION'; -NOT: 'NOT'; -NO_TRANSFORM_DISTINCT_AGG: 'NO_TRANSFORM_DISTINCT_AGG'; -NO_UNNEST: 'NO_UNNEST'; -NO_USE_CUBE: 'NO_USE_CUBE'; -NO_USE_HASH_AGGREGATION: 'NO_USE_HASH_AGGREGATION'; -NO_USE_HASH_GBY_FOR_PUSHDOWN: 'NO_USE_HASH_GBY_FOR_PUSHDOWN'; -NO_USE_HASH: 'NO_USE_HASH'; -NO_USE_INVISIBLE_INDEXES: 'NO_USE_INVISIBLE_INDEXES'; -NO_USE_MERGE: 'NO_USE_MERGE'; -NO_USE_NL: 'NO_USE_NL'; -NO_USE_VECTOR_AGGREGATION: 'NO_USE_VECTOR_AGGREGATION'; -NOVALIDATE: 'NOVALIDATE'; -NO_VECTOR_TRANSFORM_DIMS: 'NO_VECTOR_TRANSFORM_DIMS'; -NO_VECTOR_TRANSFORM_FACT: 'NO_VECTOR_TRANSFORM_FACT'; -NO_VECTOR_TRANSFORM: 'NO_VECTOR_TRANSFORM'; -NOWAIT: 'NOWAIT'; -NO_XDB_FASTPATH_INSERT: 'NO_XDB_FASTPATH_INSERT'; -NO_XML_DML_REWRITE: 'NO_XML_DML_REWRITE'; -NO_XMLINDEX_REWRITE_IN_SELECT: 'NO_XMLINDEX_REWRITE_IN_SELECT'; -NO_XMLINDEX_REWRITE: 'NO_XMLINDEX_REWRITE'; -NO_XML_QUERY_REWRITE: 'NO_XML_QUERY_REWRITE'; -NO_ZONEMAP: 'NO_ZONEMAP'; -NTH_VALUE: 'NTH_VALUE'; -NULLIF: 'NULLIF'; -NULL_: 'NULL'; -NULLS: 'NULLS'; -NUMBER: 'NUMBER'; -NUMERIC: 'NUMERIC'; -NUM_INDEX_KEYS: 'NUM_INDEX_KEYS'; -NUMTODSINTERVAL: 'NUMTODSINTERVAL'; -NUMTOYMINTERVAL: 'NUMTOYMINTERVAL'; -NVARCHAR2: 'NVARCHAR2'; -NVL2: 'NVL2'; -OBJECT2XML: 'OBJECT2XML'; -OBJECT: 'OBJECT'; -OBJ_ID: 'OBJ_ID'; -OBJNO: 'OBJNO'; -OBJNO_REUSE: 'OBJNO_REUSE'; -OCCURENCES: 'OCCURENCES'; -OFFLINE: 'OFFLINE'; -OFF: 'OFF'; -OFFSET: 'OFFSET'; -OF: 'OF'; -OIDINDEX: 'OIDINDEX'; -OID: 'OID'; -OLAP: 'OLAP'; -OLD: 'OLD'; -OLD_PUSH_PRED: 'OLD_PUSH_PRED'; -OLS: 'OLS'; -OLTP: 'OLTP'; -OMIT: 'OMIT'; -ONE: 'ONE'; -ONLINE: 'ONLINE'; -ONLINELOG: 'ONLINELOG'; -ONLY: 'ONLY'; -ON: 'ON'; -OPAQUE: 'OPAQUE'; -OPAQUE_TRANSFORM: 'OPAQUE_TRANSFORM'; -OPAQUE_XCANONICAL: 'OPAQUE_XCANONICAL'; -OPCODE: 'OPCODE'; -OPEN: 'OPEN'; -OPERATIONS: 'OPERATIONS'; -OPERATOR: 'OPERATOR'; -OPT_ESTIMATE: 'OPT_ESTIMATE'; -OPTIMAL: 'OPTIMAL'; -OPTIMIZE: 'OPTIMIZE'; -OPTIMIZER_FEATURES_ENABLE: 'OPTIMIZER_FEATURES_ENABLE'; -OPTIMIZER_GOAL: 'OPTIMIZER_GOAL'; -OPTION: 'OPTION'; -OPT_PARAM: 'OPT_PARAM'; -ORA_BRANCH: 'ORA_BRANCH'; -ORA_CHECK_ACL: 'ORA_CHECK_ACL'; -ORA_CHECK_PRIVILEGE: 'ORA_CHECK_PRIVILEGE'; -ORA_CLUSTERING: 'ORA_CLUSTERING'; -ORADATA: 'ORADATA'; -ORADEBUG: 'ORADEBUG'; -ORA_DST_AFFECTED: 'ORA_DST_AFFECTED'; -ORA_DST_CONVERT: 'ORA_DST_CONVERT'; -ORA_DST_ERROR: 'ORA_DST_ERROR'; -ORA_GET_ACLIDS: 'ORA_GET_ACLIDS'; -ORA_GET_PRIVILEGES: 'ORA_GET_PRIVILEGES'; -ORA_HASH: 'ORA_HASH'; -ORA_INVOKING_USERID: 'ORA_INVOKING_USERID'; -ORA_INVOKING_USER: 'ORA_INVOKING_USER'; -ORA_INVOKING_XS_USER_GUID: 'ORA_INVOKING_XS_USER_GUID'; -ORA_INVOKING_XS_USER: 'ORA_INVOKING_XS_USER'; -ORA_RAWCOMPARE: 'ORA_RAWCOMPARE'; -ORA_RAWCONCAT: 'ORA_RAWCONCAT'; -ORA_ROWSCN: 'ORA_ROWSCN'; -ORA_ROWSCN_RAW: 'ORA_ROWSCN_RAW'; -ORA_ROWVERSION: 'ORA_ROWVERSION'; -ORA_TABVERSION: 'ORA_TABVERSION'; -ORA_WRITE_TIME: 'ORA_WRITE_TIME'; -ORDERED: 'ORDERED'; -ORDERED_PREDICATES: 'ORDERED_PREDICATES'; -ORDER: 'ORDER'; -ORDINALITY: 'ORDINALITY'; -OR_EXPAND: 'OR_EXPAND'; -ORGANIZATION: 'ORGANIZATION'; -OR: 'OR'; -OR_PREDICATES: 'OR_PREDICATES'; -OSERROR: 'OSERROR'; -OTHER: 'OTHER'; -OUTER_JOIN_TO_ANTI: 'OUTER_JOIN_TO_ANTI'; -OUTER_JOIN_TO_INNER: 'OUTER_JOIN_TO_INNER'; -OUTER: 'OUTER'; -OUTLINE_LEAF: 'OUTLINE_LEAF'; -OUTLINE: 'OUTLINE'; -OUT_OF_LINE: 'OUT_OF_LINE'; -OUT: 'OUT'; -OVERFLOW_NOMOVE: 'OVERFLOW_NOMOVE'; -OVERFLOW: 'OVERFLOW'; -OVERLAPS: 'OVERLAPS'; -OVER: 'OVER'; -OVERRIDING: 'OVERRIDING'; -OWNER: 'OWNER'; -OWNERSHIP: 'OWNERSHIP'; -OWN: 'OWN'; -P_LETTER: 'P'; -PACKAGE: 'PACKAGE'; -PACKAGES: 'PACKAGES'; -PARALLEL_ENABLE: 'PARALLEL_ENABLE'; -PARALLEL_INDEX: 'PARALLEL_INDEX'; -PARALLEL: 'PARALLEL'; -PARAMETERFILE: 'PARAMETERFILE'; -PARAMETERS: 'PARAMETERS'; -PARAM: 'PARAM'; -PARENT: 'PARENT'; -PARENT_LEVEL_NAME: 'PARENT_LEVEL_NAME'; -PARENT_UNIQUE_NAME: 'PARENT_UNIQUE_NAME'; -PARITY: 'PARITY'; -PARTIAL_JOIN: 'PARTIAL_JOIN'; -PARTIALLY: 'PARTIALLY'; -PARTIAL: 'PARTIAL'; -PARTIAL_ROLLUP_PUSHDOWN: 'PARTIAL_ROLLUP_PUSHDOWN'; -PARTITION_HASH: 'PARTITION_HASH'; -PARTITION_LIST: 'PARTITION_LIST'; -PARTITION: 'PARTITION'; -PARTITION_RANGE: 'PARTITION_RANGE'; -PARTITIONS: 'PARTITIONS'; -PARTNUMINST: 'PART$NUM$INST'; -PASSING: 'PASSING'; -PASSWORD_GRACE_TIME: 'PASSWORD_GRACE_TIME'; -PASSWORD_LIFE_TIME: 'PASSWORD_LIFE_TIME'; -PASSWORD_LOCK_TIME: 'PASSWORD_LOCK_TIME'; -PASSWORD: 'PASSWORD'; -PASSWORD_REUSE_MAX: 'PASSWORD_REUSE_MAX'; -PASSWORD_REUSE_TIME: 'PASSWORD_REUSE_TIME'; -PASSWORD_ROLLOVER_TIME: 'PASSWORD_ROLLOVER_TIME'; -PASSWORD_VERIFY_FUNCTION: 'PASSWORD_VERIFY_FUNCTION'; -PAST: 'PAST'; -PATCH: 'PATCH'; -PATH: 'PATH'; -PATH_PREFIX: 'PATH_PREFIX'; -PATHS: 'PATHS'; -PATTERN: 'PATTERN'; -PBL_HS_BEGIN: 'PBL_HS_BEGIN'; -PBL_HS_END: 'PBL_HS_END'; -PCTFREE: 'PCTFREE'; -PCTINCREASE: 'PCTINCREASE'; -PCTTHRESHOLD: 'PCTTHRESHOLD'; -PCTUSED: 'PCTUSED'; -PCTVERSION: 'PCTVERSION'; -PENDING: 'PENDING'; -PERCENT_FOUND: '%' SPACE* 'FOUND'; -PERCENT_ISOPEN: '%' SPACE* 'ISOPEN'; -PERCENT_NOTFOUND: '%' SPACE* 'NOTFOUND'; -PERCENT_KEYWORD: 'PERCENT'; -PERCENT_RANKM: 'PERCENT_RANKM'; -PERCENT_ROWCOUNT: '%' SPACE* 'ROWCOUNT'; -PERCENT_ROWTYPE: '%' SPACE* 'ROWTYPE'; -PERCENT_TYPE: '%' SPACE* 'TYPE'; -PERFORMANCE: 'PERFORMANCE'; -PERIOD_KEYWORD: 'PERIOD'; -PERMANENT: 'PERMANENT'; -PERMISSION: 'PERMISSION'; -PERMUTE: 'PERMUTE'; -PER: 'PER'; -PFILE: 'PFILE'; -PHYSICAL: 'PHYSICAL'; -PIKEY: 'PIKEY'; -PIPELINED: 'PIPELINED'; -PIPE: 'PIPE'; -PIV_GB: 'PIV_GB'; -PIVOT: 'PIVOT'; -PIV_SSF: 'PIV_SSF'; -PLACE_DISTINCT: 'PLACE_DISTINCT'; -PLACE_GROUP_BY: 'PLACE_GROUP_BY'; -PLAN: 'PLAN'; -PLSCOPE_SETTINGS: 'PLSCOPE_SETTINGS'; -PLS_INTEGER: 'PLS_INTEGER'; -PLSQL_CCFLAGS: 'PLSQL_CCFLAGS'; -PLSQL_CODE_TYPE: 'PLSQL_CODE_TYPE'; -PLSQL_DEBUG: 'PLSQL_DEBUG'; -PLSQL_OPTIMIZE_LEVEL: 'PLSQL_OPTIMIZE_LEVEL'; -PLSQL_WARNINGS: 'PLSQL_WARNINGS'; -PLUGGABLE: 'PLUGGABLE'; -PMEM: 'PMEM'; -POINT: 'POINT'; -POLICY: 'POLICY'; -POOL_16K: 'POOL_16K'; -POOL_2K: 'POOL_2K'; -POOL_32K: 'POOL_32K'; -POOL_4K: 'POOL_4K'; -POOL_8K: 'POOL_8K'; -POSITIVEN: 'POSITIVEN'; -POSITIVE: 'POSITIVE'; -POST_TRANSACTION: 'POST_TRANSACTION'; -POWERMULTISET_BY_CARDINALITY: 'POWERMULTISET_BY_CARDINALITY'; -POWERMULTISET: 'POWERMULTISET'; -POWER: 'POWER'; -PQ_CONCURRENT_UNION: 'PQ_CONCURRENT_UNION'; -PQ_DISTRIBUTE: 'PQ_DISTRIBUTE'; -PQ_DISTRIBUTE_WINDOW: 'PQ_DISTRIBUTE_WINDOW'; -PQ_FILTER: 'PQ_FILTER'; -PQ_MAP: 'PQ_MAP'; -PQ_NOMAP: 'PQ_NOMAP'; -PQ_REPLICATE: 'PQ_REPLICATE'; -PQ_SKEW: 'PQ_SKEW'; -PRAGMA: 'PRAGMA'; -PREBUILT: 'PREBUILT'; -PRECEDES: 'PRECEDES'; -PRECEDING: 'PRECEDING'; -PRECISION: 'PRECISION'; -PRECOMPUTE_SUBQUERY: 'PRECOMPUTE_SUBQUERY'; -PREDICATE_REORDERS: 'PREDICATE_REORDERS'; -PRELOAD: 'PRELOAD'; -PREPARE: 'PREPARE'; -PRESENTNNV: 'PRESENTNNV'; -PRESENT: 'PRESENT'; -PRESENTV: 'PRESENTV'; -PRESERVE_OID: 'PRESERVE_OID'; -PRESERVE: 'PRESERVE'; -PRETTY: 'PRETTY'; -PREVIOUS: 'PREVIOUS'; -PREV: 'PREV'; -PRIMARY: 'PRIMARY'; -PRINTBLOBTOCLOB: 'PRINTBLOBTOCLOB'; -PRIORITY: 'PRIORITY'; -PRIOR: 'PRIOR'; -PRIVATE: 'PRIVATE'; -PRIVATE_SGA: 'PRIVATE_SGA'; -PRIVILEGED: 'PRIVILEGED'; -PRIVILEGE: 'PRIVILEGE'; -PRIVILEGES: 'PRIVILEGES'; -PROCEDURAL: 'PROCEDURAL'; -PROCEDURE: 'PROCEDURE'; -PROCESS: 'PROCESS'; -PROFILE: 'PROFILE'; -PROGRAM: 'PROGRAM'; -PROJECT: 'PROJECT'; -PROPAGATE: 'PROPAGATE'; -PROPERTY: 'PROPERTY'; -PROTECTED: 'PROTECTED'; -PROTECTION: 'PROTECTION'; -PROTOCOL: 'PROTOCOL'; -PROXY: 'PROXY'; -PRUNING: 'PRUNING'; -PUBLIC: 'PUBLIC'; -PULL_PRED: 'PULL_PRED'; -PURGE: 'PURGE'; -PUSH_PRED: 'PUSH_PRED'; -PUSH_SUBQ: 'PUSH_SUBQ'; -PX_FAULT_TOLERANCE: 'PX_FAULT_TOLERANCE'; -PX_GRANULE: 'PX_GRANULE'; -PX_JOIN_FILTER: 'PX_JOIN_FILTER'; -QB_NAME: 'QB_NAME'; -QUARTERS: 'QUARTERS'; -QUERY_BLOCK: 'QUERY_BLOCK'; -QUERY: 'QUERY'; -QUEUE_CURR: 'QUEUE_CURR'; -QUEUE: 'QUEUE'; -QUEUE_ROWP: 'QUEUE_ROWP'; -QUIESCE: 'QUIESCE'; -QUORUM: 'QUORUM'; -QUOTA: 'QUOTA'; -QUOTAGROUP: 'QUOTAGROUP'; -RAISE: 'RAISE'; -RANDOM_LOCAL: 'RANDOM_LOCAL'; -RANDOM: 'RANDOM'; -RANGE: 'RANGE'; -RANKM: 'RANKM'; -RAPIDLY: 'RAPIDLY'; -RAW: 'RAW'; -RAWTOHEX: 'RAWTOHEX'; -RAWTONHEX: 'RAWTONHEX'; -RBA: 'RBA'; -RBO_OUTLINE: 'RBO_OUTLINE'; -RDBA: 'RDBA'; -READ: 'READ'; -READS: 'READS'; -REALM: 'REALM'; -REAL: 'REAL'; -REBALANCE: 'REBALANCE'; -REBUILD: 'REBUILD'; -RECORD: 'RECORD'; -RECORDS_PER_BLOCK: 'RECORDS_PER_BLOCK'; -RECOVERABLE: 'RECOVERABLE'; -RECOVER: 'RECOVER'; -RECOVERY: 'RECOVERY'; -RECYCLEBIN: 'RECYCLEBIN'; -RECYCLE: 'RECYCLE'; -REDACTION: 'REDACTION'; -REDEFINE: 'REDEFINE'; -REDO: 'REDO'; -REDUCED: 'REDUCED'; -REDUNDANCY: 'REDUNDANCY'; -REF_CASCADE_CURSOR: 'REF_CASCADE_CURSOR'; -REFERENCED: 'REFERENCED'; -REFERENCE: 'REFERENCE'; -REFERENCES: 'REFERENCES'; -REFERENCING: 'REFERENCING'; -REF: 'REF'; -REFRESH: 'REFRESH'; -REFTOHEX: 'REFTOHEX'; -REGEXP_COUNT: 'REGEXP_COUNT'; -REGEXP_INSTR: 'REGEXP_INSTR'; -REGEXP_LIKE: 'REGEXP_LIKE'; -REGEXP_REPLACE: 'REGEXP_REPLACE'; -REGEXP_SUBSTR: 'REGEXP_SUBSTR'; -REGISTER: 'REGISTER'; -REGR_AVGX: 'REGR_AVGX'; -REGR_AVGY: 'REGR_AVGY'; -REGR_COUNT: 'REGR_COUNT'; -REGR_INTERCEPT: 'REGR_INTERCEPT'; -REGR_R2: 'REGR_R2'; -REGR_SLOPE: 'REGR_SLOPE'; -REGR_SXX: 'REGR_SXX'; -REGR_SXY: 'REGR_SXY'; -REGR_SYY: 'REGR_SYY'; -REGULAR: 'REGULAR'; -REJECT: 'REJECT'; -REKEY: 'REKEY'; -RELATIONAL: 'RELATIONAL'; -RELIES_ON: 'RELIES_ON'; -RELOCATE: 'RELOCATE'; -RELY: 'RELY'; -REMAINDER: 'REMAINDER'; -REMOTE: 'REMOTE'; -REMOTE_MAPPED: 'REMOTE_MAPPED'; -REMOVE: 'REMOVE'; -RENAME: 'RENAME'; -REPAIR: 'REPAIR'; -REPEAT: 'REPEAT'; -REPLACE: 'REPLACE'; -REPLICATION: 'REPLICATION'; -REQUIRED: 'REQUIRED'; -RESETLOGS: 'RESETLOGS'; -RESET: 'RESET'; -RESIZE: 'RESIZE'; -RESOLVE: 'RESOLVE'; -RESOLVER: 'RESOLVER'; -RESOURCE: 'RESOURCE'; -RESPECT: 'RESPECT'; -RESTART: 'RESTART'; -RESTORE_AS_INTERVALS: 'RESTORE_AS_INTERVALS'; -RESTORE: 'RESTORE'; -RESTRICT_ALL_REF_CONS: 'RESTRICT_ALL_REF_CONS'; -RESTRICTED: 'RESTRICTED'; -RESTRICT_REFERENCES: 'RESTRICT_REFERENCES'; -RESTRICT: 'RESTRICT'; -RESULT_CACHE: 'RESULT_CACHE'; -RESULT: 'RESULT'; -RESUMABLE: 'RESUMABLE'; -RESUME: 'RESUME'; -RETENTION: 'RETENTION'; -RETRY_ON_ROW_CHANGE: 'RETRY_ON_ROW_CHANGE'; -RETURNING: 'RETURNING'; -RETURN: 'RETURN'; -REUSE: 'REUSE'; -REVERSE: 'REVERSE'; -REVOKE: 'REVOKE'; -REWRITE_OR_ERROR: 'REWRITE_OR_ERROR'; -REWRITE: 'REWRITE'; -RIGHT: 'RIGHT'; -ROLE: 'ROLE'; -ROLESET: 'ROLESET'; -ROLES: 'ROLES'; -ROLLBACK: 'ROLLBACK'; -ROLLING: 'ROLLING'; -ROLLUP: 'ROLLUP'; -ROWDEPENDENCIES: 'ROWDEPENDENCIES'; -ROWID_MAPPING_TABLE: 'ROWID_MAPPING_TABLE'; -ROWID: 'ROWID'; -ROWIDTOCHAR: 'ROWIDTOCHAR'; -ROWIDTONCHAR: 'ROWIDTONCHAR'; -ROW_LENGTH: 'ROW_LENGTH'; -ROWNUM: 'ROWNUM'; -ROW: 'ROW'; -ROWS: 'ROWS'; -RPAD: 'RPAD'; -RTRIM: 'RTRIM'; -RULE: 'RULE'; -RULES: 'RULES'; -RUNNING: 'RUNNING'; -SALT: 'SALT'; -SAMPLE: 'SAMPLE'; -SAVE_AS_INTERVALS: 'SAVE_AS_INTERVALS'; -SAVEPOINT: 'SAVEPOINT'; -SAVE: 'SAVE'; -SB4: 'SB4'; -SCALE_ROWS: 'SCALE_ROWS'; -SCALE: 'SCALE'; -SCAN_INSTANCES: 'SCAN_INSTANCES'; -SCAN: 'SCAN'; -SCHEDULER: 'SCHEDULER'; -SCHEMACHECK: 'SCHEMACHECK'; -SCHEMA: 'SCHEMA'; -SCN_ASCENDING: 'SCN_ASCENDING'; -SCN: 'SCN'; -SCOPE: 'SCOPE'; -SCRUB: 'SCRUB'; -SD_ALL: 'SD_ALL'; -SD_INHIBIT: 'SD_INHIBIT'; -SDO_GEOM_MBR: 'SDO_GEOM_MBR'; -SDO_GEOMETRY: 'SDO_GEOMETRY'; -SD_SHOW: 'SD_SHOW'; -SEARCH: 'SEARCH'; -SECOND: 'SECOND'; -SECONDS: 'SECONDS'; -SECRET: 'SECRET'; -SECUREFILE_DBA: 'SECUREFILE_DBA'; -SECUREFILE: 'SECUREFILE'; -SECURITY: 'SECURITY'; -SEED: 'SEED'; -SEG_BLOCK: 'SEG_BLOCK'; -SEG_FILE: 'SEG_FILE'; -SEGMENT: 'SEGMENT'; -SELECTIVITY: 'SELECTIVITY'; -SELECT: 'SELECT'; -SELF: 'SELF'; -SEMIJOIN_DRIVER: 'SEMIJOIN_DRIVER'; -SEMIJOIN: 'SEMIJOIN'; -SEMI_TO_INNER: 'SEMI_TO_INNER'; -SEQUENCED: 'SEQUENCED'; -SEQUENCE: 'SEQUENCE'; -SEQUENTIAL: 'SEQUENTIAL'; -SEQ: 'SEQ'; -SERIALIZABLE: 'SERIALIZABLE'; -SERIALLY_REUSABLE: 'SERIALLY_REUSABLE'; -SERIAL: 'SERIAL'; -SERVERERROR: 'SERVERERROR'; -SERVICE_NAME_CONVERT: 'SERVICE_NAME_CONVERT'; -SERVICE: 'SERVICE'; -SERVICES: 'SERVICES'; -SESSION_CACHED_CURSORS: 'SESSION_CACHED_CURSORS'; -SESSION: 'SESSION'; -SESSIONS_PER_USER: 'SESSIONS_PER_USER'; -SESSIONTIMEZONE: 'SESSIONTIMEZONE'; -SESSIONTZNAME: 'SESSIONTZNAME'; -SET: 'SET'; -SETS: 'SETS'; -SETTINGS: 'SETTINGS'; -SET_TO_JOIN: 'SET_TO_JOIN'; -SEVERE: 'SEVERE'; -SHARDSPACE: 'SHARDSPACE'; -SHARED_POOL: 'SHARED_POOL'; -SHARED: 'SHARED'; -SHARE: 'SHARE'; -SHARING: 'SHARING'; -SHELFLIFE: 'SHELFLIFE'; -SHOW: 'SHOW'; -SHRINK: 'SHRINK'; -SHUTDOWN: 'SHUTDOWN'; -SIBLINGS: 'SIBLINGS'; -SID: 'SID'; -SITE: 'SITE'; -SIGNAL_COMPONENT: 'SIGNAL_COMPONENT'; -SIGNAL_FUNCTION: 'SIGNAL_FUNCTION'; -SIGN: 'SIGN'; -SIGNTYPE: 'SIGNTYPE'; -SIMPLE_INTEGER: 'SIMPLE_INTEGER'; -SIMPLE: 'SIMPLE'; -SINGLE: 'SINGLE'; -SINGLETASK: 'SINGLETASK'; -SINH: 'SINH'; -SIN: 'SIN'; -SIZE: 'SIZE'; -SKIP_EXT_OPTIMIZER: 'SKIP_EXT_OPTIMIZER'; -SKIP_ : 'SKIP'; -SKIP_UNQ_UNUSABLE_IDX: 'SKIP_UNQ_UNUSABLE_IDX'; -SKIP_UNUSABLE_INDEXES: 'SKIP_UNUSABLE_INDEXES'; -SMALLFILE: 'SMALLFILE'; -SMALLINT: 'SMALLINT'; -SNAPSHOT: 'SNAPSHOT'; -SOME: 'SOME'; -SORT: 'SORT'; -SOUNDEX: 'SOUNDEX'; -SOURCE_FILE_DIRECTORY: 'SOURCE_FILE_DIRECTORY'; -SOURCE_FILE_NAME_CONVERT: 'SOURCE_FILE_NAME_CONVERT'; -SOURCE: 'SOURCE'; -SPACE_KEYWORD: 'SPACE'; -SPECIFICATION: 'SPECIFICATION'; -SPFILE: 'SPFILE'; -SPLIT: 'SPLIT'; -SPREADSHEET: 'SPREADSHEET'; -SQLDATA: 'SQLDATA'; -SQLERROR: 'SQLERROR'; -SQLLDR: 'SQLLDR'; -SQL: 'SQL'; -SQL_MACRO: 'SQL_MACRO'; -SQL_TRACE: 'SQL_TRACE'; -SQL_TRANSLATION_PROFILE: 'SQL_TRANSLATION_PROFILE'; -SQRT: 'SQRT'; -STALE: 'STALE'; -STANDALONE: 'STANDALONE'; -STANDARD: 'STANDARD'; -STANDARD_HASH: 'STANDARD_HASH'; -STANDBY_MAX_DATA_DELAY: 'STANDBY_MAX_DATA_DELAY'; -STANDBYS: 'STANDBYS'; -STANDBY: 'STANDBY'; -STAR: 'STAR'; -STAR_TRANSFORMATION: 'STAR_TRANSFORMATION'; -START: 'START'; -STARTUP: 'STARTUP'; -STATEMENT_ID: 'STATEMENT_ID'; -STATEMENT_QUEUING: 'STATEMENT_QUEUING'; -STATEMENTS: 'STATEMENTS'; -STATEMENT: 'STATEMENT'; -STATE: 'STATE'; -STATIC: 'STATIC'; -STATISTICS: 'STATISTICS'; -STATS_BINOMIAL_TEST: 'STATS_BINOMIAL_TEST'; -STATS_CROSSTAB: 'STATS_CROSSTAB'; -STATS_F_TEST: 'STATS_F_TEST'; -STATS_KS_TEST: 'STATS_KS_TEST'; -STATS_MODE: 'STATS_MODE'; -STATS_MW_TEST: 'STATS_MW_TEST'; -STATS_ONE_WAY_ANOVA: 'STATS_ONE_WAY_ANOVA'; -STATS_T_TEST_INDEP: 'STATS_T_TEST_INDEP'; -STATS_T_TEST_INDEPU: 'STATS_T_TEST_INDEPU'; -STATS_T_TEST_ONE: 'STATS_T_TEST_ONE'; -STATS_T_TEST_PAIRED: 'STATS_T_TEST_PAIRED'; -STATS_WSR_TEST: 'STATS_WSR_TEST'; -STDDEV_POP: 'STDDEV_POP'; -STDDEV_SAMP: 'STDDEV_SAMP'; -STOP: 'STOP'; -STORAGE: 'STORAGE'; -STORE: 'STORE'; -STREAMS: 'STREAMS'; -STREAM: 'STREAM'; -STRICT: 'STRICT'; -STRING: 'STRING'; -STRIPE_COLUMNS: 'STRIPE_COLUMNS'; -STRIPE_WIDTH: 'STRIPE_WIDTH'; -STRIP: 'STRIP'; -STRUCTURE: 'STRUCTURE'; -SUBMULTISET: 'SUBMULTISET'; -SUBPARTITION_REL: 'SUBPARTITION_REL'; -SUBPARTITIONS: 'SUBPARTITIONS'; -SUBPARTITION: 'SUBPARTITION'; -SUBQUERIES: 'SUBQUERIES'; -SUBQUERY_PRUNING: 'SUBQUERY_PRUNING'; -SUBSCRIBE: 'SUBSCRIBE'; -SUBSET: 'SUBSET'; -SUBSTITUTABLE: 'SUBSTITUTABLE'; -SUBSTR2: 'SUBSTR2'; -SUBSTR4: 'SUBSTR4'; -SUBSTRB: 'SUBSTRB'; -SUBSTRC: 'SUBSTRC'; -SUBTYPE: 'SUBTYPE'; -SUCCESSFUL: 'SUCCESSFUL'; -SUCCESS: 'SUCCESS'; -SUMMARY: 'SUMMARY'; -SUPPLEMENTAL: 'SUPPLEMENTAL'; -SUSPEND: 'SUSPEND'; -SWAP_JOIN_INPUTS: 'SWAP_JOIN_INPUTS'; -SWITCHOVER: 'SWITCHOVER'; -SWITCH: 'SWITCH'; -SYNCHRONOUS: 'SYNCHRONOUS'; -SYNC: 'SYNC'; -SYNONYM: 'SYNONYM'; -SYS: 'SYS'; -SYSASM: 'SYSASM'; -SYS_AUDIT: 'SYS_AUDIT'; -SYSAUX: 'SYSAUX'; -SYSBACKUP: 'SYSBACKUP'; -SYS_CHECKACL: 'SYS_CHECKACL'; -SYS_CHECK_PRIVILEGE: 'SYS_CHECK_PRIVILEGE'; -SYS_CONNECT_BY_PATH: 'SYS_CONNECT_BY_PATH'; -SYS_CONTEXT: 'SYS_CONTEXT'; -SYSDATE: 'SYSDATE'; -SYSDBA: 'SYSDBA'; -SYS_DBURIGEN: 'SYS_DBURIGEN'; -SYSDG: 'SYSDG'; -SYS_DL_CURSOR: 'SYS_DL_CURSOR'; -SYS_DM_RXFORM_CHR: 'SYS_DM_RXFORM_CHR'; -SYS_DM_RXFORM_NUM: 'SYS_DM_RXFORM_NUM'; -SYS_DOM_COMPARE: 'SYS_DOM_COMPARE'; -SYS_DST_PRIM2SEC: 'SYS_DST_PRIM2SEC'; -SYS_DST_SEC2PRIM: 'SYS_DST_SEC2PRIM'; -SYS_ET_BFILE_TO_RAW: 'SYS_ET_BFILE_TO_RAW'; -SYS_ET_BLOB_TO_IMAGE: 'SYS_ET_BLOB_TO_IMAGE'; -SYS_ET_IMAGE_TO_BLOB: 'SYS_ET_IMAGE_TO_BLOB'; -SYS_ET_RAW_TO_BFILE: 'SYS_ET_RAW_TO_BFILE'; -SYS_EXTPDTXT: 'SYS_EXTPDTXT'; -SYS_EXTRACT_UTC: 'SYS_EXTRACT_UTC'; -SYS_FBT_INSDEL: 'SYS_FBT_INSDEL'; -SYS_FILTER_ACLS: 'SYS_FILTER_ACLS'; -SYS_FNMATCHES: 'SYS_FNMATCHES'; -SYS_FNREPLACE: 'SYS_FNREPLACE'; -SYS_GET_ACLIDS: 'SYS_GET_ACLIDS'; -SYS_GET_COL_ACLIDS: 'SYS_GET_COL_ACLIDS'; -SYS_GET_PRIVILEGES: 'SYS_GET_PRIVILEGES'; -SYS_GETTOKENID: 'SYS_GETTOKENID'; -SYS_GETXTIVAL: 'SYS_GETXTIVAL'; -SYS_GUID: 'SYS_GUID'; -SYSGUID: 'SYSGUID'; -SYSKM: 'SYSKM'; -SYS_MAKE_XMLNODEID: 'SYS_MAKE_XMLNODEID'; -SYS_MAKEXML: 'SYS_MAKEXML'; -SYS_MKXMLATTR: 'SYS_MKXMLATTR'; -SYS_MKXTI: 'SYS_MKXTI'; -SYSOBJ: 'SYSOBJ'; -SYS_OP_ADT2BIN: 'SYS_OP_ADT2BIN'; -SYS_OP_ADTCONS: 'SYS_OP_ADTCONS'; -SYS_OP_ALSCRVAL: 'SYS_OP_ALSCRVAL'; -SYS_OP_ATG: 'SYS_OP_ATG'; -SYS_OP_BIN2ADT: 'SYS_OP_BIN2ADT'; -SYS_OP_BITVEC: 'SYS_OP_BITVEC'; -SYS_OP_BL2R: 'SYS_OP_BL2R'; -SYS_OP_BLOOM_FILTER_LIST: 'SYS_OP_BLOOM_FILTER_LIST'; -SYS_OP_BLOOM_FILTER: 'SYS_OP_BLOOM_FILTER'; -SYS_OP_C2C: 'SYS_OP_C2C'; -SYS_OP_CAST: 'SYS_OP_CAST'; -SYS_OP_CEG: 'SYS_OP_CEG'; -SYS_OP_CL2C: 'SYS_OP_CL2C'; -SYS_OP_COMBINED_HASH: 'SYS_OP_COMBINED_HASH'; -SYS_OP_COMP: 'SYS_OP_COMP'; -SYS_OP_CONVERT: 'SYS_OP_CONVERT'; -SYS_OP_COUNTCHG: 'SYS_OP_COUNTCHG'; -SYS_OP_CSCONV: 'SYS_OP_CSCONV'; -SYS_OP_CSCONVTEST: 'SYS_OP_CSCONVTEST'; -SYS_OP_CSR: 'SYS_OP_CSR'; -SYS_OP_CSX_PATCH: 'SYS_OP_CSX_PATCH'; -SYS_OP_CYCLED_SEQ: 'SYS_OP_CYCLED_SEQ'; -SYS_OP_DECOMP: 'SYS_OP_DECOMP'; -SYS_OP_DESCEND: 'SYS_OP_DESCEND'; -SYS_OP_DISTINCT: 'SYS_OP_DISTINCT'; -SYS_OP_DRA: 'SYS_OP_DRA'; -SYS_OP_DUMP: 'SYS_OP_DUMP'; -SYS_OP_DV_CHECK: 'SYS_OP_DV_CHECK'; -SYS_OP_ENFORCE_NOT_NULL: 'SYS_OP_ENFORCE_NOT_NULL$'; -SYSOPER: 'SYSOPER'; -SYS_OP_EXTRACT: 'SYS_OP_EXTRACT'; -SYS_OP_GROUPING: 'SYS_OP_GROUPING'; -SYS_OP_GUID: 'SYS_OP_GUID'; -SYS_OP_HASH: 'SYS_OP_HASH'; -SYS_OP_IIX: 'SYS_OP_IIX'; -SYS_OP_ITR: 'SYS_OP_ITR'; -SYS_OP_KEY_VECTOR_CREATE: 'SYS_OP_KEY_VECTOR_CREATE'; -SYS_OP_KEY_VECTOR_FILTER_LIST: 'SYS_OP_KEY_VECTOR_FILTER_LIST'; -SYS_OP_KEY_VECTOR_FILTER: 'SYS_OP_KEY_VECTOR_FILTER'; -SYS_OP_KEY_VECTOR_SUCCEEDED: 'SYS_OP_KEY_VECTOR_SUCCEEDED'; -SYS_OP_KEY_VECTOR_USE: 'SYS_OP_KEY_VECTOR_USE'; -SYS_OP_LBID: 'SYS_OP_LBID'; -SYS_OP_LOBLOC2BLOB: 'SYS_OP_LOBLOC2BLOB'; -SYS_OP_LOBLOC2CLOB: 'SYS_OP_LOBLOC2CLOB'; -SYS_OP_LOBLOC2ID: 'SYS_OP_LOBLOC2ID'; -SYS_OP_LOBLOC2NCLOB: 'SYS_OP_LOBLOC2NCLOB'; -SYS_OP_LOBLOC2TYP: 'SYS_OP_LOBLOC2TYP'; -SYS_OP_LSVI: 'SYS_OP_LSVI'; -SYS_OP_LVL: 'SYS_OP_LVL'; -SYS_OP_MAKEOID: 'SYS_OP_MAKEOID'; -SYS_OP_MAP_NONNULL: 'SYS_OP_MAP_NONNULL'; -SYS_OP_MSR: 'SYS_OP_MSR'; -SYS_OP_NICOMBINE: 'SYS_OP_NICOMBINE'; -SYS_OP_NIEXTRACT: 'SYS_OP_NIEXTRACT'; -SYS_OP_NII: 'SYS_OP_NII'; -SYS_OP_NIX: 'SYS_OP_NIX'; -SYS_OP_NOEXPAND: 'SYS_OP_NOEXPAND'; -SYS_OP_NTCIMG: 'SYS_OP_NTCIMG$'; -SYS_OP_NUMTORAW: 'SYS_OP_NUMTORAW'; -SYS_OP_OIDVALUE: 'SYS_OP_OIDVALUE'; -SYS_OP_OPNSIZE: 'SYS_OP_OPNSIZE'; -SYS_OP_PAR_1: 'SYS_OP_PAR_1'; -SYS_OP_PARGID_1: 'SYS_OP_PARGID_1'; -SYS_OP_PARGID: 'SYS_OP_PARGID'; -SYS_OP_PAR: 'SYS_OP_PAR'; -SYS_OP_PART_ID: 'SYS_OP_PART_ID'; -SYS_OP_PIVOT: 'SYS_OP_PIVOT'; -SYS_OP_R2O: 'SYS_OP_R2O'; -SYS_OP_RAWTONUM: 'SYS_OP_RAWTONUM'; -SYS_OP_RDTM: 'SYS_OP_RDTM'; -SYS_OP_REF: 'SYS_OP_REF'; -SYS_OP_RMTD: 'SYS_OP_RMTD'; -SYS_OP_ROWIDTOOBJ: 'SYS_OP_ROWIDTOOBJ'; -SYS_OP_RPB: 'SYS_OP_RPB'; -SYS_OPTLOBPRBSC: 'SYS_OPTLOBPRBSC'; -SYS_OP_TOSETID: 'SYS_OP_TOSETID'; -SYS_OP_TPR: 'SYS_OP_TPR'; -SYS_OP_TRTB: 'SYS_OP_TRTB'; -SYS_OPTXICMP: 'SYS_OPTXICMP'; -SYS_OPTXQCASTASNQ: 'SYS_OPTXQCASTASNQ'; -SYS_OP_UNDESCEND: 'SYS_OP_UNDESCEND'; -SYS_OP_VECAND: 'SYS_OP_VECAND'; -SYS_OP_VECBIT: 'SYS_OP_VECBIT'; -SYS_OP_VECOR: 'SYS_OP_VECOR'; -SYS_OP_VECXOR: 'SYS_OP_VECXOR'; -SYS_OP_VERSION: 'SYS_OP_VERSION'; -SYS_OP_VREF: 'SYS_OP_VREF'; -SYS_OP_VVD: 'SYS_OP_VVD'; -SYS_OP_XMLCONS_FOR_CSX: 'SYS_OP_XMLCONS_FOR_CSX'; -SYS_OP_XPTHATG: 'SYS_OP_XPTHATG'; -SYS_OP_XPTHIDX: 'SYS_OP_XPTHIDX'; -SYS_OP_XPTHOP: 'SYS_OP_XPTHOP'; -SYS_OP_XTXT2SQLT: 'SYS_OP_XTXT2SQLT'; -SYS_OP_ZONE_ID: 'SYS_OP_ZONE_ID'; -SYS_ORDERKEY_DEPTH: 'SYS_ORDERKEY_DEPTH'; -SYS_ORDERKEY_MAXCHILD: 'SYS_ORDERKEY_MAXCHILD'; -SYS_ORDERKEY_PARENT: 'SYS_ORDERKEY_PARENT'; -SYS_PARALLEL_TXN: 'SYS_PARALLEL_TXN'; -SYS_PATHID_IS_ATTR: 'SYS_PATHID_IS_ATTR'; -SYS_PATHID_IS_NMSPC: 'SYS_PATHID_IS_NMSPC'; -SYS_PATHID_LASTNAME: 'SYS_PATHID_LASTNAME'; -SYS_PATHID_LASTNMSPC: 'SYS_PATHID_LASTNMSPC'; -SYS_PATH_REVERSE: 'SYS_PATH_REVERSE'; -SYS_PXQEXTRACT: 'SYS_PXQEXTRACT'; -SYS_RAW_TO_XSID: 'SYS_RAW_TO_XSID'; -SYS_RID_ORDER: 'SYS_RID_ORDER'; -SYS_ROW_DELTA: 'SYS_ROW_DELTA'; -SYS_SC_2_XMLT: 'SYS_SC_2_XMLT'; -SYS_SYNRCIREDO: 'SYS_SYNRCIREDO'; -SYSTEM_DEFINED: 'SYSTEM_DEFINED'; -SYSTEM: 'SYSTEM'; -SYSTIMESTAMP: 'SYSTIMESTAMP'; -SYS_TYPEID: 'SYS_TYPEID'; -SYS_UMAKEXML: 'SYS_UMAKEXML'; -SYS_XMLANALYZE: 'SYS_XMLANALYZE'; -SYS_XMLCONTAINS: 'SYS_XMLCONTAINS'; -SYS_XMLCONV: 'SYS_XMLCONV'; -SYS_XMLEXNSURI: 'SYS_XMLEXNSURI'; -SYS_XMLGEN: 'SYS_XMLGEN'; -SYS_XMLI_LOC_ISNODE: 'SYS_XMLI_LOC_ISNODE'; -SYS_XMLI_LOC_ISTEXT: 'SYS_XMLI_LOC_ISTEXT'; -SYS_XMLINSTR: 'SYS_XMLINSTR'; -SYS_XMLLOCATOR_GETSVAL: 'SYS_XMLLOCATOR_GETSVAL'; -SYS_XMLNODEID_GETCID: 'SYS_XMLNODEID_GETCID'; -SYS_XMLNODEID_GETLOCATOR: 'SYS_XMLNODEID_GETLOCATOR'; -SYS_XMLNODEID_GETOKEY: 'SYS_XMLNODEID_GETOKEY'; -SYS_XMLNODEID_GETPATHID: 'SYS_XMLNODEID_GETPATHID'; -SYS_XMLNODEID_GETPTRID: 'SYS_XMLNODEID_GETPTRID'; -SYS_XMLNODEID_GETRID: 'SYS_XMLNODEID_GETRID'; -SYS_XMLNODEID_GETSVAL: 'SYS_XMLNODEID_GETSVAL'; -SYS_XMLNODEID_GETTID: 'SYS_XMLNODEID_GETTID'; -SYS_XMLNODEID: 'SYS_XMLNODEID'; -SYS_XMLT_2_SC: 'SYS_XMLT_2_SC'; -SYS_XMLTRANSLATE: 'SYS_XMLTRANSLATE'; -SYS_XMLTYPE2SQL: 'SYS_XMLTYPE2SQL'; -SYS_XQ_ASQLCNV: 'SYS_XQ_ASQLCNV'; -SYS_XQ_ATOMCNVCHK: 'SYS_XQ_ATOMCNVCHK'; -SYS_XQBASEURI: 'SYS_XQBASEURI'; -SYS_XQCASTABLEERRH: 'SYS_XQCASTABLEERRH'; -SYS_XQCODEP2STR: 'SYS_XQCODEP2STR'; -SYS_XQCODEPEQ: 'SYS_XQCODEPEQ'; -SYS_XQCON2SEQ: 'SYS_XQCON2SEQ'; -SYS_XQCONCAT: 'SYS_XQCONCAT'; -SYS_XQDELETE: 'SYS_XQDELETE'; -SYS_XQDFLTCOLATION: 'SYS_XQDFLTCOLATION'; -SYS_XQDOC: 'SYS_XQDOC'; -SYS_XQDOCURI: 'SYS_XQDOCURI'; -SYS_XQDURDIV: 'SYS_XQDURDIV'; -SYS_XQED4URI: 'SYS_XQED4URI'; -SYS_XQENDSWITH: 'SYS_XQENDSWITH'; -SYS_XQERRH: 'SYS_XQERRH'; -SYS_XQERR: 'SYS_XQERR'; -SYS_XQESHTMLURI: 'SYS_XQESHTMLURI'; -SYS_XQEXLOBVAL: 'SYS_XQEXLOBVAL'; -SYS_XQEXSTWRP: 'SYS_XQEXSTWRP'; -SYS_XQEXTRACT: 'SYS_XQEXTRACT'; -SYS_XQEXTRREF: 'SYS_XQEXTRREF'; -SYS_XQEXVAL: 'SYS_XQEXVAL'; -SYS_XQFB2STR: 'SYS_XQFB2STR'; -SYS_XQFNBOOL: 'SYS_XQFNBOOL'; -SYS_XQFNCMP: 'SYS_XQFNCMP'; -SYS_XQFNDATIM: 'SYS_XQFNDATIM'; -SYS_XQFNLNAME: 'SYS_XQFNLNAME'; -SYS_XQFNNM: 'SYS_XQFNNM'; -SYS_XQFNNSURI: 'SYS_XQFNNSURI'; -SYS_XQFNPREDTRUTH: 'SYS_XQFNPREDTRUTH'; -SYS_XQFNQNM: 'SYS_XQFNQNM'; -SYS_XQFNROOT: 'SYS_XQFNROOT'; -SYS_XQFORMATNUM: 'SYS_XQFORMATNUM'; -SYS_XQFTCONTAIN: 'SYS_XQFTCONTAIN'; -SYS_XQFUNCR: 'SYS_XQFUNCR'; -SYS_XQGETCONTENT: 'SYS_XQGETCONTENT'; -SYS_XQINDXOF: 'SYS_XQINDXOF'; -SYS_XQINSERT: 'SYS_XQINSERT'; -SYS_XQINSPFX: 'SYS_XQINSPFX'; -SYS_XQIRI2URI: 'SYS_XQIRI2URI'; -SYS_XQLANG: 'SYS_XQLANG'; -SYS_XQLLNMFRMQNM: 'SYS_XQLLNMFRMQNM'; -SYS_XQMKNODEREF: 'SYS_XQMKNODEREF'; -SYS_XQNILLED: 'SYS_XQNILLED'; -SYS_XQNODENAME: 'SYS_XQNODENAME'; -SYS_XQNORMSPACE: 'SYS_XQNORMSPACE'; -SYS_XQNORMUCODE: 'SYS_XQNORMUCODE'; -SYS_XQ_NRNG: 'SYS_XQ_NRNG'; -SYS_XQNSP4PFX: 'SYS_XQNSP4PFX'; -SYS_XQNSPFRMQNM: 'SYS_XQNSPFRMQNM'; -SYS_XQPFXFRMQNM: 'SYS_XQPFXFRMQNM'; -SYS_XQ_PKSQL2XML: 'SYS_XQ_PKSQL2XML'; -SYS_XQPOLYABS: 'SYS_XQPOLYABS'; -SYS_XQPOLYADD: 'SYS_XQPOLYADD'; -SYS_XQPOLYCEL: 'SYS_XQPOLYCEL'; -SYS_XQPOLYCSTBL: 'SYS_XQPOLYCSTBL'; -SYS_XQPOLYCST: 'SYS_XQPOLYCST'; -SYS_XQPOLYDIV: 'SYS_XQPOLYDIV'; -SYS_XQPOLYFLR: 'SYS_XQPOLYFLR'; -SYS_XQPOLYMOD: 'SYS_XQPOLYMOD'; -SYS_XQPOLYMUL: 'SYS_XQPOLYMUL'; -SYS_XQPOLYRND: 'SYS_XQPOLYRND'; -SYS_XQPOLYSQRT: 'SYS_XQPOLYSQRT'; -SYS_XQPOLYSUB: 'SYS_XQPOLYSUB'; -SYS_XQPOLYUMUS: 'SYS_XQPOLYUMUS'; -SYS_XQPOLYUPLS: 'SYS_XQPOLYUPLS'; -SYS_XQPOLYVEQ: 'SYS_XQPOLYVEQ'; -SYS_XQPOLYVGE: 'SYS_XQPOLYVGE'; -SYS_XQPOLYVGT: 'SYS_XQPOLYVGT'; -SYS_XQPOLYVLE: 'SYS_XQPOLYVLE'; -SYS_XQPOLYVLT: 'SYS_XQPOLYVLT'; -SYS_XQPOLYVNE: 'SYS_XQPOLYVNE'; -SYS_XQREF2VAL: 'SYS_XQREF2VAL'; -SYS_XQRENAME: 'SYS_XQRENAME'; -SYS_XQREPLACE: 'SYS_XQREPLACE'; -SYS_XQRESVURI: 'SYS_XQRESVURI'; -SYS_XQRNDHALF2EVN: 'SYS_XQRNDHALF2EVN'; -SYS_XQRSLVQNM: 'SYS_XQRSLVQNM'; -SYS_XQRYENVPGET: 'SYS_XQRYENVPGET'; -SYS_XQRYVARGET: 'SYS_XQRYVARGET'; -SYS_XQRYWRP: 'SYS_XQRYWRP'; -SYS_XQSEQ2CON4XC: 'SYS_XQSEQ2CON4XC'; -SYS_XQSEQ2CON: 'SYS_XQSEQ2CON'; -SYS_XQSEQDEEPEQ: 'SYS_XQSEQDEEPEQ'; -SYS_XQSEQINSB: 'SYS_XQSEQINSB'; -SYS_XQSEQRM: 'SYS_XQSEQRM'; -SYS_XQSEQRVS: 'SYS_XQSEQRVS'; -SYS_XQSEQSUB: 'SYS_XQSEQSUB'; -SYS_XQSEQTYPMATCH: 'SYS_XQSEQTYPMATCH'; -SYS_XQSTARTSWITH: 'SYS_XQSTARTSWITH'; -SYS_XQSTATBURI: 'SYS_XQSTATBURI'; -SYS_XQSTR2CODEP: 'SYS_XQSTR2CODEP'; -SYS_XQSTRJOIN: 'SYS_XQSTRJOIN'; -SYS_XQSUBSTRAFT: 'SYS_XQSUBSTRAFT'; -SYS_XQSUBSTRBEF: 'SYS_XQSUBSTRBEF'; -SYS_XQTOKENIZE: 'SYS_XQTOKENIZE'; -SYS_XQTREATAS: 'SYS_XQTREATAS'; -SYS_XQ_UPKXML2SQL: 'SYS_XQ_UPKXML2SQL'; -SYS_XQXFORM: 'SYS_XQXFORM'; -SYS_XSID_TO_RAW: 'SYS_XSID_TO_RAW'; -SYS_ZMAP_FILTER: 'SYS_ZMAP_FILTER'; -SYS_ZMAP_REFRESH: 'SYS_ZMAP_REFRESH'; -T_LETTER: 'T'; -TABLE_LOOKUP_BY_NL: 'TABLE_LOOKUP_BY_NL'; -TABLESPACE_NO: 'TABLESPACE_NO'; -TABLESPACE: 'TABLESPACE'; -TABLES: 'TABLES'; -TABLE_STATS: 'TABLE_STATS'; -TABLE: 'TABLE'; -TABNO: 'TABNO'; -TAG: 'TAG'; -TANH: 'TANH'; -TAN: 'TAN'; -TBLORIDXPARTNUM: 'TBL$OR$IDX$PART$NUM'; -TEMPFILE: 'TEMPFILE'; -TEMPLATE: 'TEMPLATE'; -TEMPORARY: 'TEMPORARY'; -TEMP_TABLE: 'TEMP_TABLE'; -TEST: 'TEST'; -TEXT: 'TEXT'; -THAN: 'THAN'; -THEN: 'THEN'; -THE: 'THE'; -THREAD: 'THREAD'; -THROUGH: 'THROUGH'; -TIER: 'TIER'; -TIES: 'TIES'; -TIMEOUT: 'TIMEOUT'; -TIMESTAMP_LTZ_UNCONSTRAINED: 'TIMESTAMP_LTZ_UNCONSTRAINED'; -TIMESTAMP: 'TIMESTAMP'; -TIMESTAMP_TZ_UNCONSTRAINED: 'TIMESTAMP_TZ_UNCONSTRAINED'; -TIMESTAMP_UNCONSTRAINED: 'TIMESTAMP_UNCONSTRAINED'; -TIMES: 'TIMES'; -TIME: 'TIME'; -TIMEZONE: 'TIMEZONE'; -TIMEZONE_ABBR: 'TIMEZONE_ABBR'; -TIMEZONE_HOUR: 'TIMEZONE_HOUR'; -TIMEZONE_MINUTE: 'TIMEZONE_MINUTE'; -TIMEZONE_OFFSET: 'TIMEZONE_OFFSET'; -TIMEZONE_REGION: 'TIMEZONE_REGION'; -TIME_ZONE: 'TIME_ZONE'; -TIMING: 'TIMING'; -TIV_GB: 'TIV_GB'; -TIV_SSF: 'TIV_SSF'; -TO_ACLID: 'TO_ACLID'; -TO_BINARY_DOUBLE: 'TO_BINARY_DOUBLE'; -TO_BINARY_FLOAT: 'TO_BINARY_FLOAT'; -TO_BLOB: 'TO_BLOB'; -TO_CLOB: 'TO_CLOB'; -TO_DSINTERVAL: 'TO_DSINTERVAL'; -TO_LOB: 'TO_LOB'; -TO_MULTI_BYTE: 'TO_MULTI_BYTE'; -TO_NCHAR: 'TO_NCHAR'; -TO_NCLOB: 'TO_NCLOB'; -TO_NUMBER: 'TO_NUMBER'; -TOPLEVEL: 'TOPLEVEL'; -TO_SINGLE_BYTE: 'TO_SINGLE_BYTE'; -TO_TIMESTAMP: 'TO_TIMESTAMP'; -TO_TIMESTAMP_TZ: 'TO_TIMESTAMP_TZ'; -TO_TIME: 'TO_TIME'; -TO_TIME_TZ: 'TO_TIME_TZ'; -TO: 'TO'; -TO_YMINTERVAL: 'TO_YMINTERVAL'; -TRACE: 'TRACE'; -TRACING: 'TRACING'; -TRACKING: 'TRACKING'; -TRAILING: 'TRAILING'; -TRANSACTION: 'TRANSACTION'; -TRANSFORM: 'TRANSFORM'; -TRANSFORM_DISTINCT_AGG: 'TRANSFORM_DISTINCT_AGG'; -TRANSITIONAL: 'TRANSITIONAL'; -TRANSITION: 'TRANSITION'; -TRANSLATE: 'TRANSLATE'; -TRANSLATION: 'TRANSLATION'; -TREAT: 'TREAT'; -TRIGGERS: 'TRIGGERS'; -TRIGGER: 'TRIGGER'; -TRUE: 'TRUE'; -TRUNCATE: 'TRUNCATE'; -TRUNC: 'TRUNC'; -TRUSTED: 'TRUSTED'; -TRUST: 'TRUST'; -TUNING: 'TUNING'; -TX: 'TX'; -TYPES: 'TYPES'; -TYPE: 'TYPE'; -TZ_OFFSET: 'TZ_OFFSET'; -UB2: 'UB2'; -UBA: 'UBA'; -UCS2: 'UCS2'; -UID: 'UID'; -UNARCHIVED: 'UNARCHIVED'; -UNBOUNDED: 'UNBOUNDED'; -UNBOUND: 'UNBOUND'; -UNCONDITIONAL: 'UNCONDITIONAL'; -UNDER: 'UNDER'; -UNDO: 'UNDO'; -UNDROP: 'UNDROP'; -UNIFORM: 'UNIFORM'; -UNION: 'UNION'; -UNIQUE: 'UNIQUE'; -UNISTR: 'UNISTR'; -UNLIMITED: 'UNLIMITED'; -UNLOAD: 'UNLOAD'; -UNLOCK: 'UNLOCK'; -UNMATCHED: 'UNMATCHED'; -UNNEST_INNERJ_DISTINCT_VIEW: 'UNNEST_INNERJ_DISTINCT_VIEW'; -UNNEST_NOSEMIJ_NODISTINCTVIEW: 'UNNEST_NOSEMIJ_NODISTINCTVIEW'; -UNNEST_SEMIJ_VIEW: 'UNNEST_SEMIJ_VIEW'; -UNNEST: 'UNNEST'; -UNPACKED: 'UNPACKED'; -UNPIVOT: 'UNPIVOT'; -UNPLUG: 'UNPLUG'; -UNPROTECTED: 'UNPROTECTED'; -UNQUIESCE: 'UNQUIESCE'; -UNRECOVERABLE: 'UNRECOVERABLE'; -UNRESTRICTED: 'UNRESTRICTED'; -UNSUBSCRIBE: 'UNSUBSCRIBE'; -UNTIL: 'UNTIL'; -UNUSABLE: 'UNUSABLE'; -UNUSED: 'UNUSED'; -UPDATABLE: 'UPDATABLE'; -UPDATED: 'UPDATED'; -UPDATE: 'UPDATE'; -UPDATEXML: 'UPDATEXML'; -UPD_INDEXES: 'UPD_INDEXES'; -UPD_JOININDEX: 'UPD_JOININDEX'; -UPGRADE: 'UPGRADE'; -UPPER: 'UPPER'; -UPSERT: 'UPSERT'; -UROWID: 'UROWID'; -USABLE: 'USABLE'; -USAGE: 'USAGE'; -USE_ANTI: 'USE_ANTI'; -USE_CONCAT: 'USE_CONCAT'; -USE_CUBE: 'USE_CUBE'; -USE_HASH_AGGREGATION: 'USE_HASH_AGGREGATION'; -USE_HASH_GBY_FOR_PUSHDOWN: 'USE_HASH_GBY_FOR_PUSHDOWN'; -USE_HASH: 'USE_HASH'; -USE_HIDDEN_PARTITIONS: 'USE_HIDDEN_PARTITIONS'; -USE_INVISIBLE_INDEXES: 'USE_INVISIBLE_INDEXES'; -USE_MERGE_CARTESIAN: 'USE_MERGE_CARTESIAN'; -USE_MERGE: 'USE_MERGE'; -USE_NL: 'USE_NL'; -USE_NL_WITH_INDEX: 'USE_NL_WITH_INDEX'; -USE_PRIVATE_OUTLINES: 'USE_PRIVATE_OUTLINES'; -USER_DATA: 'USER_DATA'; -USER_DEFINED: 'USER_DEFINED'; -USERENV: 'USERENV'; -USERGROUP: 'USERGROUP'; -USER_RECYCLEBIN: 'USER_RECYCLEBIN'; -USERS: 'USERS'; -USER_TABLESPACES: 'USER_TABLESPACES'; -USER: 'USER'; -USE_SEMI: 'USE_SEMI'; -USE_STORED_OUTLINES: 'USE_STORED_OUTLINES'; -USE_TTT_FOR_GSETS: 'USE_TTT_FOR_GSETS'; -USE: 'USE'; -USE_VECTOR_AGGREGATION: 'USE_VECTOR_AGGREGATION'; -USE_WEAK_NAME_RESL: 'USE_WEAK_NAME_RESL'; -USING_NO_EXPAND: 'USING_NO_EXPAND'; -USING: 'USING'; -UTF16BE: 'UTF16BE'; -UTF16LE: 'UTF16LE'; -UTF32: 'UTF32'; -UTF8: 'UTF8'; -V1: 'V1'; -V2: 'V2'; -VALIDATE: 'VALIDATE'; -VALIDATE_CONVERSION: 'VALIDATE_CONVERSION'; -VALIDATION: 'VALIDATION'; -VALID_TIME_END: 'VALID_TIME_END'; -VALUES: 'VALUES'; -VALUE: 'VALUE'; -VARCHAR2: 'VARCHAR2'; -VARCHAR: 'VARCHAR'; -VARIABLE: 'VARIABLE'; -VAR_POP: 'VAR_POP'; -VARRAYS: 'VARRAYS'; -VARRAY: 'VARRAY'; -VAR_SAMP: 'VAR_SAMP'; -VARYING: 'VARYING'; -VECTOR_READ_TRACE: 'VECTOR_READ_TRACE'; -VECTOR_READ: 'VECTOR_READ'; -VECTOR_TRANSFORM_DIMS: 'VECTOR_TRANSFORM_DIMS'; -VECTOR_TRANSFORM_FACT: 'VECTOR_TRANSFORM_FACT'; -VECTOR_TRANSFORM: 'VECTOR_TRANSFORM'; -VERIFIER: 'VERIFIER'; -VERIFY: 'VERIFY'; -VERSIONING: 'VERSIONING'; -VERSIONS_ENDSCN: 'VERSIONS_ENDSCN'; -VERSIONS_ENDTIME: 'VERSIONS_ENDTIME'; -VERSIONS_OPERATION: 'VERSIONS_OPERATION'; -VERSIONS_STARTSCN: 'VERSIONS_STARTSCN'; -VERSIONS_STARTTIME: 'VERSIONS_STARTTIME'; -VERSIONS: 'VERSIONS'; -VERSIONS_XID: 'VERSIONS_XID'; -VERSION: 'VERSION'; -VIEW: 'VIEW'; -VIOLATION: 'VIOLATION'; -VIRTUAL: 'VIRTUAL'; -VISIBILITY: 'VISIBILITY'; -VISIBLE: 'VISIBLE'; -VOLUME: 'VOLUME'; -VSIZE: 'VSIZE'; -WAIT: 'WAIT'; -WALLET: 'WALLET'; -WARNING: 'WARNING'; -WEEKS: 'WEEKS'; -WEEK: 'WEEK'; -WELLFORMED: 'WELLFORMED'; -WHENEVER: 'WHENEVER'; -WHEN: 'WHEN'; -WHERE: 'WHERE'; -WHILE: 'WHILE'; -WHITESPACE: 'WHITESPACE'; -WIDTH_BUCKET: 'WIDTH_BUCKET'; -WITHIN: 'WITHIN'; -WITHOUT: 'WITHOUT'; -WITH_PLSQL: 'WITH_PLSQL'; -WITH: 'WITH'; -WORK: 'WORK'; -WRAPPED: 'WRAPPED'; -WRAPPER: 'WRAPPER'; -WRITE: 'WRITE'; -XDB_FASTPATH_INSERT: 'XDB_FASTPATH_INSERT'; -XDB: 'XDB'; -X_DYN_PRUNE: 'X_DYN_PRUNE'; -XID: 'XID'; -XML2OBJECT: 'XML2OBJECT'; -XMLAGG: 'XMLAGG'; -XMLATTRIBUTES: 'XMLATTRIBUTES'; -XMLCAST: 'XMLCAST'; -XMLCDATA: 'XMLCDATA'; -XMLCOLATTVAL: 'XMLCOLATTVAL'; -XMLCOMMENT: 'XMLCOMMENT'; -XMLCONCAT: 'XMLCONCAT'; -XMLDIFF: 'XMLDIFF'; -XML_DML_RWT_STMT: 'XML_DML_RWT_STMT'; -XMLELEMENT: 'XMLELEMENT'; -XMLEXISTS2: 'XMLEXISTS2'; -XMLEXISTS: 'XMLEXISTS'; -XMLFOREST: 'XMLFOREST'; -XMLINDEX: 'XMLINDEX'; -XMLINDEX_REWRITE_IN_SELECT: 'XMLINDEX_REWRITE_IN_SELECT'; -XMLINDEX_REWRITE: 'XMLINDEX_REWRITE'; -XMLINDEX_SEL_IDX_TBL: 'XMLINDEX_SEL_IDX_TBL'; -XMLISNODE: 'XMLISNODE'; -XMLISVALID: 'XMLISVALID'; -XMLNAMESPACES: 'XMLNAMESPACES'; -XMLPARSE: 'XMLPARSE'; -XMLPATCH: 'XMLPATCH'; -XMLPI: 'XMLPI'; -XMLQUERYVAL: 'XMLQUERYVAL'; -XMLQUERY: 'XMLQUERY'; -XMLROOT: 'XMLROOT'; -XMLSCHEMA: 'XMLSCHEMA'; -XMLSERIALIZE: 'XMLSERIALIZE'; -XMLTABLE: 'XMLTABLE'; -XMLTRANSFORMBLOB: 'XMLTRANSFORMBLOB'; -XMLTRANSFORM: 'XMLTRANSFORM'; -XMLTYPE: 'XMLTYPE'; -XML: 'XML'; -XPATHTABLE: 'XPATHTABLE'; -XS_SYS_CONTEXT: 'XS_SYS_CONTEXT'; -XS: 'XS'; -XTRANSPORT: 'XTRANSPORT'; -YEARS: 'YEARS'; -YEAR: 'YEAR'; -YES: 'YES'; -YMINTERVAL_UNCONSTRAINED: 'YMINTERVAL_UNCONSTRAINED'; -ZONEMAP: 'ZONEMAP'; -ZONE: 'ZONE'; -PREDICTION: 'PREDICTION'; -PREDICTION_BOUNDS: 'PREDICTION_BOUNDS'; -PREDICTION_COST: 'PREDICTION_COST'; -PREDICTION_DETAILS: 'PREDICTION_DETAILS'; -PREDICTION_PROBABILITY: 'PREDICTION_PROBABILITY'; -PREDICTION_SET: 'PREDICTION_SET'; +ABORT : 'ABORT'; +ABS : 'ABS'; +ABSENT : 'ABSENT'; +ACCESS : 'ACCESS'; +ACCESSED : 'ACCESSED'; +ACCOUNT : 'ACCOUNT'; +ACL : 'ACL'; +ACOS : 'ACOS'; +ACROSS : 'ACROSS'; +ACTION : 'ACTION'; +ACTIONS : 'ACTIONS'; +ACTIVATE : 'ACTIVATE'; +ACTIVE : 'ACTIVE'; +ACTIVE_COMPONENT : 'ACTIVE_COMPONENT'; +ACTIVE_DATA : 'ACTIVE_DATA'; +ACTIVE_FUNCTION : 'ACTIVE_FUNCTION'; +ACTIVE_TAG : 'ACTIVE_TAG'; +ACTIVITY : 'ACTIVITY'; +ADAPTIVE_PLAN : 'ADAPTIVE_PLAN'; +ADD : 'ADD'; +ADD_COLUMN : 'ADD_COLUMN'; +ADD_GROUP : 'ADD_GROUP'; +ADD_MONTHS : 'ADD_MONTHS'; +ADJ_DATE : 'ADJ_DATE'; +ADMIN : 'ADMIN'; +ADMINISTER : 'ADMINISTER'; +ADMINISTRATOR : 'ADMINISTRATOR'; +ADVANCED : 'ADVANCED'; +ADVISE : 'ADVISE'; +ADVISOR : 'ADVISOR'; +AFD_DISKSTRING : 'AFD_DISKSTRING'; +AFTER : 'AFTER'; +AGENT : 'AGENT'; +AGGREGATE : 'AGGREGATE'; +A_LETTER : 'A'; +ALIAS : 'ALIAS'; +ALL : 'ALL'; +ALLOCATE : 'ALLOCATE'; +ALLOW : 'ALLOW'; +ALL_ROWS : 'ALL_ROWS'; +ALTER : 'ALTER'; +ALTERNATE : 'ALTERNATE'; +ALWAYS : 'ALWAYS'; +ANALYTIC : 'ANALYTIC'; +ANALYZE : 'ANALYZE'; +ANCESTOR : 'ANCESTOR'; +ANCILLARY : 'ANCILLARY'; +AND : 'AND'; +AND_EQUAL : 'AND_EQUAL'; +ANOMALY : 'ANOMALY'; +ANSI_REARCH : 'ANSI_REARCH'; +ANTIJOIN : 'ANTIJOIN'; +ANY : 'ANY'; +ANYSCHEMA : 'ANYSCHEMA'; +APPEND : 'APPEND'; +APPENDCHILDXML : 'APPENDCHILDXML'; +APPEND_VALUES : 'APPEND_VALUES'; +APPLICATION : 'APPLICATION'; +APPLY : 'APPLY'; +APPROX_COUNT_DISTINCT : 'APPROX_COUNT_DISTINCT'; +ARCHIVAL : 'ARCHIVAL'; +ARCHIVE : 'ARCHIVE'; +ARCHIVED : 'ARCHIVED'; +ARCHIVELOG : 'ARCHIVELOG'; +ARRAY : 'ARRAY'; +AS : 'AS'; +ASC : 'ASC'; +ASCII : 'ASCII'; +ASCIISTR : 'ASCIISTR'; +ASIN : 'ASIN'; +ASIS : 'ASIS'; +ASSEMBLY : 'ASSEMBLY'; +ASSIGN : 'ASSIGN'; +ASSOCIATE : 'ASSOCIATE'; +ASYNC : 'ASYNC'; +ASYNCHRONOUS : 'ASYNCHRONOUS'; +ATAN2 : 'ATAN2'; +ATAN : 'ATAN'; +AT : 'AT'; +ATTRIBUTE : 'ATTRIBUTE'; +ATTRIBUTES : 'ATTRIBUTES'; +AUDIT : 'AUDIT'; +AUTHENTICATED : 'AUTHENTICATED'; +AUTHENTICATION : 'AUTHENTICATION'; +AUTHID : 'AUTHID'; +AUTHORIZATION : 'AUTHORIZATION'; +AUTOALLOCATE : 'AUTOALLOCATE'; +AUTO : 'AUTO'; +AUTOBACKUP : 'AUTOBACKUP'; +AUTOEXTEND : 'AUTOEXTEND'; +AUTO_LOGIN : 'AUTO_LOGIN'; +AUTOMATIC : 'AUTOMATIC'; +AUTONOMOUS_TRANSACTION : 'AUTONOMOUS_TRANSACTION'; +AUTO_REOPTIMIZE : 'AUTO_REOPTIMIZE'; +AVAILABILITY : 'AVAILABILITY'; +AVRO : 'AVRO'; +BACKGROUND : 'BACKGROUND'; +BACKINGFILE : 'BACKINGFILE'; +BACKUP : 'BACKUP'; +BACKUPS : 'BACKUPS'; +BACKUPSET : 'BACKUPSET'; +BASIC : 'BASIC'; +BASICFILE : 'BASICFILE'; +BATCH : 'BATCH'; +BATCHSIZE : 'BATCHSIZE'; +BATCH_TABLE_ACCESS_BY_ROWID : 'BATCH_TABLE_ACCESS_BY_ROWID'; +BECOME : 'BECOME'; +BEFORE : 'BEFORE'; +BEGIN : 'BEGIN'; +BEGINNING : 'BEGINNING'; +BEGIN_OUTLINE_DATA : 'BEGIN_OUTLINE_DATA'; +BEHALF : 'BEHALF'; +BEQUEATH : 'BEQUEATH'; +BETWEEN : 'BETWEEN'; +BFILE : 'BFILE'; +BFILENAME : 'BFILENAME'; +BIGFILE : 'BIGFILE'; +BINARY : 'BINARY'; +BINARY_DOUBLE : 'BINARY_DOUBLE'; +BINARY_DOUBLE_INFINITY : 'BINARY_DOUBLE_INFINITY'; +BINARY_DOUBLE_NAN : 'BINARY_DOUBLE_NAN'; +BINARY_FLOAT : 'BINARY_FLOAT'; +BINARY_FLOAT_INFINITY : 'BINARY_FLOAT_INFINITY'; +BINARY_FLOAT_NAN : 'BINARY_FLOAT_NAN'; +BINARY_INTEGER : 'BINARY_INTEGER'; +BIND_AWARE : 'BIND_AWARE'; +BINDING : 'BINDING'; +BIN_TO_NUM : 'BIN_TO_NUM'; +BITAND : 'BITAND'; +BITMAP_AND : 'BITMAP_AND'; +BITMAP : 'BITMAP'; +BITMAPS : 'BITMAPS'; +BITMAP_TREE : 'BITMAP_TREE'; +BITS : 'BITS'; +BLOB : 'BLOB'; +BLOCK : 'BLOCK'; +BLOCK_RANGE : 'BLOCK_RANGE'; +BLOCKS : 'BLOCKS'; +BLOCKSIZE : 'BLOCKSIZE'; +BODY : 'BODY'; +BOOLEAN : 'BOOLEAN'; +BOTH : 'BOTH'; +BOUND : 'BOUND'; +BRANCH : 'BRANCH'; +BREADTH : 'BREADTH'; +BROADCAST : 'BROADCAST'; +BSON : 'BSON'; +BUFFER : 'BUFFER'; +BUFFER_CACHE : 'BUFFER_CACHE'; +BUFFER_POOL : 'BUFFER_POOL'; +BUILD : 'BUILD'; +BULK : 'BULK'; +BY : 'BY'; +BYPASS_RECURSIVE_CHECK : 'BYPASS_RECURSIVE_CHECK'; +BYPASS_UJVC : 'BYPASS_UJVC'; +BYTE : 'BYTE'; +CACHE : 'CACHE'; +CACHE_CB : 'CACHE_CB'; +CACHE_INSTANCES : 'CACHE_INSTANCES'; +CACHE_TEMP_TABLE : 'CACHE_TEMP_TABLE'; +CACHING : 'CACHING'; +CALCULATED : 'CALCULATED'; +CALLBACK : 'CALLBACK'; +CALL : 'CALL'; +CANCEL : 'CANCEL'; +CANONICAL : 'CANONICAL'; +CAPACITY : 'CAPACITY'; +CAPTION : 'CAPTION'; +CARDINALITY : 'CARDINALITY'; +CASCADE : 'CASCADE'; +CASE : 'CASE'; +CAST : 'CAST'; +CASESENSITIVE : 'CASE-SENSITIVE'; +CATEGORY : 'CATEGORY'; +CDBDEFAULT : 'CDB$DEFAULT'; +CEIL : 'CEIL'; +CELL_FLASH_CACHE : 'CELL_FLASH_CACHE'; +CERTIFICATE : 'CERTIFICATE'; +CFILE : 'CFILE'; +CHAINED : 'CHAINED'; +CHANGE : 'CHANGE'; +CHANGETRACKING : 'CHANGETRACKING'; +CHANGE_DUPKEY_ERROR_INDEX : 'CHANGE_DUPKEY_ERROR_INDEX'; +CHARACTER : 'CHARACTER'; +CHAR : 'CHAR'; +CHAR_CS : 'CHAR_CS'; +CHARTOROWID : 'CHARTOROWID'; +CHECK_ACL_REWRITE : 'CHECK_ACL_REWRITE'; +CHECK : 'CHECK'; +CHECKPOINT : 'CHECKPOINT'; +CHILD : 'CHILD'; +CHOOSE : 'CHOOSE'; +CHR : 'CHR'; +CHUNK : 'CHUNK'; +CLASS : 'CLASS'; +CLASSIFICATION : 'CLASSIFICATION'; +CLASSIFIER : 'CLASSIFIER'; +CLAUSE : 'CLAUSE'; +CLEAN : 'CLEAN'; +CLEANUP : 'CLEANUP'; +CLEAR : 'CLEAR'; +C_LETTER : 'C'; +CLIENT : 'CLIENT'; +CLOB : 'CLOB'; +CLONE : 'CLONE'; +CLOSE_CACHED_OPEN_CURSORS : 'CLOSE_CACHED_OPEN_CURSORS'; +CLOSE : 'CLOSE'; +CLUSTER_BY_ROWID : 'CLUSTER_BY_ROWID'; +CLUSTER : 'CLUSTER'; +CLUSTER_DETAILS : 'CLUSTER_DETAILS'; +CLUSTER_DISTANCE : 'CLUSTER_DISTANCE'; +CLUSTER_ID : 'CLUSTER_ID'; +CLUSTERING : 'CLUSTERING'; +CLUSTERING_FACTOR : 'CLUSTERING_FACTOR'; +CLUSTER_PROBABILITY : 'CLUSTER_PROBABILITY'; +CLUSTER_SET : 'CLUSTER_SET'; +COALESCE : 'COALESCE'; +COALESCE_SQ : 'COALESCE_SQ'; +COARSE : 'COARSE'; +CO_AUTH_IND : 'CO_AUTH_IND'; +COLD : 'COLD'; +COLLECT : 'COLLECT'; +COLUMNAR : 'COLUMNAR'; +COLUMN_AUTH_INDICATOR : 'COLUMN_AUTH_INDICATOR'; +COLUMN : 'COLUMN'; +COLUMNS : 'COLUMNS'; +COLUMN_STATS : 'COLUMN_STATS'; +COLUMN_VALUE : 'COLUMN_VALUE'; +COMMENT : 'COMMENT'; +COMMIT : 'COMMIT'; +COMMITTED : 'COMMITTED'; +COMMON : 'COMMON'; +COMMON_DATA : 'COMMON_DATA'; +COMPACT : 'COMPACT'; +COMPATIBILITY : 'COMPATIBILITY'; +COMPILE : 'COMPILE'; +COMPLETE : 'COMPLETE'; +COMPLIANCE : 'COMPLIANCE'; +COMPONENT : 'COMPONENT'; +COMPONENTS : 'COMPONENTS'; +COMPOSE : 'COMPOSE'; +COMPOSITE : 'COMPOSITE'; +COMPOSITE_LIMIT : 'COMPOSITE_LIMIT'; +COMPOUND : 'COMPOUND'; +COMPRESS : 'COMPRESS'; +COMPUTE : 'COMPUTE'; +CONCAT : 'CONCAT'; +CON_DBID_TO_ID : 'CON_DBID_TO_ID'; +CONDITIONAL : 'CONDITIONAL'; +CONDITION : 'CONDITION'; +CONFIRM : 'CONFIRM'; +CONFORMING : 'CONFORMING'; +CON_GUID_TO_ID : 'CON_GUID_TO_ID'; +CON_ID : 'CON_ID'; +CON_NAME_TO_ID : 'CON_NAME_TO_ID'; +CONNECT_BY_CB_WHR_ONLY : 'CONNECT_BY_CB_WHR_ONLY'; +CONNECT_BY_COMBINE_SW : 'CONNECT_BY_COMBINE_SW'; +CONNECT_BY_COST_BASED : 'CONNECT_BY_COST_BASED'; +CONNECT_BY_ELIM_DUPS : 'CONNECT_BY_ELIM_DUPS'; +CONNECT_BY_FILTERING : 'CONNECT_BY_FILTERING'; +CONNECT_BY_ISCYCLE : 'CONNECT_BY_ISCYCLE'; +CONNECT_BY_ISLEAF : 'CONNECT_BY_ISLEAF'; +CONNECT_BY_ROOT : 'CONNECT_BY_ROOT'; +CONNECT : 'CONNECT'; +CONNECT_TIME : 'CONNECT_TIME'; +CONSIDER : 'CONSIDER'; +CONSISTENT : 'CONSISTENT'; +CONSTANT : 'CONSTANT'; +CONST : 'CONST'; +CONSTRAINT : 'CONSTRAINT'; +CONSTRAINTS : 'CONSTRAINTS'; +CONSTRUCTOR : 'CONSTRUCTOR'; +CONTAINER : 'CONTAINER'; +CONTAINERS : 'CONTAINERS'; +CONTAINERS_DEFAULT : 'CONTAINERS_DEFAULT'; +CONTAINER_DATA : 'CONTAINER_DATA'; +CONTAINER_MAP : 'CONTAINER_MAP'; +CONTENT : 'CONTENT'; +CONTENTS : 'CONTENTS'; +CONTEXT : 'CONTEXT'; +CONTINUE : 'CONTINUE'; +CONTROLFILE : 'CONTROLFILE'; +CON_UID_TO_ID : 'CON_UID_TO_ID'; +CONVERT : 'CONVERT'; +CONVERSION : 'CONVERSION'; +COOKIE : 'COOKIE'; +COPY : 'COPY'; +CORR_K : 'CORR_K'; +CORR_S : 'CORR_S'; +CORRUPTION : 'CORRUPTION'; +CORRUPT_XID_ALL : 'CORRUPT_XID_ALL'; +CORRUPT_XID : 'CORRUPT_XID'; +COS : 'COS'; +COSH : 'COSH'; +COST : 'COST'; +COST_XML_QUERY_REWRITE : 'COST_XML_QUERY_REWRITE'; +COUNT : 'COUNT'; +COVAR_POP : 'COVAR_POP'; +COVAR_SAMP : 'COVAR_SAMP'; +CPU_COSTING : 'CPU_COSTING'; +CPU_PER_CALL : 'CPU_PER_CALL'; +CPU_PER_SESSION : 'CPU_PER_SESSION'; +CRASH : 'CRASH'; +CREATE : 'CREATE'; +CREATE_FILE_DEST : 'CREATE_FILE_DEST'; +CREATE_STORED_OUTLINES : 'CREATE_STORED_OUTLINES'; +CREATION : 'CREATION'; +CREDENTIAL : 'CREDENTIAL'; +CRITICAL : 'CRITICAL'; +CROSS : 'CROSS'; +CROSSEDITION : 'CROSSEDITION'; +CSCONVERT : 'CSCONVERT'; +CUBE_AJ : 'CUBE_AJ'; +CUBE : 'CUBE'; +CUBE_GB : 'CUBE_GB'; +CUBE_SJ : 'CUBE_SJ'; +CUME_DISTM : 'CUME_DISTM'; +CURRENT : 'CURRENT'; +CURRENT_DATE : 'CURRENT_DATE'; +CURRENT_SCHEMA : 'CURRENT_SCHEMA'; +CURRENT_TIME : 'CURRENT_TIME'; +CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; +CURRENT_USER : 'CURRENT_USER'; +CURRENTV : 'CURRENTV'; +CURSOR : 'CURSOR'; +CURSOR_SHARING_EXACT : 'CURSOR_SHARING_EXACT'; +CURSOR_SPECIFIC_SEGMENT : 'CURSOR_SPECIFIC_SEGMENT'; +CUSTOMDATUM : 'CUSTOMDATUM'; +CV : 'CV'; +CYCLE : 'CYCLE'; +DANGLING : 'DANGLING'; +DATABASE : 'DATABASE'; +DATA : 'DATA'; +DATAFILE : 'DATAFILE'; +DATAFILES : 'DATAFILES'; +DATAGUARDCONFIG : 'DATAGUARDCONFIG'; +DATAMOVEMENT : 'DATAMOVEMENT'; +DATAOBJNO : 'DATAOBJNO'; +DATAOBJ_TO_MAT_PARTITION : 'DATAOBJ_TO_MAT_PARTITION'; +DATAOBJ_TO_PARTITION : 'DATAOBJ_TO_PARTITION'; +DATAPUMP : 'DATAPUMP'; +DATA_SECURITY_REWRITE_LIMIT : 'DATA_SECURITY_REWRITE_LIMIT'; +DATE : 'DATE'; +DATE_MODE : 'DATE_MODE'; +DAY : 'DAY'; +DAYS : 'DAYS'; +DBA : 'DBA'; +DBA_RECYCLEBIN : 'DBA_RECYCLEBIN'; +DBMS_STATS : 'DBMS_STATS'; +DB_ROLE_CHANGE : 'DB_ROLE_CHANGE'; +DBTIMEZONE : 'DBTIMEZONE'; +DB_UNIQUE_NAME : 'DB_UNIQUE_NAME'; +DB_VERSION : 'DB_VERSION'; +DDL : 'DDL'; +DEALLOCATE : 'DEALLOCATE'; +DEBUG : 'DEBUG'; +DEBUGGER : 'DEBUGGER'; +DEC : 'DEC'; +DECIMAL : 'DECIMAL'; +DECLARE : 'DECLARE'; +DECOMPOSE : 'DECOMPOSE'; +DECORRELATE : 'DECORRELATE'; +DECR : 'DECR'; +DECREMENT : 'DECREMENT'; +DECRYPT : 'DECRYPT'; +DEDUPLICATE : 'DEDUPLICATE'; +DEFAULT : 'DEFAULT'; +DEFAULTS : 'DEFAULTS'; +DEFAULT_COLLATION : 'DEFAULT_COLLATION'; +DEFAULT_CREDENTIAL : 'DEFAULT_CREDENTIAL'; +DEFERRABLE : 'DEFERRABLE'; +DEFERRED : 'DEFERRED'; +DEFINED : 'DEFINED'; +DEFINE : 'DEFINE'; +DEFINER : 'DEFINER'; +DEGREE : 'DEGREE'; +DELAY : 'DELAY'; +DELEGATE : 'DELEGATE'; +DELETE_ALL : 'DELETE_ALL'; +DELETE : 'DELETE'; +DELETEXML : 'DELETEXML'; +DEMAND : 'DEMAND'; +DENSE_RANKM : 'DENSE_RANKM'; +DEPENDENT : 'DEPENDENT'; +DEPTH : 'DEPTH'; +DEQUEUE : 'DEQUEUE'; +DEREF : 'DEREF'; +DEREF_NO_REWRITE : 'DEREF_NO_REWRITE'; +DESC : 'DESC'; +DESCRIPTION : 'DESCRIPTION'; +DESTROY : 'DESTROY'; +DETACHED : 'DETACHED'; +DETERMINES : 'DETERMINES'; +DETERMINISTIC : 'DETERMINISTIC'; +DICTIONARY : 'DICTIONARY'; +DIMENSION : 'DIMENSION'; +DIMENSIONS : 'DIMENSIONS'; +DIRECT_LOAD : 'DIRECT_LOAD'; +DIRECTORY : 'DIRECTORY'; +DIRECT_PATH : 'DIRECT_PATH'; +DISABLE_ALL : 'DISABLE_ALL'; +DISABLE : 'DISABLE'; +DISABLE_PARALLEL_DML : 'DISABLE_PARALLEL_DML'; +DISABLE_PRESET : 'DISABLE_PRESET'; +DISABLE_RPKE : 'DISABLE_RPKE'; +DISALLOW : 'DISALLOW'; +DISASSOCIATE : 'DISASSOCIATE'; +DISCARD : 'DISCARD'; +DISCONNECT : 'DISCONNECT'; +DISK : 'DISK'; +DISKGROUP : 'DISKGROUP'; +DISKGROUP_PLUS : '\'+ DISKGROUP'; +DISKS : 'DISKS'; +DISMOUNT : 'DISMOUNT'; +DISTINCT : 'DISTINCT'; +DISTINGUISHED : 'DISTINGUISHED'; +DISTRIBUTED : 'DISTRIBUTED'; +DISTRIBUTE : 'DISTRIBUTE'; +DML : 'DML'; +DML_UPDATE : 'DML_UPDATE'; +DOCFIDELITY : 'DOCFIDELITY'; +DOCUMENT : 'DOCUMENT'; +DOMAIN_INDEX_FILTER : 'DOMAIN_INDEX_FILTER'; +DOMAIN_INDEX_NO_SORT : 'DOMAIN_INDEX_NO_SORT'; +DOMAIN_INDEX_SORT : 'DOMAIN_INDEX_SORT'; +DOUBLE : 'DOUBLE'; +DOWNGRADE : 'DOWNGRADE'; +DRIVING_SITE : 'DRIVING_SITE'; +DROP_COLUMN : 'DROP_COLUMN'; +DROP : 'DROP'; +DROP_GROUP : 'DROP_GROUP'; +DSINTERVAL_UNCONSTRAINED : 'DSINTERVAL_UNCONSTRAINED'; +DST_UPGRADE_INSERT_CONV : 'DST_UPGRADE_INSERT_CONV'; +DUMP : 'DUMP'; +DUMPSET : 'DUMPSET'; +DUPLICATE : 'DUPLICATE'; +DV : 'DV'; +DYNAMIC : 'DYNAMIC'; +DYNAMIC_SAMPLING : 'DYNAMIC_SAMPLING'; +DYNAMIC_SAMPLING_EST_CDN : 'DYNAMIC_SAMPLING_EST_CDN'; +E_LETTER : 'E'; +EACH : 'EACH'; +EDITIONABLE : 'EDITIONABLE'; +EDITION : 'EDITION'; +EDITIONING : 'EDITIONING'; +EDITIONS : 'EDITIONS'; +ELEMENT : 'ELEMENT'; +ELIM_GROUPBY : 'ELIM_GROUPBY'; +ELIMINATE_JOIN : 'ELIMINATE_JOIN'; +ELIMINATE_OBY : 'ELIMINATE_OBY'; +ELIMINATE_OUTER_JOIN : 'ELIMINATE_OUTER_JOIN'; +ELSE : 'ELSE'; +ELSIF : 'ELSIF'; +EM : 'EM'; +EMPTY_BLOB : 'EMPTY_BLOB'; +EMPTY_CLOB : 'EMPTY_CLOB'; +EMPTY : 'EMPTY'; +ENABLE_ALL : 'ENABLE_ALL'; +ENABLE : 'ENABLE'; +ENABLE_PARALLEL_DML : 'ENABLE_PARALLEL_DML'; +ENABLE_PRESET : 'ENABLE_PRESET'; +ENCODING : 'ENCODING'; +ENCRYPT : 'ENCRYPT'; +ENCRYPTION : 'ENCRYPTION'; +END : 'END'; +END_OUTLINE_DATA : 'END_OUTLINE_DATA'; +ENFORCED : 'ENFORCED'; +ENFORCE : 'ENFORCE'; +ENQUEUE : 'ENQUEUE'; +ENTERPRISE : 'ENTERPRISE'; +ENTITYESCAPING : 'ENTITYESCAPING'; +ENTRY : 'ENTRY'; +EQUIPART : 'EQUIPART'; +ERR : 'ERR'; +ERROR_ARGUMENT : 'ERROR_ARGUMENT'; +ERROR : 'ERROR'; +ERROR_ON_OVERLAP_TIME : 'ERROR_ON_OVERLAP_TIME'; +ERRORS : 'ERRORS'; +ESCAPE : 'ESCAPE'; +ESTIMATE : 'ESTIMATE'; +EVAL : 'EVAL'; +EVALNAME : 'EVALNAME'; +EVALUATE : 'EVALUATE'; +EVALUATION : 'EVALUATION'; +EVENTS : 'EVENTS'; +EVERY : 'EVERY'; +EXCEPT : 'EXCEPT'; +EXCEPTION : 'EXCEPTION'; +EXCEPTION_INIT : 'EXCEPTION_INIT'; +EXCEPTIONS : 'EXCEPTIONS'; +EXCHANGE : 'EXCHANGE'; +EXCLUDE : 'EXCLUDE'; +EXCLUDING : 'EXCLUDING'; +EXCLUSIVE : 'EXCLUSIVE'; +EXECUTE : 'EXECUTE'; +EXEMPT : 'EXEMPT'; +EXISTING : 'EXISTING'; +EXISTS : 'EXISTS'; +EXISTSNODE : 'EXISTSNODE'; +EXIT : 'EXIT'; +EXPAND_GSET_TO_UNION : 'EXPAND_GSET_TO_UNION'; +EXPAND_TABLE : 'EXPAND_TABLE'; +EXP : 'EXP'; +EXPIRE : 'EXPIRE'; +EXPLAIN : 'EXPLAIN'; +EXPLOSION : 'EXPLOSION'; +EXPORT : 'EXPORT'; +EXPR_CORR_CHECK : 'EXPR_CORR_CHECK'; +EXPRESS : 'EXPRESS'; +EXTENDS : 'EXTENDS'; +EXTENT : 'EXTENT'; +EXTENTS : 'EXTENTS'; +EXTERNAL : 'EXTERNAL'; +EXTERNALLY : 'EXTERNALLY'; +EXTRACTCLOBXML : 'EXTRACTCLOBXML'; +EXTRACT : 'EXTRACT'; +EXTRACTVALUE : 'EXTRACTVALUE'; +EXTRA : 'EXTRA'; +FACILITY : 'FACILITY'; +FACT : 'FACT'; +FACTOR : 'FACTOR'; +FACTORIZE_JOIN : 'FACTORIZE_JOIN'; +FAILED : 'FAILED'; +FAILED_LOGIN_ATTEMPTS : 'FAILED_LOGIN_ATTEMPTS'; +FAILGROUP : 'FAILGROUP'; +FAILOVER : 'FAILOVER'; +FAILURE : 'FAILURE'; +FALSE : 'FALSE'; +FAMILY : 'FAMILY'; +FAR : 'FAR'; +FAST : 'FAST'; +FASTSTART : 'FASTSTART'; +FBTSCAN : 'FBTSCAN'; +FEATURE : 'FEATURE'; +FEATURE_DETAILS : 'FEATURE_DETAILS'; +FEATURE_ID : 'FEATURE_ID'; +FEATURE_SET : 'FEATURE_SET'; +FEATURE_VALUE : 'FEATURE_VALUE'; +FETCH : 'FETCH'; +FILE : 'FILE'; +FILE_NAME_CONVERT : 'FILE_NAME_CONVERT'; +FILEGROUP : 'FILEGROUP'; +FILESTORE : 'FILESTORE'; +FILESYSTEM_LIKE_LOGGING : 'FILESYSTEM_LIKE_LOGGING'; +FILTER : 'FILTER'; +FINAL : 'FINAL'; +FINE : 'FINE'; +FINISH : 'FINISH'; +FIRST : 'FIRST'; +FIRSTM : 'FIRSTM'; +FIRST_ROWS : 'FIRST_ROWS'; +FIRST_VALUE : 'FIRST_VALUE'; +FIXED_VIEW_DATA : 'FIXED_VIEW_DATA'; +FLAGGER : 'FLAGGER'; +FLASHBACK : 'FLASHBACK'; +FLASH_CACHE : 'FLASH_CACHE'; +FLOAT : 'FLOAT'; +FLOB : 'FLOB'; +FLEX : 'FLEX'; +FLOOR : 'FLOOR'; +FLUSH : 'FLUSH'; +FOLDER : 'FOLDER'; +FOLLOWING : 'FOLLOWING'; +FOLLOWS : 'FOLLOWS'; +FORALL : 'FORALL'; +FORCE : 'FORCE'; +FORCE_XML_QUERY_REWRITE : 'FORCE_XML_QUERY_REWRITE'; +FOREIGN : 'FOREIGN'; +FOREVER : 'FOREVER'; +FOR : 'FOR'; +FORMAT : 'FORMAT'; +FORWARD : 'FORWARD'; +FRAGMENT_NUMBER : 'FRAGMENT_NUMBER'; +FREELIST : 'FREELIST'; +FREELISTS : 'FREELISTS'; +FREEPOOLS : 'FREEPOOLS'; +FRESH : 'FRESH'; +FROM : 'FROM'; +FROM_TZ : 'FROM_TZ'; +FULL : 'FULL'; +FULL_OUTER_JOIN_TO_OUTER : 'FULL_OUTER_JOIN_TO_OUTER'; +FUNCTION : 'FUNCTION'; +FUNCTIONS : 'FUNCTIONS'; +FTP : 'FTP'; +G_LETTER : 'G'; +GATHER_OPTIMIZER_STATISTICS : 'GATHER_OPTIMIZER_STATISTICS'; +GATHER_PLAN_STATISTICS : 'GATHER_PLAN_STATISTICS'; +GBY_CONC_ROLLUP : 'GBY_CONC_ROLLUP'; +GBY_PUSHDOWN : 'GBY_PUSHDOWN'; +GENERATED : 'GENERATED'; +GET : 'GET'; +GLOBAL : 'GLOBAL'; +GLOBALLY : 'GLOBALLY'; +GLOBAL_NAME : 'GLOBAL_NAME'; +GLOBAL_TOPIC_ENABLED : 'GLOBAL_TOPIC_ENABLED'; +GOTO : 'GOTO'; +GRANT : 'GRANT'; +GROUP_BY : 'GROUP_BY'; +GROUP : 'GROUP'; +GROUP_ID : 'GROUP_ID'; +GROUPING : 'GROUPING'; +GROUPING_ID : 'GROUPING_ID'; +GROUPS : 'GROUPS'; +GUARANTEED : 'GUARANTEED'; +GUARANTEE : 'GUARANTEE'; +GUARD : 'GUARD'; +HALF_YEARS : 'HALF_YEARS'; +HASH_AJ : 'HASH_AJ'; +HASH : 'HASH'; +HASHKEYS : 'HASHKEYS'; +HASH_SJ : 'HASH_SJ'; +HAVING : 'HAVING'; +HEADER : 'HEADER'; +HEAP : 'HEAP'; +HELP : 'HELP'; +HEXTORAW : 'HEXTORAW'; +HEXTOREF : 'HEXTOREF'; +HIDDEN_KEYWORD : 'HIDDEN'; +HIDE : 'HIDE'; +HIER_ORDER : 'HIER_ORDER'; +HIERARCHICAL : 'HIERARCHICAL'; +HIERARCHIES : 'HIERARCHIES'; +HIERARCHY : 'HIERARCHY'; +HIGH : 'HIGH'; +HINTSET_BEGIN : 'HINTSET_BEGIN'; +HINTSET_END : 'HINTSET_END'; +HOT : 'HOT'; +HOUR : 'HOUR'; +HOURS : 'HOURS'; +HTTP : 'HTTP'; +HWM_BROKERED : 'HWM_BROKERED'; +HYBRID : 'HYBRID'; +H_LETTER : 'H'; +IDENTIFIED : 'IDENTIFIED'; +IDENTIFIER : 'IDENTIFIER'; +IDENTITY : 'IDENTITY'; +IDGENERATORS : 'IDGENERATORS'; +ID : 'ID'; +IDLE_TIME : 'IDLE_TIME'; +IF : 'IF'; +IGNORE : 'IGNORE'; +IGNORE_OPTIM_EMBEDDED_HINTS : 'IGNORE_OPTIM_EMBEDDED_HINTS'; +IGNORE_ROW_ON_DUPKEY_INDEX : 'IGNORE_ROW_ON_DUPKEY_INDEX'; +IGNORE_WHERE_CLAUSE : 'IGNORE_WHERE_CLAUSE'; +ILM : 'ILM'; +IMMEDIATE : 'IMMEDIATE'; +IMPACT : 'IMPACT'; +IMPORT : 'IMPORT'; +INACTIVE : 'INACTIVE'; +INACTIVE_ACCOUNT_TIME : 'INACTIVE_ACCOUNT_TIME'; +INCLUDE : 'INCLUDE'; +INCLUDE_VERSION : 'INCLUDE_VERSION'; +INCLUDING : 'INCLUDING'; +INCREMENTAL : 'INCREMENTAL'; +INCREMENT : 'INCREMENT'; +INCR : 'INCR'; +INDENT : 'INDENT'; +INDEX_ASC : 'INDEX_ASC'; +INDEX_COMBINE : 'INDEX_COMBINE'; +INDEX_DESC : 'INDEX_DESC'; +INDEXED : 'INDEXED'; +INDEXES : 'INDEXES'; +INDEX_FFS : 'INDEX_FFS'; +INDEX_FILTER : 'INDEX_FILTER'; +INDEX : 'INDEX'; +INDEXING : 'INDEXING'; +INDEX_JOIN : 'INDEX_JOIN'; +INDEX_ROWS : 'INDEX_ROWS'; +INDEX_RRS : 'INDEX_RRS'; +INDEX_RS_ASC : 'INDEX_RS_ASC'; +INDEX_RS_DESC : 'INDEX_RS_DESC'; +INDEX_RS : 'INDEX_RS'; +INDEX_SCAN : 'INDEX_SCAN'; +INDEX_SKIP_SCAN : 'INDEX_SKIP_SCAN'; +INDEX_SS_ASC : 'INDEX_SS_ASC'; +INDEX_SS_DESC : 'INDEX_SS_DESC'; +INDEX_SS : 'INDEX_SS'; +INDEX_STATS : 'INDEX_STATS'; +INDEXTYPE : 'INDEXTYPE'; +INDEXTYPES : 'INDEXTYPES'; +INDICATOR : 'INDICATOR'; +INDICES : 'INDICES'; +INFINITE : 'INFINITE'; +INFORMATIONAL : 'INFORMATIONAL'; +INHERIT : 'INHERIT'; +IN : 'IN'; +INITCAP : 'INITCAP'; +INITIAL : 'INITIAL'; +INITIALIZED : 'INITIALIZED'; +INITIALLY : 'INITIALLY'; +INITRANS : 'INITRANS'; +INLINE : 'INLINE'; +INLINE_XMLTYPE_NT : 'INLINE_XMLTYPE_NT'; +INMEMORY : 'INMEMORY'; +IN_MEMORY_METADATA : 'IN_MEMORY_METADATA'; +INMEMORY_PRUNING : 'INMEMORY_PRUNING'; +INNER : 'INNER'; +INOUT : 'INOUT'; +INPLACE : 'INPLACE'; +INSERTCHILDXMLAFTER : 'INSERTCHILDXMLAFTER'; +INSERTCHILDXMLBEFORE : 'INSERTCHILDXMLBEFORE'; +INSERTCHILDXML : 'INSERTCHILDXML'; +INSERT : 'INSERT'; +INSERTXMLAFTER : 'INSERTXMLAFTER'; +INSERTXMLBEFORE : 'INSERTXMLBEFORE'; +INSTANCE : 'INSTANCE'; +INSTANCES : 'INSTANCES'; +INSTANTIABLE : 'INSTANTIABLE'; +INSTANTLY : 'INSTANTLY'; +INSTEAD : 'INSTEAD'; +INSTR2 : 'INSTR2'; +INSTR4 : 'INSTR4'; +INSTRB : 'INSTRB'; +INSTRC : 'INSTRC'; +INSTR : 'INSTR'; +INTEGER : 'INTEGER'; +INTERLEAVED : 'INTERLEAVED'; +INTERMEDIATE : 'INTERMEDIATE'; +INTERNAL_CONVERT : 'INTERNAL_CONVERT'; +INTERNAL_USE : 'INTERNAL_USE'; +INTERPRETED : 'INTERPRETED'; +INTERSECT : 'INTERSECT'; +INTERVAL : 'INTERVAL'; +INT : 'INT'; +INTO : 'INTO'; +INVALIDATE : 'INVALIDATE'; +INVISIBLE : 'INVISIBLE'; +IN_XQUERY : 'IN_XQUERY'; +IS : 'IS'; +IS_LEAF : 'IS_LEAF'; +ISOLATION : 'ISOLATION'; +ISOLATION_LEVEL : 'ISOLATION_LEVEL'; +ITERATE : 'ITERATE'; +ITERATION_NUMBER : 'ITERATION_NUMBER'; +JAVA : 'JAVA'; +JOB : 'JOB'; +JOIN : 'JOIN'; +JSON_ARRAYAGG : 'JSON_ARRAYAGG'; +JSON_ARRAY : 'JSON_ARRAY'; +JSON_EQUAL : 'JSON_EQUAL'; +JSON_EXISTS2 : 'JSON_EXISTS2'; +JSON_EXISTS : 'JSON_EXISTS'; +JSONGET : 'JSONGET'; +JSON : 'JSON'; +JSON_OBJECTAGG : 'JSON_OBJECTAGG'; +JSON_OBJECT : 'JSON_OBJECT'; +JSONPARSE : 'JSONPARSE'; +JSON_QUERY : 'JSON_QUERY'; +JSON_SERIALIZE : 'JSON_SERIALIZE'; +JSON_TABLE : 'JSON_TABLE'; +JSON_TEXTCONTAINS2 : 'JSON_TEXTCONTAINS2'; +JSON_TEXTCONTAINS : 'JSON_TEXTCONTAINS'; +JSON_TRANSFORM : 'JSON_TRANSFORM'; +JSON_VALUE : 'JSON_VALUE'; +K_LETTER : 'K'; +KEEP_DUPLICATES : 'KEEP_DUPLICATES'; +KEEP : 'KEEP'; +KERBEROS : 'KERBEROS'; +KEY : 'KEY'; +KEY_LENGTH : 'KEY_LENGTH'; +KEYSIZE : 'KEYSIZE'; +KEYS : 'KEYS'; +KEYSTORE : 'KEYSTORE'; +KILL : 'KILL'; +LABEL : 'LABEL'; +LANGUAGE : 'LANGUAGE'; +LAST_DAY : 'LAST_DAY'; +LAST : 'LAST'; +LAST_VALUE : 'LAST_VALUE'; +LATERAL : 'LATERAL'; +LAX : 'LAX'; +LAYER : 'LAYER'; +LDAP_REGISTRATION_ENABLED : 'LDAP_REGISTRATION_ENABLED'; +LDAP_REGISTRATION : 'LDAP_REGISTRATION'; +LDAP_REG_SYNC_INTERVAL : 'LDAP_REG_SYNC_INTERVAL'; +LEAF : 'LEAF'; +LEAD_CDB : 'LEAD_CDB'; +LEAD_CDB_URI : 'LEAD_CDB_URI'; +LEADING : 'LEADING'; +LEFT : 'LEFT'; +LENGTH2 : 'LENGTH2'; +LENGTH4 : 'LENGTH4'; +LENGTHB : 'LENGTHB'; +LENGTHC : 'LENGTHC'; +LENGTH : 'LENGTH'; +LESS : 'LESS'; +LEVEL : 'LEVEL'; +LEVEL_NAME : 'LEVEL_NAME'; +LEVELS : 'LEVELS'; +LIBRARY : 'LIBRARY'; +LIFECYCLE : 'LIFECYCLE'; +LIFE : 'LIFE'; +LIFETIME : 'LIFETIME'; +LIKE2 : 'LIKE2'; +LIKE4 : 'LIKE4'; +LIKEC : 'LIKEC'; +LIKE_EXPAND : 'LIKE_EXPAND'; +LIKE : 'LIKE'; +LIMIT : 'LIMIT'; +LINEAR : 'LINEAR'; +LINK : 'LINK'; +LIST : 'LIST'; +LN : 'LN'; +LNNVL : 'LNNVL'; +LOAD : 'LOAD'; +LOB : 'LOB'; +LOBNVL : 'LOBNVL'; +LOBS : 'LOBS'; +LOCAL_INDEXES : 'LOCAL_INDEXES'; +LOCAL : 'LOCAL'; +LOCALTIME : 'LOCALTIME'; +LOCALTIMESTAMP : 'LOCALTIMESTAMP'; +LOCATION : 'LOCATION'; +LOCATOR : 'LOCATOR'; +LOCKDOWN : 'LOCKDOWN'; +LOCKED : 'LOCKED'; +LOCKING : 'LOCKING'; +LOCK : 'LOCK'; +LOGFILE : 'LOGFILE'; +LOGFILES : 'LOGFILES'; +LOGGING : 'LOGGING'; +LOGICAL : 'LOGICAL'; +LOGICAL_READS_PER_CALL : 'LOGICAL_READS_PER_CALL'; +LOGICAL_READS_PER_SESSION : 'LOGICAL_READS_PER_SESSION'; +LOG : 'LOG'; +LOGMINING : 'LOGMINING'; +LOGOFF : 'LOGOFF'; +LOGON : 'LOGON'; +LOG_READ_ONLY_VIOLATIONS : 'LOG_READ_ONLY_VIOLATIONS'; +LONG : 'LONG'; +LOOP : 'LOOP'; +LOST : 'LOST'; +LOWER : 'LOWER'; +LOW : 'LOW'; +LPAD : 'LPAD'; +LTRIM : 'LTRIM'; +M_LETTER : 'M'; +MAIN : 'MAIN'; +MAKE_REF : 'MAKE_REF'; +MANAGED : 'MANAGED'; +MANAGE : 'MANAGE'; +MANAGEMENT : 'MANAGEMENT'; +MANAGER : 'MANAGER'; +MANDATORY : 'MANDATORY'; +MANUAL : 'MANUAL'; +MAP : 'MAP'; +MAPPING : 'MAPPING'; +MASTER : 'MASTER'; +MATCHED : 'MATCHED'; +MATCHES : 'MATCHES'; +MATCH : 'MATCH'; +MATCH_NUMBER : 'MATCH_NUMBER'; +MATCH_RECOGNIZE : 'MATCH_RECOGNIZE'; +MATERIALIZED : 'MATERIALIZED'; +MATERIALIZE : 'MATERIALIZE'; +MAXARCHLOGS : 'MAXARCHLOGS'; +MAXDATAFILES : 'MAXDATAFILES'; +MAXEXTENTS : 'MAXEXTENTS'; +MAXIMIZE : 'MAXIMIZE'; +MAXINSTANCES : 'MAXINSTANCES'; +MAXLOGFILES : 'MAXLOGFILES'; +MAXLOGHISTORY : 'MAXLOGHISTORY'; +MAXLOGMEMBERS : 'MAXLOGMEMBERS'; +MAX_SHARED_TEMP_SIZE : 'MAX_SHARED_TEMP_SIZE'; +MAXSIZE : 'MAXSIZE'; +MAXTRANS : 'MAXTRANS'; +MAXVALUE : 'MAXVALUE'; +MEASURE : 'MEASURE'; +MEASURES : 'MEASURES'; +MEDIUM : 'MEDIUM'; +MEMBER : 'MEMBER'; +MEMBER_CAPTION : 'MEMBER_CAPTION'; +MEMBER_DESCRIPTION : 'MEMBER_DESCRIPTION'; +MEMBER_NAME : 'MEMBER_NAME'; +MEMBER_UNIQUE_NAME : 'MEMBER_UNIQUE_NAME'; +MEMCOMPRESS : 'MEMCOMPRESS'; +MEMORY : 'MEMORY'; +MERGEACTIONS : 'MERGE$ACTIONS'; +MERGE_AJ : 'MERGE_AJ'; +MERGE_CONST_ON : 'MERGE_CONST_ON'; +MERGE : 'MERGE'; +MERGE_SJ : 'MERGE_SJ'; +METADATA : 'METADATA'; +METHOD : 'METHOD'; +MIGRATE : 'MIGRATE'; +MIGRATION : 'MIGRATION'; +MINEXTENTS : 'MINEXTENTS'; +MINIMIZE : 'MINIMIZE'; +MINIMUM : 'MINIMUM'; +MINING : 'MINING'; +MINUS : 'MINUS'; +MINUS_NULL : 'MINUS_NULL'; +MINUTE : 'MINUTE'; +MINUTES : 'MINUTES'; +MINVALUE : 'MINVALUE'; +MIRRORCOLD : 'MIRRORCOLD'; +MIRRORHOT : 'MIRRORHOT'; +MIRROR : 'MIRROR'; +MISSING : 'MISSING'; +MISMATCH : 'MISMATCH'; +MLSLABEL : 'MLSLABEL'; +MODEL_COMPILE_SUBQUERY : 'MODEL_COMPILE_SUBQUERY'; +MODEL_DONTVERIFY_UNIQUENESS : 'MODEL_DONTVERIFY_UNIQUENESS'; +MODEL_DYNAMIC_SUBQUERY : 'MODEL_DYNAMIC_SUBQUERY'; +MODEL_MIN_ANALYSIS : 'MODEL_MIN_ANALYSIS'; +MODEL : 'MODEL'; +MODEL_NB : 'MODEL_NB'; +MODEL_NO_ANALYSIS : 'MODEL_NO_ANALYSIS'; +MODEL_PBY : 'MODEL_PBY'; +MODEL_PUSH_REF : 'MODEL_PUSH_REF'; +MODEL_SV : 'MODEL_SV'; +MODE : 'MODE'; +MODIFICATION : 'MODIFICATION'; +MODIFY_COLUMN_TYPE : 'MODIFY_COLUMN_TYPE'; +MODIFY : 'MODIFY'; +MOD : 'MOD'; +MODULE : 'MODULE'; +MONITORING : 'MONITORING'; +MONITOR : 'MONITOR'; +MONTH : 'MONTH'; +MONTHS_BETWEEN : 'MONTHS_BETWEEN'; +MONTHS : 'MONTHS'; +MOUNT : 'MOUNT'; +MOUNTPATH : 'MOUNTPATH'; +MOUNTPOINT : 'MOUNTPOINT'; +MOVEMENT : 'MOVEMENT'; +MOVE : 'MOVE'; +MULTIDIMENSIONAL : 'MULTIDIMENSIONAL'; +MULTISET : 'MULTISET'; +MV_MERGE : 'MV_MERGE'; +NAMED : 'NAMED'; +NAME : 'NAME'; +NAMESPACE : 'NAMESPACE'; +NAN : 'NAN'; +NANVL : 'NANVL'; +NATIONAL : 'NATIONAL'; +NATIVE_FULL_OUTER_JOIN : 'NATIVE_FULL_OUTER_JOIN'; +NATIVE : 'NATIVE'; +NATURAL : 'NATURAL'; +NATURALN : 'NATURALN'; +NAV : 'NAV'; +NCHAR_CS : 'NCHAR_CS'; +NCHAR : 'NCHAR'; +NCHR : 'NCHR'; +NCLOB : 'NCLOB'; +NEEDED : 'NEEDED'; +NEG : 'NEG'; +NESTED : 'NESTED'; +NESTED_TABLE_FAST_INSERT : 'NESTED_TABLE_FAST_INSERT'; +NESTED_TABLE_GET_REFS : 'NESTED_TABLE_GET_REFS'; +NESTED_TABLE_ID : 'NESTED_TABLE_ID'; +NESTED_TABLE_SET_REFS : 'NESTED_TABLE_SET_REFS'; +NESTED_TABLE_SET_SETID : 'NESTED_TABLE_SET_SETID'; +NETWORK : 'NETWORK'; +NEVER : 'NEVER'; +NEW : 'NEW'; +NEW_TIME : 'NEW_TIME'; +NEXT_DAY : 'NEXT_DAY'; +NEXT : 'NEXT'; +NL_AJ : 'NL_AJ'; +NLJ_BATCHING : 'NLJ_BATCHING'; +NLJ_INDEX_FILTER : 'NLJ_INDEX_FILTER'; +NLJ_INDEX_SCAN : 'NLJ_INDEX_SCAN'; +NLJ_PREFETCH : 'NLJ_PREFETCH'; +NLS_CALENDAR : 'NLS_CALENDAR'; +NLS_CHARACTERSET : 'NLS_CHARACTERSET'; +NLS_CHARSET_DECL_LEN : 'NLS_CHARSET_DECL_LEN'; +NLS_CHARSET_ID : 'NLS_CHARSET_ID'; +NLS_CHARSET_NAME : 'NLS_CHARSET_NAME'; +NLS_COMP : 'NLS_COMP'; +NLS_CURRENCY : 'NLS_CURRENCY'; +NLS_DATE_FORMAT : 'NLS_DATE_FORMAT'; +NLS_DATE_LANGUAGE : 'NLS_DATE_LANGUAGE'; +NLS_INITCAP : 'NLS_INITCAP'; +NLS_ISO_CURRENCY : 'NLS_ISO_CURRENCY'; +NL_SJ : 'NL_SJ'; +NLS_LANG : 'NLS_LANG'; +NLS_LANGUAGE : 'NLS_LANGUAGE'; +NLS_LENGTH_SEMANTICS : 'NLS_LENGTH_SEMANTICS'; +NLS_LOWER : 'NLS_LOWER'; +NLS_NCHAR_CONV_EXCP : 'NLS_NCHAR_CONV_EXCP'; +NLS_NUMERIC_CHARACTERS : 'NLS_NUMERIC_CHARACTERS'; +NLS_SORT : 'NLS_SORT'; +NLSSORT : 'NLSSORT'; +NLS_SPECIAL_CHARS : 'NLS_SPECIAL_CHARS'; +NLS_TERRITORY : 'NLS_TERRITORY'; +NLS_UPPER : 'NLS_UPPER'; +NO_ACCESS : 'NO_ACCESS'; +NO_ADAPTIVE_PLAN : 'NO_ADAPTIVE_PLAN'; +NO_ANSI_REARCH : 'NO_ANSI_REARCH'; +NOAPPEND : 'NOAPPEND'; +NOARCHIVELOG : 'NOARCHIVELOG'; +NOAUDIT : 'NOAUDIT'; +NO_AUTO_REOPTIMIZE : 'NO_AUTO_REOPTIMIZE'; +NO_BASETABLE_MULTIMV_REWRITE : 'NO_BASETABLE_MULTIMV_REWRITE'; +NO_BATCH_TABLE_ACCESS_BY_ROWID : 'NO_BATCH_TABLE_ACCESS_BY_ROWID'; +NO_BIND_AWARE : 'NO_BIND_AWARE'; +NO_BUFFER : 'NO_BUFFER'; +NOCACHE : 'NOCACHE'; +NO_CARTESIAN : 'NO_CARTESIAN'; +NO_CHECK_ACL_REWRITE : 'NO_CHECK_ACL_REWRITE'; +NO_CLUSTER_BY_ROWID : 'NO_CLUSTER_BY_ROWID'; +NO_CLUSTERING : 'NO_CLUSTERING'; +NO_COALESCE_SQ : 'NO_COALESCE_SQ'; +NO_COMMON_DATA : 'NO_COMMON_DATA'; +NOCOMPRESS : 'NOCOMPRESS'; +NO_CONNECT_BY_CB_WHR_ONLY : 'NO_CONNECT_BY_CB_WHR_ONLY'; +NO_CONNECT_BY_COMBINE_SW : 'NO_CONNECT_BY_COMBINE_SW'; +NO_CONNECT_BY_COST_BASED : 'NO_CONNECT_BY_COST_BASED'; +NO_CONNECT_BY_ELIM_DUPS : 'NO_CONNECT_BY_ELIM_DUPS'; +NO_CONNECT_BY_FILTERING : 'NO_CONNECT_BY_FILTERING'; +NOCOPY : 'NOCOPY'; +NO_COST_XML_QUERY_REWRITE : 'NO_COST_XML_QUERY_REWRITE'; +NO_CPU_COSTING : 'NO_CPU_COSTING'; +NOCPU_COSTING : 'NOCPU_COSTING'; +NOCYCLE : 'NOCYCLE'; +NO_DATA_SECURITY_REWRITE : 'NO_DATA_SECURITY_REWRITE'; +NO_DECORRELATE : 'NO_DECORRELATE'; +NODELAY : 'NODELAY'; +NO_DOMAIN_INDEX_FILTER : 'NO_DOMAIN_INDEX_FILTER'; +NO_DST_UPGRADE_INSERT_CONV : 'NO_DST_UPGRADE_INSERT_CONV'; +NO_ELIM_GROUPBY : 'NO_ELIM_GROUPBY'; +NO_ELIMINATE_JOIN : 'NO_ELIMINATE_JOIN'; +NO_ELIMINATE_OBY : 'NO_ELIMINATE_OBY'; +NO_ELIMINATE_OUTER_JOIN : 'NO_ELIMINATE_OUTER_JOIN'; +NOENTITYESCAPING : 'NOENTITYESCAPING'; +NO_EXPAND_GSET_TO_UNION : 'NO_EXPAND_GSET_TO_UNION'; +NO_EXPAND : 'NO_EXPAND'; +NO_EXPAND_TABLE : 'NO_EXPAND_TABLE'; +NO_FACT : 'NO_FACT'; +NO_FACTORIZE_JOIN : 'NO_FACTORIZE_JOIN'; +NO_FILTERING : 'NO_FILTERING'; +NOFORCE : 'NOFORCE'; +NO_FULL_OUTER_JOIN_TO_OUTER : 'NO_FULL_OUTER_JOIN_TO_OUTER'; +NO_GATHER_OPTIMIZER_STATISTICS : 'NO_GATHER_OPTIMIZER_STATISTICS'; +NO_GBY_PUSHDOWN : 'NO_GBY_PUSHDOWN'; +NOGUARANTEE : 'NOGUARANTEE'; +NO_INDEX_FFS : 'NO_INDEX_FFS'; +NO_INDEX : 'NO_INDEX'; +NO_INDEX_SS : 'NO_INDEX_SS'; +NO_INMEMORY : 'NO_INMEMORY'; +NO_INMEMORY_PRUNING : 'NO_INMEMORY_PRUNING'; +NOKEEP : 'NOKEEP'; +NO_LOAD : 'NO_LOAD'; +NOLOCAL : 'NOLOCAL'; +NOLOGGING : 'NOLOGGING'; +NOMAPPING : 'NOMAPPING'; +NOMAXVALUE : 'NOMAXVALUE'; +NO_MERGE : 'NO_MERGE'; +NOMINIMIZE : 'NOMINIMIZE'; +NOMINVALUE : 'NOMINVALUE'; +NO_MODEL_PUSH_REF : 'NO_MODEL_PUSH_REF'; +NO_MONITORING : 'NO_MONITORING'; +NOMONITORING : 'NOMONITORING'; +NO_MONITOR : 'NO_MONITOR'; +NO_MULTIMV_REWRITE : 'NO_MULTIMV_REWRITE'; +NO_NATIVE_FULL_OUTER_JOIN : 'NO_NATIVE_FULL_OUTER_JOIN'; +NONBLOCKING : 'NONBLOCKING'; +NONEDITIONABLE : 'NONEDITIONABLE'; +NONE : 'NONE'; +NO_NLJ_BATCHING : 'NO_NLJ_BATCHING'; +NO_NLJ_PREFETCH : 'NO_NLJ_PREFETCH'; +NO : 'NO'; +NONSCHEMA : 'NONSCHEMA'; +NO_OBJECT_LINK : 'NO_OBJECT_LINK'; +NOORDER : 'NOORDER'; +NO_ORDER_ROLLUPS : 'NO_ORDER_ROLLUPS'; +NO_OUTER_JOIN_TO_ANTI : 'NO_OUTER_JOIN_TO_ANTI'; +NO_OUTER_JOIN_TO_INNER : 'NO_OUTER_JOIN_TO_INNER'; +NOOVERRIDE : 'NOOVERRIDE'; +NO_PARALLEL_INDEX : 'NO_PARALLEL_INDEX'; +NOPARALLEL_INDEX : 'NOPARALLEL_INDEX'; +NO_PARALLEL : 'NO_PARALLEL'; +NOPARALLEL : 'NOPARALLEL'; +NO_PARTIAL_COMMIT : 'NO_PARTIAL_COMMIT'; +NO_PARTIAL_JOIN : 'NO_PARTIAL_JOIN'; +NO_PARTIAL_ROLLUP_PUSHDOWN : 'NO_PARTIAL_ROLLUP_PUSHDOWN'; +NOPARTITION : 'NOPARTITION'; +NO_PLACE_DISTINCT : 'NO_PLACE_DISTINCT'; +NO_PLACE_GROUP_BY : 'NO_PLACE_GROUP_BY'; +NO_PQ_CONCURRENT_UNION : 'NO_PQ_CONCURRENT_UNION'; +NO_PQ_MAP : 'NO_PQ_MAP'; +NOPROMPT : 'NOPROMPT'; +NO_PQ_REPLICATE : 'NO_PQ_REPLICATE'; +NO_PQ_SKEW : 'NO_PQ_SKEW'; +NO_PRUNE_GSETS : 'NO_PRUNE_GSETS'; +NO_PULL_PRED : 'NO_PULL_PRED'; +NO_PUSH_PRED : 'NO_PUSH_PRED'; +NO_PUSH_SUBQ : 'NO_PUSH_SUBQ'; +NO_PX_FAULT_TOLERANCE : 'NO_PX_FAULT_TOLERANCE'; +NO_PX_JOIN_FILTER : 'NO_PX_JOIN_FILTER'; +NO_QKN_BUFF : 'NO_QKN_BUFF'; +NO_QUERY_TRANSFORMATION : 'NO_QUERY_TRANSFORMATION'; +NO_REF_CASCADE : 'NO_REF_CASCADE'; +NORELOCATE : 'NORELOCATE'; +NORELY : 'NORELY'; +NOREPAIR : 'NOREPAIR'; +NOREPLAY : 'NOREPLAY'; +NORESETLOGS : 'NORESETLOGS'; +NO_RESULT_CACHE : 'NO_RESULT_CACHE'; +NOREVERSE : 'NOREVERSE'; +NO_REWRITE : 'NO_REWRITE'; +NOREWRITE : 'NOREWRITE'; +NORMAL : 'NORMAL'; +NO_ROOT_SW_FOR_LOCAL : 'NO_ROOT_SW_FOR_LOCAL'; +NOROWDEPENDENCIES : 'NOROWDEPENDENCIES'; +NOSCHEMACHECK : 'NOSCHEMACHECK'; +NOSEGMENT : 'NOSEGMENT'; +NO_SEMIJOIN : 'NO_SEMIJOIN'; +NO_SEMI_TO_INNER : 'NO_SEMI_TO_INNER'; +NO_SET_TO_JOIN : 'NO_SET_TO_JOIN'; +NOSORT : 'NOSORT'; +NO_SQL_TRANSLATION : 'NO_SQL_TRANSLATION'; +NO_SQL_TUNE : 'NO_SQL_TUNE'; +NO_STAR_TRANSFORMATION : 'NO_STAR_TRANSFORMATION'; +NO_STATEMENT_QUEUING : 'NO_STATEMENT_QUEUING'; +NO_STATS_GSETS : 'NO_STATS_GSETS'; +NOSTRICT : 'NOSTRICT'; +NO_SUBQUERY_PRUNING : 'NO_SUBQUERY_PRUNING'; +NO_SUBSTRB_PAD : 'NO_SUBSTRB_PAD'; +NO_SWAP_JOIN_INPUTS : 'NO_SWAP_JOIN_INPUTS'; +NOSWITCH : 'NOSWITCH'; +NO_TABLE_LOOKUP_BY_NL : 'NO_TABLE_LOOKUP_BY_NL'; +NO_TEMP_TABLE : 'NO_TEMP_TABLE'; +NOTHING : 'NOTHING'; +NOTIFICATION : 'NOTIFICATION'; +NOT : 'NOT'; +NO_TRANSFORM_DISTINCT_AGG : 'NO_TRANSFORM_DISTINCT_AGG'; +NO_UNNEST : 'NO_UNNEST'; +NO_USE_CUBE : 'NO_USE_CUBE'; +NO_USE_HASH_AGGREGATION : 'NO_USE_HASH_AGGREGATION'; +NO_USE_HASH_GBY_FOR_PUSHDOWN : 'NO_USE_HASH_GBY_FOR_PUSHDOWN'; +NO_USE_HASH : 'NO_USE_HASH'; +NO_USE_INVISIBLE_INDEXES : 'NO_USE_INVISIBLE_INDEXES'; +NO_USE_MERGE : 'NO_USE_MERGE'; +NO_USE_NL : 'NO_USE_NL'; +NO_USE_VECTOR_AGGREGATION : 'NO_USE_VECTOR_AGGREGATION'; +NOVALIDATE : 'NOVALIDATE'; +NO_VECTOR_TRANSFORM_DIMS : 'NO_VECTOR_TRANSFORM_DIMS'; +NO_VECTOR_TRANSFORM_FACT : 'NO_VECTOR_TRANSFORM_FACT'; +NO_VECTOR_TRANSFORM : 'NO_VECTOR_TRANSFORM'; +NOWAIT : 'NOWAIT'; +NO_XDB_FASTPATH_INSERT : 'NO_XDB_FASTPATH_INSERT'; +NO_XML_DML_REWRITE : 'NO_XML_DML_REWRITE'; +NO_XMLINDEX_REWRITE_IN_SELECT : 'NO_XMLINDEX_REWRITE_IN_SELECT'; +NO_XMLINDEX_REWRITE : 'NO_XMLINDEX_REWRITE'; +NO_XML_QUERY_REWRITE : 'NO_XML_QUERY_REWRITE'; +NO_ZONEMAP : 'NO_ZONEMAP'; +NTH_VALUE : 'NTH_VALUE'; +NULLIF : 'NULLIF'; +NULL_ : 'NULL'; +NULLS : 'NULLS'; +NUMBER : 'NUMBER'; +NUMERIC : 'NUMERIC'; +NUM_INDEX_KEYS : 'NUM_INDEX_KEYS'; +NUMTODSINTERVAL : 'NUMTODSINTERVAL'; +NUMTOYMINTERVAL : 'NUMTOYMINTERVAL'; +NVARCHAR2 : 'NVARCHAR2'; +NVL2 : 'NVL2'; +OBJECT2XML : 'OBJECT2XML'; +OBJECT : 'OBJECT'; +OBJ_ID : 'OBJ_ID'; +OBJNO : 'OBJNO'; +OBJNO_REUSE : 'OBJNO_REUSE'; +OCCURENCES : 'OCCURENCES'; +OFFLINE : 'OFFLINE'; +OFF : 'OFF'; +OFFSET : 'OFFSET'; +OF : 'OF'; +OIDINDEX : 'OIDINDEX'; +OID : 'OID'; +OLAP : 'OLAP'; +OLD : 'OLD'; +OLD_PUSH_PRED : 'OLD_PUSH_PRED'; +OLS : 'OLS'; +OLTP : 'OLTP'; +OMIT : 'OMIT'; +ONE : 'ONE'; +ONLINE : 'ONLINE'; +ONLINELOG : 'ONLINELOG'; +ONLY : 'ONLY'; +ON : 'ON'; +OPAQUE : 'OPAQUE'; +OPAQUE_TRANSFORM : 'OPAQUE_TRANSFORM'; +OPAQUE_XCANONICAL : 'OPAQUE_XCANONICAL'; +OPCODE : 'OPCODE'; +OPEN : 'OPEN'; +OPERATIONS : 'OPERATIONS'; +OPERATOR : 'OPERATOR'; +OPT_ESTIMATE : 'OPT_ESTIMATE'; +OPTIMAL : 'OPTIMAL'; +OPTIMIZE : 'OPTIMIZE'; +OPTIMIZER_FEATURES_ENABLE : 'OPTIMIZER_FEATURES_ENABLE'; +OPTIMIZER_GOAL : 'OPTIMIZER_GOAL'; +OPTION : 'OPTION'; +OPT_PARAM : 'OPT_PARAM'; +ORA_BRANCH : 'ORA_BRANCH'; +ORA_CHECK_ACL : 'ORA_CHECK_ACL'; +ORA_CHECK_PRIVILEGE : 'ORA_CHECK_PRIVILEGE'; +ORA_CLUSTERING : 'ORA_CLUSTERING'; +ORADATA : 'ORADATA'; +ORADEBUG : 'ORADEBUG'; +ORA_DST_AFFECTED : 'ORA_DST_AFFECTED'; +ORA_DST_CONVERT : 'ORA_DST_CONVERT'; +ORA_DST_ERROR : 'ORA_DST_ERROR'; +ORA_GET_ACLIDS : 'ORA_GET_ACLIDS'; +ORA_GET_PRIVILEGES : 'ORA_GET_PRIVILEGES'; +ORA_HASH : 'ORA_HASH'; +ORA_INVOKING_USERID : 'ORA_INVOKING_USERID'; +ORA_INVOKING_USER : 'ORA_INVOKING_USER'; +ORA_INVOKING_XS_USER_GUID : 'ORA_INVOKING_XS_USER_GUID'; +ORA_INVOKING_XS_USER : 'ORA_INVOKING_XS_USER'; +ORA_RAWCOMPARE : 'ORA_RAWCOMPARE'; +ORA_RAWCONCAT : 'ORA_RAWCONCAT'; +ORA_ROWSCN : 'ORA_ROWSCN'; +ORA_ROWSCN_RAW : 'ORA_ROWSCN_RAW'; +ORA_ROWVERSION : 'ORA_ROWVERSION'; +ORA_TABVERSION : 'ORA_TABVERSION'; +ORA_WRITE_TIME : 'ORA_WRITE_TIME'; +ORDERED : 'ORDERED'; +ORDERED_PREDICATES : 'ORDERED_PREDICATES'; +ORDER : 'ORDER'; +ORDINALITY : 'ORDINALITY'; +OR_EXPAND : 'OR_EXPAND'; +ORGANIZATION : 'ORGANIZATION'; +OR : 'OR'; +OR_PREDICATES : 'OR_PREDICATES'; +OSERROR : 'OSERROR'; +OTHER : 'OTHER'; +OUTER_JOIN_TO_ANTI : 'OUTER_JOIN_TO_ANTI'; +OUTER_JOIN_TO_INNER : 'OUTER_JOIN_TO_INNER'; +OUTER : 'OUTER'; +OUTLINE_LEAF : 'OUTLINE_LEAF'; +OUTLINE : 'OUTLINE'; +OUT_OF_LINE : 'OUT_OF_LINE'; +OUT : 'OUT'; +OVERFLOW_NOMOVE : 'OVERFLOW_NOMOVE'; +OVERFLOW : 'OVERFLOW'; +OVERLAPS : 'OVERLAPS'; +OVER : 'OVER'; +OVERRIDING : 'OVERRIDING'; +OWNER : 'OWNER'; +OWNERSHIP : 'OWNERSHIP'; +OWN : 'OWN'; +P_LETTER : 'P'; +PACKAGE : 'PACKAGE'; +PACKAGES : 'PACKAGES'; +PARALLEL_ENABLE : 'PARALLEL_ENABLE'; +PARALLEL_INDEX : 'PARALLEL_INDEX'; +PARALLEL : 'PARALLEL'; +PARAMETERFILE : 'PARAMETERFILE'; +PARAMETERS : 'PARAMETERS'; +PARAM : 'PARAM'; +PARENT : 'PARENT'; +PARENT_LEVEL_NAME : 'PARENT_LEVEL_NAME'; +PARENT_UNIQUE_NAME : 'PARENT_UNIQUE_NAME'; +PARITY : 'PARITY'; +PARTIAL_JOIN : 'PARTIAL_JOIN'; +PARTIALLY : 'PARTIALLY'; +PARTIAL : 'PARTIAL'; +PARTIAL_ROLLUP_PUSHDOWN : 'PARTIAL_ROLLUP_PUSHDOWN'; +PARTITION_HASH : 'PARTITION_HASH'; +PARTITION_LIST : 'PARTITION_LIST'; +PARTITION : 'PARTITION'; +PARTITION_RANGE : 'PARTITION_RANGE'; +PARTITIONS : 'PARTITIONS'; +PARTNUMINST : 'PART$NUM$INST'; +PASSING : 'PASSING'; +PASSWORD_GRACE_TIME : 'PASSWORD_GRACE_TIME'; +PASSWORD_LIFE_TIME : 'PASSWORD_LIFE_TIME'; +PASSWORD_LOCK_TIME : 'PASSWORD_LOCK_TIME'; +PASSWORD : 'PASSWORD'; +PASSWORD_REUSE_MAX : 'PASSWORD_REUSE_MAX'; +PASSWORD_REUSE_TIME : 'PASSWORD_REUSE_TIME'; +PASSWORD_ROLLOVER_TIME : 'PASSWORD_ROLLOVER_TIME'; +PASSWORD_VERIFY_FUNCTION : 'PASSWORD_VERIFY_FUNCTION'; +PAST : 'PAST'; +PATCH : 'PATCH'; +PATH : 'PATH'; +PATH_PREFIX : 'PATH_PREFIX'; +PATHS : 'PATHS'; +PATTERN : 'PATTERN'; +PBL_HS_BEGIN : 'PBL_HS_BEGIN'; +PBL_HS_END : 'PBL_HS_END'; +PCTFREE : 'PCTFREE'; +PCTINCREASE : 'PCTINCREASE'; +PCTTHRESHOLD : 'PCTTHRESHOLD'; +PCTUSED : 'PCTUSED'; +PCTVERSION : 'PCTVERSION'; +PENDING : 'PENDING'; +PERCENT_FOUND : '%' SPACE* 'FOUND'; +PERCENT_ISOPEN : '%' SPACE* 'ISOPEN'; +PERCENT_NOTFOUND : '%' SPACE* 'NOTFOUND'; +PERCENT_KEYWORD : 'PERCENT'; +PERCENT_RANKM : 'PERCENT_RANKM'; +PERCENT_ROWCOUNT : '%' SPACE* 'ROWCOUNT'; +PERCENT_ROWTYPE : '%' SPACE* 'ROWTYPE'; +PERCENT_TYPE : '%' SPACE* 'TYPE'; +PERFORMANCE : 'PERFORMANCE'; +PERIOD_KEYWORD : 'PERIOD'; +PERMANENT : 'PERMANENT'; +PERMISSION : 'PERMISSION'; +PERMUTE : 'PERMUTE'; +PER : 'PER'; +PFILE : 'PFILE'; +PHYSICAL : 'PHYSICAL'; +PIKEY : 'PIKEY'; +PIPELINED : 'PIPELINED'; +PIPE : 'PIPE'; +PIV_GB : 'PIV_GB'; +PIVOT : 'PIVOT'; +PIV_SSF : 'PIV_SSF'; +PLACE_DISTINCT : 'PLACE_DISTINCT'; +PLACE_GROUP_BY : 'PLACE_GROUP_BY'; +PLAN : 'PLAN'; +PLSCOPE_SETTINGS : 'PLSCOPE_SETTINGS'; +PLS_INTEGER : 'PLS_INTEGER'; +PLSQL_CCFLAGS : 'PLSQL_CCFLAGS'; +PLSQL_CODE_TYPE : 'PLSQL_CODE_TYPE'; +PLSQL_DEBUG : 'PLSQL_DEBUG'; +PLSQL_OPTIMIZE_LEVEL : 'PLSQL_OPTIMIZE_LEVEL'; +PLSQL_WARNINGS : 'PLSQL_WARNINGS'; +PLUGGABLE : 'PLUGGABLE'; +PMEM : 'PMEM'; +POINT : 'POINT'; +POLICY : 'POLICY'; +POOL_16K : 'POOL_16K'; +POOL_2K : 'POOL_2K'; +POOL_32K : 'POOL_32K'; +POOL_4K : 'POOL_4K'; +POOL_8K : 'POOL_8K'; +POSITIVEN : 'POSITIVEN'; +POSITIVE : 'POSITIVE'; +POST_TRANSACTION : 'POST_TRANSACTION'; +POWERMULTISET_BY_CARDINALITY : 'POWERMULTISET_BY_CARDINALITY'; +POWERMULTISET : 'POWERMULTISET'; +POWER : 'POWER'; +PQ_CONCURRENT_UNION : 'PQ_CONCURRENT_UNION'; +PQ_DISTRIBUTE : 'PQ_DISTRIBUTE'; +PQ_DISTRIBUTE_WINDOW : 'PQ_DISTRIBUTE_WINDOW'; +PQ_FILTER : 'PQ_FILTER'; +PQ_MAP : 'PQ_MAP'; +PQ_NOMAP : 'PQ_NOMAP'; +PQ_REPLICATE : 'PQ_REPLICATE'; +PQ_SKEW : 'PQ_SKEW'; +PRAGMA : 'PRAGMA'; +PREBUILT : 'PREBUILT'; +PRECEDES : 'PRECEDES'; +PRECEDING : 'PRECEDING'; +PRECISION : 'PRECISION'; +PRECOMPUTE_SUBQUERY : 'PRECOMPUTE_SUBQUERY'; +PREDICATE_REORDERS : 'PREDICATE_REORDERS'; +PRELOAD : 'PRELOAD'; +PREPARE : 'PREPARE'; +PRESENTNNV : 'PRESENTNNV'; +PRESENT : 'PRESENT'; +PRESENTV : 'PRESENTV'; +PRESERVE_OID : 'PRESERVE_OID'; +PRESERVE : 'PRESERVE'; +PRETTY : 'PRETTY'; +PREVIOUS : 'PREVIOUS'; +PREV : 'PREV'; +PRIMARY : 'PRIMARY'; +PRINTBLOBTOCLOB : 'PRINTBLOBTOCLOB'; +PRIORITY : 'PRIORITY'; +PRIOR : 'PRIOR'; +PRIVATE : 'PRIVATE'; +PRIVATE_SGA : 'PRIVATE_SGA'; +PRIVILEGED : 'PRIVILEGED'; +PRIVILEGE : 'PRIVILEGE'; +PRIVILEGES : 'PRIVILEGES'; +PROCEDURAL : 'PROCEDURAL'; +PROCEDURE : 'PROCEDURE'; +PROCESS : 'PROCESS'; +PROFILE : 'PROFILE'; +PROGRAM : 'PROGRAM'; +PROJECT : 'PROJECT'; +PROPAGATE : 'PROPAGATE'; +PROPERTY : 'PROPERTY'; +PROTECTED : 'PROTECTED'; +PROTECTION : 'PROTECTION'; +PROTOCOL : 'PROTOCOL'; +PROXY : 'PROXY'; +PRUNING : 'PRUNING'; +PUBLIC : 'PUBLIC'; +PULL_PRED : 'PULL_PRED'; +PURGE : 'PURGE'; +PUSH_PRED : 'PUSH_PRED'; +PUSH_SUBQ : 'PUSH_SUBQ'; +PX_FAULT_TOLERANCE : 'PX_FAULT_TOLERANCE'; +PX_GRANULE : 'PX_GRANULE'; +PX_JOIN_FILTER : 'PX_JOIN_FILTER'; +QB_NAME : 'QB_NAME'; +QUARTERS : 'QUARTERS'; +QUERY_BLOCK : 'QUERY_BLOCK'; +QUERY : 'QUERY'; +QUEUE_CURR : 'QUEUE_CURR'; +QUEUE : 'QUEUE'; +QUEUE_ROWP : 'QUEUE_ROWP'; +QUIESCE : 'QUIESCE'; +QUORUM : 'QUORUM'; +QUOTA : 'QUOTA'; +QUOTAGROUP : 'QUOTAGROUP'; +RAISE : 'RAISE'; +RANDOM_LOCAL : 'RANDOM_LOCAL'; +RANDOM : 'RANDOM'; +RANGE : 'RANGE'; +RANKM : 'RANKM'; +RAPIDLY : 'RAPIDLY'; +RAW : 'RAW'; +RAWTOHEX : 'RAWTOHEX'; +RAWTONHEX : 'RAWTONHEX'; +RBA : 'RBA'; +RBO_OUTLINE : 'RBO_OUTLINE'; +RDBA : 'RDBA'; +READ : 'READ'; +READS : 'READS'; +REALM : 'REALM'; +REAL : 'REAL'; +REBALANCE : 'REBALANCE'; +REBUILD : 'REBUILD'; +RECORD : 'RECORD'; +RECORDS_PER_BLOCK : 'RECORDS_PER_BLOCK'; +RECOVERABLE : 'RECOVERABLE'; +RECOVER : 'RECOVER'; +RECOVERY : 'RECOVERY'; +RECYCLEBIN : 'RECYCLEBIN'; +RECYCLE : 'RECYCLE'; +REDACTION : 'REDACTION'; +REDEFINE : 'REDEFINE'; +REDO : 'REDO'; +REDUCED : 'REDUCED'; +REDUNDANCY : 'REDUNDANCY'; +REF_CASCADE_CURSOR : 'REF_CASCADE_CURSOR'; +REFERENCED : 'REFERENCED'; +REFERENCE : 'REFERENCE'; +REFERENCES : 'REFERENCES'; +REFERENCING : 'REFERENCING'; +REF : 'REF'; +REFRESH : 'REFRESH'; +REFTOHEX : 'REFTOHEX'; +REGEXP_COUNT : 'REGEXP_COUNT'; +REGEXP_INSTR : 'REGEXP_INSTR'; +REGEXP_LIKE : 'REGEXP_LIKE'; +REGEXP_REPLACE : 'REGEXP_REPLACE'; +REGEXP_SUBSTR : 'REGEXP_SUBSTR'; +REGISTER : 'REGISTER'; +REGR_AVGX : 'REGR_AVGX'; +REGR_AVGY : 'REGR_AVGY'; +REGR_COUNT : 'REGR_COUNT'; +REGR_INTERCEPT : 'REGR_INTERCEPT'; +REGR_R2 : 'REGR_R2'; +REGR_SLOPE : 'REGR_SLOPE'; +REGR_SXX : 'REGR_SXX'; +REGR_SXY : 'REGR_SXY'; +REGR_SYY : 'REGR_SYY'; +REGULAR : 'REGULAR'; +REJECT : 'REJECT'; +REKEY : 'REKEY'; +RELATIONAL : 'RELATIONAL'; +RELIES_ON : 'RELIES_ON'; +RELOCATE : 'RELOCATE'; +RELY : 'RELY'; +REMAINDER : 'REMAINDER'; +REMOTE : 'REMOTE'; +REMOTE_MAPPED : 'REMOTE_MAPPED'; +REMOVE : 'REMOVE'; +RENAME : 'RENAME'; +REPAIR : 'REPAIR'; +REPEAT : 'REPEAT'; +REPLACE : 'REPLACE'; +REPLICATION : 'REPLICATION'; +REQUIRED : 'REQUIRED'; +RESETLOGS : 'RESETLOGS'; +RESET : 'RESET'; +RESIZE : 'RESIZE'; +RESOLVE : 'RESOLVE'; +RESOLVER : 'RESOLVER'; +RESOURCE : 'RESOURCE'; +RESPECT : 'RESPECT'; +RESTART : 'RESTART'; +RESTORE_AS_INTERVALS : 'RESTORE_AS_INTERVALS'; +RESTORE : 'RESTORE'; +RESTRICT_ALL_REF_CONS : 'RESTRICT_ALL_REF_CONS'; +RESTRICTED : 'RESTRICTED'; +RESTRICT_REFERENCES : 'RESTRICT_REFERENCES'; +RESTRICT : 'RESTRICT'; +RESULT_CACHE : 'RESULT_CACHE'; +RESULT : 'RESULT'; +RESUMABLE : 'RESUMABLE'; +RESUME : 'RESUME'; +RETENTION : 'RETENTION'; +RETRY_ON_ROW_CHANGE : 'RETRY_ON_ROW_CHANGE'; +RETURNING : 'RETURNING'; +RETURN : 'RETURN'; +REUSE : 'REUSE'; +REVERSE : 'REVERSE'; +REVOKE : 'REVOKE'; +REWRITE_OR_ERROR : 'REWRITE_OR_ERROR'; +REWRITE : 'REWRITE'; +RIGHT : 'RIGHT'; +ROLE : 'ROLE'; +ROLESET : 'ROLESET'; +ROLES : 'ROLES'; +ROLLBACK : 'ROLLBACK'; +ROLLING : 'ROLLING'; +ROLLUP : 'ROLLUP'; +ROWDEPENDENCIES : 'ROWDEPENDENCIES'; +ROWID_MAPPING_TABLE : 'ROWID_MAPPING_TABLE'; +ROWID : 'ROWID'; +ROWIDTOCHAR : 'ROWIDTOCHAR'; +ROWIDTONCHAR : 'ROWIDTONCHAR'; +ROW_LENGTH : 'ROW_LENGTH'; +ROWNUM : 'ROWNUM'; +ROW : 'ROW'; +ROWS : 'ROWS'; +RPAD : 'RPAD'; +RTRIM : 'RTRIM'; +RULE : 'RULE'; +RULES : 'RULES'; +RUNNING : 'RUNNING'; +SALT : 'SALT'; +SAMPLE : 'SAMPLE'; +SAVE_AS_INTERVALS : 'SAVE_AS_INTERVALS'; +SAVEPOINT : 'SAVEPOINT'; +SAVE : 'SAVE'; +SB4 : 'SB4'; +SCALE_ROWS : 'SCALE_ROWS'; +SCALE : 'SCALE'; +SCAN_INSTANCES : 'SCAN_INSTANCES'; +SCAN : 'SCAN'; +SCHEDULER : 'SCHEDULER'; +SCHEMACHECK : 'SCHEMACHECK'; +SCHEMA : 'SCHEMA'; +SCN_ASCENDING : 'SCN_ASCENDING'; +SCN : 'SCN'; +SCOPE : 'SCOPE'; +SCRUB : 'SCRUB'; +SD_ALL : 'SD_ALL'; +SD_INHIBIT : 'SD_INHIBIT'; +SDO_GEOM_MBR : 'SDO_GEOM_MBR'; +SDO_GEOMETRY : 'SDO_GEOMETRY'; +SD_SHOW : 'SD_SHOW'; +SEARCH : 'SEARCH'; +SECOND : 'SECOND'; +SECONDS : 'SECONDS'; +SECRET : 'SECRET'; +SECUREFILE_DBA : 'SECUREFILE_DBA'; +SECUREFILE : 'SECUREFILE'; +SECURITY : 'SECURITY'; +SEED : 'SEED'; +SEG_BLOCK : 'SEG_BLOCK'; +SEG_FILE : 'SEG_FILE'; +SEGMENT : 'SEGMENT'; +SELECTIVITY : 'SELECTIVITY'; +SELECT : 'SELECT'; +SELF : 'SELF'; +SEMIJOIN_DRIVER : 'SEMIJOIN_DRIVER'; +SEMIJOIN : 'SEMIJOIN'; +SEMI_TO_INNER : 'SEMI_TO_INNER'; +SEQUENCED : 'SEQUENCED'; +SEQUENCE : 'SEQUENCE'; +SEQUENTIAL : 'SEQUENTIAL'; +SEQ : 'SEQ'; +SERIALIZABLE : 'SERIALIZABLE'; +SERIALLY_REUSABLE : 'SERIALLY_REUSABLE'; +SERIAL : 'SERIAL'; +SERVERERROR : 'SERVERERROR'; +SERVICE_NAME_CONVERT : 'SERVICE_NAME_CONVERT'; +SERVICE : 'SERVICE'; +SERVICES : 'SERVICES'; +SESSION_CACHED_CURSORS : 'SESSION_CACHED_CURSORS'; +SESSION : 'SESSION'; +SESSIONS_PER_USER : 'SESSIONS_PER_USER'; +SESSIONTIMEZONE : 'SESSIONTIMEZONE'; +SESSIONTZNAME : 'SESSIONTZNAME'; +SET : 'SET'; +SETS : 'SETS'; +SETTINGS : 'SETTINGS'; +SET_TO_JOIN : 'SET_TO_JOIN'; +SEVERE : 'SEVERE'; +SHARDSPACE : 'SHARDSPACE'; +SHARED_POOL : 'SHARED_POOL'; +SHARED : 'SHARED'; +SHARE : 'SHARE'; +SHARING : 'SHARING'; +SHELFLIFE : 'SHELFLIFE'; +SHOW : 'SHOW'; +SHRINK : 'SHRINK'; +SHUTDOWN : 'SHUTDOWN'; +SIBLINGS : 'SIBLINGS'; +SID : 'SID'; +SITE : 'SITE'; +SIGNAL_COMPONENT : 'SIGNAL_COMPONENT'; +SIGNAL_FUNCTION : 'SIGNAL_FUNCTION'; +SIGN : 'SIGN'; +SIGNTYPE : 'SIGNTYPE'; +SIMPLE_INTEGER : 'SIMPLE_INTEGER'; +SIMPLE : 'SIMPLE'; +SINGLE : 'SINGLE'; +SINGLETASK : 'SINGLETASK'; +SINH : 'SINH'; +SIN : 'SIN'; +SIZE : 'SIZE'; +SKIP_EXT_OPTIMIZER : 'SKIP_EXT_OPTIMIZER'; +SKIP_ : 'SKIP'; +SKIP_UNQ_UNUSABLE_IDX : 'SKIP_UNQ_UNUSABLE_IDX'; +SKIP_UNUSABLE_INDEXES : 'SKIP_UNUSABLE_INDEXES'; +SMALLFILE : 'SMALLFILE'; +SMALLINT : 'SMALLINT'; +SNAPSHOT : 'SNAPSHOT'; +SOME : 'SOME'; +SORT : 'SORT'; +SOUNDEX : 'SOUNDEX'; +SOURCE_FILE_DIRECTORY : 'SOURCE_FILE_DIRECTORY'; +SOURCE_FILE_NAME_CONVERT : 'SOURCE_FILE_NAME_CONVERT'; +SOURCE : 'SOURCE'; +SPACE_KEYWORD : 'SPACE'; +SPECIFICATION : 'SPECIFICATION'; +SPFILE : 'SPFILE'; +SPLIT : 'SPLIT'; +SPREADSHEET : 'SPREADSHEET'; +SQLDATA : 'SQLDATA'; +SQLERROR : 'SQLERROR'; +SQLLDR : 'SQLLDR'; +SQL : 'SQL'; +SQL_MACRO : 'SQL_MACRO'; +SQL_TRACE : 'SQL_TRACE'; +SQL_TRANSLATION_PROFILE : 'SQL_TRANSLATION_PROFILE'; +SQRT : 'SQRT'; +STALE : 'STALE'; +STANDALONE : 'STANDALONE'; +STANDARD : 'STANDARD'; +STANDARD_HASH : 'STANDARD_HASH'; +STANDBY_MAX_DATA_DELAY : 'STANDBY_MAX_DATA_DELAY'; +STANDBYS : 'STANDBYS'; +STANDBY : 'STANDBY'; +STAR : 'STAR'; +STAR_TRANSFORMATION : 'STAR_TRANSFORMATION'; +START : 'START'; +STARTUP : 'STARTUP'; +STATEMENT_ID : 'STATEMENT_ID'; +STATEMENT_QUEUING : 'STATEMENT_QUEUING'; +STATEMENTS : 'STATEMENTS'; +STATEMENT : 'STATEMENT'; +STATE : 'STATE'; +STATIC : 'STATIC'; +STATISTICS : 'STATISTICS'; +STATS_BINOMIAL_TEST : 'STATS_BINOMIAL_TEST'; +STATS_CROSSTAB : 'STATS_CROSSTAB'; +STATS_F_TEST : 'STATS_F_TEST'; +STATS_KS_TEST : 'STATS_KS_TEST'; +STATS_MODE : 'STATS_MODE'; +STATS_MW_TEST : 'STATS_MW_TEST'; +STATS_ONE_WAY_ANOVA : 'STATS_ONE_WAY_ANOVA'; +STATS_T_TEST_INDEP : 'STATS_T_TEST_INDEP'; +STATS_T_TEST_INDEPU : 'STATS_T_TEST_INDEPU'; +STATS_T_TEST_ONE : 'STATS_T_TEST_ONE'; +STATS_T_TEST_PAIRED : 'STATS_T_TEST_PAIRED'; +STATS_WSR_TEST : 'STATS_WSR_TEST'; +STDDEV_POP : 'STDDEV_POP'; +STDDEV_SAMP : 'STDDEV_SAMP'; +STOP : 'STOP'; +STORAGE : 'STORAGE'; +STORE : 'STORE'; +STREAMS : 'STREAMS'; +STREAM : 'STREAM'; +STRICT : 'STRICT'; +STRING : 'STRING'; +STRIPE_COLUMNS : 'STRIPE_COLUMNS'; +STRIPE_WIDTH : 'STRIPE_WIDTH'; +STRIP : 'STRIP'; +STRUCTURE : 'STRUCTURE'; +SUBMULTISET : 'SUBMULTISET'; +SUBPARTITION_REL : 'SUBPARTITION_REL'; +SUBPARTITIONS : 'SUBPARTITIONS'; +SUBPARTITION : 'SUBPARTITION'; +SUBQUERIES : 'SUBQUERIES'; +SUBQUERY_PRUNING : 'SUBQUERY_PRUNING'; +SUBSCRIBE : 'SUBSCRIBE'; +SUBSET : 'SUBSET'; +SUBSTITUTABLE : 'SUBSTITUTABLE'; +SUBSTR2 : 'SUBSTR2'; +SUBSTR4 : 'SUBSTR4'; +SUBSTRB : 'SUBSTRB'; +SUBSTRC : 'SUBSTRC'; +SUBTYPE : 'SUBTYPE'; +SUCCESSFUL : 'SUCCESSFUL'; +SUCCESS : 'SUCCESS'; +SUMMARY : 'SUMMARY'; +SUPPLEMENTAL : 'SUPPLEMENTAL'; +SUSPEND : 'SUSPEND'; +SWAP_JOIN_INPUTS : 'SWAP_JOIN_INPUTS'; +SWITCHOVER : 'SWITCHOVER'; +SWITCH : 'SWITCH'; +SYNCHRONOUS : 'SYNCHRONOUS'; +SYNC : 'SYNC'; +SYNONYM : 'SYNONYM'; +SYS : 'SYS'; +SYSASM : 'SYSASM'; +SYS_AUDIT : 'SYS_AUDIT'; +SYSAUX : 'SYSAUX'; +SYSBACKUP : 'SYSBACKUP'; +SYS_CHECKACL : 'SYS_CHECKACL'; +SYS_CHECK_PRIVILEGE : 'SYS_CHECK_PRIVILEGE'; +SYS_CONNECT_BY_PATH : 'SYS_CONNECT_BY_PATH'; +SYS_CONTEXT : 'SYS_CONTEXT'; +SYSDATE : 'SYSDATE'; +SYSDBA : 'SYSDBA'; +SYS_DBURIGEN : 'SYS_DBURIGEN'; +SYSDG : 'SYSDG'; +SYS_DL_CURSOR : 'SYS_DL_CURSOR'; +SYS_DM_RXFORM_CHR : 'SYS_DM_RXFORM_CHR'; +SYS_DM_RXFORM_NUM : 'SYS_DM_RXFORM_NUM'; +SYS_DOM_COMPARE : 'SYS_DOM_COMPARE'; +SYS_DST_PRIM2SEC : 'SYS_DST_PRIM2SEC'; +SYS_DST_SEC2PRIM : 'SYS_DST_SEC2PRIM'; +SYS_ET_BFILE_TO_RAW : 'SYS_ET_BFILE_TO_RAW'; +SYS_ET_BLOB_TO_IMAGE : 'SYS_ET_BLOB_TO_IMAGE'; +SYS_ET_IMAGE_TO_BLOB : 'SYS_ET_IMAGE_TO_BLOB'; +SYS_ET_RAW_TO_BFILE : 'SYS_ET_RAW_TO_BFILE'; +SYS_EXTPDTXT : 'SYS_EXTPDTXT'; +SYS_EXTRACT_UTC : 'SYS_EXTRACT_UTC'; +SYS_FBT_INSDEL : 'SYS_FBT_INSDEL'; +SYS_FILTER_ACLS : 'SYS_FILTER_ACLS'; +SYS_FNMATCHES : 'SYS_FNMATCHES'; +SYS_FNREPLACE : 'SYS_FNREPLACE'; +SYS_GET_ACLIDS : 'SYS_GET_ACLIDS'; +SYS_GET_COL_ACLIDS : 'SYS_GET_COL_ACLIDS'; +SYS_GET_PRIVILEGES : 'SYS_GET_PRIVILEGES'; +SYS_GETTOKENID : 'SYS_GETTOKENID'; +SYS_GETXTIVAL : 'SYS_GETXTIVAL'; +SYS_GUID : 'SYS_GUID'; +SYSGUID : 'SYSGUID'; +SYSKM : 'SYSKM'; +SYS_MAKE_XMLNODEID : 'SYS_MAKE_XMLNODEID'; +SYS_MAKEXML : 'SYS_MAKEXML'; +SYS_MKXMLATTR : 'SYS_MKXMLATTR'; +SYS_MKXTI : 'SYS_MKXTI'; +SYSOBJ : 'SYSOBJ'; +SYS_OP_ADT2BIN : 'SYS_OP_ADT2BIN'; +SYS_OP_ADTCONS : 'SYS_OP_ADTCONS'; +SYS_OP_ALSCRVAL : 'SYS_OP_ALSCRVAL'; +SYS_OP_ATG : 'SYS_OP_ATG'; +SYS_OP_BIN2ADT : 'SYS_OP_BIN2ADT'; +SYS_OP_BITVEC : 'SYS_OP_BITVEC'; +SYS_OP_BL2R : 'SYS_OP_BL2R'; +SYS_OP_BLOOM_FILTER_LIST : 'SYS_OP_BLOOM_FILTER_LIST'; +SYS_OP_BLOOM_FILTER : 'SYS_OP_BLOOM_FILTER'; +SYS_OP_C2C : 'SYS_OP_C2C'; +SYS_OP_CAST : 'SYS_OP_CAST'; +SYS_OP_CEG : 'SYS_OP_CEG'; +SYS_OP_CL2C : 'SYS_OP_CL2C'; +SYS_OP_COMBINED_HASH : 'SYS_OP_COMBINED_HASH'; +SYS_OP_COMP : 'SYS_OP_COMP'; +SYS_OP_CONVERT : 'SYS_OP_CONVERT'; +SYS_OP_COUNTCHG : 'SYS_OP_COUNTCHG'; +SYS_OP_CSCONV : 'SYS_OP_CSCONV'; +SYS_OP_CSCONVTEST : 'SYS_OP_CSCONVTEST'; +SYS_OP_CSR : 'SYS_OP_CSR'; +SYS_OP_CSX_PATCH : 'SYS_OP_CSX_PATCH'; +SYS_OP_CYCLED_SEQ : 'SYS_OP_CYCLED_SEQ'; +SYS_OP_DECOMP : 'SYS_OP_DECOMP'; +SYS_OP_DESCEND : 'SYS_OP_DESCEND'; +SYS_OP_DISTINCT : 'SYS_OP_DISTINCT'; +SYS_OP_DRA : 'SYS_OP_DRA'; +SYS_OP_DUMP : 'SYS_OP_DUMP'; +SYS_OP_DV_CHECK : 'SYS_OP_DV_CHECK'; +SYS_OP_ENFORCE_NOT_NULL : 'SYS_OP_ENFORCE_NOT_NULL$'; +SYSOPER : 'SYSOPER'; +SYS_OP_EXTRACT : 'SYS_OP_EXTRACT'; +SYS_OP_GROUPING : 'SYS_OP_GROUPING'; +SYS_OP_GUID : 'SYS_OP_GUID'; +SYS_OP_HASH : 'SYS_OP_HASH'; +SYS_OP_IIX : 'SYS_OP_IIX'; +SYS_OP_ITR : 'SYS_OP_ITR'; +SYS_OP_KEY_VECTOR_CREATE : 'SYS_OP_KEY_VECTOR_CREATE'; +SYS_OP_KEY_VECTOR_FILTER_LIST : 'SYS_OP_KEY_VECTOR_FILTER_LIST'; +SYS_OP_KEY_VECTOR_FILTER : 'SYS_OP_KEY_VECTOR_FILTER'; +SYS_OP_KEY_VECTOR_SUCCEEDED : 'SYS_OP_KEY_VECTOR_SUCCEEDED'; +SYS_OP_KEY_VECTOR_USE : 'SYS_OP_KEY_VECTOR_USE'; +SYS_OP_LBID : 'SYS_OP_LBID'; +SYS_OP_LOBLOC2BLOB : 'SYS_OP_LOBLOC2BLOB'; +SYS_OP_LOBLOC2CLOB : 'SYS_OP_LOBLOC2CLOB'; +SYS_OP_LOBLOC2ID : 'SYS_OP_LOBLOC2ID'; +SYS_OP_LOBLOC2NCLOB : 'SYS_OP_LOBLOC2NCLOB'; +SYS_OP_LOBLOC2TYP : 'SYS_OP_LOBLOC2TYP'; +SYS_OP_LSVI : 'SYS_OP_LSVI'; +SYS_OP_LVL : 'SYS_OP_LVL'; +SYS_OP_MAKEOID : 'SYS_OP_MAKEOID'; +SYS_OP_MAP_NONNULL : 'SYS_OP_MAP_NONNULL'; +SYS_OP_MSR : 'SYS_OP_MSR'; +SYS_OP_NICOMBINE : 'SYS_OP_NICOMBINE'; +SYS_OP_NIEXTRACT : 'SYS_OP_NIEXTRACT'; +SYS_OP_NII : 'SYS_OP_NII'; +SYS_OP_NIX : 'SYS_OP_NIX'; +SYS_OP_NOEXPAND : 'SYS_OP_NOEXPAND'; +SYS_OP_NTCIMG : 'SYS_OP_NTCIMG$'; +SYS_OP_NUMTORAW : 'SYS_OP_NUMTORAW'; +SYS_OP_OIDVALUE : 'SYS_OP_OIDVALUE'; +SYS_OP_OPNSIZE : 'SYS_OP_OPNSIZE'; +SYS_OP_PAR_1 : 'SYS_OP_PAR_1'; +SYS_OP_PARGID_1 : 'SYS_OP_PARGID_1'; +SYS_OP_PARGID : 'SYS_OP_PARGID'; +SYS_OP_PAR : 'SYS_OP_PAR'; +SYS_OP_PART_ID : 'SYS_OP_PART_ID'; +SYS_OP_PIVOT : 'SYS_OP_PIVOT'; +SYS_OP_R2O : 'SYS_OP_R2O'; +SYS_OP_RAWTONUM : 'SYS_OP_RAWTONUM'; +SYS_OP_RDTM : 'SYS_OP_RDTM'; +SYS_OP_REF : 'SYS_OP_REF'; +SYS_OP_RMTD : 'SYS_OP_RMTD'; +SYS_OP_ROWIDTOOBJ : 'SYS_OP_ROWIDTOOBJ'; +SYS_OP_RPB : 'SYS_OP_RPB'; +SYS_OPTLOBPRBSC : 'SYS_OPTLOBPRBSC'; +SYS_OP_TOSETID : 'SYS_OP_TOSETID'; +SYS_OP_TPR : 'SYS_OP_TPR'; +SYS_OP_TRTB : 'SYS_OP_TRTB'; +SYS_OPTXICMP : 'SYS_OPTXICMP'; +SYS_OPTXQCASTASNQ : 'SYS_OPTXQCASTASNQ'; +SYS_OP_UNDESCEND : 'SYS_OP_UNDESCEND'; +SYS_OP_VECAND : 'SYS_OP_VECAND'; +SYS_OP_VECBIT : 'SYS_OP_VECBIT'; +SYS_OP_VECOR : 'SYS_OP_VECOR'; +SYS_OP_VECXOR : 'SYS_OP_VECXOR'; +SYS_OP_VERSION : 'SYS_OP_VERSION'; +SYS_OP_VREF : 'SYS_OP_VREF'; +SYS_OP_VVD : 'SYS_OP_VVD'; +SYS_OP_XMLCONS_FOR_CSX : 'SYS_OP_XMLCONS_FOR_CSX'; +SYS_OP_XPTHATG : 'SYS_OP_XPTHATG'; +SYS_OP_XPTHIDX : 'SYS_OP_XPTHIDX'; +SYS_OP_XPTHOP : 'SYS_OP_XPTHOP'; +SYS_OP_XTXT2SQLT : 'SYS_OP_XTXT2SQLT'; +SYS_OP_ZONE_ID : 'SYS_OP_ZONE_ID'; +SYS_ORDERKEY_DEPTH : 'SYS_ORDERKEY_DEPTH'; +SYS_ORDERKEY_MAXCHILD : 'SYS_ORDERKEY_MAXCHILD'; +SYS_ORDERKEY_PARENT : 'SYS_ORDERKEY_PARENT'; +SYS_PARALLEL_TXN : 'SYS_PARALLEL_TXN'; +SYS_PATHID_IS_ATTR : 'SYS_PATHID_IS_ATTR'; +SYS_PATHID_IS_NMSPC : 'SYS_PATHID_IS_NMSPC'; +SYS_PATHID_LASTNAME : 'SYS_PATHID_LASTNAME'; +SYS_PATHID_LASTNMSPC : 'SYS_PATHID_LASTNMSPC'; +SYS_PATH_REVERSE : 'SYS_PATH_REVERSE'; +SYS_PXQEXTRACT : 'SYS_PXQEXTRACT'; +SYS_RAW_TO_XSID : 'SYS_RAW_TO_XSID'; +SYS_RID_ORDER : 'SYS_RID_ORDER'; +SYS_ROW_DELTA : 'SYS_ROW_DELTA'; +SYS_SC_2_XMLT : 'SYS_SC_2_XMLT'; +SYS_SYNRCIREDO : 'SYS_SYNRCIREDO'; +SYSTEM_DEFINED : 'SYSTEM_DEFINED'; +SYSTEM : 'SYSTEM'; +SYSTIMESTAMP : 'SYSTIMESTAMP'; +SYS_TYPEID : 'SYS_TYPEID'; +SYS_UMAKEXML : 'SYS_UMAKEXML'; +SYS_XMLANALYZE : 'SYS_XMLANALYZE'; +SYS_XMLCONTAINS : 'SYS_XMLCONTAINS'; +SYS_XMLCONV : 'SYS_XMLCONV'; +SYS_XMLEXNSURI : 'SYS_XMLEXNSURI'; +SYS_XMLGEN : 'SYS_XMLGEN'; +SYS_XMLI_LOC_ISNODE : 'SYS_XMLI_LOC_ISNODE'; +SYS_XMLI_LOC_ISTEXT : 'SYS_XMLI_LOC_ISTEXT'; +SYS_XMLINSTR : 'SYS_XMLINSTR'; +SYS_XMLLOCATOR_GETSVAL : 'SYS_XMLLOCATOR_GETSVAL'; +SYS_XMLNODEID_GETCID : 'SYS_XMLNODEID_GETCID'; +SYS_XMLNODEID_GETLOCATOR : 'SYS_XMLNODEID_GETLOCATOR'; +SYS_XMLNODEID_GETOKEY : 'SYS_XMLNODEID_GETOKEY'; +SYS_XMLNODEID_GETPATHID : 'SYS_XMLNODEID_GETPATHID'; +SYS_XMLNODEID_GETPTRID : 'SYS_XMLNODEID_GETPTRID'; +SYS_XMLNODEID_GETRID : 'SYS_XMLNODEID_GETRID'; +SYS_XMLNODEID_GETSVAL : 'SYS_XMLNODEID_GETSVAL'; +SYS_XMLNODEID_GETTID : 'SYS_XMLNODEID_GETTID'; +SYS_XMLNODEID : 'SYS_XMLNODEID'; +SYS_XMLT_2_SC : 'SYS_XMLT_2_SC'; +SYS_XMLTRANSLATE : 'SYS_XMLTRANSLATE'; +SYS_XMLTYPE2SQL : 'SYS_XMLTYPE2SQL'; +SYS_XQ_ASQLCNV : 'SYS_XQ_ASQLCNV'; +SYS_XQ_ATOMCNVCHK : 'SYS_XQ_ATOMCNVCHK'; +SYS_XQBASEURI : 'SYS_XQBASEURI'; +SYS_XQCASTABLEERRH : 'SYS_XQCASTABLEERRH'; +SYS_XQCODEP2STR : 'SYS_XQCODEP2STR'; +SYS_XQCODEPEQ : 'SYS_XQCODEPEQ'; +SYS_XQCON2SEQ : 'SYS_XQCON2SEQ'; +SYS_XQCONCAT : 'SYS_XQCONCAT'; +SYS_XQDELETE : 'SYS_XQDELETE'; +SYS_XQDFLTCOLATION : 'SYS_XQDFLTCOLATION'; +SYS_XQDOC : 'SYS_XQDOC'; +SYS_XQDOCURI : 'SYS_XQDOCURI'; +SYS_XQDURDIV : 'SYS_XQDURDIV'; +SYS_XQED4URI : 'SYS_XQED4URI'; +SYS_XQENDSWITH : 'SYS_XQENDSWITH'; +SYS_XQERRH : 'SYS_XQERRH'; +SYS_XQERR : 'SYS_XQERR'; +SYS_XQESHTMLURI : 'SYS_XQESHTMLURI'; +SYS_XQEXLOBVAL : 'SYS_XQEXLOBVAL'; +SYS_XQEXSTWRP : 'SYS_XQEXSTWRP'; +SYS_XQEXTRACT : 'SYS_XQEXTRACT'; +SYS_XQEXTRREF : 'SYS_XQEXTRREF'; +SYS_XQEXVAL : 'SYS_XQEXVAL'; +SYS_XQFB2STR : 'SYS_XQFB2STR'; +SYS_XQFNBOOL : 'SYS_XQFNBOOL'; +SYS_XQFNCMP : 'SYS_XQFNCMP'; +SYS_XQFNDATIM : 'SYS_XQFNDATIM'; +SYS_XQFNLNAME : 'SYS_XQFNLNAME'; +SYS_XQFNNM : 'SYS_XQFNNM'; +SYS_XQFNNSURI : 'SYS_XQFNNSURI'; +SYS_XQFNPREDTRUTH : 'SYS_XQFNPREDTRUTH'; +SYS_XQFNQNM : 'SYS_XQFNQNM'; +SYS_XQFNROOT : 'SYS_XQFNROOT'; +SYS_XQFORMATNUM : 'SYS_XQFORMATNUM'; +SYS_XQFTCONTAIN : 'SYS_XQFTCONTAIN'; +SYS_XQFUNCR : 'SYS_XQFUNCR'; +SYS_XQGETCONTENT : 'SYS_XQGETCONTENT'; +SYS_XQINDXOF : 'SYS_XQINDXOF'; +SYS_XQINSERT : 'SYS_XQINSERT'; +SYS_XQINSPFX : 'SYS_XQINSPFX'; +SYS_XQIRI2URI : 'SYS_XQIRI2URI'; +SYS_XQLANG : 'SYS_XQLANG'; +SYS_XQLLNMFRMQNM : 'SYS_XQLLNMFRMQNM'; +SYS_XQMKNODEREF : 'SYS_XQMKNODEREF'; +SYS_XQNILLED : 'SYS_XQNILLED'; +SYS_XQNODENAME : 'SYS_XQNODENAME'; +SYS_XQNORMSPACE : 'SYS_XQNORMSPACE'; +SYS_XQNORMUCODE : 'SYS_XQNORMUCODE'; +SYS_XQ_NRNG : 'SYS_XQ_NRNG'; +SYS_XQNSP4PFX : 'SYS_XQNSP4PFX'; +SYS_XQNSPFRMQNM : 'SYS_XQNSPFRMQNM'; +SYS_XQPFXFRMQNM : 'SYS_XQPFXFRMQNM'; +SYS_XQ_PKSQL2XML : 'SYS_XQ_PKSQL2XML'; +SYS_XQPOLYABS : 'SYS_XQPOLYABS'; +SYS_XQPOLYADD : 'SYS_XQPOLYADD'; +SYS_XQPOLYCEL : 'SYS_XQPOLYCEL'; +SYS_XQPOLYCSTBL : 'SYS_XQPOLYCSTBL'; +SYS_XQPOLYCST : 'SYS_XQPOLYCST'; +SYS_XQPOLYDIV : 'SYS_XQPOLYDIV'; +SYS_XQPOLYFLR : 'SYS_XQPOLYFLR'; +SYS_XQPOLYMOD : 'SYS_XQPOLYMOD'; +SYS_XQPOLYMUL : 'SYS_XQPOLYMUL'; +SYS_XQPOLYRND : 'SYS_XQPOLYRND'; +SYS_XQPOLYSQRT : 'SYS_XQPOLYSQRT'; +SYS_XQPOLYSUB : 'SYS_XQPOLYSUB'; +SYS_XQPOLYUMUS : 'SYS_XQPOLYUMUS'; +SYS_XQPOLYUPLS : 'SYS_XQPOLYUPLS'; +SYS_XQPOLYVEQ : 'SYS_XQPOLYVEQ'; +SYS_XQPOLYVGE : 'SYS_XQPOLYVGE'; +SYS_XQPOLYVGT : 'SYS_XQPOLYVGT'; +SYS_XQPOLYVLE : 'SYS_XQPOLYVLE'; +SYS_XQPOLYVLT : 'SYS_XQPOLYVLT'; +SYS_XQPOLYVNE : 'SYS_XQPOLYVNE'; +SYS_XQREF2VAL : 'SYS_XQREF2VAL'; +SYS_XQRENAME : 'SYS_XQRENAME'; +SYS_XQREPLACE : 'SYS_XQREPLACE'; +SYS_XQRESVURI : 'SYS_XQRESVURI'; +SYS_XQRNDHALF2EVN : 'SYS_XQRNDHALF2EVN'; +SYS_XQRSLVQNM : 'SYS_XQRSLVQNM'; +SYS_XQRYENVPGET : 'SYS_XQRYENVPGET'; +SYS_XQRYVARGET : 'SYS_XQRYVARGET'; +SYS_XQRYWRP : 'SYS_XQRYWRP'; +SYS_XQSEQ2CON4XC : 'SYS_XQSEQ2CON4XC'; +SYS_XQSEQ2CON : 'SYS_XQSEQ2CON'; +SYS_XQSEQDEEPEQ : 'SYS_XQSEQDEEPEQ'; +SYS_XQSEQINSB : 'SYS_XQSEQINSB'; +SYS_XQSEQRM : 'SYS_XQSEQRM'; +SYS_XQSEQRVS : 'SYS_XQSEQRVS'; +SYS_XQSEQSUB : 'SYS_XQSEQSUB'; +SYS_XQSEQTYPMATCH : 'SYS_XQSEQTYPMATCH'; +SYS_XQSTARTSWITH : 'SYS_XQSTARTSWITH'; +SYS_XQSTATBURI : 'SYS_XQSTATBURI'; +SYS_XQSTR2CODEP : 'SYS_XQSTR2CODEP'; +SYS_XQSTRJOIN : 'SYS_XQSTRJOIN'; +SYS_XQSUBSTRAFT : 'SYS_XQSUBSTRAFT'; +SYS_XQSUBSTRBEF : 'SYS_XQSUBSTRBEF'; +SYS_XQTOKENIZE : 'SYS_XQTOKENIZE'; +SYS_XQTREATAS : 'SYS_XQTREATAS'; +SYS_XQ_UPKXML2SQL : 'SYS_XQ_UPKXML2SQL'; +SYS_XQXFORM : 'SYS_XQXFORM'; +SYS_XSID_TO_RAW : 'SYS_XSID_TO_RAW'; +SYS_ZMAP_FILTER : 'SYS_ZMAP_FILTER'; +SYS_ZMAP_REFRESH : 'SYS_ZMAP_REFRESH'; +T_LETTER : 'T'; +TABLE_LOOKUP_BY_NL : 'TABLE_LOOKUP_BY_NL'; +TABLESPACE_NO : 'TABLESPACE_NO'; +TABLESPACE : 'TABLESPACE'; +TABLES : 'TABLES'; +TABLE_STATS : 'TABLE_STATS'; +TABLE : 'TABLE'; +TABNO : 'TABNO'; +TAG : 'TAG'; +TANH : 'TANH'; +TAN : 'TAN'; +TBLORIDXPARTNUM : 'TBL$OR$IDX$PART$NUM'; +TEMPFILE : 'TEMPFILE'; +TEMPLATE : 'TEMPLATE'; +TEMPORARY : 'TEMPORARY'; +TEMP_TABLE : 'TEMP_TABLE'; +TEST : 'TEST'; +TEXT : 'TEXT'; +THAN : 'THAN'; +THEN : 'THEN'; +THE : 'THE'; +THREAD : 'THREAD'; +THROUGH : 'THROUGH'; +TIER : 'TIER'; +TIES : 'TIES'; +TIMEOUT : 'TIMEOUT'; +TIMESTAMP_LTZ_UNCONSTRAINED : 'TIMESTAMP_LTZ_UNCONSTRAINED'; +TIMESTAMP : 'TIMESTAMP'; +TIMESTAMP_TZ_UNCONSTRAINED : 'TIMESTAMP_TZ_UNCONSTRAINED'; +TIMESTAMP_UNCONSTRAINED : 'TIMESTAMP_UNCONSTRAINED'; +TIMES : 'TIMES'; +TIME : 'TIME'; +TIMEZONE : 'TIMEZONE'; +TIMEZONE_ABBR : 'TIMEZONE_ABBR'; +TIMEZONE_HOUR : 'TIMEZONE_HOUR'; +TIMEZONE_MINUTE : 'TIMEZONE_MINUTE'; +TIMEZONE_OFFSET : 'TIMEZONE_OFFSET'; +TIMEZONE_REGION : 'TIMEZONE_REGION'; +TIME_ZONE : 'TIME_ZONE'; +TIMING : 'TIMING'; +TIV_GB : 'TIV_GB'; +TIV_SSF : 'TIV_SSF'; +TO_ACLID : 'TO_ACLID'; +TO_BINARY_DOUBLE : 'TO_BINARY_DOUBLE'; +TO_BINARY_FLOAT : 'TO_BINARY_FLOAT'; +TO_BLOB : 'TO_BLOB'; +TO_CLOB : 'TO_CLOB'; +TO_DSINTERVAL : 'TO_DSINTERVAL'; +TO_LOB : 'TO_LOB'; +TO_MULTI_BYTE : 'TO_MULTI_BYTE'; +TO_NCHAR : 'TO_NCHAR'; +TO_NCLOB : 'TO_NCLOB'; +TO_NUMBER : 'TO_NUMBER'; +TOPLEVEL : 'TOPLEVEL'; +TO_SINGLE_BYTE : 'TO_SINGLE_BYTE'; +TO_TIMESTAMP : 'TO_TIMESTAMP'; +TO_TIMESTAMP_TZ : 'TO_TIMESTAMP_TZ'; +TO_TIME : 'TO_TIME'; +TO_TIME_TZ : 'TO_TIME_TZ'; +TO : 'TO'; +TO_YMINTERVAL : 'TO_YMINTERVAL'; +TRACE : 'TRACE'; +TRACING : 'TRACING'; +TRACKING : 'TRACKING'; +TRAILING : 'TRAILING'; +TRANSACTION : 'TRANSACTION'; +TRANSFORM : 'TRANSFORM'; +TRANSFORM_DISTINCT_AGG : 'TRANSFORM_DISTINCT_AGG'; +TRANSITIONAL : 'TRANSITIONAL'; +TRANSITION : 'TRANSITION'; +TRANSLATE : 'TRANSLATE'; +TRANSLATION : 'TRANSLATION'; +TREAT : 'TREAT'; +TRIGGERS : 'TRIGGERS'; +TRIGGER : 'TRIGGER'; +TRUE : 'TRUE'; +TRUNCATE : 'TRUNCATE'; +TRUNC : 'TRUNC'; +TRUSTED : 'TRUSTED'; +TRUST : 'TRUST'; +TUNING : 'TUNING'; +TX : 'TX'; +TYPES : 'TYPES'; +TYPE : 'TYPE'; +TZ_OFFSET : 'TZ_OFFSET'; +UB2 : 'UB2'; +UBA : 'UBA'; +UCS2 : 'UCS2'; +UID : 'UID'; +UNARCHIVED : 'UNARCHIVED'; +UNBOUNDED : 'UNBOUNDED'; +UNBOUND : 'UNBOUND'; +UNCONDITIONAL : 'UNCONDITIONAL'; +UNDER : 'UNDER'; +UNDO : 'UNDO'; +UNDROP : 'UNDROP'; +UNIFORM : 'UNIFORM'; +UNION : 'UNION'; +UNIQUE : 'UNIQUE'; +UNISTR : 'UNISTR'; +UNLIMITED : 'UNLIMITED'; +UNLOAD : 'UNLOAD'; +UNLOCK : 'UNLOCK'; +UNMATCHED : 'UNMATCHED'; +UNNEST_INNERJ_DISTINCT_VIEW : 'UNNEST_INNERJ_DISTINCT_VIEW'; +UNNEST_NOSEMIJ_NODISTINCTVIEW : 'UNNEST_NOSEMIJ_NODISTINCTVIEW'; +UNNEST_SEMIJ_VIEW : 'UNNEST_SEMIJ_VIEW'; +UNNEST : 'UNNEST'; +UNPACKED : 'UNPACKED'; +UNPIVOT : 'UNPIVOT'; +UNPLUG : 'UNPLUG'; +UNPROTECTED : 'UNPROTECTED'; +UNQUIESCE : 'UNQUIESCE'; +UNRECOVERABLE : 'UNRECOVERABLE'; +UNRESTRICTED : 'UNRESTRICTED'; +UNSUBSCRIBE : 'UNSUBSCRIBE'; +UNTIL : 'UNTIL'; +UNUSABLE : 'UNUSABLE'; +UNUSED : 'UNUSED'; +UPDATABLE : 'UPDATABLE'; +UPDATED : 'UPDATED'; +UPDATE : 'UPDATE'; +UPDATEXML : 'UPDATEXML'; +UPD_INDEXES : 'UPD_INDEXES'; +UPD_JOININDEX : 'UPD_JOININDEX'; +UPGRADE : 'UPGRADE'; +UPPER : 'UPPER'; +UPSERT : 'UPSERT'; +UROWID : 'UROWID'; +USABLE : 'USABLE'; +USAGE : 'USAGE'; +USE_ANTI : 'USE_ANTI'; +USE_CONCAT : 'USE_CONCAT'; +USE_CUBE : 'USE_CUBE'; +USE_HASH_AGGREGATION : 'USE_HASH_AGGREGATION'; +USE_HASH_GBY_FOR_PUSHDOWN : 'USE_HASH_GBY_FOR_PUSHDOWN'; +USE_HASH : 'USE_HASH'; +USE_HIDDEN_PARTITIONS : 'USE_HIDDEN_PARTITIONS'; +USE_INVISIBLE_INDEXES : 'USE_INVISIBLE_INDEXES'; +USE_MERGE_CARTESIAN : 'USE_MERGE_CARTESIAN'; +USE_MERGE : 'USE_MERGE'; +USE_NL : 'USE_NL'; +USE_NL_WITH_INDEX : 'USE_NL_WITH_INDEX'; +USE_PRIVATE_OUTLINES : 'USE_PRIVATE_OUTLINES'; +USER_DATA : 'USER_DATA'; +USER_DEFINED : 'USER_DEFINED'; +USERENV : 'USERENV'; +USERGROUP : 'USERGROUP'; +USER_RECYCLEBIN : 'USER_RECYCLEBIN'; +USERS : 'USERS'; +USER_TABLESPACES : 'USER_TABLESPACES'; +USER : 'USER'; +USE_SEMI : 'USE_SEMI'; +USE_STORED_OUTLINES : 'USE_STORED_OUTLINES'; +USE_TTT_FOR_GSETS : 'USE_TTT_FOR_GSETS'; +USE : 'USE'; +USE_VECTOR_AGGREGATION : 'USE_VECTOR_AGGREGATION'; +USE_WEAK_NAME_RESL : 'USE_WEAK_NAME_RESL'; +USING_NO_EXPAND : 'USING_NO_EXPAND'; +USING : 'USING'; +UTF16BE : 'UTF16BE'; +UTF16LE : 'UTF16LE'; +UTF32 : 'UTF32'; +UTF8 : 'UTF8'; +V1 : 'V1'; +V2 : 'V2'; +VALIDATE : 'VALIDATE'; +VALIDATE_CONVERSION : 'VALIDATE_CONVERSION'; +VALIDATION : 'VALIDATION'; +VALID_TIME_END : 'VALID_TIME_END'; +VALUES : 'VALUES'; +VALUE : 'VALUE'; +VARCHAR2 : 'VARCHAR2'; +VARCHAR : 'VARCHAR'; +VARIABLE : 'VARIABLE'; +VAR_POP : 'VAR_POP'; +VARRAYS : 'VARRAYS'; +VARRAY : 'VARRAY'; +VAR_SAMP : 'VAR_SAMP'; +VARYING : 'VARYING'; +VECTOR_READ_TRACE : 'VECTOR_READ_TRACE'; +VECTOR_READ : 'VECTOR_READ'; +VECTOR_TRANSFORM_DIMS : 'VECTOR_TRANSFORM_DIMS'; +VECTOR_TRANSFORM_FACT : 'VECTOR_TRANSFORM_FACT'; +VECTOR_TRANSFORM : 'VECTOR_TRANSFORM'; +VERIFIER : 'VERIFIER'; +VERIFY : 'VERIFY'; +VERSIONING : 'VERSIONING'; +VERSIONS_ENDSCN : 'VERSIONS_ENDSCN'; +VERSIONS_ENDTIME : 'VERSIONS_ENDTIME'; +VERSIONS_OPERATION : 'VERSIONS_OPERATION'; +VERSIONS_STARTSCN : 'VERSIONS_STARTSCN'; +VERSIONS_STARTTIME : 'VERSIONS_STARTTIME'; +VERSIONS : 'VERSIONS'; +VERSIONS_XID : 'VERSIONS_XID'; +VERSION : 'VERSION'; +VIEW : 'VIEW'; +VIOLATION : 'VIOLATION'; +VIRTUAL : 'VIRTUAL'; +VISIBILITY : 'VISIBILITY'; +VISIBLE : 'VISIBLE'; +VOLUME : 'VOLUME'; +VSIZE : 'VSIZE'; +WAIT : 'WAIT'; +WALLET : 'WALLET'; +WARNING : 'WARNING'; +WEEKS : 'WEEKS'; +WEEK : 'WEEK'; +WELLFORMED : 'WELLFORMED'; +WHENEVER : 'WHENEVER'; +WHEN : 'WHEN'; +WHERE : 'WHERE'; +WHILE : 'WHILE'; +WHITESPACE : 'WHITESPACE'; +WIDTH_BUCKET : 'WIDTH_BUCKET'; +WITHIN : 'WITHIN'; +WITHOUT : 'WITHOUT'; +WITH_PLSQL : 'WITH_PLSQL'; +WITH : 'WITH'; +WORK : 'WORK'; +WRAPPED : 'WRAPPED'; +WRAPPER : 'WRAPPER'; +WRITE : 'WRITE'; +XDB_FASTPATH_INSERT : 'XDB_FASTPATH_INSERT'; +XDB : 'XDB'; +X_DYN_PRUNE : 'X_DYN_PRUNE'; +XID : 'XID'; +XML2OBJECT : 'XML2OBJECT'; +XMLAGG : 'XMLAGG'; +XMLATTRIBUTES : 'XMLATTRIBUTES'; +XMLCAST : 'XMLCAST'; +XMLCDATA : 'XMLCDATA'; +XMLCOLATTVAL : 'XMLCOLATTVAL'; +XMLCOMMENT : 'XMLCOMMENT'; +XMLCONCAT : 'XMLCONCAT'; +XMLDIFF : 'XMLDIFF'; +XML_DML_RWT_STMT : 'XML_DML_RWT_STMT'; +XMLELEMENT : 'XMLELEMENT'; +XMLEXISTS2 : 'XMLEXISTS2'; +XMLEXISTS : 'XMLEXISTS'; +XMLFOREST : 'XMLFOREST'; +XMLINDEX : 'XMLINDEX'; +XMLINDEX_REWRITE_IN_SELECT : 'XMLINDEX_REWRITE_IN_SELECT'; +XMLINDEX_REWRITE : 'XMLINDEX_REWRITE'; +XMLINDEX_SEL_IDX_TBL : 'XMLINDEX_SEL_IDX_TBL'; +XMLISNODE : 'XMLISNODE'; +XMLISVALID : 'XMLISVALID'; +XMLNAMESPACES : 'XMLNAMESPACES'; +XMLPARSE : 'XMLPARSE'; +XMLPATCH : 'XMLPATCH'; +XMLPI : 'XMLPI'; +XMLQUERYVAL : 'XMLQUERYVAL'; +XMLQUERY : 'XMLQUERY'; +XMLROOT : 'XMLROOT'; +XMLSCHEMA : 'XMLSCHEMA'; +XMLSERIALIZE : 'XMLSERIALIZE'; +XMLTABLE : 'XMLTABLE'; +XMLTRANSFORMBLOB : 'XMLTRANSFORMBLOB'; +XMLTRANSFORM : 'XMLTRANSFORM'; +XMLTYPE : 'XMLTYPE'; +XML : 'XML'; +XPATHTABLE : 'XPATHTABLE'; +XS_SYS_CONTEXT : 'XS_SYS_CONTEXT'; +XS : 'XS'; +XTRANSPORT : 'XTRANSPORT'; +YEARS : 'YEARS'; +YEAR : 'YEAR'; +YES : 'YES'; +YMINTERVAL_UNCONSTRAINED : 'YMINTERVAL_UNCONSTRAINED'; +ZONEMAP : 'ZONEMAP'; +ZONE : 'ZONE'; +PREDICTION : 'PREDICTION'; +PREDICTION_BOUNDS : 'PREDICTION_BOUNDS'; +PREDICTION_COST : 'PREDICTION_COST'; +PREDICTION_DETAILS : 'PREDICTION_DETAILS'; +PREDICTION_PROBABILITY : 'PREDICTION_PROBABILITY'; +PREDICTION_SET : 'PREDICTION_SET'; -BLOCKCHAIN: 'BLOCKCHAIN'; -COLLATE: 'COLLATE'; -COLLATION: 'COLLATION'; -DEFINITION: 'DEFINITION'; -DUPLICATED: 'DUPLICATED'; -EXTENDED: 'EXTENDED'; -HASHING: 'HASHING'; -IDLE: 'IDLE'; -IMMUTABLE: 'IMMUTABLE'; -ORACLE_DATAPUMP: 'ORACLE_DATAPUMP'; -ORACLE_HDFS: 'ORACLE_HDFS'; -ORACLE_HIVE: 'ORACLE_HIVE'; -ORACLE_LOADER: 'ORACLE_LOADER'; -SHA2_512_Q: '"SHA2_512"'; -SHARDED: 'SHARDED'; -V1_Q: '"V1"'; +BLOCKCHAIN : 'BLOCKCHAIN'; +COLLATE : 'COLLATE'; +COLLATION : 'COLLATION'; +DEFINITION : 'DEFINITION'; +DUPLICATED : 'DUPLICATED'; +EXTENDED : 'EXTENDED'; +HASHING : 'HASHING'; +IDLE : 'IDLE'; +IMMUTABLE : 'IMMUTABLE'; +ORACLE_DATAPUMP : 'ORACLE_DATAPUMP'; +ORACLE_HDFS : 'ORACLE_HDFS'; +ORACLE_HIVE : 'ORACLE_HIVE'; +ORACLE_LOADER : 'ORACLE_LOADER'; +SHA2_512_Q : '"SHA2_512"'; +SHARDED : 'SHARDED'; +V1_Q : '"V1"'; -ISOLATE: 'ISOLATE'; -ROOT: 'ROOT'; -UNITE: 'UNITE'; -ALGORITHM: 'ALGORITHM'; +ISOLATE : 'ISOLATE'; +ROOT : 'ROOT'; +UNITE : 'UNITE'; +ALGORITHM : 'ALGORITHM'; -CUME_DIST: 'CUME_DIST'; -DENSE_RANK: 'DENSE_RANK'; -LISTAGG: 'LISTAGG'; -PERCENT_RANK: 'PERCENT_RANK'; -PERCENTILE_CONT: 'PERCENTILE_CONT'; -PERCENTILE_DISC: 'PERCENTILE_DISC'; -RANK: 'RANK'; +CUME_DIST : 'CUME_DIST'; +DENSE_RANK : 'DENSE_RANK'; +LISTAGG : 'LISTAGG'; +PERCENT_RANK : 'PERCENT_RANK'; +PERCENTILE_CONT : 'PERCENTILE_CONT'; +PERCENTILE_DISC : 'PERCENTILE_DISC'; +RANK : 'RANK'; -AVG: 'AVG'; -CORR: 'CORR'; -COVAR_: 'COVAR_'; -DECODE: 'DECODE'; -LAG: 'LAG'; -LAG_DIFF: 'LAG_DIFF'; -LAG_DIFF_PERCENT: 'LAG_DIFF_PERCENT'; -LEAD: 'LEAD'; -MAX: 'MAX'; -MEDIAN: 'MEDIAN'; -MEMOPTIMIZE: 'MEMOPTIMIZE'; -MIN: 'MIN'; -NTILE: 'NTILE'; -NVL: 'NVL'; -RATIO_TO_REPORT: 'RATIO_TO_REPORT'; -REGR_: 'REGR_'; -ROUND: 'ROUND'; -ROW_NUMBER: 'ROW_NUMBER'; -SUBSTR: 'SUBSTR'; -TO_CHAR: 'TO_CHAR'; -TRIM: 'TRIM'; -SUM: 'SUM'; -STDDEV: 'STDDEV'; -VAR_: 'VAR_'; -VARIANCE: 'VARIANCE'; -LEAST: 'LEAST'; -GREATEST: 'GREATEST'; -TO_DATE: 'TO_DATE'; +AVG : 'AVG'; +CORR : 'CORR'; +COVAR_ : 'COVAR_'; +DECODE : 'DECODE'; +LAG : 'LAG'; +LAG_DIFF : 'LAG_DIFF'; +LAG_DIFF_PERCENT : 'LAG_DIFF_PERCENT'; +LEAD : 'LEAD'; +MAX : 'MAX'; +MEDIAN : 'MEDIAN'; +MEMOPTIMIZE : 'MEMOPTIMIZE'; +MIN : 'MIN'; +NTILE : 'NTILE'; +NVL : 'NVL'; +RATIO_TO_REPORT : 'RATIO_TO_REPORT'; +REGR_ : 'REGR_'; +ROUND : 'ROUND'; +ROW_NUMBER : 'ROW_NUMBER'; +SUBSTR : 'SUBSTR'; +TO_CHAR : 'TO_CHAR'; +TRIM : 'TRIM'; +SUM : 'SUM'; +STDDEV : 'STDDEV'; +VAR_ : 'VAR_'; +VARIANCE : 'VARIANCE'; +LEAST : 'LEAST'; +GREATEST : 'GREATEST'; +TO_DATE : 'TO_DATE'; // Rule #358 - subtoken typecast in , it also incorporates // Lowercase 'n' is a usual addition to the standard -NATIONAL_CHAR_STRING_LIT: 'N' '\'' (~('\'' | '\r' | '\n' ) | '\'' '\'' | NEWLINE)* '\''; +NATIONAL_CHAR_STRING_LIT: 'N' '\'' (~('\'' | '\r' | '\n') | '\'' '\'' | NEWLINE)* '\''; // Rule #040 - subtoken typecast in // Lowercase 'b' is a usual addition to the standard @@ -2361,9 +2366,9 @@ BIT_STRING_LIT: 'B' ('\'' [01]* '\'')+; // Rule #284 - subtoken typecast in // Lowercase 'x' is a usual addition to the standard -HEX_STRING_LIT: 'X' ('\'' [A-Fa-f0-9]* '\'')+; -DOUBLE_PERIOD: '..'; -PERIOD: '.'; +HEX_STRING_LIT : 'X' ('\'' [A-Fa-f0-9]* '\'')+; +DOUBLE_PERIOD : '..'; +PERIOD : '.'; //{ Rule #238 // This rule is a bit tricky - it resolves the ambiguity with @@ -2381,89 +2386,92 @@ PERIOD: '.'; (D | F)? ;*/ -UNSIGNED_INTEGER: [0-9]+; -APPROXIMATE_NUM_LIT: FLOAT_FRAGMENT ('E' ('+'|'-')? (FLOAT_FRAGMENT | [0-9]+))? ('D' | 'F')?; - +UNSIGNED_INTEGER : [0-9]+; +APPROXIMATE_NUM_LIT : FLOAT_FRAGMENT ('E' ('+' | '-')? (FLOAT_FRAGMENT | [0-9]+))? ('D' | 'F')?; // Rule #--- is a base for Rule #065 , it incorporates // and a superfluous subtoken typecasting of the "QUOTE" -CHAR_STRING: '\'' (~('\'' | '\r' | '\n') | '\'' '\'' | NEWLINE)* '\''; +CHAR_STRING: '\'' (~('\'' | '\r' | '\n') | '\'' '\'' | NEWLINE)* '\''; // See https://livesql.oracle.com/apex/livesql/file/content_CIREYU9EA54EOKQ7LAMZKRF6P.html // TODO: context sensitive string quotes (any characted after quote) -CHAR_STRING_PERL : 'Q' '\'' (QS_ANGLE | QS_BRACE | QS_BRACK | QS_PAREN | QS_EXCLAM | QS_SHARP | QS_QUOTE | QS_DQUOTE) '\'' -> type(CHAR_STRING); -fragment QS_ANGLE : '<' .*? '>'; -fragment QS_BRACE : '{' .*? '}'; -fragment QS_BRACK : '[' .*? ']'; -fragment QS_PAREN : '(' .*? ')'; -fragment QS_EXCLAM : '!' .*? '!'; -fragment QS_SHARP : '#' .*? '#'; -fragment QS_QUOTE : '\'' .*? '\''; -fragment QS_DQUOTE : '"' .*? '"'; +CHAR_STRING_PERL: + 'Q' '\'' ( + QS_ANGLE + | QS_BRACE + | QS_BRACK + | QS_PAREN + | QS_EXCLAM + | QS_SHARP + | QS_QUOTE + | QS_DQUOTE + ) '\'' -> type(CHAR_STRING); +fragment QS_ANGLE : '<' .*? '>'; +fragment QS_BRACE : '{' .*? '}'; +fragment QS_BRACK : '[' .*? ']'; +fragment QS_PAREN : '(' .*? ')'; +fragment QS_EXCLAM : '!' .*? '!'; +fragment QS_SHARP : '#' .*? '#'; +fragment QS_QUOTE : '\'' .*? '\''; +fragment QS_DQUOTE : '"' .*? '"'; -DELIMITED_ID: '"' (~('"' | '\r' | '\n') | '"' '"')+ '"' ; +DELIMITED_ID: '"' (~('"' | '\r' | '\n') | '"' '"')+ '"'; -PERCENT: '%'; -AMPERSAND: '&'; -LEFT_PAREN: '('; -RIGHT_PAREN: ')'; -DOUBLE_ASTERISK: '**'; -ASTERISK: '*'; -PLUS_SIGN: '+'; -MINUS_SIGN: '-'; -COMMA: ','; -SOLIDUS: '/'; -AT_SIGN: '@'; -ASSIGN_OP: ':='; -HASH_OP: '#'; +PERCENT : '%'; +AMPERSAND : '&'; +LEFT_PAREN : '('; +RIGHT_PAREN : ')'; +DOUBLE_ASTERISK : '**'; +ASTERISK : '*'; +PLUS_SIGN : '+'; +MINUS_SIGN : '-'; +COMMA : ','; +SOLIDUS : '/'; +AT_SIGN : '@'; +ASSIGN_OP : ':='; +HASH_OP : '#'; -SQ: '\''; +SQ: '\''; -BINDVAR - : ':' SIMPLE_LETTER (SIMPLE_LETTER | [0-9] | '_')* - | ':' DELIMITED_ID // not used in SQL but spotted in v$sqltext when using cursor_sharing +BINDVAR: + ':' SIMPLE_LETTER (SIMPLE_LETTER | [0-9] | '_')* + | ':' DELIMITED_ID // not used in SQL but spotted in v$sqltext when using cursor_sharing | ':' UNSIGNED_INTEGER - | QUESTION_MARK // not in SQL, not in Oracle, not in OCI, use this for JDBC - ; + | QUESTION_MARK; // not in SQL, not in Oracle, not in OCI, use this for JDBC -NOT_EQUAL_OP: '!=' - | '<>' - | '^=' - | '~=' - ; -CARRET_OPERATOR_PART: '^'; -TILDE_OPERATOR_PART: '~'; -EXCLAMATION_OPERATOR_PART: '!'; -GREATER_THAN_OP: '>'; -LESS_THAN_OP: '<'; -COLON: ':'; -SEMICOLON: ';'; +NOT_EQUAL_OP : '!=' | '<>' | '^=' | '~='; +CARRET_OPERATOR_PART : '^'; +TILDE_OPERATOR_PART : '~'; +EXCLAMATION_OPERATOR_PART : '!'; +GREATER_THAN_OP : '>'; +LESS_THAN_OP : '<'; +COLON : ':'; +SEMICOLON : ';'; -BAR: '|'; -EQUALS_OP: '='; +BAR : '|'; +EQUALS_OP : '='; -LEFT_BRACKET: '['; -RIGHT_BRACKET: ']'; +LEFT_BRACKET : '['; +RIGHT_BRACKET : ']'; INTRODUCER: '_'; // Comments https://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements006.htm -SINGLE_LINE_COMMENT: '--' ~('\r' | '\n')* NEWLINE_EOF -> channel(HIDDEN); -MULTI_LINE_COMMENT: '/*' .*? '*/' -> channel(HIDDEN); +SINGLE_LINE_COMMENT : '--' ~('\r' | '\n')* NEWLINE_EOF -> channel(HIDDEN); +MULTI_LINE_COMMENT : '/*' .*? '*/' -> channel(HIDDEN); // https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve034.htm#SQPUG054 -REMARK_COMMENT: 'REM' {this.IsNewlineAtPos(-4)}? 'ARK'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF -> channel(HIDDEN); +REMARK_COMMENT: + 'REM' {this.IsNewlineAtPos(-4)}? 'ARK'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF -> channel(HIDDEN); // https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve032.htm#SQPUG052 -PROMPT_MESSAGE: 'PRO' {this.IsNewlineAtPos(-4)}? 'MPT'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF; +PROMPT_MESSAGE: 'PRO' {this.IsNewlineAtPos(-4)}? 'MPT'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF; // TODO: should starts with newline START_CMD //: 'STA' 'RT'? SPACE ~('\r' | '\n')* NEWLINE_EOF - // https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12002.htm - // https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12003.htm - : '@' {this.IsNewlineAtPos(-2)}? '@'? ~('\r' | '\n')* NEWLINE_EOF - ; + : // https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12002.htm + '@' {this.IsNewlineAtPos(-2)}? '@'? ~('\r' | '\n')* NEWLINE_EOF; // https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12003.htm REGULAR_ID: SIMPLE_LETTER (SIMPLE_LETTER | '$' | '_' | '#' | [0-9])*; diff --git a/src/grammar/plsql/PlSqlParser.g4 b/src/grammar/plsql/PlSqlParser.g4 index 02ca62a..5fe5a75 100644 --- a/src/grammar/plsql/PlSqlParser.g4 +++ b/src/grammar/plsql/PlSqlParser.g4 @@ -1,4 +1,4 @@ - /** +/** * Oracle(c) PL/SQL 11g Parser * * Copyright (c) 2009-2011 Alexandre Porcelli @@ -23,17 +23,24 @@ * Reference: https://github.com/antlr/grammars-v4/blob/master/sql/plsql/PlSqlParser.g4 */ +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging +// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true + parser grammar PlSqlParser; options { tokenVocab=PlSqlLexer; superClass=PlSqlBaseParser; } + @parser::header { import PlSqlBaseParser from './PlSqlBaseParser'; } -program: sql_script SEMICOLON? EOF; +program + : sql_script SEMICOLON? EOF + ; sql_script : (unit_statement | sql_plus_command)* @@ -58,17 +65,14 @@ unit_statement | alter_materialized_view_log | alter_user | alter_view - | analyze | associate_statistics | audit_traditional | unified_auditing - | create_function_body | create_procedure_body | create_package | create_package_body - | create_index | create_table | create_tablespace @@ -79,12 +83,10 @@ unit_statement | create_materialized_view | create_materialized_view_log | create_user - | create_sequence | create_trigger | create_type | create_synonym - | drop_function | drop_package | drop_procedure @@ -95,16 +97,11 @@ unit_statement | drop_table | drop_view | drop_index - | rename_object - | comment_on_column | comment_on_table - | anonymous_block - | grant_statement - | procedure_call ; @@ -121,9 +118,15 @@ alter_function ; create_function_body - : CREATE (OR REPLACE)? FUNCTION function_name ('(' parameter (',' parameter)* ')')? - RETURN type_spec (invoker_rights_clause | parallel_enable_clause | result_cache_clause | DETERMINISTIC)* - ((PIPELINED? (IS | AS) (DECLARE? seq_of_declare_specs? body | call_spec)) | (PIPELINED | AGGREGATE) USING implementation_type_name) ';' + : CREATE (OR REPLACE)? FUNCTION function_name ('(' parameter (',' parameter)* ')')? RETURN type_spec ( + invoker_rights_clause + | parallel_enable_clause + | result_cache_clause + | DETERMINISTIC + )* ( + (PIPELINED? (IS | AS) (DECLARE? seq_of_declare_specs? body | call_spec)) + | (PIPELINED | AGGREGATE) USING implementation_type_name + ) ';' ; // Creation Function - Specific Clauses @@ -155,15 +158,22 @@ drop_package ; alter_package - : ALTER PACKAGE package_name COMPILE DEBUG? (PACKAGE | BODY | SPECIFICATION)? compiler_parameters_clause* (REUSE SETTINGS)? ';' + : ALTER PACKAGE package_name COMPILE DEBUG? (PACKAGE | BODY | SPECIFICATION)? compiler_parameters_clause* ( + REUSE SETTINGS + )? ';' ; create_package - : CREATE (OR REPLACE)? PACKAGE (schema_object_name '.')? package_name invoker_rights_clause? (IS | AS) package_obj_spec* END package_name? ';' + : CREATE (OR REPLACE)? PACKAGE (schema_object_name '.')? package_name invoker_rights_clause? ( + IS + | AS + ) package_obj_spec* END package_name? ';' ; create_package_body - : CREATE (OR REPLACE)? PACKAGE BODY (schema_object_name '.')? package_name (IS | AS) package_obj_body* (BEGIN seq_of_statements)? END package_name? ';' + : CREATE (OR REPLACE)? PACKAGE BODY (schema_object_name '.')? package_name (IS | AS) package_obj_body* ( + BEGIN seq_of_statements + )? END package_name? ';' ; // Create Package Specific Clauses @@ -180,12 +190,13 @@ package_obj_spec ; procedure_spec - : PROCEDURE identifier ('(' parameter ( ',' parameter )* ')')? ';' + : PROCEDURE identifier ('(' parameter ( ',' parameter)* ')')? ';' ; function_spec - : FUNCTION identifier ('(' parameter ( ',' parameter)* ')')? - RETURN type_spec PIPELINED? DETERMINISTIC? (RESULT_CACHE)? ';' + : FUNCTION identifier ('(' parameter ( ',' parameter)* ')')? RETURN type_spec PIPELINED? DETERMINISTIC? ( + RESULT_CACHE + )? ';' ; package_obj_body @@ -211,20 +222,30 @@ alter_procedure ; function_body - : FUNCTION identifier ('(' parameter (',' parameter)* ')')? - RETURN type_spec (invoker_rights_clause | parallel_enable_clause | result_cache_clause | DETERMINISTIC)* - ((PIPELINED? DETERMINISTIC? (IS | AS) (DECLARE? seq_of_declare_specs? body | call_spec)) | (PIPELINED | AGGREGATE) USING implementation_type_name) ';' + : FUNCTION identifier ('(' parameter (',' parameter)* ')')? RETURN type_spec ( + invoker_rights_clause + | parallel_enable_clause + | result_cache_clause + | DETERMINISTIC + )* ( + (PIPELINED? DETERMINISTIC? (IS | AS) (DECLARE? seq_of_declare_specs? body | call_spec)) + | (PIPELINED | AGGREGATE) USING implementation_type_name + ) ';' ; procedure_body - : PROCEDURE identifier ('(' parameter (',' parameter)* ')')? (IS | AS) - (DECLARE? seq_of_declare_specs? body | call_spec | EXTERNAL) ';' + : PROCEDURE identifier ('(' parameter (',' parameter)* ')')? (IS | AS) ( + DECLARE? seq_of_declare_specs? body + | call_spec + | EXTERNAL + ) ';' ; create_procedure_body - : CREATE (OR REPLACE)? PROCEDURE procedure_name ('(' parameter (',' parameter)* ')')? - invoker_rights_clause? (IS | AS) - (DECLARE? seq_of_declare_specs? body | call_spec | EXTERNAL) ';' + : CREATE (OR REPLACE)? PROCEDURE procedure_name ('(' parameter (',' parameter)* ')')? invoker_rights_clause? ( + IS + | AS + ) (DECLARE? seq_of_declare_specs? body | call_spec | EXTERNAL) ';' ; // Trigger DDLs @@ -234,14 +255,19 @@ drop_trigger ; alter_trigger - : ALTER TRIGGER alter_trigger_name=trigger_name - ((ENABLE | DISABLE) | RENAME TO rename_trigger_name=trigger_name | COMPILE DEBUG? compiler_parameters_clause* (REUSE SETTINGS)?) ';' + : ALTER TRIGGER alter_trigger_name=trigger_name ( + (ENABLE | DISABLE) + | RENAME TO rename_trigger_name=trigger_name + | COMPILE DEBUG? compiler_parameters_clause* (REUSE SETTINGS)? + ) ';' ; create_trigger - : CREATE ( OR REPLACE )? TRIGGER trigger_name - (simple_dml_trigger | compound_dml_trigger | non_dml_trigger) - trigger_follows_clause? (ENABLE | DISABLE)? trigger_when_clause? trigger_body ';' + : CREATE (OR REPLACE)? TRIGGER trigger_name ( + simple_dml_trigger + | compound_dml_trigger + | non_dml_trigger + ) trigger_follows_clause? (ENABLE | DISABLE)? trigger_when_clause? trigger_body ';' ; trigger_follows_clause @@ -330,14 +356,14 @@ drop_type ; alter_type - : ALTER TYPE type_name - (compile_type_clause - | replace_type_clause - //TODO | {input.LT(2).getText().equalsIgnoreCase("attribute")}? alter_attribute_definition - | alter_method_spec - | alter_collection_clauses - | modifier_clause - | overriding_subprogram_spec + : ALTER TYPE type_name ( + compile_type_clause + | replace_type_clause + //TODO | {input.LT(2).getText().equalsIgnoreCase("attribute")}? alter_attribute_definition + | alter_method_spec + | alter_collection_clauses + | modifier_clause + | overriding_subprogram_spec ) dependent_handling_clause? ';' ; @@ -383,8 +409,9 @@ type_definition ; object_type_def - : invoker_rights_clause? (object_as_part | object_under_part) sqlj_object_type? - ('(' object_member_spec (',' object_member_spec)* ')')? modifier_clause* + : invoker_rights_clause? (object_as_part | object_under_part) sqlj_object_type? ( + '(' object_member_spec (',' object_member_spec)* ')' + )? modifier_clause* ; object_as_part @@ -422,19 +449,23 @@ subprog_decl_in_type ; proc_decl_in_type - : PROCEDURE procedure_name '(' type_elements_parameter (',' type_elements_parameter)* ')' - (IS | AS) (call_spec | DECLARE? seq_of_declare_specs? body ';') + : PROCEDURE procedure_name '(' type_elements_parameter (',' type_elements_parameter)* ')' ( + IS + | AS + ) (call_spec | DECLARE? seq_of_declare_specs? body ';') ; func_decl_in_type - : FUNCTION function_name ('(' type_elements_parameter (',' type_elements_parameter)* ')')? - RETURN type_spec (IS | AS) (call_spec | DECLARE? seq_of_declare_specs? body ';') + : FUNCTION function_name ('(' type_elements_parameter (',' type_elements_parameter)* ')')? RETURN type_spec ( + IS + | AS + ) (call_spec | DECLARE? seq_of_declare_specs? body ';') ; constructor_declaration - : FINAL? INSTANTIABLE? CONSTRUCTOR FUNCTION type_spec - ('(' (SELF IN OUT type_spec ',') type_elements_parameter (',' type_elements_parameter)* ')')? - RETURN SELF AS RESULT (IS | AS) (call_spec | DECLARE? seq_of_declare_specs? body ';') + : FINAL? INSTANTIABLE? CONSTRUCTOR FUNCTION type_spec ( + '(' (SELF IN OUT type_spec ',') type_elements_parameter (',' type_elements_parameter)* ')' + )? RETURN SELF AS RESULT (IS | AS) (call_spec | DECLARE? seq_of_declare_specs? body ';') ; // Common Type Clauses @@ -472,24 +503,29 @@ overriding_subprogram_spec ; overriding_function_spec - : FUNCTION function_name ('(' type_elements_parameter (',' type_elements_parameter)* ')')? - RETURN (type_spec | SELF AS RESULT) - (PIPELINED? (IS | AS) (DECLARE? seq_of_declare_specs? body))? ';'? + : FUNCTION function_name ('(' type_elements_parameter (',' type_elements_parameter)* ')')? RETURN ( + type_spec + | SELF AS RESULT + ) (PIPELINED? (IS | AS) (DECLARE? seq_of_declare_specs? body))? ';'? ; type_procedure_spec - : PROCEDURE procedure_name '(' type_elements_parameter (',' type_elements_parameter)* ')' ((IS | AS) call_spec)? + : PROCEDURE procedure_name '(' type_elements_parameter (',' type_elements_parameter)* ')' ( + (IS | AS) call_spec + )? ; type_function_spec - : FUNCTION function_name ('(' type_elements_parameter (',' type_elements_parameter)* ')')? - RETURN (type_spec | SELF AS RESULT) ((IS | AS) call_spec | EXTERNAL VARIABLE? NAME expression)? + : FUNCTION function_name ('(' type_elements_parameter (',' type_elements_parameter)* ')')? RETURN ( + type_spec + | SELF AS RESULT + ) ((IS | AS) call_spec | EXTERNAL VARIABLE? NAME expression)? ; constructor_spec - : FINAL? INSTANTIABLE? CONSTRUCTOR FUNCTION - type_spec ('(' (SELF IN OUT type_spec ',') type_elements_parameter (',' type_elements_parameter)* ')')? - RETURN SELF AS RESULT ((IS | AS) call_spec)? + : FINAL? INSTANTIABLE? CONSTRUCTOR FUNCTION type_spec ( + '(' (SELF IN OUT type_spec ',') type_elements_parameter (',' type_elements_parameter)* ')' + )? RETURN SELF AS RESULT ((IS | AS) call_spec)? ; map_order_function_spec @@ -521,11 +557,13 @@ alter_sequence alter_session : ALTER SESSION ( - ADVISE ( COMMIT | ROLLBACK | NOTHING ) + ADVISE ( COMMIT | ROLLBACK | NOTHING) | CLOSE DATABASE LINK parameter_name | enable_or_disable COMMIT IN PROCEDURE | enable_or_disable GUARD - | (enable_or_disable | FORCE) PARALLEL (DML | DDL | QUERY) (PARALLEL (literal | parameter_name))? + | (enable_or_disable | FORCE) PARALLEL (DML | DDL | QUERY) ( + PARALLEL (literal | parameter_name) + )? | SET alter_session_set_clause ) ; @@ -559,10 +597,11 @@ sequence_start_clause ; create_index - : CREATE (UNIQUE | BITMAP)? INDEX index_name - ON (cluster_index_clause | table_index_clause | bitmap_join_index_clause) - UNUSABLE? - ';' + : CREATE (UNIQUE | BITMAP)? INDEX index_name ON ( + cluster_index_clause + | table_index_clause + | bitmap_join_index_clause + ) UNUSABLE? ';' ; cluster_index_clause @@ -574,13 +613,13 @@ cluster_name ; table_index_clause - : tableview_name table_alias? '(' index_expr (ASC | DESC)? (',' index_expr (ASC | DESC)? )* ')' - index_properties? + : tableview_name table_alias? '(' index_expr (ASC | DESC)? (',' index_expr (ASC | DESC)?)* ')' index_properties? ; + bitmap_join_index_clause - : tableview_name '(' (tableview_name | table_alias)? column_name (ASC | DESC)? (',' (tableview_name | table_alias)? column_name (ASC | DESC)? )* ')' - FROM tableview_name table_alias (',' tableview_name table_alias)* - where_clause local_partitioned_index? index_attributes? + : tableview_name '(' (tableview_name | table_alias)? column_name (ASC | DESC)? ( + ',' (tableview_name | table_alias)? column_name (ASC | DESC)? + )* ')' FROM tableview_name table_alias (',' tableview_name table_alias)* where_clause local_partitioned_index? index_attributes? ; index_expr @@ -594,43 +633,50 @@ index_properties ; domain_index_clause - : indextype local_domain_index_clause? parallel_clause? (PARAMETERS '(' odci_parameters ')' )? + : indextype local_domain_index_clause? parallel_clause? (PARAMETERS '(' odci_parameters ')')? ; local_domain_index_clause - : LOCAL ('(' PARTITION partition_name (PARAMETERS '(' odci_parameters ')' )? (',' PARTITION partition_name (PARAMETERS '(' odci_parameters ')' )? )* ')' )? + : LOCAL ( + '(' PARTITION partition_name (PARAMETERS '(' odci_parameters ')')? ( + ',' PARTITION partition_name (PARAMETERS '(' odci_parameters ')')? + )* ')' + )? ; xmlindex_clause - : (XDB '.')? XMLINDEX local_xmlindex_clause? - parallel_clause? //TODO xmlindex_parameters_clause? + : (XDB '.')? XMLINDEX local_xmlindex_clause? parallel_clause? //TODO xmlindex_parameters_clause? ; local_xmlindex_clause - : LOCAL ('(' PARTITION partition_name (',' PARTITION partition_name //TODO xmlindex_parameters_clause? - )* ')')? + : LOCAL ( + '(' PARTITION partition_name ( + ',' PARTITION partition_name //TODO xmlindex_parameters_clause? + )* ')' + )? ; global_partitioned_index - : GLOBAL PARTITION BY (RANGE '(' column_name (',' column_name)* ')' '(' index_partitioning_clause ')' - | HASH '(' column_name (',' column_name)* ')' - (individual_hash_partitions - | hash_partitions_by_quantity - ) - ) + : GLOBAL PARTITION BY ( + RANGE '(' column_name (',' column_name)* ')' '(' index_partitioning_clause ')' + | HASH '(' column_name (',' column_name)* ')' ( + individual_hash_partitions + | hash_partitions_by_quantity + ) + ) ; index_partitioning_clause - : PARTITION partition_name? VALUES LESS THAN '(' literal (',' literal)* ')' - segment_attributes_clause? + : PARTITION partition_name? VALUES LESS THAN '(' literal (',' literal)* ')' segment_attributes_clause? ; local_partitioned_index - : LOCAL (on_range_partitioned_table - | on_list_partitioned_table - | on_hash_partitioned_table - | on_comp_partitioned_table - )? + : LOCAL ( + on_range_partitioned_table + | on_list_partitioned_table + | on_hash_partitioned_table + | on_comp_partitioned_table + )? ; on_range_partitioned_table @@ -642,9 +688,7 @@ on_list_partitioned_table ; partitioned_table - : PARTITION partition_name? - (segment_attributes_clause | key_compression)* - UNUSABLE? + : PARTITION partition_name? (segment_attributes_clause | key_compression)* UNUSABLE? ; on_hash_partitioned_table @@ -653,18 +697,17 @@ on_hash_partitioned_table ; on_hash_partitioned_clause - : PARTITION partition_name? (TABLESPACE tablespace)? - key_compression? UNUSABLE? + : PARTITION partition_name? (TABLESPACE tablespace)? key_compression? UNUSABLE? ; + on_comp_partitioned_table - : (STORE IN '(' tablespace (',' tablespace)* ')' )? - '(' on_comp_partitioned_clause (',' on_comp_partitioned_clause)* ')' + : (STORE IN '(' tablespace (',' tablespace)* ')')? '(' on_comp_partitioned_clause ( + ',' on_comp_partitioned_clause + )* ')' ; on_comp_partitioned_clause - : PARTITION partition_name? - (segment_attributes_clause | key_compression)* - UNUSABLE index_subpartition_clause? + : PARTITION partition_name? (segment_attributes_clause | key_compression)* UNUSABLE index_subpartition_clause? ; index_subpartition_clause @@ -673,8 +716,7 @@ index_subpartition_clause ; index_subpartition_subclause - : SUBPARTITION subpartition_name? (TABLESPACE tablespace)? - key_compression? UNUSABLE? + : SUBPARTITION subpartition_name? (TABLESPACE tablespace)? key_compression? UNUSABLE? ; odci_parameters @@ -691,13 +733,14 @@ alter_index ; alter_index_ops_set1 - : ( deallocate_unused_clause - | allocate_extent_clause - | shrink_clause - | parallel_clause - | physical_attributes_clause - | logging_clause - )+ + : ( + deallocate_unused_clause + | allocate_extent_clause + | shrink_clause + | parallel_clause + | physical_attributes_clause + | logging_clause + )+ ; alter_index_ops_set2 @@ -725,20 +768,16 @@ monitoring_nomonitoring ; rebuild_clause - : REBUILD ( PARTITION partition_name - | SUBPARTITION subpartition_name - | REVERSE - | NOREVERSE - )? - ( parallel_clause - | TABLESPACE tablespace - | PARAMETERS '(' odci_parameters ')' -//TODO | xmlindex_parameters_clause - | ONLINE - | physical_attributes_clause - | key_compression - | logging_clause - )* + : REBUILD (PARTITION partition_name | SUBPARTITION subpartition_name | REVERSE | NOREVERSE)? ( + parallel_clause + | TABLESPACE tablespace + | PARAMETERS '(' odci_parameters ')' + //TODO | xmlindex_parameters_clause + | ONLINE + | physical_attributes_clause + | key_compression + | logging_clause + )* ; alter_index_partitioning @@ -753,16 +792,15 @@ alter_index_partitioning ; modify_index_default_attrs - : MODIFY DEFAULT ATTRIBUTES (FOR PARTITION partition_name)? - ( physical_attributes_clause - | TABLESPACE (tablespace | DEFAULT) - | logging_clause - ) + : MODIFY DEFAULT ATTRIBUTES (FOR PARTITION partition_name)? ( + physical_attributes_clause + | TABLESPACE (tablespace | DEFAULT) + | logging_clause + ) ; add_hash_index_partition - : ADD PARTITION partition_name? (TABLESPACE tablespace)? - key_compression? parallel_clause? + : ADD PARTITION partition_name? (TABLESPACE tablespace)? key_compression? parallel_clause? ; coalesce_index_partition @@ -770,13 +808,13 @@ coalesce_index_partition ; modify_index_partition - : MODIFY PARTITION partition_name - ( modify_index_partitions_ops+ + : MODIFY PARTITION partition_name ( + modify_index_partitions_ops+ | PARAMETERS '(' odci_parameters ')' | COALESCE | UPDATE BLOCK REFERENCES | UNUSABLE - ) + ) ; modify_index_partitions_ops @@ -788,8 +826,7 @@ modify_index_partitions_ops ; rename_index_partition - : RENAME (PARTITION partition_name | SUBPARTITION subpartition_name) - TO new_partition_name + : RENAME (PARTITION partition_name | SUBPARTITION subpartition_name) TO new_partition_name ; drop_index_partition @@ -797,23 +834,26 @@ drop_index_partition ; split_index_partition - : SPLIT PARTITION partition_name_old AT '(' literal (',' literal)* ')' - (INTO '(' index_partition_description ',' index_partition_description ')' ) ? parallel_clause? + : SPLIT PARTITION partition_name_old AT '(' literal (',' literal)* ')' ( + INTO '(' index_partition_description ',' index_partition_description ')' + )? parallel_clause? ; index_partition_description - : PARTITION (partition_name ( (segment_attributes_clause | key_compression)+ - | PARAMETERS '(' odci_parameters ')' - ) - UNUSABLE? - )? + : PARTITION ( + partition_name ( + (segment_attributes_clause | key_compression)+ + | PARAMETERS '(' odci_parameters ')' + ) UNUSABLE? + )? ; modify_index_subpartition - : MODIFY SUBPARTITION subpartition_name (UNUSABLE - | allocate_extent_clause - | deallocate_unused_clause - ) + : MODIFY SUBPARTITION subpartition_name ( + UNUSABLE + | allocate_extent_clause + | deallocate_unused_clause + ) ; partition_name_old @@ -829,26 +869,24 @@ new_index_name ; create_user - : CREATE USER - user_object_name - ( identified_by - | identified_other_clause - | user_tablespace_clause - | quota_clause - | profile_clause - | password_expire_clause - | user_lock_clause - | user_editions_clause - | container_clause - )+ ';' + : CREATE USER user_object_name ( + identified_by + | identified_other_clause + | user_tablespace_clause + | quota_clause + | profile_clause + | password_expire_clause + | user_lock_clause + | user_editions_clause + | container_clause + )+ ';' ; // The standard clauses only permit one user per statement. // The proxy clause allows multiple users for a proxy designation. alter_user - : ALTER USER - user_object_name - ( alter_identified_by + : ALTER USER user_object_name ( + alter_identified_by | identified_other_clause | user_tablespace_clause | quota_clause @@ -859,9 +897,8 @@ alter_user | alter_user_editions_clause | container_clause | container_data_clause - )+ - ';' - | user_object_name (',' user_object_name)* proxy_clause ';' + )+ ';' + | user_object_name (',' user_object_name)* proxy_clause ';' ; alter_identified_by @@ -915,13 +952,12 @@ alter_user_editions_clause proxy_clause : REVOKE CONNECT THROUGH (ENTERPRISE USERS | user_object_name) - | GRANT CONNECT THROUGH - ( ENTERPRISE USERS - | user_object_name - (WITH (NO ROLES | ROLE role_clause))? - (AUTHENTICATION REQUIRED)? - (AUTHENTICATED USING (PASSWORD | CERTIFICATE | DISTINGUISHED NAME))? - ) + | GRANT CONNECT THROUGH ( + ENTERPRISE USERS + | user_object_name (WITH (NO ROLES | ROLE role_clause))? (AUTHENTICATION REQUIRED)? ( + AUTHENTICATED USING (PASSWORD | CERTIFICATE | DISTINGUISHED NAME) + )? + ) ; container_names @@ -943,34 +979,26 @@ container_data_clause // https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_4005.htm#SQLRF01105 analyze - : ( ANALYZE (TABLE tableview_name | INDEX index_name) partition_extention_clause? - | ANALYZE CLUSTER cluster_name - ) - - ( validation_clauses - | LIST CHAINED ROWS into_clause1? - | DELETE SYSTEM? STATISTICS - ) - ';' + : ( + ANALYZE (TABLE tableview_name | INDEX index_name) partition_extention_clause? + | ANALYZE CLUSTER cluster_name + ) (validation_clauses | LIST CHAINED ROWS into_clause1? | DELETE SYSTEM? STATISTICS) ';' ; partition_extention_clause - : PARTITION ( '(' partition_name ')' - | FOR '(' partition_key_value (',' partition_key_value)* ')' - ) - | SUBPARTITION ( '(' subpartition_name ')' - | FOR '(' subpartition_key_value (',' subpartition_key_value)* ')' - ) + : PARTITION ( + '(' partition_name ')' + | FOR '(' partition_key_value (',' partition_key_value)* ')' + ) + | SUBPARTITION ( + '(' subpartition_name ')' + | FOR '(' subpartition_key_value (',' subpartition_key_value)* ')' + ) ; validation_clauses : VALIDATE REF UPDATE (SET DANGLING TO NULL_)? - | VALIDATE STRUCTURE - ( CASCADE FAST - | CASCADE online_or_offline? into_clause? - | CASCADE - )? - online_or_offline? into_clause? + | VALIDATE STRUCTURE (CASCADE FAST | CASCADE online_or_offline? into_clause? | CASCADE)? online_or_offline? into_clause? ; online_or_offline @@ -993,10 +1021,7 @@ subpartition_key_value //https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_4006.htm#SQLRF01106 associate_statistics - : ASSOCIATE STATISTICS - WITH (column_association | function_association) - storage_table_clause? - ';' + : ASSOCIATE STATISTICS WITH (column_association | function_association) storage_table_clause? ';' ; column_association @@ -1004,24 +1029,23 @@ column_association ; function_association - : ( FUNCTIONS function_name (',' function_name)* - | PACKAGES package_name (',' package_name)* - | TYPES type_name (',' type_name)* - | INDEXES index_name (',' index_name)* - | INDEXTYPES indextype_name (',' indextype_name)* - ) - - ( using_statistics_type - | default_cost_clause (',' default_selectivity_clause)? - | default_selectivity_clause (',' default_cost_clause)? - ) + : ( + FUNCTIONS function_name (',' function_name)* + | PACKAGES package_name (',' package_name)* + | TYPES type_name (',' type_name)* + | INDEXES index_name (',' index_name)* + | INDEXTYPES indextype_name (',' indextype_name)* + ) ( + using_statistics_type + | default_cost_clause (',' default_selectivity_clause)? + | default_selectivity_clause (',' default_cost_clause)? + ) ; indextype_name : id_expression ; - using_statistics_type : USING (statistics_type_name | NULL_) ; @@ -1060,13 +1084,12 @@ storage_table_clause // https://docs.oracle.com/database/121/SQLRF/statements_4008.htm#SQLRF56110 unified_auditing - : {this.isVersion12()}? - AUDIT (POLICY policy_name ((BY | EXCEPT) audit_user (',' audit_user)* )? - (WHENEVER NOT? SUCCESSFUL)? - | CONTEXT NAMESPACE oracle_namespace - ATTRIBUTES attribute_name (',' attribute_name)* (BY audit_user (',' audit_user)*)? - ) - ';' + : {this.isVersion12()}? AUDIT ( + POLICY policy_name ((BY | EXCEPT) audit_user (',' audit_user)*)? (WHENEVER NOT? SUCCESSFUL)? + | CONTEXT NAMESPACE oracle_namespace ATTRIBUTES attribute_name (',' attribute_name)* ( + BY audit_user (',' audit_user)* + )? + ) ';' ; policy_name @@ -1077,14 +1100,12 @@ policy_name // https://docs.oracle.com/database/121/SQLRF/statements_4007.htm#SQLRF01107 audit_traditional - : AUDIT ( audit_operation_clause (auditing_by_clause | IN SESSION CURRENT)? - | audit_schema_object_clause - | NETWORK - | audit_direct_path - ) - (BY (SESSION | ACCESS) )? (WHENEVER NOT? SUCCESSFUL)? - audit_container_clause? - ';' + : AUDIT ( + audit_operation_clause (auditing_by_clause | IN SESSION CURRENT)? + | audit_schema_object_clause + | NETWORK + | audit_direct_path + ) (BY (SESSION | ACCESS))? (WHENEVER NOT? SUCCESSFUL)? audit_container_clause? ';' ; audit_direct_path @@ -1096,9 +1117,10 @@ audit_container_clause ; audit_operation_clause - : ( (sql_statement_shortcut | ALL STATEMENTS?) (',' (sql_statement_shortcut | ALL STATEMENTS?) )* - | (system_privilege | ALL PRIVILEGES) (',' (system_privilege | ALL PRIVILEGES) )* - ) + : ( + (sql_statement_shortcut | ALL STATEMENTS?) (',' (sql_statement_shortcut | ALL STATEMENTS?))* + | (system_privilege | ALL PRIVILEGES) (',' (system_privilege | ALL PRIVILEGES))* + ) ; auditing_by_clause @@ -1110,7 +1132,7 @@ audit_user ; audit_schema_object_clause - : ( sql_operation (',' sql_operation)* | ALL) auditing_on_clause + : (sql_operation (',' sql_operation)* | ALL) auditing_on_clause ; sql_operation @@ -1131,12 +1153,13 @@ sql_operation ; auditing_on_clause - : ON ( object_name - | DIRECTORY regular_id - | MINING MODEL model_name - | {this.isVersion12()}? SQL TRANSLATION PROFILE profile_name - | DEFAULT - ) + : ON ( + object_name + | DIRECTORY regular_id + | MINING MODEL model_name + | {this.isVersion12()}? SQL TRANSLATION PROFILE profile_name + | DEFAULT + ) ; model_name @@ -1206,19 +1229,11 @@ rename_object ; grant_statement - : GRANT - ( ','? - (role_name - | system_privilege - | object_privilege paren_column_list? - ) - )+ - (ON grant_object_name)? - TO (grantee_name | PUBLIC) (',' (grantee_name | PUBLIC) )* - (WITH (ADMIN | DELEGATE) OPTION)? - (WITH HIERARCHY OPTION)? - (WITH GRANT OPTION)? - container_clause? ';' + : GRANT (','? (role_name | system_privilege | object_privilege paren_column_list?))+ ( + ON grant_object_name + )? TO (grantee_name | PUBLIC) (',' (grantee_name | PUBLIC))* (WITH (ADMIN | DELEGATE) OPTION)? ( + WITH HIERARCHY OPTION + )? (WITH GRANT OPTION)? container_clause? ';' ; container_clause @@ -1226,8 +1241,7 @@ container_clause ; create_directory - : CREATE (OR REPLACE)? DIRECTORY directory_name AS directory_path - ';' + : CREATE (OR REPLACE)? DIRECTORY directory_name AS directory_path ';' ; directory_name @@ -1241,11 +1255,10 @@ directory_path // https://docs.oracle.com/cd/E11882_01/appdev.112/e25519/alter_library.htm#LNPLS99946 // https://docs.oracle.com/database/121/LNPLS/alter_library.htm#LNPLS99946 alter_library - : ALTER LIBRARY library_name - ( COMPILE library_debug? compiler_parameters_clause* (REUSE SETTINGS)? - | library_editionable - ) - ';' + : ALTER LIBRARY library_name ( + COMPILE library_debug? compiler_parameters_clause* (REUSE SETTINGS)? + | library_editionable + ) ';' ; library_editionable @@ -1256,7 +1269,6 @@ library_debug : {this.isVersion12()}? DEBUG ; - compiler_parameters_clause : parameter_name EQUALS_OP parameter_value ; @@ -1272,18 +1284,18 @@ library_name // https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_4004.htm#SQLRF01104 // https://docs.oracle.com/database/121/SQLRF/statements_4004.htm#SQLRF01104 alter_view - : ALTER VIEW tableview_name - ( ADD out_of_line_constraint - | MODIFY CONSTRAINT constraint_name (RELY | NORELY) - | DROP ( CONSTRAINT constraint_name - | PRIMARY KEY - | UNIQUE '(' column_name (',' column_name)* ')' - ) - | COMPILE - | READ (ONLY | WRITE) - | alter_view_editionable? - ) - ';' + : ALTER VIEW tableview_name ( + ADD out_of_line_constraint + | MODIFY CONSTRAINT constraint_name (RELY | NORELY) + | DROP ( + CONSTRAINT constraint_name + | PRIMARY KEY + | UNIQUE '(' column_name (',' column_name)* ')' + ) + | COMPILE + | READ (ONLY | WRITE) + | alter_view_editionable? + ) ';' ; alter_view_editionable @@ -1291,38 +1303,35 @@ alter_view_editionable ; create_view - : CREATE (OR REPLACE)? (OR? FORCE)? EDITIONABLE? EDITIONING? VIEW - tableview_name view_options? - AS select_only_statement subquery_restriction_clause? + : CREATE (OR REPLACE)? (OR? FORCE)? EDITIONABLE? EDITIONING? VIEW tableview_name view_options? AS select_only_statement + subquery_restriction_clause? ; view_options - : view_alias_constraint + : view_alias_constraint | object_view_clause -// | xmltype_view_clause //TODO + // | xmltype_view_clause //TODO ; view_alias_constraint - : '(' ( ','? (table_alias inline_constraint* | out_of_line_constraint) )+ ')' + : '(' (','? (table_alias inline_constraint* | out_of_line_constraint))+ ')' ; object_view_clause - : OF type_name - ( WITH OBJECT (IDENTIFIER|ID|OID) ( DEFAULT | '(' REGULAR_ID (',' REGULAR_ID)* ')' ) - | UNDER tableview_name - ) - ( '(' ( ','? (out_of_line_constraint | REGULAR_ID inline_constraint ) )+ ')' )* + : OF type_name ( + WITH OBJECT (IDENTIFIER | ID | OID) (DEFAULT | '(' REGULAR_ID (',' REGULAR_ID)* ')') + | UNDER tableview_name + ) ('(' ( ','? (out_of_line_constraint | REGULAR_ID inline_constraint))+ ')')* ; inline_constraint - : (CONSTRAINT constraint_name)? - ( NOT? NULL_ + : (CONSTRAINT constraint_name)? ( + NOT? NULL_ | UNIQUE | PRIMARY KEY | references_clause | check_constraint - ) - constraint_state? + ) constraint_state? ; inline_ref_constraint @@ -1334,48 +1343,48 @@ inline_ref_constraint out_of_line_ref_constraint : SCOPE FOR '(' ref_col_or_attr=regular_id ')' IS tableview_name | REF '(' ref_col_or_attr=regular_id ')' WITH ROWID - | (CONSTRAINT constraint_name)? FOREIGN KEY '(' ( ','? ref_col_or_attr=regular_id)+ ')' references_clause constraint_state? + | (CONSTRAINT constraint_name)? FOREIGN KEY '(' (','? ref_col_or_attr=regular_id)+ ')' references_clause constraint_state? ; out_of_line_constraint - : ( (CONSTRAINT constraint_name)? - ( UNIQUE '(' column_name (',' column_name)* ')' - | PRIMARY KEY '(' column_name (',' column_name)* ')' - | foreign_key_clause - | CHECK '(' expression ')' - ) - ) - constraint_state? + : ( + (CONSTRAINT constraint_name)? ( + UNIQUE '(' column_name (',' column_name)* ')' + | PRIMARY KEY '(' column_name (',' column_name)* ')' + | foreign_key_clause + | CHECK '(' expression ')' + ) + ) constraint_state? ; constraint_state - : ( NOT? DEFERRABLE - | INITIALLY (IMMEDIATE|DEFERRED) - | (RELY|NORELY) - | (ENABLE|DISABLE) - | (VALIDATE|NOVALIDATE) - | using_index_clause - )+ + : ( + NOT? DEFERRABLE + | INITIALLY (IMMEDIATE | DEFERRED) + | (RELY | NORELY) + | (ENABLE | DISABLE) + | (VALIDATE | NOVALIDATE) + | using_index_clause + )+ ; alter_tablespace - : ALTER TABLESPACE tablespace - ( DEFAULT table_compression? storage_clause? - | MINIMUM EXTENT size_clause - | RESIZE size_clause - | COALESCE - | SHRINK SPACE_KEYWORD (KEEP size_clause)? - | RENAME TO new_tablespace_name - | begin_or_end BACKUP - | datafile_tempfile_clauses - | tablespace_logging_clauses - | tablespace_group_clause - | tablespace_state_clauses - | autoextend_clause - | flashback_mode_clause - | tablespace_retention_clause - ) - ';' + : ALTER TABLESPACE tablespace ( + DEFAULT table_compression? storage_clause? + | MINIMUM EXTENT size_clause + | RESIZE size_clause + | COALESCE + | SHRINK SPACE_KEYWORD (KEEP size_clause)? + | RENAME TO new_tablespace_name + | begin_or_end BACKUP + | datafile_tempfile_clauses + | tablespace_logging_clauses + | tablespace_group_clause + | tablespace_state_clauses + | autoextend_clause + | flashback_mode_clause + | tablespace_retention_clause + ) ';' ; datafile_tempfile_clauses @@ -1416,17 +1425,16 @@ new_tablespace_name ; create_tablespace - : CREATE (BIGFILE | SMALLFILE)? - ( permanent_tablespace_clause + : CREATE (BIGFILE | SMALLFILE)? ( + permanent_tablespace_clause | temporary_tablespace_clause | undo_tablespace_clause - ) - ';' + ) ';' ; permanent_tablespace_clause - : TABLESPACE id_expression datafile_specification? - ( MINIMUM EXTENT size_clause + : TABLESPACE id_expression datafile_specification? ( + MINIMUM EXTENT size_clause | BLOCKSIZE size_clause | logging_clause | FORCE LOGGING @@ -1436,7 +1444,7 @@ permanent_tablespace_clause | extent_management_clause | segment_management_clause | flashback_mode_clause - )* + )* ; tablespace_encryption_spec @@ -1445,15 +1453,12 @@ tablespace_encryption_spec logging_clause : LOGGING - | NOLOGGING - | FILESYSTEM_LIKE_LOGGING + | NOLOGGING + | FILESYSTEM_LIKE_LOGGING ; extent_management_clause - : EXTENT MANAGEMENT LOCAL - ( AUTOALLOCATE - | UNIFORM (SIZE size_clause)? - )? + : EXTENT MANAGEMENT LOCAL (AUTOALLOCATE | UNIFORM (SIZE size_clause)?)? ; segment_management_clause @@ -1461,15 +1466,11 @@ segment_management_clause ; temporary_tablespace_clause - : TEMPORARY TABLESPACE tablespace_name=id_expression - tempfile_specification? - tablespace_group_clause? extent_management_clause? + : TEMPORARY TABLESPACE tablespace_name=id_expression tempfile_specification? tablespace_group_clause? extent_management_clause? ; undo_tablespace_clause - : UNDO TABLESPACE tablespace_name=id_expression - datafile_specification? - extent_management_clause? tablespace_retention_clause? + : UNDO TABLESPACE tablespace_name=id_expression datafile_specification? extent_management_clause? tablespace_retention_clause? ; tablespace_retention_clause @@ -1479,31 +1480,25 @@ tablespace_retention_clause // asm_filename is just a charater string. Would need to parse the string // to find diskgroup... datafile_specification - : DATAFILE - (','? datafile_tempfile_spec) + : DATAFILE (','? datafile_tempfile_spec) ; tempfile_specification - : TEMPFILE - (','? datafile_tempfile_spec) + : TEMPFILE (','? datafile_tempfile_spec) ; datafile_tempfile_spec : (CHAR_STRING)? (SIZE size_clause)? REUSE? autoextend_clause? ; - redo_log_file_spec - : (DATAFILE CHAR_STRING - | '(' ( ','? CHAR_STRING )+ ')' - )? - (SIZE size_clause)? - (BLOCKSIZE size_clause)? - REUSE? + : (DATAFILE CHAR_STRING | '(' ( ','? CHAR_STRING)+ ')')? (SIZE size_clause)? ( + BLOCKSIZE size_clause + )? REUSE? ; autoextend_clause - : AUTOEXTEND (OFF | ON (NEXT size_clause)? maxsize_clause? ) + : AUTOEXTEND (OFF | ON (NEXT size_clause)? maxsize_clause?) ; maxsize_clause @@ -1520,46 +1515,43 @@ parallel_clause ; alter_materialized_view - : ALTER MATERIALIZED VIEW tableview_name - ( physical_attributes_clause - | modify_mv_column_clause - | table_compression - | lob_storage_clause (',' lob_storage_clause)* - | modify_lob_storage_clause (',' modify_lob_storage_clause)* -//TODO | alter_table_partitioning - | parallel_clause - | logging_clause - | allocate_extent_clause - | deallocate_unused_clause - | shrink_clause - | (cache_or_nocache) - )? - alter_iot_clauses? - (USING INDEX physical_attributes_clause)? - alter_mv_option1? - ( enable_or_disable QUERY REWRITE - | COMPILE - | CONSIDER FRESH - )? - ';' + : ALTER MATERIALIZED VIEW tableview_name ( + physical_attributes_clause + | modify_mv_column_clause + | table_compression + | lob_storage_clause (',' lob_storage_clause)* + | modify_lob_storage_clause (',' modify_lob_storage_clause)* + //TODO | alter_table_partitioning + | parallel_clause + | logging_clause + | allocate_extent_clause + | deallocate_unused_clause + | shrink_clause + | (cache_or_nocache) + )? alter_iot_clauses? (USING INDEX physical_attributes_clause)? alter_mv_option1? ( + enable_or_disable QUERY REWRITE + | COMPILE + | CONSIDER FRESH + )? ';' ; alter_mv_option1 : alter_mv_refresh -//TODO | MODIFY scoped_table_ref_constraint + //TODO | MODIFY scoped_table_ref_constraint ; alter_mv_refresh - : REFRESH ( FAST - | COMPLETE - | FORCE - | ON (DEMAND | COMMIT) - | START WITH expression - | NEXT expression - | WITH PRIMARY KEY - | USING DEFAULT? MASTER ROLLBACK SEGMENT rollback_segment? - | USING (ENFORCED | TRUSTED) CONSTRAINTS - )+ + : REFRESH ( + FAST + | COMPLETE + | FORCE + | ON (DEMAND | COMMIT) + | START WITH expression + | NEXT expression + | WITH PRIMARY KEY + | USING DEFAULT? MASTER ROLLBACK SEGMENT rollback_segment? + | USING (ENFORCED | TRUSTED) CONSTRAINTS + )+ ; rollback_segment @@ -1571,20 +1563,19 @@ modify_mv_column_clause ; alter_materialized_view_log - : ALTER MATERIALIZED VIEW LOG FORCE? ON tableview_name - ( physical_attributes_clause - | add_mv_log_column_clause -//TODO | alter_table_partitioning - | parallel_clause - | logging_clause - | allocate_extent_clause - | shrink_clause - | move_mv_log_clause - | cache_or_nocache - )? - mv_log_augmentation? mv_log_purge_clause? - ';' + : ALTER MATERIALIZED VIEW LOG FORCE? ON tableview_name ( + physical_attributes_clause + | add_mv_log_column_clause + //TODO | alter_table_partitioning + | parallel_clause + | logging_clause + | allocate_extent_clause + | shrink_clause + | move_mv_log_clause + | cache_or_nocache + )? mv_log_augmentation? mv_log_purge_clause? ';' ; + add_mv_log_column_clause : ADD '(' column_name ')' ; @@ -1594,92 +1585,74 @@ move_mv_log_clause ; mv_log_augmentation - : ADD ( ( OBJECT ID - | PRIMARY KEY - | ROWID - | SEQUENCE - ) - ('(' column_name (',' column_name)* ')')? - - | '(' column_name (',' column_name)* ')' - ) - new_values_clause? + : ADD ( + (OBJECT ID | PRIMARY KEY | ROWID | SEQUENCE) ('(' column_name (',' column_name)* ')')? + | '(' column_name (',' column_name)* ')' + ) new_values_clause? ; create_materialized_view_log - : CREATE MATERIALIZED VIEW LOG ON tableview_name - ( ( physical_attributes_clause - | TABLESPACE tablespace_name=id_expression - | logging_clause - | (CACHE | NOCACHE) - )+ - )? - parallel_clause? - // table_partitioning_clauses TODO - ( WITH - ( ','? - ( OBJECT ID - | PRIMARY KEY - | ROWID - | SEQUENCE - | COMMIT SCN - ) - )* - ('(' ( ','? regular_id )+ ')' new_values_clause? )? - mv_log_purge_clause? - )* + : CREATE MATERIALIZED VIEW LOG ON tableview_name ( + ( + physical_attributes_clause + | TABLESPACE tablespace_name=id_expression + | logging_clause + | (CACHE | NOCACHE) + )+ + )? parallel_clause? + // table_partitioning_clauses TODO + ( + WITH (','? ( OBJECT ID | PRIMARY KEY | ROWID | SEQUENCE | COMMIT SCN))* ( + '(' ( ','? regular_id)+ ')' new_values_clause? + )? mv_log_purge_clause? + )* ; new_values_clause - : (INCLUDING | EXCLUDING ) NEW VALUES + : (INCLUDING | EXCLUDING) NEW VALUES ; mv_log_purge_clause - : PURGE - ( IMMEDIATE (SYNCHRONOUS | ASYNCHRONOUS)? - // |START WITH CLAUSES TODO - ) + : PURGE ( + IMMEDIATE (SYNCHRONOUS | ASYNCHRONOUS)? + // |START WITH CLAUSES TODO + ) ; create_materialized_view - : CREATE MATERIALIZED VIEW tableview_name - (OF type_name )? -//scoped_table_ref and column alias goes here TODO - ( ON PREBUILT TABLE ( (WITH | WITHOUT) REDUCED PRECISION)? - | physical_properties? (CACHE | NOCACHE)? parallel_clause? build_clause? - ) - ( USING INDEX ( (physical_attributes_clause | TABLESPACE mv_tablespace=id_expression)+ )* + : CREATE MATERIALIZED VIEW tableview_name (OF type_name)? + //scoped_table_ref and column alias goes here TODO + ( + ON PREBUILT TABLE ( (WITH | WITHOUT) REDUCED PRECISION)? + | physical_properties? (CACHE | NOCACHE)? parallel_clause? build_clause? + ) ( + USING INDEX ((physical_attributes_clause | TABLESPACE mv_tablespace=id_expression)+)* | USING NO INDEX - )? - create_mv_refresh? - (FOR UPDATE)? - ( (DISABLE | ENABLE) QUERY REWRITE )? - AS select_only_statement - ';' + )? create_mv_refresh? (FOR UPDATE)? ((DISABLE | ENABLE) QUERY REWRITE)? AS select_only_statement ';' ; create_mv_refresh - : ( NEVER REFRESH - | REFRESH - ( (FAST | COMPLETE | FORCE) - | ON (DEMAND | COMMIT) - | (START WITH | NEXT) //date goes here TODO - | WITH (PRIMARY KEY | ROWID) - | USING - ( DEFAULT (MASTER | LOCAL)? ROLLBACK SEGMENT - | (MASTER | LOCAL)? ROLLBACK SEGMENT rb_segment=REGULAR_ID - ) - | USING (ENFORCED | TRUSTED) CONSTRAINTS - )+ - ) + : ( + NEVER REFRESH + | REFRESH ( + (FAST | COMPLETE | FORCE) + | ON (DEMAND | COMMIT) + | (START WITH | NEXT) //date goes here TODO + | WITH (PRIMARY KEY | ROWID) + | USING ( + DEFAULT (MASTER | LOCAL)? ROLLBACK SEGMENT + | (MASTER | LOCAL)? ROLLBACK SEGMENT rb_segment=REGULAR_ID + ) + | USING (ENFORCED | TRUSTED) CONSTRAINTS + )+ + ) ; create_context - : CREATE (OR REPLACE)? CONTEXT oracle_namespace USING (schema_object_name '.')? package_name - (INITIALIZED (EXTERNALLY | GLOBALLY) - | ACCESSED GLOBALLY - )? - ';' + : CREATE (OR REPLACE)? CONTEXT oracle_namespace USING (schema_object_name '.')? package_name ( + INITIALIZED (EXTERNALLY | GLOBALLY) + | ACCESSED GLOBALLY + )? ';' ; oracle_namespace @@ -1688,33 +1661,33 @@ oracle_namespace //https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_5001.htm#SQLRF01201 create_cluster - : CREATE CLUSTER cluster_name '(' column_name datatype SORT? (',' column_name datatype SORT?)* ')' - ( physical_attributes_clause - | SIZE size_clause - | TABLESPACE tablespace - | INDEX - | (SINGLE TABLE)? HASHKEYS UNSIGNED_INTEGER (HASH IS expression)? - )* - parallel_clause? (ROWDEPENDENCIES | NOROWDEPENDENCIES)? - (CACHE | NOCACHE)? - ';' + : CREATE CLUSTER cluster_name '(' column_name datatype SORT? (',' column_name datatype SORT?)* ')' ( + physical_attributes_clause + | SIZE size_clause + | TABLESPACE tablespace + | INDEX + | (SINGLE TABLE)? HASHKEYS UNSIGNED_INTEGER (HASH IS expression)? + )* parallel_clause? (ROWDEPENDENCIES | NOROWDEPENDENCIES)? (CACHE | NOCACHE)? ';' ; create_table - : CREATE (GLOBAL TEMPORARY)? TABLE tableview_name - (relational_table | object_table | xmltype_table) (AS select_only_statement)? - ';' + : CREATE (GLOBAL TEMPORARY)? TABLE tableview_name ( + relational_table + | object_table + | xmltype_table + ) (AS select_only_statement)? ';' ; xmltype_table - : OF XMLTYPE ('(' object_properties ')')? - (XMLTYPE xmltype_storage)? xmlschema_spec? xmltype_virtual_columns? - (ON COMMIT (DELETE | PRESERVE) ROWS)? oid_clause? oid_index_clause? - physical_properties? column_properties? table_partitioning_clauses? - (CACHE | NOCACHE)? (RESULT_CACHE '(' MODE (DEFAULT | FORCE) ')')? - parallel_clause? (ROWDEPENDENCIES | NOROWDEPENDENCIES)? - (enable_disable_clause+)? row_movement_clause? - flashback_archive_clause? + : OF XMLTYPE ('(' object_properties ')')? (XMLTYPE xmltype_storage)? xmlschema_spec? xmltype_virtual_columns? ( + ON COMMIT (DELETE | PRESERVE) ROWS + )? oid_clause? oid_index_clause? physical_properties? column_properties? table_partitioning_clauses? ( + CACHE + | NOCACHE + )? (RESULT_CACHE '(' MODE (DEFAULT | FORCE) ')')? parallel_clause? ( + ROWDEPENDENCIES + | NOROWDEPENDENCIES + )? (enable_disable_clause+)? row_movement_clause? flashback_archive_clause? ; xmltype_virtual_columns @@ -1726,26 +1699,32 @@ xmltype_column_properties ; xmltype_storage - : STORE AS (OBJECT RELATIONAL - | (SECUREFILE | BASICFILE)? (CLOB | BINARY XML) (lob_segname ('(' lob_parameters ')')? | '(' lob_parameters ')')? - ) + : STORE AS ( + OBJECT RELATIONAL + | (SECUREFILE | BASICFILE)? (CLOB | BINARY XML) ( + lob_segname ('(' lob_parameters ')')? + | '(' lob_parameters ')' + )? + ) | STORE VARRAYS AS (LOBS | TABLES) ; xmlschema_spec - : (XMLSCHEMA DELIMITED_ID)? ELEMENT DELIMITED_ID - (allow_or_disallow NONSCHEMA)? - (allow_or_disallow ANYSCHEMA)? + : (XMLSCHEMA DELIMITED_ID)? ELEMENT DELIMITED_ID (allow_or_disallow NONSCHEMA)? ( + allow_or_disallow ANYSCHEMA + )? ; object_table - : OF type_name object_table_substitution? - ('(' object_properties (',' object_properties)* ')')? - (ON COMMIT (DELETE | PRESERVE) ROWS)? oid_clause? oid_index_clause? - physical_properties? column_properties? table_partitioning_clauses? - (CACHE | NOCACHE)? (RESULT_CACHE '(' MODE (DEFAULT | FORCE) ')')? - parallel_clause? (ROWDEPENDENCIES | NOROWDEPENDENCIES)? - (enable_disable_clause+)? row_movement_clause? flashback_archive_clause? + : OF type_name object_table_substitution? ('(' object_properties (',' object_properties)* ')')? ( + ON COMMIT (DELETE | PRESERVE) ROWS + )? oid_clause? oid_index_clause? physical_properties? column_properties? table_partitioning_clauses? ( + CACHE + | NOCACHE + )? (RESULT_CACHE '(' MODE (DEFAULT | FORCE) ')')? parallel_clause? ( + ROWDEPENDENCIES + | NOROWDEPENDENCIES + )? (enable_disable_clause+)? row_movement_clause? flashback_archive_clause? ; oid_index_clause @@ -1757,7 +1736,10 @@ oid_clause ; object_properties - : (column_name | attribute_name) (DEFAULT expression)? (inline_constraint (',' inline_constraint)* | inline_ref_constraint)? + : (column_name | attribute_name) (DEFAULT expression)? ( + inline_constraint (',' inline_constraint)* + | inline_ref_constraint + )? | out_of_line_constraint | out_of_line_ref_constraint | supplemental_logging_props @@ -1768,22 +1750,21 @@ object_table_substitution ; relational_table - : ('(' relational_property (',' relational_property)* ')')? - (ON COMMIT (DELETE | PRESERVE) ROWS)? - physical_properties? column_properties? table_partitioning_clauses? - (CACHE | NOCACHE)? (RESULT_CACHE '(' MODE (DEFAULT | FORCE) ')')? - parallel_clause? - (ROWDEPENDENCIES | NOROWDEPENDENCIES)? - (enable_disable_clause+)? row_movement_clause? flashback_archive_clause? + : ('(' relational_property (',' relational_property)* ')')? ( + ON COMMIT (DELETE | PRESERVE) ROWS + )? physical_properties? column_properties? table_partitioning_clauses? (CACHE | NOCACHE)? ( + RESULT_CACHE '(' MODE (DEFAULT | FORCE) ')' + )? parallel_clause? (ROWDEPENDENCIES | NOROWDEPENDENCIES)? (enable_disable_clause+)? row_movement_clause? flashback_archive_clause? ; relational_property - : (column_definition + : ( + column_definition | virtual_column_definition | out_of_line_constraint | out_of_line_ref_constraint | supplemental_logging_props - ) + ) ; table_partitioning_clauses @@ -1798,30 +1779,37 @@ table_partitioning_clauses ; range_partitions - : PARTITION BY RANGE '(' column_name (',' column_name)* ')' - (INTERVAL '(' expression ')' (STORE IN '(' tablespace (',' tablespace)* ')' )? )? - '(' PARTITION partition_name? range_values_clause table_partition_description (',' PARTITION partition_name? range_values_clause table_partition_description)* ')' + : PARTITION BY RANGE '(' column_name (',' column_name)* ')' ( + INTERVAL '(' expression ')' (STORE IN '(' tablespace (',' tablespace)* ')')? + )? '(' PARTITION partition_name? range_values_clause table_partition_description ( + ',' PARTITION partition_name? range_values_clause table_partition_description + )* ')' ; list_partitions - : PARTITION BY LIST '(' column_name ')' - '(' PARTITION partition_name? list_values_clause table_partition_description (',' PARTITION partition_name? list_values_clause table_partition_description )* ')' + : PARTITION BY LIST '(' column_name ')' '(' PARTITION partition_name? list_values_clause table_partition_description ( + ',' PARTITION partition_name? list_values_clause table_partition_description + )* ')' ; hash_partitions - : PARTITION BY HASH '(' column_name (',' column_name)* ')' - (individual_hash_partitions | hash_partitions_by_quantity) + : PARTITION BY HASH '(' column_name (',' column_name)* ')' ( + individual_hash_partitions + | hash_partitions_by_quantity + ) ; individual_hash_partitions - : '(' PARTITION partition_name? partitioning_storage_clause? (',' PARTITION partition_name? partitioning_storage_clause?)* ')' + : '(' PARTITION partition_name? partitioning_storage_clause? ( + ',' PARTITION partition_name? partitioning_storage_clause? + )* ')' ; hash_partitions_by_quantity - : PARTITIONS hash_partition_quantity - (STORE IN '(' tablespace (',' tablespace)* ')')? - (table_compression | key_compression)? - (OVERFLOW STORE IN '(' tablespace (',' tablespace)* ')' )? + : PARTITIONS hash_partition_quantity (STORE IN '(' tablespace (',' tablespace)* ')')? ( + table_compression + | key_compression + )? (OVERFLOW STORE IN '(' tablespace (',' tablespace)* ')')? ; hash_partition_quantity @@ -1829,27 +1817,33 @@ hash_partition_quantity ; composite_range_partitions - : PARTITION BY RANGE '(' column_name (',' column_name)* ')' - (INTERVAL '(' expression ')' (STORE IN '(' tablespace (',' tablespace)* ')' )? )? - (subpartition_by_range | subpartition_by_list | subpartition_by_hash) - '(' range_partition_desc (',' range_partition_desc)* ')' + : PARTITION BY RANGE '(' column_name (',' column_name)* ')' ( + INTERVAL '(' expression ')' (STORE IN '(' tablespace (',' tablespace)* ')')? + )? (subpartition_by_range | subpartition_by_list | subpartition_by_hash) '(' range_partition_desc ( + ',' range_partition_desc + )* ')' ; composite_list_partitions - : PARTITION BY LIST '(' column_name ')' - (subpartition_by_range | subpartition_by_list | subpartition_by_hash) - '(' list_partition_desc (',' list_partition_desc)* ')' + : PARTITION BY LIST '(' column_name ')' ( + subpartition_by_range + | subpartition_by_list + | subpartition_by_hash + ) '(' list_partition_desc (',' list_partition_desc)* ')' ; composite_hash_partitions - : PARTITION BY HASH '(' (',' column_name)+ ')' - (subpartition_by_range | subpartition_by_list | subpartition_by_hash) - (individual_hash_partitions | hash_partitions_by_quantity) + : PARTITION BY HASH '(' (',' column_name)+ ')' ( + subpartition_by_range + | subpartition_by_list + | subpartition_by_hash + ) (individual_hash_partitions | hash_partitions_by_quantity) ; reference_partitioning - : PARTITION BY REFERENCE '(' regular_id ')' - ('(' reference_partition_desc (',' reference_partition_desc)* ')')? + : PARTITION BY REFERENCE '(' regular_id ')' ( + '(' reference_partition_desc (',' reference_partition_desc)* ')' + )? ; reference_partition_desc @@ -1857,44 +1851,49 @@ reference_partition_desc ; system_partitioning - : PARTITION BY SYSTEM - (PARTITIONS UNSIGNED_INTEGER | reference_partition_desc (',' reference_partition_desc)*)? + : PARTITION BY SYSTEM ( + PARTITIONS UNSIGNED_INTEGER + | reference_partition_desc (',' reference_partition_desc)* + )? ; range_partition_desc - : PARTITION partition_name? range_values_clause table_partition_description - ( ( '(' ( range_subpartition_desc (',' range_subpartition_desc)* + : PARTITION partition_name? range_values_clause table_partition_description ( + ( + '(' ( + range_subpartition_desc (',' range_subpartition_desc)* | list_subpartition_desc (',' list_subpartition_desc)* | individual_hash_subparts (',' individual_hash_subparts)* - ) - ')' - | hash_subparts_by_quantity - ) - )? + ) ')' + | hash_subparts_by_quantity + ) + )? ; list_partition_desc - : PARTITION partition_name? list_values_clause table_partition_description - ( ( '(' ( range_subpartition_desc (',' range_subpartition_desc)* + : PARTITION partition_name? list_values_clause table_partition_description ( + ( + '(' ( + range_subpartition_desc (',' range_subpartition_desc)* | list_subpartition_desc (',' list_subpartition_desc)* | individual_hash_subparts (',' individual_hash_subparts)* - ) - ')' - | hash_subparts_by_quantity - ) - )? + ) ')' + | hash_subparts_by_quantity + ) + )? ; subpartition_template - : SUBPARTITION TEMPLATE - ( ( '(' ( range_subpartition_desc (',' range_subpartition_desc)* + : SUBPARTITION TEMPLATE ( + ( + '(' ( + range_subpartition_desc (',' range_subpartition_desc)* | list_subpartition_desc (',' list_subpartition_desc)* | individual_hash_subparts (',' individual_hash_subparts)* - ) - ')' - | hash_subpartition_quantity - ) + ) ')' + | hash_subpartition_quantity ) + ) ; hash_subpartition_quantity @@ -1910,10 +1909,10 @@ subpartition_by_list ; subpartition_by_hash - : SUBPARTITION BY HASH '(' column_name (',' column_name)* ')' - (SUBPARTITIONS UNSIGNED_INTEGER (STORE IN '(' tablespace (',' tablespace)* ')' )? - | subpartition_template - )? + : SUBPARTITION BY HASH '(' column_name (',' column_name)* ')' ( + SUBPARTITIONS UNSIGNED_INTEGER (STORE IN '(' tablespace (',' tablespace)* ')')? + | subpartition_template + )? ; subpartition_name @@ -1933,7 +1932,7 @@ individual_hash_subparts ; hash_subparts_by_quantity - : SUBPARTITIONS UNSIGNED_INTEGER (STORE IN '(' tablespace (',' tablespace)* ')' )? + : SUBPARTITIONS UNSIGNED_INTEGER (STORE IN '(' tablespace (',' tablespace)* ')')? ; range_values_clause @@ -1945,28 +1944,27 @@ list_values_clause ; table_partition_description - : deferred_segment_creation? segment_attributes_clause? - (table_compression | key_compression)? - (OVERFLOW segment_attributes_clause? )? - (lob_storage_clause | varray_col_properties | nested_table_col_properties)? + : deferred_segment_creation? segment_attributes_clause? (table_compression | key_compression)? ( + OVERFLOW segment_attributes_clause? + )? (lob_storage_clause | varray_col_properties | nested_table_col_properties)? ; partitioning_storage_clause - : ( TABLESPACE tablespace - | OVERFLOW (TABLESPACE tablespace)? - | table_compression - | key_compression - | lob_partitioning_storage - | VARRAY varray_item STORE AS (BASICFILE | SECUREFILE)? LOB lob_segname - )+ + : ( + TABLESPACE tablespace + | OVERFLOW (TABLESPACE tablespace)? + | table_compression + | key_compression + | lob_partitioning_storage + | VARRAY varray_item STORE AS (BASICFILE | SECUREFILE)? LOB lob_segname + )+ ; lob_partitioning_storage - : LOB '(' lob_item ')' - STORE AS (BASICFILE | SECUREFILE)? - (lob_segname ('(' TABLESPACE tablespace ')' )? - | '(' TABLESPACE tablespace ')' - ) + : LOB '(' lob_item ')' STORE AS (BASICFILE | SECUREFILE)? ( + lob_segname ('(' TABLESPACE tablespace ')')? + | '(' TABLESPACE tablespace ')' + ) ; //Technically, this should only allow 'K' | 'M' | 'G' | 'T' | 'P' | 'E' @@ -1975,40 +1973,34 @@ size_clause : UNSIGNED_INTEGER REGULAR_ID? ; - table_compression - : COMPRESS - ( BASIC - | FOR ( OLTP - | (QUERY | ARCHIVE) (LOW | HIGH)? - ) - )? + : COMPRESS (BASIC | FOR ( OLTP | (QUERY | ARCHIVE) (LOW | HIGH)?))? | NOCOMPRESS ; physical_attributes_clause - : (PCTFREE pctfree=UNSIGNED_INTEGER - | PCTUSED pctused=UNSIGNED_INTEGER - | INITRANS inittrans=UNSIGNED_INTEGER - | storage_clause - )+ + : ( + PCTFREE pctfree=UNSIGNED_INTEGER + | PCTUSED pctused=UNSIGNED_INTEGER + | INITRANS inittrans=UNSIGNED_INTEGER + | storage_clause + )+ ; storage_clause - : STORAGE '(' - (INITIAL initial_size=size_clause - | NEXT next_size=size_clause - | MINEXTENTS minextents=(UNSIGNED_INTEGER | UNLIMITED) - | MAXEXTENTS minextents=(UNSIGNED_INTEGER | UNLIMITED) - | PCTINCREASE pctincrease=UNSIGNED_INTEGER - | FREELISTS freelists=UNSIGNED_INTEGER - | FREELIST GROUPS freelist_groups=UNSIGNED_INTEGER - | OPTIMAL (size_clause | NULL_ ) - | BUFFER_POOL (KEEP | RECYCLE | DEFAULT) - | FLASH_CACHE (KEEP | NONE | DEFAULT) - | ENCRYPT - )+ - ')' + : STORAGE '(' ( + INITIAL initial_size=size_clause + | NEXT next_size=size_clause + | MINEXTENTS minextents=(UNSIGNED_INTEGER | UNLIMITED) + | MAXEXTENTS minextents=(UNSIGNED_INTEGER | UNLIMITED) + | PCTINCREASE pctincrease=UNSIGNED_INTEGER + | FREELISTS freelists=UNSIGNED_INTEGER + | FREELIST GROUPS freelist_groups=UNSIGNED_INTEGER + | OPTIMAL (size_clause | NULL_) + | BUFFER_POOL (KEEP | RECYCLE | DEFAULT) + | FLASH_CACHE (KEEP | NONE | DEFAULT) + | ENCRYPT + )+ ')' ; deferred_segment_creation @@ -2016,14 +2008,11 @@ deferred_segment_creation ; segment_attributes_clause - : ( physical_attributes_clause - | TABLESPACE tablespace_name=id_expression - | logging_clause - )+ + : (physical_attributes_clause | TABLESPACE tablespace_name=id_expression | logging_clause)+ ; physical_properties - : deferred_segment_creation? segment_attributes_clause table_compression? + : deferred_segment_creation? segment_attributes_clause table_compression? ; row_movement_clause @@ -2040,10 +2029,12 @@ log_grp ; supplemental_table_logging - : ADD SUPPLEMENTAL LOG (supplemental_log_grp_clause | supplemental_id_key_clause) - (',' SUPPLEMENTAL LOG (supplemental_log_grp_clause | supplemental_id_key_clause) )* - | DROP SUPPLEMENTAL LOG (supplemental_id_key_clause | GROUP log_grp) - (',' SUPPLEMENTAL LOG (supplemental_id_key_clause | GROUP log_grp) )* + : ADD SUPPLEMENTAL LOG (supplemental_log_grp_clause | supplemental_id_key_clause) ( + ',' SUPPLEMENTAL LOG (supplemental_log_grp_clause | supplemental_id_key_clause) + )* + | DROP SUPPLEMENTAL LOG (supplemental_id_key_clause | GROUP log_grp) ( + ',' SUPPLEMENTAL LOG (supplemental_id_key_clause | GROUP log_grp) + )* ; supplemental_log_grp_clause @@ -2051,24 +2042,17 @@ supplemental_log_grp_clause ; supplemental_id_key_clause - : DATA '('( ','? ( ALL - | PRIMARY KEY - | UNIQUE - | FOREIGN KEY - ) - )+ - ')' - COLUMNS + : DATA '(' (','? ( ALL | PRIMARY KEY | UNIQUE | FOREIGN KEY))+ ')' COLUMNS ; allocate_extent_clause - : ALLOCATE EXTENT - ( '(' ( SIZE size_clause - | DATAFILE datafile=CHAR_STRING - | INSTANCE inst_num=UNSIGNED_INTEGER - )+ - ')' - )? + : ALLOCATE EXTENT ( + '(' ( + SIZE size_clause + | DATAFILE datafile=CHAR_STRING + | INSTANCE inst_num=UNSIGNED_INTEGER + )+ ')' + )? ; deallocate_unused_clause @@ -2103,6 +2087,7 @@ enable_or_disable : ENABLE | DISABLE ; + allow_or_disallow : ALLOW | DISALLOW @@ -2112,8 +2097,12 @@ allow_or_disallow create_synonym // Synonym's schema cannot be specified for public synonyms - : CREATE (OR REPLACE)? PUBLIC SYNONYM synonym_name FOR (schema_name PERIOD)? schema_object_name (AT_SIGN link_name)? - | CREATE (OR REPLACE)? SYNONYM (schema_name PERIOD)? synonym_name FOR (schema_name PERIOD)? schema_object_name (AT_SIGN link_name)? + : CREATE (OR REPLACE)? PUBLIC SYNONYM synonym_name FOR (schema_name PERIOD)? schema_object_name ( + AT_SIGN link_name + )? + | CREATE (OR REPLACE)? SYNONYM (schema_name PERIOD)? synonym_name FOR (schema_name PERIOD)? schema_object_name ( + AT_SIGN link_name + )? ; comment_on_table @@ -2121,15 +2110,13 @@ comment_on_table ; alter_cluster - : ALTER CLUSTER cluster_name - ( physical_attributes_clause + : ALTER CLUSTER cluster_name ( + physical_attributes_clause | SIZE size_clause | allocate_extent_clause | deallocate_unused_clause | cache_or_nocache - )+ - parallel_clause? - ';' + )+ parallel_clause? ';' ; cache_or_nocache @@ -2142,18 +2129,17 @@ database_name ; alter_database - : ALTER DATABASE database_name? - ( startup_clauses - | recovery_clauses - | database_file_clauses - | logfile_clauses - | controlfile_clauses - | standby_database_clauses - | default_settings_clause - | instance_clauses - | security_clause - ) - ';' + : ALTER DATABASE database_name? ( + startup_clauses + | recovery_clauses + | database_file_clauses + | logfile_clauses + | controlfile_clauses + | standby_database_clauses + | default_settings_clause + | instance_clauses + | security_clause + ) ';' ; startup_clauses @@ -2184,57 +2170,62 @@ begin_or_end ; general_recovery - : RECOVER AUTOMATIC? (FROM CHAR_STRING)? - ( (full_database_recovery | partial_database_recovery | LOGFILE CHAR_STRING )? - ((TEST | ALLOW UNSIGNED_INTEGER CORRUPTION | parallel_clause)+ )? - | CONTINUE DEFAULT? - | CANCEL - ) + : RECOVER AUTOMATIC? (FROM CHAR_STRING)? ( + (full_database_recovery | partial_database_recovery | LOGFILE CHAR_STRING)? ( + (TEST | ALLOW UNSIGNED_INTEGER CORRUPTION | parallel_clause)+ + )? + | CONTINUE DEFAULT? + | CANCEL + ) ; //Need to come back to full_database_recovery - : STANDBY? DATABASE - ((UNTIL (CANCEL |TIME CHAR_STRING | CHANGE UNSIGNED_INTEGER | CONSISTENT) - | USING BACKUP CONTROLFILE - )+ - )? + : STANDBY? DATABASE ( + ( + UNTIL (CANCEL | TIME CHAR_STRING | CHANGE UNSIGNED_INTEGER | CONSISTENT) + | USING BACKUP CONTROLFILE + )+ + )? ; partial_database_recovery : TABLESPACE tablespace (',' tablespace)* - | DATAFILE CHAR_STRING | filenumber (',' CHAR_STRING | filenumber)* + | DATAFILE CHAR_STRING + | filenumber (',' CHAR_STRING | filenumber)* | partial_database_recovery_10g ; partial_database_recovery_10g - : {this.isVersion10()}? STANDBY - ( TABLESPACE tablespace (',' tablespace)* - | DATAFILE CHAR_STRING | filenumber (',' CHAR_STRING | filenumber)* - ) - UNTIL (CONSISTENT WITH)? CONTROLFILE + : {this.isVersion10()}? STANDBY ( + TABLESPACE tablespace (',' tablespace)* + | DATAFILE CHAR_STRING + | filenumber (',' CHAR_STRING | filenumber)* + ) UNTIL (CONSISTENT WITH)? CONTROLFILE ; - managed_standby_recovery - : RECOVER (MANAGED STANDBY DATABASE - ((USING CURRENT LOGFILE + : RECOVER ( + MANAGED STANDBY DATABASE ( + ( + USING CURRENT LOGFILE | DISCONNECT (FROM SESSION)? | NODELAY | UNTIL CHANGE UNSIGNED_INTEGER | UNTIL CONSISTENT | parallel_clause - )+ - | FINISH - | CANCEL - )? - | TO LOGICAL STANDBY (db_name | KEEP IDENTITY) - ) + )+ + | FINISH + | CANCEL + )? + | TO LOGICAL STANDBY (db_name | KEEP IDENTITY) + ) ; db_name : regular_id ; + database_file_clauses : RENAME FILE filename (',' filename)* TO filename | create_datafile_clause @@ -2243,35 +2234,36 @@ database_file_clauses ; create_datafile_clause - : CREATE DATAFILE (filename | filenumber) (',' (filename | filenumber) )* - (AS (NEW) )? + : CREATE DATAFILE (filename | filenumber) (',' (filename | filenumber))* (AS (NEW))? ; alter_datafile_clause - : DATAFILE (filename|filenumber) (',' (filename|filenumber) )* - ( ONLINE + : DATAFILE (filename | filenumber) (',' (filename | filenumber))* ( + ONLINE | OFFLINE (FOR DROP)? | RESIZE size_clause | autoextend_clause | END BACKUP - ) + ) ; alter_tempfile_clause - : TEMPFILE (filename | filenumber) (',' (filename | filenumber) )* - ( RESIZE size_clause + : TEMPFILE (filename | filenumber) (',' (filename | filenumber))* ( + RESIZE size_clause | autoextend_clause | DROP (INCLUDING DATAFILES) | ONLINE | OFFLINE - ) + ) ; logfile_clauses : (ARCHIVELOG MANUAL? | NOARCHIVELOG) | NO? FORCE LOGGING | RENAME FILE filename (',' filename)* TO filename - | CLEAR UNARCHIVED? LOGFILE logfile_descriptor (',' logfile_descriptor)* (UNRECOVERABLE DATAFILE)? + | CLEAR UNARCHIVED? LOGFILE logfile_descriptor (',' logfile_descriptor)* ( + UNRECOVERABLE DATAFILE + )? | add_logfile_clauses | drop_logfile_clauses | switch_logfile_clause @@ -2279,23 +2271,24 @@ logfile_clauses ; add_logfile_clauses - : ADD STANDBY? LOGFILE - ( -//TODO (INSTANCE CHAR_STRING | THREAD UNSIGNED_INTEGER)? - (log_file_group redo_log_file_spec)+ - | MEMBER filename REUSE? (',' filename REUSE?)* TO logfile_descriptor (',' logfile_descriptor)* - ) + : ADD STANDBY? LOGFILE ( + //TODO (INSTANCE CHAR_STRING | THREAD UNSIGNED_INTEGER)? + (log_file_group redo_log_file_spec)+ + | MEMBER filename REUSE? (',' filename REUSE?)* TO logfile_descriptor ( + ',' logfile_descriptor + )* + ) ; log_file_group - :(','? (THREAD UNSIGNED_INTEGER)? GROUP UNSIGNED_INTEGER) + : (','? (THREAD UNSIGNED_INTEGER)? GROUP UNSIGNED_INTEGER) ; drop_logfile_clauses - : DROP STANDBY? - LOGFILE (logfile_descriptor (',' logfile_descriptor)* - | MEMBER filename (',' filename)* - ) + : DROP STANDBY? LOGFILE ( + logfile_descriptor (',' logfile_descriptor)* + | MEMBER filename (',' filename)* + ) ; switch_logfile_clause @@ -2303,11 +2296,7 @@ switch_logfile_clause ; supplemental_db_logging - : add_or_drop - SUPPLEMENTAL LOG (DATA - | supplemental_id_key_clause - | supplemental_plsql_clause - ) + : add_or_drop SUPPLEMENTAL LOG (DATA | supplemental_id_key_clause | supplemental_plsql_clause) ; add_or_drop @@ -2331,19 +2320,19 @@ controlfile_clauses ; trace_file_clause - : TRACE (AS filename REUSE?)? (RESETLOGS|NORESETLOGS)? + : TRACE (AS filename REUSE?)? (RESETLOGS | NORESETLOGS)? ; standby_database_clauses - : ( activate_standby_db_clause - | maximize_standby_db_clause - | register_logfile_clause - | commit_switchover_clause - | start_standby_clause - | stop_standby_clause - | convert_database_clause - ) - parallel_clause? + : ( + activate_standby_db_clause + | maximize_standby_db_clause + | register_logfile_clause + | commit_switchover_clause + | start_standby_clause + | stop_standby_clause + | convert_database_clause + ) parallel_clause? ; activate_standby_db_clause @@ -2360,24 +2349,27 @@ register_logfile_clause ; commit_switchover_clause - : (PREPARE | COMMIT) TO SWITCHOVER - ((TO (((PHYSICAL | LOGICAL)? PRIMARY | PHYSICAL? STANDBY) - ((WITH | WITHOUT)? SESSION SHUTDOWN (WAIT | NOWAIT) )? - | LOGICAL STANDBY - ) - | LOGICAL STANDBY - ) + : (PREPARE | COMMIT) TO SWITCHOVER ( + ( + TO ( + ((PHYSICAL | LOGICAL)? PRIMARY | PHYSICAL? STANDBY) ( + (WITH | WITHOUT)? SESSION SHUTDOWN (WAIT | NOWAIT) + )? + | LOGICAL STANDBY + ) + | LOGICAL STANDBY + ) | CANCEL - )? + )? ; start_standby_clause - : START LOGICAL STANDBY APPLY IMMEDIATE? NODELAY? - ( NEW PRIMARY regular_id + : START LOGICAL STANDBY APPLY IMMEDIATE? NODELAY? ( + NEW PRIMARY regular_id | INITIAL scn_value=UNSIGNED_INTEGER? | SKIP_ FAILED TRANSACTION | FINISH - )? + )? ; stop_standby_clause @@ -2433,17 +2425,14 @@ filename ; alter_table - : ALTER TABLE tableview_name - ( - | alter_table_properties - | constraint_clauses - | column_clauses -//TODO | alter_table_partitioning -//TODO | alter_external_table - | move_table_clause - ) - ((enable_disable_clause | enable_or_disable (TABLE LOCK | ALL TRIGGERS) )+)? - ';' + : ALTER TABLE tableview_name ( + | alter_table_properties + | constraint_clauses + | column_clauses + //TODO | alter_table_partitioning + //TODO | alter_external_table + | move_table_clause + ) ((enable_disable_clause | enable_or_disable (TABLE LOCK | ALL TRIGGERS))+)? ';' ; alter_table_properties @@ -2456,21 +2445,21 @@ alter_table_properties ; alter_table_properties_1 - : ( physical_attributes_clause - | logging_clause - | table_compression - | supplemental_table_logging - | allocate_extent_clause - | deallocate_unused_clause - | (CACHE | NOCACHE) - | RESULT_CACHE '(' MODE (DEFAULT | FORCE) ')' - | upgrade_table_clause - | records_per_block_clause - | parallel_clause - | row_movement_clause - | flashback_archive_clause - )+ - alter_iot_clauses? + : ( + physical_attributes_clause + | logging_clause + | table_compression + | supplemental_table_logging + | allocate_extent_clause + | deallocate_unused_clause + | (CACHE | NOCACHE) + | RESULT_CACHE '(' MODE (DEFAULT | FORCE) ')' + | upgrade_table_clause + | records_per_block_clause + | parallel_clause + | row_movement_clause + | flashback_archive_clause + )+ alter_iot_clauses? ; alter_iot_clauses @@ -2486,37 +2475,43 @@ alter_mapping_table_clause alter_overflow_clause : add_overflow_clause - | OVERFLOW (segment_attributes_clause | allocate_extent_clause | shrink_clause | deallocate_unused_clause)+ + | OVERFLOW ( + segment_attributes_clause + | allocate_extent_clause + | shrink_clause + | deallocate_unused_clause + )+ ; add_overflow_clause - : ADD OVERFLOW segment_attributes_clause? ('(' PARTITION segment_attributes_clause? (',' PARTITION segment_attributes_clause?)* ')' )? + : ADD OVERFLOW segment_attributes_clause? ( + '(' PARTITION segment_attributes_clause? (',' PARTITION segment_attributes_clause?)* ')' + )? ; - enable_disable_clause - : (ENABLE | DISABLE) (VALIDATE | NOVALIDATE)? - (UNIQUE '(' column_name (',' column_name)* ')' - | PRIMARY KEY - | CONSTRAINT constraint_name - ) using_index_clause? exceptions_clause? - CASCADE? ((KEEP | DROP) INDEX)? + : (ENABLE | DISABLE) (VALIDATE | NOVALIDATE)? ( + UNIQUE '(' column_name (',' column_name)* ')' + | PRIMARY KEY + | CONSTRAINT constraint_name + ) using_index_clause? exceptions_clause? CASCADE? ((KEEP | DROP) INDEX)? ; using_index_clause - : USING INDEX (index_name | '(' create_index ')' | index_attributes )? + : USING INDEX (index_name | '(' create_index ')' | index_attributes)? ; index_attributes - : ( physical_attributes_clause - | logging_clause - | TABLESPACE (tablespace | DEFAULT) - | key_compression - | sort_or_nosort - | REVERSE - | visible_or_invisible - | parallel_clause - )+ + : ( + physical_attributes_clause + | logging_clause + | TABLESPACE (tablespace | DEFAULT) + | key_compression + | sort_or_nosort + | REVERSE + | visible_or_invisible + | parallel_clause + )+ ; sort_or_nosort @@ -2529,7 +2524,9 @@ exceptions_clause ; move_table_clause - : MOVE ONLINE? segment_attributes_clause? table_compression? index_org_table_clause? ((lob_storage_clause | varray_col_properties)+)? parallel_clause? + : MOVE ONLINE? segment_attributes_clause? table_compression? index_org_table_clause? ( + (lob_storage_clause | varray_col_properties)+ + )? parallel_clause? ; index_org_table_clause @@ -2578,27 +2575,32 @@ new_column_name ; add_modify_drop_column_clauses - : (add_column_clause - |modify_column_clauses - |drop_column_clause - )+ + : (add_column_clause | modify_column_clauses | drop_column_clause)+ ; drop_column_clause - : SET UNUSED (COLUMN column_name| ('(' column_name (',' column_name)* ')' )) (CASCADE CONSTRAINTS | INVALIDATE)* - | DROP (COLUMN column_name | '(' column_name (',' column_name)* ')' ) (CASCADE CONSTRAINTS | INVALIDATE)* (CHECKPOINT UNSIGNED_INTEGER)? + : SET UNUSED (COLUMN column_name | ('(' column_name (',' column_name)* ')')) ( + CASCADE CONSTRAINTS + | INVALIDATE + )* + | DROP (COLUMN column_name | '(' column_name (',' column_name)* ')') ( + CASCADE CONSTRAINTS + | INVALIDATE + )* (CHECKPOINT UNSIGNED_INTEGER)? | DROP (UNUSED COLUMNS | COLUMNS CONTINUE) (CHECKPOINT UNSIGNED_INTEGER) ; modify_column_clauses - : MODIFY ('(' modify_col_properties (',' modify_col_properties)* ')' - | modify_col_properties - | modify_col_substitutable - ) + : MODIFY ( + '(' modify_col_properties (',' modify_col_properties)* ')' + | modify_col_properties + | modify_col_substitutable + ) ; modify_col_properties - : column_name datatype? (DEFAULT expression)? (ENCRYPT encryption_spec | DECRYPT)? inline_constraint* lob_storage_clause? //TODO alter_xmlschema_clause + : column_name datatype? (DEFAULT expression)? (ENCRYPT encryption_spec | DECRYPT)? inline_constraint* lob_storage_clause? + //TODO alter_xmlschema_clause ; modify_col_substitutable @@ -2606,24 +2608,26 @@ modify_col_substitutable ; add_column_clause - : ADD ('(' (column_definition | virtual_column_definition) (',' (column_definition - | virtual_column_definition) - )* - ')' - | ( column_definition | virtual_column_definition )) - column_properties? + : ADD ( + '(' (column_definition | virtual_column_definition) ( + ',' (column_definition | virtual_column_definition) + )* ')' + | ( column_definition | virtual_column_definition) + ) column_properties? ; varray_col_properties - : VARRAY varray_item ( substitutable_column_clause? varray_storage_clause - | substitutable_column_clause - ) + : VARRAY varray_item ( + substitutable_column_clause? varray_storage_clause + | substitutable_column_clause + ) ; varray_storage_clause - : STORE AS (SECUREFILE|BASICFILE)? LOB ( lob_segname? '(' lob_storage_parameters ')' - | lob_segname - ) + : STORE AS (SECUREFILE | BASICFILE)? LOB ( + lob_segname? '(' lob_storage_parameters ')' + | lob_segname + ) ; lob_segname @@ -2635,14 +2639,23 @@ lob_item ; lob_storage_parameters - : TABLESPACE tablespace | (lob_parameters storage_clause? ) - | storage_clause + : TABLESPACE tablespace + | (lob_parameters storage_clause?) + | storage_clause ; lob_storage_clause - : LOB ( '(' lob_item (',' lob_item)* ')' STORE AS ( (SECUREFILE|BASICFILE) | '(' lob_storage_parameters ')' )+ - | '(' lob_item ')' STORE AS ( (SECUREFILE | BASICFILE) | lob_segname | '(' lob_storage_parameters ')' )+ - ) + : LOB ( + '(' lob_item (',' lob_item)* ')' STORE AS ( + (SECUREFILE | BASICFILE) + | '(' lob_storage_parameters ')' + )+ + | '(' lob_item ')' STORE AS ( + (SECUREFILE | BASICFILE) + | lob_segname + | '(' lob_storage_parameters ')' + )+ + ) ; modify_lob_storage_clause @@ -2650,34 +2663,36 @@ modify_lob_storage_clause ; modify_lob_parameters - : ( storage_clause - | (PCTVERSION | FREEPOOLS) UNSIGNED_INTEGER - | REBUILD FREEPOOLS - | lob_retention_clause - | lob_deduplicate_clause - | lob_compression_clause - | ENCRYPT encryption_spec - | DECRYPT - | CACHE - | (CACHE | NOCACHE | CACHE READS) logging_clause? - | allocate_extent_clause - | shrink_clause - | deallocate_unused_clause - )+ + : ( + storage_clause + | (PCTVERSION | FREEPOOLS) UNSIGNED_INTEGER + | REBUILD FREEPOOLS + | lob_retention_clause + | lob_deduplicate_clause + | lob_compression_clause + | ENCRYPT encryption_spec + | DECRYPT + | CACHE + | (CACHE | NOCACHE | CACHE READS) logging_clause? + | allocate_extent_clause + | shrink_clause + | deallocate_unused_clause + )+ ; lob_parameters - : ( (ENABLE | DISABLE) STORAGE IN ROW - | CHUNK UNSIGNED_INTEGER - | PCTVERSION UNSIGNED_INTEGER - | FREEPOOLS UNSIGNED_INTEGER - | lob_retention_clause - | lob_deduplicate_clause - | lob_compression_clause - | ENCRYPT encryption_spec - | DECRYPT - | (CACHE | NOCACHE | CACHE READS) logging_clause? - )+ + : ( + (ENABLE | DISABLE) STORAGE IN ROW + | CHUNK UNSIGNED_INTEGER + | PCTVERSION UNSIGNED_INTEGER + | FREEPOOLS UNSIGNED_INTEGER + | lob_retention_clause + | lob_deduplicate_clause + | lob_compression_clause + | ENCRYPT encryption_spec + | DECRYPT + | (CACHE | NOCACHE | CACHE READS) logging_clause? + )+ ; lob_deduplicate_clause @@ -2695,8 +2710,9 @@ lob_retention_clause ; encryption_spec - : (USING CHAR_STRING)? (IDENTIFIED BY REGULAR_ID)? CHAR_STRING? (NO? SALT)? + : (USING CHAR_STRING)? (IDENTIFIED BY REGULAR_ID)? CHAR_STRING? (NO? SALT)? ; + tablespace : regular_id ; @@ -2713,13 +2729,13 @@ column_properties ; column_definition - : column_name (datatype | type_name) - SORT? (DEFAULT expression)? (ENCRYPT (USING CHAR_STRING)? (IDENTIFIED BY regular_id)? CHAR_STRING? (NO? SALT)? )? (inline_constraint* | inline_ref_constraint) + : column_name (datatype | type_name) SORT? (DEFAULT expression)? ( + ENCRYPT (USING CHAR_STRING)? (IDENTIFIED BY regular_id)? CHAR_STRING? (NO? SALT)? + )? (inline_constraint* | inline_ref_constraint) ; virtual_column_definition - : column_name datatype? autogenerated_sequence_definition? - VIRTUAL? inline_constraint* + : column_name datatype? autogenerated_sequence_definition? VIRTUAL? inline_constraint* ; autogenerated_sequence_definition @@ -2727,15 +2743,10 @@ autogenerated_sequence_definition ; nested_table_col_properties - : NESTED TABLE (nested_item | COLUMN_VALUE) substitutable_column_clause? (LOCAL | GLOBAL)? - STORE AS tableview_name ( '(' ( '(' object_properties ')' - | physical_properties - | column_properties - )+ - ')' - )? - (RETURN AS? (LOCATOR | VALUE) )? - ; + : NESTED TABLE (nested_item | COLUMN_VALUE) substitutable_column_clause? (LOCAL | GLOBAL)? STORE AS tableview_name ( + '(' ('(' object_properties ')' | physical_properties | column_properties)+ ')' + )? (RETURN AS? (LOCATOR | VALUE))? + ; nested_item : regular_id @@ -2760,8 +2771,12 @@ object_type_col_properties constraint_clauses : ADD '(' (out_of_line_constraint* | out_of_line_ref_constraint) ')' - | ADD (out_of_line_constraint* | out_of_line_ref_constraint) - | MODIFY (CONSTRAINT constraint_name | PRIMARY KEY | UNIQUE '(' column_name (',' column_name)* ')') constraint_state CASCADE? + | ADD (out_of_line_constraint* | out_of_line_ref_constraint) + | MODIFY ( + CONSTRAINT constraint_name + | PRIMARY KEY + | UNIQUE '(' column_name (',' column_name)* ')' + ) constraint_state CASCADE? | RENAME CONSTRAINT old_constraint_name TO new_constraint_name | drop_constraint_clause+ ; @@ -2775,7 +2790,7 @@ new_constraint_name ; drop_constraint_clause - : DROP drop_primary_key_or_unique_or_generic_clause + : DROP drop_primary_key_or_unique_or_generic_clause ; drop_primary_key_or_unique_or_generic_clause @@ -2783,7 +2798,6 @@ drop_primary_key_or_unique_or_generic_clause | CONSTRAINT constraint_name CASCADE? ; - check_constraint : CHECK '(' condition ')' DISABLE? ; @@ -2873,7 +2887,9 @@ subtype_declaration // cursor_declaration incorportates curscursor_body and cursor_spec cursor_declaration - : CURSOR identifier ('(' parameter_spec (',' parameter_spec)* ')' )? (RETURN type_spec)? (IS select_statement)? ';' + : CURSOR identifier ('(' parameter_spec (',' parameter_spec)* ')')? (RETURN type_spec)? ( + IS select_statement + )? ';' ; parameter_spec @@ -2885,11 +2901,13 @@ exception_declaration ; pragma_declaration - : PRAGMA (SERIALLY_REUSABLE - | AUTONOMOUS_TRANSACTION - | EXCEPTION_INIT '(' exception_name ',' numeric_negative ')' - | INLINE '(' id1=identifier ',' expression ')' - | RESTRICT_REFERENCES '(' (identifier | DEFAULT) (',' identifier)+ ')') ';' + : PRAGMA ( + SERIALLY_REUSABLE + | AUTONOMOUS_TRANSACTION + | EXCEPTION_INIT '(' exception_name ',' numeric_negative ')' + | INLINE '(' id1=identifier ',' expression ')' + | RESTRICT_REFERENCES '(' (identifier | DEFAULT) (',' identifier)+ ')' + ) ';' ; // Record Declaration Specific Clauses @@ -3036,7 +3054,8 @@ procedure_call ; pipe_row_statement - : PIPE ROW '(' expression ')'; + : PIPE ROW '(' expression ')' + ; body : BEGIN seq_of_statements (EXCEPTION exception_handler+)? END label_name? @@ -3066,7 +3085,11 @@ sql_statement ; execute_immediate - : EXECUTE IMMEDIATE expression (into_clause using_clause? | using_clause dynamic_returning_clause? | dynamic_returning_clause)? + : EXECUTE IMMEDIATE expression ( + into_clause using_clause? + | using_clause dynamic_returning_clause? + | dynamic_returning_clause + )? ; // Execute Immediate Specific Clause @@ -3105,7 +3128,10 @@ open_statement ; fetch_statement - : FETCH cursor_name (it1=INTO variable_name (',' variable_name)* | BULK COLLECT INTO variable_name (',' variable_name)*) + : FETCH cursor_name ( + it1=INTO variable_name (',' variable_name)* + | BULK COLLECT INTO variable_name (',' variable_name)* + ) ; open_for_statement @@ -3123,19 +3149,25 @@ transaction_control_statements ; set_transaction_command - : SET TRANSACTION - (READ (ONLY | WRITE) | ISOLATION LEVEL (SERIALIZABLE | READ COMMITTED) | USE ROLLBACK SEGMENT rollback_segment_name)? - (NAME quoted_string)? + : SET TRANSACTION ( + READ (ONLY | WRITE) + | ISOLATION LEVEL (SERIALIZABLE | READ COMMITTED) + | USE ROLLBACK SEGMENT rollback_segment_name + )? (NAME quoted_string)? ; set_constraint_command - : SET (CONSTRAINT | CONSTRAINTS) (ALL | constraint_name (',' constraint_name)*) (IMMEDIATE | DEFERRED) + : SET (CONSTRAINT | CONSTRAINTS) (ALL | constraint_name (',' constraint_name)*) ( + IMMEDIATE + | DEFERRED + ) ; commit_statement - : COMMIT WORK? - (COMMENT expression | FORCE (CORRUPT_XID expression | CORRUPT_XID_ALL | expression (',' expression)?))? - write_clause? + : COMMIT WORK? ( + COMMENT expression + | FORCE (CORRUPT_XID expression | CORRUPT_XID_ALL | expression (',' expression)?) + )? write_clause? ; write_clause @@ -3172,8 +3204,13 @@ seq_of_statements */ explain_statement - : EXPLAIN PLAN (SET STATEMENT_ID '=' quoted_string)? (INTO tableview_name)? - FOR (select_statement | update_statement | delete_statement | insert_statement | merge_statement) + : EXPLAIN PLAN (SET STATEMENT_ID '=' quoted_string)? (INTO tableview_name)? FOR ( + select_statement + | update_statement + | delete_statement + | insert_statement + | merge_statement + ) ; select_only_statement @@ -3191,13 +3228,13 @@ subquery_factoring_clause ; factoring_element - : query_name paren_column_list? AS '(' subquery order_by_clause? ')' - search_clause? cycle_clause? + : query_name paren_column_list? AS '(' subquery order_by_clause? ')' search_clause? cycle_clause? ; search_clause - : SEARCH (DEPTH | BREADTH) FIRST BY column_name ASC? DESC? (NULLS FIRST)? (NULLS LAST)? - (',' column_name ASC? DESC? (NULLS FIRST)? (NULLS LAST)?)* SET column_name + : SEARCH (DEPTH | BREADTH) FIRST BY column_name ASC? DESC? (NULLS FIRST)? (NULLS LAST)? ( + ',' column_name ASC? DESC? (NULLS FIRST)? (NULLS LAST)? + )* SET column_name ; cycle_clause @@ -3218,8 +3255,8 @@ subquery_operation_part ; query_block - : SELECT (DISTINCT | UNIQUE | ALL)? selected_list - into_clause? from_clause? where_clause? hierarchical_query_clause? group_by_clause? model_clause? order_by_clause? + : SELECT (DISTINCT | UNIQUE | ALL)? selected_list into_clause? from_clause? where_clause? hierarchical_query_clause? group_by_clause? model_clause + ? order_by_clause? ; selected_list @@ -3254,14 +3291,16 @@ table_ref_aux ; table_ref_aux_internal - : dml_table_expression_clause (pivot_clause | unpivot_clause)? # table_ref_aux_internal_one - | '(' table_ref subquery_operation_part* ')' (pivot_clause | unpivot_clause)? # table_ref_aux_internal_two - | ONLY '(' dml_table_expression_clause ')' # table_ref_aux_internal_three + : dml_table_expression_clause (pivot_clause | unpivot_clause)? # table_ref_aux_internal_one + | '(' table_ref subquery_operation_part* ')' (pivot_clause | unpivot_clause)? # table_ref_aux_internal_two + | ONLY '(' dml_table_expression_clause ')' # table_ref_aux_internal_three ; join_clause - : query_partition_clause? (CROSS | NATURAL)? (INNER | outer_join_type)? - JOIN table_ref_aux query_partition_clause? (join_on_part | join_using_part)* + : query_partition_clause? (CROSS | NATURAL)? (INNER | outer_join_type)? JOIN table_ref_aux query_partition_clause? ( + join_on_part + | join_using_part + )* ; join_on_part @@ -3311,8 +3350,7 @@ pivot_in_clause_elements ; unpivot_clause - : UNPIVOT ((INCLUDE | EXCLUDE) NULLS)? - '(' (column_name | paren_column_list) pivot_for_clause unpivot_in_clause ')' + : UNPIVOT ((INCLUDE | EXCLUDE) NULLS)? '(' (column_name | paren_column_list) pivot_for_clause unpivot_in_clause ')' ; unpivot_in_clause @@ -3320,8 +3358,7 @@ unpivot_in_clause ; unpivot_in_elements - : (column_name | paren_column_list) - (AS (constant | '(' constant (',' constant)* ')'))? + : (column_name | paren_column_list) (AS (constant | '(' constant (',' constant)* ')'))? ; hierarchical_query_clause @@ -3392,7 +3429,7 @@ model_column_partition_part ; model_column_list - : '(' model_column (',' model_column)* ')' + : '(' model_column (',' model_column)* ')' ; model_column @@ -3460,8 +3497,10 @@ update_statement // Update Specific Clauses update_set_clause - : SET - (column_based_update_set_clause (',' column_based_update_set_clause)* | VALUE '(' identifier ')' '=' expression) + : SET ( + column_based_update_set_clause (',' column_based_update_set_clause)* + | VALUE '(' identifier ')' '=' expression + ) ; column_based_update_set_clause @@ -3512,9 +3551,10 @@ values_clause ; merge_statement - : MERGE INTO tableview_name table_alias? USING selected_tableview ON '(' condition ')' - (merge_update_clause merge_insert_clause? | merge_insert_clause merge_update_clause?)? - error_logging_clause? + : MERGE INTO tableview_name table_alias? USING selected_tableview ON '(' condition ')' ( + merge_update_clause merge_insert_clause? + | merge_insert_clause merge_update_clause? + )? error_logging_clause? ; // Merge Specific Clauses @@ -3532,8 +3572,7 @@ merge_update_delete_part ; merge_insert_clause - : WHEN NOT MATCHED THEN INSERT paren_column_list? - VALUES '(' expressions? ')' where_clause? + : WHEN NOT MATCHED THEN INSERT paren_column_list? VALUES '(' expressions? ')' where_clause? ; selected_tableview @@ -3636,11 +3675,16 @@ unary_logical_expression : NOT? multiset_expression (IS NOT? logical_operation)* ; -logical_operation: - (NULL_ - | NAN | PRESENT - | INFINITE | A_LETTER SET | EMPTY - | OF TYPE? '(' ONLY? type_spec (',' type_spec)* ')') +logical_operation + : ( + NULL_ + | NAN + | PRESENT + | INFINITE + | A_LETTER SET + | EMPTY + | OF TYPE? '(' ONLY? type_spec (',' type_spec)* ')' + ) ; multiset_expression @@ -3653,10 +3697,13 @@ relational_expression ; compound_expression - : concatenation - (NOT? ( IN in_elements + : concatenation ( + NOT? ( + IN in_elements | BETWEEN between_elements - | like_type=(LIKE | LIKEC | LIKE2 | LIKE4) concatenation (ESCAPE concatenation)?))? + | like_type=(LIKE | LIKEC | LIKE2 | LIKE4) concatenation (ESCAPE concatenation)? + ) + )? ; relational_operator @@ -3678,8 +3725,7 @@ between_elements ; concatenation - : model_expression - (AT (LOCAL | TIME ZONE concatenation) | interval_expression)? + : model_expression (AT (LOCAL | TIME ZONE concatenation) | interval_expression)? | concatenation op=(ASTERISK | SOLIDUS) concatenation | concatenation op=(PLUS_SIGN | MINUS_SIGN) concatenation | concatenation BAR BAR concatenation @@ -3701,15 +3747,17 @@ model_expression_element ; single_column_for_loop - : FOR column_name - ( IN '(' expressions? ')' - | (LIKE expression)? FROM fromExpr=expression TO toExpr=expression - action_type=(INCREMENT | DECREMENT) action_expr=expression) + : FOR column_name ( + IN '(' expressions? ')' + | (LIKE expression)? FROM fromExpr=expression TO toExpr=expression action_type=( + INCREMENT + | DECREMENT + ) action_expr=expression + ) ; multi_column_for_loop - : FOR paren_column_list - IN '(' (subquery | '(' expressions? ')') ')' + : FOR paren_column_list IN '(' (subquery | '(' expressions? ')') ')' ; unary_expression @@ -3717,12 +3765,12 @@ unary_expression | PRIOR unary_expression | CONNECT_BY_ROOT unary_expression | /*TODO {input.LT(1).getText().equalsIgnoreCase("new") && !input.LT(2).getText().equals(".")}?*/ NEW unary_expression - | DISTINCT unary_expression - | ALL unary_expression - | /*TODO{(input.LA(1) == CASE || input.LA(2) == CASE)}?*/ case_statement/*[false]*/ - | quantified_expression - | standard_function - | atom + | DISTINCT unary_expression + | ALL unary_expression + | /*TODO{(input.LA(1) == CASE || input.LA(2) == CASE)}?*/ case_statement /*[false]*/ + | quantified_expression + | standard_function + | atom ; case_statement /*TODO [boolean isStatementParameter] @@ -3737,7 +3785,7 @@ TODO scope { // CASE simple_case_statement - : label_name? ck1=CASE expression simple_case_when_part+ case_else_part? END CASE? label_name? + : label_name? ck1=CASE expression simple_case_when_part+ case_else_part? END CASE? label_name? ; simple_case_when_part @@ -3771,9 +3819,10 @@ quantified_expression string_function : SUBSTR '(' expression ',' expression (',' expression)? ')' - | TO_CHAR '(' (table_element | standard_function | expression) - (',' quoted_string)? (',' quoted_string)? ')' - | DECODE '(' expressions ')' + | TO_CHAR '(' (table_element | standard_function | expression) (',' quoted_string)? ( + ',' quoted_string + )? ')' + | DECODE '(' expressions ')' | CHR '(' concatenation USING NCHAR_CS ')' | NVL '(' expression ',' expression ')' | TRIM '(' ((LEADING | TRAILING | BOTH)? quoted_string? FROM)? concatenation ')' @@ -3798,51 +3847,51 @@ numeric_function_wrapper ; numeric_function - : SUM '(' (DISTINCT | ALL)? expression ')' - | COUNT '(' ( ASTERISK | ((DISTINCT | UNIQUE | ALL)? concatenation)? ) ')' over_clause? - | ROUND '(' expression (',' UNSIGNED_INTEGER)? ')' - | AVG '(' (DISTINCT | ALL)? expression ')' - | MAX '(' (DISTINCT | ALL)? expression ')' - | LEAST '(' expressions ')' - | GREATEST '(' expressions ')' - ; + : SUM '(' (DISTINCT | ALL)? expression ')' + | COUNT '(' (ASTERISK | ((DISTINCT | UNIQUE | ALL)? concatenation)?) ')' over_clause? + | ROUND '(' expression (',' UNSIGNED_INTEGER)? ')' + | AVG '(' (DISTINCT | ALL)? expression ')' + | MAX '(' (DISTINCT | ALL)? expression ')' + | LEAST '(' expressions ')' + | GREATEST '(' expressions ')' + ; other_function : over_clause_keyword function_argument_analytic over_clause? | /*TODO stantard_function_enabling_using*/ regular_id function_argument_modeling using_clause? - | COUNT '(' ( ASTERISK | (DISTINCT | UNIQUE | ALL)? concatenation) ')' over_clause? + | COUNT '(' (ASTERISK | (DISTINCT | UNIQUE | ALL)? concatenation) ')' over_clause? | (CAST | XMLCAST) '(' (MULTISET '(' subquery ')' | concatenation) AS type_spec ')' | COALESCE '(' table_element (',' (numeric | quoted_string))? ')' | COLLECT '(' (DISTINCT | UNIQUE)? concatenation collect_order_by_part? ')' | within_or_over_clause_keyword function_argument within_or_over_part+ - | cursor_name ( PERCENT_ISOPEN | PERCENT_FOUND | PERCENT_NOTFOUND | PERCENT_ROWCOUNT ) + | cursor_name (PERCENT_ISOPEN | PERCENT_FOUND | PERCENT_NOTFOUND | PERCENT_ROWCOUNT) | DECOMPOSE '(' concatenation (CANONICAL | COMPATIBILITY)? ')' | EXTRACT '(' regular_id FROM concatenation ')' | (FIRST_VALUE | LAST_VALUE) function_argument_analytic respect_or_ignore_nulls? over_clause - | standard_prediction_function_keyword - '(' expressions cost_matrix_clause? using_clause? ')' + | standard_prediction_function_keyword '(' expressions cost_matrix_clause? using_clause? ')' | TRANSLATE '(' expression (USING (CHAR_CS | NCHAR_CS))? (',' expression)* ')' | TREAT '(' expression AS REF? type_spec ')' | TRIM '(' ((LEADING | TRAILING | BOTH)? quoted_string? FROM)? concatenation ')' | XMLAGG '(' expression order_by_clause? ')' ('.' general_element_part)? - | (XMLCOLATTVAL | XMLFOREST) - '(' xml_multiuse_expression_element (',' xml_multiuse_expression_element)* ')' ('.' general_element_part)? - | XMLELEMENT - '(' (ENTITYESCAPING | NOENTITYESCAPING)? (NAME | EVALNAME)? expression - (/*TODO{input.LT(2).getText().equalsIgnoreCase("xmlattributes")}?*/ ',' xml_attributes_clause)? - (',' expression column_alias?)* ')' ('.' general_element_part)? + | (XMLCOLATTVAL | XMLFOREST) '(' xml_multiuse_expression_element ( + ',' xml_multiuse_expression_element + )* ')' ('.' general_element_part)? + | XMLELEMENT '(' (ENTITYESCAPING | NOENTITYESCAPING)? (NAME | EVALNAME)? expression ( + /*TODO{input.LT(2).getText().equalsIgnoreCase("xmlattributes")}?*/ ',' xml_attributes_clause + )? (',' expression column_alias?)* ')' ('.' general_element_part)? | XMLEXISTS '(' expression xml_passing_clause? ')' | XMLPARSE '(' (DOCUMENT | CONTENT) concatenation WELLFORMED? ')' ('.' general_element_part)? - | XMLPI - '(' (NAME identifier | EVALNAME concatenation) (',' concatenation)? ')' ('.' general_element_part)? - | XMLQUERY - '(' concatenation xml_passing_clause? RETURNING CONTENT (NULL_ ON EMPTY)? ')' ('.' general_element_part)? - | XMLROOT - '(' concatenation (',' xmlroot_param_version_part)? (',' xmlroot_param_standalone_part)? ')' ('.' general_element_part)? - | XMLSERIALIZE - '(' (DOCUMENT | CONTENT) concatenation (AS type_spec)? - xmlserialize_param_enconding_part? xmlserialize_param_version_part? xmlserialize_param_ident_part? ((HIDE | SHOW) DEFAULTS)? ')' - ('.' general_element_part)? + | XMLPI '(' (NAME identifier | EVALNAME concatenation) (',' concatenation)? ')' ( + '.' general_element_part + )? + | XMLQUERY '(' concatenation xml_passing_clause? RETURNING CONTENT (NULL_ ON EMPTY)? ')' ( + '.' general_element_part + )? + | XMLROOT '(' concatenation (',' xmlroot_param_version_part)? ( + ',' xmlroot_param_standalone_part + )? ')' ('.' general_element_part)? + | XMLSERIALIZE '(' (DOCUMENT | CONTENT) concatenation (AS type_spec)? xmlserialize_param_enconding_part? xmlserialize_param_version_part? + xmlserialize_param_ident_part? ((HIDE | SHOW) DEFAULTS)? ')' ('.' general_element_part)? | xmltable ; @@ -3889,8 +3938,7 @@ over_clause ; windowing_clause - : windowing_type - (BETWEEN windowing_elements AND windowing_elements | windowing_elements) + : windowing_type (BETWEEN windowing_elements AND windowing_elements | windowing_elements) ; windowing_type @@ -3922,7 +3970,10 @@ within_or_over_part ; cost_matrix_clause - : COST (MODEL AUTO? | '(' cost_class_name (',' cost_class_name)* ')' VALUES '(' expressions? ')') + : COST ( + MODEL AUTO? + | '(' cost_class_name (',' cost_class_name)* ')' VALUES '(' expressions? ')' + ) ; xml_passing_clause @@ -3930,19 +3981,17 @@ xml_passing_clause ; xml_attributes_clause - : XMLATTRIBUTES - '(' (ENTITYESCAPING | NOENTITYESCAPING)? (SCHEMACHECK | NOSCHEMACHECK)? - xml_multiuse_expression_element (',' xml_multiuse_expression_element)* ')' + : XMLATTRIBUTES '(' (ENTITYESCAPING | NOENTITYESCAPING)? (SCHEMACHECK | NOSCHEMACHECK)? xml_multiuse_expression_element ( + ',' xml_multiuse_expression_element + )* ')' ; xml_namespaces_clause - : XMLNAMESPACES - '(' (concatenation column_alias)? (',' concatenation column_alias)* xml_general_default_part? ')' + : XMLNAMESPACES '(' (concatenation column_alias)? (',' concatenation column_alias)* xml_general_default_part? ')' ; xml_table_column - : xml_column_name - (FOR ORDINALITY | type_spec (PATH concatenation)? xml_general_default_part?) + : xml_column_name (FOR ORDINALITY | type_spec (PATH concatenation)? xml_general_default_part?) ; xml_general_default_part @@ -3987,13 +4036,14 @@ sql_plus_command ; whenever_command - : WHENEVER (SQLERROR | OSERROR) - ( EXIT (SUCCESS | FAILURE | WARNING | variable_name) (COMMIT | ROLLBACK) - | CONTINUE (COMMIT | ROLLBACK | NONE)) + : WHENEVER (SQLERROR | OSERROR) ( + EXIT (SUCCESS | FAILURE | WARNING | variable_name) (COMMIT | ROLLBACK) + | CONTINUE (COMMIT | ROLLBACK | NONE) + ) ; set_command - : SET regular_id (CHAR_STRING | ON | OFF | /*EXACT_NUM_LIT*/numeric | regular_id) + : SET regular_id (CHAR_STRING | ON | OFF | /*EXACT_NUM_LIT*/ numeric | regular_id) ; // Common @@ -4156,13 +4206,17 @@ column_name ; tableview_name - : identifier ('.' id_expression)? - (AT_SIGN link_name | /*TODO{!(input.LA(2) == BY)}?*/ partition_extension_clause)? + : identifier ('.' id_expression)? ( + AT_SIGN link_name + | /*TODO{!(input.LA(2) == BY)}?*/ partition_extension_clause + )? | xmltable outer_join_sign? ; xmltable - : XMLTABLE '(' (xml_namespaces_clause ',')? concatenation xml_passing_clause? (COLUMNS xml_table_column (',' xml_table_column)*)? ')' ('.' general_element_part)? + : XMLTABLE '(' (xml_namespaces_clause ',')? concatenation xml_passing_clause? ( + COLUMNS xml_table_column (',' xml_table_column)* + )? ')' ('.' general_element_part)? ; char_set_name @@ -4222,9 +4276,11 @@ function_argument_analytic ; function_argument_modeling - : '(' column_name (',' (numeric | NULL_) (',' (numeric | NULL_))?)? - USING (tableview_name '.' ASTERISK | ASTERISK | expression column_alias? (',' expression column_alias?)*) - ')' keep_clause? + : '(' column_name (',' (numeric | NULL_) (',' (numeric | NULL_))?)? USING ( + tableview_name '.' ASTERISK + | ASTERISK + | expression column_alias? (',' expression column_alias?)* + ) ')' keep_clause? ; respect_or_ignore_nulls @@ -4308,9 +4364,8 @@ native_datatype_element bind_variable : (BINDVAR | ':' UNSIGNED_INTEGER) - // Pro*C/C++ indicator variables - (INDICATOR? (BINDVAR | ':' UNSIGNED_INTEGER))? - ('.' general_element_part)* + // Pro*C/C++ indicator variables + (INDICATOR? (BINDVAR | ':' UNSIGNED_INTEGER))? ('.' general_element_part)* ; general_element @@ -4402,7 +4457,7 @@ system_privilege | SET CONTAINER | CREATE ANY? PROCEDURE | (ALTER | DROP | EXECUTE) ANY PROCEDURE - | (CREATE | ALTER | DROP ) PROFILE + | (CREATE | ALTER | DROP) PROFILE | CREATE ROLE | (ALTER | DROP | GRANT) ANY ROLE | (CREATE | ALTER | DROP) ROLLBACK SEGMENT @@ -4452,10 +4507,16 @@ system_privilege constant : TIMESTAMP (quoted_string | bind_variable) (AT TIME ZONE quoted_string)? - | INTERVAL (quoted_string | bind_variable | general_element_part) - (YEAR | MONTH | DAY | HOUR | MINUTE | SECOND) - ('(' (UNSIGNED_INTEGER | bind_variable) (',' (UNSIGNED_INTEGER | bind_variable) )? ')')? - (TO ( DAY | HOUR | MINUTE | SECOND ('(' (UNSIGNED_INTEGER | bind_variable) ')')?))? + | INTERVAL (quoted_string | bind_variable | general_element_part) ( + YEAR + | MONTH + | DAY + | HOUR + | MINUTE + | SECOND + ) ('(' (UNSIGNED_INTEGER | bind_variable) (',' (UNSIGNED_INTEGER | bind_variable))? ')')? ( + TO (DAY | HOUR | MINUTE | SECOND ('(' (UNSIGNED_INTEGER | bind_variable) ')')?) + )? | numeric | DATE quoted_string | quoted_string @@ -6633,4 +6694,4 @@ non_reserved_keywords_pre12c | YEAR | YES | ZONE - ; + ; \ No newline at end of file diff --git a/src/grammar/spark/SparkSqlLexer.g4 b/src/grammar/spark/SparkSqlLexer.g4 index 06e4e42..84034fa 100644 --- a/src/grammar/spark/SparkSqlLexer.g4 +++ b/src/grammar/spark/SparkSqlLexer.g4 @@ -18,6 +18,11 @@ * Reference: https://github.com/apache/spark/blob/master/sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseLexer.g4 */ +// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing +// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true +// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true + lexer grammar SparkSqlLexer; @members { @@ -39,12 +44,12 @@ lexer grammar SparkSqlLexer; SEMICOLON: ';'; -LEFT_PAREN: '('; -RIGHT_PAREN: ')'; -COMMA: ','; -DOT: '.'; -LEFT_BRACKET: '['; -RIGHT_BRACKET: ']'; +LEFT_PAREN : '('; +RIGHT_PAREN : ')'; +COMMA : ','; +DOT : '.'; +LEFT_BRACKET : '['; +RIGHT_BRACKET : ']'; // NOTE: If you add a new token in the list below, you should update the list of keywords // and reserved tag in `docs/sql-ref-ansi-compliance.md#sql-keywords`, and @@ -54,468 +59,420 @@ RIGHT_BRACKET: ']'; // Start of the keywords list //============================ //--SPARK-KEYWORD-LIST-START -KW_ADD: 'ADD'; -KW_AFTER: 'AFTER'; -KW_ALL: 'ALL'; -KW_ALTER: 'ALTER'; -KW_ALWAYS: 'ALWAYS'; -KW_ANALYZE: 'ANALYZE'; -KW_AND: 'AND'; -KW_ANTI: 'ANTI'; -KW_ANY: 'ANY'; -KW_ANY_VALUE: 'ANY_VALUE'; -KW_ARCHIVE: 'ARCHIVE'; -KW_ARRAY: 'ARRAY'; -KW_AS: 'AS'; -KW_ASC: 'ASC'; -KW_AT: 'AT'; -KW_AUTHORIZATION: 'AUTHORIZATION'; -KW_BETWEEN: 'BETWEEN'; -KW_BIGINT: 'BIGINT'; -KW_BINARY: 'BINARY'; -KW_BOOLEAN: 'BOOLEAN'; -KW_BOTH: 'BOTH'; -KW_BUCKET: 'BUCKET'; -KW_BUCKETS: 'BUCKETS'; -KW_BY: 'BY'; -KW_BYTE: 'BYTE'; -KW_CACHE: 'CACHE'; -KW_CASCADE: 'CASCADE'; -KW_CASE: 'CASE'; -KW_CAST: 'CAST'; -KW_CATALOG: 'CATALOG'; -KW_CATALOGS: 'CATALOGS'; -KW_CHANGE: 'CHANGE'; -KW_CHAR: 'CHAR'; -KW_CHARACTER: 'CHARACTER'; -KW_CHECK: 'CHECK'; -KW_CLEAR: 'CLEAR'; -KW_CLUSTER: 'CLUSTER'; -KW_CLUSTERED: 'CLUSTERED'; -KW_CODEGEN: 'CODEGEN'; -KW_COLLATE: 'COLLATE'; -KW_COLLECTION: 'COLLECTION'; -KW_COLUMN: 'COLUMN'; -KW_COLUMNS: 'COLUMNS'; -KW_COMMENT: 'COMMENT'; -KW_COMMIT: 'COMMIT'; -KW_COMPACT: 'COMPACT'; -KW_COMPACTIONS: 'COMPACTIONS'; -KW_COMPUTE: 'COMPUTE'; -KW_CONCATENATE: 'CONCATENATE'; -KW_CONSTRAINT: 'CONSTRAINT'; -KW_COST: 'COST'; -KW_CREATE: 'CREATE'; -KW_CROSS: 'CROSS'; -KW_CUBE: 'CUBE'; -KW_CURRENT: 'CURRENT'; -KW_CURRENT_DATE: 'CURRENT_DATE'; -KW_CURRENT_TIME: 'CURRENT_TIME'; -KW_CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; -KW_CURRENT_USER: 'CURRENT_USER'; -KW_DAY: 'DAY'; -KW_DAYS: 'DAYS'; -KW_DAYOFYEAR: 'DAYOFYEAR'; -KW_DATA: 'DATA'; -KW_DATE: 'DATE'; -KW_DATABASE: 'DATABASE'; -KW_DATABASES: 'DATABASES'; -KW_DATEADD: 'DATEADD'; -KW_DATE_ADD: 'DATE_ADD'; -KW_DATEDIFF: 'DATEDIFF'; -KW_DATE_DIFF: 'DATE_DIFF'; -KW_DBPROPERTIES: 'DBPROPERTIES'; -KW_DEC: 'DEC'; -KW_DECIMAL: 'DECIMAL'; -KW_DECLARE: 'DECLARE'; -KW_DEFAULT: 'DEFAULT'; -KW_DEFINED: 'DEFINED'; -KW_DELETE: 'DELETE'; -KW_DELIMITED: 'DELIMITED'; -KW_DESC: 'DESC'; -KW_DESCRIBE: 'DESCRIBE'; -KW_DFS: 'DFS'; -KW_DIRECTORIES: 'DIRECTORIES'; -KW_DIRECTORY: 'DIRECTORY'; -KW_DISTINCT: 'DISTINCT'; -KW_DISTRIBUTE: 'DISTRIBUTE'; -KW_DIV: 'DIV'; -KW_DOUBLE: 'DOUBLE'; -KW_DROP: 'DROP'; -KW_ELSE: 'ELSE'; -KW_END: 'END'; -KW_ESCAPE: 'ESCAPE'; -KW_ESCAPED: 'ESCAPED'; -KW_EXCEPT: 'EXCEPT'; -KW_EXCHANGE: 'EXCHANGE'; -KW_EXCLUDE: 'EXCLUDE'; -KW_EXISTS: 'EXISTS'; -KW_EXPLAIN: 'EXPLAIN'; -KW_EXPORT: 'EXPORT'; -KW_EXTENDED: 'EXTENDED'; -KW_EXTERNAL: 'EXTERNAL'; -KW_EXTRACT: 'EXTRACT'; -KW_FALSE: 'FALSE'; -KW_FETCH: 'FETCH'; -KW_FIELDS: 'FIELDS'; -KW_FILTER: 'FILTER'; -KW_FILEFORMAT: 'FILEFORMAT'; -KW_FIRST: 'FIRST'; -KW_FLOAT: 'FLOAT'; -KW_FOLLOWING: 'FOLLOWING'; -KW_FOR: 'FOR'; -KW_FOREIGN: 'FOREIGN'; -KW_FORMAT: 'FORMAT'; -KW_FORMATTED: 'FORMATTED'; -KW_FROM: 'FROM'; -KW_FULL: 'FULL'; -KW_FUNCTION: 'FUNCTION'; -KW_FUNCTIONS: 'FUNCTIONS'; -KW_GENERATED: 'GENERATED'; -KW_GLOBAL: 'GLOBAL'; -KW_GRANT: 'GRANT'; -KW_GROUP: 'GROUP'; -KW_GROUPING: 'GROUPING'; -KW_HAVING: 'HAVING'; -KW_BINARY_HEX: 'X'; -KW_HOUR: 'HOUR'; -KW_HOURS: 'HOURS'; -KW_IDENTIFIER: 'IDENTIFIER'; -KW_IF: 'IF'; -KW_IGNORE: 'IGNORE'; -KW_IMPORT: 'IMPORT'; -KW_IN: 'IN'; -KW_INCLUDE: 'INCLUDE'; -KW_INDEX: 'INDEX'; -KW_INDEXES: 'INDEXES'; -KW_INNER: 'INNER'; -KW_INPATH: 'INPATH'; -KW_INPUTFORMAT: 'INPUTFORMAT'; -KW_INSERT: 'INSERT'; -KW_INTERSECT: 'INTERSECT'; -KW_INTERVAL: 'INTERVAL'; -KW_INT: 'INT'; -KW_INTEGER: 'INTEGER'; -KW_INTO: 'INTO'; -KW_IS: 'IS'; -KW_ITEMS: 'ITEMS'; -KW_JOIN: 'JOIN'; -KW_KEYS: 'KEYS'; -KW_LAST: 'LAST'; -KW_LATERAL: 'LATERAL'; -KW_LAZY: 'LAZY'; -KW_LEADING: 'LEADING'; -KW_LEFT: 'LEFT'; -KW_LIKE: 'LIKE'; -KW_ILIKE: 'ILIKE'; -KW_LIMIT: 'LIMIT'; -KW_LINES: 'LINES'; -KW_LIST: 'LIST'; -KW_LOAD: 'LOAD'; -KW_LOCAL: 'LOCAL'; -KW_LOCATION: 'LOCATION'; -KW_LOCK: 'LOCK'; -KW_LOCKS: 'LOCKS'; -KW_LOGICAL: 'LOGICAL'; -KW_LONG: 'LONG'; -KW_MACRO: 'MACRO'; -KW_MAP: 'MAP'; -KW_MATCHED: 'MATCHED'; -KW_MERGE: 'MERGE'; -KW_MICROSECOND: 'MICROSECOND'; -KW_MICROSECONDS: 'MICROSECONDS'; -KW_MILLISECOND: 'MILLISECOND'; -KW_MILLISECONDS: 'MILLISECONDS'; -KW_MINUTE: 'MINUTE'; -KW_MINUTES: 'MINUTES'; -KW_MONTH: 'MONTH'; -KW_MONTHS: 'MONTHS'; -KW_MSCK: 'MSCK'; -KW_NAME: 'NAME'; -KW_NAMESPACE: 'NAMESPACE'; -KW_NAMESPACES: 'NAMESPACES'; -KW_NANOSECOND: 'NANOSECOND'; -KW_NANOSECONDS: 'NANOSECONDS'; -KW_NATURAL: 'NATURAL'; -KW_NO: 'NO'; -KW_NOSCAN: 'NOSCAN'; -KW_NOT: 'NOT'; -KW_NULL: 'NULL'; -KW_NULLS: 'NULLS'; -KW_NUMERIC: 'NUMERIC'; -KW_OF: 'OF'; -KW_OFFSET: 'OFFSET'; -KW_ON: 'ON'; -KW_ONLY: 'ONLY'; -KW_OPTION: 'OPTION'; -KW_OPTIONS: 'OPTIONS'; -KW_OR: 'OR'; -KW_ORDER: 'ORDER'; -KW_OUT: 'OUT'; -KW_OUTER: 'OUTER'; -KW_OUTPUTFORMAT: 'OUTPUTFORMAT'; -KW_OVER: 'OVER'; -KW_OVERLAPS: 'OVERLAPS'; -KW_OVERLAY: 'OVERLAY'; -KW_OVERWRITE: 'OVERWRITE'; -KW_PARTITION: 'PARTITION'; -KW_PARTITIONED: 'PARTITIONED'; -KW_PARTITIONS: 'PARTITIONS'; -KW_PERCENTILE_CONT: 'PERCENTILE_CONT'; -KW_PERCENTILE_DISC: 'PERCENTILE_DISC'; -KW_PERCENTLIT: 'PERCENT'; -KW_PIVOT: 'PIVOT'; -KW_PLACING: 'PLACING'; -KW_POSITION: 'POSITION'; -KW_PRECEDING: 'PRECEDING'; -KW_PRIMARY: 'PRIMARY'; -KW_PRINCIPALS: 'PRINCIPALS'; -KW_PROPERTIES: 'PROPERTIES'; -KW_PURGE: 'PURGE'; -KW_QUARTER: 'QUARTER'; -KW_QUERY: 'QUERY'; -KW_RANGE: 'RANGE'; -KW_REAL: 'REAL'; -KW_RECORDREADER: 'RECORDREADER'; -KW_RECORDWRITER: 'RECORDWRITER'; -KW_RECOVER: 'RECOVER'; -KW_REDUCE: 'REDUCE'; -KW_REFERENCES: 'REFERENCES'; -KW_REFRESH: 'REFRESH'; -KW_RENAME: 'RENAME'; -KW_REPAIR: 'REPAIR'; -KW_REPEATABLE: 'REPEATABLE'; -KW_REPLACE: 'REPLACE'; -KW_RESET: 'RESET'; -KW_RESPECT: 'RESPECT'; -KW_RESTRICT: 'RESTRICT'; -KW_REVOKE: 'REVOKE'; -KW_RIGHT: 'RIGHT'; -KW_RLIKE: 'RLIKE'; -KW_REGEXP: 'REGEXP'; -KW_ROLE: 'ROLE'; -KW_ROLES: 'ROLES'; -KW_ROLLBACK: 'ROLLBACK'; -KW_ROLLUP: 'ROLLUP'; -KW_ROW: 'ROW'; -KW_ROWS: 'ROWS'; -KW_SECOND: 'SECOND'; -KW_SECONDS: 'SECONDS'; -KW_SCHEMA: 'SCHEMA'; -KW_SCHEMAS: 'SCHEMAS'; -KW_SELECT: 'SELECT'; -KW_SEMI: 'SEMI'; -KW_SEPARATED: 'SEPARATED'; -KW_SERDE: 'SERDE'; -KW_SERDEPROPERTIES: 'SERDEPROPERTIES'; -KW_SESSION_USER: 'SESSION_USER'; -KW_SET: 'SET'; -KW_MINUS: 'MINUS'; -KW_SETS: 'SETS'; -KW_SHORT: 'SHORT'; -KW_SHOW: 'SHOW'; -KW_SINGLE: 'SINGLE'; -KW_SKEWED: 'SKEWED'; -KW_SMALLINT: 'SMALLINT'; -KW_SOME: 'SOME'; -KW_SORT: 'SORT'; -KW_SORTED: 'SORTED'; -KW_SOURCE: 'SOURCE'; -KW_START: 'START'; -KW_STATISTICS: 'STATISTICS'; -KW_STORED: 'STORED'; -KW_STRATIFY: 'STRATIFY'; -KW_STRING: 'STRING'; -KW_STRUCT: 'STRUCT'; -KW_SUBSTR: 'SUBSTR'; -KW_SUBSTRING: 'SUBSTRING'; -KW_SYNC: 'SYNC'; -KW_SYSTEM: 'SYSTEM'; -KW_SYSTEM_TIME: 'SYSTEM_TIME'; -KW_SYSTEM_VERSION: 'SYSTEM_VERSION'; -KW_TABLE: 'TABLE'; -KW_TABLES: 'TABLES'; -KW_TABLESAMPLE: 'TABLESAMPLE'; -KW_TARGET: 'TARGET'; -KW_TBLPROPERTIES: 'TBLPROPERTIES'; -KW_TEMPORARY: 'TEMPORARY'; -KW_TERMINATED: 'TERMINATED'; -KW_THEN: 'THEN'; -KW_TIME: 'TIME'; -KW_TIMEDIFF: 'TIMEDIFF'; -KW_TIMESTAMP: 'TIMESTAMP'; -KW_TIMESTAMP_LTZ: 'TIMESTAMP_LTZ'; -KW_TIMESTAMP_NTZ: 'TIMESTAMP_NTZ'; -KW_TIMESTAMPADD: 'TIMESTAMPADD'; -KW_TIMESTAMPDIFF: 'TIMESTAMPDIFF'; -KW_TINYINT: 'TINYINT'; -KW_TO: 'TO'; -KW_TOUCH: 'TOUCH'; -KW_TRAILING: 'TRAILING'; -KW_TRANSACTION: 'TRANSACTION'; -KW_TRANSACTIONS: 'TRANSACTIONS'; -KW_TRANSFORM: 'TRANSFORM'; -KW_TRIM: 'TRIM'; -KW_TRUE: 'TRUE'; -KW_TRUNCATE: 'TRUNCATE'; -KW_TRY_CAST: 'TRY_CAST'; -KW_TYPE: 'TYPE'; -KW_UNARCHIVE: 'UNARCHIVE'; -KW_UNBOUNDED: 'UNBOUNDED'; -KW_UNCACHE: 'UNCACHE'; -KW_UNION: 'UNION'; -KW_UNIQUE: 'UNIQUE'; -KW_UNKNOWN: 'UNKNOWN'; -KW_UNLOCK: 'UNLOCK'; -KW_UNPIVOT: 'UNPIVOT'; -KW_UNSET: 'UNSET'; -KW_UPDATE: 'UPDATE'; -KW_USE: 'USE'; -KW_USER: 'USER'; -KW_USING: 'USING'; -KW_VALUES: 'VALUES'; -KW_VARCHAR: 'VARCHAR'; -KW_VAR: 'VAR'; -KW_VARIABLE: 'VARIABLE'; -KW_VERSION: 'VERSION'; -KW_VIEW: 'VIEW'; -KW_VIEWS: 'VIEWS'; -KW_VOID: 'VOID'; -KW_WEEK: 'WEEK'; -KW_WEEKS: 'WEEKS'; -KW_WHEN: 'WHEN'; -KW_WHERE: 'WHERE'; -KW_WINDOW: 'WINDOW'; -KW_WITH: 'WITH'; -KW_WITHIN: 'WITHIN'; -KW_YEAR: 'YEAR'; -KW_YEARS: 'YEARS'; -KW_ZONE: 'ZONE'; +KW_ADD : 'ADD'; +KW_AFTER : 'AFTER'; +KW_ALL : 'ALL'; +KW_ALTER : 'ALTER'; +KW_ALWAYS : 'ALWAYS'; +KW_ANALYZE : 'ANALYZE'; +KW_AND : 'AND'; +KW_ANTI : 'ANTI'; +KW_ANY : 'ANY'; +KW_ANY_VALUE : 'ANY_VALUE'; +KW_ARCHIVE : 'ARCHIVE'; +KW_ARRAY : 'ARRAY'; +KW_AS : 'AS'; +KW_ASC : 'ASC'; +KW_AT : 'AT'; +KW_AUTHORIZATION : 'AUTHORIZATION'; +KW_BETWEEN : 'BETWEEN'; +KW_BIGINT : 'BIGINT'; +KW_BINARY : 'BINARY'; +KW_BOOLEAN : 'BOOLEAN'; +KW_BOTH : 'BOTH'; +KW_BUCKET : 'BUCKET'; +KW_BUCKETS : 'BUCKETS'; +KW_BY : 'BY'; +KW_BYTE : 'BYTE'; +KW_CACHE : 'CACHE'; +KW_CASCADE : 'CASCADE'; +KW_CASE : 'CASE'; +KW_CAST : 'CAST'; +KW_CATALOG : 'CATALOG'; +KW_CATALOGS : 'CATALOGS'; +KW_CHANGE : 'CHANGE'; +KW_CHAR : 'CHAR'; +KW_CHARACTER : 'CHARACTER'; +KW_CHECK : 'CHECK'; +KW_CLEAR : 'CLEAR'; +KW_CLUSTER : 'CLUSTER'; +KW_CLUSTERED : 'CLUSTERED'; +KW_CODEGEN : 'CODEGEN'; +KW_COLLATE : 'COLLATE'; +KW_COLLECTION : 'COLLECTION'; +KW_COLUMN : 'COLUMN'; +KW_COLUMNS : 'COLUMNS'; +KW_COMMENT : 'COMMENT'; +KW_COMMIT : 'COMMIT'; +KW_COMPACT : 'COMPACT'; +KW_COMPACTIONS : 'COMPACTIONS'; +KW_COMPUTE : 'COMPUTE'; +KW_CONCATENATE : 'CONCATENATE'; +KW_CONSTRAINT : 'CONSTRAINT'; +KW_COST : 'COST'; +KW_CREATE : 'CREATE'; +KW_CROSS : 'CROSS'; +KW_CUBE : 'CUBE'; +KW_CURRENT : 'CURRENT'; +KW_CURRENT_DATE : 'CURRENT_DATE'; +KW_CURRENT_TIME : 'CURRENT_TIME'; +KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; +KW_CURRENT_USER : 'CURRENT_USER'; +KW_DAY : 'DAY'; +KW_DAYS : 'DAYS'; +KW_DAYOFYEAR : 'DAYOFYEAR'; +KW_DATA : 'DATA'; +KW_DATE : 'DATE'; +KW_DATABASE : 'DATABASE'; +KW_DATABASES : 'DATABASES'; +KW_DATEADD : 'DATEADD'; +KW_DATE_ADD : 'DATE_ADD'; +KW_DATEDIFF : 'DATEDIFF'; +KW_DATE_DIFF : 'DATE_DIFF'; +KW_DBPROPERTIES : 'DBPROPERTIES'; +KW_DEC : 'DEC'; +KW_DECIMAL : 'DECIMAL'; +KW_DECLARE : 'DECLARE'; +KW_DEFAULT : 'DEFAULT'; +KW_DEFINED : 'DEFINED'; +KW_DELETE : 'DELETE'; +KW_DELIMITED : 'DELIMITED'; +KW_DESC : 'DESC'; +KW_DESCRIBE : 'DESCRIBE'; +KW_DFS : 'DFS'; +KW_DIRECTORIES : 'DIRECTORIES'; +KW_DIRECTORY : 'DIRECTORY'; +KW_DISTINCT : 'DISTINCT'; +KW_DISTRIBUTE : 'DISTRIBUTE'; +KW_DIV : 'DIV'; +KW_DOUBLE : 'DOUBLE'; +KW_DROP : 'DROP'; +KW_ELSE : 'ELSE'; +KW_END : 'END'; +KW_ESCAPE : 'ESCAPE'; +KW_ESCAPED : 'ESCAPED'; +KW_EXCEPT : 'EXCEPT'; +KW_EXCHANGE : 'EXCHANGE'; +KW_EXCLUDE : 'EXCLUDE'; +KW_EXISTS : 'EXISTS'; +KW_EXPLAIN : 'EXPLAIN'; +KW_EXPORT : 'EXPORT'; +KW_EXTENDED : 'EXTENDED'; +KW_EXTERNAL : 'EXTERNAL'; +KW_EXTRACT : 'EXTRACT'; +KW_FALSE : 'FALSE'; +KW_FETCH : 'FETCH'; +KW_FIELDS : 'FIELDS'; +KW_FILTER : 'FILTER'; +KW_FILEFORMAT : 'FILEFORMAT'; +KW_FIRST : 'FIRST'; +KW_FLOAT : 'FLOAT'; +KW_FOLLOWING : 'FOLLOWING'; +KW_FOR : 'FOR'; +KW_FOREIGN : 'FOREIGN'; +KW_FORMAT : 'FORMAT'; +KW_FORMATTED : 'FORMATTED'; +KW_FROM : 'FROM'; +KW_FULL : 'FULL'; +KW_FUNCTION : 'FUNCTION'; +KW_FUNCTIONS : 'FUNCTIONS'; +KW_GENERATED : 'GENERATED'; +KW_GLOBAL : 'GLOBAL'; +KW_GRANT : 'GRANT'; +KW_GROUP : 'GROUP'; +KW_GROUPING : 'GROUPING'; +KW_HAVING : 'HAVING'; +KW_BINARY_HEX : 'X'; +KW_HOUR : 'HOUR'; +KW_HOURS : 'HOURS'; +KW_IDENTIFIER : 'IDENTIFIER'; +KW_IF : 'IF'; +KW_IGNORE : 'IGNORE'; +KW_IMPORT : 'IMPORT'; +KW_IN : 'IN'; +KW_INCLUDE : 'INCLUDE'; +KW_INDEX : 'INDEX'; +KW_INDEXES : 'INDEXES'; +KW_INNER : 'INNER'; +KW_INPATH : 'INPATH'; +KW_INPUTFORMAT : 'INPUTFORMAT'; +KW_INSERT : 'INSERT'; +KW_INTERSECT : 'INTERSECT'; +KW_INTERVAL : 'INTERVAL'; +KW_INT : 'INT'; +KW_INTEGER : 'INTEGER'; +KW_INTO : 'INTO'; +KW_IS : 'IS'; +KW_ITEMS : 'ITEMS'; +KW_JOIN : 'JOIN'; +KW_KEYS : 'KEYS'; +KW_LAST : 'LAST'; +KW_LATERAL : 'LATERAL'; +KW_LAZY : 'LAZY'; +KW_LEADING : 'LEADING'; +KW_LEFT : 'LEFT'; +KW_LIKE : 'LIKE'; +KW_ILIKE : 'ILIKE'; +KW_LIMIT : 'LIMIT'; +KW_LINES : 'LINES'; +KW_LIST : 'LIST'; +KW_LOAD : 'LOAD'; +KW_LOCAL : 'LOCAL'; +KW_LOCATION : 'LOCATION'; +KW_LOCK : 'LOCK'; +KW_LOCKS : 'LOCKS'; +KW_LOGICAL : 'LOGICAL'; +KW_LONG : 'LONG'; +KW_MACRO : 'MACRO'; +KW_MAP : 'MAP'; +KW_MATCHED : 'MATCHED'; +KW_MERGE : 'MERGE'; +KW_MICROSECOND : 'MICROSECOND'; +KW_MICROSECONDS : 'MICROSECONDS'; +KW_MILLISECOND : 'MILLISECOND'; +KW_MILLISECONDS : 'MILLISECONDS'; +KW_MINUTE : 'MINUTE'; +KW_MINUTES : 'MINUTES'; +KW_MONTH : 'MONTH'; +KW_MONTHS : 'MONTHS'; +KW_MSCK : 'MSCK'; +KW_NAME : 'NAME'; +KW_NAMESPACE : 'NAMESPACE'; +KW_NAMESPACES : 'NAMESPACES'; +KW_NANOSECOND : 'NANOSECOND'; +KW_NANOSECONDS : 'NANOSECONDS'; +KW_NATURAL : 'NATURAL'; +KW_NO : 'NO'; +KW_NOSCAN : 'NOSCAN'; +KW_NOT : 'NOT'; +KW_NULL : 'NULL'; +KW_NULLS : 'NULLS'; +KW_NUMERIC : 'NUMERIC'; +KW_OF : 'OF'; +KW_OFFSET : 'OFFSET'; +KW_ON : 'ON'; +KW_ONLY : 'ONLY'; +KW_OPTION : 'OPTION'; +KW_OPTIONS : 'OPTIONS'; +KW_OR : 'OR'; +KW_ORDER : 'ORDER'; +KW_OUT : 'OUT'; +KW_OUTER : 'OUTER'; +KW_OUTPUTFORMAT : 'OUTPUTFORMAT'; +KW_OVER : 'OVER'; +KW_OVERLAPS : 'OVERLAPS'; +KW_OVERLAY : 'OVERLAY'; +KW_OVERWRITE : 'OVERWRITE'; +KW_PARTITION : 'PARTITION'; +KW_PARTITIONED : 'PARTITIONED'; +KW_PARTITIONS : 'PARTITIONS'; +KW_PERCENTILE_CONT : 'PERCENTILE_CONT'; +KW_PERCENTILE_DISC : 'PERCENTILE_DISC'; +KW_PERCENTLIT : 'PERCENT'; +KW_PIVOT : 'PIVOT'; +KW_PLACING : 'PLACING'; +KW_POSITION : 'POSITION'; +KW_PRECEDING : 'PRECEDING'; +KW_PRIMARY : 'PRIMARY'; +KW_PRINCIPALS : 'PRINCIPALS'; +KW_PROPERTIES : 'PROPERTIES'; +KW_PURGE : 'PURGE'; +KW_QUARTER : 'QUARTER'; +KW_QUERY : 'QUERY'; +KW_RANGE : 'RANGE'; +KW_REAL : 'REAL'; +KW_RECORDREADER : 'RECORDREADER'; +KW_RECORDWRITER : 'RECORDWRITER'; +KW_RECOVER : 'RECOVER'; +KW_REDUCE : 'REDUCE'; +KW_REFERENCES : 'REFERENCES'; +KW_REFRESH : 'REFRESH'; +KW_RENAME : 'RENAME'; +KW_REPAIR : 'REPAIR'; +KW_REPEATABLE : 'REPEATABLE'; +KW_REPLACE : 'REPLACE'; +KW_RESET : 'RESET'; +KW_RESPECT : 'RESPECT'; +KW_RESTRICT : 'RESTRICT'; +KW_REVOKE : 'REVOKE'; +KW_RIGHT : 'RIGHT'; +KW_RLIKE : 'RLIKE'; +KW_REGEXP : 'REGEXP'; +KW_ROLE : 'ROLE'; +KW_ROLES : 'ROLES'; +KW_ROLLBACK : 'ROLLBACK'; +KW_ROLLUP : 'ROLLUP'; +KW_ROW : 'ROW'; +KW_ROWS : 'ROWS'; +KW_SECOND : 'SECOND'; +KW_SECONDS : 'SECONDS'; +KW_SCHEMA : 'SCHEMA'; +KW_SCHEMAS : 'SCHEMAS'; +KW_SELECT : 'SELECT'; +KW_SEMI : 'SEMI'; +KW_SEPARATED : 'SEPARATED'; +KW_SERDE : 'SERDE'; +KW_SERDEPROPERTIES : 'SERDEPROPERTIES'; +KW_SESSION_USER : 'SESSION_USER'; +KW_SET : 'SET'; +KW_MINUS : 'MINUS'; +KW_SETS : 'SETS'; +KW_SHORT : 'SHORT'; +KW_SHOW : 'SHOW'; +KW_SINGLE : 'SINGLE'; +KW_SKEWED : 'SKEWED'; +KW_SMALLINT : 'SMALLINT'; +KW_SOME : 'SOME'; +KW_SORT : 'SORT'; +KW_SORTED : 'SORTED'; +KW_SOURCE : 'SOURCE'; +KW_START : 'START'; +KW_STATISTICS : 'STATISTICS'; +KW_STORED : 'STORED'; +KW_STRATIFY : 'STRATIFY'; +KW_STRING : 'STRING'; +KW_STRUCT : 'STRUCT'; +KW_SUBSTR : 'SUBSTR'; +KW_SUBSTRING : 'SUBSTRING'; +KW_SYNC : 'SYNC'; +KW_SYSTEM : 'SYSTEM'; +KW_SYSTEM_TIME : 'SYSTEM_TIME'; +KW_SYSTEM_VERSION : 'SYSTEM_VERSION'; +KW_TABLE : 'TABLE'; +KW_TABLES : 'TABLES'; +KW_TABLESAMPLE : 'TABLESAMPLE'; +KW_TARGET : 'TARGET'; +KW_TBLPROPERTIES : 'TBLPROPERTIES'; +KW_TEMPORARY : 'TEMPORARY'; +KW_TERMINATED : 'TERMINATED'; +KW_THEN : 'THEN'; +KW_TIME : 'TIME'; +KW_TIMEDIFF : 'TIMEDIFF'; +KW_TIMESTAMP : 'TIMESTAMP'; +KW_TIMESTAMP_LTZ : 'TIMESTAMP_LTZ'; +KW_TIMESTAMP_NTZ : 'TIMESTAMP_NTZ'; +KW_TIMESTAMPADD : 'TIMESTAMPADD'; +KW_TIMESTAMPDIFF : 'TIMESTAMPDIFF'; +KW_TINYINT : 'TINYINT'; +KW_TO : 'TO'; +KW_TOUCH : 'TOUCH'; +KW_TRAILING : 'TRAILING'; +KW_TRANSACTION : 'TRANSACTION'; +KW_TRANSACTIONS : 'TRANSACTIONS'; +KW_TRANSFORM : 'TRANSFORM'; +KW_TRIM : 'TRIM'; +KW_TRUE : 'TRUE'; +KW_TRUNCATE : 'TRUNCATE'; +KW_TRY_CAST : 'TRY_CAST'; +KW_TYPE : 'TYPE'; +KW_UNARCHIVE : 'UNARCHIVE'; +KW_UNBOUNDED : 'UNBOUNDED'; +KW_UNCACHE : 'UNCACHE'; +KW_UNION : 'UNION'; +KW_UNIQUE : 'UNIQUE'; +KW_UNKNOWN : 'UNKNOWN'; +KW_UNLOCK : 'UNLOCK'; +KW_UNPIVOT : 'UNPIVOT'; +KW_UNSET : 'UNSET'; +KW_UPDATE : 'UPDATE'; +KW_USE : 'USE'; +KW_USER : 'USER'; +KW_USING : 'USING'; +KW_VALUES : 'VALUES'; +KW_VARCHAR : 'VARCHAR'; +KW_VAR : 'VAR'; +KW_VARIABLE : 'VARIABLE'; +KW_VERSION : 'VERSION'; +KW_VIEW : 'VIEW'; +KW_VIEWS : 'VIEWS'; +KW_VOID : 'VOID'; +KW_WEEK : 'WEEK'; +KW_WEEKS : 'WEEKS'; +KW_WHEN : 'WHEN'; +KW_WHERE : 'WHERE'; +KW_WINDOW : 'WINDOW'; +KW_WITH : 'WITH'; +KW_WITHIN : 'WITHIN'; +KW_YEAR : 'YEAR'; +KW_YEARS : 'YEARS'; +KW_ZONE : 'ZONE'; //--SPARK-KEYWORD-LIST-END //============================ // End of the keywords list //============================ -EQ : '=' | '=='; -NSEQ: '<=>'; -NEQ : '<>'; -NEQJ: '!='; -LT : '<'; -LTE : '<=' | '!>'; -GT : '>'; -GTE : '>=' | '!<'; +EQ : '=' | '=='; +NSEQ : '<=>'; +NEQ : '<>'; +NEQJ : '!='; +LT : '<'; +LTE : '<=' | '!>'; +GT : '>'; +GTE : '>=' | '!<'; -NOT: '!'; -PLUS: '+'; -MINUS: '-'; -ASTERISK: '*'; -SLASH: '/'; -PERCENT: '%'; -TILDE: '~'; -AMPERSAND: '&'; -PIPE: '|'; -CONCAT_PIPE: '||'; -HAT: '^'; -COLON: ':'; -ARROW: '->'; -FAT_ARROW : '=>'; -HENT_START: '/*+'; -HENT_END: '*/'; -QUESTION: '?'; +NOT : '!'; +PLUS : '+'; +MINUS : '-'; +ASTERISK : '*'; +SLASH : '/'; +PERCENT : '%'; +TILDE : '~'; +AMPERSAND : '&'; +PIPE : '|'; +CONCAT_PIPE : '||'; +HAT : '^'; +COLON : ':'; +ARROW : '->'; +FAT_ARROW : '=>'; +HENT_START : '/*+'; +HENT_END : '*/'; +QUESTION : '?'; -STRING_LITERAL - : '\'' ( ~('\''|'\\') | ('\\' .) )* '\'' - | 'R\'' (~'\'')* '\'' - | 'R"'(~'"')* '"' - ; +STRING_LITERAL: '\'' ( ~('\'' | '\\') | ('\\' .))* '\'' | 'R\'' (~'\'')* '\'' | 'R"' (~'"')* '"'; -DOUBLEQUOTED_STRING - :'"' ( ~('"'|'\\') | ('\\' .) )* '"' - ; +DOUBLEQUOTED_STRING: '"' ( ~('"' | '\\') | ('\\' .))* '"'; // NOTE: If you move a numeric literal, you should modify `ParserUtils.toExprAlias()` // which assumes all numeric literals are between `BIGINT_LITERAL` and `BIGDECIMAL_LITERAL`. -BIGINT_LITERAL - : DIGIT+ 'L' - ; +BIGINT_LITERAL: DIGIT+ 'L'; -SMALLINT_LITERAL - : DIGIT+ 'S' - ; +SMALLINT_LITERAL: DIGIT+ 'S'; -TINYINT_LITERAL - : DIGIT+ 'Y' - ; +TINYINT_LITERAL: DIGIT+ 'Y'; -INTEGER_VALUE - : DIGIT+ - ; +INTEGER_VALUE: DIGIT+; -EXPONENT_VALUE - : DIGIT+ EXPONENT - | DECIMAL_DIGITS EXPONENT - ; +EXPONENT_VALUE: DIGIT+ EXPONENT | DECIMAL_DIGITS EXPONENT; -DECIMAL_VALUE - : DECIMAL_DIGITS - ; +DECIMAL_VALUE: DECIMAL_DIGITS; -FLOAT_LITERAL - : DIGIT+ EXPONENT? 'F' - | DECIMAL_DIGITS EXPONENT? 'F' - ; +FLOAT_LITERAL: DIGIT+ EXPONENT? 'F' | DECIMAL_DIGITS EXPONENT? 'F'; -DOUBLE_LITERAL - : DIGIT+ EXPONENT? 'D' - | DECIMAL_DIGITS EXPONENT? 'D' - ; +DOUBLE_LITERAL: DIGIT+ EXPONENT? 'D' | DECIMAL_DIGITS EXPONENT? 'D'; -BIGDECIMAL_LITERAL - : DIGIT+ EXPONENT? 'BD' - | DECIMAL_DIGITS EXPONENT? 'BD' - ; +BIGDECIMAL_LITERAL: DIGIT+ EXPONENT? 'BD' | DECIMAL_DIGITS EXPONENT? 'BD'; -IDENTIFIER - : (LETTER | DIGIT | '_')+ - ; +IDENTIFIER: (LETTER | DIGIT | '_')+; -BACKQUOTED_IDENTIFIER - : '`' ( ~'`' | '``' )* '`' - ; +BACKQUOTED_IDENTIFIER: '`' ( ~'`' | '``')* '`'; -fragment DECIMAL_DIGITS - : DIGIT+ '.' DIGIT* - | '.' DIGIT+ - ; +fragment DECIMAL_DIGITS: DIGIT+ '.' DIGIT* | '.' DIGIT+; -fragment EXPONENT - : 'E' [+-]? DIGIT+ - ; +fragment EXPONENT: 'E' [+-]? DIGIT+; -fragment DIGIT - : [0-9] - ; +fragment DIGIT: [0-9]; -fragment LETTER - : [A-Za-z] - ; +fragment LETTER: [A-Za-z]; -SIMPLE_COMMENT - : '--' ('\\\n' | ~[\r\n])* '\r'? '\n'? -> channel(HIDDEN) - ; +SIMPLE_COMMENT: '--' ('\\\n' | ~[\r\n])* '\r'? '\n'? -> channel(HIDDEN); -BRACKETED_COMMENT - : '/*' ( BRACKETED_COMMENT | . )*? ('*/' | {this.markUnclosedComment();} EOF) -> channel(HIDDEN) - ; +BRACKETED_COMMENT: + '/*' (BRACKETED_COMMENT | .)*? ('*/' | {this.markUnclosedComment();} EOF) -> channel(HIDDEN); -WS - : [ \r\n\t]+ -> channel(HIDDEN) - ; +WS: [ \r\n\t]+ -> channel(HIDDEN); // Catch-all for anything we can't recognize. // We use this to be able to ignore and recover all the text // when splitting statements with DelimiterLexer -UNRECOGNIZED - : . - ; +UNRECOGNIZED: .; \ No newline at end of file diff --git a/src/grammar/spark/SparkSqlParser.g4 b/src/grammar/spark/SparkSqlParser.g4 index 34f54fc..b55c014 100644 --- a/src/grammar/spark/SparkSqlParser.g4 +++ b/src/grammar/spark/SparkSqlParser.g4 @@ -18,16 +18,22 @@ * Reference: https://github.com/apache/spark/blob/master/sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4 */ +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging +// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true + parser grammar SparkSqlParser; -options { tokenVocab = SparkSqlLexer; } +options { + tokenVocab=SparkSqlLexer; +} program : singleStatement* EOF ; singleStatement - : statement SEMICOLON ? + : statement SEMICOLON? ; statement @@ -36,150 +42,117 @@ statement | KW_USE dbSchemaName | KW_USE dbSchema dbSchemaName | KW_SET KW_CATALOG (identifier | stringLit) - | KW_CREATE dbSchema (ifNotExists)? dbSchemaNameCreate - (commentSpec | - locationSpec | - (KW_WITH (KW_DBPROPERTIES | KW_PROPERTIES) propertyList))* - | KW_ALTER dbSchema dbSchemaName - KW_SET (KW_DBPROPERTIES | KW_PROPERTIES) propertyList - | KW_ALTER dbSchema dbSchemaName - KW_SET locationSpec - | KW_DROP dbSchema (ifExists)? dbSchemaName - (KW_RESTRICT | KW_CASCADE)? - | KW_SHOW dbSchemas ((KW_FROM | KW_IN) multipartIdentifier)? - (KW_LIKE? pattern=stringLit)? - | createTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? - createTableClauses - (KW_AS? query)? - | KW_CREATE KW_TABLE (ifNotExists)? target=tableNameCreate - KW_LIKE source=tableName - (tableProvider | - rowFormat | - createFileFormat | - locationSpec | - (KW_TBLPROPERTIES tableProps=propertyList))* - | replaceTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? - createTableClauses - (KW_AS? query)? - | KW_ANALYZE KW_TABLE tableName partitionSpec? KW_COMPUTE KW_STATISTICS - (KW_NOSCAN | KW_FOR KW_COLUMNS columnNameSeq | KW_FOR KW_ALL KW_COLUMNS)? - | KW_ANALYZE KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? KW_COMPUTE KW_STATISTICS - (KW_NOSCAN)? - | KW_ALTER KW_TABLE tableName - KW_ADD KW_COLUMN qualifiedColTypeWithPositionForAdd - | KW_ALTER KW_TABLE tableName - KW_ADD KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForAdd RIGHT_PAREN - | KW_ALTER KW_TABLE table=tableName - KW_RENAME KW_COLUMN columnName KW_TO columnNameCreate - | KW_ALTER KW_TABLE tableName - KW_DROP KW_COLUMN (ifExists)? columnName - | KW_ALTER KW_TABLE tableName - KW_DROP KW_COLUMNS (ifExists)? LEFT_PAREN columnNameSeq RIGHT_PAREN - | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) - KW_RENAME KW_TO multipartIdentifier - | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) - KW_SET KW_TBLPROPERTIES propertyList - | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) - KW_UNSET KW_TBLPROPERTIES (ifExists)? propertyList - | KW_ALTER KW_TABLE table=tableName - (KW_ALTER | KW_CHANGE) KW_COLUMN? column=columnName - alterColumnAction? - | KW_ALTER KW_TABLE table=tableName partitionSpec? - KW_CHANGE KW_COLUMN? - colName=columnName colType colPosition? - | KW_ALTER KW_TABLE table=tableName partitionSpec? - KW_REPLACE KW_COLUMNS - LEFT_PAREN qualifiedColTypeWithPositionSeqForReplace - RIGHT_PAREN - | KW_ALTER KW_TABLE tableName (partitionSpec)? - KW_SET KW_SERDE stringLit (KW_WITH KW_SERDEPROPERTIES propertyList)? - | KW_ALTER KW_TABLE tableName (partitionSpec)? - KW_SET KW_SERDEPROPERTIES propertyList - | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_ADD (ifNotExists)? - partitionSpecLocation+ - | KW_ALTER KW_TABLE tableName - partitionSpec KW_RENAME KW_TO partitionSpec - | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) - KW_DROP (ifExists)? partitionSpec (COMMA partitionSpec)* KW_PURGE? - | KW_ALTER KW_TABLE tableName - (partitionSpec)? KW_SET locationSpec + | KW_CREATE dbSchema (ifNotExists)? dbSchemaNameCreate ( + commentSpec + | locationSpec + | (KW_WITH (KW_DBPROPERTIES | KW_PROPERTIES) propertyList) + )* + | KW_ALTER dbSchema dbSchemaName KW_SET (KW_DBPROPERTIES | KW_PROPERTIES) propertyList + | KW_ALTER dbSchema dbSchemaName KW_SET locationSpec + | KW_DROP dbSchema (ifExists)? dbSchemaName (KW_RESTRICT | KW_CASCADE)? + | KW_SHOW dbSchemas ((KW_FROM | KW_IN) multipartIdentifier)? (KW_LIKE? pattern=stringLit)? + | createTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? createTableClauses ( + KW_AS? query + )? + | KW_CREATE KW_TABLE (ifNotExists)? target=tableNameCreate KW_LIKE source=tableName ( + tableProvider + | rowFormat + | createFileFormat + | locationSpec + | (KW_TBLPROPERTIES tableProps=propertyList) + )* + | replaceTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? createTableClauses ( + KW_AS? query + )? + | KW_ANALYZE KW_TABLE tableName partitionSpec? KW_COMPUTE KW_STATISTICS ( + KW_NOSCAN + | KW_FOR KW_COLUMNS columnNameSeq + | KW_FOR KW_ALL KW_COLUMNS + )? + | KW_ANALYZE KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? KW_COMPUTE KW_STATISTICS (KW_NOSCAN)? + | KW_ALTER KW_TABLE tableName KW_ADD KW_COLUMN qualifiedColTypeWithPositionForAdd + | KW_ALTER KW_TABLE tableName KW_ADD KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForAdd RIGHT_PAREN + | KW_ALTER KW_TABLE table=tableName KW_RENAME KW_COLUMN columnName KW_TO columnNameCreate + | KW_ALTER KW_TABLE tableName KW_DROP KW_COLUMN (ifExists)? columnName + | KW_ALTER KW_TABLE tableName KW_DROP KW_COLUMNS (ifExists)? LEFT_PAREN columnNameSeq RIGHT_PAREN + | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_RENAME KW_TO multipartIdentifier + | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_SET KW_TBLPROPERTIES propertyList + | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_UNSET KW_TBLPROPERTIES (ifExists)? propertyList + | KW_ALTER KW_TABLE table=tableName (KW_ALTER | KW_CHANGE) KW_COLUMN? column=columnName alterColumnAction? + | KW_ALTER KW_TABLE table=tableName partitionSpec? KW_CHANGE KW_COLUMN? colName=columnName colType colPosition? + | KW_ALTER KW_TABLE table=tableName partitionSpec? KW_REPLACE KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForReplace RIGHT_PAREN + | KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET KW_SERDE stringLit ( + KW_WITH KW_SERDEPROPERTIES propertyList + )? + | KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET KW_SERDEPROPERTIES propertyList + | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_ADD (ifNotExists)? partitionSpecLocation+ + | KW_ALTER KW_TABLE tableName partitionSpec KW_RENAME KW_TO partitionSpec + | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_DROP (ifExists)? partitionSpec ( + COMMA partitionSpec + )* KW_PURGE? + | KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET locationSpec | KW_ALTER KW_TABLE tableName KW_RECOVER KW_PARTITIONS | KW_DROP KW_TABLE (ifExists)? tableName KW_PURGE? | KW_DROP KW_VIEW (ifExists)? viewName - | KW_CREATE (KW_OR KW_REPLACE)? (KW_GLOBAL? KW_TEMPORARY)? - KW_VIEW (ifNotExists)? viewNameCreate - identifierCommentList? - (commentSpec | - (KW_PARTITIONED KW_ON identifierList) | - (KW_TBLPROPERTIES propertyList))* - KW_AS query - | KW_CREATE (KW_OR KW_REPLACE)? KW_GLOBAL? KW_TEMPORARY KW_VIEW - viewNameCreate (LEFT_PAREN colTypeList RIGHT_PAREN)? tableProvider - (KW_OPTIONS propertyList)? + | KW_CREATE (KW_OR KW_REPLACE)? (KW_GLOBAL? KW_TEMPORARY)? KW_VIEW (ifNotExists)? viewNameCreate identifierCommentList? ( + commentSpec + | (KW_PARTITIONED KW_ON identifierList) + | (KW_TBLPROPERTIES propertyList) + )* KW_AS query + | KW_CREATE (KW_OR KW_REPLACE)? KW_GLOBAL? KW_TEMPORARY KW_VIEW viewNameCreate ( + LEFT_PAREN colTypeList RIGHT_PAREN + )? tableProvider (KW_OPTIONS propertyList)? | KW_ALTER KW_VIEW viewName KW_AS? query - | KW_CREATE (KW_OR KW_REPLACE)? KW_TEMPORARY? KW_FUNCTION (ifNotExists)? - functionNameCreate KW_AS className=stringLit - (KW_USING resource (COMMA resource)*)? + | KW_CREATE (KW_OR KW_REPLACE)? KW_TEMPORARY? KW_FUNCTION (ifNotExists)? functionNameCreate KW_AS className=stringLit ( + KW_USING resource (COMMA resource)* + )? | KW_DROP KW_TEMPORARY? KW_FUNCTION (ifExists)? functionName - | KW_DECLARE (KW_OR KW_REPLACE)? KW_VARIABLE? - functionName dataType? variableDefaultExpression? + | KW_DECLARE (KW_OR KW_REPLACE)? KW_VARIABLE? functionName dataType? variableDefaultExpression? | KW_DROP KW_TEMPORARY KW_VARIABLE (ifExists)? (tableName | viewName | functionName) - | KW_EXPLAIN (KW_LOGICAL | KW_FORMATTED | KW_EXTENDED | KW_CODEGEN | KW_COST)? - statement - | KW_SHOW KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? - (KW_LIKE? pattern=stringLit)? - | KW_SHOW KW_TABLE KW_EXTENDED ((KW_FROM | KW_IN) ns=dbSchemaName)? - KW_LIKE pattern=stringLit partitionSpec? - | KW_SHOW KW_TBLPROPERTIES table=tableName - (LEFT_PAREN key=propertyKey RIGHT_PAREN)? - | KW_SHOW KW_COLUMNS (KW_FROM | KW_IN) table=tableName - ((KW_FROM | KW_IN) dbSchemaName)? - | KW_SHOW KW_VIEWS ((KW_FROM | KW_IN) dbSchemaName)? - (KW_LIKE? pattern=stringLit)? + | KW_EXPLAIN (KW_LOGICAL | KW_FORMATTED | KW_EXTENDED | KW_CODEGEN | KW_COST)? statement + | KW_SHOW KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? (KW_LIKE? pattern=stringLit)? + | KW_SHOW KW_TABLE KW_EXTENDED ((KW_FROM | KW_IN) ns=dbSchemaName)? KW_LIKE pattern=stringLit partitionSpec? + | KW_SHOW KW_TBLPROPERTIES table=tableName (LEFT_PAREN key=propertyKey RIGHT_PAREN)? + | KW_SHOW KW_COLUMNS (KW_FROM | KW_IN) table=tableName ((KW_FROM | KW_IN) dbSchemaName)? + | KW_SHOW KW_VIEWS ((KW_FROM | KW_IN) dbSchemaName)? (KW_LIKE? pattern=stringLit)? | KW_SHOW KW_PARTITIONS tableName partitionSpec? - | KW_SHOW functionKind? KW_FUNCTIONS ((KW_FROM | KW_IN) ns=dbSchemaName)? - (KW_LIKE? (legacy=multipartIdentifier | pattern=stringLit))? + | KW_SHOW functionKind? KW_FUNCTIONS ((KW_FROM | KW_IN) ns=dbSchemaName)? ( + KW_LIKE? (legacy=multipartIdentifier | pattern=stringLit) + )? | KW_SHOW KW_CREATE KW_TABLE tableName (KW_AS KW_SERDE)? | KW_SHOW KW_CURRENT dbSchema | KW_SHOW KW_CATALOGS (KW_LIKE? pattern=stringLit)? | (KW_DESC | KW_DESCRIBE) KW_FUNCTION KW_EXTENDED? describeFuncName | (KW_DESC | KW_DESCRIBE) KW_DATABASE KW_EXTENDED? dbSchemaName - | (KW_DESC | KW_DESCRIBE) KW_TABLE? option=(KW_EXTENDED | KW_FORMATTED)? - tableName partitionSpec? describeColName? + | (KW_DESC | KW_DESCRIBE) KW_TABLE? option=(KW_EXTENDED | KW_FORMATTED)? tableName partitionSpec? describeColName? | (KW_DESC | KW_DESCRIBE) KW_QUERY? query - | KW_COMMENT KW_ON dbSchema dbSchemaName KW_IS - comment + | KW_COMMENT KW_ON dbSchema dbSchemaName KW_IS comment | KW_COMMENT KW_ON KW_TABLE tableName KW_IS comment | KW_REFRESH KW_TABLE tableName | KW_REFRESH KW_FUNCTION functionName | KW_REFRESH (stringLit | .*?) - | KW_CACHE KW_LAZY? KW_TABLE tableName - (KW_OPTIONS options=propertyList)? (KW_AS? query)? + | KW_CACHE KW_LAZY? KW_TABLE tableName (KW_OPTIONS options=propertyList)? (KW_AS? query)? | KW_UNCACHE KW_TABLE (ifExists)? tableName | KW_CLEAR KW_CACHE - | KW_LOAD KW_DATA KW_LOCAL? KW_INPATH path=stringLit KW_OVERWRITE? KW_INTO KW_TABLE - tableName partitionSpec? + | KW_LOAD KW_DATA KW_LOCAL? KW_INPATH path=stringLit KW_OVERWRITE? KW_INTO KW_TABLE tableName partitionSpec? | KW_TRUNCATE KW_TABLE tableName partitionSpec? - | (KW_MSCK)? KW_REPAIR KW_TABLE tableName - (option=(KW_ADD|KW_DROP|KW_SYNC) KW_PARTITIONS)? + | (KW_MSCK)? KW_REPAIR KW_TABLE tableName (option=(KW_ADD | KW_DROP | KW_SYNC) KW_PARTITIONS)? | op=(KW_ADD | KW_LIST) identifier .*? | KW_SET KW_ROLE .*? | KW_SET KW_TIME KW_ZONE interval | KW_SET KW_TIME KW_ZONE timezone | KW_SET KW_TIME KW_ZONE .*? | KW_SET (KW_VARIABLE | KW_VAR) assignmentList - | KW_SET (KW_VARIABLE | KW_VAR) LEFT_PAREN multipartIdentifierList RIGHT_PAREN EQ - LEFT_PAREN query RIGHT_PAREN + | KW_SET (KW_VARIABLE | KW_VAR) LEFT_PAREN multipartIdentifierList RIGHT_PAREN EQ LEFT_PAREN query RIGHT_PAREN | KW_SET configKey EQ configValue | KW_SET configKey (EQ .*?)? | KW_SET .*? EQ configValue | KW_SET .*? | KW_RESET configKey | KW_RESET .*? - | KW_CREATE KW_INDEX (ifNotExists)? identifier KW_ON KW_TABLE? - tableName (KW_USING indexType=identifier)? - LEFT_PAREN multipartIdentifierPropertyList RIGHT_PAREN - (KW_OPTIONS options=propertyList)? + | KW_CREATE KW_INDEX (ifNotExists)? identifier KW_ON KW_TABLE? tableName ( + KW_USING indexType=identifier + )? LEFT_PAREN multipartIdentifierPropertyList RIGHT_PAREN (KW_OPTIONS options=propertyList)? | KW_DROP KW_INDEX (ifExists)? identifier KW_ON KW_TABLE? tableName | unsupportedHiveNativeCommands .*? ; @@ -253,15 +226,13 @@ replaceTableHeader ; bucketSpec - : KW_CLUSTERED KW_BY identifierList - (KW_SORTED KW_BY orderedIdentifierList)? - KW_INTO INTEGER_VALUE KW_BUCKETS + : KW_CLUSTERED KW_BY identifierList (KW_SORTED KW_BY orderedIdentifierList)? KW_INTO INTEGER_VALUE KW_BUCKETS ; skewSpec - : KW_SKEWED KW_BY identifierList - KW_ON (constantList | nestedConstantList) - (KW_STORED KW_AS KW_DIRECTORIES)? + : KW_SKEWED KW_BY identifierList KW_ON (constantList | nestedConstantList) ( + KW_STORED KW_AS KW_DIRECTORIES + )? ; locationSpec @@ -277,11 +248,19 @@ query ; insertInto - : KW_INSERT KW_OVERWRITE KW_TABLE? tableName (partitionSpec (ifNotExists)?)? ((KW_BY KW_NAME) | (LEFT_PAREN columnNameSeq RIGHT_PAREN ))? - | KW_INSERT KW_INTO KW_TABLE? tableName partitionSpec? (ifNotExists)? ((KW_BY KW_NAME) | (LEFT_PAREN columnNameSeq RIGHT_PAREN ))? + : KW_INSERT KW_OVERWRITE KW_TABLE? tableName (partitionSpec (ifNotExists)?)? ( + (KW_BY KW_NAME) + | (LEFT_PAREN columnNameSeq RIGHT_PAREN) + )? + | KW_INSERT KW_INTO KW_TABLE? tableName partitionSpec? (ifNotExists)? ( + (KW_BY KW_NAME) + | (LEFT_PAREN columnNameSeq RIGHT_PAREN) + )? | KW_INSERT KW_INTO KW_TABLE? tableName KW_REPLACE whereClause | KW_INSERT KW_OVERWRITE KW_LOCAL? KW_DIRECTORY path=stringLit rowFormat? createFileFormat? - | KW_INSERT KW_OVERWRITE KW_LOCAL? KW_DIRECTORY (path=stringLit)? tableProvider (KW_OPTIONS options=propertyList)? + | KW_INSERT KW_OVERWRITE KW_LOCAL? KW_DIRECTORY (path=stringLit)? tableProvider ( + KW_OPTIONS options=propertyList + )? ; partitionSpecLocation @@ -334,15 +313,17 @@ tableProvider ; createTableClauses - :((KW_OPTIONS options=expressionPropertyList) | - (KW_PARTITIONED KW_BY partitioning=partitionFieldList) | - skewSpec | - bucketSpec | - rowFormat | - createFileFormat | - locationSpec | - commentSpec | - (KW_TBLPROPERTIES tableProps=propertyList))* + : ( + (KW_OPTIONS options=expressionPropertyList) + | (KW_PARTITIONED KW_BY partitioning=partitionFieldList) + | skewSpec + | bucketSpec + | rowFormat + | createFileFormat + | locationSpec + | commentSpec + | (KW_TBLPROPERTIES tableProps=propertyList) + )* ; propertyList @@ -404,32 +385,47 @@ dmlStatementNoWith | fromClause multiInsertQueryBody+ | KW_DELETE KW_FROM tableName tableAlias whereClause? | KW_UPDATE tableName tableAlias setClause whereClause? - | KW_MERGE KW_INTO target=tableName targetAlias=tableAlias - KW_USING (source=identifierReference | - LEFT_PAREN sourceQuery=query RIGHT_PAREN) sourceAlias=tableAlias - KW_ON mergeCondition=booleanExpression - matchedClause* - notMatchedClause* - notMatchedBySourceClause* + | KW_MERGE KW_INTO target=tableName targetAlias=tableAlias KW_USING ( + source=identifierReference + | LEFT_PAREN sourceQuery=query RIGHT_PAREN + ) sourceAlias=tableAlias KW_ON mergeCondition=booleanExpression matchedClause* notMatchedClause* notMatchedBySourceClause* ; -dbSchemaName: identifierReference; +dbSchemaName + : identifierReference + ; -dbSchemaNameCreate: identifierReference; +dbSchemaNameCreate + : identifierReference + ; -tableNameCreate: tableIdentifier; +tableNameCreate + : tableIdentifier + ; -tableName: tableIdentifier; +tableName + : tableIdentifier + ; -viewNameCreate: viewIdentifier; +viewNameCreate + : viewIdentifier + ; -viewName: viewIdentifier; +viewName + : viewIdentifier + ; -columnName: multipartIdentifier; - -columnNameSeq: columnName (COMMA columnName)* ; +columnName + : multipartIdentifier + ; -columnNameCreate: errorCapturingIdentifier; +columnNameSeq + : columnName (COMMA columnName)* + ; + +columnNameCreate + : errorCapturingIdentifier + ; identifierReference : KW_IDENTIFIER LEFT_PAREN expression RIGHT_PAREN @@ -437,13 +433,11 @@ identifierReference ; queryOrganization - : (KW_ORDER KW_BY order+=sortItem (COMMA order+=sortItem)*)? - (KW_CLUSTER KW_BY clusterBy+=expression (COMMA clusterBy+=expression)*)? - (KW_DISTRIBUTE KW_BY distributeBy+=expression (COMMA distributeBy+=expression)*)? - (KW_SORT KW_BY sort+=sortItem (COMMA sort+=sortItem)*)? - windowClause? - (KW_LIMIT (KW_ALL | limit=expression))? - (KW_OFFSET offset=expression)? + : (KW_ORDER KW_BY order+=sortItem (COMMA order+=sortItem)*)? ( + KW_CLUSTER KW_BY clusterBy+=expression (COMMA clusterBy+=expression)* + )? (KW_DISTRIBUTE KW_BY distributeBy+=expression (COMMA distributeBy+=expression)*)? ( + KW_SORT KW_BY sort+=sortItem (COMMA sort+=sortItem)* + )? windowClause? (KW_LIMIT (KW_ALL | limit=expression))? (KW_OFFSET offset=expression)? ; multiInsertQueryBody @@ -452,12 +446,9 @@ multiInsertQueryBody queryTerm : queryPrimary - | left=queryTerm - operator=(KW_INTERSECT | KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm - | left=queryTerm - operator=KW_INTERSECT setQuantifier? right=queryTerm - | left=queryTerm - operator=(KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm + | left=queryTerm operator=(KW_INTERSECT | KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm + | left=queryTerm operator=KW_INTERSECT setQuantifier? right=queryTerm + | left=queryTerm operator=(KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm ; queryPrimary @@ -469,7 +460,9 @@ queryPrimary ; sortItem - : (columnName | expression) ordering=(KW_ASC | KW_DESC)? (KW_NULLS nullOrder=(KW_LAST | KW_FIRST))? + : (columnName | expression) ordering=(KW_ASC | KW_DESC)? ( + KW_NULLS nullOrder=(KW_LAST | KW_FIRST) + )? ; fromStatement @@ -477,45 +470,27 @@ fromStatement ; fromStatementBody - : transformClause - whereClause? - queryOrganization - | selectClause - lateralView* - whereClause? - aggregationClause? - havingClause? - windowClause? - queryOrganization + : transformClause whereClause? queryOrganization + | selectClause lateralView* whereClause? aggregationClause? havingClause? windowClause? queryOrganization ; querySpecification - : transformClause - fromClause? - lateralView* - whereClause? - aggregationClause? - havingClause? - windowClause? - | selectClause - fromClause? - lateralView* - whereClause? - aggregationClause? - havingClause? - windowClause? + : transformClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause? + | selectClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause? ; transformClause - : (KW_SELECT kind=KW_TRANSFORM LEFT_PAREN setQuantifier? expressionSeq RIGHT_PAREN - | kind=KW_MAP setQuantifier? expressionSeq - | kind=KW_REDUCE setQuantifier? expressionSeq) - inRowFormat=rowFormat? - (KW_RECORDWRITER recordWriter=stringLit)? - KW_USING script=stringLit - (KW_AS (identifierSeq | colTypeList | (LEFT_PAREN (identifierSeq | colTypeList) RIGHT_PAREN)))? - outRowFormat=rowFormat? - (KW_RECORDREADER recordReader=stringLit)? + : ( + KW_SELECT kind=KW_TRANSFORM LEFT_PAREN setQuantifier? expressionSeq RIGHT_PAREN + | kind=KW_MAP setQuantifier? expressionSeq + | kind=KW_REDUCE setQuantifier? expressionSeq + ) inRowFormat=rowFormat? (KW_RECORDWRITER recordWriter=stringLit)? KW_USING script=stringLit ( + KW_AS ( + identifierSeq + | colTypeList + | (LEFT_PAREN (identifierSeq | colTypeList) RIGHT_PAREN) + ) + )? outRowFormat=rowFormat? (KW_RECORDREADER recordReader=stringLit)? ; selectClause @@ -529,6 +504,7 @@ setClause matchedClause : KW_WHEN KW_MATCHED (KW_AND matchedCond=booleanExpression)? KW_THEN matchedAction ; + notMatchedClause : KW_WHEN KW_NOT KW_MATCHED (KW_BY KW_TARGET)? (KW_AND notMatchedCond=booleanExpression)? KW_THEN notMatchedAction ; @@ -545,8 +521,9 @@ matchedAction notMatchedAction : KW_INSERT ASTERISK - | KW_INSERT LEFT_PAREN multipartIdentifierList RIGHT_PAREN - KW_VALUES LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN + | KW_INSERT LEFT_PAREN multipartIdentifierList RIGHT_PAREN KW_VALUES LEFT_PAREN expression ( + COMMA expression + )* RIGHT_PAREN ; notMatchedBySourceAction @@ -576,7 +553,9 @@ hint hintStatement : hintName=identifier - | hintName=identifier LEFT_PAREN parameters+=primaryExpression (COMMA parameters+=primaryExpression)* RIGHT_PAREN + | hintName=identifier LEFT_PAREN parameters+=primaryExpression ( + COMMA parameters+=primaryExpression + )* RIGHT_PAREN ; fromClause @@ -584,7 +563,9 @@ fromClause ; functionKind - : KW_USER | KW_SYSTEM | KW_ALL + : KW_USER + | KW_SYSTEM + | KW_ALL ; temporalClause @@ -593,12 +574,14 @@ temporalClause ; aggregationClause - : KW_GROUP KW_BY groupingExpressionsWithGroupingAnalytics+=groupByClause - (COMMA groupingExpressionsWithGroupingAnalytics+=groupByClause)* + : KW_GROUP KW_BY groupingExpressionsWithGroupingAnalytics+=groupByClause ( + COMMA groupingExpressionsWithGroupingAnalytics+=groupByClause + )* | KW_GROUP KW_BY groupingExpressions+=expression (COMMA groupingExpressions+=expression)* ( - KW_WITH kind=KW_ROLLUP - | KW_WITH kind=KW_CUBE - | kind=KW_GROUPING KW_SETS LEFT_PAREN groupingSet (COMMA groupingSet)* RIGHT_PAREN)? + KW_WITH kind=KW_ROLLUP + | KW_WITH kind=KW_CUBE + | kind=KW_GROUPING KW_SETS LEFT_PAREN groupingSet (COMMA groupingSet)* RIGHT_PAREN + )? ; groupByClause @@ -624,7 +607,9 @@ groupingSet ; pivotClause - : KW_PIVOT LEFT_PAREN aggregates=namedExpressionSeq KW_FOR pivotColumn KW_IN LEFT_PAREN pivotValues+=pivotValue (COMMA pivotValues+=pivotValue)* RIGHT_PAREN RIGHT_PAREN + : KW_PIVOT LEFT_PAREN aggregates=namedExpressionSeq KW_FOR pivotColumn KW_IN LEFT_PAREN pivotValues+=pivotValue ( + COMMA pivotValues+=pivotValue + )* RIGHT_PAREN RIGHT_PAREN ; pivotColumn @@ -637,9 +622,9 @@ pivotValue ; unpivotClause - : KW_UNPIVOT nullOperator=unpivotNullClause? LEFT_PAREN - operator=unpivotOperator - RIGHT_PAREN (KW_AS? identifier)? + : KW_UNPIVOT nullOperator=unpivotNullClause? LEFT_PAREN operator=unpivotOperator RIGHT_PAREN ( + KW_AS? identifier + )? ; unpivotNullClause @@ -651,13 +636,17 @@ unpivotOperator ; unpivotSingleValueColumnClause - : unpivotValueColumn KW_FOR unpivotNameColumn KW_IN LEFT_PAREN unpivotColumns+=unpivotColumnAndAlias (COMMA unpivotColumns+=unpivotColumnAndAlias)* RIGHT_PAREN + : unpivotValueColumn KW_FOR unpivotNameColumn KW_IN LEFT_PAREN unpivotColumns+=unpivotColumnAndAlias ( + COMMA unpivotColumns+=unpivotColumnAndAlias + )* RIGHT_PAREN ; unpivotMultiValueColumnClause - : LEFT_PAREN unpivotValueColumns+=unpivotValueColumn (COMMA unpivotValueColumns+=unpivotValueColumn)* RIGHT_PAREN - KW_FOR unpivotNameColumn - KW_IN LEFT_PAREN unpivotColumnSets+=unpivotColumnSet (COMMA unpivotColumnSets+=unpivotColumnSet)* RIGHT_PAREN + : LEFT_PAREN unpivotValueColumns+=unpivotValueColumn ( + COMMA unpivotValueColumns+=unpivotValueColumn + )* RIGHT_PAREN KW_FOR unpivotNameColumn KW_IN LEFT_PAREN unpivotColumnSets+=unpivotColumnSet ( + COMMA unpivotColumnSets+=unpivotColumnSet + )* RIGHT_PAREN ; unpivotColumnSet @@ -685,13 +674,17 @@ unpivotAlias ; ifNotExists - : KW_IF KW_NOT KW_EXISTS; + : KW_IF KW_NOT KW_EXISTS + ; ifExists - : KW_IF KW_EXISTS; + : KW_IF KW_EXISTS + ; lateralView - : KW_LATERAL KW_VIEW (KW_OUTER)? viewName LEFT_PAREN (expression (COMMA expression)*)? RIGHT_PAREN tableAlias (KW_AS? colName+=identifier (COMMA colName+=identifier)*)? + : KW_LATERAL KW_VIEW (KW_OUTER)? viewName LEFT_PAREN (expression (COMMA expression)*)? RIGHT_PAREN tableAlias ( + KW_AS? colName+=identifier (COMMA colName+=identifier)* + )? ; setQuantifier @@ -731,14 +724,17 @@ joinCriteria ; sample - : KW_TABLESAMPLE LEFT_PAREN sampleMethod? RIGHT_PAREN (KW_REPEATABLE LEFT_PAREN seed=INTEGER_VALUE RIGHT_PAREN)? + : KW_TABLESAMPLE LEFT_PAREN sampleMethod? RIGHT_PAREN ( + KW_REPEATABLE LEFT_PAREN seed=INTEGER_VALUE RIGHT_PAREN + )? ; sampleMethod : negativeSign=MINUS? percentage=(INTEGER_VALUE | DECIMAL_VALUE) KW_PERCENTLIT | expression KW_ROWS - | sampleType=KW_BUCKET numerator=INTEGER_VALUE KW_OUT KW_OF denominator=INTEGER_VALUE - (KW_ON (identifier | qualifiedName LEFT_PAREN RIGHT_PAREN))? + | sampleType=KW_BUCKET numerator=INTEGER_VALUE KW_OUT KW_OF denominator=INTEGER_VALUE ( + KW_ON (identifier | qualifiedName LEFT_PAREN RIGHT_PAREN) + )? | bytes=expression ; @@ -767,8 +763,7 @@ identifierComment ; relationPrimary - : identifierReference temporalClause? - sample? tableAlias + : identifierReference temporalClause? sample? tableAlias | LEFT_PAREN query RIGHT_PAREN sample? tableAlias | LEFT_PAREN relation RIGHT_PAREN sample? tableAlias | inlineTable @@ -786,13 +781,19 @@ functionTableSubqueryArgument ; tableArgumentPartitioning - : ((KW_WITH KW_SINGLE KW_PARTITION) - | ((KW_PARTITION | KW_DISTRIBUTE) KW_BY - (((LEFT_PAREN partition+=expression (COMMA partition+=expression)* RIGHT_PAREN)) - | partition+=expression))) - ((KW_ORDER | KW_SORT) KW_BY - (((LEFT_PAREN sortItem (COMMA sortItem)* RIGHT_PAREN) - | sortItem)))? + : ( + (KW_WITH KW_SINGLE KW_PARTITION) + | ( + (KW_PARTITION | KW_DISTRIBUTE) KW_BY ( + ((LEFT_PAREN partition+=expression (COMMA partition+=expression)* RIGHT_PAREN)) + | partition+=expression + ) + ) + ) ( + (KW_ORDER | KW_SORT) KW_BY ( + ((LEFT_PAREN sortItem (COMMA sortItem)* RIGHT_PAREN) | sortItem) + ) + )? ; functionTableNamedArgumentExpression @@ -810,9 +811,7 @@ functionTableArgument ; functionTable - : functionName LEFT_PAREN - (functionTableArgument (COMMA functionTableArgument)*)? - RIGHT_PAREN tableAlias + : functionName LEFT_PAREN (functionTableArgument (COMMA functionTableArgument)*)? RIGHT_PAREN tableAlias ; tableAlias @@ -821,12 +820,15 @@ tableAlias rowFormat : KW_ROW KW_FORMAT KW_SERDE name=stringLit (KW_WITH KW_SERDEPROPERTIES props=propertyList)? - | KW_ROW KW_FORMAT KW_DELIMITED - (KW_FIELDS KW_TERMINATED KW_BY fieldsTerminatedBy=stringLit (KW_ESCAPED KW_BY escapedBy=stringLit)?)? - (KW_COLLECTION KW_ITEMS KW_TERMINATED KW_BY collectionItemsTerminatedBy=stringLit)? - (KW_MAP KW_KEYS KW_TERMINATED KW_BY keysTerminatedBy=stringLit)? - (KW_LINES KW_TERMINATED KW_BY linesSeparatedBy=stringLit)? - (KW_NULL KW_DEFINED KW_AS nullDefinedAs=stringLit)? + | KW_ROW KW_FORMAT KW_DELIMITED ( + KW_FIELDS KW_TERMINATED KW_BY fieldsTerminatedBy=stringLit ( + KW_ESCAPED KW_BY escapedBy=stringLit + )? + )? (KW_COLLECTION KW_ITEMS KW_TERMINATED KW_BY collectionItemsTerminatedBy=stringLit)? ( + KW_MAP KW_KEYS KW_TERMINATED KW_BY keysTerminatedBy=stringLit + )? (KW_LINES KW_TERMINATED KW_BY linesSeparatedBy=stringLit)? ( + KW_NULL KW_DEFINED KW_AS nullDefinedAs=stringLit + )? ; multipartIdentifierList @@ -872,8 +874,7 @@ partitionField transform : qualifiedName - | transformName=identifier - LEFT_PAREN transformArgument (COMMA transformArgument)* RIGHT_PAREN + | transformName=identifier LEFT_PAREN transformArgument (COMMA transformArgument)* RIGHT_PAREN ; transformArgument @@ -911,7 +912,10 @@ predicate | KW_NOT? kind=KW_IN LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN | KW_NOT? kind=KW_IN LEFT_PAREN query RIGHT_PAREN | KW_NOT? kind=(KW_RLIKE | KW_REGEXP) pattern=valueExpression - | KW_NOT? kind=(KW_LIKE | KW_ILIKE) quantifier=(KW_ANY | KW_SOME | KW_ALL) (LEFT_PAREN RIGHT_PAREN | LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN) + | KW_NOT? kind=(KW_LIKE | KW_ILIKE) quantifier=(KW_ANY | KW_SOME | KW_ALL) ( + LEFT_PAREN RIGHT_PAREN + | LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN + ) | KW_NOT? kind=(KW_LIKE | KW_ILIKE) pattern=valueExpression (KW_ESCAPE escapeChar=stringLit)? | KW_IS KW_NOT? kind=KW_NULL | KW_IS KW_NOT? kind=(KW_TRUE | KW_FALSE | KW_UNKNOWN) @@ -930,15 +934,29 @@ valueExpression ; datetimeUnit - : KW_YEAR | KW_QUARTER | KW_MONTH - | KW_WEEK | KW_DAY | KW_DAYOFYEAR - | KW_HOUR | KW_MINUTE | KW_SECOND | KW_MILLISECOND | KW_MICROSECOND + : KW_YEAR + | KW_QUARTER + | KW_MONTH + | KW_WEEK + | KW_DAY + | KW_DAYOFYEAR + | KW_HOUR + | KW_MINUTE + | KW_SECOND + | KW_MILLISECOND + | KW_MICROSECOND ; primaryExpression : name=(KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_CURRENT_USER | KW_USER | KW_SESSION_USER) - | name=(KW_TIMESTAMPADD | KW_DATEADD | KW_DATE_ADD) LEFT_PAREN (unit=datetimeUnit | invalidUnit=stringLit) COMMA unitsAmount=valueExpression COMMA timestamp=valueExpression RIGHT_PAREN - | name=(KW_TIMESTAMPDIFF | KW_DATEDIFF | KW_DATE_DIFF | KW_TIMEDIFF) LEFT_PAREN (unit=datetimeUnit | invalidUnit=stringLit) COMMA startTimestamp=valueExpression COMMA endTimestamp=valueExpression RIGHT_PAREN + | name=(KW_TIMESTAMPADD | KW_DATEADD | KW_DATE_ADD) LEFT_PAREN ( + unit=datetimeUnit + | invalidUnit=stringLit + ) COMMA unitsAmount=valueExpression COMMA timestamp=valueExpression RIGHT_PAREN + | name=(KW_TIMESTAMPDIFF | KW_DATEDIFF | KW_DATE_DIFF | KW_TIMEDIFF) LEFT_PAREN ( + unit=datetimeUnit + | invalidUnit=stringLit + ) COMMA startTimestamp=valueExpression COMMA endTimestamp=valueExpression RIGHT_PAREN | KW_CASE whenClause+ (KW_ELSE elseExpression=expression)? KW_END | KW_CASE expression whenClause+ (KW_ELSE elseExpression=expression)? KW_END | name=(KW_CAST | KW_TRY_CAST) LEFT_PAREN expression KW_AS dataType RIGHT_PAREN @@ -953,10 +971,9 @@ primaryExpression | LEFT_PAREN namedExpression (COMMA namedExpression)+ RIGHT_PAREN | LEFT_PAREN query RIGHT_PAREN | KW_IDENTIFIER LEFT_PAREN expression RIGHT_PAREN - | functionName LEFT_PAREN (setQuantifier? functionArgument - (COMMA functionArgument)*)? RIGHT_PAREN - (KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN)? - (nullsOption=(KW_IGNORE | KW_RESPECT) KW_NULLS)? ( KW_OVER windowSpec)? + | functionName LEFT_PAREN (setQuantifier? functionArgument (COMMA functionArgument)*)? RIGHT_PAREN ( + KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN + )? (nullsOption=(KW_IGNORE | KW_RESPECT) KW_NULLS)? (KW_OVER windowSpec)? | identifier ARROW expression | LEFT_PAREN identifier (COMMA identifier)+ RIGHT_PAREN ARROW expression | value=primaryExpression LEFT_BRACKET index=valueExpression RIGHT_BRACKET @@ -964,20 +981,26 @@ primaryExpression | base=primaryExpression DOT fieldName=identifier | LEFT_PAREN expression RIGHT_PAREN | KW_EXTRACT LEFT_PAREN field=identifier KW_FROM source=valueExpression RIGHT_PAREN - | (KW_SUBSTR | KW_SUBSTRING) LEFT_PAREN str=valueExpression (KW_FROM | COMMA) pos=valueExpression - ((KW_FOR | COMMA) len=valueExpression)? RIGHT_PAREN - | KW_TRIM LEFT_PAREN trimOption=(KW_BOTH | KW_LEADING | KW_TRAILING)? (trimStr=valueExpression)? - KW_FROM srcStr=valueExpression RIGHT_PAREN - | KW_OVERLAY LEFT_PAREN input=valueExpression KW_PLACING replace=valueExpression - KW_FROM position=valueExpression (KW_FOR length=valueExpression)? RIGHT_PAREN - | name=(KW_PERCENTILE_CONT | KW_PERCENTILE_DISC) LEFT_PAREN percentage=valueExpression RIGHT_PAREN - KW_WITHIN KW_GROUP LEFT_PAREN KW_ORDER KW_BY sortItem RIGHT_PAREN - (KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN)? ( KW_OVER windowSpec)? + | (KW_SUBSTR | KW_SUBSTRING) LEFT_PAREN str=valueExpression (KW_FROM | COMMA) pos=valueExpression ( + (KW_FOR | COMMA) len=valueExpression + )? RIGHT_PAREN + | KW_TRIM LEFT_PAREN trimOption=(KW_BOTH | KW_LEADING | KW_TRAILING)? ( + trimStr=valueExpression + )? KW_FROM srcStr=valueExpression RIGHT_PAREN + | KW_OVERLAY LEFT_PAREN input=valueExpression KW_PLACING replace=valueExpression KW_FROM position=valueExpression ( + KW_FOR length=valueExpression + )? RIGHT_PAREN + | name=(KW_PERCENTILE_CONT | KW_PERCENTILE_DISC) LEFT_PAREN percentage=valueExpression RIGHT_PAREN KW_WITHIN KW_GROUP LEFT_PAREN KW_ORDER KW_BY + sortItem RIGHT_PAREN (KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN)? ( + KW_OVER windowSpec + )? ; literalType : KW_DATE - | KW_TIMESTAMP | KW_TIMESTAMP_LTZ | KW_TIMESTAMP_NTZ + | KW_TIMESTAMP + | KW_TIMESTAMP_LTZ + | KW_TIMESTAMP_NTZ | KW_INTERVAL | KW_BINARY_HEX | unsupportedType=identifier @@ -995,19 +1018,40 @@ constant ; comparisonOperator - : EQ | NEQ | NEQJ | LT | LTE | GT | GTE | NSEQ + : EQ + | NEQ + | NEQJ + | LT + | LTE + | GT + | GTE + | NSEQ ; arithmeticOperator - : PLUS | MINUS | ASTERISK | SLASH | PERCENT | KW_DIV | TILDE | AMPERSAND | PIPE | CONCAT_PIPE | HAT + : PLUS + | MINUS + | ASTERISK + | SLASH + | PERCENT + | KW_DIV + | TILDE + | AMPERSAND + | PIPE + | CONCAT_PIPE + | HAT ; predicateOperator - : KW_OR | KW_AND | KW_IN | KW_NOT + : KW_OR + | KW_AND + | KW_IN + | KW_NOT ; booleanValue - : KW_TRUE | KW_FALSE + : KW_TRUE + | KW_FALSE ; interval @@ -1031,42 +1075,76 @@ unitToUnitInterval ; intervalValue - : (PLUS | MINUS)? - (INTEGER_VALUE | DECIMAL_VALUE | stringLit) + : (PLUS | MINUS)? (INTEGER_VALUE | DECIMAL_VALUE | stringLit) ; unitInMultiUnits - : KW_NANOSECOND | KW_NANOSECONDS | KW_MICROSECOND | KW_MICROSECONDS | KW_MILLISECOND | KW_MILLISECONDS - | KW_SECOND | KW_SECONDS | KW_MINUTE | KW_MINUTES | KW_HOUR | KW_HOURS | KW_DAY | KW_DAYS | KW_WEEK | KW_WEEKS - | KW_MONTH | KW_MONTHS | KW_YEAR | KW_YEARS + : KW_NANOSECOND + | KW_NANOSECONDS + | KW_MICROSECOND + | KW_MICROSECONDS + | KW_MILLISECOND + | KW_MILLISECONDS + | KW_SECOND + | KW_SECONDS + | KW_MINUTE + | KW_MINUTES + | KW_HOUR + | KW_HOURS + | KW_DAY + | KW_DAYS + | KW_WEEK + | KW_WEEKS + | KW_MONTH + | KW_MONTHS + | KW_YEAR + | KW_YEARS ; unitInUnitToUnit - : KW_SECOND | KW_MINUTE | KW_HOUR | KW_DAY | KW_MONTH | KW_YEAR + : KW_SECOND + | KW_MINUTE + | KW_HOUR + | KW_DAY + | KW_MONTH + | KW_YEAR ; colPosition - : position=KW_FIRST | position=KW_AFTER afterCol=errorCapturingIdentifier + : position=KW_FIRST + | position=KW_AFTER afterCol=errorCapturingIdentifier ; type : KW_BOOLEAN - | KW_TINYINT | KW_BYTE - | KW_SMALLINT | KW_SHORT - | KW_INT | KW_INTEGER - | KW_BIGINT | KW_LONG - | KW_FLOAT | KW_REAL + | KW_TINYINT + | KW_BYTE + | KW_SMALLINT + | KW_SHORT + | KW_INT + | KW_INTEGER + | KW_BIGINT + | KW_LONG + | KW_FLOAT + | KW_REAL | KW_DOUBLE | KW_DATE - | KW_TIMESTAMP | KW_TIMESTAMP_NTZ | KW_TIMESTAMP_LTZ + | KW_TIMESTAMP + | KW_TIMESTAMP_NTZ + | KW_TIMESTAMP_LTZ | KW_STRING - | KW_CHARACTER | KW_CHAR + | KW_CHARACTER + | KW_CHAR | KW_VARCHAR | KW_BINARY - | KW_DECIMAL | KW_DEC | KW_NUMERIC + | KW_DECIMAL + | KW_DEC + | KW_NUMERIC | KW_VOID | KW_INTERVAL - | KW_ARRAY | KW_STRUCT | KW_MAP + | KW_ARRAY + | KW_STRUCT + | KW_MAP | unsupportedType=identifier ; @@ -1075,10 +1153,10 @@ dataType | complex=KW_MAP LT dataType COMMA dataType GT | complex=KW_STRUCT (LT complexColTypeList? GT | NEQ) | KW_INTERVAL (KW_YEAR | KW_MONTH) (KW_TO KW_MONTH)? - | KW_INTERVAL (KW_DAY | KW_HOUR | KW_MINUTE | KW_SECOND) - (KW_TO (KW_HOUR | KW_MINUTE | KW_SECOND))? - | type (LEFT_PAREN INTEGER_VALUE - (COMMA INTEGER_VALUE)* RIGHT_PAREN)? + | KW_INTERVAL (KW_DAY | KW_HOUR | KW_MINUTE | KW_SECOND) ( + KW_TO (KW_HOUR | KW_MINUTE | KW_SECOND) + )? + | type (LEFT_PAREN INTEGER_VALUE (COMMA INTEGER_VALUE)* RIGHT_PAREN)? ; qualifiedColTypeWithPositionSeqForAdd @@ -1097,7 +1175,6 @@ qualifiedColTypeWithPositionForReplace : name=columnName dataType colDefinitionDescriptorWithPosition* ; - colDefinitionDescriptorWithPosition : KW_NOT KW_NULL | defaultExpression @@ -1163,12 +1240,14 @@ namedWindow windowSpec : name=errorCapturingIdentifier | LEFT_PAREN name=errorCapturingIdentifier RIGHT_PAREN - | LEFT_PAREN - ( KW_CLUSTER KW_BY partition+=expression (COMMA partition+=expression)* - | ((KW_PARTITION | KW_DISTRIBUTE) KW_BY partition+=expression (COMMA partition+=expression)*)? - ((KW_ORDER | KW_SORT) KW_BY sortItem (COMMA sortItem)*)?) - windowFrame? - RIGHT_PAREN + | LEFT_PAREN ( + KW_CLUSTER KW_BY partition+=expression (COMMA partition+=expression)* + | ( + (KW_PARTITION | KW_DISTRIBUTE) KW_BY partition+=expression ( + COMMA partition+=expression + )* + )? ((KW_ORDER | KW_SORT) KW_BY sortItem (COMMA sortItem)*)? + ) windowFrame? RIGHT_PAREN ; /** @@ -1290,7 +1369,7 @@ version // You can find the full keywords list by searching "Start of the keywords list" in this file. // The non-reserved keywords are listed below. Keywords not in this list are reserved keywords. ansiNonReserved -//--ANSI-NON-RESERVED-START + //--ANSI-NON-RESERVED-START : KW_ADD | KW_AFTER | KW_ALTER @@ -1553,7 +1632,7 @@ ansiNonReserved | KW_YEAR | KW_YEARS | KW_ZONE -//--ANSI-NON-RESERVED-END + //--ANSI-NON-RESERVED-END ; // When `SQL_standard_keyword_behavior=false`, there are 2 kinds of keywords in Spark SQL. @@ -1585,7 +1664,7 @@ strictNonReserved ; nonReserved -//--DEFAULT-NON-RESERVED-START + //--DEFAULT-NON-RESERVED-START : KW_ADD | KW_AFTER | KW_ALL @@ -1907,5 +1986,5 @@ nonReserved | KW_YEAR | KW_YEARS | KW_ZONE -//--DEFAULT-NON-RESERVED-END - ; + //--DEFAULT-NON-RESERVED-END + ; \ No newline at end of file diff --git a/src/grammar/trinosql/TrinoSql.g4 b/src/grammar/trinosql/TrinoSql.g4 index 52ec91f..357d679 100644 --- a/src/grammar/trinosql/TrinoSql.g4 +++ b/src/grammar/trinosql/TrinoSql.g4 @@ -17,1047 +17,1189 @@ * Reference: https://github.com/trinodb/trino/blob/385/core/trino-parser/src/main/antlr4/io/trino/sql/parser/SqlBase.g4 */ + +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging +// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true + grammar TrinoSql; tokens { - DELIMITER + DELIMITER } // Modified entrypoint -program: statements* EOF; - -statements: - singleStatement - | standaloneExpression - | standalonePathSpecification - | standaloneType - | standaloneRowPattern; - -singleStatement: statement SEMICOLON?; - -standaloneExpression: expression SEMICOLON?; - -standalonePathSpecification: pathSpecification SEMICOLON?; - -standaloneType: type SEMICOLON?; - -standaloneRowPattern: rowPattern SEMICOLON?; - -statement: - query # statementDefault - | KW_USE schemaName # use - | KW_CREATE KW_SCHEMA (KW_IF KW_NOT KW_EXISTS)? schemaNameCreate ( - KW_AUTHORIZATION principal - )? (KW_WITH properties)? # createSchema - | KW_DROP KW_SCHEMA (KW_IF KW_EXISTS)? schemaName (KW_CASCADE | KW_RESTRICT)? # dropSchema - | KW_ALTER KW_SCHEMA schemaName KW_RENAME KW_TO schemaNameCreate # renameSchema - | KW_ALTER KW_SCHEMA schemaName KW_SET KW_AUTHORIZATION principal # setSchemaAuthorization - | KW_CREATE KW_TABLE (KW_IF KW_NOT KW_EXISTS)? tableNameCreate columnListCreate? ( - KW_COMMENT string - )? (KW_WITH properties)? KW_AS (query | '(' query ')') ( - KW_WITH (KW_NO)? KW_DATA - )? # createTableAsSelect - | KW_CREATE KW_TABLE (KW_IF KW_NOT KW_EXISTS)? tableNameCreate '(' tableElement ( - ',' tableElement - )* ')' (KW_COMMENT string)? (KW_WITH properties)? # createTable - | KW_DROP KW_TABLE (KW_IF KW_EXISTS)? tableName # dropTable - | KW_INSERT KW_INTO tableName columnList? query # insertInto - | KW_DELETE KW_FROM tableName (KW_WHERE booleanExpression)? # delete - | KW_TRUNCATE KW_TABLE tableName # truncateTable - | KW_ALTER KW_TABLE (KW_IF KW_EXISTS)? from = tableName KW_RENAME KW_TO to = tableNameCreate # renameTable - | KW_COMMENT KW_ON KW_TABLE tableName KW_IS (string | KW_NULL) # commentTable - | KW_COMMENT KW_ON KW_COLUMN columnName KW_IS (string | KW_NULL) # commentColumn - | KW_ALTER KW_TABLE (KW_IF KW_EXISTS)? tableName KW_RENAME KW_COLUMN ( - KW_IF KW_EXISTS - )? from = columnName KW_TO to = columnNameCreate # renameColumn - | KW_ALTER KW_TABLE (KW_IF KW_EXISTS)? tableName KW_DROP KW_COLUMN ( - KW_IF KW_EXISTS - )? column = columnName # dropColumn - | KW_ALTER KW_TABLE (KW_IF KW_EXISTS)? tableName KW_ADD KW_COLUMN ( - KW_IF KW_NOT KW_EXISTS - )? column = columnDefinition # addColumn - | KW_ALTER KW_TABLE tableName KW_SET KW_AUTHORIZATION principal # setTableAuthorization - | KW_ALTER KW_TABLE tableName KW_SET KW_PROPERTIES propertyAssignments # setTableProperties - | KW_ALTER KW_TABLE tableName KW_EXECUTE procedureName = identifier ( - '(' (callArgument (',' callArgument)*)? ')' - )? (KW_WHERE where = booleanExpression)? # tableExecute - | KW_ANALYZE tableName (KW_WITH properties)? # analyze - | KW_CREATE (KW_OR KW_REPLACE)? KW_MATERIALIZED KW_VIEW (KW_IF KW_NOT KW_EXISTS)? viewNameCreate ( - KW_COMMENT string - )? (KW_WITH properties)? KW_AS query # createMaterializedView - | KW_CREATE (KW_OR KW_REPLACE)? KW_VIEW viewNameCreate (KW_COMMENT string)? ( - KW_SECURITY (KW_DEFINER | KW_INVOKER) - )? KW_AS query # createView - | KW_REFRESH KW_MATERIALIZED KW_VIEW viewName # refreshMaterializedView - | KW_DROP KW_MATERIALIZED KW_VIEW (KW_IF KW_EXISTS)? viewName # dropMaterializedView - | KW_ALTER KW_MATERIALIZED KW_VIEW (KW_IF KW_EXISTS)? from = viewName KW_RENAME KW_TO to = viewNameCreate # renameMaterializedView - | KW_ALTER KW_MATERIALIZED KW_VIEW viewName - KW_SET KW_PROPERTIES propertyAssignments # setMaterializedViewProperties - | KW_DROP KW_VIEW (KW_IF KW_EXISTS)? viewName # dropView - | KW_ALTER KW_VIEW from = viewName KW_RENAME KW_TO to = viewNameCreate # renameView - | KW_ALTER KW_VIEW from = viewName KW_SET KW_AUTHORIZATION principal # setViewAuthorization - | KW_CALL functionName '(' (callArgument (',' callArgument)*)? ')' # call - | KW_CREATE KW_ROLE name = identifier - (KW_WITH KW_ADMIN grantor)? - (KW_IN catalogName)? # createRole - | KW_DROP KW_ROLE name = identifier # dropRole - | KW_GRANT roles KW_TO principal - (',' principal)* - (KW_WITH KW_ADMIN KW_OPTION)? - (KW_GRANTED KW_BY grantor)? - (KW_IN catalogName)? # grantRoles - | KW_REVOKE (KW_ADMIN KW_OPTION KW_FOR)? roles KW_FROM principal - (',' principal)* - (KW_GRANTED KW_BY grantor)? - (KW_IN catalogName)? # revokeRoles - | KW_SET KW_ROLE (KW_ALL | KW_NONE | role = identifier) ( - KW_IN catalogName - )? # setRole | KW_GRANT (privilege (',' privilege)* | KW_ALL KW_PRIVILEGES) KW_ON ( - KW_SCHEMA? schemaName - | KW_TABLE? tableName - )? KW_TO grantee = principal (KW_WITH KW_GRANT KW_OPTION)? # grant - | KW_DENY (privilege (',' privilege)* | KW_ALL KW_PRIVILEGES) KW_ON ( - KW_SCHEMA? schemaName - | KW_TABLE? tableName - ) KW_TO grantee = principal # deny - | KW_REVOKE (KW_GRANT KW_OPTION KW_FOR)? ( - privilege (',' privilege)* - | KW_ALL KW_PRIVILEGES - ) KW_ON (KW_SCHEMA? schemaName | KW_TABLE? tableName)? KW_FROM grantee = principal # revoke - | KW_SHOW KW_GRANTS (KW_ON KW_TABLE? tableName)? # showGrants - | KW_EXPLAIN KW_ANALYZE? KW_VERBOSE? ( - '(' explainOption (',' explainOption)* ')' - )? statement # explain - | KW_SHOW KW_CREATE KW_TABLE tableName # showCreateTable - | KW_SHOW KW_CREATE KW_SCHEMA schemaName # showCreateSchema - | KW_SHOW KW_CREATE KW_VIEW viewName # showCreateView - | KW_SHOW KW_CREATE KW_MATERIALIZED KW_VIEW viewName # showCreateMaterializedView - | KW_SHOW KW_TABLES ((KW_FROM | KW_IN) schemaName)? ( - KW_LIKE pattern = string (KW_ESCAPE escape = string)? - )? # showTables - | KW_SHOW KW_SCHEMAS ((KW_FROM | KW_IN) catalogName)? ( - KW_LIKE pattern = string (KW_ESCAPE escape = string)? - )? # showSchemas - | KW_SHOW KW_CATALOGS ( - KW_LIKE pattern = string (KW_ESCAPE escape = string)? - )? # showCatalogs - | KW_SHOW KW_COLUMNS (KW_FROM | KW_IN) tableOrViewName? ( - KW_LIKE pattern = string (KW_ESCAPE escape = string)? - )? # showColumns - | KW_SHOW KW_STATS KW_FOR tableName # showStats - | KW_SHOW KW_STATS KW_FOR '(' query ')' # showStatsForQuery - | KW_SHOW KW_CURRENT? KW_ROLES ((KW_FROM | KW_IN) identifier)? # showRoles - | KW_SHOW KW_ROLE KW_GRANTS ((KW_FROM | KW_IN) identifier)? # showRoleGrants - | KW_DESCRIBE tableOrViewName # showColumns - | KW_DESC tableOrViewName # showColumns - | KW_SHOW KW_FUNCTIONS ( - KW_LIKE pattern = string (KW_ESCAPE escape = string)? - )? # showFunctions - | KW_SHOW KW_SESSION ( - KW_LIKE pattern = string (KW_ESCAPE escape = string)? - )? # showSession - | KW_SET KW_SESSION qualifiedName EQ expression # setSession - | KW_RESET KW_SESSION qualifiedName # resetSession - | KW_START KW_TRANSACTION (transactionMode (',' transactionMode)*)? # startTransaction - | KW_COMMIT KW_WORK? # commit - | KW_ROLLBACK KW_WORK? # rollback - | KW_PREPARE identifier KW_FROM statement # prepare - | KW_DEALLOCATE KW_PREPARE identifier # deallocate - | KW_EXECUTE identifier (KW_USING expression (',' expression)*)? # execute - | KW_DESCRIBE KW_INPUT identifier # describeInput - | KW_DESCRIBE KW_OUTPUT identifier # describeOutput - | KW_SET KW_PATH pathSpecification # setPath - | KW_SET KW_TIME KW_ZONE (KW_LOCAL | expression) # setTimeZone - | KW_UPDATE tableName KW_SET updateAssignment ( - ',' updateAssignment - )* (KW_WHERE where = booleanExpression)? # update - | KW_MERGE KW_INTO tableName (KW_AS? identifier)? KW_USING relation KW_ON expression mergeCase+ # merge - | KW_SHOW KW_COMMENT KW_ON KW_TABLE tableName # showTableComment - | KW_SHOW KW_COMMENT KW_ON KW_COLUMN columnName # showColumnComment; - -query: with? queryNoWith; - -with: KW_WITH KW_RECURSIVE? namedQuery (',' namedQuery)*; - -tableElement: columnDefinition | likeClause; - -columnDefinition: - columnNameCreate type (KW_NOT KW_NULL)? (KW_COMMENT string)? ( - KW_WITH properties - )?; - -likeClause: - KW_LIKE tableName ( - optionType = (KW_INCLUDING | KW_EXCLUDING) KW_PROPERTIES - )?; - -properties: '(' propertyAssignments ')'; - -propertyAssignments: property (',' property)*; - -property: identifier EQ propertyValue; - -propertyValue: - KW_DEFAULT # defaultPropertyValue - | expression # nonDefaultPropertyValue; - -queryNoWith: - queryTerm (KW_ORDER KW_BY sortItem (',' sortItem)*)? ( - KW_OFFSET offset = rowCount (KW_ROW | KW_ROWS)? - )? ( - (KW_LIMIT limit = limitRowCount) - | ( - KW_FETCH (KW_FIRST | KW_NEXT) (fetchFirst = rowCount)? ( - KW_ROW - | KW_ROWS - ) (KW_ONLY | KW_WITH KW_TIES) - ) - )?; - -limitRowCount: KW_ALL | rowCount; - -rowCount: INTEGER_VALUE | QUESTION_MARK; - -queryTerm: - queryPrimary # queryTermDefault - | left = queryTerm operator = KW_INTERSECT setQuantifier? right = queryTerm # setOperation - | left = queryTerm operator = (KW_UNION | KW_EXCEPT) setQuantifier? right = queryTerm # setOperation; - -queryPrimary: - querySpecification # queryPrimaryDefault - | KW_TABLE tableName # table - | KW_VALUES expression (',' expression)* # inlineTable - | '(' queryNoWith ')' # subquery; - -sortItem: - (columnName | expression) ordering = (KW_ASC | KW_DESC)? ( - KW_NULLS nullOrdering = (KW_FIRST | KW_LAST) - )?; - -querySpecification: - KW_SELECT setQuantifier? selectItem (',' selectItem)* ( - KW_FROM relation (',' relation)* - )? (KW_WHERE where = booleanExpression)? (KW_GROUP KW_BY groupBy)? ( - KW_HAVING having = booleanExpression - )? (KW_WINDOW windowDefinition (',' windowDefinition)*)?; - -groupBy: setQuantifier? groupingElement (',' groupingElement)*; - -groupingElement: - groupingSet # singleGroupingSet - | KW_ROLLUP '(' (groupingTerm (',' groupingTerm)*)? ')' # rollup - | KW_CUBE '(' (groupingTerm (',' groupingTerm)*)? ')' # cube - | KW_GROUPING KW_SETS '(' groupingSet (',' groupingSet)* ')' # multipleGroupingSets; - -groupingSet: - '(' (groupingTerm (',' groupingTerm)*)? ')' - | groupingTerm; - -groupingTerm: - columnName - | expression; - -windowDefinition: - name = identifier KW_AS '(' windowSpecification ')'; - -windowSpecification: (existingWindowName = identifier)? ( - KW_PARTITION KW_BY partition += expression ( - ',' partition += expression - )* - )? (KW_ORDER KW_BY sortItem (',' sortItem)*)? windowFrame?; - -namedQuery: name = identifier (columnAliases)? KW_AS '(' query ')'; - -setQuantifier: KW_DISTINCT | KW_ALL; - -selectItem: - (columnName | expression) (KW_AS? identifier)? # selectSingle - | primaryExpression '.' ASTERISK (KW_AS columnAliases)? # selectAll - | ASTERISK # selectAll; - -relation: - left = relation ( - KW_CROSS KW_JOIN right = sampledRelation - | joinType KW_JOIN rightRelation = relation joinCriteria - | KW_NATURAL joinType KW_JOIN right = sampledRelation - ) # joinRelation - | sampledRelation # relationDefault; - -joinType: KW_INNER? | KW_LEFT KW_OUTER? | KW_RIGHT KW_OUTER? | KW_FULL KW_OUTER?; - -joinCriteria: - KW_ON booleanExpression - | KW_USING '(' identifier (',' identifier)* ')'; - -sampledRelation: - patternRecognition ( - KW_TABLESAMPLE sampleType '(' percentage = expression ')' - )?; - -sampleType: KW_BERNOULLI | KW_SYSTEM; - -patternRecognition: - aliasedRelation ( - KW_MATCH_RECOGNIZE '(' ( - KW_PARTITION KW_BY partition += expression ( - ',' partition += expression - )* - )? (KW_ORDER KW_BY sortItem (',' sortItem)*)? ( - KW_MEASURES measureDefinition (',' measureDefinition)* - )? rowsPerMatch? (KW_AFTER KW_MATCH skipTo)? (KW_INITIAL | KW_SEEK)? KW_PATTERN '(' rowPattern ')' ( - KW_SUBSET subsetDefinition (',' subsetDefinition)* - )? KW_DEFINE variableDefinition (',' variableDefinition)* ')' ( - KW_AS? identifier columnAliases? - )? - )?; - -measureDefinition: expression KW_AS identifier; - -rowsPerMatch: - KW_ONE KW_ROW KW_PER KW_MATCH - | KW_ALL KW_ROWS KW_PER KW_MATCH emptyMatchHandling?; - -emptyMatchHandling: - KW_SHOW KW_EMPTY KW_MATCHES - | KW_OMIT KW_EMPTY KW_MATCHES - | KW_WITH KW_UNMATCHED KW_ROWS; - -skipTo: - 'SKIP' KW_TO KW_NEXT KW_ROW - | 'SKIP' KW_PAST KW_LAST KW_ROW - | 'SKIP' KW_TO KW_FIRST identifier - | 'SKIP' KW_TO KW_LAST identifier - | 'SKIP' KW_TO identifier; - -subsetDefinition: - name = identifier EQ '(' union += identifier ( - ',' union += identifier - )* ')'; - -variableDefinition: identifier KW_AS expression; - -aliasedRelation: - relationPrimary (KW_AS? identifier columnAliases?)?; - -columnListCreate: '(' columnNameCreate (',' columnNameCreate)* ')'; - -columnList: '(' columnName (',' columnName)* ')'; - -columnAliases: '(' identifier (',' identifier)* ')'; - -relationPrimary: - tableOrViewName #tableOrViewRelation - | '(' query ')' # subqueryRelation - | KW_UNNEST '(' expression (',' expression)* ')' ( - KW_WITH KW_ORDINALITY - )? # unnest - | KW_LATERAL '(' query ')' # lateral - | '(' relation ')' # parenthesizedRelation; - -expression: booleanExpression; - -booleanExpression: - valueExpression predicate[$valueExpression.ctx]? # predicated - | KW_NOT booleanExpression # logicalNot - | left = booleanExpression operator = KW_AND right = booleanExpression # logicalBinary - | left = booleanExpression operator = KW_OR right = booleanExpression # logicalBinary; - -// workaround for https://github.com/antlr/antlr4/issues/780 -predicate[ParserRuleContext value]: - comparisonOperator right = valueExpression # comparison - | comparisonOperator comparisonQuantifier '(' query ')' # quantifiedComparison - | KW_NOT? KW_BETWEEN lower = valueExpression KW_AND upper = valueExpression # between - | KW_NOT? KW_IN '(' expression (',' expression)* ')' # inList - | KW_NOT? KW_IN '(' query ')' # inSubquery - | KW_NOT? KW_LIKE pattern = valueExpression ( - KW_ESCAPE escape = valueExpression - )? # like - | KW_IS KW_NOT? KW_NULL # nullPredicate - | KW_IS KW_NOT? KW_DISTINCT KW_FROM right = valueExpression # distinctFrom; - -valueExpression: - primaryExpression # valueExpressionDefault - | valueExpression KW_AT timeZoneSpecifier # atTimeZone - | operator = (MINUS | PLUS) valueExpression # arithmeticUnary - | left = valueExpression operator = ( - ASTERISK - | SLASH - | PERCENT - ) right = valueExpression # arithmeticBinary - | left = valueExpression operator = (PLUS | MINUS) right = valueExpression # arithmeticBinary - | left = valueExpression CONCAT right = valueExpression # concatenation; - -primaryExpression: - KW_NULL # nullLiteral - | interval # intervalLiteral - | identifier string # typeConstructor - | KW_DOUBLE KW_PRECISION string # typeConstructor - | number # numericLiteral - | booleanValue # booleanLiteral - | string # stringLiteral - | BINARY_LITERAL # binaryLiteral - | QUESTION_MARK # parameter - | KW_POSITION '(' valueExpression KW_IN valueExpression ')' # position - | '(' expression (',' expression)+ ')' # rowConstructor - | KW_ROW '(' expression (',' expression)* ')' # rowConstructor - | functionName '(' ASTERISK ')' filter? over? # functionCall - | processingMode? functionName '(' ( - setQuantifier? expression (',' expression)* - )? (KW_ORDER KW_BY sortItem (',' sortItem)*)? ')' filter? ( - nullTreatment? over - )? # functionCall - | identifier over # measure - | identifier '->' expression # lambda - | '(' (identifier (',' identifier)*)? ')' '->' expression # lambda - | '(' query ')' # subqueryExpression - // This is an extension to ANSI SQL, which considers KW_EXISTS to be a - | KW_EXISTS '(' query ')' # exists - | KW_CASE operand = expression whenClause+ ( - KW_ELSE elseExpression = expression - )? KW_END # simpleCase - | KW_CASE whenClause+ (KW_ELSE elseExpression = expression)? KW_END # searchedCase - | KW_CAST '(' expression KW_AS type ')' # cast - | KW_TRY_CAST '(' expression KW_AS type ')' # cast - | KW_ARRAY '[' (expression (',' expression)*)? ']' # arrayConstructor - | value = primaryExpression '[' index = valueExpression ']' # subscript - | identifier # columnReference - | base = primaryExpression '.' fieldName = identifier # dereference - | name = KW_CURRENT_DATE # specialDateTimeFunction - | name = KW_CURRENT_TIME ('(' precision = INTEGER_VALUE ')')? # specialDateTimeFunction - | name = KW_CURRENT_TIMESTAMP ( - '(' precision = INTEGER_VALUE ')' - )? # specialDateTimeFunction - | name = KW_LOCALTIME ('(' precision = INTEGER_VALUE ')')? # specialDateTimeFunction - | name = KW_LOCALTIMESTAMP ('(' precision = INTEGER_VALUE ')')? # specialDateTimeFunction - | name = KW_CURRENT_USER # currentUser - | name = KW_CURRENT_CATALOG # currentCatalog - | name = KW_CURRENT_SCHEMA # currentSchema - | name = KW_CURRENT_PATH # currentPath - | KW_SUBSTRING '(' valueExpression KW_FROM valueExpression ( - KW_FOR valueExpression - )? ')' # substring - | KW_NORMALIZE '(' valueExpression (',' normalForm)? ')' # normalize - | KW_EXTRACT '(' identifier KW_FROM valueExpression ')' # extract - | '(' expression ')' # parenthesizedExpression - | KW_GROUPING '(' (qualifiedName (',' qualifiedName)*)? ')' # groupingOperation; - -processingMode: KW_RUNNING | KW_FINAL; - -nullTreatment: KW_IGNORE KW_NULLS | KW_RESPECT KW_NULLS; - -string: - STRING # basicStringLiteral - | UNICODE_STRING (KW_UESCAPE STRING)? # unicodeStringLiteral; - -timeZoneSpecifier: - KW_TIME KW_ZONE interval # timeZoneInterval - | KW_TIME KW_ZONE string # timeZoneString; - -comparisonOperator: EQ | NEQ | LT | LTE | GT | GTE; - -comparisonQuantifier: KW_ALL | KW_SOME | KW_ANY; - -booleanValue: KW_TRUE | KW_FALSE; - -interval: - KW_INTERVAL sign = (PLUS | MINUS)? string from = intervalField ( - KW_TO to = intervalField - )?; - -intervalField: KW_YEAR | KW_MONTH | KW_DAY | KW_HOUR | KW_MINUTE | KW_SECOND; - -normalForm: KW_NFD | KW_NFC | KW_NFKD | KW_NFKC; - -type: - KW_ROW '(' rowField (',' rowField)* ')' # rowType - | KW_INTERVAL from = intervalField (KW_TO to = intervalField)? # intervalType - | base = KW_TIMESTAMP ('(' precision = typeParameter ')')? ( - KW_WITHOUT KW_TIME KW_ZONE - )? # dateTimeType - | base = KW_TIMESTAMP ('(' precision = typeParameter ')')? KW_WITH KW_TIME KW_ZONE # dateTimeType - | base = KW_TIME ('(' precision = typeParameter ')')? ( - KW_WITHOUT KW_TIME KW_ZONE - )? # dateTimeType - | base = KW_TIME ('(' precision = typeParameter ')')? KW_WITH KW_TIME KW_ZONE # dateTimeType - | KW_DOUBLE KW_PRECISION # doublePrecisionType - | KW_ARRAY '<' type '>' # legacyArrayType - | KW_MAP '<' keyType = type ',' valueType = type '>' # legacyMapType - | type KW_ARRAY ('[' INTEGER_VALUE ']')? # arrayType - | identifier ('(' typeParameter (',' typeParameter)* ')')? # genericType; - -rowField: type | identifier type; - -typeParameter: INTEGER_VALUE | type; - -whenClause: - KW_WHEN condition = expression KW_THEN result = expression; - -filter: KW_FILTER '(' KW_WHERE booleanExpression ')'; - -mergeCase: - KW_WHEN KW_MATCHED (KW_AND condition = expression)? KW_THEN KW_UPDATE KW_SET targets += identifier EQ values += - expression ( - ',' targets += identifier EQ values += expression - )* # mergeUpdate - | KW_WHEN KW_MATCHED (KW_AND condition = expression)? KW_THEN KW_DELETE # mergeDelete - | KW_WHEN KW_NOT KW_MATCHED (KW_AND condition = expression)? KW_THEN KW_INSERT ( - '(' targets += identifier (',' targets += identifier)* ')' - )? KW_VALUES '(' values += expression (',' values += expression)* ')' # mergeInsert; - -over: - KW_OVER (windowName = identifier | '(' windowSpecification ')'); - -windowFrame: ( - KW_MEASURES measureDefinition (',' measureDefinition)* - )? frameExtent (KW_AFTER KW_MATCH skipTo)? (KW_INITIAL | KW_SEEK)? ( - KW_PATTERN '(' rowPattern ')' - )? (KW_SUBSET subsetDefinition (',' subsetDefinition)*)? ( - KW_DEFINE variableDefinition (',' variableDefinition)* - )?; - -frameExtent: - frameType = KW_RANGE frameStart = frameBound - | frameType = KW_ROWS frameStart = frameBound - | frameType = KW_GROUPS frameStart = frameBound - | frameType = KW_RANGE KW_BETWEEN frameStart = frameBound KW_AND end = frameBound - | frameType = KW_ROWS KW_BETWEEN frameStart = frameBound KW_AND end = frameBound - | frameType = KW_GROUPS KW_BETWEEN frameStart = frameBound KW_AND end = frameBound; - -frameBound: - KW_UNBOUNDED boundType = KW_PRECEDING # unboundedFrame - | KW_UNBOUNDED boundType = KW_FOLLOWING # unboundedFrame - | KW_CURRENT KW_ROW # currentRowBound - | expression boundType = (KW_PRECEDING | KW_FOLLOWING) # boundedFrame; - -rowPattern: - patternPrimary patternQuantifier? # quantifiedPrimary - | rowPattern rowPattern # patternConcatenation - | rowPattern '|' rowPattern # patternAlternation; - -patternPrimary: - identifier # patternVariable - | '(' ')' # emptyPattern - | KW_PERMUTE '(' rowPattern (',' rowPattern)* ')' # patternPermutation - | '(' rowPattern ')' # groupedPattern - | '^' # partitionStartAnchor - | '$' # partitionEndAnchor - | '{-' rowPattern '-}' # excludedPattern; - -patternQuantifier: - ASTERISK (reluctant = QUESTION_MARK)? # zeroOrMoreQuantifier - | PLUS (reluctant = QUESTION_MARK)? # oneOrMoreQuantifier - | QUESTION_MARK (reluctant = QUESTION_MARK)? # zeroOrOneQuantifier - | '{' exactly = INTEGER_VALUE '}' (reluctant = QUESTION_MARK)? # rangeQuantifier - | '{' (atLeast = INTEGER_VALUE)? ',' (atMost = INTEGER_VALUE)? '}' ( - reluctant = QUESTION_MARK - )? # rangeQuantifier; - -updateAssignment: identifier EQ expression; - -explainOption: - KW_FORMAT value = (KW_TEXT | KW_GRAPHVIZ | KW_JSON) # explainFormat - | KW_TYPE value = (KW_LOGICAL | KW_DISTRIBUTED | KW_VALIDATE | KW_IO) # explainType; - -transactionMode: - KW_ISOLATION KW_LEVEL levelOfIsolation # isolationLevel - | KW_READ accessMode = (KW_ONLY | KW_WRITE) # transactionAccessMode; - -levelOfIsolation: - KW_READ KW_UNCOMMITTED # readUncommitted - | KW_READ KW_COMMITTED # readCommitted - | KW_REPEATABLE KW_READ # repeatableRead - | KW_SERIALIZABLE # serializable; - -callArgument: - expression # positionalArgument - | identifier '=>' expression # namedArgument; - -pathElement: - identifier '.' identifier # qualifiedArgument - | identifier # unqualifiedArgument; - -pathSpecification: pathElement (',' pathElement)*; - -privilege: KW_SELECT | KW_DELETE | KW_INSERT | KW_UPDATE; - -tableOrViewName - : tableName - | viewName; - -tableName: tablePath; - -tableNameCreate: tablePath; - -viewName: viewPath; - -viewNameCreate: viewPath; - -tablePath - : table = identifier - | schema = identifier '.' table = identifier - | catalog = identifier '.' schema = identifier '.' table = identifier - ; - -viewPath - : view = identifier - | schema = identifier '.' view = identifier - | catalog = identifier '.' schema = identifier '.' view = identifier - ; - -schemaName: schemaPath; - -schemaNameCreate: schemaPath; - -schemaPath - : schema = identifier - | catalog = identifier '.' schema = identifier - ; - -catalogName: catalog = identifier; - -catalogNameCreate: catalog = identifier; - -functionName: qualifiedName; - -columnName: qualifiedName ; - -columnNameCreate: identifier; - -qualifiedName: identifier ('.' identifier)*; - -grantor: - principal # specifiedPrincipal - | KW_CURRENT_USER # currentUserGrantor - | KW_CURRENT_ROLE # currentRoleGrantor; - -principal: - identifier # unspecifiedPrincipal - | KW_USER identifier # userPrincipal - | KW_ROLE identifier # rolePrincipal; - -roles: identifier (',' identifier)*; - -identifier - : IDENTIFIER #unquotedIdentifier - | QUOTED_IDENTIFIER #quotedIdentifier - | nonReserved #unquotedIdentifier - | BACKQUOTED_IDENTIFIER #backQuotedIdentifier - | DIGIT_IDENTIFIER #digitIdentifier +program + : statements* EOF ; -number: - MINUS? DECIMAL_VALUE # decimalLiteral - | MINUS? DOUBLE_VALUE # doubleLiteral - | MINUS? INTEGER_VALUE # integerLiteral; +statements + : singleStatement + | standaloneExpression + | standalonePathSpecification + | standaloneType + | standaloneRowPattern + ; + +singleStatement + : statement SEMICOLON? + ; + +standaloneExpression + : expression SEMICOLON? + ; + +standalonePathSpecification + : pathSpecification SEMICOLON? + ; + +standaloneType + : type SEMICOLON? + ; + +standaloneRowPattern + : rowPattern SEMICOLON? + ; + +statement + : query # statementDefault + | KW_USE schemaName # use + | KW_CREATE KW_SCHEMA (KW_IF KW_NOT KW_EXISTS)? schemaNameCreate (KW_AUTHORIZATION principal)? ( + KW_WITH properties + )? # createSchema + | KW_DROP KW_SCHEMA (KW_IF KW_EXISTS)? schemaName (KW_CASCADE | KW_RESTRICT)? # dropSchema + | KW_ALTER KW_SCHEMA schemaName KW_RENAME KW_TO schemaNameCreate # renameSchema + | KW_ALTER KW_SCHEMA schemaName KW_SET KW_AUTHORIZATION principal # setSchemaAuthorization + | KW_CREATE KW_TABLE (KW_IF KW_NOT KW_EXISTS)? tableNameCreate columnListCreate? ( + KW_COMMENT string + )? (KW_WITH properties)? KW_AS (query | '(' query ')') (KW_WITH (KW_NO)? KW_DATA)? # createTableAsSelect + | KW_CREATE KW_TABLE (KW_IF KW_NOT KW_EXISTS)? tableNameCreate '(' tableElement ( + ',' tableElement + )* ')' (KW_COMMENT string)? (KW_WITH properties)? # createTable + | KW_DROP KW_TABLE (KW_IF KW_EXISTS)? tableName # dropTable + | KW_INSERT KW_INTO tableName columnList? query # insertInto + | KW_DELETE KW_FROM tableName (KW_WHERE booleanExpression)? # delete + | KW_TRUNCATE KW_TABLE tableName # truncateTable + | KW_ALTER KW_TABLE (KW_IF KW_EXISTS)? from= tableName KW_RENAME KW_TO to= tableNameCreate # renameTable + | KW_COMMENT KW_ON KW_TABLE tableName KW_IS (string | KW_NULL) # commentTable + | KW_COMMENT KW_ON KW_COLUMN columnName KW_IS (string | KW_NULL) # commentColumn + | KW_ALTER KW_TABLE (KW_IF KW_EXISTS)? tableName KW_RENAME KW_COLUMN (KW_IF KW_EXISTS)? from= columnName KW_TO to= columnNameCreate # renameColumn + | KW_ALTER KW_TABLE (KW_IF KW_EXISTS)? tableName KW_DROP KW_COLUMN (KW_IF KW_EXISTS)? column= columnName # dropColumn + | KW_ALTER KW_TABLE (KW_IF KW_EXISTS)? tableName KW_ADD KW_COLUMN (KW_IF KW_NOT KW_EXISTS)? column= columnDefinition # addColumn + | KW_ALTER KW_TABLE tableName KW_SET KW_AUTHORIZATION principal # setTableAuthorization + | KW_ALTER KW_TABLE tableName KW_SET KW_PROPERTIES propertyAssignments # setTableProperties + | KW_ALTER KW_TABLE tableName KW_EXECUTE procedureName= identifier ( + '(' (callArgument (',' callArgument)*)? ')' + )? (KW_WHERE where= booleanExpression)? # tableExecute + | KW_ANALYZE tableName (KW_WITH properties)? # analyze + | KW_CREATE (KW_OR KW_REPLACE)? KW_MATERIALIZED KW_VIEW (KW_IF KW_NOT KW_EXISTS)? viewNameCreate ( + KW_COMMENT string + )? (KW_WITH properties)? KW_AS query # createMaterializedView + | KW_CREATE (KW_OR KW_REPLACE)? KW_VIEW viewNameCreate (KW_COMMENT string)? ( + KW_SECURITY (KW_DEFINER | KW_INVOKER) + )? KW_AS query # createView + | KW_REFRESH KW_MATERIALIZED KW_VIEW viewName # refreshMaterializedView + | KW_DROP KW_MATERIALIZED KW_VIEW (KW_IF KW_EXISTS)? viewName # dropMaterializedView + | KW_ALTER KW_MATERIALIZED KW_VIEW (KW_IF KW_EXISTS)? from= viewName KW_RENAME KW_TO to= viewNameCreate # renameMaterializedView + | KW_ALTER KW_MATERIALIZED KW_VIEW viewName KW_SET KW_PROPERTIES propertyAssignments # setMaterializedViewProperties + | KW_DROP KW_VIEW (KW_IF KW_EXISTS)? viewName # dropView + | KW_ALTER KW_VIEW from= viewName KW_RENAME KW_TO to= viewNameCreate # renameView + | KW_ALTER KW_VIEW from= viewName KW_SET KW_AUTHORIZATION principal # setViewAuthorization + | KW_CALL functionName '(' (callArgument (',' callArgument)*)? ')' # call + | KW_CREATE KW_ROLE name= identifier (KW_WITH KW_ADMIN grantor)? (KW_IN catalogName)? # createRole + | KW_DROP KW_ROLE name= identifier # dropRole + | KW_GRANT roles KW_TO principal (',' principal)* (KW_WITH KW_ADMIN KW_OPTION)? ( + KW_GRANTED KW_BY grantor + )? (KW_IN catalogName)? # grantRoles + | KW_REVOKE (KW_ADMIN KW_OPTION KW_FOR)? roles KW_FROM principal (',' principal)* ( + KW_GRANTED KW_BY grantor + )? (KW_IN catalogName)? # revokeRoles + | KW_SET KW_ROLE (KW_ALL | KW_NONE | role= identifier) (KW_IN catalogName)? # setRole + | KW_GRANT (privilege (',' privilege)* | KW_ALL KW_PRIVILEGES) KW_ON ( + KW_SCHEMA? schemaName + | KW_TABLE? tableName + )? KW_TO grantee= principal (KW_WITH KW_GRANT KW_OPTION)? # grant + | KW_DENY (privilege (',' privilege)* | KW_ALL KW_PRIVILEGES) KW_ON ( + KW_SCHEMA? schemaName + | KW_TABLE? tableName + ) KW_TO grantee= principal # deny + | KW_REVOKE (KW_GRANT KW_OPTION KW_FOR)? (privilege (',' privilege)* | KW_ALL KW_PRIVILEGES) KW_ON ( + KW_SCHEMA? schemaName + | KW_TABLE? tableName + )? KW_FROM grantee= principal # revoke + | KW_SHOW KW_GRANTS (KW_ON KW_TABLE? tableName)? # showGrants + | KW_EXPLAIN KW_ANALYZE? KW_VERBOSE? ('(' explainOption (',' explainOption)* ')')? statement # explain + | KW_SHOW KW_CREATE KW_TABLE tableName # showCreateTable + | KW_SHOW KW_CREATE KW_SCHEMA schemaName # showCreateSchema + | KW_SHOW KW_CREATE KW_VIEW viewName # showCreateView + | KW_SHOW KW_CREATE KW_MATERIALIZED KW_VIEW viewName # showCreateMaterializedView + | KW_SHOW KW_TABLES ((KW_FROM | KW_IN) schemaName)? ( + KW_LIKE pattern= string (KW_ESCAPE escape= string)? + )? # showTables + | KW_SHOW KW_SCHEMAS ((KW_FROM | KW_IN) catalogName)? ( + KW_LIKE pattern= string (KW_ESCAPE escape= string)? + )? # showSchemas + | KW_SHOW KW_CATALOGS (KW_LIKE pattern= string (KW_ESCAPE escape= string)?)? # showCatalogs + | KW_SHOW KW_COLUMNS (KW_FROM | KW_IN) tableOrViewName? ( + KW_LIKE pattern= string (KW_ESCAPE escape= string)? + )? # showColumns + | KW_SHOW KW_STATS KW_FOR tableName # showStats + | KW_SHOW KW_STATS KW_FOR '(' query ')' # showStatsForQuery + | KW_SHOW KW_CURRENT? KW_ROLES ((KW_FROM | KW_IN) identifier)? # showRoles + | KW_SHOW KW_ROLE KW_GRANTS ((KW_FROM | KW_IN) identifier)? # showRoleGrants + | KW_DESCRIBE tableOrViewName # showColumns + | KW_DESC tableOrViewName # showColumns + | KW_SHOW KW_FUNCTIONS (KW_LIKE pattern= string (KW_ESCAPE escape= string)?)? # showFunctions + | KW_SHOW KW_SESSION (KW_LIKE pattern= string (KW_ESCAPE escape= string)?)? # showSession + | KW_SET KW_SESSION qualifiedName EQ expression # setSession + | KW_RESET KW_SESSION qualifiedName # resetSession + | KW_START KW_TRANSACTION (transactionMode (',' transactionMode)*)? # startTransaction + | KW_COMMIT KW_WORK? # commit + | KW_ROLLBACK KW_WORK? # rollback + | KW_PREPARE identifier KW_FROM statement # prepare + | KW_DEALLOCATE KW_PREPARE identifier # deallocate + | KW_EXECUTE identifier (KW_USING expression (',' expression)*)? # execute + | KW_DESCRIBE KW_INPUT identifier # describeInput + | KW_DESCRIBE KW_OUTPUT identifier # describeOutput + | KW_SET KW_PATH pathSpecification # setPath + | KW_SET KW_TIME KW_ZONE (KW_LOCAL | expression) # setTimeZone + | KW_UPDATE tableName KW_SET updateAssignment (',' updateAssignment)* ( + KW_WHERE where= booleanExpression + )? # update + | KW_MERGE KW_INTO tableName (KW_AS? identifier)? KW_USING relation KW_ON expression mergeCase+ # merge + | KW_SHOW KW_COMMENT KW_ON KW_TABLE tableName # showTableComment + | KW_SHOW KW_COMMENT KW_ON KW_COLUMN columnName # showColumnComment + ; + +query + : with? queryNoWith + ; + +with + : KW_WITH KW_RECURSIVE? namedQuery (',' namedQuery)* + ; + +tableElement + : columnDefinition + | likeClause + ; + +columnDefinition + : columnNameCreate type (KW_NOT KW_NULL)? (KW_COMMENT string)? (KW_WITH properties)? + ; + +likeClause + : KW_LIKE tableName (optionType= (KW_INCLUDING | KW_EXCLUDING) KW_PROPERTIES)? + ; + +properties + : '(' propertyAssignments ')' + ; + +propertyAssignments + : property (',' property)* + ; + +property + : identifier EQ propertyValue + ; + +propertyValue + : KW_DEFAULT # defaultPropertyValue + | expression # nonDefaultPropertyValue + ; + +queryNoWith + : queryTerm (KW_ORDER KW_BY sortItem (',' sortItem)*)? ( + KW_OFFSET offset= rowCount (KW_ROW | KW_ROWS)? + )? ( + (KW_LIMIT limit= limitRowCount) + | ( + KW_FETCH (KW_FIRST | KW_NEXT) (fetchFirst= rowCount)? (KW_ROW | KW_ROWS) ( + KW_ONLY + | KW_WITH KW_TIES + ) + ) + )? + ; + +limitRowCount + : KW_ALL + | rowCount + ; + +rowCount + : INTEGER_VALUE + | QUESTION_MARK + ; + +queryTerm + : queryPrimary # queryTermDefault + | left= queryTerm operator= KW_INTERSECT setQuantifier? right= queryTerm # setOperation + | left= queryTerm operator= (KW_UNION | KW_EXCEPT) setQuantifier? right= queryTerm # setOperation + ; + +queryPrimary + : querySpecification # queryPrimaryDefault + | KW_TABLE tableName # table + | KW_VALUES expression (',' expression)* # inlineTable + | '(' queryNoWith ')' # subquery + ; + +sortItem + : (columnName | expression) ordering= (KW_ASC | KW_DESC)? ( + KW_NULLS nullOrdering= (KW_FIRST | KW_LAST) + )? + ; + +querySpecification + : KW_SELECT setQuantifier? selectItem (',' selectItem)* (KW_FROM relation (',' relation)*)? ( + KW_WHERE where= booleanExpression + )? (KW_GROUP KW_BY groupBy)? (KW_HAVING having= booleanExpression)? ( + KW_WINDOW windowDefinition (',' windowDefinition)* + )? + ; + +groupBy + : setQuantifier? groupingElement (',' groupingElement)* + ; + +groupingElement + : groupingSet # singleGroupingSet + | KW_ROLLUP '(' (groupingTerm (',' groupingTerm)*)? ')' # rollup + | KW_CUBE '(' (groupingTerm (',' groupingTerm)*)? ')' # cube + | KW_GROUPING KW_SETS '(' groupingSet (',' groupingSet)* ')' # multipleGroupingSets + ; + +groupingSet + : '(' (groupingTerm (',' groupingTerm)*)? ')' + | groupingTerm + ; + +groupingTerm + : columnName + | expression + ; + +windowDefinition + : name= identifier KW_AS '(' windowSpecification ')' + ; + +windowSpecification + : (existingWindowName= identifier)? ( + KW_PARTITION KW_BY partition+= expression (',' partition+= expression)* + )? (KW_ORDER KW_BY sortItem (',' sortItem)*)? windowFrame? + ; + +namedQuery + : name= identifier (columnAliases)? KW_AS '(' query ')' + ; + +setQuantifier + : KW_DISTINCT + | KW_ALL + ; + +selectItem + : (columnName | expression) (KW_AS? identifier)? # selectSingle + | primaryExpression '.' ASTERISK (KW_AS columnAliases)? # selectAll + | ASTERISK # selectAll + ; + +relation + : left= relation ( + KW_CROSS KW_JOIN right= sampledRelation + | joinType KW_JOIN rightRelation= relation joinCriteria + | KW_NATURAL joinType KW_JOIN right= sampledRelation + ) # joinRelation + | sampledRelation # relationDefault + ; + +joinType + : KW_INNER? + | KW_LEFT KW_OUTER? + | KW_RIGHT KW_OUTER? + | KW_FULL KW_OUTER? + ; + +joinCriteria + : KW_ON booleanExpression + | KW_USING '(' identifier (',' identifier)* ')' + ; + +sampledRelation + : patternRecognition (KW_TABLESAMPLE sampleType '(' percentage= expression ')')? + ; + +sampleType + : KW_BERNOULLI + | KW_SYSTEM + ; + +patternRecognition + : aliasedRelation ( + KW_MATCH_RECOGNIZE '(' ( + KW_PARTITION KW_BY partition+= expression (',' partition+= expression)* + )? (KW_ORDER KW_BY sortItem (',' sortItem)*)? ( + KW_MEASURES measureDefinition (',' measureDefinition)* + )? rowsPerMatch? (KW_AFTER KW_MATCH skipTo)? (KW_INITIAL | KW_SEEK)? KW_PATTERN '(' rowPattern ')' ( + KW_SUBSET subsetDefinition (',' subsetDefinition)* + )? KW_DEFINE variableDefinition (',' variableDefinition)* ')' ( + KW_AS? identifier columnAliases? + )? + )? + ; + +measureDefinition + : expression KW_AS identifier + ; + +rowsPerMatch + : KW_ONE KW_ROW KW_PER KW_MATCH + | KW_ALL KW_ROWS KW_PER KW_MATCH emptyMatchHandling? + ; + +emptyMatchHandling + : KW_SHOW KW_EMPTY KW_MATCHES + | KW_OMIT KW_EMPTY KW_MATCHES + | KW_WITH KW_UNMATCHED KW_ROWS + ; + +skipTo + : 'SKIP' KW_TO KW_NEXT KW_ROW + | 'SKIP' KW_PAST KW_LAST KW_ROW + | 'SKIP' KW_TO KW_FIRST identifier + | 'SKIP' KW_TO KW_LAST identifier + | 'SKIP' KW_TO identifier + ; + +subsetDefinition + : name= identifier EQ '(' union+= identifier (',' union+= identifier)* ')' + ; + +variableDefinition + : identifier KW_AS expression + ; + +aliasedRelation + : relationPrimary (KW_AS? identifier columnAliases?)? + ; + +columnListCreate + : '(' columnNameCreate (',' columnNameCreate)* ')' + ; + +columnList + : '(' columnName (',' columnName)* ')' + ; + +columnAliases + : '(' identifier (',' identifier)* ')' + ; + +relationPrimary + : tableOrViewName # tableOrViewRelation + | '(' query ')' # subqueryRelation + | KW_UNNEST '(' expression (',' expression)* ')' (KW_WITH KW_ORDINALITY)? # unnest + | KW_LATERAL '(' query ')' # lateral + | '(' relation ')' # parenthesizedRelation + ; + +expression + : booleanExpression + ; + +booleanExpression + : valueExpression predicate[$valueExpression.ctx]? # predicated + | KW_NOT booleanExpression # logicalNot + | left= booleanExpression operator= KW_AND right= booleanExpression # logicalBinary + | left= booleanExpression operator= KW_OR right= booleanExpression # logicalBinary + ; + +// workaround for https://github.com/antlr/antlr4/issues/780 +predicate[ParserRuleContext value] + : comparisonOperator right= valueExpression # comparison + | comparisonOperator comparisonQuantifier '(' query ')' # quantifiedComparison + | KW_NOT? KW_BETWEEN lower= valueExpression KW_AND upper= valueExpression # between + | KW_NOT? KW_IN '(' expression (',' expression)* ')' # inList + | KW_NOT? KW_IN '(' query ')' # inSubquery + | KW_NOT? KW_LIKE pattern= valueExpression (KW_ESCAPE escape= valueExpression)? # like + | KW_IS KW_NOT? KW_NULL # nullPredicate + | KW_IS KW_NOT? KW_DISTINCT KW_FROM right= valueExpression # distinctFrom + ; + +valueExpression + : primaryExpression # valueExpressionDefault + | valueExpression KW_AT timeZoneSpecifier # atTimeZone + | operator= (MINUS | PLUS) valueExpression # arithmeticUnary + | left= valueExpression operator= (ASTERISK | SLASH | PERCENT) right= valueExpression # arithmeticBinary + | left= valueExpression operator= (PLUS | MINUS) right= valueExpression # arithmeticBinary + | left= valueExpression CONCAT right= valueExpression # concatenation + ; + +primaryExpression + : KW_NULL # nullLiteral + | interval # intervalLiteral + | identifier string # typeConstructor + | KW_DOUBLE KW_PRECISION string # typeConstructor + | number # numericLiteral + | booleanValue # booleanLiteral + | string # stringLiteral + | BINARY_LITERAL # binaryLiteral + | QUESTION_MARK # parameter + | KW_POSITION '(' valueExpression KW_IN valueExpression ')' # position + | '(' expression (',' expression)+ ')' # rowConstructor + | KW_ROW '(' expression (',' expression)* ')' # rowConstructor + | functionName '(' ASTERISK ')' filter? over? # functionCall + | processingMode? functionName '(' (setQuantifier? expression (',' expression)*)? ( + KW_ORDER KW_BY sortItem (',' sortItem)* + )? ')' filter? (nullTreatment? over)? # functionCall + | identifier over # measure + | identifier '->' expression # lambda + | '(' (identifier (',' identifier)*)? ')' '->' expression # lambda + | '(' query ')' # subqueryExpression + // This is an extension to ANSI SQL, which considers KW_EXISTS to be a + | KW_EXISTS '(' query ')' # exists + | KW_CASE operand= expression whenClause+ (KW_ELSE elseExpression= expression)? KW_END # simpleCase + | KW_CASE whenClause+ (KW_ELSE elseExpression= expression)? KW_END # searchedCase + | KW_CAST '(' expression KW_AS type ')' # cast + | KW_TRY_CAST '(' expression KW_AS type ')' # cast + | KW_ARRAY '[' (expression (',' expression)*)? ']' # arrayConstructor + | value= primaryExpression '[' index= valueExpression ']' # subscript + | identifier # columnReference + | base= primaryExpression '.' fieldName= identifier # dereference + | name= KW_CURRENT_DATE # specialDateTimeFunction + | name= KW_CURRENT_TIME ('(' precision= INTEGER_VALUE ')')? # specialDateTimeFunction + | name= KW_CURRENT_TIMESTAMP ('(' precision= INTEGER_VALUE ')')? # specialDateTimeFunction + | name= KW_LOCALTIME ('(' precision= INTEGER_VALUE ')')? # specialDateTimeFunction + | name= KW_LOCALTIMESTAMP ('(' precision= INTEGER_VALUE ')')? # specialDateTimeFunction + | name= KW_CURRENT_USER # currentUser + | name= KW_CURRENT_CATALOG # currentCatalog + | name= KW_CURRENT_SCHEMA # currentSchema + | name= KW_CURRENT_PATH # currentPath + | KW_SUBSTRING '(' valueExpression KW_FROM valueExpression (KW_FOR valueExpression)? ')' # substring + | KW_NORMALIZE '(' valueExpression (',' normalForm)? ')' # normalize + | KW_EXTRACT '(' identifier KW_FROM valueExpression ')' # extract + | '(' expression ')' # parenthesizedExpression + | KW_GROUPING '(' (qualifiedName (',' qualifiedName)*)? ')' # groupingOperation + ; + +processingMode + : KW_RUNNING + | KW_FINAL + ; + +nullTreatment + : KW_IGNORE KW_NULLS + | KW_RESPECT KW_NULLS + ; + +string + : STRING # basicStringLiteral + | UNICODE_STRING (KW_UESCAPE STRING)? # unicodeStringLiteral + ; + +timeZoneSpecifier + : KW_TIME KW_ZONE interval # timeZoneInterval + | KW_TIME KW_ZONE string # timeZoneString + ; + +comparisonOperator + : EQ + | NEQ + | LT + | LTE + | GT + | GTE + ; + +comparisonQuantifier + : KW_ALL + | KW_SOME + | KW_ANY + ; + +booleanValue + : KW_TRUE + | KW_FALSE + ; + +interval + : KW_INTERVAL sign= (PLUS | MINUS)? string from= intervalField (KW_TO to= intervalField)? + ; + +intervalField + : KW_YEAR + | KW_MONTH + | KW_DAY + | KW_HOUR + | KW_MINUTE + | KW_SECOND + ; + +normalForm + : KW_NFD + | KW_NFC + | KW_NFKD + | KW_NFKC + ; + +type + : KW_ROW '(' rowField (',' rowField)* ')' # rowType + | KW_INTERVAL from= intervalField (KW_TO to= intervalField)? # intervalType + | base= KW_TIMESTAMP ('(' precision= typeParameter ')')? (KW_WITHOUT KW_TIME KW_ZONE)? # dateTimeType + | base= KW_TIMESTAMP ('(' precision= typeParameter ')')? KW_WITH KW_TIME KW_ZONE # dateTimeType + | base= KW_TIME ('(' precision= typeParameter ')')? (KW_WITHOUT KW_TIME KW_ZONE)? # dateTimeType + | base= KW_TIME ('(' precision= typeParameter ')')? KW_WITH KW_TIME KW_ZONE # dateTimeType + | KW_DOUBLE KW_PRECISION # doublePrecisionType + | KW_ARRAY '<' type '>' # legacyArrayType + | KW_MAP '<' keyType= type ',' valueType= type '>' # legacyMapType + | type KW_ARRAY ('[' INTEGER_VALUE ']')? # arrayType + | identifier ('(' typeParameter (',' typeParameter)* ')')? # genericType + ; + +rowField + : type + | identifier type + ; + +typeParameter + : INTEGER_VALUE + | type + ; + +whenClause + : KW_WHEN condition= expression KW_THEN result= expression + ; + +filter + : KW_FILTER '(' KW_WHERE booleanExpression ')' + ; + +mergeCase + : KW_WHEN KW_MATCHED (KW_AND condition= expression)? KW_THEN KW_UPDATE KW_SET targets+= identifier EQ values+= expression ( + ',' targets+= identifier EQ values+= expression + )* # mergeUpdate + | KW_WHEN KW_MATCHED (KW_AND condition= expression)? KW_THEN KW_DELETE # mergeDelete + | KW_WHEN KW_NOT KW_MATCHED (KW_AND condition= expression)? KW_THEN KW_INSERT ( + '(' targets+= identifier (',' targets+= identifier)* ')' + )? KW_VALUES '(' values+= expression (',' values+= expression)* ')' # mergeInsert + ; + +over + : KW_OVER (windowName= identifier | '(' windowSpecification ')') + ; + +windowFrame + : (KW_MEASURES measureDefinition (',' measureDefinition)*)? frameExtent ( + KW_AFTER KW_MATCH skipTo + )? (KW_INITIAL | KW_SEEK)? (KW_PATTERN '(' rowPattern ')')? ( + KW_SUBSET subsetDefinition (',' subsetDefinition)* + )? (KW_DEFINE variableDefinition (',' variableDefinition)*)? + ; + +frameExtent + : frameType= KW_RANGE frameStart= frameBound + | frameType= KW_ROWS frameStart= frameBound + | frameType= KW_GROUPS frameStart= frameBound + | frameType= KW_RANGE KW_BETWEEN frameStart= frameBound KW_AND end= frameBound + | frameType= KW_ROWS KW_BETWEEN frameStart= frameBound KW_AND end= frameBound + | frameType= KW_GROUPS KW_BETWEEN frameStart= frameBound KW_AND end= frameBound + ; + +frameBound + : KW_UNBOUNDED boundType= KW_PRECEDING # unboundedFrame + | KW_UNBOUNDED boundType= KW_FOLLOWING # unboundedFrame + | KW_CURRENT KW_ROW # currentRowBound + | expression boundType= (KW_PRECEDING | KW_FOLLOWING) # boundedFrame + ; + +rowPattern + : patternPrimary patternQuantifier? # quantifiedPrimary + | rowPattern rowPattern # patternConcatenation + | rowPattern '|' rowPattern # patternAlternation + ; + +patternPrimary + : identifier # patternVariable + | '(' ')' # emptyPattern + | KW_PERMUTE '(' rowPattern (',' rowPattern)* ')' # patternPermutation + | '(' rowPattern ')' # groupedPattern + | '^' # partitionStartAnchor + | '$' # partitionEndAnchor + | '{-' rowPattern '-}' # excludedPattern + ; + +patternQuantifier + : ASTERISK (reluctant= QUESTION_MARK)? # zeroOrMoreQuantifier + | PLUS (reluctant= QUESTION_MARK)? # oneOrMoreQuantifier + | QUESTION_MARK (reluctant= QUESTION_MARK)? # zeroOrOneQuantifier + | '{' exactly= INTEGER_VALUE '}' (reluctant= QUESTION_MARK)? # rangeQuantifier + | '{' (atLeast= INTEGER_VALUE)? ',' (atMost= INTEGER_VALUE)? '}' (reluctant= QUESTION_MARK)? # rangeQuantifier + ; + +updateAssignment + : identifier EQ expression + ; + +explainOption + : KW_FORMAT value= (KW_TEXT | KW_GRAPHVIZ | KW_JSON) # explainFormat + | KW_TYPE value= (KW_LOGICAL | KW_DISTRIBUTED | KW_VALIDATE | KW_IO) # explainType + ; + +transactionMode + : KW_ISOLATION KW_LEVEL levelOfIsolation # isolationLevel + | KW_READ accessMode= (KW_ONLY | KW_WRITE) # transactionAccessMode + ; + +levelOfIsolation + : KW_READ KW_UNCOMMITTED # readUncommitted + | KW_READ KW_COMMITTED # readCommitted + | KW_REPEATABLE KW_READ # repeatableRead + | KW_SERIALIZABLE # serializable + ; + +callArgument + : expression # positionalArgument + | identifier '=>' expression # namedArgument + ; + +pathElement + : identifier '.' identifier # qualifiedArgument + | identifier # unqualifiedArgument + ; + +pathSpecification + : pathElement (',' pathElement)* + ; + +privilege + : KW_SELECT + | KW_DELETE + | KW_INSERT + | KW_UPDATE + ; + +tableOrViewName + : tableName + | viewName + ; + +tableName + : tablePath + ; + +tableNameCreate + : tablePath + ; + +viewName + : viewPath + ; + +viewNameCreate + : viewPath + ; + +tablePath + : table= identifier + | schema= identifier '.' table= identifier + | catalog= identifier '.' schema= identifier '.' table= identifier + ; + +viewPath + : view= identifier + | schema= identifier '.' view= identifier + | catalog= identifier '.' schema= identifier '.' view= identifier + ; + +schemaName + : schemaPath + ; + +schemaNameCreate + : schemaPath + ; + +schemaPath + : schema= identifier + | catalog= identifier '.' schema= identifier + ; + +catalogName + : catalog= identifier + ; + +catalogNameCreate + : catalog= identifier + ; + +functionName + : qualifiedName + ; + +columnName + : qualifiedName + ; + +columnNameCreate + : identifier + ; + +qualifiedName + : identifier ('.' identifier)* + ; + +grantor + : principal # specifiedPrincipal + | KW_CURRENT_USER # currentUserGrantor + | KW_CURRENT_ROLE # currentRoleGrantor + ; + +principal + : identifier # unspecifiedPrincipal + | KW_USER identifier # userPrincipal + | KW_ROLE identifier # rolePrincipal + ; + +roles + : identifier (',' identifier)* + ; + +identifier + : IDENTIFIER # unquotedIdentifier + | QUOTED_IDENTIFIER # quotedIdentifier + | nonReserved # unquotedIdentifier + | BACKQUOTED_IDENTIFIER # backQuotedIdentifier + | DIGIT_IDENTIFIER # digitIdentifier + ; + +number + : MINUS? DECIMAL_VALUE # decimalLiteral + | MINUS? DOUBLE_VALUE # doubleLiteral + | MINUS? INTEGER_VALUE # integerLiteral + ; nonReserved - : KW_ADD - | KW_ADMIN - | KW_AFTER - | KW_ALL - | KW_ANALYZE - | KW_ANY - | KW_ARRAY - | KW_ASC - | KW_AT - | KW_AUTHORIZATION - | KW_BERNOULLI - | KW_CALL - | KW_CASCADE - | KW_CATALOGS - | KW_COLUMN - | KW_COLUMNS - | KW_COMMENT - | KW_COMMIT - | KW_COMMITTED - | KW_CURRENT - | KW_DATA - | KW_DATE - | KW_DAY - | KW_DEFAULT - | KW_DEFINE - | KW_DEFINER - | KW_DESC - | KW_DISTRIBUTED - | KW_DOUBLE - | KW_EMPTY - | KW_EXCLUDING - | KW_EXPLAIN - | KW_FETCH - | KW_FILTER - | KW_FINAL - | KW_FIRST - | KW_FOLLOWING - | KW_FORMAT - | KW_FUNCTIONS - | KW_GRANT - | KW_GRANTED - | KW_GRANTS - | KW_DENY - | KW_GRAPHVIZ - | KW_GROUPS - | KW_HOUR - | KW_IF - | KW_IGNORE - | KW_INCLUDING - | KW_INITIAL - | KW_INPUT - | KW_INTERVAL - | KW_INVOKER - | KW_IO - | KW_ISOLATION - | KW_JSON - | KW_LAST - | KW_LATERAL - | KW_LEVEL - | KW_LIMIT - | KW_LOCAL - | KW_LOGICAL - | KW_MAP - | KW_MATCH - | KW_MATCHED - | KW_MATCHES - | KW_MATCH_RECOGNIZE - | KW_MATERIALIZED - | KW_MEASURES - | KW_MERGE - | KW_MINUTE - | KW_MONTH - | KW_NEXT - | KW_NFC - | KW_NFD - | KW_NFKC - | KW_NFKD - | KW_NO - | KW_NONE - | KW_NULLIF - | KW_NULLS - | KW_OFFSET - | KW_OMIT - | KW_ONE - | KW_ONLY - | KW_OPTION - | KW_ORDINALITY - | KW_OUTPUT - | KW_OVER - | KW_PARTITION - | KW_PARTITIONS - | KW_PAST - | KW_PATH - | KW_PATTERN - | KW_PER - | KW_PERMUTE - | KW_POSITION - | KW_PRECEDING - | KW_PRECISION - | KW_PRIVILEGES - | KW_PROPERTIES - | KW_RANGE - | KW_READ - | KW_REFRESH - | KW_RENAME - | KW_REPEATABLE - | KW_REPLACE - | KW_RESET - | KW_RESPECT - | KW_RESTRICT - | KW_REVOKE - | KW_ROLE - | KW_ROLES - | KW_ROLLBACK - | KW_ROW - | KW_ROWS - | KW_RUNNING - | KW_SCHEMA - | KW_SCHEMAS - | KW_SECOND - | KW_SECURITY - | KW_SEEK - | KW_SERIALIZABLE - | KW_SESSION - | KW_SET - | KW_SETS - | KW_SHOW - | KW_SOME - | KW_START - | KW_STATS - | KW_SUBSET - | KW_SUBSTRING - | KW_SYSTEM - | KW_TABLES - | KW_TABLESAMPLE - | KW_TEXT - | KW_TIES - | KW_TIME - | KW_TIMESTAMP - | KW_TO - | KW_TRANSACTION - | KW_TRUNCATE - | KW_TRY_CAST - | KW_TYPE - | KW_UNBOUNDED - | KW_UNCOMMITTED - | KW_UNMATCHED - | KW_UPDATE - | KW_USE - | KW_USER - | KW_VALIDATE - | KW_VERBOSE - | KW_VIEW - | KW_WINDOW - | KW_WITHOUT - | KW_WORK - | KW_WRITE - | KW_YEAR - | KW_ZONE; + : KW_ADD + | KW_ADMIN + | KW_AFTER + | KW_ALL + | KW_ANALYZE + | KW_ANY + | KW_ARRAY + | KW_ASC + | KW_AT + | KW_AUTHORIZATION + | KW_BERNOULLI + | KW_CALL + | KW_CASCADE + | KW_CATALOGS + | KW_COLUMN + | KW_COLUMNS + | KW_COMMENT + | KW_COMMIT + | KW_COMMITTED + | KW_CURRENT + | KW_DATA + | KW_DATE + | KW_DAY + | KW_DEFAULT + | KW_DEFINE + | KW_DEFINER + | KW_DESC + | KW_DISTRIBUTED + | KW_DOUBLE + | KW_EMPTY + | KW_EXCLUDING + | KW_EXPLAIN + | KW_FETCH + | KW_FILTER + | KW_FINAL + | KW_FIRST + | KW_FOLLOWING + | KW_FORMAT + | KW_FUNCTIONS + | KW_GRANT + | KW_GRANTED + | KW_GRANTS + | KW_DENY + | KW_GRAPHVIZ + | KW_GROUPS + | KW_HOUR + | KW_IF + | KW_IGNORE + | KW_INCLUDING + | KW_INITIAL + | KW_INPUT + | KW_INTERVAL + | KW_INVOKER + | KW_IO + | KW_ISOLATION + | KW_JSON + | KW_LAST + | KW_LATERAL + | KW_LEVEL + | KW_LIMIT + | KW_LOCAL + | KW_LOGICAL + | KW_MAP + | KW_MATCH + | KW_MATCHED + | KW_MATCHES + | KW_MATCH_RECOGNIZE + | KW_MATERIALIZED + | KW_MEASURES + | KW_MERGE + | KW_MINUTE + | KW_MONTH + | KW_NEXT + | KW_NFC + | KW_NFD + | KW_NFKC + | KW_NFKD + | KW_NO + | KW_NONE + | KW_NULLIF + | KW_NULLS + | KW_OFFSET + | KW_OMIT + | KW_ONE + | KW_ONLY + | KW_OPTION + | KW_ORDINALITY + | KW_OUTPUT + | KW_OVER + | KW_PARTITION + | KW_PARTITIONS + | KW_PAST + | KW_PATH + | KW_PATTERN + | KW_PER + | KW_PERMUTE + | KW_POSITION + | KW_PRECEDING + | KW_PRECISION + | KW_PRIVILEGES + | KW_PROPERTIES + | KW_RANGE + | KW_READ + | KW_REFRESH + | KW_RENAME + | KW_REPEATABLE + | KW_REPLACE + | KW_RESET + | KW_RESPECT + | KW_RESTRICT + | KW_REVOKE + | KW_ROLE + | KW_ROLES + | KW_ROLLBACK + | KW_ROW + | KW_ROWS + | KW_RUNNING + | KW_SCHEMA + | KW_SCHEMAS + | KW_SECOND + | KW_SECURITY + | KW_SEEK + | KW_SERIALIZABLE + | KW_SESSION + | KW_SET + | KW_SETS + | KW_SHOW + | KW_SOME + | KW_START + | KW_STATS + | KW_SUBSET + | KW_SUBSTRING + | KW_SYSTEM + | KW_TABLES + | KW_TABLESAMPLE + | KW_TEXT + | KW_TIES + | KW_TIME + | KW_TIMESTAMP + | KW_TO + | KW_TRANSACTION + | KW_TRUNCATE + | KW_TRY_CAST + | KW_TYPE + | KW_UNBOUNDED + | KW_UNCOMMITTED + | KW_UNMATCHED + | KW_UPDATE + | KW_USE + | KW_USER + | KW_VALIDATE + | KW_VERBOSE + | KW_VIEW + | KW_WINDOW + | KW_WITHOUT + | KW_WORK + | KW_WRITE + | KW_YEAR + | KW_ZONE + ; -KW_ADD: 'ADD'; -KW_ADMIN: 'ADMIN'; -KW_AFTER: 'AFTER'; -KW_ALL: 'ALL'; -KW_ALTER: 'ALTER'; -KW_ANALYZE: 'ANALYZE'; -KW_AND: 'AND'; -KW_ANY: 'ANY'; -KW_ARRAY: 'ARRAY'; -KW_AS: 'AS'; -KW_ASC: 'ASC'; -KW_AT: 'AT'; -KW_AUTHORIZATION: 'AUTHORIZATION'; -KW_BERNOULLI: 'BERNOULLI'; -KW_BETWEEN: 'BETWEEN'; -KW_BY: 'BY'; -KW_CALL: 'CALL'; -KW_CASCADE: 'CASCADE'; -KW_CASE: 'CASE'; -KW_CAST: 'CAST'; -KW_CATALOGS: 'CATALOGS'; -KW_COLUMN: 'COLUMN'; -KW_COLUMNS: 'COLUMNS'; -KW_COMMENT: 'COMMENT'; -KW_COMMIT: 'COMMIT'; -KW_COMMITTED: 'COMMITTED'; -KW_CONSTRAINT: 'CONSTRAINT'; -KW_CREATE: 'CREATE'; -KW_CROSS: 'CROSS'; -KW_CUBE: 'CUBE'; -KW_CURRENT: 'CURRENT'; -KW_CURRENT_CATALOG: 'CURRENT_CATALOG'; -KW_CURRENT_DATE: 'CURRENT_DATE'; -KW_CURRENT_PATH: 'CURRENT_PATH'; -KW_CURRENT_ROLE: 'CURRENT_ROLE'; -KW_CURRENT_SCHEMA: 'CURRENT_SCHEMA'; -KW_CURRENT_TIME: 'CURRENT_TIME'; -KW_CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; -KW_CURRENT_USER: 'CURRENT_USER'; -KW_DATA: 'DATA'; -KW_DATE: 'DATE'; -KW_DAY: 'DAY'; -KW_DEFAULT: 'DEFAULT'; -KW_DEALLOCATE: 'DEALLOCATE'; -KW_DEFINER: 'DEFINER'; -KW_DELETE: 'DELETE'; -KW_DESC: 'DESC'; -KW_DESCRIBE: 'DESCRIBE'; -KW_DEFINE: 'DEFINE'; -KW_DISTINCT: 'DISTINCT'; -KW_DISTRIBUTED: 'DISTRIBUTED'; -KW_DOUBLE: 'DOUBLE'; -KW_DROP: 'DROP'; -KW_ELSE: 'ELSE'; -KW_EMPTY: 'EMPTY'; -KW_END: 'END'; -KW_ESCAPE: 'ESCAPE'; -KW_EXCEPT: 'EXCEPT'; -KW_EXCLUDING: 'EXCLUDING'; -KW_EXECUTE: 'EXECUTE'; -KW_EXISTS: 'EXISTS'; -KW_EXPLAIN: 'EXPLAIN'; -KW_EXTRACT: 'EXTRACT'; -KW_FALSE: 'FALSE'; -KW_FETCH: 'FETCH'; -KW_FILTER: 'FILTER'; -KW_FINAL: 'FINAL'; -KW_FIRST: 'FIRST'; -KW_FOLLOWING: 'FOLLOWING'; -KW_FOR: 'FOR'; -KW_FORMAT: 'FORMAT'; -KW_FROM: 'FROM'; -KW_FULL: 'FULL'; -KW_FUNCTIONS: 'FUNCTIONS'; -KW_GRANT: 'GRANT'; -KW_GRANTED: 'GRANTED'; -KW_GRANTS: 'GRANTS'; -KW_DENY: 'DENY'; -KW_GRAPHVIZ: 'GRAPHVIZ'; -KW_GROUP: 'GROUP'; -KW_GROUPING: 'GROUPING'; -KW_GROUPS: 'GROUPS'; -KW_HAVING: 'HAVING'; -KW_HOUR: 'HOUR'; -KW_IF: 'IF'; -KW_IGNORE: 'IGNORE'; -KW_IN: 'IN'; -KW_INCLUDING: 'INCLUDING'; -KW_INITIAL: 'INITIAL'; -KW_INNER: 'INNER'; -KW_INPUT: 'INPUT'; -KW_INSERT: 'INSERT'; -KW_INTERSECT: 'INTERSECT'; -KW_INTERVAL: 'INTERVAL'; -KW_INTO: 'INTO'; -KW_INVOKER: 'INVOKER'; -KW_IO: 'IO'; -KW_IS: 'IS'; -KW_ISOLATION: 'ISOLATION'; -KW_JOIN: 'JOIN'; -KW_JSON: 'JSON'; -KW_LAST: 'LAST'; -KW_LATERAL: 'LATERAL'; -KW_LEFT: 'LEFT'; -KW_LEVEL: 'LEVEL'; -KW_LIKE: 'LIKE'; -KW_LIMIT: 'LIMIT'; -KW_LOCAL: 'LOCAL'; -KW_LOCALTIME: 'LOCALTIME'; -KW_LOCALTIMESTAMP: 'LOCALTIMESTAMP'; -KW_LOGICAL: 'LOGICAL'; -KW_MAP: 'MAP'; -KW_MATCH: 'MATCH'; -KW_MATCHED: 'MATCHED'; -KW_MATCHES: 'MATCHES'; -KW_MATCH_RECOGNIZE: 'MATCH_RECOGNIZE'; -KW_MATERIALIZED: 'MATERIALIZED'; -KW_MEASURES: 'MEASURES'; -KW_MERGE: 'MERGE'; -KW_MINUTE: 'MINUTE'; -KW_MONTH: 'MONTH'; -KW_NATURAL: 'NATURAL'; -KW_NEXT: 'NEXT'; -KW_NFC: 'NFC'; -KW_NFD: 'NFD'; -KW_NFKC: 'NFKC'; -KW_NFKD: 'NFKD'; -KW_NO: 'NO'; -KW_NONE: 'NONE'; -KW_NORMALIZE: 'NORMALIZE'; -KW_NOT: 'NOT'; -KW_NULL: 'NULL'; -KW_NULLIF: 'NULLIF'; -KW_NULLS: 'NULLS'; -KW_OFFSET: 'OFFSET'; -KW_OMIT: 'OMIT'; -KW_ON: 'ON'; -KW_ONE: 'ONE'; -KW_ONLY: 'ONLY'; -KW_OPTION: 'OPTION'; -KW_OR: 'OR'; -KW_ORDER: 'ORDER'; -KW_ORDINALITY: 'ORDINALITY'; -KW_OUTER: 'OUTER'; -KW_OUTPUT: 'OUTPUT'; -KW_OVER: 'OVER'; -KW_PARTITION: 'PARTITION'; -KW_PARTITIONS: 'PARTITIONS'; -KW_PAST: 'PAST'; -KW_PATH: 'PATH'; -KW_PATTERN: 'PATTERN'; -KW_PER: 'PER'; -KW_PERMUTE: 'PERMUTE'; -KW_POSITION: 'POSITION'; -KW_PRECEDING: 'PRECEDING'; -KW_PRECISION: 'PRECISION'; -KW_PREPARE: 'PREPARE'; -KW_PRIVILEGES: 'PRIVILEGES'; -KW_PROPERTIES: 'PROPERTIES'; -KW_RANGE: 'RANGE'; -KW_READ: 'READ'; -KW_RECURSIVE: 'RECURSIVE'; -KW_REFRESH: 'REFRESH'; -KW_RENAME: 'RENAME'; -KW_REPEATABLE: 'REPEATABLE'; -KW_REPLACE: 'REPLACE'; -KW_RESET: 'RESET'; -KW_RESPECT: 'RESPECT'; -KW_RESTRICT: 'RESTRICT'; -KW_REVOKE: 'REVOKE'; -KW_RIGHT: 'RIGHT'; -KW_ROLE: 'ROLE'; -KW_ROLES: 'ROLES'; -KW_ROLLBACK: 'ROLLBACK'; -KW_ROLLUP: 'ROLLUP'; -KW_ROW: 'ROW'; -KW_ROWS: 'ROWS'; -KW_RUNNING: 'RUNNING'; -KW_SCHEMA: 'SCHEMA'; -KW_SCHEMAS: 'SCHEMAS'; -KW_SECOND: 'SECOND'; -KW_SECURITY: 'SECURITY'; -KW_SEEK: 'SEEK'; -KW_SELECT: 'SELECT'; -KW_SERIALIZABLE: 'SERIALIZABLE'; -KW_SESSION: 'SESSION'; -KW_SET: 'SET'; -KW_SETS: 'SETS'; -KW_SHOW: 'SHOW'; -KW_SOME: 'SOME'; -KW_START: 'START'; -KW_STATS: 'STATS'; -KW_SUBSET: 'SUBSET'; -KW_SUBSTRING: 'SUBSTRING'; -KW_SYSTEM: 'SYSTEM'; -KW_TABLE: 'TABLE'; -KW_TABLES: 'TABLES'; -KW_TABLESAMPLE: 'TABLESAMPLE'; -KW_TEXT: 'TEXT'; -KW_THEN: 'THEN'; -KW_TIES: 'TIES'; -KW_TIME: 'TIME'; -KW_TIMESTAMP: 'TIMESTAMP'; -KW_TO: 'TO'; -KW_TRANSACTION: 'TRANSACTION'; -KW_TRUNCATE: 'TRUNCATE'; -KW_TRUE: 'TRUE'; -KW_TRY_CAST: 'TRY_CAST'; -KW_TYPE: 'TYPE'; -KW_UESCAPE: 'UESCAPE'; -KW_UNBOUNDED: 'UNBOUNDED'; -KW_UNCOMMITTED: 'UNCOMMITTED'; -KW_UNION: 'UNION'; -KW_UNMATCHED: 'UNMATCHED'; -KW_UNNEST: 'UNNEST'; -KW_UPDATE: 'UPDATE'; -KW_USE: 'USE'; -KW_USER: 'USER'; -KW_USING: 'USING'; -KW_VALIDATE: 'VALIDATE'; -KW_VALUES: 'VALUES'; -KW_VERBOSE: 'VERBOSE'; -KW_VIEW: 'VIEW'; -KW_WHEN: 'WHEN'; -KW_WHERE: 'WHERE'; -KW_WINDOW: 'WINDOW'; -KW_WITH: 'WITH'; -KW_WITHOUT: 'WITHOUT'; -KW_WORK: 'WORK'; -KW_WRITE: 'WRITE'; -KW_YEAR: 'YEAR'; -KW_ZONE: 'ZONE'; +/** + * Don't modify the following comments manually, it's used for formatting. + * If the antlr.format.json changed, + * copy the comments from the header of any lexer file to overwrite the comments below. + */ -EQ: '='; -NEQ: '<>' | '!='; -LT: '<'; -LTE: '<='; -GT: '>'; -GTE: '>='; +// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing +// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true +// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true -PLUS: '+'; -MINUS: '-'; -ASTERISK: '*'; -SLASH: '/'; -PERCENT: '%'; -CONCAT: '||'; -QUESTION_MARK: '?'; +KW_ADD : 'ADD'; +KW_ADMIN : 'ADMIN'; +KW_AFTER : 'AFTER'; +KW_ALL : 'ALL'; +KW_ALTER : 'ALTER'; +KW_ANALYZE : 'ANALYZE'; +KW_AND : 'AND'; +KW_ANY : 'ANY'; +KW_ARRAY : 'ARRAY'; +KW_AS : 'AS'; +KW_ASC : 'ASC'; +KW_AT : 'AT'; +KW_AUTHORIZATION : 'AUTHORIZATION'; +KW_BERNOULLI : 'BERNOULLI'; +KW_BETWEEN : 'BETWEEN'; +KW_BY : 'BY'; +KW_CALL : 'CALL'; +KW_CASCADE : 'CASCADE'; +KW_CASE : 'CASE'; +KW_CAST : 'CAST'; +KW_CATALOGS : 'CATALOGS'; +KW_COLUMN : 'COLUMN'; +KW_COLUMNS : 'COLUMNS'; +KW_COMMENT : 'COMMENT'; +KW_COMMIT : 'COMMIT'; +KW_COMMITTED : 'COMMITTED'; +KW_CONSTRAINT : 'CONSTRAINT'; +KW_CREATE : 'CREATE'; +KW_CROSS : 'CROSS'; +KW_CUBE : 'CUBE'; +KW_CURRENT : 'CURRENT'; +KW_CURRENT_CATALOG : 'CURRENT_CATALOG'; +KW_CURRENT_DATE : 'CURRENT_DATE'; +KW_CURRENT_PATH : 'CURRENT_PATH'; +KW_CURRENT_ROLE : 'CURRENT_ROLE'; +KW_CURRENT_SCHEMA : 'CURRENT_SCHEMA'; +KW_CURRENT_TIME : 'CURRENT_TIME'; +KW_CURRENT_TIMESTAMP : 'CURRENT_TIMESTAMP'; +KW_CURRENT_USER : 'CURRENT_USER'; +KW_DATA : 'DATA'; +KW_DATE : 'DATE'; +KW_DAY : 'DAY'; +KW_DEFAULT : 'DEFAULT'; +KW_DEALLOCATE : 'DEALLOCATE'; +KW_DEFINER : 'DEFINER'; +KW_DELETE : 'DELETE'; +KW_DESC : 'DESC'; +KW_DESCRIBE : 'DESCRIBE'; +KW_DEFINE : 'DEFINE'; +KW_DISTINCT : 'DISTINCT'; +KW_DISTRIBUTED : 'DISTRIBUTED'; +KW_DOUBLE : 'DOUBLE'; +KW_DROP : 'DROP'; +KW_ELSE : 'ELSE'; +KW_EMPTY : 'EMPTY'; +KW_END : 'END'; +KW_ESCAPE : 'ESCAPE'; +KW_EXCEPT : 'EXCEPT'; +KW_EXCLUDING : 'EXCLUDING'; +KW_EXECUTE : 'EXECUTE'; +KW_EXISTS : 'EXISTS'; +KW_EXPLAIN : 'EXPLAIN'; +KW_EXTRACT : 'EXTRACT'; +KW_FALSE : 'FALSE'; +KW_FETCH : 'FETCH'; +KW_FILTER : 'FILTER'; +KW_FINAL : 'FINAL'; +KW_FIRST : 'FIRST'; +KW_FOLLOWING : 'FOLLOWING'; +KW_FOR : 'FOR'; +KW_FORMAT : 'FORMAT'; +KW_FROM : 'FROM'; +KW_FULL : 'FULL'; +KW_FUNCTIONS : 'FUNCTIONS'; +KW_GRANT : 'GRANT'; +KW_GRANTED : 'GRANTED'; +KW_GRANTS : 'GRANTS'; +KW_DENY : 'DENY'; +KW_GRAPHVIZ : 'GRAPHVIZ'; +KW_GROUP : 'GROUP'; +KW_GROUPING : 'GROUPING'; +KW_GROUPS : 'GROUPS'; +KW_HAVING : 'HAVING'; +KW_HOUR : 'HOUR'; +KW_IF : 'IF'; +KW_IGNORE : 'IGNORE'; +KW_IN : 'IN'; +KW_INCLUDING : 'INCLUDING'; +KW_INITIAL : 'INITIAL'; +KW_INNER : 'INNER'; +KW_INPUT : 'INPUT'; +KW_INSERT : 'INSERT'; +KW_INTERSECT : 'INTERSECT'; +KW_INTERVAL : 'INTERVAL'; +KW_INTO : 'INTO'; +KW_INVOKER : 'INVOKER'; +KW_IO : 'IO'; +KW_IS : 'IS'; +KW_ISOLATION : 'ISOLATION'; +KW_JOIN : 'JOIN'; +KW_JSON : 'JSON'; +KW_LAST : 'LAST'; +KW_LATERAL : 'LATERAL'; +KW_LEFT : 'LEFT'; +KW_LEVEL : 'LEVEL'; +KW_LIKE : 'LIKE'; +KW_LIMIT : 'LIMIT'; +KW_LOCAL : 'LOCAL'; +KW_LOCALTIME : 'LOCALTIME'; +KW_LOCALTIMESTAMP : 'LOCALTIMESTAMP'; +KW_LOGICAL : 'LOGICAL'; +KW_MAP : 'MAP'; +KW_MATCH : 'MATCH'; +KW_MATCHED : 'MATCHED'; +KW_MATCHES : 'MATCHES'; +KW_MATCH_RECOGNIZE : 'MATCH_RECOGNIZE'; +KW_MATERIALIZED : 'MATERIALIZED'; +KW_MEASURES : 'MEASURES'; +KW_MERGE : 'MERGE'; +KW_MINUTE : 'MINUTE'; +KW_MONTH : 'MONTH'; +KW_NATURAL : 'NATURAL'; +KW_NEXT : 'NEXT'; +KW_NFC : 'NFC'; +KW_NFD : 'NFD'; +KW_NFKC : 'NFKC'; +KW_NFKD : 'NFKD'; +KW_NO : 'NO'; +KW_NONE : 'NONE'; +KW_NORMALIZE : 'NORMALIZE'; +KW_NOT : 'NOT'; +KW_NULL : 'NULL'; +KW_NULLIF : 'NULLIF'; +KW_NULLS : 'NULLS'; +KW_OFFSET : 'OFFSET'; +KW_OMIT : 'OMIT'; +KW_ON : 'ON'; +KW_ONE : 'ONE'; +KW_ONLY : 'ONLY'; +KW_OPTION : 'OPTION'; +KW_OR : 'OR'; +KW_ORDER : 'ORDER'; +KW_ORDINALITY : 'ORDINALITY'; +KW_OUTER : 'OUTER'; +KW_OUTPUT : 'OUTPUT'; +KW_OVER : 'OVER'; +KW_PARTITION : 'PARTITION'; +KW_PARTITIONS : 'PARTITIONS'; +KW_PAST : 'PAST'; +KW_PATH : 'PATH'; +KW_PATTERN : 'PATTERN'; +KW_PER : 'PER'; +KW_PERMUTE : 'PERMUTE'; +KW_POSITION : 'POSITION'; +KW_PRECEDING : 'PRECEDING'; +KW_PRECISION : 'PRECISION'; +KW_PREPARE : 'PREPARE'; +KW_PRIVILEGES : 'PRIVILEGES'; +KW_PROPERTIES : 'PROPERTIES'; +KW_RANGE : 'RANGE'; +KW_READ : 'READ'; +KW_RECURSIVE : 'RECURSIVE'; +KW_REFRESH : 'REFRESH'; +KW_RENAME : 'RENAME'; +KW_REPEATABLE : 'REPEATABLE'; +KW_REPLACE : 'REPLACE'; +KW_RESET : 'RESET'; +KW_RESPECT : 'RESPECT'; +KW_RESTRICT : 'RESTRICT'; +KW_REVOKE : 'REVOKE'; +KW_RIGHT : 'RIGHT'; +KW_ROLE : 'ROLE'; +KW_ROLES : 'ROLES'; +KW_ROLLBACK : 'ROLLBACK'; +KW_ROLLUP : 'ROLLUP'; +KW_ROW : 'ROW'; +KW_ROWS : 'ROWS'; +KW_RUNNING : 'RUNNING'; +KW_SCHEMA : 'SCHEMA'; +KW_SCHEMAS : 'SCHEMAS'; +KW_SECOND : 'SECOND'; +KW_SECURITY : 'SECURITY'; +KW_SEEK : 'SEEK'; +KW_SELECT : 'SELECT'; +KW_SERIALIZABLE : 'SERIALIZABLE'; +KW_SESSION : 'SESSION'; +KW_SET : 'SET'; +KW_SETS : 'SETS'; +KW_SHOW : 'SHOW'; +KW_SOME : 'SOME'; +KW_START : 'START'; +KW_STATS : 'STATS'; +KW_SUBSET : 'SUBSET'; +KW_SUBSTRING : 'SUBSTRING'; +KW_SYSTEM : 'SYSTEM'; +KW_TABLE : 'TABLE'; +KW_TABLES : 'TABLES'; +KW_TABLESAMPLE : 'TABLESAMPLE'; +KW_TEXT : 'TEXT'; +KW_THEN : 'THEN'; +KW_TIES : 'TIES'; +KW_TIME : 'TIME'; +KW_TIMESTAMP : 'TIMESTAMP'; +KW_TO : 'TO'; +KW_TRANSACTION : 'TRANSACTION'; +KW_TRUNCATE : 'TRUNCATE'; +KW_TRUE : 'TRUE'; +KW_TRY_CAST : 'TRY_CAST'; +KW_TYPE : 'TYPE'; +KW_UESCAPE : 'UESCAPE'; +KW_UNBOUNDED : 'UNBOUNDED'; +KW_UNCOMMITTED : 'UNCOMMITTED'; +KW_UNION : 'UNION'; +KW_UNMATCHED : 'UNMATCHED'; +KW_UNNEST : 'UNNEST'; +KW_UPDATE : 'UPDATE'; +KW_USE : 'USE'; +KW_USER : 'USER'; +KW_USING : 'USING'; +KW_VALIDATE : 'VALIDATE'; +KW_VALUES : 'VALUES'; +KW_VERBOSE : 'VERBOSE'; +KW_VIEW : 'VIEW'; +KW_WHEN : 'WHEN'; +KW_WHERE : 'WHERE'; +KW_WINDOW : 'WINDOW'; +KW_WITH : 'WITH'; +KW_WITHOUT : 'WITHOUT'; +KW_WORK : 'WORK'; +KW_WRITE : 'WRITE'; +KW_YEAR : 'YEAR'; +KW_ZONE : 'ZONE'; + +EQ : '='; +NEQ : '<>' | '!='; +LT : '<'; +LTE : '<='; +GT : '>'; +GTE : '>='; + +PLUS : '+'; +MINUS : '-'; +ASTERISK : '*'; +SLASH : '/'; +PERCENT : '%'; +CONCAT : '||'; +QUESTION_MARK : '?'; STRING: '\'' ( ~'\'' | '\'\'')* '\''; @@ -1072,9 +1214,7 @@ INTEGER_VALUE: DIGIT+; DECIMAL_VALUE: DIGIT+ '.' DIGIT* | '.' DIGIT+; -DOUBLE_VALUE: - DIGIT+ ('.' DIGIT*)? EXPONENT - | '.' DIGIT+ EXPONENT; +DOUBLE_VALUE: DIGIT+ ('.' DIGIT*)? EXPONENT | '.' DIGIT+ EXPONENT; IDENTIFIER: (LETTER | '_') (LETTER | DIGIT | '_')*; @@ -1082,8 +1222,8 @@ DIGIT_IDENTIFIER: DIGIT (LETTER | DIGIT | '_')+; QUOTED_IDENTIFIER: '"' ( ~'"' | '""')* '"'; -BACKQUOTED_IDENTIFIER: '`' ( ~'`' | '``')* '`'; -SEMICOLON: ';'; +BACKQUOTED_IDENTIFIER : '`' ( ~'`' | '``')* '`'; +SEMICOLON : ';'; fragment EXPONENT: 'E' [+-]? DIGIT+; @@ -1099,4 +1239,4 @@ WS: [ \r\n\t]+ -> channel(HIDDEN); // Catch-all for anything we can't recognize. We use this to be able to ignore and recover all the // text when splitting statements with DelimiterLexer -UNRECOGNIZED: .; +UNRECOGNIZED: .; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 6a5160d..84e9b98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,6 +17,14 @@ dependencies: "@babel/highlight" "^7.18.6" +"@babel/code-frame@^7.16.0": + version "7.23.5" + resolved "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" + integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== + dependencies: + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" + "@babel/compat-data@^7.22.0": version "7.22.3" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.3.tgz#cd502a6a0b6e37d7ad72ce7e71a7160a3ae36f7e" @@ -134,6 +142,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + "@babel/helper-validator-option@^7.21.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" @@ -157,6 +170,15 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.npmmirror.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.9", "@babel/parser@^7.22.0", "@babel/parser@^7.22.4": version "7.22.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.4.tgz#a770e98fd785c231af9d93f6459d36770993fb32" @@ -260,6 +282,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.20.2" +"@babel/runtime@^7.21.0": + version "7.23.6" + resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.23.6.tgz#c05e610dc228855dc92ef1b53d07389ed8ab521d" + integrity sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.20.7", "@babel/template@^7.21.9", "@babel/template@^7.3.3": version "7.21.9" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.21.9.tgz#bf8dad2859130ae46088a99c1f265394877446fb" @@ -479,11 +508,28 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@humanwhocodes/momoa@^2.0.3": + version "2.0.4" + resolved "https://registry.npmmirror.com/@humanwhocodes/momoa/-/momoa-2.0.4.tgz#8b9e7a629651d15009c3587d07a222deeb829385" + integrity sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA== + "@hutson/parse-repository-url@^3.0.0": version "3.0.2" resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.npmmirror.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -760,6 +806,24 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.npmmirror.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + +"@readme/better-ajv-errors@1.6.0": + version "1.6.0" + resolved "https://registry.npmmirror.com/@readme/better-ajv-errors/-/better-ajv-errors-1.6.0.tgz#cf96740bd71d256ed628f3a7466ecae0846edd62" + integrity sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/runtime" "^7.21.0" + "@humanwhocodes/momoa" "^2.0.3" + chalk "^4.1.2" + json-to-ast "^2.0.3" + jsonpointer "^5.0.0" + leven "^3.1.0" + "@sinclair/typebox@^0.25.16": version "0.25.24" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" @@ -940,6 +1004,11 @@ expect "^29.0.0" pretty-format "^29.0.0" +"@types/json-schema@^7.0.12": + version "7.0.15" + resolved "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/minimist@^1.2.0": version "1.2.2" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" @@ -1025,7 +1094,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^8.11.0: +ajv@8.12.0, ajv@^8.11.0: version "8.12.0" resolved "https://registry.npmmirror.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== @@ -1071,11 +1140,23 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -ansi-styles@^6.0.0: +ansi-styles@^6.0.0, ansi-styles@^6.1.0: version "6.2.1" resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== +antlr-format-cli@^1.2.1: + version "1.2.1" + resolved "https://registry.npmmirror.com/antlr-format-cli/-/antlr-format-cli-1.2.1.tgz#285ad653551ad8821e7685f2b44199f838113bbb" + integrity sha512-vqpoL9x3bXiNnC/vzZG3XOyk2vUAHPmBbI/ufyAqbxQHD27OPuUM4n/6m6NBEZZ7V4U2aEiefnZg2SCaSU89oA== + dependencies: + "@readme/better-ajv-errors" "1.6.0" + ajv "8.12.0" + antlr4ng "2.0.2" + commander "11.1.0" + glob "10.3.10" + ts-json-schema-generator "1.4.0" + antlr4-c3@3.1.1: version "3.1.1" resolved "https://registry.npmmirror.com/antlr4-c3/-/antlr4-c3-3.1.1.tgz#f3d579e17c925d9e3cc984ed0ecb5095fce1611f" @@ -1083,6 +1164,11 @@ antlr4-c3@3.1.1: dependencies: antlr4ts "0.5.0-alpha.4" +antlr4ng@2.0.2: + version "2.0.2" + resolved "https://registry.npmmirror.com/antlr4ng/-/antlr4ng-2.0.2.tgz#31d224cc45e578b78ef77fccf9316d133d7cc81c" + integrity sha512-Fhs3AvhoGigRt3RpHw0wGA7n03j9BpskH9yCUViNB7NtKuCA+imy2orEZ8qcgPG98f7IryEPYlG9sx99f3ZOyw== + antlr4ts-cli@^0.5.0-alpha.4: version "0.5.0-alpha.4" resolved "https://registry.yarnpkg.com/antlr4ts-cli/-/antlr4ts-cli-0.5.0-alpha.4.tgz#f3bfc37f10131e78d7b981c397a2aaa0450b67f6" @@ -1225,6 +1311,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -1296,7 +1389,7 @@ caniuse-lite@^1.0.30001489: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001491.tgz#eab0e0f392de6f7411751d148de9b5bd6b203e46" integrity sha512-17EYIi4TLnPiTzVKMveIxU5ETlxbSO3B6iPvMbprqnKh4qJsQGk5Nh1Lp4jIMAE0XfrujsJuWZAM3oJdMHaKBA== -chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: +chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1399,6 +1492,11 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== +code-error-fragment@0.0.230: + version "0.0.230" + resolved "https://registry.npmmirror.com/code-error-fragment/-/code-error-fragment-0.0.230.tgz#d736d75c832445342eca1d1fedbf17d9618b14d7" + integrity sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw== + collect-v8-coverage@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" @@ -1433,6 +1531,11 @@ colorette@^2.0.16: resolved "https://registry.npmmirror.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== +commander@11.1.0, commander@^11.0.0: + version "11.1.0" + resolved "https://registry.npmmirror.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" + integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== + commander@^9.3.0: version "9.5.0" resolved "https://registry.npmmirror.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" @@ -1708,7 +1811,7 @@ create-require@^1.1.0: resolved "https://registry.npmmirror.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -2001,6 +2104,14 @@ findup-sync@^4.0.0: micromatch "^4.0.2" resolve-dir "^1.0.1" +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.npmmirror.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + fs-extra@9.1.0: version "9.1.0" resolved "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -2099,6 +2210,17 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" +glob@10.3.10, glob@^10.3.10: + version "10.3.10" + resolved "https://registry.npmmirror.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b" + integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.5" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" + glob@7.2.3, glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -2111,6 +2233,17 @@ glob@7.2.3, glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.0.3: + version "8.1.0" + resolved "https://registry.npmmirror.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + global-dirs@^0.1.1: version "0.1.1" resolved "https://registry.npmmirror.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" @@ -2148,6 +2281,11 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9: resolved "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.npmmirror.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" @@ -2452,6 +2590,15 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jackspeak@^2.3.5: + version "2.3.6" + resolved "https://registry.npmmirror.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-changed-files@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" @@ -2858,9 +3005,17 @@ json-stringify-safe@^5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@^2.2.2: +json-to-ast@^2.0.3: + version "2.1.0" + resolved "https://registry.npmmirror.com/json-to-ast/-/json-to-ast-2.1.0.tgz#041a9fcd03c0845036acb670d29f425cea4faaf9" + integrity sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ== + dependencies: + code-error-fragment "0.0.230" + grapheme-splitter "^1.0.4" + +json5@^2.2.2, json5@^2.2.3: version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + resolved "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== jsonc-parser@^3.2.0: @@ -2882,6 +3037,11 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== +jsonpointer@^5.0.0: + version "5.0.1" + resolved "https://registry.npmmirror.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" + integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== + kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" @@ -3083,6 +3243,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +"lru-cache@^9.1.1 || ^10.0.0": + version "10.1.0" + resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" + integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag== + make-dir@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -3164,6 +3329,20 @@ minimatch@^3.0.4, minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.npmmirror.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^9.0.1: + version "9.0.3" + resolved "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -3183,6 +3362,11 @@ minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": + version "7.0.4" + resolved "https://registry.npmmirror.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" + integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== + modify-values@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" @@ -3410,6 +3594,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.10.1: + version "1.10.1" + resolved "https://registry.npmmirror.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" + integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== + dependencies: + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -3577,6 +3769,11 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -3668,6 +3865,11 @@ safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-stable-stringify@^2.4.3: + version "2.4.3" + resolved "https://registry.npmmirror.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886" + integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g== + "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -3714,6 +3916,11 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -3848,6 +4055,15 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -3857,7 +4073,7 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^5.0.0: +string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== @@ -3885,6 +4101,13 @@ stringify-package@^1.0.1: resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85" integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -4020,6 +4243,19 @@ trim-newlines@^3.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== +ts-json-schema-generator@1.4.0: + version "1.4.0" + resolved "https://registry.npmmirror.com/ts-json-schema-generator/-/ts-json-schema-generator-1.4.0.tgz#f341b36792c372d3d09245414a4f3a6efa2697f8" + integrity sha512-wm8vyihmGgYpxrqRshmYkWGNwEk+sf3xV2rUgxv8Ryeh7bSpMO7pZQOht+2rS002eDkFTxR7EwRPXVzrS0WJTg== + dependencies: + "@types/json-schema" "^7.0.12" + commander "^11.0.0" + glob "^8.0.3" + json5 "^2.2.3" + normalize-path "^3.0.0" + safe-stable-stringify "^2.4.3" + typescript "~5.2.2" + ts-node@^10.8.1: version "10.9.1" resolved "https://registry.npmmirror.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" @@ -4074,7 +4310,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -"typescript@^4.6.4 || ^5.0.0": +"typescript@^4.6.4 || ^5.0.0", typescript@~5.2.2: version "5.2.2" resolved "https://registry.npmmirror.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== @@ -4174,6 +4410,15 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -4192,6 +4437,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"