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
This commit is contained in:
Hayden 2023-12-12 20:05:21 +08:00 committed by GitHub
parent 17eba1f2aa
commit 14a5214e82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 16763 additions and 13690 deletions

View File

@ -1,4 +1,5 @@
module.exports = { module.exports = {
'*.js': [`prettier --write`], '*.js': [`prettier --write`],
'*.ts': [`prettier --write`], '*.ts': [`prettier --write`],
'*.g4': [`antlr-format -c ./antlr.format.json -v`],
}; };

34
antlr.format.json Normal file
View File

@ -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
}
}

View File

@ -28,6 +28,7 @@
"release": "node ./scripts/release.js", "release": "node ./scripts/release.js",
"lint": "prettier --check '**/*.ts' --config ./.prettierrc", "lint": "prettier --check '**/*.ts' --config ./.prettierrc",
"lint-fix": "prettier --write '**/*.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" "cleanComment": "node ./scripts/cleanCommentCli.js"
}, },
"license": "MIT", "license": "MIT",
@ -39,6 +40,7 @@
"@swc/jest": "^0.2.26", "@swc/jest": "^0.2.26",
"@types/jest": "^29.5.1", "@types/jest": "^29.5.1",
"@types/node": "^18.15.11", "@types/node": "^18.15.11",
"antlr-format-cli": "^1.2.1",
"antlr4ts-cli": "^0.5.0-alpha.4", "antlr4ts-cli": "^0.5.0-alpha.4",
"chalk": "4.1.2", "chalk": "4.1.2",
"commitizen": "^4.3.0", "commitizen": "^4.3.0",

View File

@ -8,6 +8,7 @@ specifiers:
'@swc/jest': ^0.2.26 '@swc/jest': ^0.2.26
'@types/jest': ^29.5.1 '@types/jest': ^29.5.1
'@types/node': ^18.15.11 '@types/node': ^18.15.11
antlr-format-cli: ^1.2.1
antlr4-c3: 3.1.1 antlr4-c3: 3.1.1
antlr4ts: 0.5.0-alpha.4 antlr4ts: 0.5.0-alpha.4
antlr4ts-cli: ^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 '@swc/jest': 0.2.26_@swc+core@1.3.60
'@types/jest': 29.5.1 '@types/jest': 29.5.1
'@types/node': 18.16.16 '@types/node': 18.16.16
antlr-format-cli: 1.2.1
antlr4ts-cli: 0.5.0-alpha.4 antlr4ts-cli: 0.5.0-alpha.4
chalk: 4.1.2 chalk: 4.1.2
commitizen: 4.3.0_@swc+core@1.3.60 commitizen: 4.3.0_@swc+core@1.3.60
@ -351,6 +353,13 @@ packages:
'@babel/helper-plugin-utils': 7.21.5 '@babel/helper-plugin-utils': 7.21.5
dev: true 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: /@babel/template/7.21.9:
resolution: {integrity: sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==} resolution: {integrity: sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
@ -587,6 +596,11 @@ packages:
'@jridgewell/trace-mapping': 0.3.9 '@jridgewell/trace-mapping': 0.3.9
dev: true 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: /@hutson/parse-repository-url/3.0.2:
resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
@ -899,6 +913,22 @@ packages:
dev: true dev: true
optional: 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: /@sinclair/typebox/0.25.24:
resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==}
dev: true dev: true
@ -1112,6 +1142,10 @@ packages:
pretty-format: 29.5.0 pretty-format: 29.5.0
dev: true dev: true
/@types/json-schema/7.0.15:
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
dev: true
/@types/minimist/1.2.2: /@types/minimist/1.2.2:
resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
dev: true dev: true
@ -1233,12 +1267,32 @@ packages:
engines: {node: '>=12'} engines: {node: '>=12'}
dev: true 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: /antlr4-c3/3.1.1:
resolution: {integrity: sha512-S7DixV12kxWexTkQYGvooCgHYU5AjF74oYio+ZNgm0XN3EzxDY3J6Si9GprQ4KksvgWwK//EgZnL/26WB+bOpw==} resolution: {integrity: sha512-S7DixV12kxWexTkQYGvooCgHYU5AjF74oYio+ZNgm0XN3EzxDY3J6Si9GprQ4KksvgWwK//EgZnL/26WB+bOpw==}
dependencies: dependencies:
antlr4ts: 0.5.0-alpha.4 antlr4ts: 0.5.0-alpha.4
dev: false 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: /antlr4ts-cli/0.5.0-alpha.4:
resolution: {integrity: sha512-lVPVBTA2CVHRYILSKilL6Jd4hAumhSZZWA7UbQNQrmaSSj7dPmmYaN4bOmZG79cOy0lS00i4LY68JZZjZMWVrw==} resolution: {integrity: sha512-lVPVBTA2CVHRYILSKilL6Jd4hAumhSZZWA7UbQNQrmaSSj7dPmmYaN4bOmZG79cOy0lS00i4LY68JZZjZMWVrw==}
hasBin: true hasBin: true
@ -1558,6 +1612,11 @@ packages:
engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
dev: true 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: /collect-v8-coverage/1.0.1:
resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==}
dev: true dev: true
@ -1587,6 +1646,11 @@ packages:
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
dev: true dev: true
/commander/11.1.0:
resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==}
engines: {node: '>=16'}
dev: true
/commander/9.5.0: /commander/9.5.0:
resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
engines: {node: ^12.20.0 || >=14} engines: {node: ^12.20.0 || >=14}
@ -2312,6 +2376,17 @@ packages:
path-is-absolute: 1.0.1 path-is-absolute: 1.0.1
dev: true 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: /global-dirs/0.1.1:
resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==}
engines: {node: '>=4'} engines: {node: '>=4'}
@ -2348,6 +2423,10 @@ packages:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
dev: true dev: true
/grapheme-splitter/1.0.4:
resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==}
dev: true
/handlebars/4.7.7: /handlebars/4.7.7:
resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==} resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==}
engines: {node: '>=0.4.7'} engines: {node: '>=0.4.7'}
@ -3107,6 +3186,14 @@ packages:
resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
dev: true 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: /json5/2.2.3:
resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
engines: {node: '>=6'} engines: {node: '>=6'}
@ -3130,6 +3217,11 @@ packages:
engines: {'0': node >= 0.2.0} engines: {'0': node >= 0.2.0}
dev: true 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: /kind-of/6.0.3:
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -3405,6 +3497,13 @@ packages:
brace-expansion: 1.1.11 brace-expansion: 1.1.11
dev: true 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: /minimatch/9.0.3:
resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}
engines: {node: '>=16 || 14 >=14.17'} engines: {node: '>=16 || 14 >=14.17'}
@ -3823,6 +3922,10 @@ packages:
strip-indent: 3.0.0 strip-indent: 3.0.0
dev: true dev: true
/regenerator-runtime/0.14.0:
resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==}
dev: true
/require-directory/2.1.1: /require-directory/2.1.1:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -3910,6 +4013,11 @@ packages:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
dev: true 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: /safer-buffer/2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
dev: true dev: true
@ -4253,6 +4361,20 @@ packages:
engines: {node: '>=8'} engines: {node: '>=8'}
dev: true 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: /ts-node/10.9.1_0d2585e4297d96d8e906ef9bffd6d443:
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
hasBin: true hasBin: true
@ -4324,6 +4446,12 @@ packages:
hasBin: true hasBin: true
dev: 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: /uglify-js/3.17.4:
resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==}
engines: {node: '>=0.8.0'} engines: {node: '>=0.8.0'}

View File

@ -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; lexer grammar FlinkSqlLexer;
// SKIP // SKIP
SPACE : [ \t\r\n]+ -> channel(HIDDEN); SPACE : [ \t\r\n]+ -> channel(HIDDEN);
COMMENT_INPUT : '/*' .*? '*/' -> channel(HIDDEN); COMMENT_INPUT : '/*' .*? '*/' -> channel(HIDDEN);
LINE_COMMENT: ( LINE_COMMENT: (('--' | '#') ~[\r\n]* ('\r'? '\n' | EOF) | '--' ('\r'? '\n' | EOF)) -> channel(HIDDEN);
('--' | '#') ~[\r\n]* ('\r'? '\n' | EOF)
| '--' ('\r'? '\n' | EOF)
) -> channel(HIDDEN);
/** /**
* Keywords and Reserved Keywords * Keywords and Reserved Keywords
@ -532,7 +534,6 @@ KW_WEEK :'WEEK';
KW_YEARS : 'YEARS'; KW_YEARS : 'YEARS';
KW_ZONE : 'ZONE'; KW_ZONE : 'ZONE';
// Operators. Comparation // Operators. Comparation
EQUAL_SYMBOL : '='; EQUAL_SYMBOL : '=';
@ -540,7 +541,6 @@ GREATER_SYMBOL: '>';
LESS_SYMBOL : '<'; LESS_SYMBOL : '<';
EXCLAMATION_SYMBOL : '!'; EXCLAMATION_SYMBOL : '!';
// Operators. Bit // Operators. Bit
BIT_NOT_OP : '~'; BIT_NOT_OP : '~';
@ -548,7 +548,6 @@ BIT_OR_OP: '|';
BIT_AND_OP : '&'; BIT_AND_OP : '&';
BIT_XOR_OP : '^'; BIT_XOR_OP : '^';
// Constructors symbols // Constructors symbols
DOT : '.'; DOT : '.';

View File

@ -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; parser grammar FlinkSqlParser;
options { tokenVocab=FlinkSqlLexer; } options {
tokenVocab=FlinkSqlLexer;
}
program: singleStatement* EOF; program
: singleStatement* EOF
;
singleStatement singleStatement
: sqlStatement SEMICOLON? : sqlStatement SEMICOLON?
@ -10,10 +18,18 @@ singleStatement
; ;
sqlStatement sqlStatement
: ddlStatement | dmlStatement | describeStatement : ddlStatement
| explainStatement | useStatement | showStatememt | dmlStatement
| loadStatement | unloadStatememt | setStatememt | describeStatement
| resetStatememt | jarStatememt | dtAddStatement | explainStatement
| useStatement
| showStatememt
| loadStatement
| unloadStatememt
| setStatememt
| resetStatememt
| jarStatememt
| dtAddStatement
; ;
emptyStatement emptyStatement
@ -21,13 +37,25 @@ emptyStatement
; ;
ddlStatement ddlStatement
: createTable | createDatabase | createView | createFunction | createCatalog : createTable
| alterTable | alertView | alterDatabase | alterFunction | createDatabase
| dropCatalog | dropTable | dropDatabase | dropView | dropFunction | createView
| createFunction
| createCatalog
| alterTable
| alertView
| alterDatabase
| alterFunction
| dropCatalog
| dropTable
| dropDatabase
| dropView
| dropFunction
; ;
dmlStatement dmlStatement
: queryStatement | insertStatement : queryStatement
| insertStatement
; ;
// some statemen // some statemen
@ -36,7 +64,11 @@ describeStatement
; ;
explainStatement explainStatement
: KW_EXPLAIN (explainDetails | KW_PLAN KW_FOR)? (dmlStatement | insertSimpleStatement | insertMulStatement) : KW_EXPLAIN (explainDetails | KW_PLAN KW_FOR)? (
dmlStatement
| insertSimpleStatement
| insertMulStatement
)
; ;
explainDetails explainDetails
@ -44,7 +76,9 @@ explainDetails
; ;
explainDetail explainDetail
: KW_CHANGELOG_MODE | KW_JSON_EXECUTION_PLAN | KW_ESTIMATED_COST : KW_CHANGELOG_MODE
| KW_JSON_EXECUTION_PLAN
| KW_ESTIMATED_COST
; ;
useStatement useStatement
@ -91,7 +125,13 @@ jarStatememt
dtAddStatement dtAddStatement
: KW_ADD KW_JAR KW_WITH dtFilePath (KW_AS uid)? : 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_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_PYTHON_PARAMETER dtFilePath
| KW_ADD KW_ENGINE KW_FILE KW_WITH dtFilePath KW_RENAME uid KW_KEY uid | 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 | KW_ADD KW_CONFIG KW_FILE KW_WITH dtFilePath KW_FOR uid KW_AS uid
@ -108,16 +148,9 @@ createTable
; ;
simpleCreateTable simpleCreateTable
: KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tablePathCreate : KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tablePathCreate LR_BRACKET columnOptionDefinition (
LR_BRACKET COMMA columnOptionDefinition
columnOptionDefinition (COMMA columnOptionDefinition)* )* (COMMA watermarkDefinition)? (COMMA tableConstraint)? (COMMA selfDefinitionClause)? RR_BRACKET commentSpec? partitionDefinition? withOption
(COMMA watermarkDefinition)?
(COMMA tableConstraint)?
(COMMA selfDefinitionClause)?
RR_BRACKET
commentSpec?
partitionDefinition?
withOption
likeDefinition? likeDefinition?
; ;
@ -141,10 +174,12 @@ physicalColumnDefinition
columnNameCreate columnNameCreate
: uid : uid
| expression; | expression
;
columnName columnName
: uid | expression : uid
| expression
; ;
columnNameList columnNameList
@ -153,9 +188,21 @@ columnNameList
columnType columnType
: typeName=(KW_DATE | KW_BOOLEAN | KW_NULL) : typeName=(KW_DATE | KW_BOOLEAN | KW_NULL)
| typeName=(KW_CHAR | KW_VARCHAR | KW_STRING | KW_BINARY | KW_VARBINARY | KW_BYTES | typeName=(
| KW_TINYINT | KW_SMALLINT |KW_INT | KW_INTEGER | KW_BIGINT KW_CHAR
| KW_TIME | KW_TIMESTAMP_LTZ | KW_DATETIME | 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? ) lengthOneDimension?
| typeName=KW_TIMESTAMP lengthOneDimension? ((KW_WITHOUT | KW_WITH) KW_LOCAL? KW_TIME KW_ZONE)? | 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? | typeName=(KW_DECIMAL | KW_DEC | KW_NUMERIC | KW_FLOAT | KW_DOUBLE) lengthTwoOptionalDimension?
@ -190,7 +237,8 @@ rowTypeDimension
; ;
columnConstraint 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 commentSpec
@ -271,7 +319,9 @@ createView
; ;
createFunction 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 usingClause
@ -287,7 +337,13 @@ jarFileName
// it only includes rename, set key, add constraint, drop constraint, add unique // it only includes rename, set key, add constraint, drop constraint, add unique
alterTable alterTable
: KW_ALTER KW_TABLE ifExists? tablePath (renameDefinition | setKeyValueDefinition | addConstraint | dropConstraint | addUnique) : KW_ALTER KW_TABLE ifExists? tablePath (
renameDefinition
| setKeyValueDefinition
| addConstraint
| dropConstraint
| addUnique
)
; ;
renameDefinition renameDefinition
@ -323,10 +379,11 @@ alterDatabase
; ;
alterFunction 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 // Drop statements
dropCatalog dropCatalog
@ -349,17 +406,16 @@ 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 // Insert statements
insertStatement insertStatement
: (KW_EXECUTE? insertSimpleStatement) : (KW_EXECUTE? insertSimpleStatement)
| insertMulStatementCompatibility | (KW_EXECUTE insertMulStatement) | insertMulStatementCompatibility
| (KW_EXECUTE insertMulStatement)
; ;
insertSimpleStatement insertSimpleStatement
: KW_INSERT (KW_INTO | KW_OVERWRITE) tablePath : KW_INSERT (KW_INTO | KW_OVERWRITE) tablePath (
(
insertPartitionDefinition? columnNameList? queryStatement insertPartitionDefinition? columnNameList? queryStatement
| valuesDefinition | valuesDefinition
) )
@ -374,9 +430,7 @@ valuesDefinition
; ;
valuesRowDefinition valuesRowDefinition
: LR_BRACKET : LR_BRACKET constant (COMMA constant)* RR_BRACKET
constant (COMMA constant)*
RR_BRACKET
; ;
insertMulStatementCompatibility insertMulStatementCompatibility
@ -420,7 +474,10 @@ selectStatement
; ;
selectClause selectClause
: KW_SELECT setQuantifier? (ASTERISK_SIGN | projectItemDefinition (COMMA projectItemDefinition)*) : KW_SELECT setQuantifier? (
ASTERISK_SIGN
| projectItemDefinition (COMMA projectItemDefinition)*
)
; ;
projectItemDefinition projectItemDefinition
@ -563,25 +620,12 @@ namedWindow
; ;
windowSpec windowSpec
: name=errorCapturingIdentifier? : name=errorCapturingIdentifier? LR_BRACKET partitionByClause? orderByCaluse? windowFrame? RR_BRACKET
LR_BRACKET
partitionByClause?
orderByCaluse?
windowFrame?
RR_BRACKET
; ;
matchRecognizeClause matchRecognizeClause
: KW_MATCH_RECOGNIZE : KW_MATCH_RECOGNIZE LR_BRACKET partitionByClause? orderByCaluse? measuresClause? outputMode? afterMatchStrategy? patternDefination?
LR_BRACKET patternVariablesDefination RR_BRACKET (KW_AS? identifier)?
partitionByClause?
orderByCaluse?
measuresClause?
outputMode?
afterMatchStrategy?
patternDefination?
patternVariablesDefination
RR_BRACKET ( KW_AS? identifier )?
; ;
orderByCaluse orderByCaluse
@ -614,11 +658,7 @@ measuresClause
; ;
patternDefination patternDefination
: KW_PATTERN : KW_PATTERN LR_BRACKET patternVariable+ RR_BRACKET withinClause?
LR_BRACKET
patternVariable+
RR_BRACKET
withinClause?
; ;
patternVariable patternVariable
@ -654,7 +694,6 @@ withinClause
: KW_WITHIN timeIntervalExpression : KW_WITHIN timeIntervalExpression
; ;
// expression // expression
expression expression
@ -671,10 +710,7 @@ booleanExpression
; ;
predicate predicate
: KW_NOT? : KW_NOT? kind=KW_BETWEEN (KW_ASYMMETRIC | KW_SYMMETRIC)? lower=valueExpression KW_AND upper=valueExpression
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 expression (COMMA expression)* RR_BRACKET
| KW_NOT? kind=KW_IN LR_BRACKET queryStatement RR_BRACKET | KW_NOT? kind=KW_IN LR_BRACKET queryStatement RR_BRACKET
| kind=KW_EXISTS LR_BRACKET queryStatement RR_BRACKET | kind=KW_EXISTS LR_BRACKET queryStatement RR_BRACKET
@ -686,7 +722,10 @@ predicate
; ;
likePredicate 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)? | KW_NOT? kind=KW_LIKE pattern=valueExpression (KW_ESCAPE stringLiteral)?
; ;
@ -758,7 +797,8 @@ correlationName
; ;
qualifiedName qualifiedName
: identifier | dereferenceDefinition : identifier
| dereferenceDefinition
; ;
timeIntervalExpression timeIntervalExpression
@ -814,7 +854,8 @@ identifier
; ;
unquotedIdentifier unquotedIdentifier
: DIG_LITERAL | ID_LITERAL : DIG_LITERAL
| ID_LITERAL
; ;
quotedIdentifier quotedIdentifier
@ -870,10 +911,12 @@ withOption
; ;
ifNotExists ifNotExists
: KW_IF KW_NOT KW_EXISTS; : KW_IF KW_NOT KW_EXISTS
;
ifExists ifExists
: KW_IF KW_EXISTS; : KW_IF KW_EXISTS
;
tablePropertyList tablePropertyList
: LR_BRACKET tableProperty (COMMA tableProperty)* RR_BRACKET : LR_BRACKET tableProperty (COMMA tableProperty)* RR_BRACKET
@ -884,7 +927,8 @@ tableProperty
; ;
tablePropertyKey tablePropertyKey
: identifier | dereferenceDefinition : identifier
| dereferenceDefinition
| STRING_LITERAL | STRING_LITERAL
; ;
@ -963,7 +1007,9 @@ decimalLiteral
; ;
booleanLiteral booleanLiteral
: KW_TRUE | KW_FALSE; : KW_TRUE
| KW_FALSE
;
setQuantifier setQuantifier
: KW_DISTINCT : KW_DISTINCT

View File

@ -20,6 +20,11 @@
* Reference: https://github.com/antlr/grammars-v4/blob/master/sql/hive/v4/HiveLexer.g4 * 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; lexer grammar HiveSqlLexer;
// unsupported option caseInsensitive in antlr4@4.9 // unsupported option caseInsensitive in antlr4@4.9
@ -460,32 +465,17 @@ DOLLAR : '$';
// LITERALS // LITERALS
StringLiteral StringLiteral: ( '\'' ( ~('\'' | '\\') | ('\\' .))* '\'' | '"' ( ~('"' | '\\') | ('\\' .))* '"')+;
: ( '\'' ( ~('\''|'\\') | ('\\' .) )* '\''
| '"' ( ~('"'|'\\') | ('\\' .) )* '"'
)+
;
CharSetLiteral CharSetLiteral: StringLiteral | '0' 'X' (HexDigit | Digit)+;
: StringLiteral
| '0' 'X' (HexDigit | Digit)+
;
IntegralLiteral IntegralLiteral: Digit+ ('L' | 'S' | 'Y');
: Digit+ ('L' | 'S' | 'Y')
;
NumberLiteral NumberLiteral: Number ('B'? 'D');
: Number ('B'? 'D')
;
ByteLengthLiteral ByteLengthLiteral: Digit+ [BKMG];
: Digit+ [BKMG]
;
Number Number: Digit+ (DOT Digit* Exponent? | Exponent)?;
: Digit+ (DOT Digit* Exponent? | Exponent)?
;
/* /*
An Identifier can be: An Identifier can be:
@ -508,67 +498,46 @@ An Identifier can be:
- hint name - hint name
- window name - window name
*/ */
Identifier Identifier: (Letter | Digit) (Letter | Digit | '_')* | QuotedIdentifier | '`' RegexComponent+ '`';
: (Letter | Digit) (Letter | Digit | '_')*
| QuotedIdentifier
| '`' RegexComponent+ '`'
;
fragment fragment QuotedIdentifier: '`' ('``' | ~'`')* '`';
QuotedIdentifier
: '`' ('``' | ~'`')* '`'
;
fragment fragment Letter: 'A' ..'Z' | 'a' ..'z';
Letter
: 'A'..'Z'
| 'a'..'z'
;
fragment fragment HexDigit: 'A' ..'F';
HexDigit
: 'A'..'F'
;
fragment fragment Digit: '0' ..'9';
Digit
: '0'..'9'
;
fragment fragment Exponent: ('E') ( PLUS | MINUS)? (Digit)+;
Exponent
: ('E') ( PLUS|MINUS )? (Digit)+
;
fragment fragment RegexComponent:
RegexComponent 'A' ..'Z'
: 'A'..'Z' | '0'..'9' | '_' | '0' ..'9'
| PLUS | STAR | QUESTION | MINUS | DOT | '_'
| LPAREN | RPAREN | LSQUARE | RSQUARE | LCURLY | RCURLY | PLUS
| BITWISEXOR | BITWISEOR | DOLLAR | BITWISENOT | STAR
; | QUESTION
| MINUS
| DOT
| LPAREN
| RPAREN
| LSQUARE
| RSQUARE
| LCURLY
| RCURLY
| BITWISEXOR
| BITWISEOR
| DOLLAR
| BITWISENOT;
CharSetName CharSetName: '_' (Letter | Digit | '_' | '-' | '.' | ':')+;
: '_' (Letter | Digit | '_' | '-' | '.' | ':')+
;
WHITE_SPACE WHITE_SPACE: (' ' | '\r' | '\t' | '\n') -> channel(HIDDEN);
: (' '|'\r'|'\t'|'\n') -> channel(HIDDEN)
;
LINE_COMMENT LINE_COMMENT: '--' ~('\n' | '\r')* -> channel(HIDDEN);
: '--' ~('\n' | '\r')* -> channel(HIDDEN)
;
QUERY_HINT QUERY_HINT: SHOW_HINT | HIDDEN_HINT;
: SHOW_HINT
| HIDDEN_HINT
;
SHOW_HINT SHOW_HINT: '/*+' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN);
: '/*+' (QUERY_HINT | .)*? '*/' ->channel(HIDDEN)
;
HIDDEN_HINT HIDDEN_HINT: '/*' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN);
: '/*' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN)
;

View File

@ -20,6 +20,10 @@
* Reference: https://github.com/antlr/grammars-v4/blob/master/sql/hive/v4/HiveParser.g4 * 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; parser grammar HiveSqlParser;
options options
@ -27,7 +31,9 @@ options
tokenVocab=HiveSqlLexer; tokenVocab=HiveSqlLexer;
} }
program : statement* EOF; program
: statement* EOF
;
// starting rule // starting rule
statement statement
@ -35,10 +41,7 @@ statement
; ;
explainStatement explainStatement
: KW_EXPLAIN ( : KW_EXPLAIN (explainOption* execStatement | KW_REWRITE queryStatementExpression)
explainOption* execStatement
| KW_REWRITE queryStatementExpression
)
; ;
explainOption explainOption
@ -98,24 +101,17 @@ replicationClause
; ;
exportStatement exportStatement
: KW_EXPORT : KW_EXPORT KW_TABLE tableOrPartition KW_TO StringLiteral replicationClause?
KW_TABLE tableOrPartition
KW_TO StringLiteral
replicationClause?
; ;
importStatement importStatement
: KW_IMPORT : KW_IMPORT (KW_EXTERNAL? KW_TABLE tableOrPartition)? KW_FROM path=StringLiteral tableLocation?
(KW_EXTERNAL? KW_TABLE tableOrPartition)?
KW_FROM path=StringLiteral
tableLocation?
; ;
replDumpStatement replDumpStatement
: KW_REPL KW_DUMP : KW_REPL KW_DUMP dbPolicy=replDbPolicy (KW_REPLACE oldDbPolicy=replDbPolicy)? (
dbPolicy=replDbPolicy KW_WITH replConf=replConfigs
(KW_REPLACE oldDbPolicy=replDbPolicy)? )?
(KW_WITH replConf=replConfigs)?
; ;
replDbPolicy replDbPolicy
@ -123,10 +119,9 @@ replDbPolicy
; ;
replLoadStatement replLoadStatement
: KW_REPL KW_LOAD : KW_REPL KW_LOAD sourceDbPolicy=replDbPolicy (KW_INTO dbName=dbSchemaName)? (
sourceDbPolicy=replDbPolicy KW_WITH replConf=replConfigs
(KW_INTO dbName=dbSchemaName)? )?
(KW_WITH replConf=replConfigs)?
; ;
replConfigs replConfigs
@ -142,9 +137,7 @@ replTableLevelPolicy
; ;
replStatusStatement replStatusStatement
: KW_REPL KW_STATUS : KW_REPL KW_STATUS dbName=dbSchemaName (KW_WITH replConf=replConfigs)?
dbName=dbSchemaName
(KW_WITH replConf=replConfigs)?
; ;
ddlStatement ddlStatement
@ -231,19 +224,12 @@ orReplace
; ;
createDatabaseStatement createDatabaseStatement
: KW_CREATE KW_REMOTE? db_schema : KW_CREATE KW_REMOTE? db_schema ifNotExists? name=dbSchemaNameCreate databaseComment? dbLocation? dbManagedLocation? (
ifNotExists? KW_WITH KW_DBPROPERTIES dbprops=dbProperties
name=dbSchemaNameCreate )?
databaseComment? | KW_CREATE KW_REMOTE db_schema ifNotExists? name=dbSchemaNameCreate databaseComment? dbConnectorName (
dbLocation? KW_WITH KW_DBPROPERTIES dbprops=dbProperties
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 dbLocation
@ -291,8 +277,7 @@ inputFileFormat
; ;
tabTypeExpr tabTypeExpr
: id_ (DOT id_)? : id_ (DOT id_)? (id_ (DOT (KW_ELEM_TYPE | KW_KEY_TYPE | KW_VALUE_TYPE | id_))*)?
(id_ (DOT (KW_ELEM_TYPE | KW_KEY_TYPE | KW_VALUE_TYPE | id_))*)?
; ;
partTypeExpr partTypeExpr
@ -304,8 +289,7 @@ tabPartColTypeExpr
; ;
descStatement descStatement
: (KW_DESCRIBE | KW_DESC) : (KW_DESCRIBE | KW_DESC) (
(
db_schema KW_EXTENDED? dbName=dbSchemaName db_schema KW_EXTENDED? dbName=dbSchemaName
| KW_DATACONNECTOR KW_EXTENDED? dcName=dbSchemaName | KW_DATACONNECTOR KW_EXTENDED? dcName=dbSchemaName
| KW_FUNCTION KW_EXTENDED? name=functionNameForDDL | KW_FUNCTION KW_EXTENDED? name=functionNameForDDL
@ -315,8 +299,11 @@ descStatement
; ;
analyzeStatement analyzeStatement
: KW_ANALYZE KW_TABLE parttype=tableOrPartition : KW_ANALYZE KW_TABLE parttype=tableOrPartition (
( KW_COMPUTE KW_STATISTICS (noscan=KW_NOSCAN | KW_FOR KW_COLUMNS statsColumnName=columnNameList?)? KW_COMPUTE KW_STATISTICS (
noscan=KW_NOSCAN
| KW_FOR KW_COLUMNS statsColumnName=columnNameList?
)?
| KW_CACHE KW_METADATA | KW_CACHE KW_METADATA
) )
; ;
@ -334,17 +321,29 @@ db_schema
showStatement showStatement
: KW_SHOW (KW_DATABASES | KW_SCHEMAS) (KW_LIKE showStmtIdentifier)? : 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 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_VIEWS (from_in db_name=dbSchemaName)? (
| KW_SHOW KW_MATERIALIZED KW_VIEWS (from_in db_name=dbSchemaName)? (KW_LIKE showStmtIdentifier|showStmtIdentifier)? KW_LIKE showStmtIdentifier
| KW_SHOW KW_SORTED? KW_COLUMNS from_in tableOrView (from_in db_name=dbSchemaName)? (KW_LIKE showStmtIdentifier|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_FUNCTIONS (KW_LIKE functionNameForDDL)?
| KW_SHOW KW_PARTITIONS tabOrViewName=tableOrView partitionSpec? whereClause? orderByClause? limitClause? | 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_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_TABLE KW_EXTENDED (from_in db_name=dbSchemaName)? KW_LIKE showStmtIdentifier partitionSpec?
| KW_SHOW KW_TBLPROPERTIES tableName (LPAREN prptyName=StringLiteral RPAREN)? | 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_LOCKS (
| KW_SHOW KW_COMPACTIONS db_schema dbName=dbSchemaName isExtended=KW_EXTENDED?
( compactionId | parttype=partTypeExpr? isExtended=KW_EXTENDED?
)
| KW_SHOW KW_COMPACTIONS (
compactionId
| db_schema dbName=dbSchemaName compactionPool? compactionType? compactionStatus? orderByClause? limitClause? | db_schema dbName=dbSchemaName compactionPool? compactionType? compactionStatus? orderByClause? limitClause?
| parttype=partTypeExpr? compactionPool? compactionType? compactionStatus? orderByClause? limitClause? | parttype=partTypeExpr? compactionPool? compactionType? compactionStatus? orderByClause? limitClause?
) )
@ -391,10 +390,7 @@ dropRoleStatement
; ;
grantPrivileges grantPrivileges
: KW_GRANT privList=privilegeList : KW_GRANT privList=privilegeList privilegeObject? KW_TO principalSpecification withGrantOption?
privilegeObject?
KW_TO principalSpecification
withGrantOption?
; ;
revokePrivileges revokePrivileges
@ -422,11 +418,7 @@ showCurrentRole
; ;
setRole setRole
: KW_SET KW_ROLE : KW_SET KW_ROLE (all=KW_ALL | none=KW_NONE | id_)
( all=KW_ALL
| none=KW_NONE
| id_
)
; ;
showGrants showGrants
@ -518,9 +510,10 @@ withAdminOption
; ;
metastoreCheck metastoreCheck
: KW_MSCK repair=KW_REPAIR? : KW_MSCK repair=KW_REPAIR? (
(KW_TABLE tableName KW_TABLE tableName (
(opt=(KW_ADD | KW_DROP | KW_SYNC) parts=KW_PARTITIONS partitionSelectorSpec?)? opt=(KW_ADD | KW_DROP | KW_SYNC) parts=KW_PARTITIONS partitionSelectorSpec?
)?
) )
; ;
@ -539,8 +532,9 @@ resourceType
; ;
createFunctionStatement createFunctionStatement
: KW_CREATE temp=KW_TEMPORARY? KW_FUNCTION functionNameCreate KW_AS StringLiteral : KW_CREATE temp=KW_TEMPORARY? KW_FUNCTION functionNameCreate KW_AS StringLiteral (
(KW_USING rList=resourceList)? KW_USING rList=resourceList
)?
; ;
dropFunctionStatement dropFunctionStatement
@ -552,8 +546,7 @@ reloadFunctionsStatement
; ;
createMacroStatement createMacroStatement
: KW_CREATE KW_TEMPORARY KW_MACRO Identifier : KW_CREATE KW_TEMPORARY KW_MACRO Identifier LPAREN columnNameTypeList? RPAREN expression
LPAREN columnNameTypeList? RPAREN expression
; ;
dropMacroStatement dropMacroStatement
@ -561,25 +554,21 @@ dropMacroStatement
; ;
createIndexStatement createIndexStatement
: KW_CREATE KW_INDEX id_ KW_ON KW_TABLE tableName columnParenthesesList KW_AS indextype=StringLiteral : KW_CREATE KW_INDEX id_ KW_ON KW_TABLE tableName columnParenthesesList KW_AS indextype=StringLiteral (
(KW_WITH KW_DEFERRED KW_REBUILD)? KW_WITH KW_DEFERRED KW_REBUILD
(KW_IDXPROPERTIES tableProperties)? )? (KW_IDXPROPERTIES tableProperties)? (KW_IN KW_TABLE tableName)? (
(KW_IN KW_TABLE tableName)? KW_PARTITIONED KW_BY columnParenthesesList
(KW_PARTITIONED KW_BY columnParenthesesList)? )? (tableRowFormat? tableFileFormat)? (KW_LOCATION locn=StringLiteral)? tablePropertiesPrefixed? tableComment?
(tableRowFormat? tableFileFormat)? ;
(KW_LOCATION locn=StringLiteral)?
tablePropertiesPrefixed?
tableComment?;
dropIndexStatement dropIndexStatement
: KW_DROP KW_INDEX ifExists? id_ KW_ON tableName; : KW_DROP KW_INDEX ifExists? id_ KW_ON tableName
;
createViewStatement createViewStatement
: KW_CREATE orReplace? KW_VIEW ifNotExists? name=viewNameCreate : KW_CREATE orReplace? KW_VIEW ifNotExists? name=viewNameCreate (
(LPAREN columnNameCommentList RPAREN)? tableComment? viewPartition? LPAREN columnNameCommentList RPAREN
tablePropertiesPrefixed? )? tableComment? viewPartition? tablePropertiesPrefixed? KW_AS selectStatementWithCTE
KW_AS
selectStatementWithCTE
; ;
viewPartition viewPartition
@ -612,10 +601,8 @@ dropViewStatement
; ;
createMaterializedViewStatement createMaterializedViewStatement
: KW_CREATE KW_MATERIALIZED KW_VIEW ifNotExists? name=viewNameCreate : KW_CREATE KW_MATERIALIZED KW_VIEW ifNotExists? name=viewNameCreate rewriteDisabled? tableComment? viewPartition? viewOrganization?
rewriteDisabled? tableComment? viewPartition? viewOrganization? tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? KW_AS selectStatementWithCTE
tableRowFormat? tableFileFormat? tableLocation?
tablePropertiesPrefixed? KW_AS selectStatementWithCTE
; ;
dropMaterializedViewStatement dropMaterializedViewStatement
@ -623,11 +610,7 @@ dropMaterializedViewStatement
; ;
createScheduledQueryStatement createScheduledQueryStatement
: KW_CREATE KW_SCHEDULED KW_QUERY name=id_ : KW_CREATE KW_SCHEDULED KW_QUERY name=id_ scheduleSpec executedAsSpec? enableSpecification? definedAsSpec
scheduleSpec
executedAsSpec?
enableSpecification?
definedAsSpec
; ;
dropScheduledQueryStatement dropScheduledQueryStatement
@ -648,8 +631,9 @@ alterScheduledQueryChange
scheduleSpec scheduleSpec
: KW_CRON cronString=StringLiteral : KW_CRON cronString=StringLiteral
| KW_EVERY value=Number? qualifier=intervalQualifiers | KW_EVERY value=Number? qualifier=intervalQualifiers (
((KW_AT | KW_OFFSET KW_BY) offsetTs=StringLiteral)? (KW_AT | KW_OFFSET KW_BY) offsetTs=StringLiteral
)?
; ;
executedAsSpec executedAsSpec
@ -670,8 +654,8 @@ tableComment
; ;
createTablePartitionSpec createTablePartitionSpec
: KW_PARTITIONED KW_BY : KW_PARTITIONED KW_BY (
( LPAREN (opt1=createTablePartitionColumnTypeSpec | opt2=createTablePartitionColumnSpec) LPAREN (opt1=createTablePartitionColumnTypeSpec | opt2=createTablePartitionColumnSpec)
| KW_SPEC LPAREN spec=partitionTransformSpec | KW_SPEC LPAREN spec=partitionTransformSpec
) RPAREN ) RPAREN
; ;
@ -699,8 +683,9 @@ partitionTransformType
; ;
tableBuckets tableBuckets
: KW_CLUSTERED KW_BY LPAREN bucketCols=columnNameList RPAREN : KW_CLUSTERED KW_BY LPAREN bucketCols=columnNameList RPAREN (
(KW_SORTED KW_BY LPAREN sortCols=columnNameOrderList RPAREN)? KW_INTO num=Number KW_BUCKETS KW_SORTED KW_BY LPAREN sortCols=columnNameOrderList RPAREN
)? KW_INTO num=Number KW_BUCKETS
; ;
tableImplBuckets tableImplBuckets
@ -725,12 +710,14 @@ recordWriter
; ;
rowFormatSerde 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 rowFormatDelimited
: KW_ROW KW_FORMAT KW_DELIMITED tableRowFormatFieldIdentifier? tableRowFormatCollItemsIdentifier? : KW_ROW KW_FORMAT KW_DELIMITED tableRowFormatFieldIdentifier? tableRowFormatCollItemsIdentifier? tableRowFormatMapKeysIdentifier?
tableRowFormatMapKeysIdentifier? tableRowFormatLinesIdentifier? tableRowNullFormat? tableRowFormatLinesIdentifier? tableRowNullFormat?
; ;
tableRowFormat tableRowFormat
@ -760,7 +747,9 @@ keyProperty
; ;
tableRowFormatFieldIdentifier 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 tableRowFormatCollItemsIdentifier
@ -780,16 +769,15 @@ tableRowNullFormat
; ;
tableFileFormat tableFileFormat
: KW_STORED KW_AS KW_INPUTFORMAT : KW_STORED KW_AS KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral (
inFmt=StringLiteral KW_OUTPUTFORMAT KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral
outFmt=StringLiteral )?
(KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)? | KW_STORED KW_BY storageHandler=StringLiteral (
| KW_STORED KW_BY storageHandler=StringLiteral KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties
(KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)? )? (KW_STORED KW_AS fileformat=id_)?
(KW_STORED KW_AS fileformat=id_)? | KW_STORED KW_BY genericSpec=id_ (KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)? (
| KW_STORED KW_BY genericSpec=id_ KW_STORED KW_AS fileformat=id_
(KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)? )?
(KW_STORED KW_AS fileformat=id_)?
| KW_STORED KW_AS genericSpec=id_ | KW_STORED KW_AS genericSpec=id_
; ;
@ -880,13 +868,13 @@ checkConstraint
; ;
createForeignKey createForeignKey
: (KW_CONSTRAINT constraintName=id_)? KW_FOREIGN KW_KEY fkCols=columnParenthesesList : (KW_CONSTRAINT constraintName=id_)? KW_FOREIGN KW_KEY fkCols=columnParenthesesList KW_REFERENCES tabName=tableName parCols=columnParenthesesList
KW_REFERENCES tabName=tableName parCols=columnParenthesesList constraintOptsCreate? constraintOptsCreate?
; ;
alterForeignKeyWithName alterForeignKeyWithName
: KW_CONSTRAINT constraintName=id_ KW_FOREIGN KW_KEY fkCols=columnParenthesesList : KW_CONSTRAINT constraintName=id_ KW_FOREIGN KW_KEY fkCols=columnParenthesesList KW_REFERENCES tabName=tableName parCols=columnParenthesesList
KW_REFERENCES tabName=tableName parCols=columnParenthesesList constraintOptsAlter? constraintOptsAlter?
; ;
skewedValueElement skewedValueElement
@ -1032,7 +1020,8 @@ type
| listType | listType
| structType | structType
| mapType | mapType
| unionType; | unionType
;
primitiveType primitiveType
: KW_TINYINT : KW_TINYINT
@ -1121,25 +1110,13 @@ regularBody
; ;
atomSelectStatement atomSelectStatement
: s=selectClause : s=selectClause f=fromClause? w=whereClause? g=groupByClause? h=havingClause? win=window_clause? q=qualifyClause?
f=fromClause?
w=whereClause?
g=groupByClause?
h=havingClause?
win=window_clause?
q=qualifyClause?
| LPAREN selectStatement RPAREN | LPAREN selectStatement RPAREN
| valuesSource | valuesSource
; ;
selectStatement selectStatement
: a=atomSelectStatement : a=atomSelectStatement set=setOpSelectStatement? o=orderByClause? c=clusterByClause? d=distributeByClause? sort=sortByClause? l=limitClause?
set=setOpSelectStatement?
o=orderByClause?
c=clusterByClause?
d=distributeByClause?
sort=sortByClause?
l=limitClause?
; ;
setOpSelectStatement setOpSelectStatement
@ -1151,35 +1128,15 @@ selectStatementWithCTE
; ;
body body
: insertClause : insertClause selectClause lateralView? whereClause? groupByClause? havingClause? window_clause? qualifyClause? orderByClause? clusterByClause?
selectClause distributeByClause? sortByClause? limitClause?
lateralView? | selectClause lateralView? whereClause? groupByClause? havingClause? window_clause? qualifyClause? orderByClause? clusterByClause?
whereClause? distributeByClause? sortByClause? limitClause?
groupByClause?
havingClause?
window_clause?
qualifyClause?
orderByClause?
clusterByClause?
distributeByClause?
sortByClause?
limitClause?
| selectClause
lateralView?
whereClause?
groupByClause?
havingClause?
window_clause?
qualifyClause?
orderByClause?
clusterByClause?
distributeByClause?
sortByClause?
limitClause?
; ;
insertClause insertClause
: KW_INSERT ( KW_OVERWRITE destination ifNotExists? : KW_INSERT (
KW_OVERWRITE destination ifNotExists?
| KW_INTO KW_TABLE? tableOrPartition (LPAREN targetCols=columnNameList RPAREN)? | KW_INTO KW_TABLE? tableOrPartition (LPAREN targetCols=columnNameList RPAREN)?
) )
; ;
@ -1267,6 +1224,7 @@ rollbackStatement
setAutoCommitStatement setAutoCommitStatement
: KW_SET KW_AUTOCOMMIT booleanValueTok : KW_SET KW_AUTOCOMMIT booleanValueTok
; ;
/* /*
END user defined transaction boundaries END user defined transaction boundaries
*/ */
@ -1285,6 +1243,7 @@ BEGIN SQL Merge statement
mergeStatement mergeStatement
: KW_MERGE QUERY_HINT? KW_INTO tableName (KW_AS? id_)? KW_USING joinSourcePart KW_ON expression whenClauses : 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 Allow 0,1 or 2 WHEN MATCHED clauses and 0 or 1 WHEN NOT MATCHED
Each WHEN clause may have AND <boolean predicate>. Each WHEN clause may have AND <boolean predicate>.
@ -1311,6 +1270,7 @@ updateOrDelete
: KW_UPDATE setColumnsClause : KW_UPDATE setColumnsClause
| KW_DELETE | KW_DELETE
; ;
/* /*
END SQL Merge statement END SQL Merge statement
*/ */
@ -1343,7 +1303,8 @@ END SHOW COMPACTIONS statement
*/ */
alterStatement alterStatement
: KW_ALTER ( KW_TABLE tableName alterTableStatementSuffix : KW_ALTER (
KW_TABLE tableName alterTableStatementSuffix
| KW_VIEW viewName KW_AS? alterViewStatementSuffix | KW_VIEW viewName KW_AS? alterViewStatementSuffix
| KW_MATERIALIZED KW_VIEW tableNameTree=viewName alterMaterializedViewStatementSuffix | KW_MATERIALIZED KW_VIEW tableNameTree=viewName alterMaterializedViewStatementSuffix
| db_schema alterDatabaseStatementSuffix | db_schema alterDatabaseStatementSuffix
@ -1465,12 +1426,15 @@ alterStatementSuffixDropConstraint
; ;
alterStatementSuffixRenameCol alterStatementSuffixRenameCol
: KW_CHANGE KW_COLUMN? oldName=columnName newName=columnNameCreate colType alterColumnConstraint? : KW_CHANGE KW_COLUMN? oldName=columnName newName=columnNameCreate colType alterColumnConstraint? (
(KW_COMMENT comment=StringLiteral)? alterStatementChangeColPosition? restrictOrCascade? KW_COMMENT comment=StringLiteral
)? alterStatementChangeColPosition? restrictOrCascade?
; ;
alterStatementSuffixUpdateStatsCol 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 alterStatementSuffixUpdateStats
@ -1511,7 +1475,9 @@ alterStatementSuffixRecoverPartitions
; ;
alterStatementSuffixDropPartitions 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 alterStatementSuffixProperties
@ -1525,7 +1491,8 @@ alterViewSuffixProperties
; ;
alterStatementSuffixSerdeProperties alterStatementSuffixSerdeProperties
: KW_SET ( KW_SERDE serdeName=StringLiteral (KW_WITH KW_SERDEPROPERTIES tableProperties)? : KW_SET (
KW_SERDE serdeName=StringLiteral (KW_WITH KW_SERDEPROPERTIES tableProperties)?
| KW_SERDEPROPERTIES tableProperties | KW_SERDEPROPERTIES tableProperties
) )
| KW_UNSET KW_SERDEPROPERTIES tableProperties | KW_UNSET KW_SERDEPROPERTIES tableProperties
@ -1578,7 +1545,9 @@ alterStatementSuffixRenamePart
; ;
alterStatementSuffixStatsPart 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 alterStatementSuffixMergeFiles
@ -1598,7 +1567,9 @@ compactPool
; ;
alterStatementSuffixCompact 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 alterStatementSuffixSetOwner
@ -1610,20 +1581,21 @@ alterStatementSuffixSetPartSpec
; ;
alterStatementSuffixExecute alterStatementSuffixExecute
: KW_EXECUTE ( KW_ROLLBACK LPAREN rollbackParam=(StringLiteral | Number) : KW_EXECUTE (
KW_ROLLBACK LPAREN rollbackParam=(StringLiteral | Number)
| KW_EXPIRE_SNAPSHOTS LPAREN expireParam=StringLiteral | KW_EXPIRE_SNAPSHOTS LPAREN expireParam=StringLiteral
| KW_SET_CURRENT_SNAPSHOT LPAREN snapshotParam=Number | KW_SET_CURRENT_SNAPSHOT LPAREN snapshotParam=Number
) RPAREN ) RPAREN
; ;
alterIndexStatementSuffix alterIndexStatementSuffix
: id_ KW_ON tableName : id_ KW_ON tableName partitionSpec? KW_REBUILD
partitionSpec? ;
KW_REBUILD;
fileFormat fileFormat
: KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral KW_SERDE serdeCls=StringLiteral : KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral KW_SERDE serdeCls=StringLiteral (
(KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)? KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral
)?
| genericSpec=id_ | genericSpec=id_
; ;
@ -1655,46 +1627,22 @@ likeTableOrFile
Rules for parsing createtable Rules for parsing createtable
*/ */
createTableStatement createTableStatement
: KW_CREATE temp=KW_TEMPORARY? trans=KW_TRANSACTIONAL? ext=KW_EXTERNAL? KW_TABLE ifNotExists? name=tableNameCreate : KW_CREATE temp=KW_TEMPORARY? trans=KW_TRANSACTIONAL? ext=KW_EXTERNAL? KW_TABLE ifNotExists? name=tableNameCreate (
( likeTableOrFile likeTableOrFile createTablePartitionSpec? tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed?
createTablePartitionSpec? | (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? createTablePartitionSpec? tableBuckets? tableSkewed? tableRowFormat?
tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? (KW_AS selectStatementWithCTE)?
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 | KW_CREATE mgd=KW_MANAGED KW_TABLE ifNotExists? name=tableNameCreate (
( likeTableOrFile likeTableOrFile tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed?
tableRowFormat? | (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? createTablePartitionSpec? tableBuckets? tableSkewed? tableRowFormat?
tableFileFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? (KW_AS selectStatementWithCTE)?
tableLocation?
tablePropertiesPrefixed?
| (LPAREN columnNameTypeOrConstraintList RPAREN)?
tableComment?
createTablePartitionSpec?
tableBuckets?
tableSkewed?
tableRowFormat?
tableFileFormat?
tableLocation?
tablePropertiesPrefixed?
(KW_AS selectStatementWithCTE)?
) )
; ;
createDataConnectorStatement createDataConnectorStatement
: KW_CREATE KW_DATACONNECTOR ifNotExists? name=id_ dataConnectorType? dataConnectorUrl? dataConnectorComment? : KW_CREATE KW_DATACONNECTOR ifNotExists? name=id_ dataConnectorType? dataConnectorUrl? dataConnectorComment? (
(KW_WITH KW_DCPROPERTIES dcprops=dcProperties)? KW_WITH KW_DCPROPERTIES dcprops=dcProperties
)?
; ;
dataConnectorComment dataConnectorComment
@ -1756,7 +1704,9 @@ atomjoinSource
; ;
joinSource joinSource
: atomjoinSource (joinToken joinSourcePart (KW_ON expression | KW_USING columnParenthesesList)?)* : atomjoinSource (
joinToken joinSourcePart (KW_ON expression | KW_USING columnParenthesesList)?
)*
; ;
joinSourcePart joinSourcePart
@ -1777,7 +1727,8 @@ uniqueJoinToken
joinToken joinToken
: COMMA : COMMA
| ( KW_INNER | (
KW_INNER
| KW_CROSS | KW_CROSS
| (KW_RIGHT | KW_FULL) KW_OUTER? | (KW_RIGHT | KW_FULL) KW_OUTER?
| KW_LEFT (KW_SEMI | KW_ANTI | KW_OUTER)? | KW_LEFT (KW_SEMI | KW_ANTI | KW_OUTER)?
@ -1786,7 +1737,8 @@ joinToken
lateralView lateralView
: KW_LATERAL KW_VIEW KW_OUTER function_ tableAlias (KW_AS id_ (COMMA id_)*)? : 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_)*)? | 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)? | KW_TABLE LPAREN valuesClause RPAREN KW_AS? tableAlias (LPAREN id_ (COMMA id_)* RPAREN)?
) )
; ;
@ -1796,8 +1748,9 @@ tableAlias
; ;
tableBucketSample tableBucketSample
: KW_TABLESAMPLE LPAREN KW_BUCKET numerator=Number KW_OUT KW_OF denominator=Number : KW_TABLESAMPLE LPAREN KW_BUCKET numerator=Number KW_OUT KW_OF denominator=Number (
(KW_ON expr+=expression (COMMA expr+=expression)*)? RPAREN KW_ON expr+=expression (COMMA expr+=expression)*
)? RPAREN
; ;
splitSample splitSample
@ -1810,11 +1763,14 @@ tableSample
; ;
tableSource 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 asOfClause
: KW_FOR ( KW_SYSTEM_TIME KW_AS KW_OF asOfTime=expression : 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_VERSION KW_AS KW_OF asOfVersion=Number
) )
; ;
@ -1876,10 +1832,9 @@ partitionTableFunctionSource
; ;
partitionedTableFunction partitionedTableFunction
: n=id_ LPAREN KW_ON : n=id_ LPAREN KW_ON ptfsrc=partitionTableFunctionSource spec=partitioningSpec? (
ptfsrc=partitionTableFunctionSource spec=partitioningSpec? Identifier LPAREN expression RPAREN (COMMA Identifier LPAREN expression RPAREN)*
(Identifier LPAREN expression RPAREN (COMMA Identifier LPAREN expression RPAREN)*)? )? RPAREN alias=id_?
RPAREN alias=id_?
; ;
/** /**
@ -1954,11 +1909,9 @@ selectList
; ;
selectTrfmClause selectTrfmClause
: LPAREN selectExpressionList RPAREN : LPAREN selectExpressionList RPAREN rowFormat recordWriter KW_USING StringLiteral (
rowFormat recordWriter KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList)
KW_USING StringLiteral )? rowFormat recordReader
(KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList))?
rowFormat recordReader
; ;
selectItem selectItem
@ -1967,11 +1920,9 @@ selectItem
; ;
trfmClause trfmClause
: (KW_MAP | KW_REDUCE) selectExpressionList : (KW_MAP | KW_REDUCE) selectExpressionList rowFormat recordWriter KW_USING StringLiteral (
rowFormat recordWriter KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList)
KW_USING StringLiteral )? rowFormat recordReader
(KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList))?
rowFormat recordReader
; ;
selectExpression selectExpression
@ -2005,13 +1956,15 @@ window_frame
; ;
window_range_expression window_range_expression
: KW_ROWS ( window_frame_start_boundary : KW_ROWS (
window_frame_start_boundary
| KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary | KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary
) )
; ;
window_value_expression window_value_expression
: KW_RANGE ( window_frame_start_boundary : KW_RANGE (
window_frame_start_boundary
| KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary | KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary
) )
; ;
@ -2046,15 +1999,14 @@ groupByEmpty
// standard rollup syntax // standard rollup syntax
rollupStandard rollupStandard
: (rollup=KW_ROLLUP | cube=KW_CUBE) : (rollup=KW_ROLLUP | cube=KW_CUBE) LPAREN expression (COMMA expression)* RPAREN
LPAREN expression (COMMA expression)* RPAREN
; ;
// old hive rollup syntax // old hive rollup syntax
rollupOldSyntax rollupOldSyntax
: expr=expressionsNotInParenthesis : expr=expressionsNotInParenthesis (rollup=KW_WITH KW_ROLLUP | cube=KW_WITH KW_CUBE)? (
(rollup=KW_WITH KW_ROLLUP | cube=KW_WITH KW_CUBE)? sets=KW_GROUPING KW_SETS LPAREN groupingSetExpression (COMMA groupingSetExpression)* RPAREN
(sets=KW_GROUPING KW_SETS LPAREN groupingSetExpression (COMMA groupingSetExpression)* RPAREN)? )?
; ;
groupingSetExpression groupingSetExpression
@ -2150,17 +2102,16 @@ sortByClause
// TRIM([LEADING|TRAILING|BOTH] trim_characters FROM str) // TRIM([LEADING|TRAILING|BOTH] trim_characters FROM str)
trimFunction trimFunction
: KW_TRIM LPAREN (leading=KW_LEADING | trailing=KW_TRAILING | KW_BOTH)? : KW_TRIM LPAREN (leading=KW_LEADING | trailing=KW_TRAILING | KW_BOTH)? trim_characters=selectExpression? KW_FROM str=selectExpression RPAREN
trim_characters=selectExpression? KW_FROM str=selectExpression RPAREN
; ;
// fun(par1, par2, par3) // fun(par1, par2, par3)
function_ function_
: trimFunction : trimFunction
| functionNameForInvoke | functionNameForInvoke LPAREN (
LPAREN star=STAR
(star=STAR | dist=all_distinct? (selectExpression (COMMA selectExpression)*)?) | dist=all_distinct? (selectExpression (COMMA selectExpression)*)?
( ) (
// SELECT rank(3) WITHIN GROUP (<order by clause>) // SELECT rank(3) WITHIN GROUP (<order by clause>)
RPAREN within=KW_WITHIN KW_GROUP LPAREN ordBy=orderByClause RPAREN RPAREN within=KW_WITHIN KW_GROUP LPAREN ordBy=orderByClause RPAREN
// No null treatment: SELECT first_value(b) OVER (<window spec>) // No null treatment: SELECT first_value(b) OVER (<window spec>)
@ -2201,27 +2152,15 @@ internalFunctionName // Hive Internal Function
; ;
castExpression castExpression
: KW_CAST : KW_CAST LPAREN expression KW_AS toType=primitiveType (fmt=KW_FORMAT StringLiteral)? RPAREN
LPAREN
expression
KW_AS
toType=primitiveType
(fmt=KW_FORMAT StringLiteral)?
RPAREN
; ;
caseExpression caseExpression
: KW_CASE expression : KW_CASE expression (KW_WHEN expression KW_THEN expression)+ (KW_ELSE expression)? KW_END
(KW_WHEN expression KW_THEN expression)+
(KW_ELSE expression)?
KW_END
; ;
whenExpression whenExpression
: KW_CASE : KW_CASE (KW_WHEN expression KW_THEN expression)+ (KW_ELSE expression)? KW_END
(KW_WHEN expression KW_THEN expression)+
(KW_ELSE expression)?
KW_END
; ;
floorExpression floorExpression
@ -2363,7 +2302,9 @@ precedenceBitwiseXorOperator
; ;
precedenceBitwiseXorExpression precedenceBitwiseXorExpression
: precedenceUnaryPrefixExpression (precedenceBitwiseXorOperator precedenceUnaryPrefixExpression)* : precedenceUnaryPrefixExpression (
precedenceBitwiseXorOperator precedenceUnaryPrefixExpression
)*
; ;
precedenceStarOperator precedenceStarOperator
@ -2392,7 +2333,6 @@ precedenceConcatenateOperator
precedenceConcatenateExpression precedenceConcatenateExpression
: precedencePlusExpression (precedenceConcatenateOperator plus=precedencePlusExpression)* : precedencePlusExpression (precedenceConcatenateOperator plus=precedencePlusExpression)*
; ;
precedenceAmpersandOperator precedenceAmpersandOperator
@ -2483,8 +2423,8 @@ precedenceEqualOperator
; ;
precedenceEqualExpression precedenceEqualExpression
: precedenceSimilarExpression : precedenceSimilarExpression (
( equal+=precedenceEqualOperator p+=precedenceSimilarExpression equal+=precedenceEqualOperator p+=precedenceSimilarExpression
| dist+=precedenceDistinctOperator p+=precedenceSimilarExpression | dist+=precedenceDistinctOperator p+=precedenceSimilarExpression
)* )*
; ;
@ -2988,8 +2928,10 @@ rpUnassignList
; ;
createResourcePlanStatement createResourcePlanStatement
: KW_CREATE KW_RESOURCE KW_PLAN ifNotExists? : KW_CREATE KW_RESOURCE KW_PLAN ifNotExists? (
(name=id_ KW_LIKE likeName=id_ | name=id_ (KW_WITH rpAssignList)?) name=id_ KW_LIKE likeName=id_
| name=id_ (KW_WITH rpAssignList)?
)
; ;
withReplace withReplace
@ -3131,13 +3073,12 @@ triggerActionExpressionStandalone
; ;
createTriggerStatement createTriggerStatement
: KW_CREATE KW_TRIGGER rpName=id_ DOT triggerName=id_ : KW_CREATE KW_TRIGGER rpName=id_ DOT triggerName=id_ KW_WHEN triggerExpression KW_DO triggerActionExpression
KW_WHEN triggerExpression KW_DO triggerActionExpression
; ;
alterTriggerStatement alterTriggerStatement
: KW_ALTER KW_TRIGGER rpName=id_ DOT triggerName=id_ : KW_ALTER KW_TRIGGER rpName=id_ DOT triggerName=id_ (
( KW_WHEN triggerExpression KW_DO triggerActionExpression KW_WHEN triggerExpression KW_DO triggerActionExpression
| (KW_ADD KW_TO | KW_DROP KW_FROM) (KW_POOL poolName=poolPath | KW_UNMANAGED) | (KW_ADD KW_TO | KW_DROP KW_FROM) (KW_POOL poolName=poolPath | KW_UNMANAGED)
) )
; ;
@ -3147,7 +3088,8 @@ dropTriggerStatement
; ;
poolAssign poolAssign
: ( KW_ALLOC_FRACTION EQUAL allocFraction=Number : (
KW_ALLOC_FRACTION EQUAL allocFraction=Number
| KW_QUERY_PARALLELISM EQUAL parallelism=Number | KW_QUERY_PARALLELISM EQUAL parallelism=Number
| KW_SCHEDULING_POLICY EQUAL policy=StringLiteral | KW_SCHEDULING_POLICY EQUAL policy=StringLiteral
| KW_PATH EQUAL path=poolPath | KW_PATH EQUAL path=poolPath
@ -3159,13 +3101,12 @@ poolAssignList
; ;
createPoolStatement createPoolStatement
: KW_CREATE KW_POOL rpName=id_ DOT poolPath : KW_CREATE KW_POOL rpName=id_ DOT poolPath KW_WITH poolAssignList
KW_WITH poolAssignList
; ;
alterPoolStatement alterPoolStatement
: KW_ALTER KW_POOL rpName=id_ DOT poolPath : KW_ALTER KW_POOL rpName=id_ DOT poolPath (
( KW_SET poolAssignList KW_SET poolAssignList
| KW_UNSET KW_SCHEDULING_POLICY | KW_UNSET KW_SCHEDULING_POLICY
| (KW_ADD | KW_DROP) KW_TRIGGER triggerName=id_ | (KW_ADD | KW_DROP) KW_TRIGGER triggerName=id_
) )
@ -3176,20 +3117,19 @@ dropPoolStatement
; ;
createMappingStatement createMappingStatement
: KW_CREATE mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) : KW_CREATE mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_ (
KW_MAPPING name=StringLiteral KW_TO path=poolPath
KW_IN rpName=id_ (KW_TO path=poolPath | unmanaged) | unmanaged
(KW_WITH KW_ORDER order=Number)? ) (KW_WITH KW_ORDER order=Number)?
; ;
alterMappingStatement alterMappingStatement
: KW_ALTER mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) : KW_ALTER mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_ (
KW_MAPPING name=StringLiteral KW_TO path=poolPath
KW_IN rpName=id_ (KW_TO path=poolPath | unmanaged) | unmanaged
(KW_WITH KW_ORDER order=Number)? ) (KW_WITH KW_ORDER order=Number)?
; ;
dropMappingStatement dropMappingStatement
: KW_DROP mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING : KW_DROP mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_
name=StringLiteral KW_IN rpName=id_
; ;

View File

@ -19,9 +19,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. 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; lexer grammar ImpalaSqlLexer;
options { caseInsensitive = true; } options {
caseInsensitive=true;
}
KW_ADD : 'ADD'; KW_ADD : 'ADD';
KW_ALL : 'ALL'; KW_ALL : 'ALL';
@ -286,84 +293,43 @@ QUESTION : '?';
RIGHT_ARROW: '->'; RIGHT_ARROW: '->';
STRING STRING: '\'' ( ~'\'' | '\'\'')* '\'' | '"' ( ~'"' | '""')* '"';
: '\'' ( ~'\'' | '\'\'' )* '\''
| '"' ( ~'"' | '""' )* '"'
;
UNICODE_STRING UNICODE_STRING: 'U&\'' ( ~'\'' | '\'\'')* '\'';
: 'U&\'' ( ~'\'' | '\'\'' )* '\''
;
// Note: we allow any character inside the binary literal and validate // Note: we allow any character inside the binary literal and validate
// its a correct literal when the AST is being constructed. This // its a correct literal when the AST is being constructed. This
// allows us to provide more meaningful error messages to the user // allows us to provide more meaningful error messages to the user
BINARY_LITERAL BINARY_LITERAL: 'X\'' (~'\'')* '\'';
: 'X\'' (~'\'')* '\''
;
INTEGER_VALUE INTEGER_VALUE: DIGIT+;
: DIGIT+
;
DECIMAL_VALUE DECIMAL_VALUE: DIGIT+ '.' DIGIT* | '.' DIGIT+;
: DIGIT+ '.' DIGIT*
| '.' DIGIT+
;
DOUBLE_VALUE DOUBLE_VALUE: DIGIT+ ('.' DIGIT*)? EXPONENT | '.' DIGIT+ EXPONENT;
: DIGIT+ ('.' DIGIT*)? EXPONENT
| '.' DIGIT+ EXPONENT
;
IDENTIFIER IDENTIFIER: (LETTER | '_') (LETTER | DIGIT | '_' | '@' | ':')*;
: (LETTER | '_') (LETTER | DIGIT | '_' | '@' | ':')*
;
DIGIT_IDENTIFIER DIGIT_IDENTIFIER: DIGIT (LETTER | DIGIT | '_' | '@' | ':')+;
: DIGIT (LETTER | DIGIT | '_' | '@' | ':')+
;
QUOTED_IDENTIFIER QUOTED_IDENTIFIER: '"' ( ~'"' | '""')* '"';
: '"' ( ~'"' | '""' )* '"'
;
BACKQUOTED_IDENTIFIER BACKQUOTED_IDENTIFIER: '`' ( ~'`' | '``')* '`';
: '`' ( ~'`' | '``' )* '`'
;
TIME_WITH_TIME_ZONE TIME_WITH_TIME_ZONE: 'TIME' WS 'WITH' WS 'TIME' WS 'ZONE';
: 'TIME' WS 'WITH' WS 'TIME' WS 'ZONE'
;
TIMESTAMP_WITH_TIME_ZONE TIMESTAMP_WITH_TIME_ZONE: 'TIMESTAMP' WS 'WITH' WS 'TIME' WS 'ZONE';
: 'TIMESTAMP' WS 'WITH' WS 'TIME' WS 'ZONE'
;
DOUBLE_PRECISION DOUBLE_PRECISION: 'DOUBLE' WS 'PRECISION';
: 'DOUBLE' WS 'PRECISION'
;
fragment EXPONENT fragment EXPONENT: 'E' [+-]? DIGIT+;
: 'E' [+-]? DIGIT+
;
fragment DIGIT fragment DIGIT: [0-9];
: [0-9]
;
fragment LETTER fragment LETTER: [A-Z];
: [A-Z]
;
SIMPLE_COMMENT SIMPLE_COMMENT: '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN);
: '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN)
;
BRACKETED_COMMENT BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
: '/*' .*? '*/' -> channel(HIDDEN)
;
WS WS: [ \r\n\t]+ -> channel(HIDDEN);
: [ \r\n\t]+ -> channel(HIDDEN)
;

View File

@ -12,6 +12,10 @@
* limitations under the License. * 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; parser grammar ImpalaSqlParser;
options options
@ -19,7 +23,9 @@ options
tokenVocab=ImpalaSqlLexer; tokenVocab=ImpalaSqlLexer;
} }
program: singleStatement* EOF; program
: singleStatement* EOF
;
singleStatement singleStatement
: sqlStatement SEMICOLON? : sqlStatement SEMICOLON?
@ -50,7 +56,9 @@ sqlStatement
| refreshStatement | refreshStatement
; ;
useStatement: KW_USE databaseNamePath; useStatement
: KW_USE databaseNamePath
;
createStatement createStatement
: createSchema : createSchema
@ -64,59 +72,56 @@ createStatement
; ;
createTableSelect createTableSelect
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate (
(LPAREN columnDefinition (COMMA columnDefinition)* (COMMA constraintSpecification)? RPAREN)? LPAREN columnDefinition (COMMA columnDefinition)* (COMMA constraintSpecification)? RPAREN
(KW_PARTITIONED KW_BY (partitionedBy | createColumnAliases) )? )? (KW_PARTITIONED KW_BY (partitionedBy | createColumnAliases))? createCommonItem (
createCommonItem KW_AS queryStatement
(KW_AS queryStatement)? )?
; ;
createTableLike createTableLike
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate KW_LIKE (
KW_LIKE (tableNamePath | KW_PARQUET parquet=stringLiteral) tableNamePath
(KW_PARTITIONED KW_BY partitionedBy)? | KW_PARQUET parquet=stringLiteral
createCommonItem ) (KW_PARTITIONED KW_BY partitionedBy)? createCommonItem
; ;
createKuduTableAsSelect createKuduTableAsSelect
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate : KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate (
(LPAREN kuduTableElement (COMMA kuduTableElement)* (COMMA KW_PRIMARY KW_KEY columnAliases)? RPAREN)? LPAREN kuduTableElement (COMMA kuduTableElement)* (COMMA KW_PRIMARY KW_KEY columnAliases)? RPAREN
(KW_PRIMARY KW_KEY columnAliases?)? )? (KW_PRIMARY KW_KEY columnAliases?)? (KW_PARTITION KW_BY kuduPartitionClause)? (
(KW_PARTITION KW_BY kuduPartitionClause)? KW_COMMENT stringLiteral
(KW_COMMENT stringLiteral)? )? KW_STORED KW_AS KW_KUDU (KW_TBLPROPERTIES tblProp=properties)? (KW_AS queryStatement)?
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; createView
: KW_CREATE KW_VIEW ifNotExists? viewNameCreate viewColumns? (KW_COMMENT stringLiteral)? (
createSchema: KW_TBLPROPERTIES tblProp=properties
KW_CREATE (KW_SCHEMA | KW_DATABASE) ifNotExists? databaseNameCreate )? KW_AS queryStatement
(KW_COMMENT comment=stringLiteral)? (KW_LOCATION location=stringLiteral)?
; ;
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 createAggregateFunction
: KW_CREATE KW_AGGREGATE? KW_FUNCTION ifNotExists? functionNameCreate (LPAREN(type (COMMA type)*)? RPAREN)? : KW_CREATE KW_AGGREGATE? KW_FUNCTION ifNotExists? functionNameCreate (
KW_RETURNS type LPAREN (type (COMMA type)*)? RPAREN
(KW_INTERMEDIATE type)? )? 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_LOCATION STRING KW_PREPARE_FN EQ STRING
(KW_INIT_FN EQ STRING)? )? (KW_CLOSEFN EQ STRING)? (KW_SERIALIZE_FN EQ STRING)? (KW_FINALIZE_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 createFunction
: KW_CREATE KW_FUNCTION ifNotExists? functionNameCreate (LPAREN(type (COMMA type)*)? RPAREN)? : KW_CREATE KW_FUNCTION ifNotExists? functionNameCreate (LPAREN (type (COMMA type)*)? RPAREN)? (
(KW_RETURNS type)? KW_RETURNS type
KW_LOCATION STRING )? KW_LOCATION STRING KW_SYMBOL EQ symbol=stringLiteral
KW_SYMBOL EQ symbol=stringLiteral
; ;
alterStatement alterStatement
@ -140,54 +145,122 @@ alterStatement
| alterTableOwner | 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 computeStatement
: computeStats : computeStats
| computeIncrementalStats | 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 dropStatement
: dropRole : dropRole
@ -198,41 +271,65 @@ dropStatement
| dropSchema | 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 grantStatement
: grantRole : grantRole
| grant | 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 revokeStatement
: revokeRole : revokeRole
| revoke | 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 insertStatement
: with? KW_INSERT (KW_INTO | KW_OVERWRITE) KW_TABLE? tableNamePath : with? KW_INSERT (KW_INTO | KW_OVERWRITE) KW_TABLE? tableNamePath columnAliases? (
columnAliases? KW_PARTITION LPAREN expression (COMMA expression)* RPAREN
(KW_PARTITION LPAREN expression(COMMA expression)*RPAREN)? )? queryStatement
queryStatement
; ;
deleteStatement deleteStatement
@ -240,13 +337,25 @@ deleteStatement
| deleteTableRef | 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 showStatement
: showRoles : showRoles
@ -264,59 +373,80 @@ showStatement
; ;
showSchemas showSchemas
: KW_SHOW (KW_SCHEMAS | KW_DATABASES) : KW_SHOW (KW_SCHEMAS | KW_DATABASES) (
(KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*)? KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*
)?
; ;
showTables showTables
: : KW_SHOW KW_TABLES (KW_IN tableNamePath)? (
KW_SHOW KW_TABLES (KW_IN tableNamePath)? KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*
(KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*)? )?
; ;
showFunctions showFunctions
: : KW_SHOW (KW_AGGREGATE | KW_ANALYTIC)? KW_FUNCTIONS (KW_IN databaseNamePath)? (
KW_SHOW (KW_AGGREGATE | KW_ANALYTIC)? KW_FUNCTIONS (KW_IN databaseNamePath)? KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*
(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 showGrants
: showDatabaseGrant : showDatabaseGrant
| showTableGrant | showTableGrant
| showColumnGrant | showColumnGrant
| KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier | KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (
(KW_ON (KW_SERVER | KW_URI) (qualifiedName)?)? KW_ON (KW_SERVER | KW_URI) (qualifiedName)?
)?
; ;
showDatabaseGrant: showDatabaseGrant
KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier : KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (
(KW_ON KW_DATABASE (databaseNamePath)?)? KW_ON KW_DATABASE (databaseNamePath)?
)?
; ;
showTableGrant: showTableGrant
KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier : KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (KW_ON KW_TABLE (tableNamePath)?)?
(KW_ON KW_TABLE (tableNamePath)?)?
; ;
showColumnGrant: showColumnGrant
KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier : KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (
(KW_ON KW_COLUMN (columnNamePath)?)? KW_ON KW_COLUMN (columnNamePath)?
)?
; ;
addCommentStatement addCommentStatement
@ -325,32 +455,57 @@ addCommentStatement
| addColumnComments | addColumnComments
; ;
addDatabaseComments: KW_COMMENT KW_ON KW_DATABASE databaseNamePath KW_IS (stringLiteral | KW_NULL); 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)?
; ;
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 ifExists
: KW_IF KW_EXISTS : KW_IF KW_EXISTS
@ -360,38 +515,61 @@ ifNotExists
: KW_IF KW_NOT KW_EXISTS : 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 createCommonItem
: : (KW_SORT KW_BY columnAliases)? (KW_COMMENT comment=stringLiteral)? (
(KW_SORT KW_BY columnAliases)? KW_ROW KW_FORMAT rowFormat
(KW_COMMENT comment=stringLiteral)? )? (KW_WITH KW_SERDEPROPERTIES serdProp=properties)? (KW_STORED KW_AS fileFormat)? (
(KW_ROW KW_FORMAT rowFormat)? KW_LOCATION location=stringLiteral
(KW_WITH KW_SERDEPROPERTIES serdProp=properties)? )? (
(KW_STORED KW_AS fileFormat)? KW_CACHED KW_IN cacheName=qualifiedName (KW_WITH KW_REPLICATION EQ INTEGER_VALUE)?
(KW_LOCATION location=stringLiteral)? | KW_UNCACHED
(KW_CACHED KW_IN cacheName=qualifiedName (KW_WITH KW_REPLICATION EQ INTEGER_VALUE )? | KW_UNCACHED)? )? (KW_TBLPROPERTIES tblProp=properties)?
(KW_TBLPROPERTIES tblProp=properties)?
; ;
assignmentList assignmentList
@ -403,7 +581,9 @@ assignmentItem
; ;
viewColumns viewColumns
: LPAREN columnNamePath (KW_COMMENT stringLiteral)? (COMMA identifier (KW_COMMENT stringLiteral)?)* RPAREN : LPAREN columnNamePath (KW_COMMENT stringLiteral)? (
COMMA identifier (KW_COMMENT stringLiteral)?
)* RPAREN
; ;
queryStatement queryStatement
@ -415,13 +595,18 @@ with
; ;
constraintSpecification constraintSpecification
: : KW_PRIMARY KW_KEY columnAliases (KW_DISABLE)? (KW_NOVALIDATE | COMMA KW_NOVALIDATE)? (
KW_PRIMARY KW_KEY columnAliases (KW_DISABLE)? (KW_NOVALIDATE | COMMA KW_NOVALIDATE)? (KW_RELY | COMMA KW_RELY)? ((COMMA foreignKeySpecification | foreignKeySpecification) (COMMA foreignKeySpecification)*?)? KW_RELY
| COMMA KW_RELY
)? (
(COMMA foreignKeySpecification | foreignKeySpecification) (COMMA foreignKeySpecification)*?
)?
; ;
foreignKeySpecification foreignKeySpecification
: : KW_FOREIGN KW_KEY columnAliases KW_REFERENCES tableNamePath columnAliases (KW_DISABLE)? (
KW_FOREIGN KW_KEY columnAliases KW_REFERENCES tableNamePath columnAliases (KW_DISABLE)? (KW_NOVALIDATE)? (KW_RELY)? KW_NOVALIDATE
)? (KW_RELY)?
; ;
columnDefinition columnDefinition
@ -433,7 +618,9 @@ kuduTableElement
; ;
kuduColumnDefinition kuduColumnDefinition
: columnNamePathCreate type (kuduAttributes kuduAttributes*?)? (KW_COMMENT stringLiteral)? (KW_PRIMARY KW_KEY )? : columnNamePathCreate type (kuduAttributes kuduAttributes*?)? (KW_COMMENT stringLiteral)? (
KW_PRIMARY KW_KEY
)?
; ;
columnSpecWithKudu columnSpecWithKudu
@ -472,7 +659,8 @@ fileFormat
; ;
kuduPartitionClause kuduPartitionClause
: (hashClause (COMMA hashClause)*? (COMMA rangeClause)?) | rangeClause : (hashClause (COMMA hashClause)*? (COMMA rangeClause)?)
| rangeClause
; ;
hashClause hashClause
@ -480,11 +668,14 @@ hashClause
; ;
rangeClause 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 kuduPartitionSpec
: KW_VALUE partitionCol expression | (expression rangeOperator)? KW_VALUES (rangeOperator expression)? : KW_VALUE partitionCol expression
| (expression rangeOperator)? KW_VALUES (rangeOperator expression)?
; ;
cacheSpec cacheSpec
@ -528,17 +719,19 @@ sortedBy
; ;
rowFormat 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 property
: identifier (EQ expression)? : identifier (EQ expression)?
; ;
queryNoWith: queryNoWith
queryTerm : queryTerm (KW_ORDER KW_BY sortItem (COMMA sortItem)*)? (
(KW_ORDER KW_BY sortItem (COMMA sortItem)*)? KW_LIMIT rows=expression (KW_OFFSET offset=INTEGER_VALUE)?
(KW_LIMIT rows=expression (KW_OFFSET offset=INTEGER_VALUE )?)? )?
; ;
queryTerm queryTerm
@ -559,11 +752,11 @@ sortItem
; ;
querySpecification querySpecification
: KW_SELECT setQuantifier? (KW_STRAIGHT_JOIN)? selectItem (COMMA selectItem)* : KW_SELECT setQuantifier? (KW_STRAIGHT_JOIN)? selectItem (COMMA selectItem)* (
(KW_FROM relation (COMMA relation)*)? KW_FROM relation (COMMA relation)*
(KW_WHERE where=booleanExpression)? )? (KW_WHERE where=booleanExpression)? (KW_GROUP KW_BY groupBy)? (
(KW_GROUP KW_BY groupBy)? KW_HAVING having=booleanExpression
(KW_HAVING having=booleanExpression)? )?
; ;
groupBy groupBy
@ -595,8 +788,8 @@ selectItem
; ;
relation relation
: left=relation : left=relation (
( KW_CROSS KW_JOIN right=sampledRelation KW_CROSS KW_JOIN right=sampledRelation
| joinType KW_JOIN rightRelation=relation joinCriteria | joinType KW_JOIN rightRelation=relation joinCriteria
) # joinRelation ) # joinRelation
| sampledRelation # relationDefault | sampledRelation # relationDefault
@ -622,7 +815,9 @@ joinCriteria
sampledRelation sampledRelation
: aliasedRelation ( : 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
)?
)? )?
; ;
@ -650,13 +845,22 @@ relationPrimary
| parenthesizedRelation | 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 expression
: booleanExpression : booleanExpression
@ -675,7 +879,9 @@ predicate[ParserRuleContext value]
| KW_NOT? KW_BETWEEN lower=valueExpression KW_AND upper=valueExpression # between | 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 LPAREN expression (COMMA expression)* RPAREN # inList
| KW_NOT? KW_IN subQueryRelation # inSubquery | KW_NOT? KW_IN subQueryRelation # inSubquery
| KW_NOT? (KW_LIKE | KW_ILIKE | KW_RLIKE) pattern=valueExpression (KW_ESCAPE escape=valueExpression)? #like | KW_NOT? (KW_LIKE | KW_ILIKE | KW_RLIKE) pattern=valueExpression (
KW_ESCAPE escape=valueExpression
)? # like
| (KW_REGEXP | KW_IREGEXP) pattern=valueExpression # REGEXP | (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_NULL | KW_UNKNOWN | KW_TRUE | KW_FALSE) # nullOrUnKnownOrBooleanPredicate
| KW_IS KW_NOT? KW_DISTINCT KW_FROM right=valueExpression # distinctFrom | KW_IS KW_NOT? KW_DISTINCT KW_FROM right=valueExpression # distinctFrom
@ -703,8 +909,9 @@ primaryExpression
| LPAREN expression (KW_AS type)? (COMMA expression (KW_AS type)?)*? RPAREN # rowConstructor | LPAREN expression (KW_AS type)? (COMMA expression (KW_AS type)?)*? RPAREN # rowConstructor
| KW_ROW LPAREN expression (COMMA expression)* RPAREN # rowConstructor | KW_ROW LPAREN expression (COMMA expression)* RPAREN # rowConstructor
| functionNamePath LPAREN ASTERISK RPAREN filter? over? # functionCall | functionNamePath LPAREN ASTERISK RPAREN filter? over? # functionCall
| functionNamePath LPAREN (setQuantifier? expression (COMMA expression)*)? | functionNamePath LPAREN (setQuantifier? expression (COMMA expression)*)? (
(KW_ORDER KW_BY sortItem (COMMA sortItem)*)? RPAREN filter? over? #functionCall KW_ORDER KW_BY sortItem (COMMA sortItem)*
)? RPAREN filter? over? # functionCall
| identifier RIGHT_ARROW expression # lambda | identifier RIGHT_ARROW expression # lambda
| LPAREN (identifier (COMMA identifier)*)? RPAREN RIGHT_ARROW expression # lambda | LPAREN (identifier (COMMA identifier)*)? RPAREN RIGHT_ARROW expression # lambda
| LPAREN queryStatement RPAREN # subqueryExpression | LPAREN queryStatement RPAREN # subqueryExpression
@ -737,15 +944,23 @@ stringLiteral
; ;
comparisonOperator comparisonOperator
: EQ | NEQ | LT | LTE | GT | GTE : EQ
| NEQ
| LT
| LTE
| GT
| GTE
; ;
comparisonQuantifier comparisonQuantifier
: KW_ALL | KW_SOME | KW_ANY : KW_ALL
| KW_SOME
| KW_ANY
; ;
booleanValue booleanValue
: KW_TRUE | KW_FALSE : KW_TRUE
| KW_FALSE
; ;
interval interval
@ -756,11 +971,25 @@ interval
; ;
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 normalForm
: KW_NFD | KW_NFC | KW_NFKD | KW_NFKC : KW_NFD
| KW_NFC
| KW_NFKD
| KW_NFKC
; ;
type type
@ -772,7 +1001,8 @@ type
; ;
typeParameter typeParameter
: INTEGER_VALUE | type : INTEGER_VALUE
| type
; ;
baseType baseType
@ -791,11 +1021,9 @@ filter
; ;
over over
: KW_OVER LPAREN : KW_OVER LPAREN (KW_PARTITION KW_BY partition+=expression (COMMA partition+=expression)*)? (
(KW_PARTITION KW_BY partition+=expression (COMMA partition+=expression)*)? KW_ORDER KW_BY sortItem (COMMA sortItem)*
(KW_ORDER KW_BY sortItem (COMMA sortItem)*)? )? windowFrame? RPAREN
windowFrame?
RPAREN
; ;
/** /**
@ -826,11 +1054,22 @@ pathSpecification
; ;
privilege 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 objectType
: KW_SERVER | KW_URI | KW_DATABASE | KW_TABLE : KW_SERVER
| KW_URI
| KW_DATABASE
| KW_TABLE
; ;
qualifiedName qualifiedName
: identifier (DOT identifier)* : identifier (DOT identifier)*
; ;

View File

@ -25,21 +25,26 @@ THE SOFTWARE.
// https://github.com/antlr/grammars-v4/blob/master/sql/mysql/Positive-Technologies/MySqlLexer.g4 // 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; lexer grammar MySqlLexer;
options { caseInsensitive = true; } options {
caseInsensitive=true;
channels { MYSQLCOMMENT, ERRORCHANNEL } }
channels {
MYSQLCOMMENT,
ERRORCHANNEL
}
SPACE : [ \t\r\n]+ -> channel(HIDDEN); SPACE : [ \t\r\n]+ -> channel(HIDDEN);
SPEC_MYSQL_COMMENT : '/*!' .+? '*/' -> channel(MYSQLCOMMENT); SPEC_MYSQL_COMMENT : '/*!' .+? '*/' -> channel(MYSQLCOMMENT);
COMMENT_INPUT : '/*' .*? '*/' -> channel(HIDDEN); COMMENT_INPUT : '/*' .*? '*/' -> channel(HIDDEN);
LINE_COMMENT: ( LINE_COMMENT: (('--' [ \t]* | '#') ~[\r\n]* ('\r'? '\n' | EOF) | '--' ('\r'? '\n' | EOF)) -> channel(HIDDEN);
('--' [ \t]* | '#') ~[\r\n]* ('\r'? '\n' | EOF)
| '--' ('\r'? '\n' | EOF)
) -> channel(HIDDEN);
// Keywords // Keywords
// Common Keywords // Common Keywords
@ -285,7 +290,6 @@ KW_ENUM: 'ENUM';
KW_VARYING : 'VARYING'; KW_VARYING : 'VARYING';
KW_SERIAL : 'SERIAL'; KW_SERIAL : 'SERIAL';
// Interval type Keywords // Interval type Keywords
KW_YEAR_MONTH : 'YEAR_MONTH'; KW_YEAR_MONTH : 'YEAR_MONTH';
@ -755,7 +759,6 @@ KW_X509: 'X509';
KW_XA : 'XA'; KW_XA : 'XA';
KW_XML : 'XML'; KW_XML : 'XML';
// Interval type Keywords // Interval type Keywords
KW_QUARTER : 'QUARTER'; KW_QUARTER : 'QUARTER';
@ -767,7 +770,6 @@ KW_WEEK: 'WEEK';
KW_SECOND : 'SECOND'; KW_SECOND : 'SECOND';
KW_MICROSECOND : 'MICROSECOND'; KW_MICROSECOND : 'MICROSECOND';
// PRIVILEGES // PRIVILEGES
KW_ADMIN : 'ADMIN'; KW_ADMIN : 'ADMIN';
@ -823,7 +825,6 @@ KW_TABLE_ENCRYPTION_ADMIN: 'TABLE_ENCRYPTION_ADMIN';
KW_VERSION_TOKEN_ADMIN : 'VERSION_TOKEN_ADMIN'; KW_VERSION_TOKEN_ADMIN : 'VERSION_TOKEN_ADMIN';
KW_XA_RECOVER_ADMIN : 'XA_RECOVER_ADMIN'; KW_XA_RECOVER_ADMIN : 'XA_RECOVER_ADMIN';
// Charsets // Charsets
KW_ARMSCII8 : 'ARMSCII8'; KW_ARMSCII8 : 'ARMSCII8';
@ -868,7 +869,6 @@ KW_UTF8: 'UTF8';
KW_UTF8MB3 : 'UTF8MB3'; KW_UTF8MB3 : 'UTF8MB3';
KW_UTF8MB4 : 'UTF8MB4'; KW_UTF8MB4 : 'UTF8MB4';
// DB Engines // DB Engines
KW_ARCHIVE : 'ARCHIVE'; KW_ARCHIVE : 'ARCHIVE';
@ -884,7 +884,6 @@ KW_NDBCLUSTER: 'NDBCLUSTER';
KW_PERFORMANCE_SCHEMA : 'PERFORMANCE_SCHEMA'; KW_PERFORMANCE_SCHEMA : 'PERFORMANCE_SCHEMA';
KW_TOKUDB : 'TOKUDB'; KW_TOKUDB : 'TOKUDB';
// Transaction Levels // Transaction Levels
KW_REPEATABLE : 'REPEATABLE'; KW_REPEATABLE : 'REPEATABLE';
@ -892,7 +891,6 @@ KW_COMMITTED: 'COMMITTED';
KW_UNCOMMITTED : 'UNCOMMITTED'; KW_UNCOMMITTED : 'UNCOMMITTED';
KW_SERIALIZABLE : 'SERIALIZABLE'; KW_SERIALIZABLE : 'SERIALIZABLE';
// Spatial data types // Spatial data types
KW_GEOMETRYCOLLECTION : 'GEOMETRYCOLLECTION'; KW_GEOMETRYCOLLECTION : 'GEOMETRYCOLLECTION';
@ -905,7 +903,6 @@ KW_MULTIPOLYGON: 'MULTIPOLYGON';
KW_POINT : 'POINT'; KW_POINT : 'POINT';
KW_POLYGON : 'POLYGON'; KW_POLYGON : 'POLYGON';
// Common function names // Common function names
KW_CATALOG_NAME : 'CATALOG_NAME'; KW_CATALOG_NAME : 'CATALOG_NAME';
@ -928,7 +925,6 @@ KW_TP_CONNECTION_ADMIN: 'TP_CONNECTION_ADMIN';
KW_TYPE : 'TYPE'; KW_TYPE : 'TYPE';
KW_WEIGHT_STRING : 'WEIGHT_STRING'; KW_WEIGHT_STRING : 'WEIGHT_STRING';
// Operators // Operators
// Operators. Assigns // Operators. Assigns
@ -942,7 +938,6 @@ AND_ASSIGN: '&=';
XOR_ASSIGN : '^='; XOR_ASSIGN : '^=';
OR_ASSIGN : '|='; OR_ASSIGN : '|=';
// Operators. Arithmetics // Operators. Arithmetics
STAR : '*'; STAR : '*';
@ -953,7 +948,6 @@ MINUS: '-';
DIV : 'DIV'; DIV : 'DIV';
MOD : 'MOD'; MOD : 'MOD';
// Operators. Comparation // Operators. Comparation
EQUAL_SYMBOL : '='; EQUAL_SYMBOL : '=';
@ -961,7 +955,6 @@ GREATER_SYMBOL: '>';
LESS_SYMBOL : '<'; LESS_SYMBOL : '<';
EXCLAMATION_SYMBOL : '!'; EXCLAMATION_SYMBOL : '!';
// Operators. Bit // Operators. Bit
BIT_NOT_OP : '~'; BIT_NOT_OP : '~';
@ -969,7 +962,6 @@ BIT_OR_OP: '|';
BIT_AND_OP : '&'; BIT_AND_OP : '&';
BIT_XOR_OP : '^'; BIT_XOR_OP : '^';
// Constructors symbols // Constructors symbols
DOT : '.'; DOT : '.';
@ -987,27 +979,22 @@ DOUBLE_QUOTE_SYMB: '"';
REVERSE_QUOTE_SYMB : '`'; REVERSE_QUOTE_SYMB : '`';
COLON_SYMB : ':'; COLON_SYMB : ':';
fragment QUOTE_SYMB fragment QUOTE_SYMB: SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB | REVERSE_QUOTE_SYMB;
: SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB | REVERSE_QUOTE_SYMB
;
// Charsets // Charsets
CHARSET_REVERSE_QOUTE_STRING: '`' CHARSET_NAME '`'; CHARSET_REVERSE_QOUTE_STRING: '`' CHARSET_NAME '`';
// File's sizes // File's sizes
FILESIZE_LITERAL: DEC_DIGIT+ ('K' | 'M' | 'G' | 'T'); FILESIZE_LITERAL: DEC_DIGIT+ ('K' | 'M' | 'G' | 'T');
// Literal Primitives // Literal Primitives
START_NATIONAL_STRING_LITERAL : 'N' SQUOTA_STRING; START_NATIONAL_STRING_LITERAL : 'N' SQUOTA_STRING;
STRING_LITERAL : DQUOTA_STRING | SQUOTA_STRING | BQUOTA_STRING; STRING_LITERAL : DQUOTA_STRING | SQUOTA_STRING | BQUOTA_STRING;
DECIMAL_LITERAL : DEC_DIGIT+; DECIMAL_LITERAL : DEC_DIGIT+;
HEXADECIMAL_LITERAL: 'X' '\'' (HEX_DIGIT HEX_DIGIT)+ '\'' HEXADECIMAL_LITERAL : 'X' '\'' (HEX_DIGIT HEX_DIGIT)+ '\'' | '0X' HEX_DIGIT+;
| '0X' HEX_DIGIT+;
REAL_LITERAL: DEC_DIGIT* '.' DEC_DIGIT+ REAL_LITERAL:
DEC_DIGIT* '.' DEC_DIGIT+
| DEC_DIGIT+ '.' EXPONENT_NUM_PART | DEC_DIGIT+ '.' EXPONENT_NUM_PART
| DEC_DIGIT* '.' (DEC_DIGIT+ EXPONENT_NUM_PART) | DEC_DIGIT* '.' (DEC_DIGIT+ EXPONENT_NUM_PART)
| DEC_DIGIT+ EXPONENT_NUM_PART; | DEC_DIGIT+ EXPONENT_NUM_PART;
@ -1015,38 +1002,60 @@ NULL_SPEC_LITERAL: '\\' 'N';
BIT_STRING : BIT_STRING_L; BIT_STRING : BIT_STRING_L;
STRING_CHARSET_NAME : '_' CHARSET_NAME; STRING_CHARSET_NAME : '_' CHARSET_NAME;
// Identifiers // Identifiers
ID: ID_LITERAL; ID: ID_LITERAL;
// DOUBLE_QUOTE_ID: '"' ~'"'+ '"'; // DOUBLE_QUOTE_ID: '"' ~'"'+ '"';
REVERSE_QUOTE_ID : BQUOTA_STRING; REVERSE_QUOTE_ID : BQUOTA_STRING;
HOST_IP_ADDRESS : (AT_SIGN IP_ADDRESS); HOST_IP_ADDRESS : (AT_SIGN IP_ADDRESS);
LOCAL_ID: AT_SIGN LOCAL_ID : AT_SIGN ( STRING_LITERAL | [A-Z0-9._$\u0080-\uFFFF]+);
( GLOBAL_ID : AT_SIGN AT_SIGN ( [A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING);
STRING_LITERAL | [A-Z0-9._$\u0080-\uFFFF]+ PERSIST_ID : AT_SIGN AT_SIGN ( [A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING);
);
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 // Fragments for Literal primitives
fragment CHARSET_NAME: KW_ARMSCII8 | KW_ASCII | KW_BIG5 | KW_BINARY | KW_CP1250 fragment CHARSET_NAME:
| KW_CP1251 | KW_CP1256 | KW_CP1257 | KW_CP850 KW_ARMSCII8
| KW_CP852 | KW_CP866 | KW_CP932 | KW_DEC8 | KW_EUCJPMS | KW_ASCII
| KW_EUCKR | KW_GB2312 | KW_GBK | KW_GEOSTD8 | KW_GREEK | KW_BIG5
| KW_HEBREW | KW_HP8 | KW_KEYBCS2 | KW_KOI8R | KW_KOI8U | KW_BINARY
| KW_LATIN1 | KW_LATIN2 | KW_LATIN5 | KW_LATIN7 | KW_CP1250
| KW_MACCE | KW_MACROMAN | KW_SJIS | KW_SWE7 | KW_TIS620 | KW_CP1251
| KW_UCS2 | KW_UJIS | KW_UTF16 | KW_UTF16LE | KW_UTF32 | KW_CP1256
| KW_UTF8 | KW_UTF8MB3 | KW_UTF8MB4; | 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 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 ID_LITERAL : [A-Z_$0-9\u0080-\uFFFF]*? [A-Z_$\u0080-\uFFFF]+? [A-Z_$0-9\u0080-\uFFFF]*;
@ -1058,7 +1067,6 @@ fragment DEC_DIGIT: [0-9];
fragment BIT_STRING_L : 'B' '\'' [01]+ '\''; fragment BIT_STRING_L : 'B' '\'' [01]+ '\'';
fragment IP_ADDRESS : [0-9]+ '.' [0-9.]+ | [0-9A-F]* ':' [0-9A-F]* ':' [0-9A-F:]+; fragment IP_ADDRESS : [0-9]+ '.' [0-9.]+ | [0-9A-F]* ':' [0-9A-F]* ':' [0-9A-F:]+;
// Last tokens must generate Errors // Last tokens must generate Errors
ERROR_RECONGNIGION: . -> channel(ERRORCHANNEL); ERROR_RECONGNIGION: . -> channel(ERRORCHANNEL);

File diff suppressed because it is too large Load Diff

View File

@ -24,12 +24,16 @@
* written authorization from Tunnel Vision Laboratories, LLC. * written authorization from Tunnel Vision Laboratories, LLC.
*/ */
/** /**
* This file is an adaptation of antlr's sql/postgresql/PostgreSQLLexer.g4 grammar. * 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 * 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; lexer grammar PostgreSQLLexer;
/** /**
@ -81,25 +85,12 @@ PARAM: '$' ([0-9])+;
// this rule does not allow + or - at the end of a multi-character operator // this rule does not allow + or - at the end of a multi-character operator
Operator: ( Operator: (
( (OperatorCharacter | ('+' | '-')+ ( OperatorCharacter | '/'?) | '/')+
OperatorCharacter
| ('+' | '-')+ (
OperatorCharacter
| '/' ?
)
| '/'
)+
| // special handling for the single-character operators + and - | // special handling for the single-character operators + and -
[+-] [+-]
) ); //TODO somehow rewrite this part without using Actions
//TODO somehow rewrite this part without using Actions
;
OperatorEndingWithPlusMinus: ( OperatorEndingWithPlusMinus: (OperatorCharacterNotAllowPlusMinusAtEnd | '-' | '/')* OperatorCharacterAllowPlusMinusAtEnd Operator? (
OperatorCharacterNotAllowPlusMinusAtEnd
| '-'
| '/'
)* OperatorCharacterAllowPlusMinusAtEnd Operator? (
'+' '+'
| '-' | '-'
)+ -> type (Operator); )+ -> type (Operator);
@ -706,8 +697,7 @@ QuotedIdentifier: UnterminatedQuotedIdentifier '"';
UnterminatedQuotedIdentifier: '"' ('""' | ~ [\u0000"])*; UnterminatedQuotedIdentifier: '"' ('""' | ~ [\u0000"])*;
// This is a quoted identifier which is terminated but contains a \u0000 character // This is a quoted identifier which is terminated but contains a \u0000 character
InvalidQuotedIdentifier: InvalidQuotedIdentifier: InvalidUnterminatedQuotedIdentifier '"';
InvalidUnterminatedQuotedIdentifier '"';
// This is a quoted identifier which is unterminated and contains a \u0000 character // This is a quoted identifier which is unterminated and contains a \u0000 character
InvalidUnterminatedQuotedIdentifier: '"' ('""' | ~ '"')*; InvalidUnterminatedQuotedIdentifier: '"' ('""' | ~ '"')*;
@ -725,15 +715,13 @@ InvalidUnterminatedQuotedIdentifier: '"' ('""' | ~ '"')*;
UnicodeQuotedIdentifier: 'U' '&' QuotedIdentifier; UnicodeQuotedIdentifier: 'U' '&' QuotedIdentifier;
// This is a Unicode quoted identifier which only contains valid characters but is not terminated // This is a Unicode quoted identifier which only contains valid characters but is not terminated
UnterminatedUnicodeQuotedIdentifier: UnterminatedUnicodeQuotedIdentifier: 'U' '&' UnterminatedQuotedIdentifier;
'U' '&' UnterminatedQuotedIdentifier;
// This is a Unicode quoted identifier which is terminated but contains a \u0000 character // This is a Unicode quoted identifier which is terminated but contains a \u0000 character
InvalidUnicodeQuotedIdentifier: 'U' '&' InvalidQuotedIdentifier; InvalidUnicodeQuotedIdentifier: 'U' '&' InvalidQuotedIdentifier;
// This is a Unicode quoted identifier which is unterminated and contains a \u0000 character // This is a Unicode quoted identifier which is unterminated and contains a \u0000 character
InvalidUnterminatedUnicodeQuotedIdentifier: InvalidUnterminatedUnicodeQuotedIdentifier: 'U' '&' InvalidUnterminatedQuotedIdentifier;
'U' '&' InvalidUnterminatedQuotedIdentifier;
// //
// CONSTANTS (4.1.2) // CONSTANTS (4.1.2)
@ -747,8 +735,7 @@ StringConstant: UnterminatedStringConstant '\'';
UnterminatedStringConstant: '\'' ('\'\'' | ~ '\'')*; UnterminatedStringConstant: '\'' ('\'\'' | ~ '\'')*;
// String Constants with C-style Escapes (4.1.2.2) // String Constants with C-style Escapes (4.1.2.2)
BeginEscapeStringConstant: BeginEscapeStringConstant: 'E' '\'' -> more, pushMode (EscapeStringConstantMode);
'E' '\'' -> more, pushMode (EscapeStringConstantMode);
// String Constants with Unicode Escapes (4.1.2.3) // 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. // TODO: these rules assume '' is still a valid escape sequence within a Unicode string constant.
UnicodeEscapeStringConstant: UnicodeEscapeStringConstant: UnterminatedUnicodeEscapeStringConstant '\'';
UnterminatedUnicodeEscapeStringConstant '\'';
UnterminatedUnicodeEscapeStringConstant: UnterminatedUnicodeEscapeStringConstant: 'U' '&' UnterminatedStringConstant;
'U' '&' UnterminatedStringConstant;
// Dollar-quoted String Constants (4.1.2.4) // Dollar-quoted String Constants (4.1.2.4)
BeginDollarStringConstant: BeginDollarStringConstant: '$' Tag? '$' -> pushMode (DollarQuotedStringMode);
'$' Tag? '$' -> pushMode (DollarQuotedStringMode);
/* "The tag, if any, of a dollar-quoted string follows the same rules as an unquoted identifier, /* "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." * except that it cannot contain a dollar sign."
*/ */
@ -781,22 +765,17 @@ BinaryStringConstant: UnterminatedBinaryStringConstant '\'';
UnterminatedBinaryStringConstant: 'B' '\'' [01]*; UnterminatedBinaryStringConstant: 'B' '\'' [01]*;
InvalidBinaryStringConstant: InvalidBinaryStringConstant: InvalidUnterminatedBinaryStringConstant '\'';
InvalidUnterminatedBinaryStringConstant '\'';
InvalidUnterminatedBinaryStringConstant: InvalidUnterminatedBinaryStringConstant: 'B' UnterminatedStringConstant;
'B' UnterminatedStringConstant;
HexadecimalStringConstant: HexadecimalStringConstant: UnterminatedHexadecimalStringConstant '\'';
UnterminatedHexadecimalStringConstant '\'';
UnterminatedHexadecimalStringConstant: 'X' '\'' [0-9a-fA-F]*; UnterminatedHexadecimalStringConstant: 'X' '\'' [0-9a-fA-F]*;
InvalidHexadecimalStringConstant: InvalidHexadecimalStringConstant: InvalidUnterminatedHexadecimalStringConstant '\'';
InvalidUnterminatedHexadecimalStringConstant '\'';
InvalidUnterminatedHexadecimalStringConstant: InvalidUnterminatedHexadecimalStringConstant: 'X' UnterminatedStringConstant;
'X' UnterminatedStringConstant;
// Numeric Constants (4.1.2.6) // Numeric Constants (4.1.2.6)
Integral: Digits; Integral: Digits;
@ -804,8 +783,7 @@ Integral: Digits;
NumericFail: Digits '..'; NumericFail: Digits '..';
Numeric: Numeric:
Digits '.' Digits? /*? replaced with + to solve problem with DOT_DOT .. but this surely must be rewriten */ Digits '.' Digits? /*? replaced with + to solve problem with DOT_DOT .. but this surely must be rewriten */ (
(
'E' [+-]? Digits 'E' [+-]? Digits
)? )?
| '.' Digits ('E' [+-]? Digits)? | '.' Digits ('E' [+-]? Digits)?
@ -833,14 +811,7 @@ Newline: ('\r' '\n'? | '\n') -> channel (HIDDEN);
LineComment: '--' ~ [\r\n]* -> channel (HIDDEN); LineComment: '--' ~ [\r\n]* -> channel (HIDDEN);
BlockComment: ( BlockComment: ('/*' ( '/'* BlockComment | ~ [/*] | '/'+ ~ [/*] | '*'+ ~ [/*])* '*'* '*/') -> channel (HIDDEN);
'/*' (
'/'* BlockComment
| ~ [/*]
| '/'+ ~ [/*]
| '*'+ ~ [/*]
)* '*'* '*/'
) -> channel (HIDDEN);
UnterminatedBlockComment: UnterminatedBlockComment:
'/*' ( '/*' (
@ -852,9 +823,7 @@ UnterminatedBlockComment:
('/'+ ~ [/*] | '*'+ ~ [/*]) ('/'+ ~ [/*] | '*'+ ~ [/*])
)* )*
// Handle the case of / or * characters at the end of the file, or a nested unterminated block comment // Handle the case of / or * characters at the end of the file, or a nested unterminated block comment
('/'+ | '*'+ | '/'* UnterminatedBlockComment)? ('/'+ | '*'+ | '/'* UnterminatedBlockComment)?; // Optional assertion to make sure this rule is working as intended
// Optional assertion to make sure this rule is working as intended
;
// //
// META-COMMANDS // META-COMMANDS
@ -863,8 +832,7 @@ UnterminatedBlockComment:
// http://www.postgresql.org/docs/9.3/static/app-psql.html // http://www.postgresql.org/docs/9.3/static/app-psql.html
MetaCommand: MetaCommand: '\\' (~ [\r\n\\"] | '"' ~ [\r\n"]* '"')* ('"' ~ [\r\n"]*)?;
'\\' (~ [\r\n\\"] | '"' ~ [\r\n"]* '"')* ('"' ~ [\r\n"]*)?;
EndMetaCommand: '\\\\'; EndMetaCommand: '\\\\';
// //
@ -882,8 +850,7 @@ EndMetaCommand: '\\\\';
ErrorCharacter: .; ErrorCharacter: .;
mode EscapeStringConstantMode; mode EscapeStringConstantMode;
EscapeStringConstant: EscapeStringConstant: EscapeStringText '\'' -> mode (AfterEscapeStringConstantMode);
EscapeStringText '\'' -> mode (AfterEscapeStringConstantMode);
UnterminatedEscapeStringConstant: UnterminatedEscapeStringConstant:
EscapeStringText EscapeStringText
@ -896,8 +863,7 @@ fragment EscapeStringText: (
// two-digit hex escapes are still valid when treated as single-digit escapes // two-digit hex escapes are still valid when treated as single-digit escapes
'x' [0-9a-fA-F] '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]
| '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] | '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]
[0-9a-fA-F] [0-9a-fA-F]
| |
// Any character other than the Unicode escapes can follow a backslash. Some have // Any character other than the Unicode escapes can follow a backslash. Some have
// special meaning, but that doesn't affect the syntax. // special meaning, but that doesn't affect the syntax.
@ -906,8 +872,7 @@ fragment EscapeStringText: (
| ~ ['\\] | ~ ['\\]
)*; )*;
InvalidEscapeStringConstant: InvalidEscapeStringConstant: InvalidEscapeStringText '\'' -> mode (AfterEscapeStringConstantMode);
InvalidEscapeStringText '\'' -> mode (AfterEscapeStringConstantMode);
InvalidUnterminatedEscapeStringConstant: InvalidUnterminatedEscapeStringConstant:
InvalidEscapeStringText InvalidEscapeStringText
@ -917,8 +882,7 @@ InvalidUnterminatedEscapeStringConstant:
fragment InvalidEscapeStringText: ('\'\'' | '\\' . | ~ ['\\])*; fragment InvalidEscapeStringText: ('\'\'' | '\\' . | ~ ['\\])*;
mode AfterEscapeStringConstantMode; mode AfterEscapeStringConstantMode;
AfterEscapeStringConstantMode_Whitespace: AfterEscapeStringConstantMode_Whitespace: Whitespace -> type (Whitespace), channel (HIDDEN);
Whitespace -> type (Whitespace), channel (HIDDEN);
AfterEscapeStringConstantMode_Newline: AfterEscapeStringConstantMode_Newline:
Newline -> type (Newline), channel (HIDDEN), mode (AfterEscapeStringConstantWithNewlineMode); Newline -> type (Newline), channel (HIDDEN), mode (AfterEscapeStringConstantWithNewlineMode);
@ -929,8 +893,7 @@ mode AfterEscapeStringConstantWithNewlineMode;
AfterEscapeStringConstantWithNewlineMode_Whitespace: AfterEscapeStringConstantWithNewlineMode_Whitespace:
Whitespace -> type (Whitespace), channel (HIDDEN); Whitespace -> type (Whitespace), channel (HIDDEN);
AfterEscapeStringConstantWithNewlineMode_Newline: AfterEscapeStringConstantWithNewlineMode_Newline: Newline -> type (Newline), channel (HIDDEN);
Newline -> type (Newline), channel (HIDDEN);
AfterEscapeStringConstantWithNewlineMode_Continued: AfterEscapeStringConstantWithNewlineMode_Continued:
'\'' -> more, mode (EscapeStringConstantMode); '\'' -> more, mode (EscapeStringConstantMode);

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,11 @@
* Reference: https://github.com/antlr/grammars-v4/blob/master/sql/plsql/PlSqlLexer.g4 * 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; lexer grammar PlSqlLexer;
options { options {
@ -2384,14 +2389,23 @@ PERIOD: '.';
UNSIGNED_INTEGER : [0-9]+; UNSIGNED_INTEGER : [0-9]+;
APPROXIMATE_NUM_LIT : FLOAT_FRAGMENT ('E' ('+' | '-')? (FLOAT_FRAGMENT | [0-9]+))? ('D' | 'F')?; APPROXIMATE_NUM_LIT : FLOAT_FRAGMENT ('E' ('+' | '-')? (FLOAT_FRAGMENT | [0-9]+))? ('D' | 'F')?;
// Rule #--- <CHAR_STRING> is a base for Rule #065 <char_string_lit> , it incorporates <character_representation> // Rule #--- <CHAR_STRING> is a base for Rule #065 <char_string_lit> , it incorporates <character_representation>
// and a superfluous subtoken typecasting of the "QUOTE" // 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 // See https://livesql.oracle.com/apex/livesql/file/content_CIREYU9EA54EOKQ7LAMZKRF6P.html
// TODO: context sensitive string quotes (any characted after quote) // 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); 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_ANGLE : '<' .*? '>';
fragment QS_BRACE : '{' .*? '}'; fragment QS_BRACE : '{' .*? '}';
fragment QS_BRACK : '[' .*? ']'; fragment QS_BRACK : '[' .*? ']';
@ -2419,18 +2433,13 @@ HASH_OP: '#';
SQ: '\''; SQ: '\'';
BINDVAR BINDVAR:
: ':' SIMPLE_LETTER (SIMPLE_LETTER | [0-9] | '_')* ':' SIMPLE_LETTER (SIMPLE_LETTER | [0-9] | '_')*
| ':' DELIMITED_ID // not used in SQL but spotted in v$sqltext when using cursor_sharing | ':' DELIMITED_ID // not used in SQL but spotted in v$sqltext when using cursor_sharing
| ':' UNSIGNED_INTEGER | ':' 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: '!=' NOT_EQUAL_OP : '!=' | '<>' | '^=' | '~=';
| '<>'
| '^='
| '~='
;
CARRET_OPERATOR_PART : '^'; CARRET_OPERATOR_PART : '^';
TILDE_OPERATOR_PART : '~'; TILDE_OPERATOR_PART : '~';
EXCLAMATION_OPERATOR_PART : '!'; EXCLAMATION_OPERATOR_PART : '!';
@ -2452,7 +2461,8 @@ INTRODUCER: '_';
SINGLE_LINE_COMMENT : '--' ~('\r' | '\n')* NEWLINE_EOF -> channel(HIDDEN); SINGLE_LINE_COMMENT : '--' ~('\r' | '\n')* NEWLINE_EOF -> channel(HIDDEN);
MULTI_LINE_COMMENT : '/*' .*? '*/' -> channel(HIDDEN); MULTI_LINE_COMMENT : '/*' .*? '*/' -> channel(HIDDEN);
// https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve034.htm#SQPUG054 // 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 // 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;
@ -2460,10 +2470,8 @@ PROMPT_MESSAGE: 'PRO' {this.IsNewlineAtPos(-4)}? 'MPT'? (' ' ~('\r' | '\n')
// TODO: should starts with newline // TODO: should starts with newline
START_CMD START_CMD
//: 'STA' 'RT'? SPACE ~('\r' | '\n')* NEWLINE_EOF //: '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/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/ch12003.htm
: '@' {this.IsNewlineAtPos(-2)}? '@'? ~('\r' | '\n')* NEWLINE_EOF
;
REGULAR_ID: SIMPLE_LETTER (SIMPLE_LETTER | '$' | '_' | '#' | [0-9])*; REGULAR_ID: SIMPLE_LETTER (SIMPLE_LETTER | '$' | '_' | '#' | [0-9])*;

File diff suppressed because it is too large Load Diff

View File

@ -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 * 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; lexer grammar SparkSqlLexer;
@members { @members {
@ -423,99 +428,51 @@ HENT_START: '/*+';
HENT_END : '*/'; HENT_END : '*/';
QUESTION : '?'; QUESTION : '?';
STRING_LITERAL STRING_LITERAL: '\'' ( ~('\'' | '\\') | ('\\' .))* '\'' | 'R\'' (~'\'')* '\'' | 'R"' (~'"')* '"';
: '\'' ( ~('\''|'\\') | ('\\' .) )* '\''
| 'R\'' (~'\'')* '\''
| 'R"'(~'"')* '"'
;
DOUBLEQUOTED_STRING DOUBLEQUOTED_STRING: '"' ( ~('"' | '\\') | ('\\' .))* '"';
:'"' ( ~('"'|'\\') | ('\\' .) )* '"'
;
// NOTE: If you move a numeric literal, you should modify `ParserUtils.toExprAlias()` // NOTE: If you move a numeric literal, you should modify `ParserUtils.toExprAlias()`
// which assumes all numeric literals are between `BIGINT_LITERAL` and `BIGDECIMAL_LITERAL`. // which assumes all numeric literals are between `BIGINT_LITERAL` and `BIGDECIMAL_LITERAL`.
BIGINT_LITERAL BIGINT_LITERAL: DIGIT+ 'L';
: DIGIT+ 'L'
;
SMALLINT_LITERAL SMALLINT_LITERAL: DIGIT+ 'S';
: DIGIT+ 'S'
;
TINYINT_LITERAL TINYINT_LITERAL: DIGIT+ 'Y';
: DIGIT+ 'Y'
;
INTEGER_VALUE INTEGER_VALUE: DIGIT+;
: DIGIT+
;
EXPONENT_VALUE EXPONENT_VALUE: DIGIT+ EXPONENT | DECIMAL_DIGITS EXPONENT;
: DIGIT+ EXPONENT
| DECIMAL_DIGITS EXPONENT
;
DECIMAL_VALUE DECIMAL_VALUE: DECIMAL_DIGITS;
: DECIMAL_DIGITS
;
FLOAT_LITERAL FLOAT_LITERAL: DIGIT+ EXPONENT? 'F' | DECIMAL_DIGITS EXPONENT? 'F';
: DIGIT+ EXPONENT? 'F'
| DECIMAL_DIGITS EXPONENT? 'F'
;
DOUBLE_LITERAL DOUBLE_LITERAL: DIGIT+ EXPONENT? 'D' | DECIMAL_DIGITS EXPONENT? 'D';
: DIGIT+ EXPONENT? 'D'
| DECIMAL_DIGITS EXPONENT? 'D'
;
BIGDECIMAL_LITERAL BIGDECIMAL_LITERAL: DIGIT+ EXPONENT? 'BD' | DECIMAL_DIGITS EXPONENT? 'BD';
: DIGIT+ EXPONENT? 'BD'
| DECIMAL_DIGITS EXPONENT? 'BD'
;
IDENTIFIER IDENTIFIER: (LETTER | DIGIT | '_')+;
: (LETTER | DIGIT | '_')+
;
BACKQUOTED_IDENTIFIER BACKQUOTED_IDENTIFIER: '`' ( ~'`' | '``')* '`';
: '`' ( ~'`' | '``' )* '`'
;
fragment DECIMAL_DIGITS fragment DECIMAL_DIGITS: DIGIT+ '.' DIGIT* | '.' DIGIT+;
: DIGIT+ '.' DIGIT*
| '.' DIGIT+
;
fragment EXPONENT fragment EXPONENT: 'E' [+-]? DIGIT+;
: 'E' [+-]? DIGIT+
;
fragment DIGIT fragment DIGIT: [0-9];
: [0-9]
;
fragment LETTER fragment LETTER: [A-Za-z];
: [A-Za-z]
;
SIMPLE_COMMENT SIMPLE_COMMENT: '--' ('\\\n' | ~[\r\n])* '\r'? '\n'? -> channel(HIDDEN);
: '--' ('\\\n' | ~[\r\n])* '\r'? '\n'? -> channel(HIDDEN)
;
BRACKETED_COMMENT BRACKETED_COMMENT:
: '/*' ( BRACKETED_COMMENT | . )*? ('*/' | {this.markUnclosedComment();} EOF) -> channel(HIDDEN) '/*' (BRACKETED_COMMENT | .)*? ('*/' | {this.markUnclosedComment();} EOF) -> channel(HIDDEN);
;
WS WS: [ \r\n\t]+ -> channel(HIDDEN);
: [ \r\n\t]+ -> channel(HIDDEN)
;
// Catch-all for anything we can't recognize. // Catch-all for anything we can't recognize.
// We use this to be able to ignore and recover all the text // We use this to be able to ignore and recover all the text
// when splitting statements with DelimiterLexer // when splitting statements with DelimiterLexer
UNRECOGNIZED UNRECOGNIZED: .;
: .
;

View File

@ -18,9 +18,15 @@
* Reference: https://github.com/apache/spark/blob/master/sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4 * 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; parser grammar SparkSqlParser;
options { tokenVocab = SparkSqlLexer; } options {
tokenVocab=SparkSqlLexer;
}
program program
: singleStatement* EOF : singleStatement* EOF
@ -36,150 +42,117 @@ statement
| KW_USE dbSchemaName | KW_USE dbSchemaName
| KW_USE dbSchema dbSchemaName | KW_USE dbSchema dbSchemaName
| KW_SET KW_CATALOG (identifier | stringLit) | KW_SET KW_CATALOG (identifier | stringLit)
| KW_CREATE dbSchema (ifNotExists)? dbSchemaNameCreate | KW_CREATE dbSchema (ifNotExists)? dbSchemaNameCreate (
(commentSpec | commentSpec
locationSpec | | locationSpec
(KW_WITH (KW_DBPROPERTIES | KW_PROPERTIES) propertyList))* | (KW_WITH (KW_DBPROPERTIES | KW_PROPERTIES) propertyList)
| KW_ALTER dbSchema dbSchemaName )*
KW_SET (KW_DBPROPERTIES | KW_PROPERTIES) propertyList | KW_ALTER dbSchema dbSchemaName KW_SET (KW_DBPROPERTIES | KW_PROPERTIES) propertyList
| KW_ALTER dbSchema dbSchemaName | KW_ALTER dbSchema dbSchemaName KW_SET locationSpec
KW_SET locationSpec | KW_DROP dbSchema (ifExists)? dbSchemaName (KW_RESTRICT | KW_CASCADE)?
| KW_DROP dbSchema (ifExists)? dbSchemaName | KW_SHOW dbSchemas ((KW_FROM | KW_IN) multipartIdentifier)? (KW_LIKE? pattern=stringLit)?
(KW_RESTRICT | KW_CASCADE)? | createTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? createTableClauses (
| KW_SHOW dbSchemas ((KW_FROM | KW_IN) multipartIdentifier)? KW_AS? query
(KW_LIKE? pattern=stringLit)? )?
| createTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? | KW_CREATE KW_TABLE (ifNotExists)? target=tableNameCreate KW_LIKE source=tableName (
createTableClauses tableProvider
(KW_AS? query)? | rowFormat
| KW_CREATE KW_TABLE (ifNotExists)? target=tableNameCreate | createFileFormat
KW_LIKE source=tableName | locationSpec
(tableProvider | | (KW_TBLPROPERTIES tableProps=propertyList)
rowFormat | )*
createFileFormat | | replaceTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? createTableClauses (
locationSpec | KW_AS? query
(KW_TBLPROPERTIES tableProps=propertyList))* )?
| replaceTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? | KW_ANALYZE KW_TABLE tableName partitionSpec? KW_COMPUTE KW_STATISTICS (
createTableClauses KW_NOSCAN
(KW_AS? query)? | KW_FOR KW_COLUMNS columnNameSeq
| KW_ANALYZE KW_TABLE tableName partitionSpec? KW_COMPUTE KW_STATISTICS | KW_FOR KW_ALL KW_COLUMNS
(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_ANALYZE KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? KW_COMPUTE KW_STATISTICS (KW_NOSCAN)?
(KW_NOSCAN)? | KW_ALTER KW_TABLE tableName KW_ADD KW_COLUMN qualifiedColTypeWithPositionForAdd
| KW_ALTER KW_TABLE tableName | KW_ALTER KW_TABLE tableName KW_ADD KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForAdd RIGHT_PAREN
KW_ADD KW_COLUMN qualifiedColTypeWithPositionForAdd | KW_ALTER KW_TABLE table=tableName KW_RENAME KW_COLUMN columnName KW_TO columnNameCreate
| KW_ALTER KW_TABLE tableName | KW_ALTER KW_TABLE tableName KW_DROP KW_COLUMN (ifExists)? columnName
KW_ADD KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForAdd RIGHT_PAREN | KW_ALTER KW_TABLE tableName KW_DROP KW_COLUMNS (ifExists)? LEFT_PAREN columnNameSeq RIGHT_PAREN
| KW_ALTER KW_TABLE table=tableName | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_RENAME KW_TO multipartIdentifier
KW_RENAME KW_COLUMN columnName KW_TO columnNameCreate | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_SET KW_TBLPROPERTIES propertyList
| KW_ALTER KW_TABLE tableName | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_UNSET KW_TBLPROPERTIES (ifExists)? propertyList
KW_DROP KW_COLUMN (ifExists)? columnName | KW_ALTER KW_TABLE table=tableName (KW_ALTER | KW_CHANGE) KW_COLUMN? column=columnName alterColumnAction?
| KW_ALTER KW_TABLE tableName | KW_ALTER KW_TABLE table=tableName partitionSpec? KW_CHANGE KW_COLUMN? colName=columnName colType colPosition?
KW_DROP KW_COLUMNS (ifExists)? LEFT_PAREN columnNameSeq RIGHT_PAREN | KW_ALTER KW_TABLE table=tableName partitionSpec? KW_REPLACE KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForReplace RIGHT_PAREN
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) | KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET KW_SERDE stringLit (
KW_RENAME KW_TO multipartIdentifier KW_WITH KW_SERDEPROPERTIES propertyList
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) )?
KW_SET KW_TBLPROPERTIES propertyList | KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET KW_SERDEPROPERTIES propertyList
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_ADD (ifNotExists)? partitionSpecLocation+
KW_UNSET KW_TBLPROPERTIES (ifExists)? propertyList | KW_ALTER KW_TABLE tableName partitionSpec KW_RENAME KW_TO partitionSpec
| KW_ALTER KW_TABLE table=tableName | KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_DROP (ifExists)? partitionSpec (
(KW_ALTER | KW_CHANGE) KW_COLUMN? column=columnName COMMA partitionSpec
alterColumnAction? )* KW_PURGE?
| KW_ALTER KW_TABLE table=tableName partitionSpec? | KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET locationSpec
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_ALTER KW_TABLE tableName KW_RECOVER KW_PARTITIONS
| KW_DROP KW_TABLE (ifExists)? tableName KW_PURGE? | KW_DROP KW_TABLE (ifExists)? tableName KW_PURGE?
| KW_DROP KW_VIEW (ifExists)? viewName | KW_DROP KW_VIEW (ifExists)? viewName
| KW_CREATE (KW_OR KW_REPLACE)? (KW_GLOBAL? KW_TEMPORARY)? | KW_CREATE (KW_OR KW_REPLACE)? (KW_GLOBAL? KW_TEMPORARY)? KW_VIEW (ifNotExists)? viewNameCreate identifierCommentList? (
KW_VIEW (ifNotExists)? viewNameCreate commentSpec
identifierCommentList? | (KW_PARTITIONED KW_ON identifierList)
(commentSpec | | (KW_TBLPROPERTIES propertyList)
(KW_PARTITIONED KW_ON identifierList) | )* KW_AS query
(KW_TBLPROPERTIES propertyList))* | KW_CREATE (KW_OR KW_REPLACE)? KW_GLOBAL? KW_TEMPORARY KW_VIEW viewNameCreate (
KW_AS query LEFT_PAREN colTypeList RIGHT_PAREN
| KW_CREATE (KW_OR KW_REPLACE)? KW_GLOBAL? KW_TEMPORARY KW_VIEW )? tableProvider (KW_OPTIONS propertyList)?
viewNameCreate (LEFT_PAREN colTypeList RIGHT_PAREN)? tableProvider
(KW_OPTIONS propertyList)?
| KW_ALTER KW_VIEW viewName KW_AS? query | KW_ALTER KW_VIEW viewName KW_AS? query
| KW_CREATE (KW_OR KW_REPLACE)? KW_TEMPORARY? KW_FUNCTION (ifNotExists)? | KW_CREATE (KW_OR KW_REPLACE)? KW_TEMPORARY? KW_FUNCTION (ifNotExists)? functionNameCreate KW_AS className=stringLit (
functionNameCreate KW_AS className=stringLit KW_USING resource (COMMA resource)*
(KW_USING resource (COMMA resource)*)? )?
| KW_DROP KW_TEMPORARY? KW_FUNCTION (ifExists)? functionName | KW_DROP KW_TEMPORARY? KW_FUNCTION (ifExists)? functionName
| KW_DECLARE (KW_OR KW_REPLACE)? KW_VARIABLE? | KW_DECLARE (KW_OR KW_REPLACE)? KW_VARIABLE? functionName dataType? variableDefaultExpression?
functionName dataType? variableDefaultExpression?
| KW_DROP KW_TEMPORARY KW_VARIABLE (ifExists)? (tableName | viewName | functionName) | KW_DROP KW_TEMPORARY KW_VARIABLE (ifExists)? (tableName | viewName | functionName)
| KW_EXPLAIN (KW_LOGICAL | KW_FORMATTED | KW_EXTENDED | KW_CODEGEN | KW_COST)? | KW_EXPLAIN (KW_LOGICAL | KW_FORMATTED | KW_EXTENDED | KW_CODEGEN | KW_COST)? statement
statement | KW_SHOW KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? (KW_LIKE? pattern=stringLit)?
| KW_SHOW KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? | KW_SHOW KW_TABLE KW_EXTENDED ((KW_FROM | KW_IN) ns=dbSchemaName)? KW_LIKE pattern=stringLit partitionSpec?
(KW_LIKE? pattern=stringLit)? | KW_SHOW KW_TBLPROPERTIES table=tableName (LEFT_PAREN key=propertyKey RIGHT_PAREN)?
| KW_SHOW KW_TABLE KW_EXTENDED ((KW_FROM | KW_IN) ns=dbSchemaName)? | KW_SHOW KW_COLUMNS (KW_FROM | KW_IN) table=tableName ((KW_FROM | KW_IN) dbSchemaName)?
KW_LIKE pattern=stringLit partitionSpec? | KW_SHOW KW_VIEWS ((KW_FROM | KW_IN) dbSchemaName)? (KW_LIKE? pattern=stringLit)?
| 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 KW_PARTITIONS tableName partitionSpec?
| KW_SHOW functionKind? KW_FUNCTIONS ((KW_FROM | KW_IN) ns=dbSchemaName)? | KW_SHOW functionKind? KW_FUNCTIONS ((KW_FROM | KW_IN) ns=dbSchemaName)? (
(KW_LIKE? (legacy=multipartIdentifier | pattern=stringLit))? KW_LIKE? (legacy=multipartIdentifier | pattern=stringLit)
)?
| KW_SHOW KW_CREATE KW_TABLE tableName (KW_AS KW_SERDE)? | KW_SHOW KW_CREATE KW_TABLE tableName (KW_AS KW_SERDE)?
| KW_SHOW KW_CURRENT dbSchema | KW_SHOW KW_CURRENT dbSchema
| KW_SHOW KW_CATALOGS (KW_LIKE? pattern=stringLit)? | KW_SHOW KW_CATALOGS (KW_LIKE? pattern=stringLit)?
| (KW_DESC | KW_DESCRIBE) KW_FUNCTION KW_EXTENDED? describeFuncName | (KW_DESC | KW_DESCRIBE) KW_FUNCTION KW_EXTENDED? describeFuncName
| (KW_DESC | KW_DESCRIBE) KW_DATABASE KW_EXTENDED? dbSchemaName | (KW_DESC | KW_DESCRIBE) KW_DATABASE KW_EXTENDED? dbSchemaName
| (KW_DESC | KW_DESCRIBE) KW_TABLE? option=(KW_EXTENDED | KW_FORMATTED)? | (KW_DESC | KW_DESCRIBE) KW_TABLE? option=(KW_EXTENDED | KW_FORMATTED)? tableName partitionSpec? describeColName?
tableName partitionSpec? describeColName?
| (KW_DESC | KW_DESCRIBE) KW_QUERY? query | (KW_DESC | KW_DESCRIBE) KW_QUERY? query
| KW_COMMENT KW_ON dbSchema dbSchemaName KW_IS | KW_COMMENT KW_ON dbSchema dbSchemaName KW_IS comment
comment
| KW_COMMENT KW_ON KW_TABLE tableName KW_IS comment | KW_COMMENT KW_ON KW_TABLE tableName KW_IS comment
| KW_REFRESH KW_TABLE tableName | KW_REFRESH KW_TABLE tableName
| KW_REFRESH KW_FUNCTION functionName | KW_REFRESH KW_FUNCTION functionName
| KW_REFRESH (stringLit | .*?) | KW_REFRESH (stringLit | .*?)
| KW_CACHE KW_LAZY? KW_TABLE tableName | KW_CACHE KW_LAZY? KW_TABLE tableName (KW_OPTIONS options=propertyList)? (KW_AS? query)?
(KW_OPTIONS options=propertyList)? (KW_AS? query)?
| KW_UNCACHE KW_TABLE (ifExists)? tableName | KW_UNCACHE KW_TABLE (ifExists)? tableName
| KW_CLEAR KW_CACHE | KW_CLEAR KW_CACHE
| KW_LOAD KW_DATA KW_LOCAL? KW_INPATH path=stringLit KW_OVERWRITE? KW_INTO KW_TABLE | KW_LOAD KW_DATA KW_LOCAL? KW_INPATH path=stringLit KW_OVERWRITE? KW_INTO KW_TABLE tableName partitionSpec?
tableName partitionSpec?
| KW_TRUNCATE KW_TABLE tableName partitionSpec? | KW_TRUNCATE KW_TABLE tableName partitionSpec?
| (KW_MSCK)? KW_REPAIR KW_TABLE tableName | (KW_MSCK)? KW_REPAIR KW_TABLE tableName (option=(KW_ADD | KW_DROP | KW_SYNC) KW_PARTITIONS)?
(option=(KW_ADD|KW_DROP|KW_SYNC) KW_PARTITIONS)?
| op=(KW_ADD | KW_LIST) identifier .*? | op=(KW_ADD | KW_LIST) identifier .*?
| KW_SET KW_ROLE .*? | KW_SET KW_ROLE .*?
| KW_SET KW_TIME KW_ZONE interval | KW_SET KW_TIME KW_ZONE interval
| KW_SET KW_TIME KW_ZONE timezone | KW_SET KW_TIME KW_ZONE timezone
| KW_SET KW_TIME KW_ZONE .*? | KW_SET KW_TIME KW_ZONE .*?
| KW_SET (KW_VARIABLE | KW_VAR) assignmentList | KW_SET (KW_VARIABLE | KW_VAR) assignmentList
| KW_SET (KW_VARIABLE | KW_VAR) LEFT_PAREN multipartIdentifierList RIGHT_PAREN EQ | KW_SET (KW_VARIABLE | KW_VAR) LEFT_PAREN multipartIdentifierList RIGHT_PAREN EQ LEFT_PAREN query RIGHT_PAREN
LEFT_PAREN query RIGHT_PAREN
| KW_SET configKey EQ configValue | KW_SET configKey EQ configValue
| KW_SET configKey (EQ .*?)? | KW_SET configKey (EQ .*?)?
| KW_SET .*? EQ configValue | KW_SET .*? EQ configValue
| KW_SET .*? | KW_SET .*?
| KW_RESET configKey | KW_RESET configKey
| KW_RESET .*? | KW_RESET .*?
| KW_CREATE KW_INDEX (ifNotExists)? identifier KW_ON KW_TABLE? | KW_CREATE KW_INDEX (ifNotExists)? identifier KW_ON KW_TABLE? tableName (
tableName (KW_USING indexType=identifier)? KW_USING indexType=identifier
LEFT_PAREN multipartIdentifierPropertyList RIGHT_PAREN )? LEFT_PAREN multipartIdentifierPropertyList RIGHT_PAREN (KW_OPTIONS options=propertyList)?
(KW_OPTIONS options=propertyList)?
| KW_DROP KW_INDEX (ifExists)? identifier KW_ON KW_TABLE? tableName | KW_DROP KW_INDEX (ifExists)? identifier KW_ON KW_TABLE? tableName
| unsupportedHiveNativeCommands .*? | unsupportedHiveNativeCommands .*?
; ;
@ -253,15 +226,13 @@ replaceTableHeader
; ;
bucketSpec bucketSpec
: KW_CLUSTERED KW_BY identifierList : KW_CLUSTERED KW_BY identifierList (KW_SORTED KW_BY orderedIdentifierList)? KW_INTO INTEGER_VALUE KW_BUCKETS
(KW_SORTED KW_BY orderedIdentifierList)?
KW_INTO INTEGER_VALUE KW_BUCKETS
; ;
skewSpec skewSpec
: KW_SKEWED KW_BY identifierList : KW_SKEWED KW_BY identifierList KW_ON (constantList | nestedConstantList) (
KW_ON (constantList | nestedConstantList) KW_STORED KW_AS KW_DIRECTORIES
(KW_STORED KW_AS KW_DIRECTORIES)? )?
; ;
locationSpec locationSpec
@ -277,11 +248,19 @@ query
; ;
insertInto insertInto
: KW_INSERT KW_OVERWRITE KW_TABLE? tableName (partitionSpec (ifNotExists)?)? ((KW_BY KW_NAME) | (LEFT_PAREN columnNameSeq RIGHT_PAREN ))? : KW_INSERT KW_OVERWRITE KW_TABLE? tableName (partitionSpec (ifNotExists)?)? (
| KW_INSERT KW_INTO KW_TABLE? tableName partitionSpec? (ifNotExists)? ((KW_BY KW_NAME) | (LEFT_PAREN columnNameSeq RIGHT_PAREN ))? (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_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 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 partitionSpecLocation
@ -334,15 +313,17 @@ tableProvider
; ;
createTableClauses createTableClauses
:((KW_OPTIONS options=expressionPropertyList) | : (
(KW_PARTITIONED KW_BY partitioning=partitionFieldList) | (KW_OPTIONS options=expressionPropertyList)
skewSpec | | (KW_PARTITIONED KW_BY partitioning=partitionFieldList)
bucketSpec | | skewSpec
rowFormat | | bucketSpec
createFileFormat | | rowFormat
locationSpec | | createFileFormat
commentSpec | | locationSpec
(KW_TBLPROPERTIES tableProps=propertyList))* | commentSpec
| (KW_TBLPROPERTIES tableProps=propertyList)
)*
; ;
propertyList propertyList
@ -404,32 +385,47 @@ dmlStatementNoWith
| fromClause multiInsertQueryBody+ | fromClause multiInsertQueryBody+
| KW_DELETE KW_FROM tableName tableAlias whereClause? | KW_DELETE KW_FROM tableName tableAlias whereClause?
| KW_UPDATE tableName tableAlias setClause whereClause? | KW_UPDATE tableName tableAlias setClause whereClause?
| KW_MERGE KW_INTO target=tableName targetAlias=tableAlias | KW_MERGE KW_INTO target=tableName targetAlias=tableAlias KW_USING (
KW_USING (source=identifierReference | source=identifierReference
LEFT_PAREN sourceQuery=query RIGHT_PAREN) sourceAlias=tableAlias | LEFT_PAREN sourceQuery=query RIGHT_PAREN
KW_ON mergeCondition=booleanExpression ) sourceAlias=tableAlias KW_ON mergeCondition=booleanExpression matchedClause* notMatchedClause* notMatchedBySourceClause*
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; columnName
: multipartIdentifier
;
columnNameSeq: columnName (COMMA columnName)* ; columnNameSeq
: columnName (COMMA columnName)*
;
columnNameCreate: errorCapturingIdentifier; columnNameCreate
: errorCapturingIdentifier
;
identifierReference identifierReference
: KW_IDENTIFIER LEFT_PAREN expression RIGHT_PAREN : KW_IDENTIFIER LEFT_PAREN expression RIGHT_PAREN
@ -437,13 +433,11 @@ identifierReference
; ;
queryOrganization queryOrganization
: (KW_ORDER KW_BY order+=sortItem (COMMA order+=sortItem)*)? : (KW_ORDER KW_BY order+=sortItem (COMMA order+=sortItem)*)? (
(KW_CLUSTER KW_BY clusterBy+=expression (COMMA clusterBy+=expression)*)? KW_CLUSTER KW_BY clusterBy+=expression (COMMA clusterBy+=expression)*
(KW_DISTRIBUTE KW_BY distributeBy+=expression (COMMA distributeBy+=expression)*)? )? (KW_DISTRIBUTE KW_BY distributeBy+=expression (COMMA distributeBy+=expression)*)? (
(KW_SORT KW_BY sort+=sortItem (COMMA sort+=sortItem)*)? KW_SORT KW_BY sort+=sortItem (COMMA sort+=sortItem)*
windowClause? )? windowClause? (KW_LIMIT (KW_ALL | limit=expression))? (KW_OFFSET offset=expression)?
(KW_LIMIT (KW_ALL | limit=expression))?
(KW_OFFSET offset=expression)?
; ;
multiInsertQueryBody multiInsertQueryBody
@ -452,12 +446,9 @@ multiInsertQueryBody
queryTerm queryTerm
: queryPrimary : queryPrimary
| left=queryTerm | left=queryTerm operator=(KW_INTERSECT | KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm
operator=(KW_INTERSECT | KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm | left=queryTerm operator=KW_INTERSECT setQuantifier? right=queryTerm
| left=queryTerm | left=queryTerm operator=(KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm
operator=KW_INTERSECT setQuantifier? right=queryTerm
| left=queryTerm
operator=(KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm
; ;
queryPrimary queryPrimary
@ -469,7 +460,9 @@ queryPrimary
; ;
sortItem 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 fromStatement
@ -477,45 +470,27 @@ fromStatement
; ;
fromStatementBody fromStatementBody
: transformClause : transformClause whereClause? queryOrganization
whereClause? | selectClause lateralView* whereClause? aggregationClause? havingClause? windowClause? queryOrganization
queryOrganization
| selectClause
lateralView*
whereClause?
aggregationClause?
havingClause?
windowClause?
queryOrganization
; ;
querySpecification querySpecification
: transformClause : transformClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause?
fromClause? | selectClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause?
lateralView*
whereClause?
aggregationClause?
havingClause?
windowClause?
| selectClause
fromClause?
lateralView*
whereClause?
aggregationClause?
havingClause?
windowClause?
; ;
transformClause transformClause
: (KW_SELECT kind=KW_TRANSFORM LEFT_PAREN setQuantifier? expressionSeq RIGHT_PAREN : (
KW_SELECT kind=KW_TRANSFORM LEFT_PAREN setQuantifier? expressionSeq RIGHT_PAREN
| kind=KW_MAP setQuantifier? expressionSeq | kind=KW_MAP setQuantifier? expressionSeq
| kind=KW_REDUCE setQuantifier? expressionSeq) | kind=KW_REDUCE setQuantifier? expressionSeq
inRowFormat=rowFormat? ) inRowFormat=rowFormat? (KW_RECORDWRITER recordWriter=stringLit)? KW_USING script=stringLit (
(KW_RECORDWRITER recordWriter=stringLit)? KW_AS (
KW_USING script=stringLit identifierSeq
(KW_AS (identifierSeq | colTypeList | (LEFT_PAREN (identifierSeq | colTypeList) RIGHT_PAREN)))? | colTypeList
outRowFormat=rowFormat? | (LEFT_PAREN (identifierSeq | colTypeList) RIGHT_PAREN)
(KW_RECORDREADER recordReader=stringLit)? )
)? outRowFormat=rowFormat? (KW_RECORDREADER recordReader=stringLit)?
; ;
selectClause selectClause
@ -529,6 +504,7 @@ setClause
matchedClause matchedClause
: KW_WHEN KW_MATCHED (KW_AND matchedCond=booleanExpression)? KW_THEN matchedAction : KW_WHEN KW_MATCHED (KW_AND matchedCond=booleanExpression)? KW_THEN matchedAction
; ;
notMatchedClause notMatchedClause
: KW_WHEN KW_NOT KW_MATCHED (KW_BY KW_TARGET)? (KW_AND notMatchedCond=booleanExpression)? KW_THEN notMatchedAction : KW_WHEN KW_NOT KW_MATCHED (KW_BY KW_TARGET)? (KW_AND notMatchedCond=booleanExpression)? KW_THEN notMatchedAction
; ;
@ -545,8 +521,9 @@ matchedAction
notMatchedAction notMatchedAction
: KW_INSERT ASTERISK : KW_INSERT ASTERISK
| KW_INSERT LEFT_PAREN multipartIdentifierList RIGHT_PAREN | KW_INSERT LEFT_PAREN multipartIdentifierList RIGHT_PAREN KW_VALUES LEFT_PAREN expression (
KW_VALUES LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN COMMA expression
)* RIGHT_PAREN
; ;
notMatchedBySourceAction notMatchedBySourceAction
@ -576,7 +553,9 @@ hint
hintStatement hintStatement
: hintName=identifier : 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 fromClause
@ -584,7 +563,9 @@ fromClause
; ;
functionKind functionKind
: KW_USER | KW_SYSTEM | KW_ALL : KW_USER
| KW_SYSTEM
| KW_ALL
; ;
temporalClause temporalClause
@ -593,12 +574,14 @@ temporalClause
; ;
aggregationClause aggregationClause
: KW_GROUP KW_BY groupingExpressionsWithGroupingAnalytics+=groupByClause : KW_GROUP KW_BY groupingExpressionsWithGroupingAnalytics+=groupByClause (
(COMMA groupingExpressionsWithGroupingAnalytics+=groupByClause)* COMMA groupingExpressionsWithGroupingAnalytics+=groupByClause
)*
| KW_GROUP KW_BY groupingExpressions+=expression (COMMA groupingExpressions+=expression)* ( | KW_GROUP KW_BY groupingExpressions+=expression (COMMA groupingExpressions+=expression)* (
KW_WITH kind=KW_ROLLUP KW_WITH kind=KW_ROLLUP
| KW_WITH kind=KW_CUBE | KW_WITH kind=KW_CUBE
| kind=KW_GROUPING KW_SETS LEFT_PAREN groupingSet (COMMA groupingSet)* RIGHT_PAREN)? | kind=KW_GROUPING KW_SETS LEFT_PAREN groupingSet (COMMA groupingSet)* RIGHT_PAREN
)?
; ;
groupByClause groupByClause
@ -624,7 +607,9 @@ groupingSet
; ;
pivotClause 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 pivotColumn
@ -637,9 +622,9 @@ pivotValue
; ;
unpivotClause unpivotClause
: KW_UNPIVOT nullOperator=unpivotNullClause? LEFT_PAREN : KW_UNPIVOT nullOperator=unpivotNullClause? LEFT_PAREN operator=unpivotOperator RIGHT_PAREN (
operator=unpivotOperator KW_AS? identifier
RIGHT_PAREN (KW_AS? identifier)? )?
; ;
unpivotNullClause unpivotNullClause
@ -651,13 +636,17 @@ unpivotOperator
; ;
unpivotSingleValueColumnClause 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 unpivotMultiValueColumnClause
: LEFT_PAREN unpivotValueColumns+=unpivotValueColumn (COMMA unpivotValueColumns+=unpivotValueColumn)* RIGHT_PAREN : LEFT_PAREN unpivotValueColumns+=unpivotValueColumn (
KW_FOR unpivotNameColumn COMMA unpivotValueColumns+=unpivotValueColumn
KW_IN LEFT_PAREN unpivotColumnSets+=unpivotColumnSet (COMMA unpivotColumnSets+=unpivotColumnSet)* RIGHT_PAREN )* RIGHT_PAREN KW_FOR unpivotNameColumn KW_IN LEFT_PAREN unpivotColumnSets+=unpivotColumnSet (
COMMA unpivotColumnSets+=unpivotColumnSet
)* RIGHT_PAREN
; ;
unpivotColumnSet unpivotColumnSet
@ -685,13 +674,17 @@ unpivotAlias
; ;
ifNotExists ifNotExists
: KW_IF KW_NOT KW_EXISTS; : KW_IF KW_NOT KW_EXISTS
;
ifExists ifExists
: KW_IF KW_EXISTS; : KW_IF KW_EXISTS
;
lateralView 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 setQuantifier
@ -731,14 +724,17 @@ joinCriteria
; ;
sample 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 sampleMethod
: negativeSign=MINUS? percentage=(INTEGER_VALUE | DECIMAL_VALUE) KW_PERCENTLIT : negativeSign=MINUS? percentage=(INTEGER_VALUE | DECIMAL_VALUE) KW_PERCENTLIT
| expression KW_ROWS | expression KW_ROWS
| sampleType=KW_BUCKET numerator=INTEGER_VALUE KW_OUT KW_OF denominator=INTEGER_VALUE | sampleType=KW_BUCKET numerator=INTEGER_VALUE KW_OUT KW_OF denominator=INTEGER_VALUE (
(KW_ON (identifier | qualifiedName LEFT_PAREN RIGHT_PAREN))? KW_ON (identifier | qualifiedName LEFT_PAREN RIGHT_PAREN)
)?
| bytes=expression | bytes=expression
; ;
@ -767,8 +763,7 @@ identifierComment
; ;
relationPrimary relationPrimary
: identifierReference temporalClause? : identifierReference temporalClause? sample? tableAlias
sample? tableAlias
| LEFT_PAREN query RIGHT_PAREN sample? tableAlias | LEFT_PAREN query RIGHT_PAREN sample? tableAlias
| LEFT_PAREN relation RIGHT_PAREN sample? tableAlias | LEFT_PAREN relation RIGHT_PAREN sample? tableAlias
| inlineTable | inlineTable
@ -786,13 +781,19 @@ functionTableSubqueryArgument
; ;
tableArgumentPartitioning tableArgumentPartitioning
: ((KW_WITH KW_SINGLE KW_PARTITION) : (
| ((KW_PARTITION | KW_DISTRIBUTE) KW_BY (KW_WITH KW_SINGLE KW_PARTITION)
(((LEFT_PAREN partition+=expression (COMMA partition+=expression)* RIGHT_PAREN)) | (
| partition+=expression))) (KW_PARTITION | KW_DISTRIBUTE) KW_BY (
((KW_ORDER | KW_SORT) KW_BY ((LEFT_PAREN partition+=expression (COMMA partition+=expression)* RIGHT_PAREN))
(((LEFT_PAREN sortItem (COMMA sortItem)* RIGHT_PAREN) | partition+=expression
| sortItem)))? )
)
) (
(KW_ORDER | KW_SORT) KW_BY (
((LEFT_PAREN sortItem (COMMA sortItem)* RIGHT_PAREN) | sortItem)
)
)?
; ;
functionTableNamedArgumentExpression functionTableNamedArgumentExpression
@ -810,9 +811,7 @@ functionTableArgument
; ;
functionTable functionTable
: functionName LEFT_PAREN : functionName LEFT_PAREN (functionTableArgument (COMMA functionTableArgument)*)? RIGHT_PAREN tableAlias
(functionTableArgument (COMMA functionTableArgument)*)?
RIGHT_PAREN tableAlias
; ;
tableAlias tableAlias
@ -821,12 +820,15 @@ tableAlias
rowFormat rowFormat
: KW_ROW KW_FORMAT KW_SERDE name=stringLit (KW_WITH KW_SERDEPROPERTIES props=propertyList)? : KW_ROW KW_FORMAT KW_SERDE name=stringLit (KW_WITH KW_SERDEPROPERTIES props=propertyList)?
| KW_ROW KW_FORMAT KW_DELIMITED | KW_ROW KW_FORMAT KW_DELIMITED (
(KW_FIELDS KW_TERMINATED KW_BY fieldsTerminatedBy=stringLit (KW_ESCAPED KW_BY escapedBy=stringLit)?)? KW_FIELDS KW_TERMINATED KW_BY fieldsTerminatedBy=stringLit (
(KW_COLLECTION KW_ITEMS KW_TERMINATED KW_BY collectionItemsTerminatedBy=stringLit)? KW_ESCAPED KW_BY escapedBy=stringLit
(KW_MAP KW_KEYS KW_TERMINATED KW_BY keysTerminatedBy=stringLit)? )?
(KW_LINES KW_TERMINATED KW_BY linesSeparatedBy=stringLit)? )? (KW_COLLECTION KW_ITEMS KW_TERMINATED KW_BY collectionItemsTerminatedBy=stringLit)? (
(KW_NULL KW_DEFINED KW_AS nullDefinedAs=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 multipartIdentifierList
@ -872,8 +874,7 @@ partitionField
transform transform
: qualifiedName : qualifiedName
| transformName=identifier | transformName=identifier LEFT_PAREN transformArgument (COMMA transformArgument)* RIGHT_PAREN
LEFT_PAREN transformArgument (COMMA transformArgument)* RIGHT_PAREN
; ;
transformArgument 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 expression (COMMA expression)* RIGHT_PAREN
| KW_NOT? kind=KW_IN LEFT_PAREN query 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_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_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_NULL
| KW_IS KW_NOT? kind=(KW_TRUE | KW_FALSE | KW_UNKNOWN) | KW_IS KW_NOT? kind=(KW_TRUE | KW_FALSE | KW_UNKNOWN)
@ -930,15 +934,29 @@ valueExpression
; ;
datetimeUnit datetimeUnit
: KW_YEAR | KW_QUARTER | KW_MONTH : KW_YEAR
| KW_WEEK | KW_DAY | KW_DAYOFYEAR | KW_QUARTER
| KW_HOUR | KW_MINUTE | KW_SECOND | KW_MILLISECOND | KW_MICROSECOND | KW_MONTH
| KW_WEEK
| KW_DAY
| KW_DAYOFYEAR
| KW_HOUR
| KW_MINUTE
| KW_SECOND
| KW_MILLISECOND
| KW_MICROSECOND
; ;
primaryExpression primaryExpression
: name=(KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_CURRENT_USER | KW_USER | KW_SESSION_USER) : 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_TIMESTAMPADD | KW_DATEADD | KW_DATE_ADD) LEFT_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 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 whenClause+ (KW_ELSE elseExpression=expression)? KW_END
| KW_CASE expression 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 | 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 namedExpression (COMMA namedExpression)+ RIGHT_PAREN
| LEFT_PAREN query RIGHT_PAREN | LEFT_PAREN query RIGHT_PAREN
| KW_IDENTIFIER LEFT_PAREN expression RIGHT_PAREN | KW_IDENTIFIER LEFT_PAREN expression RIGHT_PAREN
| functionName LEFT_PAREN (setQuantifier? functionArgument | functionName LEFT_PAREN (setQuantifier? functionArgument (COMMA functionArgument)*)? RIGHT_PAREN (
(COMMA functionArgument)*)? RIGHT_PAREN KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN
(KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN)? )? (nullsOption=(KW_IGNORE | KW_RESPECT) KW_NULLS)? (KW_OVER windowSpec)?
(nullsOption=(KW_IGNORE | KW_RESPECT) KW_NULLS)? ( KW_OVER windowSpec)?
| identifier ARROW expression | identifier ARROW expression
| LEFT_PAREN identifier (COMMA identifier)+ RIGHT_PAREN ARROW expression | LEFT_PAREN identifier (COMMA identifier)+ RIGHT_PAREN ARROW expression
| value=primaryExpression LEFT_BRACKET index=valueExpression RIGHT_BRACKET | value=primaryExpression LEFT_BRACKET index=valueExpression RIGHT_BRACKET
@ -964,20 +981,26 @@ primaryExpression
| base=primaryExpression DOT fieldName=identifier | base=primaryExpression DOT fieldName=identifier
| LEFT_PAREN expression RIGHT_PAREN | LEFT_PAREN expression RIGHT_PAREN
| KW_EXTRACT LEFT_PAREN field=identifier KW_FROM source=valueExpression 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_SUBSTR | KW_SUBSTRING) LEFT_PAREN str=valueExpression (KW_FROM | COMMA) pos=valueExpression (
((KW_FOR | COMMA) len=valueExpression)? RIGHT_PAREN (KW_FOR | COMMA) len=valueExpression
| KW_TRIM LEFT_PAREN trimOption=(KW_BOTH | KW_LEADING | KW_TRAILING)? (trimStr=valueExpression)? )? RIGHT_PAREN
KW_FROM srcStr=valueExpression RIGHT_PAREN | KW_TRIM LEFT_PAREN trimOption=(KW_BOTH | KW_LEADING | KW_TRAILING)? (
| KW_OVERLAY LEFT_PAREN input=valueExpression KW_PLACING replace=valueExpression trimStr=valueExpression
KW_FROM position=valueExpression (KW_FOR length=valueExpression)? RIGHT_PAREN )? KW_FROM srcStr=valueExpression RIGHT_PAREN
| name=(KW_PERCENTILE_CONT | KW_PERCENTILE_DISC) LEFT_PAREN percentage=valueExpression RIGHT_PAREN | KW_OVERLAY LEFT_PAREN input=valueExpression KW_PLACING replace=valueExpression KW_FROM position=valueExpression (
KW_WITHIN KW_GROUP LEFT_PAREN KW_ORDER KW_BY sortItem RIGHT_PAREN KW_FOR length=valueExpression
(KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN)? ( KW_OVER windowSpec)? )? 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 literalType
: KW_DATE : KW_DATE
| KW_TIMESTAMP | KW_TIMESTAMP_LTZ | KW_TIMESTAMP_NTZ | KW_TIMESTAMP
| KW_TIMESTAMP_LTZ
| KW_TIMESTAMP_NTZ
| KW_INTERVAL | KW_INTERVAL
| KW_BINARY_HEX | KW_BINARY_HEX
| unsupportedType=identifier | unsupportedType=identifier
@ -995,19 +1018,40 @@ constant
; ;
comparisonOperator comparisonOperator
: EQ | NEQ | NEQJ | LT | LTE | GT | GTE | NSEQ : EQ
| NEQ
| NEQJ
| LT
| LTE
| GT
| GTE
| NSEQ
; ;
arithmeticOperator 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 predicateOperator
: KW_OR | KW_AND | KW_IN | KW_NOT : KW_OR
| KW_AND
| KW_IN
| KW_NOT
; ;
booleanValue booleanValue
: KW_TRUE | KW_FALSE : KW_TRUE
| KW_FALSE
; ;
interval interval
@ -1031,42 +1075,76 @@ unitToUnitInterval
; ;
intervalValue intervalValue
: (PLUS | MINUS)? : (PLUS | MINUS)? (INTEGER_VALUE | DECIMAL_VALUE | stringLit)
(INTEGER_VALUE | DECIMAL_VALUE | stringLit)
; ;
unitInMultiUnits unitInMultiUnits
: KW_NANOSECOND | KW_NANOSECONDS | KW_MICROSECOND | KW_MICROSECONDS | KW_MILLISECOND | KW_MILLISECONDS : KW_NANOSECOND
| KW_SECOND | KW_SECONDS | KW_MINUTE | KW_MINUTES | KW_HOUR | KW_HOURS | KW_DAY | KW_DAYS | KW_WEEK | KW_WEEKS | KW_NANOSECONDS
| KW_MONTH | KW_MONTHS | KW_YEAR | KW_YEARS | 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 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 colPosition
: position=KW_FIRST | position=KW_AFTER afterCol=errorCapturingIdentifier : position=KW_FIRST
| position=KW_AFTER afterCol=errorCapturingIdentifier
; ;
type type
: KW_BOOLEAN : KW_BOOLEAN
| KW_TINYINT | KW_BYTE | KW_TINYINT
| KW_SMALLINT | KW_SHORT | KW_BYTE
| KW_INT | KW_INTEGER | KW_SMALLINT
| KW_BIGINT | KW_LONG | KW_SHORT
| KW_FLOAT | KW_REAL | KW_INT
| KW_INTEGER
| KW_BIGINT
| KW_LONG
| KW_FLOAT
| KW_REAL
| KW_DOUBLE | KW_DOUBLE
| KW_DATE | KW_DATE
| KW_TIMESTAMP | KW_TIMESTAMP_NTZ | KW_TIMESTAMP_LTZ | KW_TIMESTAMP
| KW_TIMESTAMP_NTZ
| KW_TIMESTAMP_LTZ
| KW_STRING | KW_STRING
| KW_CHARACTER | KW_CHAR | KW_CHARACTER
| KW_CHAR
| KW_VARCHAR | KW_VARCHAR
| KW_BINARY | KW_BINARY
| KW_DECIMAL | KW_DEC | KW_NUMERIC | KW_DECIMAL
| KW_DEC
| KW_NUMERIC
| KW_VOID | KW_VOID
| KW_INTERVAL | KW_INTERVAL
| KW_ARRAY | KW_STRUCT | KW_MAP | KW_ARRAY
| KW_STRUCT
| KW_MAP
| unsupportedType=identifier | unsupportedType=identifier
; ;
@ -1075,10 +1153,10 @@ dataType
| complex=KW_MAP LT dataType COMMA dataType GT | complex=KW_MAP LT dataType COMMA dataType GT
| complex=KW_STRUCT (LT complexColTypeList? GT | NEQ) | complex=KW_STRUCT (LT complexColTypeList? GT | NEQ)
| KW_INTERVAL (KW_YEAR | KW_MONTH) (KW_TO KW_MONTH)? | KW_INTERVAL (KW_YEAR | KW_MONTH) (KW_TO KW_MONTH)?
| KW_INTERVAL (KW_DAY | KW_HOUR | KW_MINUTE | KW_SECOND) | KW_INTERVAL (KW_DAY | KW_HOUR | KW_MINUTE | KW_SECOND) (
(KW_TO (KW_HOUR | KW_MINUTE | KW_SECOND))? KW_TO (KW_HOUR | KW_MINUTE | KW_SECOND)
| type (LEFT_PAREN INTEGER_VALUE )?
(COMMA INTEGER_VALUE)* RIGHT_PAREN)? | type (LEFT_PAREN INTEGER_VALUE (COMMA INTEGER_VALUE)* RIGHT_PAREN)?
; ;
qualifiedColTypeWithPositionSeqForAdd qualifiedColTypeWithPositionSeqForAdd
@ -1097,7 +1175,6 @@ qualifiedColTypeWithPositionForReplace
: name=columnName dataType colDefinitionDescriptorWithPosition* : name=columnName dataType colDefinitionDescriptorWithPosition*
; ;
colDefinitionDescriptorWithPosition colDefinitionDescriptorWithPosition
: KW_NOT KW_NULL : KW_NOT KW_NULL
| defaultExpression | defaultExpression
@ -1163,12 +1240,14 @@ namedWindow
windowSpec windowSpec
: name=errorCapturingIdentifier : name=errorCapturingIdentifier
| LEFT_PAREN name=errorCapturingIdentifier RIGHT_PAREN | LEFT_PAREN name=errorCapturingIdentifier RIGHT_PAREN
| LEFT_PAREN | LEFT_PAREN (
( KW_CLUSTER KW_BY partition+=expression (COMMA partition+=expression)* 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)*)?) (KW_PARTITION | KW_DISTRIBUTE) KW_BY partition+=expression (
windowFrame? COMMA partition+=expression
RIGHT_PAREN )*
)? ((KW_ORDER | KW_SORT) KW_BY sortItem (COMMA sortItem)*)?
) windowFrame? RIGHT_PAREN
; ;
/** /**

File diff suppressed because it is too large Load Diff

270
yarn.lock
View File

@ -17,6 +17,14 @@
dependencies: dependencies:
"@babel/highlight" "^7.18.6" "@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": "@babel/compat-data@^7.22.0":
version "7.22.3" version "7.22.3"
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.3.tgz#cd502a6a0b6e37d7ad72ce7e71a7160a3ae36f7e" 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" 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== 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": "@babel/helper-validator-option@^7.21.0":
version "7.21.0" version "7.21.0"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" 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" chalk "^2.0.0"
js-tokens "^4.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": "@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" version "7.22.4"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.4.tgz#a770e98fd785c231af9d93f6459d36770993fb32" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.4.tgz#a770e98fd785c231af9d93f6459d36770993fb32"
@ -260,6 +282,13 @@
dependencies: dependencies:
"@babel/helper-plugin-utils" "^7.20.2" "@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": "@babel/template@^7.20.7", "@babel/template@^7.21.9", "@babel/template@^7.3.3":
version "7.21.9" version "7.21.9"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.21.9.tgz#bf8dad2859130ae46088a99c1f265394877446fb" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.21.9.tgz#bf8dad2859130ae46088a99c1f265394877446fb"
@ -479,11 +508,28 @@
dependencies: dependencies:
"@jridgewell/trace-mapping" "0.3.9" "@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": "@hutson/parse-repository-url@^3.0.0":
version "3.0.2" version "3.0.2"
resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340"
integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== 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": "@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" 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/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14" "@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": "@sinclair/typebox@^0.25.16":
version "0.25.24" version "0.25.24"
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718"
@ -940,6 +1004,11 @@
expect "^29.0.0" expect "^29.0.0"
pretty-format "^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": "@types/minimist@^1.2.0":
version "1.2.2" version "1.2.2"
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" 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" clean-stack "^2.0.0"
indent-string "^4.0.0" indent-string "^4.0.0"
ajv@^8.11.0: ajv@8.12.0, ajv@^8.11.0:
version "8.12.0" version "8.12.0"
resolved "https://registry.npmmirror.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" resolved "https://registry.npmmirror.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1"
integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== 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" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== 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" version "6.2.1"
resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== 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: antlr4-c3@3.1.1:
version "3.1.1" version "3.1.1"
resolved "https://registry.npmmirror.com/antlr4-c3/-/antlr4-c3-3.1.1.tgz#f3d579e17c925d9e3cc984ed0ecb5095fce1611f" resolved "https://registry.npmmirror.com/antlr4-c3/-/antlr4-c3-3.1.1.tgz#f3d579e17c925d9e3cc984ed0ecb5095fce1611f"
@ -1083,6 +1164,11 @@ antlr4-c3@3.1.1:
dependencies: dependencies:
antlr4ts "0.5.0-alpha.4" 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: antlr4ts-cli@^0.5.0-alpha.4:
version "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" 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" balanced-match "^1.0.0"
concat-map "0.0.1" 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: braces@^3.0.2:
version "3.0.2" version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" 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" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001491.tgz#eab0e0f392de6f7411751d148de9b5bd6b203e46"
integrity sha512-17EYIi4TLnPiTzVKMveIxU5ETlxbSO3B6iPvMbprqnKh4qJsQGk5Nh1Lp4jIMAE0XfrujsJuWZAM3oJdMHaKBA== 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" version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== 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" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== 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: collect-v8-coverage@^1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" 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" resolved "https://registry.npmmirror.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a"
integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== 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: commander@^9.3.0:
version "9.5.0" version "9.5.0"
resolved "https://registry.npmmirror.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" 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" resolved "https://registry.npmmirror.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== 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" version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
@ -2001,6 +2104,14 @@ findup-sync@^4.0.0:
micromatch "^4.0.2" micromatch "^4.0.2"
resolve-dir "^1.0.1" 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: fs-extra@9.1.0:
version "9.1.0" version "9.1.0"
resolved "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" resolved "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
@ -2099,6 +2210,17 @@ gitconfiglocal@^1.0.0:
dependencies: dependencies:
ini "^1.3.2" 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: glob@7.2.3, glob@^7.1.3, glob@^7.1.4:
version "7.2.3" version "7.2.3"
resolved "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" 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" once "^1.3.0"
path-is-absolute "^1.0.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: global-dirs@^0.1.1:
version "0.1.1" version "0.1.1"
resolved "https://registry.npmmirror.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" 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" 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== 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: handlebars@^4.7.7:
version "4.7.7" version "4.7.7"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" 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" html-escaper "^2.0.0"
istanbul-lib-report "^3.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: jest-changed-files@^29.5.0:
version "29.5.0" version "29.5.0"
resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" 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" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== 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" 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== integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
jsonc-parser@^3.2.0: 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" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== 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: kind-of@^6.0.3:
version "6.0.3" version "6.0.3"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
@ -3083,6 +3243,11 @@ lru-cache@^6.0.0:
dependencies: dependencies:
yallist "^4.0.0" 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: make-dir@^3.0.0:
version "3.1.0" version "3.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" 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: dependencies:
brace-expansion "^1.1.7" 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: minimist-options@4.1.0:
version "4.1.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" 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" resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== 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: modify-values@^1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" 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" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== 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: path-type@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" 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" indent-string "^4.0.0"
strip-indent "^3.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: require-directory@^2.1.1:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" 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" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== 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": "safer-buffer@>= 2.1.2 < 3":
version "2.1.2" version "2.1.2"
resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" 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" resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== 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: sisteransi@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" 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" char-regex "^1.0.2"
strip-ansi "^6.0.0" 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: string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3" version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" 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" is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1" 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" version "5.1.2"
resolved "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" resolved "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== 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" resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85"
integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== 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: strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1" version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" 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" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== 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: ts-node@^10.8.1:
version "10.9.1" version "10.9.1"
resolved "https://registry.npmmirror.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" 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" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== 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" version "5.2.2"
resolved "https://registry.npmmirror.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" resolved "https://registry.npmmirror.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== 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" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== 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: wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
version "6.2.0" version "6.2.0"
resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" 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" string-width "^4.1.0"
strip-ansi "^6.0.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: wrappy@1:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"