You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2020/10/20 11:15:29 UTC
[shardingsphere] branch master updated: change parser rule name
from XXX_ to XXX (#7863)
This is an automated email from the ASF dual-hosted git repository.
panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 3aa401b change parser rule name from XXX_ to XXX (#7863)
3aa401b is described below
commit 3aa401b34481de0c22afde0bf68d52fb81f19cee
Author: JingShang Lu <lu...@apache.org>
AuthorDate: Tue Oct 20 19:15:12 2020 +0800
change parser rule name from XXX_ to XXX (#7863)
---
.../src/main/antlr4/imports/mysql/BaseRule.g4 | 2 +-
.../src/main/antlr4/imports/mysql/DDLStatement.g4 | 20 +-
.../src/main/antlr4/imports/oracle/BaseRule.g4 | 22 +-
.../src/main/antlr4/imports/oracle/DCLStatement.g4 | 260 ++++++++++-----------
.../src/main/antlr4/imports/oracle/DDLStatement.g4 | 58 ++---
.../src/main/antlr4/imports/oracle/DMLStatement.g4 | 8 +-
.../src/main/antlr4/imports/sql92/BaseRule.g4 | 48 ++--
.../src/main/antlr4/imports/sql92/DCLStatement.g4 | 18 +-
.../src/main/antlr4/imports/sql92/DDLStatement.g4 | 34 +--
.../src/main/antlr4/imports/sql92/TCLStatement.g4 | 4 +-
.../src/main/antlr4/imports/sqlserver/BaseRule.g4 | 24 +-
.../main/antlr4/imports/sqlserver/DCLStatement.g4 | 70 +++---
.../main/antlr4/imports/sqlserver/DDLStatement.g4 | 106 ++++-----
.../main/antlr4/imports/sqlserver/DMLStatement.g4 | 28 +--
.../visitor/impl/SQLServerDMLVisitor.java | 48 ++--
15 files changed, 375 insertions(+), 375 deletions(-)
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
index 1bb9df0..1307d02 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
@@ -613,7 +613,7 @@ ignoredIdentifier
: identifier (DOT_ identifier)?
;
-ignoredIdentifiers_
+ignoredIdentifiers
: ignoredIdentifier (COMMA_ ignoredIdentifier)*
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
index 44a0684..95004d0 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
@@ -436,18 +436,18 @@ alterSpecification
| renameTableSpecification
| (WITHOUT | WITH) VALIDATION
| ADD PARTITION LP_ partitionDefinition RP_
- | DROP PARTITION ignoredIdentifiers_
- | DISCARD PARTITION (ignoredIdentifiers_ | ALL) TABLESPACE
- | IMPORT PARTITION (ignoredIdentifiers_ | ALL) TABLESPACE
- | TRUNCATE PARTITION (ignoredIdentifiers_ | ALL)
+ | DROP PARTITION ignoredIdentifiers
+ | DISCARD PARTITION (ignoredIdentifiers | ALL) TABLESPACE
+ | IMPORT PARTITION (ignoredIdentifiers | ALL) TABLESPACE
+ | TRUNCATE PARTITION (ignoredIdentifiers | ALL)
| COALESCE PARTITION NUMBER_
- | REORGANIZE PARTITION ignoredIdentifiers_ INTO partitionDefinitions
+ | REORGANIZE PARTITION ignoredIdentifiers INTO partitionDefinitions
| EXCHANGE PARTITION ignoredIdentifier WITH TABLE tableName ((WITH | WITHOUT) VALIDATION)?
- | ANALYZE PARTITION (ignoredIdentifiers_ | ALL)
- | CHECK PARTITION (ignoredIdentifiers_ | ALL)
- | OPTIMIZE PARTITION (ignoredIdentifiers_ | ALL)
- | REBUILD PARTITION (ignoredIdentifiers_ | ALL)
- | REPAIR PARTITION (ignoredIdentifiers_ | ALL)
+ | ANALYZE PARTITION (ignoredIdentifiers | ALL)
+ | CHECK PARTITION (ignoredIdentifiers | ALL)
+ | OPTIMIZE PARTITION (ignoredIdentifiers | ALL)
+ | REBUILD PARTITION (ignoredIdentifiers | ALL)
+ | REPAIR PARTITION (ignoredIdentifiers | ALL)
| REMOVE PARTITIONING
| UPGRADE PARTITIONING
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
index 8343795..ed478ba 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
@@ -162,7 +162,7 @@ exprList
// TODO comb expr
expr
: expr logicalOperator expr
- | notOperator_ expr
+ | notOperator expr
| LP_ expr RP_
| booleanPrimary
;
@@ -171,7 +171,7 @@ logicalOperator
: OR | OR_ | AND | AND_
;
-notOperator_
+notOperator
: NOT | NOT_
;
@@ -248,26 +248,26 @@ castFunction
;
charFunction
- : CHAR LP_ expr (COMMA_ expr)* (USING ignoredIdentifier_)? RP_
+ : CHAR LP_ expr (COMMA_ expr)* (USING ignoredIdentifier)? RP_
;
regularFunction
- : regularFunctionName_ LP_ (expr (COMMA_ expr)* | ASTERISK_)? RP_
+ : regularFunctionName LP_ (expr (COMMA_ expr)* | ASTERISK_)? RP_
;
-regularFunctionName_
+regularFunctionName
: identifier | IF | LOCALTIME | LOCALTIMESTAMP | INTERVAL
;
caseExpression
- : CASE simpleExpr? caseWhen_+ caseElse_?
+ : CASE simpleExpr? caseWhen+ caseElse?
;
-caseWhen_
+caseWhen
: WHEN expr THEN expr
;
-caseElse_
+caseElse
: ELSE expr
;
@@ -363,12 +363,12 @@ constructorExpr
: NEW dataTypeName exprList
;
-ignoredIdentifier_
+ignoredIdentifier
: IDENTIFIER_
;
-ignoredIdentifiers_
- : ignoredIdentifier_ (COMMA_ ignoredIdentifier_)*
+ignoredIdentifiers
+ : ignoredIdentifier (COMMA_ ignoredIdentifier)*
;
matchNone
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DCLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DCLStatement.g4
index 807cc2d..c01b511 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DCLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DCLStatement.g4
@@ -20,30 +20,30 @@ grammar DCLStatement;
import Symbol, Keyword, OracleKeyword, Literals, BaseRule;
grant
- : GRANT (objectPrivilegeClause | systemPrivilegeClause_ | roleClause_)
+ : GRANT (objectPrivilegeClause | systemPrivilegeClause | roleClause)
;
revoke
- : REVOKE (objectPrivilegeClause | systemPrivilegeClause_ | roleClause_)
+ : REVOKE (objectPrivilegeClause | systemPrivilegeClause | roleClause)
;
objectPrivilegeClause
- : objectPrivileges_ ON onObjectClause
+ : objectPrivileges ON onObjectClause
;
-systemPrivilegeClause_
- : systemPrivilege_
+systemPrivilegeClause
+ : systemPrivilege
;
-roleClause_
- : ignoredIdentifiers_
+roleClause
+ : ignoredIdentifiers
;
-objectPrivileges_
- : objectPrivilegeType_ columnNames? (COMMA_ objectPrivilegeType_ columnNames?)*
+objectPrivileges
+ : objectPrivilegeType columnNames? (COMMA_ objectPrivilegeType columnNames?)*
;
-objectPrivilegeType_
+objectPrivilegeType
: ALL PRIVILEGES?
| SELECT
| INSERT
@@ -73,226 +73,226 @@ onObjectClause
| tableName
;
-systemPrivilege_
+systemPrivilege
: ALL PRIVILEGES
- | advisorFrameworkSystemPrivilege_
- | clustersSystemPrivilege_
- | contextsSystemPrivilege_
- | dataRedactionSystemPrivilege_
- | databaseSystemPrivilege_
- | databaseLinksSystemPrivilege_
- | debuggingSystemPrivilege_
- | dictionariesSystemPrivilege_
- | dimensionsSystemPrivilege_
- | directoriesSystemPrivilege_
- | editionsSystemPrivilege_
- | flashbackDataArchivesPrivilege_
- | indexesSystemPrivilege_
- | indexTypesSystemPrivilege_
- | jobSchedulerObjectsSystemPrivilege_
- | keyManagementFrameworkSystemPrivilege_
- | librariesFrameworkSystemPrivilege_
- | logminerFrameworkSystemPrivilege_
- | materizlizedViewsSystemPrivilege_
- | miningModelsSystemPrivilege_
- | olapCubesSystemPrivilege_
- | olapCubeMeasureFoldersSystemPrivilege_
- | olapCubeDiminsionsSystemPrivilege_
- | olapCubeBuildProcessesSystemPrivilege_
- | operatorsSystemPrivilege_
- | outlinesSystemPrivilege_
- | planManagementSystemPrivilege_
- | pluggableDatabasesSystemPrivilege_
- | proceduresSystemPrivilege_
- | profilesSystemPrivilege_
- | rolesSystemPrivilege_
- | rollbackSegmentsSystemPrivilege_
- | sequencesSystemPrivilege_
- | sessionsSystemPrivilege_
- | sqlTranslationProfilesSystemPrivilege_
- | synonymsSystemPrivilege_
- | tablesSystemPrivilege_
- | tablespacesSystemPrivilege_
- | triggersSystemPrivilege_
- | typesSystemPrivilege_
- | usersSystemPrivilege_
- | viewsSystemPrivilege_
- | miscellaneousSystemPrivilege_
- ;
-
-systemPrivilegeOperation_
+ | advisorFrameworkSystemPrivilege
+ | clustersSystemPrivilege
+ | contextsSystemPrivilege
+ | dataRedactionSystemPrivilege
+ | databaseSystemPrivilege
+ | databaseLinksSystemPrivilege
+ | debuggingSystemPrivilege
+ | dictionariesSystemPrivilege
+ | dimensionsSystemPrivilege
+ | directoriesSystemPrivilege
+ | editionsSystemPrivilege
+ | flashbackDataArchivesPrivilege
+ | indexesSystemPrivilege
+ | indexTypesSystemPrivilege
+ | jobSchedulerObjectsSystemPrivilege
+ | keyManagementFrameworkSystemPrivilege
+ | librariesFrameworkSystemPrivilege
+ | logminerFrameworkSystemPrivilege
+ | materizlizedViewsSystemPrivilege
+ | miningModelsSystemPrivilege
+ | olapCubesSystemPrivilege
+ | olapCubeMeasureFoldersSystemPrivilege
+ | olapCubeDiminsionsSystemPrivilege
+ | olapCubeBuildProcessesSystemPrivilege
+ | operatorsSystemPrivilege
+ | outlinesSystemPrivilege
+ | planManagementSystemPrivilege
+ | pluggableDatabasesSystemPrivilege
+ | proceduresSystemPrivilege
+ | profilesSystemPrivilege
+ | rolesSystemPrivilege
+ | rollbackSegmentsSystemPrivilege
+ | sequencesSystemPrivilege
+ | sessionsSystemPrivilege
+ | sqlTranslationProfilesSystemPrivilege
+ | synonymsSystemPrivilege
+ | tablesSystemPrivilege
+ | tablespacesSystemPrivilege
+ | triggersSystemPrivilege
+ | typesSystemPrivilege
+ | usersSystemPrivilege
+ | viewsSystemPrivilege
+ | miscellaneousSystemPrivilege
+ ;
+
+systemPrivilegeOperation
: (CREATE | ALTER | DROP | SELECT | INSERT | UPDATE | DELETE | EXECUTE) ANY?
;
-advisorFrameworkSystemPrivilege_
- : systemPrivilegeOperation_? SQL PROFILE | ADVISOR | ADMINISTER ANY? SQL (TUNING SET | MANAGEMENT OBJECT)
+advisorFrameworkSystemPrivilege
+ : systemPrivilegeOperation? SQL PROFILE | ADVISOR | ADMINISTER ANY? SQL (TUNING SET | MANAGEMENT OBJECT)
;
-clustersSystemPrivilege_
- : systemPrivilegeOperation_ CLUSTER
+clustersSystemPrivilege
+ : systemPrivilegeOperation CLUSTER
;
-contextsSystemPrivilege_
- : systemPrivilegeOperation_ CONTEXT
+contextsSystemPrivilege
+ : systemPrivilegeOperation CONTEXT
;
-dataRedactionSystemPrivilege_
+dataRedactionSystemPrivilege
: EXEMPT REDACTION POLICY
;
-databaseSystemPrivilege_
+databaseSystemPrivilege
: ALTER (DATABASE | SYSTEM) | AUDIT SYSTEM
;
-databaseLinksSystemPrivilege_
+databaseLinksSystemPrivilege
: (CREATE | ALTER | DROP) PUBLIC? DATABASE LINK
;
-debuggingSystemPrivilege_
+debuggingSystemPrivilege
: DEBUG (CONNECT SESSION | ANY PROCEDURE)
;
-dictionariesSystemPrivilege_
+dictionariesSystemPrivilege
: ANALYZE ANY DICTIONARY
;
-dimensionsSystemPrivilege_
- : systemPrivilegeOperation_ DIMENSION
+dimensionsSystemPrivilege
+ : systemPrivilegeOperation DIMENSION
;
-directoriesSystemPrivilege_
- : systemPrivilegeOperation_ DIRECTORY
+directoriesSystemPrivilege
+ : systemPrivilegeOperation DIRECTORY
;
-editionsSystemPrivilege_
- : systemPrivilegeOperation_ EDITION
+editionsSystemPrivilege
+ : systemPrivilegeOperation EDITION
;
-flashbackDataArchivesPrivilege_
+flashbackDataArchivesPrivilege
: FLASHBACK ARCHIVE ADMINISTER
;
-indexesSystemPrivilege_
- : systemPrivilegeOperation_ INDEX
+indexesSystemPrivilege
+ : systemPrivilegeOperation INDEX
;
-indexTypesSystemPrivilege_
- : systemPrivilegeOperation_ INDEXTYPE
+indexTypesSystemPrivilege
+ : systemPrivilegeOperation INDEXTYPE
;
-jobSchedulerObjectsSystemPrivilege_
+jobSchedulerObjectsSystemPrivilege
: CREATE (ANY | EXTERNAL)? JOB | EXECUTE ANY (CLASS | PROGRAM) | MANAGE SCHEDULER
;
-keyManagementFrameworkSystemPrivilege_
+keyManagementFrameworkSystemPrivilege
: ADMINISTER KEY MANAGEMENT
;
-librariesFrameworkSystemPrivilege_
- : systemPrivilegeOperation_ LIBRARY
+librariesFrameworkSystemPrivilege
+ : systemPrivilegeOperation LIBRARY
;
-logminerFrameworkSystemPrivilege_
+logminerFrameworkSystemPrivilege
: LOGMINING
;
-materizlizedViewsSystemPrivilege_
- : systemPrivilegeOperation_ MATERIALIZED VIEW | GLOBAL? QUERY REWRITE | ON COMMIT REFRESH | FLASHBACK ANY TABLE
+materizlizedViewsSystemPrivilege
+ : systemPrivilegeOperation MATERIALIZED VIEW | GLOBAL? QUERY REWRITE | ON COMMIT REFRESH | FLASHBACK ANY TABLE
;
-miningModelsSystemPrivilege_
- : (systemPrivilegeOperation_ | COMMENT ANY) MINING MODEL
+miningModelsSystemPrivilege
+ : (systemPrivilegeOperation | COMMENT ANY) MINING MODEL
;
-olapCubesSystemPrivilege_
- : systemPrivilegeOperation_ CUBE
+olapCubesSystemPrivilege
+ : systemPrivilegeOperation CUBE
;
-olapCubeMeasureFoldersSystemPrivilege_
- : systemPrivilegeOperation_ MEASURE FOLDER
+olapCubeMeasureFoldersSystemPrivilege
+ : systemPrivilegeOperation MEASURE FOLDER
;
-olapCubeDiminsionsSystemPrivilege_
- : systemPrivilegeOperation_ CUBE DIMENSION
+olapCubeDiminsionsSystemPrivilege
+ : systemPrivilegeOperation CUBE DIMENSION
;
-olapCubeBuildProcessesSystemPrivilege_
- : systemPrivilegeOperation_ CUBE BUILD PROCESS
+olapCubeBuildProcessesSystemPrivilege
+ : systemPrivilegeOperation CUBE BUILD PROCESS
;
-operatorsSystemPrivilege_
- : systemPrivilegeOperation_ OPERATOR
+operatorsSystemPrivilege
+ : systemPrivilegeOperation OPERATOR
;
-outlinesSystemPrivilege_
- : systemPrivilegeOperation_ OUTLINE
+outlinesSystemPrivilege
+ : systemPrivilegeOperation OUTLINE
;
-planManagementSystemPrivilege_
+planManagementSystemPrivilege
: ADMINISTER SQL MANAGEMENT OBJECT
;
-pluggableDatabasesSystemPrivilege_
+pluggableDatabasesSystemPrivilege
: CREATE PLUGGABLE DATABASE | SET CONTAINER
;
-proceduresSystemPrivilege_
- : systemPrivilegeOperation_ PROCEDURE
+proceduresSystemPrivilege
+ : systemPrivilegeOperation PROCEDURE
;
-profilesSystemPrivilege_
- : systemPrivilegeOperation_ PROFILE
+profilesSystemPrivilege
+ : systemPrivilegeOperation PROFILE
;
-rolesSystemPrivilege_
- : (systemPrivilegeOperation_ | GRANT ANY) ROLE
+rolesSystemPrivilege
+ : (systemPrivilegeOperation | GRANT ANY) ROLE
;
-rollbackSegmentsSystemPrivilege_
- : systemPrivilegeOperation_ ROLLBACK SEGMENT
+rollbackSegmentsSystemPrivilege
+ : systemPrivilegeOperation ROLLBACK SEGMENT
;
-sequencesSystemPrivilege_
- : systemPrivilegeOperation_ SEQUENCE
+sequencesSystemPrivilege
+ : systemPrivilegeOperation SEQUENCE
;
-sessionsSystemPrivilege_
+sessionsSystemPrivilege
: (CREATE | ALTER | RESTRICTED) SESSION | ALTER RESOURCE COST
;
-sqlTranslationProfilesSystemPrivilege_
- : (systemPrivilegeOperation_ | USE ANY) SQL TRANSLATION PROFILE | TRANSLATE ANY SQL
+sqlTranslationProfilesSystemPrivilege
+ : (systemPrivilegeOperation | USE ANY) SQL TRANSLATION PROFILE | TRANSLATE ANY SQL
;
-synonymsSystemPrivilege_
- : systemPrivilegeOperation_ SYNONYM | DROP PUBLIC SYNONYM
+synonymsSystemPrivilege
+ : systemPrivilegeOperation SYNONYM | DROP PUBLIC SYNONYM
;
-tablesSystemPrivilege_
- : (systemPrivilegeOperation_ | (BACKUP | LOCK | READ | FLASHBACK) ANY) TABLE
+tablesSystemPrivilege
+ : (systemPrivilegeOperation | (BACKUP | LOCK | READ | FLASHBACK) ANY) TABLE
;
-tablespacesSystemPrivilege_
- : (systemPrivilegeOperation_ | MANAGE | UNLIMITED) TABLESPACE
+tablespacesSystemPrivilege
+ : (systemPrivilegeOperation | MANAGE | UNLIMITED) TABLESPACE
;
-triggersSystemPrivilege_
- : systemPrivilegeOperation_ TRIGGER | ADMINISTER DATABASE TRIGGER
+triggersSystemPrivilege
+ : systemPrivilegeOperation TRIGGER | ADMINISTER DATABASE TRIGGER
;
-typesSystemPrivilege_
- : (systemPrivilegeOperation_ | UNDER ANY) TYPE
+typesSystemPrivilege
+ : (systemPrivilegeOperation | UNDER ANY) TYPE
;
-usersSystemPrivilege_
- : systemPrivilegeOperation_ USER
+usersSystemPrivilege
+ : systemPrivilegeOperation USER
;
-viewsSystemPrivilege_
- : (systemPrivilegeOperation_ | (UNDER | MERGE) ANY) VIEW
+viewsSystemPrivilege
+ : (systemPrivilegeOperation | (UNDER | MERGE) ANY) VIEW
;
-miscellaneousSystemPrivilege_
+miscellaneousSystemPrivilege
: ANALYZE ANY | AUDIT ANY | BECOME USER | CHANGE NOTIFICATION | COMMENT ANY TABLE | EXEMPT ACCESS POLICY | FORCE ANY? TRANSACTION
| GRANT ANY OBJECT? PRIVILEGE | INHERIT ANY PRIVILEGES | KEEP DATE TIME | KEEP SYSGUID | PURGE DBA_RECYCLEBIN | RESUMABLE
| SELECT ANY (DICTIONARY | TRANSACTION) | SYSBACKUP | SYSDBA | SYSDG | SYSKM | SYSOPER
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
index 538d5ec..9c03704 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
@@ -20,11 +20,11 @@ grammar DDLStatement;
import Symbol, Keyword, OracleKeyword, Literals, BaseRule;
createTable
- : CREATE createTableSpecification_ TABLE tableName createDefinitionClause
+ : CREATE createTableSpecification TABLE tableName createDefinitionClause
;
createIndex
- : CREATE createIndexSpecification_ INDEX indexName ON createIndexDefinitionClause
+ : CREATE createIndexSpecification INDEX indexName ON createIndexDefinitionClause
;
alterTable
@@ -33,7 +33,7 @@ alterTable
// TODO hongjun throw exeption when alter index on oracle
alterIndex
- : ALTER INDEX indexName renameIndexClause_
+ : ALTER INDEX indexName renameIndexClause
;
dropTable
@@ -48,7 +48,7 @@ truncateTable
: TRUNCATE TABLE tableName
;
-createTableSpecification_
+createTableSpecification
: (GLOBAL TEMPORARY)?
;
@@ -57,7 +57,7 @@ tablespaceClauseWithParen
;
tablespaceClause
- : TABLESPACE ignoredIdentifier_
+ : TABLESPACE ignoredIdentifier
;
domainIndexClause
@@ -77,14 +77,14 @@ relationalProperty
;
columnDefinition
- : columnName dataType SORT? visibleClause_ (defaultNullClause_ expr | identityClause)? (ENCRYPT encryptionSpecification_)? (inlineConstraint+ | inlineRefConstraint)?
+ : columnName dataType SORT? visibleClause (defaultNullClause expr | identityClause)? (ENCRYPT encryptionSpecification)? (inlineConstraint+ | inlineRefConstraint)?
;
-visibleClause_
+visibleClause
: (VISIBLE | INVISIBLE)?
;
-defaultNullClause_
+defaultNullClause
: DEFAULT (ON NULL)?
;
@@ -111,12 +111,12 @@ identityOption
| NOORDER
;
-encryptionSpecification_
+encryptionSpecification
: (USING STRING_)? (IDENTIFIED BY STRING_)? STRING_? (NO? SALT)?
;
inlineConstraint
- : (CONSTRAINT ignoredIdentifier_)? (NOT? NULL | UNIQUE | primaryKey | referencesClause | CHECK LP_ expr RP_) constraintState*
+ : (CONSTRAINT ignoredIdentifier)? (NOT? NULL | UNIQUE | primaryKey | referencesClause | CHECK LP_ expr RP_) constraintState*
;
referencesClause
@@ -146,15 +146,15 @@ exceptionsClause
;
usingIndexClause
- : USING INDEX (indexName | createIndexClause_)?
+ : USING INDEX (indexName | createIndexClause)?
;
-createIndexClause_
+createIndexClause
: LP_ createIndex RP_
;
inlineRefConstraint
- : SCOPE IS tableName | WITH ROWID | (CONSTRAINT ignoredIdentifier_)? referencesClause constraintState*
+ : SCOPE IS tableName | WITH ROWID | (CONSTRAINT ignoredIdentifier)? referencesClause constraintState*
;
virtualColumnDefinition
@@ -162,7 +162,7 @@ virtualColumnDefinition
;
outOfLineConstraint
- : (CONSTRAINT ignoredIdentifier_)?
+ : (CONSTRAINT ignoredIdentifier)?
(UNIQUE columnNames
| primaryKey columnNames
| FOREIGN KEY columnNames referencesClause
@@ -173,26 +173,26 @@ outOfLineConstraint
outOfLineRefConstraint
: SCOPE FOR LP_ lobItem RP_ IS tableName
| REF LP_ lobItem RP_ WITH ROWID
- | (CONSTRAINT ignoredIdentifier_)? FOREIGN KEY lobItemList referencesClause constraintState*
+ | (CONSTRAINT ignoredIdentifier)? FOREIGN KEY lobItemList referencesClause constraintState*
;
-createIndexSpecification_
+createIndexSpecification
: (UNIQUE | BITMAP)?
;
tableIndexClause
- : tableName alias? indexExpressions_
+ : tableName alias? indexExpressions
;
-indexExpressions_
- : LP_ indexExpression_ (COMMA_ indexExpression_)* RP_
+indexExpressions
+ : LP_ indexExpression (COMMA_ indexExpression)* RP_
;
-indexExpression_
+indexExpression
: (columnName | expr) (ASC | DESC)?
;
-bitmapJoinIndexClause_
+bitmapJoinIndexClause
: tableName columnSortsClause_ FROM tableAlias WHERE expr
;
@@ -205,7 +205,7 @@ columnSortClause_
;
createIndexDefinitionClause
- : tableIndexClause | bitmapJoinIndexClause_
+ : tableIndexClause | bitmapJoinIndexClause
;
tableAlias
@@ -217,10 +217,10 @@ alterDefinitionClause
;
alterTableProperties
- : renameTableSpecification_ | REKEY encryptionSpecification_
+ : renameTableSpecification | REKEY encryptionSpecification
;
-renameTableSpecification_
+renameTableSpecification
: RENAME TO identifier
;
@@ -265,7 +265,7 @@ modifyColumnSpecification
;
modifyColProperties
- : columnName dataType? (DEFAULT expr)? (ENCRYPT encryptionSpecification_ | DECRYPT)? inlineConstraint*
+ : columnName dataType? (DEFAULT expr)? (ENCRYPT encryptionSpecification | DECRYPT)? inlineConstraint*
;
modifyColSubstitutable
@@ -309,7 +309,7 @@ modifyConstraintClause
;
constraintWithName
- : CONSTRAINT ignoredIdentifier_
+ : CONSTRAINT ignoredIdentifier
;
constraintOption
@@ -321,13 +321,13 @@ constraintPrimaryOrUnique
;
renameConstraintClause
- : RENAME constraintWithName TO ignoredIdentifier_
+ : RENAME constraintWithName TO ignoredIdentifier
;
dropConstraintClause
: DROP
(
- constraintPrimaryOrUnique CASCADE? ((KEEP | DROP) INDEX)? | (CONSTRAINT ignoredIdentifier_ CASCADE?)
+ constraintPrimaryOrUnique CASCADE? ((KEEP | DROP) INDEX)? | (CONSTRAINT ignoredIdentifier CASCADE?)
)
;
@@ -343,6 +343,6 @@ objectProperty
: (columnName | attributeName) (DEFAULT expr)? (inlineConstraint* | inlineRefConstraint?) | outOfLineConstraint | outOfLineRefConstraint
;
-renameIndexClause_
+renameIndexClause
: (RENAME TO indexName)?
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
index 4a6f1d7..0a5517c 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
@@ -56,10 +56,10 @@ insertValuesClause
;
update
- : UPDATE updateSpecification_? tableReferences setAssignmentsClause whereClause?
+ : UPDATE updateSpecification? tableReferences setAssignmentsClause whereClause?
;
-updateSpecification_
+updateSpecification
: ONLY
;
@@ -81,10 +81,10 @@ assignmentValue
;
delete
- : DELETE deleteSpecification_? (singleTableClause | multipleTablesClause) whereClause?
+ : DELETE deleteSpecification? (singleTableClause | multipleTablesClause) whereClause?
;
-deleteSpecification_
+deleteSpecification
: ONLY
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/BaseRule.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/BaseRule.g4
index 1a421bb..9b1097d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/BaseRule.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/BaseRule.g4
@@ -34,7 +34,7 @@ literals
;
stringLiterals
- : characterSetName_? STRING_ collateClause_?
+ : characterSetName? STRING_ collateClause?
;
numberLiterals
@@ -47,11 +47,11 @@ dateTimeLiterals
;
hexadecimalLiterals
- : characterSetName_? HEX_DIGIT_ collateClause_?
+ : characterSetName? HEX_DIGIT_ collateClause?
;
bitValueLiterals
- : characterSetName_? BIT_NUM_ collateClause_?
+ : characterSetName? BIT_NUM_ collateClause?
;
booleanLiterals
@@ -121,13 +121,13 @@ tableNames
: LP_? tableName (COMMA_ tableName)* RP_?
;
-characterSetName_
+characterSetName
: IDENTIFIER_
;
expr
: expr logicalOperator expr
- | notOperator_ expr
+ | notOperator expr
| LP_ expr RP_
| booleanPrimary
;
@@ -136,7 +136,7 @@ logicalOperator
: OR | AND | AND_
;
-notOperator_
+notOperator
: NOT | NOT_
;
@@ -187,7 +187,7 @@ simpleExpr
| LP_ expr (COMMA_ expr)* RP_
| EXISTS? subquery
| LBE_ identifier expr RBE_
- | matchExpression_
+ | matchExpression
| caseExpression
| intervalExpression
;
@@ -209,7 +209,7 @@ distinct
;
specialFunction
- : castFunction | convertFunction | positionFunction | substringFunction | extractFunction | trimFunction_
+ : castFunction | convertFunction | positionFunction | substringFunction | extractFunction | trimFunction
;
castFunction
@@ -232,39 +232,39 @@ extractFunction
: EXTRACT LP_ identifier FROM expr RP_
;
-trimFunction_
+trimFunction
: TRIM LP_ (LEADING | BOTH | TRAILING) STRING_ FROM STRING_ RP_
;
regularFunction
- : regularFunctionName_ LP_ (expr (COMMA_ expr)* | ASTERISK_)? RP_
+ : regularFunctionName LP_ (expr (COMMA_ expr)* | ASTERISK_)? RP_
;
-regularFunctionName_
+regularFunctionName
: identifier | IF | CURRENT_TIMESTAMP | LOCALTIME | LOCALTIMESTAMP | INTERVAL
;
-matchExpression_
+matchExpression
: literals MATCH UNIQUE? (PARTIAL | FULL) subquery
;
caseExpression
- : CASE simpleExpr? caseWhen_+ caseElse_? END
+ : CASE simpleExpr? caseWhen+ caseElse? END
;
-caseWhen_
+caseWhen
: WHEN expr THEN expr
;
-caseElse_
+caseElse
: ELSE expr
;
intervalExpression
- : INTERVAL expr intervalUnit_
+ : INTERVAL expr intervalUnit
;
-intervalUnit_
+intervalUnit
: MICROSECOND | SECOND | MINUTE | HOUR | DAY | WEEK | MONTH | QUARTER | YEAR
;
@@ -281,7 +281,7 @@ orderByItem
;
dataType
- : dataTypeName dataTypeLength? characterSet_? collateClause_? | dataTypeName LP_ STRING_ (COMMA_ STRING_)* RP_ characterSet_? collateClause_?
+ : dataTypeName dataTypeLength? characterSet? collateClause? | dataTypeName LP_ STRING_ (COMMA_ STRING_)* RP_ characterSet? collateClause?
;
dataTypeName
@@ -295,18 +295,18 @@ dataTypeLength
: LP_ NUMBER_ (COMMA_ NUMBER_)? RP_
;
-characterSet_
- : (CHARACTER | CHAR) SET EQ_? ignoredIdentifier_
+characterSet
+ : (CHARACTER | CHAR) SET EQ_? ignoredIdentifier
;
-collateClause_
- : COLLATE EQ_? (STRING_ | ignoredIdentifier_)
+collateClause
+ : COLLATE EQ_? (STRING_ | ignoredIdentifier)
;
-ignoredIdentifier_
+ignoredIdentifier
: identifier (DOT_ identifier)?
;
-dropBehaviour_
+dropBehaviour
: (CASCADE | RESTRICT)?
;
\ No newline at end of file
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DCLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DCLStatement.g4
index 2050875..48401a9 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DCLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DCLStatement.g4
@@ -20,22 +20,22 @@ grammar DCLStatement;
import Symbol, Keyword, SQL92Keyword, Literals, BaseRule;
grant
- : GRANT privilegeClause TO grantee_ (COMMA_ grantee_)* (WITH GRANT OPTION)?
+ : GRANT privilegeClause TO grantee (COMMA_ grantee)* (WITH GRANT OPTION)?
;
revoke
- : REVOKE (GRANT OPTION FOR)? privilegeClause FROM grantee_ (COMMA_ grantee_)* dropBehaviour_
+ : REVOKE (GRANT OPTION FOR)? privilegeClause FROM grantee (COMMA_ grantee)* dropBehaviour
;
privilegeClause
- : privileges_ ON onObjectClause
+ : privileges ON onObjectClause
;
-privileges_
- : privilegeType_ columnNames
+privileges
+ : privilegeType columnNames
;
-privilegeType_
+privilegeType
: ALL PRIVILEGES
| SELECT
| DELETE
@@ -45,15 +45,15 @@ privilegeType_
| USAGE
;
-grantee_
+grantee
: PUBLIC | identifier
;
onObjectClause
- : objectType_? privilegeLevel
+ : objectType? privilegeLevel
;
-objectType_
+objectType
: TABLE
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DDLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DDLStatement.g4
index f422fb3..a5b95e0 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DDLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DDLStatement.g4
@@ -20,7 +20,7 @@ grammar DDLStatement;
import Symbol, Keyword, SQL92Keyword, Literals, BaseRule, DMLStatement;
createTable
- : CREATE createTableSpecification_? TABLE tableName (createDefinitionClause | createLikeClause_)
+ : CREATE createTableSpecification? TABLE tableName (createDefinitionClause | createLikeClause)
;
alterTable
@@ -28,7 +28,7 @@ alterTable
;
dropTable
- : DROP TABLE tableNames dropBehaviour_
+ : DROP TABLE tableNames dropBehaviour
;
createDatabase
@@ -36,7 +36,7 @@ createDatabase
;
dropDatabase
- : DROP SCHEMA schemaName dropBehaviour_
+ : DROP SCHEMA schemaName dropBehaviour
;
createView
@@ -46,10 +46,10 @@ createView
;
dropView
- : DROP VIEW viewName dropBehaviour_
+ : DROP VIEW viewName dropBehaviour
;
-createTableSpecification_
+createTableSpecification
: (GLOBAL | LOCAL) TEMPORARY
;
@@ -58,7 +58,7 @@ createDefinitionClause
;
createDatabaseSpecification_
- : DEFAULT CHARACTER SET EQ_? characterSetName_
+ : DEFAULT CHARACTER SET EQ_? characterSetName
;
createDefinition
@@ -73,7 +73,7 @@ dataTypeOption
: primaryKey
| UNIQUE KEY?
| NOT? NULL
- | collateClause_
+ | collateClause
| checkConstraintDefinition
| referenceDefinition
| DEFAULT (literals | expr)
@@ -81,27 +81,27 @@ dataTypeOption
;
checkConstraintDefinition
- : (CONSTRAINT ignoredIdentifier_?)? CHECK expr
+ : (CONSTRAINT ignoredIdentifier?)? CHECK expr
;
referenceDefinition
- : REFERENCES tableName keyParts_ (MATCH FULL | MATCH PARTIAL | MATCH UNIQUE)? (ON (UPDATE | DELETE) referenceOption_)*
+ : REFERENCES tableName keyParts (MATCH FULL | MATCH PARTIAL | MATCH UNIQUE)? (ON (UPDATE | DELETE) referenceOption)*
;
-referenceOption_
+referenceOption
: RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT
;
-keyParts_
- : LP_ keyPart_ (COMMA_ keyPart_)* RP_
+keyParts
+ : LP_ keyPart (COMMA_ keyPart)* RP_
;
-keyPart_
+keyPart
: (columnName (LP_ NUMBER_ RP_)? | expr) (ASC | DESC)?
;
constraintDefinition
- : (CONSTRAINT ignoredIdentifier_?)? (primaryKeyOption | uniqueOption_ | foreignKeyOption)
+ : (CONSTRAINT ignoredIdentifier?)? (primaryKeyOption | uniqueOption | foreignKeyOption)
;
primaryKeyOption
@@ -112,15 +112,15 @@ primaryKey
: PRIMARY KEY
;
-uniqueOption_
- : UNIQUE keyParts_
+uniqueOption
+ : UNIQUE keyParts
;
foreignKeyOption
: FOREIGN KEY columnNames referenceDefinition
;
-createLikeClause_
+createLikeClause
: LP_? LIKE tableName RP_?
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/TCLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/TCLStatement.g4
index 0cc7f94..c55a021 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/TCLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/TCLStatement.g4
@@ -20,7 +20,7 @@ grammar TCLStatement;
import Symbol, Keyword, SQL92Keyword, Literals, BaseRule;
setTransaction
- : SET TRANSACTION ISOLATION LEVEL levelOfIsolation_
+ : SET TRANSACTION ISOLATION LEVEL levelOfIsolation
;
commit
@@ -31,6 +31,6 @@ rollback
: ROLLBACK
;
-levelOfIsolation_
+levelOfIsolation
: READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ| SERIALIZABLE
;
\ No newline at end of file
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
index 0e71386..2da18c4 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
@@ -154,7 +154,7 @@ primaryKey
// TODO comb expr
expr
: expr logicalOperator expr
- | notOperator_ expr
+ | notOperator expr
| LP_ expr RP_
| booleanPrimary
;
@@ -163,7 +163,7 @@ logicalOperator
: OR | OR_ | AND | AND_
;
-notOperator_
+notOperator
: NOT | NOT_
;
@@ -240,26 +240,26 @@ castFunction
;
charFunction
- : CHAR LP_ expr (COMMA_ expr)* (USING ignoredIdentifier_)? RP_
+ : CHAR LP_ expr (COMMA_ expr)* (USING ignoredIdentifier)? RP_
;
regularFunction
- : regularFunctionName_ LP_ (expr (COMMA_ expr)* | ASTERISK_)? RP_
+ : regularFunctionName LP_ (expr (COMMA_ expr)* | ASTERISK_)? RP_
;
-regularFunctionName_
+regularFunctionName
: identifier | IF | LOCALTIME | LOCALTIMESTAMP | INTERVAL
;
caseExpression
- : CASE simpleExpr? caseWhen_+ caseElse_?
+ : CASE simpleExpr? caseWhen+ caseElse?
;
-caseWhen_
+caseWhen
: WHEN expr THEN expr
;
-caseElse_
+caseElse
: ELSE expr
;
@@ -281,7 +281,7 @@ orderByItem
;
dataType
- : dataTypeName (dataTypeLength | LP_ MAX RP_ | LP_ (CONTENT | DOCUMENT)? ignoredIdentifier_ RP_)?
+ : dataTypeName (dataTypeLength | LP_ MAX RP_ | LP_ (CONTENT | DOCUMENT)? ignoredIdentifier RP_)?
;
dataTypeName
@@ -406,12 +406,12 @@ onLowPriorLockWait
: ON (LP_ lowPriorityLockWait RP_)?
;
-ignoredIdentifier_
+ignoredIdentifier
: IDENTIFIER_
;
-ignoredIdentifiers_
- : ignoredIdentifier_ (COMMA_ ignoredIdentifier_)*
+ignoredIdentifiers
+ : ignoredIdentifier (COMMA_ ignoredIdentifier)*
;
matchNone
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DCLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DCLStatement.g4
index 2b2d96e..349660b 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DCLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DCLStatement.g4
@@ -20,11 +20,11 @@ grammar DCLStatement;
import Symbol, Keyword, SQLServerKeyword, Literals, BaseRule;
grant
- : GRANT (classPrivilegesClause | classTypePrivilegesClause | roleClause_)
+ : GRANT (classPrivilegesClause | classTypePrivilegesClause | roleClause)
;
revoke
- : REVOKE (optionForClause_? classPrivilegesClause | classTypePrivilegesClause | roleClause_)
+ : REVOKE (optionForClause? classPrivilegesClause | classTypePrivilegesClause | roleClause)
;
deny
@@ -32,53 +32,53 @@ deny
;
classPrivilegesClause
- : classPrivileges_ (ON onClassClause)?
+ : classPrivileges (ON onClassClause)?
;
classTypePrivilegesClause
- : classTypePrivileges_ (ON onClassTypeClause)?
+ : classTypePrivileges (ON onClassTypeClause)?
;
-optionForClause_
+optionForClause
: GRANT OPTION FOR
;
-classPrivileges_
- : privilegeType_ columnNames? (COMMA_ privilegeType_ columnNames?)*
+classPrivileges
+ : privilegeType columnNames? (COMMA_ privilegeType columnNames?)*
;
onClassClause
: class_? tableName
;
-classTypePrivileges_
- : privilegeType_ (COMMA_ privilegeType_)*
+classTypePrivileges
+ : privilegeType (COMMA_ privilegeType)*
;
onClassTypeClause
- : classType_? tableName
+ : classType? tableName
;
-privilegeType_
+privilegeType
: ALL PRIVILEGES?
- | basicPermission_ | objectPermission_
- | serverPermission_ | serverPrincipalPermission_
- | databasePermission_ | databasePrincipalPermission_ | schemaPermission_
- | serviceBrokerPermission_ | endpointPermission_
- | certificatePermission_ | symmetricKeyPermission_ | asymmetricKeyPermission_
- | assemblyPermission_ | availabilityGroupPermission_ | fullTextPermission_
+ | basicPermission | objectPermission
+ | serverPermission | serverPrincipalPermission
+ | databasePermission | databasePrincipalPermission | schemaPermission
+ | serviceBrokerPermission | endpointPermission
+ | certificatePermission | symmetricKeyPermission | asymmetricKeyPermission
+ | assemblyPermission | availabilityGroupPermission | fullTextPermission
;
-basicPermission_
+basicPermission
: CONTROL SERVER? | TAKE OWNERSHIP | ALTER | VIEW ANY? DEFINITION | REFERENCES
| SELECT | INSERT | UPDATE | DELETE | EXECUTE | RECEIVE
;
-objectPermission_
+objectPermission
: VIEW CHANGE TRACKING
;
-serverPermission_
+serverPermission
: ALTER (RESOURCES | SETTINGS | TRACE | SERVER STATE)
| ALTER ANY (AVAILABILITY GROUP | CONNECTION | CREDENTIAL | DATABASE | ENDPOINT | EVENT NOTIFICATION | EVENT SESSION | LINKED SERVER | LOGIN | SERVER AUDIT | SERVER ROLE)
| CREATE (AVAILABILITY GROUP | DDL EVENT NOTIFICATION | ENDPOINT | SERVER ROLE | TRACE EVENT NOTIFICATION)
@@ -91,11 +91,11 @@ serverPermission_
| SHUTDOWN
;
-serverPrincipalPermission_
+serverPrincipalPermission
: IMPERSONATE | ALTER ANY (LOGIN | SERVER ROLE)
;
-databasePermission_
+databasePermission
: ALTER TRACE
| ALTER ANY (DATABASE (AUDIT | DDL TRIGGER | EVENT NOTIFICATION | EVENT SESSION | SCOPED CONFIGURATION)? | DATASPACE | SCHEMA
| SERVICE AUDIT?| USER | APPLICATION? ROLE | CERTIFICATE | CONTRACT | ASSEMBLY | CONNECTION
@@ -112,43 +112,43 @@ databasePermission_
| AUTHENTICATE SERVER? | SHOWPLAN | SUBSCRIBE QUERY NOTIFICATIONS | UNMASK | CHECKPOINT | ADMINISTER DATABASE BULK OPERATIONS
;
-databasePrincipalPermission_
+databasePrincipalPermission
: IMPERSONATE | ALTER ANY (USER | APPLICATION? ROLE)
;
-schemaPermission_
+schemaPermission
: ALTER ANY SCHEMA | CREATE SEQUENCE | VIEW CHANGE TRACKING
;
-serviceBrokerPermission_
+serviceBrokerPermission
: ALTER ANY (CONTRACT | MESSAGE TYPE | REMOTE SERVICE BINDING | ROUTE | SERVICE)
;
-endpointPermission_
+endpointPermission
: ALTER ANY ENDPOINT
;
-certificatePermission_
+certificatePermission
: ALTER ANY CERTIFICATE
;
-symmetricKeyPermission_
+symmetricKeyPermission
: ALTER ANY SYMMETRIC KEY
;
-asymmetricKeyPermission_
+asymmetricKeyPermission
: ALTER ANY ASYMMETRIC KEY
;
-assemblyPermission_
+assemblyPermission
: ALTER ANY ASSEMBLY
;
-availabilityGroupPermission_
+availabilityGroupPermission
: ALTER ANY AVAILABILITY GROUP | CONNECT
;
-fullTextPermission_
+fullTextPermission
: ALTER ANY FULLTEXT CATALOG
;
@@ -156,12 +156,12 @@ class_
: IDENTIFIER_ COLON_ COLON_
;
-classType_
+classType
: (LOGIN | DATABASE | OBJECT | ROLE | SCHEMA | USER) COLON_ COLON_
;
-roleClause_
- : ignoredIdentifiers_
+roleClause
+ : ignoredIdentifiers
;
createUser
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
index c491c0a..f5c852d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
@@ -20,11 +20,11 @@ grammar DDLStatement;
import Symbol, Keyword, SQLServerKeyword, Literals, BaseRule;
createTable
- : CREATE TABLE tableName fileTableClause_ createDefinitionClause
+ : CREATE TABLE tableName fileTableClause createDefinitionClause
;
createIndex
- : CREATE createIndexSpecification_ INDEX indexName ON tableName columnNamesWithSort
+ : CREATE createIndexSpecification INDEX indexName ON tableName columnNamesWithSort
;
alterTable
@@ -36,23 +36,23 @@ alterIndex
;
dropTable
- : DROP TABLE ifExist_? tableNames
+ : DROP TABLE ifExist? tableNames
;
dropIndex
- : DROP INDEX ifExist_? indexName ON tableName
+ : DROP INDEX ifExist? indexName ON tableName
;
truncateTable
: TRUNCATE TABLE tableName
;
-fileTableClause_
+fileTableClause
: (AS FILETABLE)?
;
createDefinitionClause
- : createTableDefinitions partitionScheme_ fileGroup_
+ : createTableDefinitions partitionScheme fileGroup
;
createTableDefinitions
@@ -72,23 +72,23 @@ columnDefinitionOption
| COLLATE collationName
| SPARSE
| MASKED WITH LP_ FUNCTION EQ_ STRING_ RP_
- | (CONSTRAINT ignoredIdentifier_)? DEFAULT expr
+ | (CONSTRAINT ignoredIdentifier)? DEFAULT expr
| IDENTITY (LP_ NUMBER_ COMMA_ NUMBER_ RP_)?
| NOT FOR REPLICATION
| GENERATED ALWAYS AS ROW (START | END) HIDDEN_?
| NOT? NULL
| ROWGUIDCOL
- | ENCRYPTED WITH encryptedOptions_
+ | ENCRYPTED WITH encryptedOptions
| columnConstraint (COMMA_ columnConstraint)*
| columnIndex
;
-encryptedOptions_
- : LP_ COLUMN_ENCRYPTION_KEY EQ_ ignoredIdentifier_ COMMA_ ENCRYPTION_TYPE EQ_ (DETERMINISTIC | RANDOMIZED) COMMA_ ALGORITHM EQ_ STRING_ RP_
+encryptedOptions
+ : LP_ COLUMN_ENCRYPTION_KEY EQ_ ignoredIdentifier COMMA_ ENCRYPTION_TYPE EQ_ (DETERMINISTIC | RANDOMIZED) COMMA_ ALGORITHM EQ_ STRING_ RP_
;
columnConstraint
- : (CONSTRAINT ignoredIdentifier_)? (primaryKeyConstraint | columnForeignKeyConstraint | checkConstraint)
+ : (CONSTRAINT ignoredIdentifier)? (primaryKeyConstraint | columnForeignKeyConstraint | checkConstraint)
;
primaryKeyConstraint
@@ -96,10 +96,10 @@ primaryKeyConstraint
;
diskTablePrimaryKeyConstraintOption
- : clusterOption_? primaryKeyWithClause? primaryKeyOnClause?
+ : clusterOption? primaryKeyWithClause? primaryKeyOnClause?
;
-clusterOption_
+clusterOption
: CLUSTERED | NONCLUSTERED
;
@@ -116,7 +116,7 @@ onSchemaColumn
;
onFileGroup
- : ON ignoredIdentifier_
+ : ON ignoredIdentifier
;
onString
@@ -148,10 +148,10 @@ checkConstraint
;
columnIndex
- : INDEX indexName clusterOption_? withIndexOption_? indexOnClause? fileStreamOn_?
+ : INDEX indexName clusterOption? withIndexOption? indexOnClause? fileStreamOn?
;
-withIndexOption_
+withIndexOption
: WITH LP_ indexOption (COMMA_ indexOption)* RP_
;
@@ -163,8 +163,8 @@ onDefault
: ON DEFAULT
;
-fileStreamOn_
- : FILESTREAM_ON (ignoredIdentifier_ | schemaName | STRING_)
+fileStreamOn
+ : FILESTREAM_ON (ignoredIdentifier | schemaName | STRING_)
;
columnConstraints
@@ -176,11 +176,11 @@ computedColumnDefinition
;
columnSetDefinition
- : ignoredIdentifier_ IDENTIFIER_ COLUMN_SET FOR ALL_SPARSE_COLUMNS
+ : ignoredIdentifier IDENTIFIER_ COLUMN_SET FOR ALL_SPARSE_COLUMNS
;
tableConstraint
- : (CONSTRAINT ignoredIdentifier_)? (tablePrimaryConstraint | tableForeignKeyConstraint | checkConstraint)
+ : (CONSTRAINT ignoredIdentifier)? (tablePrimaryConstraint | tableForeignKeyConstraint | checkConstraint)
;
tablePrimaryConstraint
@@ -192,7 +192,7 @@ primaryKeyUnique
;
diskTablePrimaryConstraintOption
- : clusterOption_? columnNames primaryKeyWithClause? primaryKeyOnClause?
+ : clusterOption? columnNames primaryKeyWithClause? primaryKeyOnClause?
;
memoryTablePrimaryConstraintOption
@@ -208,14 +208,14 @@ tableForeignKeyConstraint
;
tableIndex
- : INDEX indexName indexNameOption_ (WITH indexOptions_)? indexOnClause? fileStreamOn_?
+ : INDEX indexName indexNameOption (WITH indexOptions)? indexOnClause? fileStreamOn?
;
-indexNameOption_
- : clusterOption_? columnNames | CLUSTERED COLUMNSTORE | NONCLUSTERED? COLUMNSTORE columnNames
+indexNameOption
+ : clusterOption? columnNames | CLUSTERED COLUMNSTORE | NONCLUSTERED? COLUMNSTORE columnNames
;
-indexOptions_
+indexOptions
: LP_ indexOption (COMMA_ indexOption)* RP_
;
@@ -223,12 +223,12 @@ periodClause
: PERIOD FOR SYSTEM_TIME LP_ columnName COMMA_ columnName RP_
;
-partitionScheme_
- : (ON (schemaName LP_ columnName RP_ | ignoredIdentifier_ | STRING_))?
+partitionScheme
+ : (ON (schemaName LP_ columnName RP_ | ignoredIdentifier | STRING_))?
;
-fileGroup_
- : (TEXTIMAGE_ON (ignoredIdentifier_ | STRING_))? ((FILESTREAM_ON (schemaName) | ignoredIdentifier_ STRING_))? (WITH tableOptions)?
+fileGroup
+ : (TEXTIMAGE_ON (ignoredIdentifier | STRING_))? ((FILESTREAM_ON (schemaName) | ignoredIdentifier STRING_))? (WITH tableOptions)?
;
tableOptions
@@ -237,11 +237,11 @@ tableOptions
tableOption
: DATA_COMPRESSION EQ_ (NONE | ROW | PAGE) (ON PARTITIONS LP_ partitionExpressions RP_)?
- | FILETABLE_DIRECTORY EQ_ ignoredIdentifier_
+ | FILETABLE_DIRECTORY EQ_ ignoredIdentifier
| FILETABLE_COLLATE_FILENAME EQ_ (collationName | DATABASE_DEAULT)
- | FILETABLE_PRIMARY_KEY_CONSTRAINT_NAME EQ_ ignoredIdentifier_
- | FILETABLE_STREAMID_UNIQUE_CONSTRAINT_NAME EQ_ ignoredIdentifier_
- | FILETABLE_FULLPATH_UNIQUE_CONSTRAINT_NAME EQ_ ignoredIdentifier_
+ | FILETABLE_PRIMARY_KEY_CONSTRAINT_NAME EQ_ ignoredIdentifier
+ | FILETABLE_STREAMID_UNIQUE_CONSTRAINT_NAME EQ_ ignoredIdentifier
+ | FILETABLE_FULLPATH_UNIQUE_CONSTRAINT_NAME EQ_ ignoredIdentifier
| SYSTEM_VERSIONING EQ_ ON onHistoryTableClause?
| REMOTE_DATA_ARCHIVE EQ_ (ON tableStretchOptions? | OFF migrationState_)
| tableOperationOption
@@ -277,8 +277,8 @@ dataWareHousePartitionOption
: (PARTITION LP_ columnName RANGE (LEFT | RIGHT)? FOR VALUES LP_ simpleExpr (COMMA_ simpleExpr)* RP_ RP_)
;
-createIndexSpecification_
- : UNIQUE? clusterOption_?
+createIndexSpecification
+ : UNIQUE? clusterOption?
;
alterDefinitionClause
@@ -311,7 +311,7 @@ alterColumnAddOption
;
constraintForColumn
- : (CONSTRAINT ignoredIdentifier_)? DEFAULT simpleExpr FOR columnName
+ : (CONSTRAINT ignoredIdentifier)? DEFAULT simpleExpr FOR columnName
;
generatedColumnNamesClause
@@ -323,7 +323,7 @@ generatedColumnNameClause
;
generatedColumnName
- : columnName dataTypeName GENERATED ALWAYS AS ROW (START | END)? HIDDEN_? (NOT NULL)? (CONSTRAINT ignoredIdentifier_)?
+ : columnName dataTypeName GENERATED ALWAYS AS ROW (START | END)? HIDDEN_? (NOT NULL)? (CONSTRAINT ignoredIdentifier)?
;
alterDrop
@@ -331,11 +331,11 @@ alterDrop
;
alterTableDropConstraint
- : CONSTRAINT? ifExist_? dropConstraintName (COMMA_ dropConstraintName)*
+ : CONSTRAINT? ifExist? dropConstraintName (COMMA_ dropConstraintName)*
;
dropConstraintName
- : ignoredIdentifier_ dropConstraintWithClause?
+ : ignoredIdentifier dropConstraintWithClause?
;
dropConstraintWithClause
@@ -343,27 +343,27 @@ dropConstraintWithClause
;
dropConstraintOption
- : (MAXDOP EQ_ NUMBER_ | ONLINE EQ_ onOffOption_ | MOVE TO (schemaName LP_ columnName RP_ | ignoredIdentifier_ | STRING_))
+ : (MAXDOP EQ_ NUMBER_ | ONLINE EQ_ onOffOption | MOVE TO (schemaName LP_ columnName RP_ | ignoredIdentifier | STRING_))
;
-onOffOption_
+onOffOption
: ON | OFF
;
dropColumnSpecification
- : COLUMN ifExist_? columnName (COMMA_ columnName)*
+ : COLUMN ifExist? columnName (COMMA_ columnName)*
;
dropIndexSpecification
- : INDEX ifExist_? indexName (COMMA_ indexName)*
+ : INDEX ifExist? indexName (COMMA_ indexName)*
;
alterCheckConstraint
- : WITH? (CHECK | NOCHECK) CONSTRAINT (ALL | ignoredIdentifiers_)
+ : WITH? (CHECK | NOCHECK) CONSTRAINT (ALL | ignoredIdentifiers)
;
alterTrigger
- : (ENABLE| DISABLE) TRIGGER (ALL | ignoredIdentifiers_)
+ : (ENABLE| DISABLE) TRIGGER (ALL | ignoredIdentifiers)
;
alterSwitch
@@ -375,7 +375,7 @@ alterSet
;
setFileStreamClause
- : FILESTREAM_ON EQ_ (schemaName | ignoredIdentifier_ | STRING_)
+ : FILESTREAM_ON EQ_ (schemaName | ignoredIdentifier | STRING_)
;
setSystemVersionClause
@@ -383,14 +383,14 @@ setSystemVersionClause
;
alterSetOnClause
- : LP_ (HISTORY_TABLE EQ_ tableName)? dataConsistencyCheckClause_? historyRetentionPeriodClause_? RP_
+ : LP_ (HISTORY_TABLE EQ_ tableName)? dataConsistencyCheckClause? historyRetentionPeriodClause? RP_
;
-dataConsistencyCheckClause_
- : COMMA_? DATA_CONSISTENCY_CHECK EQ_ onOffOption_
+dataConsistencyCheckClause
+ : COMMA_? DATA_CONSISTENCY_CHECK EQ_ onOffOption
;
-historyRetentionPeriodClause_
+historyRetentionPeriodClause
: COMMA_? HISTORY_RETENTION_PERIOD EQ_ historyRetentionPeriod
;
@@ -411,7 +411,7 @@ indexNonClusterClause
;
alterTableIndexOnClause
- : ON ignoredIdentifier_ | DEFAULT
+ : ON ignoredIdentifier | DEFAULT
;
indexClusterClause
@@ -426,9 +426,9 @@ alterTableOption
;
onHistoryTableClause
- : LP_ HISTORY_TABLE EQ_ tableName (COMMA_ DATA_CONSISTENCY_CHECK EQ_ onOffOption_)? RP_
+ : LP_ HISTORY_TABLE EQ_ tableName (COMMA_ DATA_CONSISTENCY_CHECK EQ_ onOffOption)? RP_
;
-ifExist_
+ifExist
: IF EXISTS
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4
index 129a79d..eef909f 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4
@@ -20,19 +20,19 @@ grammar DMLStatement;
import Symbol, Keyword, SQLServerKeyword, Literals, BaseRule;
insert
- : withClause_? INSERT top? INTO? tableName (AS? alias)? (insertDefaultValue | insertValuesClause | insertSelectClause)
+ : withClause? INSERT top? INTO? tableName (AS? alias)? (insertDefaultValue | insertValuesClause | insertSelectClause)
;
insertDefaultValue
- : columnNames? outputClause_? DEFAULT VALUES
+ : columnNames? outputClause? DEFAULT VALUES
;
insertValuesClause
- : columnNames? outputClause_? VALUES assignmentValues (COMMA_ assignmentValues)*
+ : columnNames? outputClause? VALUES assignmentValues (COMMA_ assignmentValues)*
;
insertSelectClause
- : columnNames? outputClause_? select
+ : columnNames? outputClause? select
;
update
@@ -157,30 +157,30 @@ subquery
: LP_ aggregationClause RP_
;
-withClause_
- : WITH cteClause_ (COMMA_ cteClause_)*
+withClause
+ : WITH cteClause (COMMA_ cteClause)*
;
-cteClause_
+cteClause
: identifier columnNames? AS subquery
;
-outputClause_
- : OUTPUT (outputWithColumns_ | outputWithAaterisk_) (INTO outputTableName_ columnNames?)?
+outputClause
+ : OUTPUT (outputWithColumns | outputWithAaterisk) (INTO outputTableName columnNames?)?
;
-outputWithColumns_
- : outputWithColumn_ (COMMA_ outputWithColumn_)*
+outputWithColumns
+ : outputWithColumn (COMMA_ outputWithColumn)*
;
-outputWithColumn_
+outputWithColumn
: (INSERTED | DELETED) DOT_ name (AS? alias)?
;
-outputWithAaterisk_
+outputWithAaterisk
: (INSERTED | DELETED) DOT_ASTERISK_
;
-outputTableName_
+outputTableName
: (AT_ name) | tableName
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/impl/SQLServerDMLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/impl/SQLServerDMLVisitor.java
index 6d12144..e3d023d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/impl/SQLServerDMLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/impl/SQLServerDMLVisitor.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Ass
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AssignmentValuesContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.ColumnNameContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.ColumnNamesContext;
-import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.CteClause_Context;
+import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.CteClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.DeleteContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.DuplicateSpecificationContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.ExprContext;
@@ -42,10 +42,10 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Mul
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.MultipleTablesClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OrderByClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OrderByItemContext;
-import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OutputClause_Context;
-import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OutputTableName_Context;
-import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OutputWithColumn_Context;
-import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OutputWithColumns_Context;
+import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OutputClauseContext;
+import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OutputTableNameContext;
+import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OutputWithColumnContext;
+import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.OutputWithColumnsContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.ProjectionContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.ProjectionsContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.QualifiedShorthandContext;
@@ -61,7 +61,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Tab
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.TopContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.UpdateContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.WhereClauseContext;
-import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.WithClause_Context;
+import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.WithClauseContext;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.InsertValuesSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.SetAssignmentSegment;
@@ -135,8 +135,8 @@ public final class SQLServerDMLVisitor extends SQLServerVisitor implements DMLVi
} else {
result = (SQLServerInsertStatement) visit(ctx.insertSelectClause());
}
- if (null != ctx.withClause_()) {
- result.setWithSegment((WithSegment) visit(ctx.withClause_()));
+ if (null != ctx.withClause()) {
+ result.setWithSegment((WithSegment) visit(ctx.withClause()));
}
result.setTable((SimpleTableSegment) visit(ctx.tableName()));
result.setParameterCount(getCurrentParameterIndex());
@@ -147,20 +147,20 @@ public final class SQLServerDMLVisitor extends SQLServerVisitor implements DMLVi
public ASTNode visitInsertDefaultValue(final InsertDefaultValueContext ctx) {
SQLServerInsertStatement result = new SQLServerInsertStatement();
result.setInsertColumns(createInsertColumns(ctx.columnNames(), ctx.start.getStartIndex()));
- if (null != ctx.outputClause_()) {
- result.setOutputSegment((OutputSegment) visit(ctx.outputClause_()));
+ if (null != ctx.outputClause()) {
+ result.setOutputSegment((OutputSegment) visit(ctx.outputClause()));
}
return result;
}
@Override
- public ASTNode visitOutputClause_(final OutputClause_Context ctx) {
+ public ASTNode visitOutputClause(final OutputClauseContext ctx) {
OutputSegment result = new OutputSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
- if (null != ctx.outputWithColumns_()) {
- OutputWithColumns_Context outputWithColumnsContext = ctx.outputWithColumns_();
- List<OutputWithColumn_Context> outputWithColumnContexts = outputWithColumnsContext.outputWithColumn_();
+ if (null != ctx.outputWithColumns()) {
+ OutputWithColumnsContext outputWithColumnsContext = ctx.outputWithColumns();
+ List<OutputWithColumnContext> outputWithColumnContexts = outputWithColumnsContext.outputWithColumn();
Collection<ColumnProjectionSegment> outputColumns = new LinkedList<>();
- for (OutputWithColumn_Context each : outputWithColumnContexts) {
+ for (OutputWithColumnContext each : outputWithColumnContexts) {
ColumnSegment column = new ColumnSegment(each.start.getStartIndex(), each.stop.getStopIndex(), new IdentifierValue(each.name().getText()));
ColumnProjectionSegment outputColumn = new ColumnProjectionSegment(column);
if (null != each.alias()) {
@@ -170,8 +170,8 @@ public final class SQLServerDMLVisitor extends SQLServerVisitor implements DMLVi
}
result.getOutputColumns().addAll(outputColumns);
}
- if (null != ctx.outputTableName_()) {
- OutputTableName_Context outputTableNameContext = ctx.outputTableName_();
+ if (null != ctx.outputTableName()) {
+ OutputTableNameContext outputTableNameContext = ctx.outputTableName();
TableNameSegment tableName = new TableNameSegment(outputTableNameContext.start.getStartIndex(),
outputTableNameContext.stop.getStopIndex(), new IdentifierValue(outputTableNameContext.getText()));
result.setTableName(tableName);
@@ -189,8 +189,8 @@ public final class SQLServerDMLVisitor extends SQLServerVisitor implements DMLVi
SQLServerInsertStatement result = new SQLServerInsertStatement();
result.setInsertColumns(createInsertColumns(ctx.columnNames(), ctx.start.getStartIndex()));
result.getValues().addAll(createInsertValuesSegments(ctx.assignmentValues()));
- if (null != ctx.outputClause_()) {
- result.setOutputSegment((OutputSegment) visit(ctx.outputClause_()));
+ if (null != ctx.outputClause()) {
+ result.setOutputSegment((OutputSegment) visit(ctx.outputClause()));
}
return result;
}
@@ -208,8 +208,8 @@ public final class SQLServerDMLVisitor extends SQLServerVisitor implements DMLVi
SQLServerInsertStatement result = new SQLServerInsertStatement();
result.setInsertColumns(createInsertColumns(ctx.columnNames(), ctx.start.getStartIndex()));
result.setInsertSelect(createInsertSelectSegment(ctx));
- if (null != ctx.outputClause_()) {
- result.setOutputSegment((OutputSegment) visit(ctx.outputClause_()));
+ if (null != ctx.outputClause()) {
+ result.setOutputSegment((OutputSegment) visit(ctx.outputClause()));
}
return result;
}
@@ -230,10 +230,10 @@ public final class SQLServerDMLVisitor extends SQLServerVisitor implements DMLVi
}
@Override
- public ASTNode visitWithClause_(final WithClause_Context ctx) {
- List<CteClause_Context> cteClauses = ctx.cteClause_();
+ public ASTNode visitWithClause(final WithClauseContext ctx) {
+ List<CteClauseContext> cteClauses = ctx.cteClause();
Collection<CommonTableExpressionSegment> commonTableExpressions = new LinkedList<>();
- for (CteClause_Context cte : cteClauses) {
+ for (CteClauseContext cte : cteClauses) {
SubquerySegment subquery = new SubquerySegment(cte.start.getStartIndex(), cte.stop.getStopIndex(), (SQLServerSelectStatement) visit(cte.subquery()));
IdentifierValue identifier = (IdentifierValue) visit(cte.identifier());
CommonTableExpressionSegment commonTableExpression = new CommonTableExpressionSegment(cte.start.getStartIndex(), cte.stop.getStopIndex(), identifier, subquery);