This is an automated email from the ASF dual-hosted git repository. rong pushed a commit to branch iotdb-1620 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 7090f17cb38edeb0705e8ee3a10b17cb8cfa72b3 Author: Steve Yurong Su <[email protected]> AuthorDate: Tue Oct 26 10:42:44 2021 +0800 g4 --- .../org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4 | 68 +++++----------------- .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 | 6 +- 2 files changed, 17 insertions(+), 57 deletions(-) diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4 index dc1a8ee..d39844c 100644 --- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4 +++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4 @@ -25,7 +25,7 @@ lexer grammar IoTDBSqlLexer; WS : - [ \t\r\n]+ -> skip + [ \u000B\t\r\n]+ -> skip ; @@ -840,25 +840,9 @@ RS_BRACKET : ']'; // String Literal STRING_LITERAL - : SQUOTE_STRING + : '\'' ((~'\'') | '\'\'')* '\'' ; -QUOTED_STRING_LITERAL - : DQUOTE_STRING - | BQUOTE_STRING - ; - -fragment DQUOTE_STRING - : '"' ('\\' . | ~'"' )*? '"' - ; - -fragment SQUOTE_STRING - : '\'' ('\\' . | ~'\'' )*? '\'' - ; - -fragment BQUOTE_STRING - : '`' ('\\' . | ~'`' )*? '`' - ; // Date & Time Literal @@ -913,43 +897,23 @@ NAN_LITERAL */ ID - : FIRST_NAME_CHAR NAME_CHAR* + : NAME_CHAR+ + | '"' (~('"' | '.') | '""')* '"' + | '`' (~('`' | '.') | '``')* '`' ; fragment NAME_CHAR - : 'A'..'Z' - | 'a'..'z' - | '0'..'9' - | '_' - | '-' - | ':' - | '/' - | '@' - | '#' - | '$' - | '%' - | '&' - | '+' - | '{' - | '}' - | CN_CHAR - ; - -fragment FIRST_NAME_CHAR - : 'A'..'Z' - | 'a'..'z' - | '0'..'9' - | '_' - | '/' - | '@' - | '#' - | '$' - | '%' - | '&' - | '+' - | '{' - | '}' - | CN_CHAR + : 'A'..'Z' + | 'a'..'z' + | '0'..'9' + | '_' + | ':' + | '@' + | '#' + | '$' + | '{' + | '}' + | CN_CHAR ; fragment CN_CHAR diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 index b7043c9..a758fcd 100644 --- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 +++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 @@ -404,7 +404,6 @@ insertMultiValue measurementName : nodeNameWithoutWildcard - | LR_BRACKET nodeNameWithoutWildcard (COMMA nodeNameWithoutWildcard)+ RR_BRACKET ; measurementValue @@ -662,14 +661,12 @@ suffixPath nodeName : wildcard? ID wildcard? | wildcard - | (ID | OPERATOR_IN)? LS_BRACKET INTEGER_LITERAL? ID? RS_BRACKET? ID? | literalCanBeNodeName | keywordsCanBeNodeName ; nodeNameWithoutWildcard : ID - | (ID | OPERATOR_IN)? LS_BRACKET INTEGER_LITERAL? ID? RS_BRACKET? ID? | literalCanBeNodeName | keywordsCanBeNodeName ; @@ -680,8 +677,7 @@ wildcard ; literalCanBeNodeName - : QUOTED_STRING_LITERAL - | datetimeLiteral + : datetimeLiteral | DURATION_LITERAL | (MINUS|PLUS)? INTEGER_LITERAL | (MINUS|PLUS)? EXPONENT_NUM_PART
