diff --git a/src/grammar/generic/GenericSql.g4 b/src/grammar/generic/GenericSql.g4 index 80b327da..6a844daf 100644 --- a/src/grammar/generic/GenericSql.g4 +++ b/src/grammar/generic/GenericSql.g4 @@ -86,9 +86,10 @@ setQuantifier ; selectItem - : expression (KW_AS? alias=identifier)? - | qualifiedName '.' ASTERISK - | ASTERISK + : expression (KW_AS? alias=identifier)? # selectExpressionElement + | qualifiedName '.' ASTERISK # selectStarElement + | ASTERISK # selectAllElement + | {this.shouldMatchEmpty()}? emptyColumn # selectEmptyElement ; fromClause @@ -118,7 +119,7 @@ relationPrimary ; whereClause - : KW_WHERE expression + : KW_WHERE (expression | {this.shouldMatchEmpty()}? emptyColumn) ; groupByClause @@ -126,7 +127,7 @@ groupByClause ; havingClause - : KW_HAVING expression + : KW_HAVING (expression | {this.shouldMatchEmpty()}? emptyColumn) ; orderByClause @@ -177,7 +178,11 @@ tableElement ; columnDefinition - : columnRef dataType (KW_NOT KW_NULL)? (KW_DEFAULT expression)? (KW_PRIMARY KW_KEY)? + : columnRefCreate colType=dataType (KW_NOT KW_NULL)? (KW_DEFAULT expression)? (KW_PRIMARY KW_KEY)? + ; + +columnRefCreate + : identifier ; tableConstraint @@ -251,17 +256,17 @@ valueExpression ; primaryExpression - : literal # literalExpression - | qualifiedName '(' (setQuantifier? expression (',' expression)*)? ')' # functionCall - | KW_CASE whenClause+ (KW_ELSE expression)? KW_END # searchedCaseExpression - | KW_CASE expression whenClause+ (KW_ELSE expression)? KW_END # simpleCaseExpression - | KW_CAST '(' expression KW_AS dataType ')' # castExpression - | KW_COALESCE '(' expression (',' expression)* ')' # coalesceExpression - | KW_NULLIF '(' valueExpression ',' valueExpression ')' # nullIfExpression - | '(' expression ')' # parenthesizedExpression - | KW_EXISTS '(' queryStatement ')' # existsExpression - | subqueryExpression # subqueryExpressionDefault - | qualifiedName # columnReference + : literal # literalExpression + | functionName '(' (setQuantifier? expression (',' expression)*)? ')' # functionCall + | KW_CASE whenClause+ (KW_ELSE expression)? KW_END # searchedCaseExpression + | KW_CASE expression whenClause+ (KW_ELSE expression)? KW_END # simpleCaseExpression + | KW_CAST '(' expression KW_AS dataType ')' # castExpression + | KW_COALESCE '(' expression (',' expression)* ')' # coalesceExpression + | KW_NULLIF '(' valueExpression ',' valueExpression ')' # nullIfExpression + | '(' expression ')' # parenthesizedExpression + | KW_EXISTS '(' queryStatement ')' # existsExpression + | subqueryExpression # subqueryExpressionDefault + | columnName # columnReference ; whenClause @@ -328,8 +333,22 @@ qualifiedName : identifier ('.' identifier)* ; +qualifiedNameAllowEmpty + : qualifiedName + | {this.shouldMatchEmpty()}? qualifiedName '.' emptyColumn + ; + columnRef : identifier + | {this.shouldMatchEmpty()}? emptyColumn + ; + +columnName + : qualifiedNameAllowEmpty + ; + +emptyColumn + : ; tableName @@ -340,6 +359,10 @@ tableNameCreate : qualifiedName ; +functionName + : qualifiedName + ; + // 非保留关键字 — 可以用作标识符的关键字 // 核心结构关键字 (SELECT, FROM, WHERE, CREATE, TABLE, INSERT, UPDATE, DELETE, DROP, ALTER, SET 等) 是保留的,不能用作标识符 nonReserved diff --git a/src/lib/generic/GenericSql.interp b/src/lib/generic/GenericSql.interp index 1bd3b3e7..c53331ac 100644 --- a/src/lib/generic/GenericSql.interp +++ b/src/lib/generic/GenericSql.interp @@ -282,6 +282,7 @@ deleteStatement createTableStatement tableElement columnDefinition +columnRefCreate tableConstraint alterTableStatement dropTableStatement @@ -300,11 +301,15 @@ property literal identifier qualifiedName +qualifiedNameAllowEmpty columnRef +columnName +emptyColumn tableName tableNameCreate +functionName nonReserved atn: -[4, 1, 122, 817, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 1, 0, 5, 0, 112, 8, 0, 10, 0, 12, 0, 115, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 3, 2, 123, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 132, 8, 3, 1, 4, 3, 4, 135, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 3, 5, 141, 8, 5, 1, 5, 1, 5, 1, 5, 5, 5, 146, 8, 5, 10, 5, 12, 5, 149, 9, 5, 1, 6, 1, 6, 3, 6, 153, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 164, 8, 7, 10, 7, 12, 7, 167, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 3, 8, 174, 8, 8, 1, 8, 5, 8, 177, 8, 8, 10, 8, 12, 8, 180, 9, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 189, 8, 10, 1, 11, 1, 11, 3, 11, 193, 8, 11, 1, 11, 1, 11, 1, 11, 5, 11, 198, 8, 11, 10, 11, 12, 11, 201, 9, 11, 1, 11, 3, 11, 204, 8, 11, 1, 11, 3, 11, 207, 8, 11, 1, 11, 3, 11, 210, 8, 11, 1, 11, 3, 11, 213, 8, 11, 1, 11, 3, 11, 216, 8, 11, 1, 11, 3, 11, 219, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 225, 8, 13, 1, 13, 3, 13, 228, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 235, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 241, 8, 14, 10, 14, 12, 14, 244, 9, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 256, 8, 15, 10, 15, 12, 15, 259, 9, 15, 1, 16, 3, 16, 262, 8, 16, 1, 16, 1, 16, 3, 16, 266, 8, 16, 1, 16, 1, 16, 3, 16, 270, 8, 16, 1, 16, 1, 16, 3, 16, 274, 8, 16, 1, 16, 3, 16, 277, 8, 16, 1, 17, 1, 17, 3, 17, 281, 8, 17, 1, 17, 3, 17, 284, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 291, 8, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 3, 20, 299, 8, 20, 1, 20, 1, 20, 1, 20, 5, 20, 304, 8, 20, 10, 20, 12, 20, 307, 9, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 5, 22, 317, 8, 22, 10, 22, 12, 22, 320, 9, 22, 1, 23, 1, 23, 3, 23, 324, 8, 23, 1, 23, 1, 23, 3, 23, 328, 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 334, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 340, 8, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 5, 26, 348, 8, 26, 10, 26, 12, 26, 351, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 361, 8, 27, 10, 27, 12, 27, 364, 9, 27, 1, 27, 3, 27, 367, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 3, 29, 377, 8, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 384, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 5, 30, 391, 8, 30, 10, 30, 12, 30, 394, 9, 30, 1, 30, 1, 30, 1, 30, 3, 30, 399, 8, 30, 1, 31, 1, 31, 3, 31, 403, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 409, 8, 32, 1, 32, 1, 32, 3, 32, 413, 8, 32, 1, 32, 1, 32, 3, 32, 417, 8, 32, 1, 33, 1, 33, 3, 33, 421, 8, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 429, 8, 33, 10, 33, 12, 33, 432, 9, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 441, 8, 33, 10, 33, 12, 33, 444, 9, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 459, 8, 33, 10, 33, 12, 33, 462, 9, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 5, 33, 471, 8, 33, 10, 33, 12, 33, 474, 9, 33, 1, 33, 1, 33, 3, 33, 478, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 484, 8, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 492, 8, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 499, 8, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 518, 8, 34, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 524, 8, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 3, 37, 534, 8, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 5, 37, 542, 8, 37, 10, 37, 12, 37, 545, 9, 37, 1, 38, 1, 38, 3, 38, 549, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 555, 8, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 5, 39, 562, 8, 39, 10, 39, 12, 39, 565, 9, 39, 1, 39, 1, 39, 1, 39, 3, 39, 570, 8, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 578, 8, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 586, 8, 39, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 592, 8, 39, 1, 39, 1, 39, 3, 39, 596, 8, 39, 1, 39, 1, 39, 1, 39, 3, 39, 601, 8, 39, 1, 39, 1, 39, 1, 39, 3, 39, 606, 8, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 3, 41, 614, 8, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 5, 41, 625, 8, 41, 10, 41, 12, 41, 628, 9, 41, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 634, 8, 42, 1, 42, 1, 42, 1, 42, 5, 42, 639, 8, 42, 10, 42, 12, 42, 642, 9, 42, 3, 42, 644, 8, 42, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 650, 8, 42, 11, 42, 12, 42, 651, 1, 42, 1, 42, 3, 42, 656, 8, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 663, 8, 42, 11, 42, 12, 42, 664, 1, 42, 1, 42, 3, 42, 669, 8, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 685, 8, 42, 10, 42, 12, 42, 688, 9, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 710, 8, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 734, 8, 45, 1, 45, 3, 45, 737, 8, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 744, 8, 45, 1, 45, 3, 45, 747, 8, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 753, 8, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 759, 8, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 767, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 773, 8, 46, 10, 46, 12, 46, 776, 9, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 799, 8, 49, 1, 50, 1, 50, 1, 50, 5, 50, 804, 8, 50, 10, 50, 12, 50, 807, 9, 50, 1, 51, 1, 51, 1, 52, 1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 0, 3, 30, 74, 82, 55, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 0, 8, 3, 0, 36, 36, 52, 52, 87, 87, 2, 0, 6, 6, 30, 30, 2, 0, 10, 10, 29, 29, 2, 0, 39, 39, 57, 57, 1, 0, 95, 100, 1, 0, 101, 102, 1, 0, 103, 105, 22, 0, 5, 6, 10, 10, 12, 15, 18, 18, 20, 21, 24, 27, 29, 29, 31, 31, 38, 40, 43, 43, 46, 46, 50, 51, 56, 58, 60, 60, 63, 66, 70, 70, 75, 75, 78, 78, 80, 80, 82, 86, 88, 88, 90, 91, 912, 0, 113, 1, 0, 0, 0, 2, 118, 1, 0, 0, 0, 4, 120, 1, 0, 0, 0, 6, 131, 1, 0, 0, 0, 8, 134, 1, 0, 0, 0, 10, 138, 1, 0, 0, 0, 12, 150, 1, 0, 0, 0, 14, 159, 1, 0, 0, 0, 16, 170, 1, 0, 0, 0, 18, 181, 1, 0, 0, 0, 20, 188, 1, 0, 0, 0, 22, 190, 1, 0, 0, 0, 24, 220, 1, 0, 0, 0, 26, 234, 1, 0, 0, 0, 28, 236, 1, 0, 0, 0, 30, 245, 1, 0, 0, 0, 32, 276, 1, 0, 0, 0, 34, 278, 1, 0, 0, 0, 36, 290, 1, 0, 0, 0, 38, 292, 1, 0, 0, 0, 40, 295, 1, 0, 0, 0, 42, 308, 1, 0, 0, 0, 44, 311, 1, 0, 0, 0, 46, 321, 1, 0, 0, 0, 48, 329, 1, 0, 0, 0, 50, 335, 1, 0, 0, 0, 52, 343, 1, 0, 0, 0, 54, 354, 1, 0, 0, 0, 56, 368, 1, 0, 0, 0, 58, 372, 1, 0, 0, 0, 60, 378, 1, 0, 0, 0, 62, 402, 1, 0, 0, 0, 64, 404, 1, 0, 0, 0, 66, 420, 1, 0, 0, 0, 68, 479, 1, 0, 0, 0, 70, 519, 1, 0, 0, 0, 72, 527, 1, 0, 0, 0, 74, 533, 1, 0, 0, 0, 76, 546, 1, 0, 0, 0, 78, 605, 1, 0, 0, 0, 80, 607, 1, 0, 0, 0, 82, 613, 1, 0, 0, 0, 84, 709, 1, 0, 0, 0, 86, 711, 1, 0, 0, 0, 88, 716, 1, 0, 0, 0, 90, 766, 1, 0, 0, 0, 92, 768, 1, 0, 0, 0, 94, 779, 1, 0, 0, 0, 96, 791, 1, 0, 0, 0, 98, 798, 1, 0, 0, 0, 100, 800, 1, 0, 0, 0, 102, 808, 1, 0, 0, 0, 104, 810, 1, 0, 0, 0, 106, 812, 1, 0, 0, 0, 108, 814, 1, 0, 0, 0, 110, 112, 3, 2, 1, 0, 111, 110, 1, 0, 0, 0, 112, 115, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 116, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 116, 117, 5, 0, 0, 1, 117, 1, 1, 0, 0, 0, 118, 119, 3, 4, 2, 0, 119, 3, 1, 0, 0, 0, 120, 122, 3, 6, 3, 0, 121, 123, 5, 108, 0, 0, 122, 121, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 5, 1, 0, 0, 0, 124, 132, 3, 8, 4, 0, 125, 132, 3, 50, 25, 0, 126, 132, 3, 54, 27, 0, 127, 132, 3, 58, 29, 0, 128, 132, 3, 60, 30, 0, 129, 132, 3, 68, 34, 0, 130, 132, 3, 70, 35, 0, 131, 124, 1, 0, 0, 0, 131, 125, 1, 0, 0, 0, 131, 126, 1, 0, 0, 0, 131, 127, 1, 0, 0, 0, 131, 128, 1, 0, 0, 0, 131, 129, 1, 0, 0, 0, 131, 130, 1, 0, 0, 0, 132, 7, 1, 0, 0, 0, 133, 135, 3, 10, 5, 0, 134, 133, 1, 0, 0, 0, 134, 135, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 137, 3, 16, 8, 0, 137, 9, 1, 0, 0, 0, 138, 140, 5, 94, 0, 0, 139, 141, 5, 72, 0, 0, 140, 139, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 147, 3, 12, 6, 0, 143, 144, 5, 1, 0, 0, 144, 146, 3, 12, 6, 0, 145, 143, 1, 0, 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 11, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 150, 152, 3, 98, 49, 0, 151, 153, 3, 14, 7, 0, 152, 151, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 5, 9, 0, 0, 155, 156, 5, 2, 0, 0, 156, 157, 3, 8, 4, 0, 157, 158, 5, 3, 0, 0, 158, 13, 1, 0, 0, 0, 159, 160, 5, 2, 0, 0, 160, 165, 3, 98, 49, 0, 161, 162, 5, 1, 0, 0, 162, 164, 3, 98, 49, 0, 163, 161, 1, 0, 0, 0, 164, 167, 1, 0, 0, 0, 165, 163, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 168, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 168, 169, 5, 3, 0, 0, 169, 15, 1, 0, 0, 0, 170, 178, 3, 18, 9, 0, 171, 173, 7, 0, 0, 0, 172, 174, 5, 6, 0, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 177, 3, 18, 9, 0, 176, 171, 1, 0, 0, 0, 177, 180, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 17, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 181, 182, 3, 20, 10, 0, 182, 19, 1, 0, 0, 0, 183, 189, 3, 22, 11, 0, 184, 185, 5, 2, 0, 0, 185, 186, 3, 8, 4, 0, 186, 187, 5, 3, 0, 0, 187, 189, 1, 0, 0, 0, 188, 183, 1, 0, 0, 0, 188, 184, 1, 0, 0, 0, 189, 21, 1, 0, 0, 0, 190, 192, 5, 76, 0, 0, 191, 193, 3, 24, 12, 0, 192, 191, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 199, 3, 26, 13, 0, 195, 196, 5, 1, 0, 0, 196, 198, 3, 26, 13, 0, 197, 195, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 203, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 204, 3, 28, 14, 0, 203, 202, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 206, 1, 0, 0, 0, 205, 207, 3, 38, 19, 0, 206, 205, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 209, 1, 0, 0, 0, 208, 210, 3, 40, 20, 0, 209, 208, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 212, 1, 0, 0, 0, 211, 213, 3, 42, 21, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 215, 1, 0, 0, 0, 214, 216, 3, 44, 22, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 218, 1, 0, 0, 0, 217, 219, 3, 48, 24, 0, 218, 217, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 23, 1, 0, 0, 0, 220, 221, 7, 1, 0, 0, 221, 25, 1, 0, 0, 0, 222, 227, 3, 72, 36, 0, 223, 225, 5, 9, 0, 0, 224, 223, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 228, 3, 98, 49, 0, 227, 224, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 235, 1, 0, 0, 0, 229, 230, 3, 100, 50, 0, 230, 231, 5, 4, 0, 0, 231, 232, 5, 103, 0, 0, 232, 235, 1, 0, 0, 0, 233, 235, 5, 103, 0, 0, 234, 222, 1, 0, 0, 0, 234, 229, 1, 0, 0, 0, 234, 233, 1, 0, 0, 0, 235, 27, 1, 0, 0, 0, 236, 237, 5, 42, 0, 0, 237, 242, 3, 30, 15, 0, 238, 239, 5, 1, 0, 0, 239, 241, 3, 30, 15, 0, 240, 238, 1, 0, 0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 29, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 245, 246, 6, 15, -1, 0, 246, 247, 3, 34, 17, 0, 247, 257, 1, 0, 0, 0, 248, 249, 10, 2, 0, 0, 249, 250, 3, 32, 16, 0, 250, 251, 5, 55, 0, 0, 251, 252, 3, 30, 15, 0, 252, 253, 5, 67, 0, 0, 253, 254, 3, 72, 36, 0, 254, 256, 1, 0, 0, 0, 255, 248, 1, 0, 0, 0, 256, 259, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 257, 258, 1, 0, 0, 0, 258, 31, 1, 0, 0, 0, 259, 257, 1, 0, 0, 0, 260, 262, 5, 48, 0, 0, 261, 260, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 277, 1, 0, 0, 0, 263, 265, 5, 58, 0, 0, 264, 266, 5, 70, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 277, 1, 0, 0, 0, 267, 269, 5, 75, 0, 0, 268, 270, 5, 70, 0, 0, 269, 268, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 277, 1, 0, 0, 0, 271, 273, 5, 43, 0, 0, 272, 274, 5, 70, 0, 0, 273, 272, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 277, 1, 0, 0, 0, 275, 277, 5, 24, 0, 0, 276, 261, 1, 0, 0, 0, 276, 263, 1, 0, 0, 0, 276, 267, 1, 0, 0, 0, 276, 271, 1, 0, 0, 0, 276, 275, 1, 0, 0, 0, 277, 33, 1, 0, 0, 0, 278, 283, 3, 36, 18, 0, 279, 281, 5, 9, 0, 0, 280, 279, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 284, 3, 98, 49, 0, 283, 280, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 35, 1, 0, 0, 0, 285, 291, 3, 104, 52, 0, 286, 287, 5, 2, 0, 0, 287, 288, 3, 8, 4, 0, 288, 289, 5, 3, 0, 0, 289, 291, 1, 0, 0, 0, 290, 285, 1, 0, 0, 0, 290, 286, 1, 0, 0, 0, 291, 37, 1, 0, 0, 0, 292, 293, 5, 93, 0, 0, 293, 294, 3, 72, 36, 0, 294, 39, 1, 0, 0, 0, 295, 296, 5, 44, 0, 0, 296, 298, 5, 15, 0, 0, 297, 299, 3, 24, 12, 0, 298, 297, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 1, 0, 0, 0, 300, 305, 3, 72, 36, 0, 301, 302, 5, 1, 0, 0, 302, 304, 3, 72, 36, 0, 303, 301, 1, 0, 0, 0, 304, 307, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 41, 1, 0, 0, 0, 307, 305, 1, 0, 0, 0, 308, 309, 5, 45, 0, 0, 309, 310, 3, 72, 36, 0, 310, 43, 1, 0, 0, 0, 311, 312, 5, 69, 0, 0, 312, 313, 5, 15, 0, 0, 313, 318, 3, 46, 23, 0, 314, 315, 5, 1, 0, 0, 315, 317, 3, 46, 23, 0, 316, 314, 1, 0, 0, 0, 317, 320, 1, 0, 0, 0, 318, 316, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 45, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 323, 3, 72, 36, 0, 322, 324, 7, 2, 0, 0, 323, 322, 1, 0, 0, 0, 323, 324, 1, 0, 0, 0, 324, 327, 1, 0, 0, 0, 325, 326, 5, 64, 0, 0, 326, 328, 7, 3, 0, 0, 327, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 47, 1, 0, 0, 0, 329, 330, 5, 60, 0, 0, 330, 333, 3, 72, 36, 0, 331, 332, 5, 66, 0, 0, 332, 334, 3, 72, 36, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 49, 1, 0, 0, 0, 335, 336, 5, 49, 0, 0, 336, 337, 5, 53, 0, 0, 337, 339, 3, 104, 52, 0, 338, 340, 3, 52, 26, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 342, 3, 8, 4, 0, 342, 51, 1, 0, 0, 0, 343, 344, 5, 2, 0, 0, 344, 349, 3, 102, 51, 0, 345, 346, 5, 1, 0, 0, 346, 348, 3, 102, 51, 0, 347, 345, 1, 0, 0, 0, 348, 351, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 352, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 352, 353, 5, 3, 0, 0, 353, 53, 1, 0, 0, 0, 354, 355, 5, 89, 0, 0, 355, 356, 3, 104, 52, 0, 356, 357, 5, 77, 0, 0, 357, 362, 3, 56, 28, 0, 358, 359, 5, 1, 0, 0, 359, 361, 3, 56, 28, 0, 360, 358, 1, 0, 0, 0, 361, 364, 1, 0, 0, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 366, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 365, 367, 3, 38, 19, 0, 366, 365, 1, 0, 0, 0, 366, 367, 1, 0, 0, 0, 367, 55, 1, 0, 0, 0, 368, 369, 3, 102, 51, 0, 369, 370, 5, 95, 0, 0, 370, 371, 3, 72, 36, 0, 371, 57, 1, 0, 0, 0, 372, 373, 5, 28, 0, 0, 373, 374, 5, 42, 0, 0, 374, 376, 3, 104, 52, 0, 375, 377, 3, 38, 19, 0, 376, 375, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 59, 1, 0, 0, 0, 378, 379, 5, 23, 0, 0, 379, 383, 5, 79, 0, 0, 380, 381, 5, 46, 0, 0, 381, 382, 5, 61, 0, 0, 382, 384, 5, 37, 0, 0, 383, 380, 1, 0, 0, 0, 383, 384, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 385, 386, 3, 106, 53, 0, 386, 387, 5, 2, 0, 0, 387, 392, 3, 62, 31, 0, 388, 389, 5, 1, 0, 0, 389, 391, 3, 62, 31, 0, 390, 388, 1, 0, 0, 0, 391, 394, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 392, 393, 1, 0, 0, 0, 393, 395, 1, 0, 0, 0, 394, 392, 1, 0, 0, 0, 395, 398, 5, 3, 0, 0, 396, 397, 5, 94, 0, 0, 397, 399, 3, 92, 46, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 61, 1, 0, 0, 0, 400, 403, 3, 64, 32, 0, 401, 403, 3, 66, 33, 0, 402, 400, 1, 0, 0, 0, 402, 401, 1, 0, 0, 0, 403, 63, 1, 0, 0, 0, 404, 405, 3, 102, 51, 0, 405, 408, 3, 90, 45, 0, 406, 407, 5, 61, 0, 0, 407, 409, 5, 62, 0, 0, 408, 406, 1, 0, 0, 0, 408, 409, 1, 0, 0, 0, 409, 412, 1, 0, 0, 0, 410, 411, 5, 27, 0, 0, 411, 413, 3, 72, 36, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 415, 5, 71, 0, 0, 415, 417, 5, 56, 0, 0, 416, 414, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 65, 1, 0, 0, 0, 418, 419, 5, 22, 0, 0, 419, 421, 3, 98, 49, 0, 420, 418, 1, 0, 0, 0, 420, 421, 1, 0, 0, 0, 421, 477, 1, 0, 0, 0, 422, 423, 5, 71, 0, 0, 423, 424, 5, 56, 0, 0, 424, 425, 5, 2, 0, 0, 425, 430, 3, 102, 51, 0, 426, 427, 5, 1, 0, 0, 427, 429, 3, 102, 51, 0, 428, 426, 1, 0, 0, 0, 429, 432, 1, 0, 0, 0, 430, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 433, 1, 0, 0, 0, 432, 430, 1, 0, 0, 0, 433, 434, 5, 3, 0, 0, 434, 478, 1, 0, 0, 0, 435, 436, 5, 88, 0, 0, 436, 437, 5, 2, 0, 0, 437, 442, 3, 102, 51, 0, 438, 439, 5, 1, 0, 0, 439, 441, 3, 102, 51, 0, 440, 438, 1, 0, 0, 0, 441, 444, 1, 0, 0, 0, 442, 440, 1, 0, 0, 0, 442, 443, 1, 0, 0, 0, 443, 445, 1, 0, 0, 0, 444, 442, 1, 0, 0, 0, 445, 446, 5, 3, 0, 0, 446, 478, 1, 0, 0, 0, 447, 448, 5, 19, 0, 0, 448, 449, 5, 2, 0, 0, 449, 450, 3, 72, 36, 0, 450, 451, 5, 3, 0, 0, 451, 478, 1, 0, 0, 0, 452, 453, 5, 41, 0, 0, 453, 454, 5, 56, 0, 0, 454, 455, 5, 2, 0, 0, 455, 460, 3, 102, 51, 0, 456, 457, 5, 1, 0, 0, 457, 459, 3, 102, 51, 0, 458, 456, 1, 0, 0, 0, 459, 462, 1, 0, 0, 0, 460, 458, 1, 0, 0, 0, 460, 461, 1, 0, 0, 0, 461, 463, 1, 0, 0, 0, 462, 460, 1, 0, 0, 0, 463, 464, 5, 3, 0, 0, 464, 465, 5, 73, 0, 0, 465, 466, 3, 104, 52, 0, 466, 467, 5, 2, 0, 0, 467, 472, 3, 102, 51, 0, 468, 469, 5, 1, 0, 0, 469, 471, 3, 102, 51, 0, 470, 468, 1, 0, 0, 0, 471, 474, 1, 0, 0, 0, 472, 470, 1, 0, 0, 0, 472, 473, 1, 0, 0, 0, 473, 475, 1, 0, 0, 0, 474, 472, 1, 0, 0, 0, 475, 476, 5, 3, 0, 0, 476, 478, 1, 0, 0, 0, 477, 422, 1, 0, 0, 0, 477, 435, 1, 0, 0, 0, 477, 447, 1, 0, 0, 0, 477, 452, 1, 0, 0, 0, 478, 67, 1, 0, 0, 0, 479, 480, 5, 7, 0, 0, 480, 483, 5, 79, 0, 0, 481, 482, 5, 46, 0, 0, 482, 484, 5, 37, 0, 0, 483, 481, 1, 0, 0, 0, 483, 484, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 517, 3, 104, 52, 0, 486, 487, 5, 5, 0, 0, 487, 491, 5, 21, 0, 0, 488, 489, 5, 46, 0, 0, 489, 490, 5, 61, 0, 0, 490, 492, 5, 37, 0, 0, 491, 488, 1, 0, 0, 0, 491, 492, 1, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 518, 3, 64, 32, 0, 494, 495, 5, 32, 0, 0, 495, 498, 5, 21, 0, 0, 496, 497, 5, 46, 0, 0, 497, 499, 5, 37, 0, 0, 498, 496, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 500, 1, 0, 0, 0, 500, 518, 3, 102, 51, 0, 501, 502, 5, 74, 0, 0, 502, 503, 5, 85, 0, 0, 503, 518, 3, 106, 53, 0, 504, 505, 5, 7, 0, 0, 505, 506, 5, 21, 0, 0, 506, 507, 3, 102, 51, 0, 507, 508, 5, 77, 0, 0, 508, 509, 5, 27, 0, 0, 509, 510, 3, 72, 36, 0, 510, 518, 1, 0, 0, 0, 511, 512, 5, 7, 0, 0, 512, 513, 5, 21, 0, 0, 513, 514, 3, 102, 51, 0, 514, 515, 5, 32, 0, 0, 515, 516, 5, 27, 0, 0, 516, 518, 1, 0, 0, 0, 517, 486, 1, 0, 0, 0, 517, 494, 1, 0, 0, 0, 517, 501, 1, 0, 0, 0, 517, 504, 1, 0, 0, 0, 517, 511, 1, 0, 0, 0, 518, 69, 1, 0, 0, 0, 519, 520, 5, 32, 0, 0, 520, 523, 5, 79, 0, 0, 521, 522, 5, 46, 0, 0, 522, 524, 5, 37, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 3, 104, 52, 0, 526, 71, 1, 0, 0, 0, 527, 528, 3, 74, 37, 0, 528, 73, 1, 0, 0, 0, 529, 530, 6, 37, -1, 0, 530, 534, 3, 76, 38, 0, 531, 532, 5, 61, 0, 0, 532, 534, 3, 74, 37, 3, 533, 529, 1, 0, 0, 0, 533, 531, 1, 0, 0, 0, 534, 543, 1, 0, 0, 0, 535, 536, 10, 2, 0, 0, 536, 537, 5, 8, 0, 0, 537, 542, 3, 74, 37, 3, 538, 539, 10, 1, 0, 0, 539, 540, 5, 68, 0, 0, 540, 542, 3, 74, 37, 2, 541, 535, 1, 0, 0, 0, 541, 538, 1, 0, 0, 0, 542, 545, 1, 0, 0, 0, 543, 541, 1, 0, 0, 0, 543, 544, 1, 0, 0, 0, 544, 75, 1, 0, 0, 0, 545, 543, 1, 0, 0, 0, 546, 548, 3, 82, 41, 0, 547, 549, 3, 78, 39, 0, 548, 547, 1, 0, 0, 0, 548, 549, 1, 0, 0, 0, 549, 77, 1, 0, 0, 0, 550, 551, 3, 80, 40, 0, 551, 552, 3, 82, 41, 0, 552, 606, 1, 0, 0, 0, 553, 555, 5, 61, 0, 0, 554, 553, 1, 0, 0, 0, 554, 555, 1, 0, 0, 0, 555, 556, 1, 0, 0, 0, 556, 557, 5, 47, 0, 0, 557, 558, 5, 2, 0, 0, 558, 563, 3, 72, 36, 0, 559, 560, 5, 1, 0, 0, 560, 562, 3, 72, 36, 0, 561, 559, 1, 0, 0, 0, 562, 565, 1, 0, 0, 0, 563, 561, 1, 0, 0, 0, 563, 564, 1, 0, 0, 0, 564, 566, 1, 0, 0, 0, 565, 563, 1, 0, 0, 0, 566, 567, 5, 3, 0, 0, 567, 606, 1, 0, 0, 0, 568, 570, 5, 61, 0, 0, 569, 568, 1, 0, 0, 0, 569, 570, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 572, 5, 47, 0, 0, 572, 573, 5, 2, 0, 0, 573, 574, 3, 8, 4, 0, 574, 575, 5, 3, 0, 0, 575, 606, 1, 0, 0, 0, 576, 578, 5, 61, 0, 0, 577, 576, 1, 0, 0, 0, 577, 578, 1, 0, 0, 0, 578, 579, 1, 0, 0, 0, 579, 580, 5, 11, 0, 0, 580, 581, 3, 82, 41, 0, 581, 582, 5, 8, 0, 0, 582, 583, 3, 82, 41, 0, 583, 606, 1, 0, 0, 0, 584, 586, 5, 61, 0, 0, 585, 584, 1, 0, 0, 0, 585, 586, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 588, 5, 59, 0, 0, 588, 591, 3, 82, 41, 0, 589, 590, 5, 35, 0, 0, 590, 592, 3, 82, 41, 0, 591, 589, 1, 0, 0, 0, 591, 592, 1, 0, 0, 0, 592, 606, 1, 0, 0, 0, 593, 595, 5, 54, 0, 0, 594, 596, 5, 61, 0, 0, 595, 594, 1, 0, 0, 0, 595, 596, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 606, 5, 62, 0, 0, 598, 600, 5, 54, 0, 0, 599, 601, 5, 61, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 5, 30, 0, 0, 603, 604, 5, 42, 0, 0, 604, 606, 3, 82, 41, 0, 605, 550, 1, 0, 0, 0, 605, 554, 1, 0, 0, 0, 605, 569, 1, 0, 0, 0, 605, 577, 1, 0, 0, 0, 605, 585, 1, 0, 0, 0, 605, 593, 1, 0, 0, 0, 605, 598, 1, 0, 0, 0, 606, 79, 1, 0, 0, 0, 607, 608, 7, 4, 0, 0, 608, 81, 1, 0, 0, 0, 609, 610, 6, 41, -1, 0, 610, 614, 3, 84, 42, 0, 611, 612, 7, 5, 0, 0, 612, 614, 3, 82, 41, 4, 613, 609, 1, 0, 0, 0, 613, 611, 1, 0, 0, 0, 614, 626, 1, 0, 0, 0, 615, 616, 10, 3, 0, 0, 616, 617, 7, 6, 0, 0, 617, 625, 3, 82, 41, 4, 618, 619, 10, 2, 0, 0, 619, 620, 7, 5, 0, 0, 620, 625, 3, 82, 41, 3, 621, 622, 10, 1, 0, 0, 622, 623, 5, 106, 0, 0, 623, 625, 3, 82, 41, 2, 624, 615, 1, 0, 0, 0, 624, 618, 1, 0, 0, 0, 624, 621, 1, 0, 0, 0, 625, 628, 1, 0, 0, 0, 626, 624, 1, 0, 0, 0, 626, 627, 1, 0, 0, 0, 627, 83, 1, 0, 0, 0, 628, 626, 1, 0, 0, 0, 629, 710, 3, 96, 48, 0, 630, 631, 3, 100, 50, 0, 631, 643, 5, 2, 0, 0, 632, 634, 3, 24, 12, 0, 633, 632, 1, 0, 0, 0, 633, 634, 1, 0, 0, 0, 634, 635, 1, 0, 0, 0, 635, 640, 3, 72, 36, 0, 636, 637, 5, 1, 0, 0, 637, 639, 3, 72, 36, 0, 638, 636, 1, 0, 0, 0, 639, 642, 1, 0, 0, 0, 640, 638, 1, 0, 0, 0, 640, 641, 1, 0, 0, 0, 641, 644, 1, 0, 0, 0, 642, 640, 1, 0, 0, 0, 643, 633, 1, 0, 0, 0, 643, 644, 1, 0, 0, 0, 644, 645, 1, 0, 0, 0, 645, 646, 5, 3, 0, 0, 646, 710, 1, 0, 0, 0, 647, 649, 5, 16, 0, 0, 648, 650, 3, 86, 43, 0, 649, 648, 1, 0, 0, 0, 650, 651, 1, 0, 0, 0, 651, 649, 1, 0, 0, 0, 651, 652, 1, 0, 0, 0, 652, 655, 1, 0, 0, 0, 653, 654, 5, 33, 0, 0, 654, 656, 3, 72, 36, 0, 655, 653, 1, 0, 0, 0, 655, 656, 1, 0, 0, 0, 656, 657, 1, 0, 0, 0, 657, 658, 5, 34, 0, 0, 658, 710, 1, 0, 0, 0, 659, 660, 5, 16, 0, 0, 660, 662, 3, 72, 36, 0, 661, 663, 3, 86, 43, 0, 662, 661, 1, 0, 0, 0, 663, 664, 1, 0, 0, 0, 664, 662, 1, 0, 0, 0, 664, 665, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 667, 5, 33, 0, 0, 667, 669, 3, 72, 36, 0, 668, 666, 1, 0, 0, 0, 668, 669, 1, 0, 0, 0, 669, 670, 1, 0, 0, 0, 670, 671, 5, 34, 0, 0, 671, 710, 1, 0, 0, 0, 672, 673, 5, 17, 0, 0, 673, 674, 5, 2, 0, 0, 674, 675, 3, 72, 36, 0, 675, 676, 5, 9, 0, 0, 676, 677, 3, 90, 45, 0, 677, 678, 5, 3, 0, 0, 678, 710, 1, 0, 0, 0, 679, 680, 5, 20, 0, 0, 680, 681, 5, 2, 0, 0, 681, 686, 3, 72, 36, 0, 682, 683, 5, 1, 0, 0, 683, 685, 3, 72, 36, 0, 684, 682, 1, 0, 0, 0, 685, 688, 1, 0, 0, 0, 686, 684, 1, 0, 0, 0, 686, 687, 1, 0, 0, 0, 687, 689, 1, 0, 0, 0, 688, 686, 1, 0, 0, 0, 689, 690, 5, 3, 0, 0, 690, 710, 1, 0, 0, 0, 691, 692, 5, 63, 0, 0, 692, 693, 5, 2, 0, 0, 693, 694, 3, 82, 41, 0, 694, 695, 5, 1, 0, 0, 695, 696, 3, 82, 41, 0, 696, 697, 5, 3, 0, 0, 697, 710, 1, 0, 0, 0, 698, 699, 5, 2, 0, 0, 699, 700, 3, 72, 36, 0, 700, 701, 5, 3, 0, 0, 701, 710, 1, 0, 0, 0, 702, 703, 5, 37, 0, 0, 703, 704, 5, 2, 0, 0, 704, 705, 3, 8, 4, 0, 705, 706, 5, 3, 0, 0, 706, 710, 1, 0, 0, 0, 707, 710, 3, 88, 44, 0, 708, 710, 3, 100, 50, 0, 709, 629, 1, 0, 0, 0, 709, 630, 1, 0, 0, 0, 709, 647, 1, 0, 0, 0, 709, 659, 1, 0, 0, 0, 709, 672, 1, 0, 0, 0, 709, 679, 1, 0, 0, 0, 709, 691, 1, 0, 0, 0, 709, 698, 1, 0, 0, 0, 709, 702, 1, 0, 0, 0, 709, 707, 1, 0, 0, 0, 709, 708, 1, 0, 0, 0, 710, 85, 1, 0, 0, 0, 711, 712, 5, 92, 0, 0, 712, 713, 3, 72, 36, 0, 713, 714, 5, 81, 0, 0, 714, 715, 3, 72, 36, 0, 715, 87, 1, 0, 0, 0, 716, 717, 5, 2, 0, 0, 717, 718, 3, 8, 4, 0, 718, 719, 5, 3, 0, 0, 719, 89, 1, 0, 0, 0, 720, 767, 5, 14, 0, 0, 721, 767, 5, 84, 0, 0, 722, 767, 5, 78, 0, 0, 723, 767, 5, 50, 0, 0, 724, 767, 5, 51, 0, 0, 725, 767, 5, 12, 0, 0, 726, 767, 5, 40, 0, 0, 727, 767, 5, 31, 0, 0, 728, 736, 5, 26, 0, 0, 729, 730, 5, 2, 0, 0, 730, 733, 5, 111, 0, 0, 731, 732, 5, 1, 0, 0, 732, 734, 5, 111, 0, 0, 733, 731, 1, 0, 0, 0, 733, 734, 1, 0, 0, 0, 734, 735, 1, 0, 0, 0, 735, 737, 5, 3, 0, 0, 736, 729, 1, 0, 0, 0, 736, 737, 1, 0, 0, 0, 737, 767, 1, 0, 0, 0, 738, 746, 5, 65, 0, 0, 739, 740, 5, 2, 0, 0, 740, 743, 5, 111, 0, 0, 741, 742, 5, 1, 0, 0, 742, 744, 5, 111, 0, 0, 743, 741, 1, 0, 0, 0, 743, 744, 1, 0, 0, 0, 744, 745, 1, 0, 0, 0, 745, 747, 5, 3, 0, 0, 746, 739, 1, 0, 0, 0, 746, 747, 1, 0, 0, 0, 747, 767, 1, 0, 0, 0, 748, 752, 5, 90, 0, 0, 749, 750, 5, 2, 0, 0, 750, 751, 5, 111, 0, 0, 751, 753, 5, 3, 0, 0, 752, 749, 1, 0, 0, 0, 752, 753, 1, 0, 0, 0, 753, 767, 1, 0, 0, 0, 754, 758, 5, 18, 0, 0, 755, 756, 5, 2, 0, 0, 756, 757, 5, 111, 0, 0, 757, 759, 5, 3, 0, 0, 758, 755, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 767, 1, 0, 0, 0, 760, 767, 5, 80, 0, 0, 761, 767, 5, 25, 0, 0, 762, 767, 5, 82, 0, 0, 763, 767, 5, 83, 0, 0, 764, 767, 5, 13, 0, 0, 765, 767, 5, 91, 0, 0, 766, 720, 1, 0, 0, 0, 766, 721, 1, 0, 0, 0, 766, 722, 1, 0, 0, 0, 766, 723, 1, 0, 0, 0, 766, 724, 1, 0, 0, 0, 766, 725, 1, 0, 0, 0, 766, 726, 1, 0, 0, 0, 766, 727, 1, 0, 0, 0, 766, 728, 1, 0, 0, 0, 766, 738, 1, 0, 0, 0, 766, 748, 1, 0, 0, 0, 766, 754, 1, 0, 0, 0, 766, 760, 1, 0, 0, 0, 766, 761, 1, 0, 0, 0, 766, 762, 1, 0, 0, 0, 766, 763, 1, 0, 0, 0, 766, 764, 1, 0, 0, 0, 766, 765, 1, 0, 0, 0, 767, 91, 1, 0, 0, 0, 768, 769, 5, 2, 0, 0, 769, 774, 3, 94, 47, 0, 770, 771, 5, 1, 0, 0, 771, 773, 3, 94, 47, 0, 772, 770, 1, 0, 0, 0, 773, 776, 1, 0, 0, 0, 774, 772, 1, 0, 0, 0, 774, 775, 1, 0, 0, 0, 775, 777, 1, 0, 0, 0, 776, 774, 1, 0, 0, 0, 777, 778, 5, 3, 0, 0, 778, 93, 1, 0, 0, 0, 779, 780, 3, 98, 49, 0, 780, 781, 5, 95, 0, 0, 781, 782, 3, 96, 48, 0, 782, 95, 1, 0, 0, 0, 783, 792, 5, 62, 0, 0, 784, 792, 5, 86, 0, 0, 785, 792, 5, 38, 0, 0, 786, 792, 5, 111, 0, 0, 787, 792, 5, 112, 0, 0, 788, 792, 5, 113, 0, 0, 789, 792, 5, 109, 0, 0, 790, 792, 5, 110, 0, 0, 791, 783, 1, 0, 0, 0, 791, 784, 1, 0, 0, 0, 791, 785, 1, 0, 0, 0, 791, 786, 1, 0, 0, 0, 791, 787, 1, 0, 0, 0, 791, 788, 1, 0, 0, 0, 791, 789, 1, 0, 0, 0, 791, 790, 1, 0, 0, 0, 792, 97, 1, 0, 0, 0, 793, 799, 5, 114, 0, 0, 794, 799, 5, 115, 0, 0, 795, 799, 5, 116, 0, 0, 796, 799, 5, 117, 0, 0, 797, 799, 3, 108, 54, 0, 798, 793, 1, 0, 0, 0, 798, 794, 1, 0, 0, 0, 798, 795, 1, 0, 0, 0, 798, 796, 1, 0, 0, 0, 798, 797, 1, 0, 0, 0, 799, 99, 1, 0, 0, 0, 800, 805, 3, 98, 49, 0, 801, 802, 5, 4, 0, 0, 802, 804, 3, 98, 49, 0, 803, 801, 1, 0, 0, 0, 804, 807, 1, 0, 0, 0, 805, 803, 1, 0, 0, 0, 805, 806, 1, 0, 0, 0, 806, 101, 1, 0, 0, 0, 807, 805, 1, 0, 0, 0, 808, 809, 3, 98, 49, 0, 809, 103, 1, 0, 0, 0, 810, 811, 3, 100, 50, 0, 811, 105, 1, 0, 0, 0, 812, 813, 3, 100, 50, 0, 813, 107, 1, 0, 0, 0, 814, 815, 7, 7, 0, 0, 815, 109, 1, 0, 0, 0, 97, 113, 122, 131, 134, 140, 147, 152, 165, 173, 178, 188, 192, 199, 203, 206, 209, 212, 215, 218, 224, 227, 234, 242, 257, 261, 265, 269, 273, 276, 280, 283, 290, 298, 305, 318, 323, 327, 333, 339, 349, 362, 366, 376, 383, 392, 398, 402, 408, 412, 416, 420, 430, 442, 460, 472, 477, 483, 491, 498, 517, 523, 533, 541, 543, 548, 554, 563, 569, 577, 585, 591, 595, 600, 605, 613, 624, 626, 633, 640, 643, 651, 655, 664, 668, 686, 709, 733, 736, 743, 746, 752, 758, 766, 774, 791, 798, 805] \ No newline at end of file +[4, 1, 122, 854, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 1, 0, 5, 0, 122, 8, 0, 10, 0, 12, 0, 125, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 3, 2, 133, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 142, 8, 3, 1, 4, 3, 4, 145, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 3, 5, 151, 8, 5, 1, 5, 1, 5, 1, 5, 5, 5, 156, 8, 5, 10, 5, 12, 5, 159, 9, 5, 1, 6, 1, 6, 3, 6, 163, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 174, 8, 7, 10, 7, 12, 7, 177, 9, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 3, 8, 184, 8, 8, 1, 8, 5, 8, 187, 8, 8, 10, 8, 12, 8, 190, 9, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 199, 8, 10, 1, 11, 1, 11, 3, 11, 203, 8, 11, 1, 11, 1, 11, 1, 11, 5, 11, 208, 8, 11, 10, 11, 12, 11, 211, 9, 11, 1, 11, 3, 11, 214, 8, 11, 1, 11, 3, 11, 217, 8, 11, 1, 11, 3, 11, 220, 8, 11, 1, 11, 3, 11, 223, 8, 11, 1, 11, 3, 11, 226, 8, 11, 1, 11, 3, 11, 229, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 3, 13, 235, 8, 13, 1, 13, 3, 13, 238, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 247, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 5, 14, 253, 8, 14, 10, 14, 12, 14, 256, 9, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 268, 8, 15, 10, 15, 12, 15, 271, 9, 15, 1, 16, 3, 16, 274, 8, 16, 1, 16, 1, 16, 3, 16, 278, 8, 16, 1, 16, 1, 16, 3, 16, 282, 8, 16, 1, 16, 1, 16, 3, 16, 286, 8, 16, 1, 16, 3, 16, 289, 8, 16, 1, 17, 1, 17, 3, 17, 293, 8, 17, 1, 17, 3, 17, 296, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 303, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 309, 8, 19, 1, 20, 1, 20, 1, 20, 3, 20, 314, 8, 20, 1, 20, 1, 20, 1, 20, 5, 20, 319, 8, 20, 10, 20, 12, 20, 322, 9, 20, 1, 21, 1, 21, 1, 21, 1, 21, 3, 21, 328, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 5, 22, 335, 8, 22, 10, 22, 12, 22, 338, 9, 22, 1, 23, 1, 23, 3, 23, 342, 8, 23, 1, 23, 1, 23, 3, 23, 346, 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 352, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 358, 8, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 5, 26, 366, 8, 26, 10, 26, 12, 26, 369, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 379, 8, 27, 10, 27, 12, 27, 382, 9, 27, 1, 27, 3, 27, 385, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 3, 29, 395, 8, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 402, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 5, 30, 409, 8, 30, 10, 30, 12, 30, 412, 9, 30, 1, 30, 1, 30, 1, 30, 3, 30, 417, 8, 30, 1, 31, 1, 31, 3, 31, 421, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 427, 8, 32, 1, 32, 1, 32, 3, 32, 431, 8, 32, 1, 32, 1, 32, 3, 32, 435, 8, 32, 1, 33, 1, 33, 1, 34, 1, 34, 3, 34, 441, 8, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 449, 8, 34, 10, 34, 12, 34, 452, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 461, 8, 34, 10, 34, 12, 34, 464, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 479, 8, 34, 10, 34, 12, 34, 482, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 491, 8, 34, 10, 34, 12, 34, 494, 9, 34, 1, 34, 1, 34, 3, 34, 498, 8, 34, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 504, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 512, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 519, 8, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 538, 8, 35, 1, 36, 1, 36, 1, 36, 1, 36, 3, 36, 544, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 554, 8, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 5, 38, 562, 8, 38, 10, 38, 12, 38, 565, 9, 38, 1, 39, 1, 39, 3, 39, 569, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 575, 8, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 582, 8, 40, 10, 40, 12, 40, 585, 9, 40, 1, 40, 1, 40, 1, 40, 3, 40, 590, 8, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 598, 8, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 606, 8, 40, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 612, 8, 40, 1, 40, 1, 40, 3, 40, 616, 8, 40, 1, 40, 1, 40, 1, 40, 3, 40, 621, 8, 40, 1, 40, 1, 40, 1, 40, 3, 40, 626, 8, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 634, 8, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 645, 8, 42, 10, 42, 12, 42, 648, 9, 42, 1, 43, 1, 43, 1, 43, 1, 43, 3, 43, 654, 8, 43, 1, 43, 1, 43, 1, 43, 5, 43, 659, 8, 43, 10, 43, 12, 43, 662, 9, 43, 3, 43, 664, 8, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 670, 8, 43, 11, 43, 12, 43, 671, 1, 43, 1, 43, 3, 43, 676, 8, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 683, 8, 43, 11, 43, 12, 43, 684, 1, 43, 1, 43, 3, 43, 689, 8, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 5, 43, 705, 8, 43, 10, 43, 12, 43, 708, 9, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 3, 43, 730, 8, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 754, 8, 46, 1, 46, 3, 46, 757, 8, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 764, 8, 46, 1, 46, 3, 46, 767, 8, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 773, 8, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 779, 8, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 787, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 793, 8, 47, 10, 47, 12, 47, 796, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 812, 8, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 819, 8, 50, 1, 51, 1, 51, 1, 51, 5, 51, 824, 8, 51, 10, 51, 12, 51, 827, 9, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 835, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 840, 8, 53, 1, 54, 1, 54, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 0, 3, 30, 76, 84, 60, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 0, 8, 3, 0, 36, 36, 52, 52, 87, 87, 2, 0, 6, 6, 30, 30, 2, 0, 10, 10, 29, 29, 2, 0, 39, 39, 57, 57, 1, 0, 95, 100, 1, 0, 101, 102, 1, 0, 103, 105, 22, 0, 5, 6, 10, 10, 12, 15, 18, 18, 20, 21, 24, 27, 29, 29, 31, 31, 38, 40, 43, 43, 46, 46, 50, 51, 56, 58, 60, 60, 63, 66, 70, 70, 75, 75, 78, 78, 80, 80, 82, 86, 88, 88, 90, 91, 949, 0, 123, 1, 0, 0, 0, 2, 128, 1, 0, 0, 0, 4, 130, 1, 0, 0, 0, 6, 141, 1, 0, 0, 0, 8, 144, 1, 0, 0, 0, 10, 148, 1, 0, 0, 0, 12, 160, 1, 0, 0, 0, 14, 169, 1, 0, 0, 0, 16, 180, 1, 0, 0, 0, 18, 191, 1, 0, 0, 0, 20, 198, 1, 0, 0, 0, 22, 200, 1, 0, 0, 0, 24, 230, 1, 0, 0, 0, 26, 246, 1, 0, 0, 0, 28, 248, 1, 0, 0, 0, 30, 257, 1, 0, 0, 0, 32, 288, 1, 0, 0, 0, 34, 290, 1, 0, 0, 0, 36, 302, 1, 0, 0, 0, 38, 304, 1, 0, 0, 0, 40, 310, 1, 0, 0, 0, 42, 323, 1, 0, 0, 0, 44, 329, 1, 0, 0, 0, 46, 339, 1, 0, 0, 0, 48, 347, 1, 0, 0, 0, 50, 353, 1, 0, 0, 0, 52, 361, 1, 0, 0, 0, 54, 372, 1, 0, 0, 0, 56, 386, 1, 0, 0, 0, 58, 390, 1, 0, 0, 0, 60, 396, 1, 0, 0, 0, 62, 420, 1, 0, 0, 0, 64, 422, 1, 0, 0, 0, 66, 436, 1, 0, 0, 0, 68, 440, 1, 0, 0, 0, 70, 499, 1, 0, 0, 0, 72, 539, 1, 0, 0, 0, 74, 547, 1, 0, 0, 0, 76, 553, 1, 0, 0, 0, 78, 566, 1, 0, 0, 0, 80, 625, 1, 0, 0, 0, 82, 627, 1, 0, 0, 0, 84, 633, 1, 0, 0, 0, 86, 729, 1, 0, 0, 0, 88, 731, 1, 0, 0, 0, 90, 736, 1, 0, 0, 0, 92, 786, 1, 0, 0, 0, 94, 788, 1, 0, 0, 0, 96, 799, 1, 0, 0, 0, 98, 811, 1, 0, 0, 0, 100, 818, 1, 0, 0, 0, 102, 820, 1, 0, 0, 0, 104, 834, 1, 0, 0, 0, 106, 839, 1, 0, 0, 0, 108, 841, 1, 0, 0, 0, 110, 843, 1, 0, 0, 0, 112, 845, 1, 0, 0, 0, 114, 847, 1, 0, 0, 0, 116, 849, 1, 0, 0, 0, 118, 851, 1, 0, 0, 0, 120, 122, 3, 2, 1, 0, 121, 120, 1, 0, 0, 0, 122, 125, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 126, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 127, 5, 0, 0, 1, 127, 1, 1, 0, 0, 0, 128, 129, 3, 4, 2, 0, 129, 3, 1, 0, 0, 0, 130, 132, 3, 6, 3, 0, 131, 133, 5, 108, 0, 0, 132, 131, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 5, 1, 0, 0, 0, 134, 142, 3, 8, 4, 0, 135, 142, 3, 50, 25, 0, 136, 142, 3, 54, 27, 0, 137, 142, 3, 58, 29, 0, 138, 142, 3, 60, 30, 0, 139, 142, 3, 70, 35, 0, 140, 142, 3, 72, 36, 0, 141, 134, 1, 0, 0, 0, 141, 135, 1, 0, 0, 0, 141, 136, 1, 0, 0, 0, 141, 137, 1, 0, 0, 0, 141, 138, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 141, 140, 1, 0, 0, 0, 142, 7, 1, 0, 0, 0, 143, 145, 3, 10, 5, 0, 144, 143, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 147, 3, 16, 8, 0, 147, 9, 1, 0, 0, 0, 148, 150, 5, 94, 0, 0, 149, 151, 5, 72, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 157, 3, 12, 6, 0, 153, 154, 5, 1, 0, 0, 154, 156, 3, 12, 6, 0, 155, 153, 1, 0, 0, 0, 156, 159, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 11, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 160, 162, 3, 100, 50, 0, 161, 163, 3, 14, 7, 0, 162, 161, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 165, 5, 9, 0, 0, 165, 166, 5, 2, 0, 0, 166, 167, 3, 8, 4, 0, 167, 168, 5, 3, 0, 0, 168, 13, 1, 0, 0, 0, 169, 170, 5, 2, 0, 0, 170, 175, 3, 100, 50, 0, 171, 172, 5, 1, 0, 0, 172, 174, 3, 100, 50, 0, 173, 171, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 3, 0, 0, 179, 15, 1, 0, 0, 0, 180, 188, 3, 18, 9, 0, 181, 183, 7, 0, 0, 0, 182, 184, 5, 6, 0, 0, 183, 182, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 187, 3, 18, 9, 0, 186, 181, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 17, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 192, 3, 20, 10, 0, 192, 19, 1, 0, 0, 0, 193, 199, 3, 22, 11, 0, 194, 195, 5, 2, 0, 0, 195, 196, 3, 8, 4, 0, 196, 197, 5, 3, 0, 0, 197, 199, 1, 0, 0, 0, 198, 193, 1, 0, 0, 0, 198, 194, 1, 0, 0, 0, 199, 21, 1, 0, 0, 0, 200, 202, 5, 76, 0, 0, 201, 203, 3, 24, 12, 0, 202, 201, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 209, 3, 26, 13, 0, 205, 206, 5, 1, 0, 0, 206, 208, 3, 26, 13, 0, 207, 205, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 213, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 214, 3, 28, 14, 0, 213, 212, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 216, 1, 0, 0, 0, 215, 217, 3, 38, 19, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 219, 1, 0, 0, 0, 218, 220, 3, 40, 20, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 222, 1, 0, 0, 0, 221, 223, 3, 42, 21, 0, 222, 221, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 225, 1, 0, 0, 0, 224, 226, 3, 44, 22, 0, 225, 224, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 228, 1, 0, 0, 0, 227, 229, 3, 48, 24, 0, 228, 227, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 23, 1, 0, 0, 0, 230, 231, 7, 1, 0, 0, 231, 25, 1, 0, 0, 0, 232, 237, 3, 74, 37, 0, 233, 235, 5, 9, 0, 0, 234, 233, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 238, 3, 100, 50, 0, 237, 234, 1, 0, 0, 0, 237, 238, 1, 0, 0, 0, 238, 247, 1, 0, 0, 0, 239, 240, 3, 102, 51, 0, 240, 241, 5, 4, 0, 0, 241, 242, 5, 103, 0, 0, 242, 247, 1, 0, 0, 0, 243, 247, 5, 103, 0, 0, 244, 245, 4, 13, 0, 0, 245, 247, 3, 110, 55, 0, 246, 232, 1, 0, 0, 0, 246, 239, 1, 0, 0, 0, 246, 243, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 247, 27, 1, 0, 0, 0, 248, 249, 5, 42, 0, 0, 249, 254, 3, 30, 15, 0, 250, 251, 5, 1, 0, 0, 251, 253, 3, 30, 15, 0, 252, 250, 1, 0, 0, 0, 253, 256, 1, 0, 0, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 29, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 257, 258, 6, 15, -1, 0, 258, 259, 3, 34, 17, 0, 259, 269, 1, 0, 0, 0, 260, 261, 10, 2, 0, 0, 261, 262, 3, 32, 16, 0, 262, 263, 5, 55, 0, 0, 263, 264, 3, 30, 15, 0, 264, 265, 5, 67, 0, 0, 265, 266, 3, 74, 37, 0, 266, 268, 1, 0, 0, 0, 267, 260, 1, 0, 0, 0, 268, 271, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 31, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 272, 274, 5, 48, 0, 0, 273, 272, 1, 0, 0, 0, 273, 274, 1, 0, 0, 0, 274, 289, 1, 0, 0, 0, 275, 277, 5, 58, 0, 0, 276, 278, 5, 70, 0, 0, 277, 276, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 289, 1, 0, 0, 0, 279, 281, 5, 75, 0, 0, 280, 282, 5, 70, 0, 0, 281, 280, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 289, 1, 0, 0, 0, 283, 285, 5, 43, 0, 0, 284, 286, 5, 70, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 289, 5, 24, 0, 0, 288, 273, 1, 0, 0, 0, 288, 275, 1, 0, 0, 0, 288, 279, 1, 0, 0, 0, 288, 283, 1, 0, 0, 0, 288, 287, 1, 0, 0, 0, 289, 33, 1, 0, 0, 0, 290, 295, 3, 36, 18, 0, 291, 293, 5, 9, 0, 0, 292, 291, 1, 0, 0, 0, 292, 293, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 296, 3, 100, 50, 0, 295, 292, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 35, 1, 0, 0, 0, 297, 303, 3, 112, 56, 0, 298, 299, 5, 2, 0, 0, 299, 300, 3, 8, 4, 0, 300, 301, 5, 3, 0, 0, 301, 303, 1, 0, 0, 0, 302, 297, 1, 0, 0, 0, 302, 298, 1, 0, 0, 0, 303, 37, 1, 0, 0, 0, 304, 308, 5, 93, 0, 0, 305, 309, 3, 74, 37, 0, 306, 307, 4, 19, 2, 0, 307, 309, 3, 110, 55, 0, 308, 305, 1, 0, 0, 0, 308, 306, 1, 0, 0, 0, 309, 39, 1, 0, 0, 0, 310, 311, 5, 44, 0, 0, 311, 313, 5, 15, 0, 0, 312, 314, 3, 24, 12, 0, 313, 312, 1, 0, 0, 0, 313, 314, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 320, 3, 74, 37, 0, 316, 317, 5, 1, 0, 0, 317, 319, 3, 74, 37, 0, 318, 316, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 41, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 327, 5, 45, 0, 0, 324, 328, 3, 74, 37, 0, 325, 326, 4, 21, 3, 0, 326, 328, 3, 110, 55, 0, 327, 324, 1, 0, 0, 0, 327, 325, 1, 0, 0, 0, 328, 43, 1, 0, 0, 0, 329, 330, 5, 69, 0, 0, 330, 331, 5, 15, 0, 0, 331, 336, 3, 46, 23, 0, 332, 333, 5, 1, 0, 0, 333, 335, 3, 46, 23, 0, 334, 332, 1, 0, 0, 0, 335, 338, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 45, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 341, 3, 74, 37, 0, 340, 342, 7, 2, 0, 0, 341, 340, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 345, 1, 0, 0, 0, 343, 344, 5, 64, 0, 0, 344, 346, 7, 3, 0, 0, 345, 343, 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 47, 1, 0, 0, 0, 347, 348, 5, 60, 0, 0, 348, 351, 3, 74, 37, 0, 349, 350, 5, 66, 0, 0, 350, 352, 3, 74, 37, 0, 351, 349, 1, 0, 0, 0, 351, 352, 1, 0, 0, 0, 352, 49, 1, 0, 0, 0, 353, 354, 5, 49, 0, 0, 354, 355, 5, 53, 0, 0, 355, 357, 3, 112, 56, 0, 356, 358, 3, 52, 26, 0, 357, 356, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 359, 1, 0, 0, 0, 359, 360, 3, 8, 4, 0, 360, 51, 1, 0, 0, 0, 361, 362, 5, 2, 0, 0, 362, 367, 3, 106, 53, 0, 363, 364, 5, 1, 0, 0, 364, 366, 3, 106, 53, 0, 365, 363, 1, 0, 0, 0, 366, 369, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 370, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 370, 371, 5, 3, 0, 0, 371, 53, 1, 0, 0, 0, 372, 373, 5, 89, 0, 0, 373, 374, 3, 112, 56, 0, 374, 375, 5, 77, 0, 0, 375, 380, 3, 56, 28, 0, 376, 377, 5, 1, 0, 0, 377, 379, 3, 56, 28, 0, 378, 376, 1, 0, 0, 0, 379, 382, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 384, 1, 0, 0, 0, 382, 380, 1, 0, 0, 0, 383, 385, 3, 38, 19, 0, 384, 383, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 385, 55, 1, 0, 0, 0, 386, 387, 3, 106, 53, 0, 387, 388, 5, 95, 0, 0, 388, 389, 3, 74, 37, 0, 389, 57, 1, 0, 0, 0, 390, 391, 5, 28, 0, 0, 391, 392, 5, 42, 0, 0, 392, 394, 3, 112, 56, 0, 393, 395, 3, 38, 19, 0, 394, 393, 1, 0, 0, 0, 394, 395, 1, 0, 0, 0, 395, 59, 1, 0, 0, 0, 396, 397, 5, 23, 0, 0, 397, 401, 5, 79, 0, 0, 398, 399, 5, 46, 0, 0, 399, 400, 5, 61, 0, 0, 400, 402, 5, 37, 0, 0, 401, 398, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 402, 403, 1, 0, 0, 0, 403, 404, 3, 114, 57, 0, 404, 405, 5, 2, 0, 0, 405, 410, 3, 62, 31, 0, 406, 407, 5, 1, 0, 0, 407, 409, 3, 62, 31, 0, 408, 406, 1, 0, 0, 0, 409, 412, 1, 0, 0, 0, 410, 408, 1, 0, 0, 0, 410, 411, 1, 0, 0, 0, 411, 413, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 413, 416, 5, 3, 0, 0, 414, 415, 5, 94, 0, 0, 415, 417, 3, 94, 47, 0, 416, 414, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 61, 1, 0, 0, 0, 418, 421, 3, 64, 32, 0, 419, 421, 3, 68, 34, 0, 420, 418, 1, 0, 0, 0, 420, 419, 1, 0, 0, 0, 421, 63, 1, 0, 0, 0, 422, 423, 3, 66, 33, 0, 423, 426, 3, 92, 46, 0, 424, 425, 5, 61, 0, 0, 425, 427, 5, 62, 0, 0, 426, 424, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, 430, 1, 0, 0, 0, 428, 429, 5, 27, 0, 0, 429, 431, 3, 74, 37, 0, 430, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 434, 1, 0, 0, 0, 432, 433, 5, 71, 0, 0, 433, 435, 5, 56, 0, 0, 434, 432, 1, 0, 0, 0, 434, 435, 1, 0, 0, 0, 435, 65, 1, 0, 0, 0, 436, 437, 3, 100, 50, 0, 437, 67, 1, 0, 0, 0, 438, 439, 5, 22, 0, 0, 439, 441, 3, 100, 50, 0, 440, 438, 1, 0, 0, 0, 440, 441, 1, 0, 0, 0, 441, 497, 1, 0, 0, 0, 442, 443, 5, 71, 0, 0, 443, 444, 5, 56, 0, 0, 444, 445, 5, 2, 0, 0, 445, 450, 3, 106, 53, 0, 446, 447, 5, 1, 0, 0, 447, 449, 3, 106, 53, 0, 448, 446, 1, 0, 0, 0, 449, 452, 1, 0, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 453, 1, 0, 0, 0, 452, 450, 1, 0, 0, 0, 453, 454, 5, 3, 0, 0, 454, 498, 1, 0, 0, 0, 455, 456, 5, 88, 0, 0, 456, 457, 5, 2, 0, 0, 457, 462, 3, 106, 53, 0, 458, 459, 5, 1, 0, 0, 459, 461, 3, 106, 53, 0, 460, 458, 1, 0, 0, 0, 461, 464, 1, 0, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 465, 1, 0, 0, 0, 464, 462, 1, 0, 0, 0, 465, 466, 5, 3, 0, 0, 466, 498, 1, 0, 0, 0, 467, 468, 5, 19, 0, 0, 468, 469, 5, 2, 0, 0, 469, 470, 3, 74, 37, 0, 470, 471, 5, 3, 0, 0, 471, 498, 1, 0, 0, 0, 472, 473, 5, 41, 0, 0, 473, 474, 5, 56, 0, 0, 474, 475, 5, 2, 0, 0, 475, 480, 3, 106, 53, 0, 476, 477, 5, 1, 0, 0, 477, 479, 3, 106, 53, 0, 478, 476, 1, 0, 0, 0, 479, 482, 1, 0, 0, 0, 480, 478, 1, 0, 0, 0, 480, 481, 1, 0, 0, 0, 481, 483, 1, 0, 0, 0, 482, 480, 1, 0, 0, 0, 483, 484, 5, 3, 0, 0, 484, 485, 5, 73, 0, 0, 485, 486, 3, 112, 56, 0, 486, 487, 5, 2, 0, 0, 487, 492, 3, 106, 53, 0, 488, 489, 5, 1, 0, 0, 489, 491, 3, 106, 53, 0, 490, 488, 1, 0, 0, 0, 491, 494, 1, 0, 0, 0, 492, 490, 1, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 495, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 495, 496, 5, 3, 0, 0, 496, 498, 1, 0, 0, 0, 497, 442, 1, 0, 0, 0, 497, 455, 1, 0, 0, 0, 497, 467, 1, 0, 0, 0, 497, 472, 1, 0, 0, 0, 498, 69, 1, 0, 0, 0, 499, 500, 5, 7, 0, 0, 500, 503, 5, 79, 0, 0, 501, 502, 5, 46, 0, 0, 502, 504, 5, 37, 0, 0, 503, 501, 1, 0, 0, 0, 503, 504, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 537, 3, 112, 56, 0, 506, 507, 5, 5, 0, 0, 507, 511, 5, 21, 0, 0, 508, 509, 5, 46, 0, 0, 509, 510, 5, 61, 0, 0, 510, 512, 5, 37, 0, 0, 511, 508, 1, 0, 0, 0, 511, 512, 1, 0, 0, 0, 512, 513, 1, 0, 0, 0, 513, 538, 3, 64, 32, 0, 514, 515, 5, 32, 0, 0, 515, 518, 5, 21, 0, 0, 516, 517, 5, 46, 0, 0, 517, 519, 5, 37, 0, 0, 518, 516, 1, 0, 0, 0, 518, 519, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 538, 3, 106, 53, 0, 521, 522, 5, 74, 0, 0, 522, 523, 5, 85, 0, 0, 523, 538, 3, 114, 57, 0, 524, 525, 5, 7, 0, 0, 525, 526, 5, 21, 0, 0, 526, 527, 3, 106, 53, 0, 527, 528, 5, 77, 0, 0, 528, 529, 5, 27, 0, 0, 529, 530, 3, 74, 37, 0, 530, 538, 1, 0, 0, 0, 531, 532, 5, 7, 0, 0, 532, 533, 5, 21, 0, 0, 533, 534, 3, 106, 53, 0, 534, 535, 5, 32, 0, 0, 535, 536, 5, 27, 0, 0, 536, 538, 1, 0, 0, 0, 537, 506, 1, 0, 0, 0, 537, 514, 1, 0, 0, 0, 537, 521, 1, 0, 0, 0, 537, 524, 1, 0, 0, 0, 537, 531, 1, 0, 0, 0, 538, 71, 1, 0, 0, 0, 539, 540, 5, 32, 0, 0, 540, 543, 5, 79, 0, 0, 541, 542, 5, 46, 0, 0, 542, 544, 5, 37, 0, 0, 543, 541, 1, 0, 0, 0, 543, 544, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 546, 3, 112, 56, 0, 546, 73, 1, 0, 0, 0, 547, 548, 3, 76, 38, 0, 548, 75, 1, 0, 0, 0, 549, 550, 6, 38, -1, 0, 550, 554, 3, 78, 39, 0, 551, 552, 5, 61, 0, 0, 552, 554, 3, 76, 38, 3, 553, 549, 1, 0, 0, 0, 553, 551, 1, 0, 0, 0, 554, 563, 1, 0, 0, 0, 555, 556, 10, 2, 0, 0, 556, 557, 5, 8, 0, 0, 557, 562, 3, 76, 38, 3, 558, 559, 10, 1, 0, 0, 559, 560, 5, 68, 0, 0, 560, 562, 3, 76, 38, 2, 561, 555, 1, 0, 0, 0, 561, 558, 1, 0, 0, 0, 562, 565, 1, 0, 0, 0, 563, 561, 1, 0, 0, 0, 563, 564, 1, 0, 0, 0, 564, 77, 1, 0, 0, 0, 565, 563, 1, 0, 0, 0, 566, 568, 3, 84, 42, 0, 567, 569, 3, 80, 40, 0, 568, 567, 1, 0, 0, 0, 568, 569, 1, 0, 0, 0, 569, 79, 1, 0, 0, 0, 570, 571, 3, 82, 41, 0, 571, 572, 3, 84, 42, 0, 572, 626, 1, 0, 0, 0, 573, 575, 5, 61, 0, 0, 574, 573, 1, 0, 0, 0, 574, 575, 1, 0, 0, 0, 575, 576, 1, 0, 0, 0, 576, 577, 5, 47, 0, 0, 577, 578, 5, 2, 0, 0, 578, 583, 3, 74, 37, 0, 579, 580, 5, 1, 0, 0, 580, 582, 3, 74, 37, 0, 581, 579, 1, 0, 0, 0, 582, 585, 1, 0, 0, 0, 583, 581, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 583, 1, 0, 0, 0, 586, 587, 5, 3, 0, 0, 587, 626, 1, 0, 0, 0, 588, 590, 5, 61, 0, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 591, 1, 0, 0, 0, 591, 592, 5, 47, 0, 0, 592, 593, 5, 2, 0, 0, 593, 594, 3, 8, 4, 0, 594, 595, 5, 3, 0, 0, 595, 626, 1, 0, 0, 0, 596, 598, 5, 61, 0, 0, 597, 596, 1, 0, 0, 0, 597, 598, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, 600, 5, 11, 0, 0, 600, 601, 3, 84, 42, 0, 601, 602, 5, 8, 0, 0, 602, 603, 3, 84, 42, 0, 603, 626, 1, 0, 0, 0, 604, 606, 5, 61, 0, 0, 605, 604, 1, 0, 0, 0, 605, 606, 1, 0, 0, 0, 606, 607, 1, 0, 0, 0, 607, 608, 5, 59, 0, 0, 608, 611, 3, 84, 42, 0, 609, 610, 5, 35, 0, 0, 610, 612, 3, 84, 42, 0, 611, 609, 1, 0, 0, 0, 611, 612, 1, 0, 0, 0, 612, 626, 1, 0, 0, 0, 613, 615, 5, 54, 0, 0, 614, 616, 5, 61, 0, 0, 615, 614, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 1, 0, 0, 0, 617, 626, 5, 62, 0, 0, 618, 620, 5, 54, 0, 0, 619, 621, 5, 61, 0, 0, 620, 619, 1, 0, 0, 0, 620, 621, 1, 0, 0, 0, 621, 622, 1, 0, 0, 0, 622, 623, 5, 30, 0, 0, 623, 624, 5, 42, 0, 0, 624, 626, 3, 84, 42, 0, 625, 570, 1, 0, 0, 0, 625, 574, 1, 0, 0, 0, 625, 589, 1, 0, 0, 0, 625, 597, 1, 0, 0, 0, 625, 605, 1, 0, 0, 0, 625, 613, 1, 0, 0, 0, 625, 618, 1, 0, 0, 0, 626, 81, 1, 0, 0, 0, 627, 628, 7, 4, 0, 0, 628, 83, 1, 0, 0, 0, 629, 630, 6, 42, -1, 0, 630, 634, 3, 86, 43, 0, 631, 632, 7, 5, 0, 0, 632, 634, 3, 84, 42, 4, 633, 629, 1, 0, 0, 0, 633, 631, 1, 0, 0, 0, 634, 646, 1, 0, 0, 0, 635, 636, 10, 3, 0, 0, 636, 637, 7, 6, 0, 0, 637, 645, 3, 84, 42, 4, 638, 639, 10, 2, 0, 0, 639, 640, 7, 5, 0, 0, 640, 645, 3, 84, 42, 3, 641, 642, 10, 1, 0, 0, 642, 643, 5, 106, 0, 0, 643, 645, 3, 84, 42, 2, 644, 635, 1, 0, 0, 0, 644, 638, 1, 0, 0, 0, 644, 641, 1, 0, 0, 0, 645, 648, 1, 0, 0, 0, 646, 644, 1, 0, 0, 0, 646, 647, 1, 0, 0, 0, 647, 85, 1, 0, 0, 0, 648, 646, 1, 0, 0, 0, 649, 730, 3, 98, 49, 0, 650, 651, 3, 116, 58, 0, 651, 663, 5, 2, 0, 0, 652, 654, 3, 24, 12, 0, 653, 652, 1, 0, 0, 0, 653, 654, 1, 0, 0, 0, 654, 655, 1, 0, 0, 0, 655, 660, 3, 74, 37, 0, 656, 657, 5, 1, 0, 0, 657, 659, 3, 74, 37, 0, 658, 656, 1, 0, 0, 0, 659, 662, 1, 0, 0, 0, 660, 658, 1, 0, 0, 0, 660, 661, 1, 0, 0, 0, 661, 664, 1, 0, 0, 0, 662, 660, 1, 0, 0, 0, 663, 653, 1, 0, 0, 0, 663, 664, 1, 0, 0, 0, 664, 665, 1, 0, 0, 0, 665, 666, 5, 3, 0, 0, 666, 730, 1, 0, 0, 0, 667, 669, 5, 16, 0, 0, 668, 670, 3, 88, 44, 0, 669, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 669, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 675, 1, 0, 0, 0, 673, 674, 5, 33, 0, 0, 674, 676, 3, 74, 37, 0, 675, 673, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 677, 1, 0, 0, 0, 677, 678, 5, 34, 0, 0, 678, 730, 1, 0, 0, 0, 679, 680, 5, 16, 0, 0, 680, 682, 3, 74, 37, 0, 681, 683, 3, 88, 44, 0, 682, 681, 1, 0, 0, 0, 683, 684, 1, 0, 0, 0, 684, 682, 1, 0, 0, 0, 684, 685, 1, 0, 0, 0, 685, 688, 1, 0, 0, 0, 686, 687, 5, 33, 0, 0, 687, 689, 3, 74, 37, 0, 688, 686, 1, 0, 0, 0, 688, 689, 1, 0, 0, 0, 689, 690, 1, 0, 0, 0, 690, 691, 5, 34, 0, 0, 691, 730, 1, 0, 0, 0, 692, 693, 5, 17, 0, 0, 693, 694, 5, 2, 0, 0, 694, 695, 3, 74, 37, 0, 695, 696, 5, 9, 0, 0, 696, 697, 3, 92, 46, 0, 697, 698, 5, 3, 0, 0, 698, 730, 1, 0, 0, 0, 699, 700, 5, 20, 0, 0, 700, 701, 5, 2, 0, 0, 701, 706, 3, 74, 37, 0, 702, 703, 5, 1, 0, 0, 703, 705, 3, 74, 37, 0, 704, 702, 1, 0, 0, 0, 705, 708, 1, 0, 0, 0, 706, 704, 1, 0, 0, 0, 706, 707, 1, 0, 0, 0, 707, 709, 1, 0, 0, 0, 708, 706, 1, 0, 0, 0, 709, 710, 5, 3, 0, 0, 710, 730, 1, 0, 0, 0, 711, 712, 5, 63, 0, 0, 712, 713, 5, 2, 0, 0, 713, 714, 3, 84, 42, 0, 714, 715, 5, 1, 0, 0, 715, 716, 3, 84, 42, 0, 716, 717, 5, 3, 0, 0, 717, 730, 1, 0, 0, 0, 718, 719, 5, 2, 0, 0, 719, 720, 3, 74, 37, 0, 720, 721, 5, 3, 0, 0, 721, 730, 1, 0, 0, 0, 722, 723, 5, 37, 0, 0, 723, 724, 5, 2, 0, 0, 724, 725, 3, 8, 4, 0, 725, 726, 5, 3, 0, 0, 726, 730, 1, 0, 0, 0, 727, 730, 3, 90, 45, 0, 728, 730, 3, 108, 54, 0, 729, 649, 1, 0, 0, 0, 729, 650, 1, 0, 0, 0, 729, 667, 1, 0, 0, 0, 729, 679, 1, 0, 0, 0, 729, 692, 1, 0, 0, 0, 729, 699, 1, 0, 0, 0, 729, 711, 1, 0, 0, 0, 729, 718, 1, 0, 0, 0, 729, 722, 1, 0, 0, 0, 729, 727, 1, 0, 0, 0, 729, 728, 1, 0, 0, 0, 730, 87, 1, 0, 0, 0, 731, 732, 5, 92, 0, 0, 732, 733, 3, 74, 37, 0, 733, 734, 5, 81, 0, 0, 734, 735, 3, 74, 37, 0, 735, 89, 1, 0, 0, 0, 736, 737, 5, 2, 0, 0, 737, 738, 3, 8, 4, 0, 738, 739, 5, 3, 0, 0, 739, 91, 1, 0, 0, 0, 740, 787, 5, 14, 0, 0, 741, 787, 5, 84, 0, 0, 742, 787, 5, 78, 0, 0, 743, 787, 5, 50, 0, 0, 744, 787, 5, 51, 0, 0, 745, 787, 5, 12, 0, 0, 746, 787, 5, 40, 0, 0, 747, 787, 5, 31, 0, 0, 748, 756, 5, 26, 0, 0, 749, 750, 5, 2, 0, 0, 750, 753, 5, 111, 0, 0, 751, 752, 5, 1, 0, 0, 752, 754, 5, 111, 0, 0, 753, 751, 1, 0, 0, 0, 753, 754, 1, 0, 0, 0, 754, 755, 1, 0, 0, 0, 755, 757, 5, 3, 0, 0, 756, 749, 1, 0, 0, 0, 756, 757, 1, 0, 0, 0, 757, 787, 1, 0, 0, 0, 758, 766, 5, 65, 0, 0, 759, 760, 5, 2, 0, 0, 760, 763, 5, 111, 0, 0, 761, 762, 5, 1, 0, 0, 762, 764, 5, 111, 0, 0, 763, 761, 1, 0, 0, 0, 763, 764, 1, 0, 0, 0, 764, 765, 1, 0, 0, 0, 765, 767, 5, 3, 0, 0, 766, 759, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 787, 1, 0, 0, 0, 768, 772, 5, 90, 0, 0, 769, 770, 5, 2, 0, 0, 770, 771, 5, 111, 0, 0, 771, 773, 5, 3, 0, 0, 772, 769, 1, 0, 0, 0, 772, 773, 1, 0, 0, 0, 773, 787, 1, 0, 0, 0, 774, 778, 5, 18, 0, 0, 775, 776, 5, 2, 0, 0, 776, 777, 5, 111, 0, 0, 777, 779, 5, 3, 0, 0, 778, 775, 1, 0, 0, 0, 778, 779, 1, 0, 0, 0, 779, 787, 1, 0, 0, 0, 780, 787, 5, 80, 0, 0, 781, 787, 5, 25, 0, 0, 782, 787, 5, 82, 0, 0, 783, 787, 5, 83, 0, 0, 784, 787, 5, 13, 0, 0, 785, 787, 5, 91, 0, 0, 786, 740, 1, 0, 0, 0, 786, 741, 1, 0, 0, 0, 786, 742, 1, 0, 0, 0, 786, 743, 1, 0, 0, 0, 786, 744, 1, 0, 0, 0, 786, 745, 1, 0, 0, 0, 786, 746, 1, 0, 0, 0, 786, 747, 1, 0, 0, 0, 786, 748, 1, 0, 0, 0, 786, 758, 1, 0, 0, 0, 786, 768, 1, 0, 0, 0, 786, 774, 1, 0, 0, 0, 786, 780, 1, 0, 0, 0, 786, 781, 1, 0, 0, 0, 786, 782, 1, 0, 0, 0, 786, 783, 1, 0, 0, 0, 786, 784, 1, 0, 0, 0, 786, 785, 1, 0, 0, 0, 787, 93, 1, 0, 0, 0, 788, 789, 5, 2, 0, 0, 789, 794, 3, 96, 48, 0, 790, 791, 5, 1, 0, 0, 791, 793, 3, 96, 48, 0, 792, 790, 1, 0, 0, 0, 793, 796, 1, 0, 0, 0, 794, 792, 1, 0, 0, 0, 794, 795, 1, 0, 0, 0, 795, 797, 1, 0, 0, 0, 796, 794, 1, 0, 0, 0, 797, 798, 5, 3, 0, 0, 798, 95, 1, 0, 0, 0, 799, 800, 3, 100, 50, 0, 800, 801, 5, 95, 0, 0, 801, 802, 3, 98, 49, 0, 802, 97, 1, 0, 0, 0, 803, 812, 5, 62, 0, 0, 804, 812, 5, 86, 0, 0, 805, 812, 5, 38, 0, 0, 806, 812, 5, 111, 0, 0, 807, 812, 5, 112, 0, 0, 808, 812, 5, 113, 0, 0, 809, 812, 5, 109, 0, 0, 810, 812, 5, 110, 0, 0, 811, 803, 1, 0, 0, 0, 811, 804, 1, 0, 0, 0, 811, 805, 1, 0, 0, 0, 811, 806, 1, 0, 0, 0, 811, 807, 1, 0, 0, 0, 811, 808, 1, 0, 0, 0, 811, 809, 1, 0, 0, 0, 811, 810, 1, 0, 0, 0, 812, 99, 1, 0, 0, 0, 813, 819, 5, 114, 0, 0, 814, 819, 5, 115, 0, 0, 815, 819, 5, 116, 0, 0, 816, 819, 5, 117, 0, 0, 817, 819, 3, 118, 59, 0, 818, 813, 1, 0, 0, 0, 818, 814, 1, 0, 0, 0, 818, 815, 1, 0, 0, 0, 818, 816, 1, 0, 0, 0, 818, 817, 1, 0, 0, 0, 819, 101, 1, 0, 0, 0, 820, 825, 3, 100, 50, 0, 821, 822, 5, 4, 0, 0, 822, 824, 3, 100, 50, 0, 823, 821, 1, 0, 0, 0, 824, 827, 1, 0, 0, 0, 825, 823, 1, 0, 0, 0, 825, 826, 1, 0, 0, 0, 826, 103, 1, 0, 0, 0, 827, 825, 1, 0, 0, 0, 828, 835, 3, 102, 51, 0, 829, 830, 4, 52, 9, 0, 830, 831, 3, 102, 51, 0, 831, 832, 5, 4, 0, 0, 832, 833, 3, 110, 55, 0, 833, 835, 1, 0, 0, 0, 834, 828, 1, 0, 0, 0, 834, 829, 1, 0, 0, 0, 835, 105, 1, 0, 0, 0, 836, 840, 3, 100, 50, 0, 837, 838, 4, 53, 10, 0, 838, 840, 3, 110, 55, 0, 839, 836, 1, 0, 0, 0, 839, 837, 1, 0, 0, 0, 840, 107, 1, 0, 0, 0, 841, 842, 3, 104, 52, 0, 842, 109, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 111, 1, 0, 0, 0, 845, 846, 3, 102, 51, 0, 846, 113, 1, 0, 0, 0, 847, 848, 3, 102, 51, 0, 848, 115, 1, 0, 0, 0, 849, 850, 3, 102, 51, 0, 850, 117, 1, 0, 0, 0, 851, 852, 7, 7, 0, 0, 852, 119, 1, 0, 0, 0, 101, 123, 132, 141, 144, 150, 157, 162, 175, 183, 188, 198, 202, 209, 213, 216, 219, 222, 225, 228, 234, 237, 246, 254, 269, 273, 277, 281, 285, 288, 292, 295, 302, 308, 313, 320, 327, 336, 341, 345, 351, 357, 367, 380, 384, 394, 401, 410, 416, 420, 426, 430, 434, 440, 450, 462, 480, 492, 497, 503, 511, 518, 537, 543, 553, 561, 563, 568, 574, 583, 589, 597, 605, 611, 615, 620, 625, 633, 644, 646, 653, 660, 663, 671, 675, 684, 688, 706, 729, 753, 756, 763, 766, 772, 778, 786, 794, 811, 818, 825, 834, 839] \ No newline at end of file diff --git a/src/lib/generic/GenericSqlListener.ts b/src/lib/generic/GenericSqlListener.ts index 6082db72..0a94c78b 100644 --- a/src/lib/generic/GenericSqlListener.ts +++ b/src/lib/generic/GenericSqlListener.ts @@ -27,7 +27,10 @@ import { QueryTermContext } from "./GenericSqlParser.js"; import { QueryPrimaryContext } from "./GenericSqlParser.js"; import { QuerySpecificationContext } from "./GenericSqlParser.js"; import { SetQuantifierContext } from "./GenericSqlParser.js"; -import { SelectItemContext } from "./GenericSqlParser.js"; +import { SelectExpressionElementContext } from "./GenericSqlParser.js"; +import { SelectStarElementContext } from "./GenericSqlParser.js"; +import { SelectAllElementContext } from "./GenericSqlParser.js"; +import { SelectEmptyElementContext } from "./GenericSqlParser.js"; import { FromClauseContext } from "./GenericSqlParser.js"; import { SimpleRelationContext } from "./GenericSqlParser.js"; import { JoinRelationContext } from "./GenericSqlParser.js"; @@ -49,6 +52,7 @@ import { DeleteStatementContext } from "./GenericSqlParser.js"; import { CreateTableStatementContext } from "./GenericSqlParser.js"; import { TableElementContext } from "./GenericSqlParser.js"; import { ColumnDefinitionContext } from "./GenericSqlParser.js"; +import { ColumnRefCreateContext } from "./GenericSqlParser.js"; import { TableConstraintContext } from "./GenericSqlParser.js"; import { AlterTableStatementContext } from "./GenericSqlParser.js"; import { DropTableStatementContext } from "./GenericSqlParser.js"; @@ -95,9 +99,13 @@ import { StringLiteralContext } from "./GenericSqlParser.js"; import { BinaryLiteralContext } from "./GenericSqlParser.js"; import { IdentifierContext } from "./GenericSqlParser.js"; import { QualifiedNameContext } from "./GenericSqlParser.js"; +import { QualifiedNameAllowEmptyContext } from "./GenericSqlParser.js"; import { ColumnRefContext } from "./GenericSqlParser.js"; +import { ColumnNameContext } from "./GenericSqlParser.js"; +import { EmptyColumnContext } from "./GenericSqlParser.js"; import { TableNameContext } from "./GenericSqlParser.js"; import { TableNameCreateContext } from "./GenericSqlParser.js"; +import { FunctionNameContext } from "./GenericSqlParser.js"; import { NonReservedContext } from "./GenericSqlParser.js"; @@ -311,15 +319,53 @@ export class GenericSqlListener implements ParseTreeListener { */ exitSetQuantifier?: (ctx: SetQuantifierContext) => void; /** - * Enter a parse tree produced by `GenericSqlParser.selectItem`. + * Enter a parse tree produced by the `selectExpressionElement` + * labeled alternative in `GenericSqlParser.selectItem`. * @param ctx the parse tree */ - enterSelectItem?: (ctx: SelectItemContext) => void; + enterSelectExpressionElement?: (ctx: SelectExpressionElementContext) => void; /** - * Exit a parse tree produced by `GenericSqlParser.selectItem`. + * Exit a parse tree produced by the `selectExpressionElement` + * labeled alternative in `GenericSqlParser.selectItem`. * @param ctx the parse tree */ - exitSelectItem?: (ctx: SelectItemContext) => void; + exitSelectExpressionElement?: (ctx: SelectExpressionElementContext) => void; + /** + * Enter a parse tree produced by the `selectStarElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + */ + enterSelectStarElement?: (ctx: SelectStarElementContext) => void; + /** + * Exit a parse tree produced by the `selectStarElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + */ + exitSelectStarElement?: (ctx: SelectStarElementContext) => void; + /** + * Enter a parse tree produced by the `selectAllElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + */ + enterSelectAllElement?: (ctx: SelectAllElementContext) => void; + /** + * Exit a parse tree produced by the `selectAllElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + */ + exitSelectAllElement?: (ctx: SelectAllElementContext) => void; + /** + * Enter a parse tree produced by the `selectEmptyElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + */ + enterSelectEmptyElement?: (ctx: SelectEmptyElementContext) => void; + /** + * Exit a parse tree produced by the `selectEmptyElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + */ + exitSelectEmptyElement?: (ctx: SelectEmptyElementContext) => void; /** * Enter a parse tree produced by `GenericSqlParser.fromClause`. * @param ctx the parse tree @@ -538,6 +584,16 @@ export class GenericSqlListener implements ParseTreeListener { * @param ctx the parse tree */ exitColumnDefinition?: (ctx: ColumnDefinitionContext) => void; + /** + * Enter a parse tree produced by `GenericSqlParser.columnRefCreate`. + * @param ctx the parse tree + */ + enterColumnRefCreate?: (ctx: ColumnRefCreateContext) => void; + /** + * Exit a parse tree produced by `GenericSqlParser.columnRefCreate`. + * @param ctx the parse tree + */ + exitColumnRefCreate?: (ctx: ColumnRefCreateContext) => void; /** * Enter a parse tree produced by `GenericSqlParser.tableConstraint`. * @param ctx the parse tree @@ -1064,6 +1120,16 @@ export class GenericSqlListener implements ParseTreeListener { * @param ctx the parse tree */ exitQualifiedName?: (ctx: QualifiedNameContext) => void; + /** + * Enter a parse tree produced by `GenericSqlParser.qualifiedNameAllowEmpty`. + * @param ctx the parse tree + */ + enterQualifiedNameAllowEmpty?: (ctx: QualifiedNameAllowEmptyContext) => void; + /** + * Exit a parse tree produced by `GenericSqlParser.qualifiedNameAllowEmpty`. + * @param ctx the parse tree + */ + exitQualifiedNameAllowEmpty?: (ctx: QualifiedNameAllowEmptyContext) => void; /** * Enter a parse tree produced by `GenericSqlParser.columnRef`. * @param ctx the parse tree @@ -1074,6 +1140,26 @@ export class GenericSqlListener implements ParseTreeListener { * @param ctx the parse tree */ exitColumnRef?: (ctx: ColumnRefContext) => void; + /** + * Enter a parse tree produced by `GenericSqlParser.columnName`. + * @param ctx the parse tree + */ + enterColumnName?: (ctx: ColumnNameContext) => void; + /** + * Exit a parse tree produced by `GenericSqlParser.columnName`. + * @param ctx the parse tree + */ + exitColumnName?: (ctx: ColumnNameContext) => void; + /** + * Enter a parse tree produced by `GenericSqlParser.emptyColumn`. + * @param ctx the parse tree + */ + enterEmptyColumn?: (ctx: EmptyColumnContext) => void; + /** + * Exit a parse tree produced by `GenericSqlParser.emptyColumn`. + * @param ctx the parse tree + */ + exitEmptyColumn?: (ctx: EmptyColumnContext) => void; /** * Enter a parse tree produced by `GenericSqlParser.tableName`. * @param ctx the parse tree @@ -1094,6 +1180,16 @@ export class GenericSqlListener implements ParseTreeListener { * @param ctx the parse tree */ exitTableNameCreate?: (ctx: TableNameCreateContext) => void; + /** + * Enter a parse tree produced by `GenericSqlParser.functionName`. + * @param ctx the parse tree + */ + enterFunctionName?: (ctx: FunctionNameContext) => void; + /** + * Exit a parse tree produced by `GenericSqlParser.functionName`. + * @param ctx the parse tree + */ + exitFunctionName?: (ctx: FunctionNameContext) => void; /** * Enter a parse tree produced by `GenericSqlParser.nonReserved`. * @param ctx the parse tree diff --git a/src/lib/generic/GenericSqlParser.ts b/src/lib/generic/GenericSqlParser.ts index 4274b4cd..134a8c17 100644 --- a/src/lib/generic/GenericSqlParser.ts +++ b/src/lib/generic/GenericSqlParser.ts @@ -172,28 +172,33 @@ export class GenericSqlParser extends SQLParserBase { public static readonly RULE_createTableStatement = 30; public static readonly RULE_tableElement = 31; public static readonly RULE_columnDefinition = 32; - public static readonly RULE_tableConstraint = 33; - public static readonly RULE_alterTableStatement = 34; - public static readonly RULE_dropTableStatement = 35; - public static readonly RULE_expression = 36; - public static readonly RULE_booleanExpression = 37; - public static readonly RULE_predicatedExpression = 38; - public static readonly RULE_predicate = 39; - public static readonly RULE_comparisonOperator = 40; - public static readonly RULE_valueExpression = 41; - public static readonly RULE_primaryExpression = 42; - public static readonly RULE_whenClause = 43; - public static readonly RULE_subqueryExpression = 44; - public static readonly RULE_dataType = 45; - public static readonly RULE_properties = 46; - public static readonly RULE_property = 47; - public static readonly RULE_literal = 48; - public static readonly RULE_identifier = 49; - public static readonly RULE_qualifiedName = 50; - public static readonly RULE_columnRef = 51; - public static readonly RULE_tableName = 52; - public static readonly RULE_tableNameCreate = 53; - public static readonly RULE_nonReserved = 54; + public static readonly RULE_columnRefCreate = 33; + public static readonly RULE_tableConstraint = 34; + public static readonly RULE_alterTableStatement = 35; + public static readonly RULE_dropTableStatement = 36; + public static readonly RULE_expression = 37; + public static readonly RULE_booleanExpression = 38; + public static readonly RULE_predicatedExpression = 39; + public static readonly RULE_predicate = 40; + public static readonly RULE_comparisonOperator = 41; + public static readonly RULE_valueExpression = 42; + public static readonly RULE_primaryExpression = 43; + public static readonly RULE_whenClause = 44; + public static readonly RULE_subqueryExpression = 45; + public static readonly RULE_dataType = 46; + public static readonly RULE_properties = 47; + public static readonly RULE_property = 48; + public static readonly RULE_literal = 49; + public static readonly RULE_identifier = 50; + public static readonly RULE_qualifiedName = 51; + public static readonly RULE_qualifiedNameAllowEmpty = 52; + public static readonly RULE_columnRef = 53; + public static readonly RULE_columnName = 54; + public static readonly RULE_emptyColumn = 55; + public static readonly RULE_tableName = 56; + public static readonly RULE_tableNameCreate = 57; + public static readonly RULE_functionName = 58; + public static readonly RULE_nonReserved = 59; public static readonly literalNames = [ null, "','", "'('", "')'", "'.'", "'ADD'", "'ALL'", "'ALTER'", "'AND'", @@ -247,12 +252,13 @@ export class GenericSqlParser extends SQLParserBase { "whereClause", "groupByClause", "havingClause", "orderByClause", "sortItem", "limitClause", "insertStatement", "columnList", "updateStatement", "updateAssignment", "deleteStatement", "createTableStatement", "tableElement", - "columnDefinition", "tableConstraint", "alterTableStatement", "dropTableStatement", - "expression", "booleanExpression", "predicatedExpression", "predicate", - "comparisonOperator", "valueExpression", "primaryExpression", "whenClause", - "subqueryExpression", "dataType", "properties", "property", "literal", - "identifier", "qualifiedName", "columnRef", "tableName", "tableNameCreate", - "nonReserved", + "columnDefinition", "columnRefCreate", "tableConstraint", "alterTableStatement", + "dropTableStatement", "expression", "booleanExpression", "predicatedExpression", + "predicate", "comparisonOperator", "valueExpression", "primaryExpression", + "whenClause", "subqueryExpression", "dataType", "properties", "property", + "literal", "identifier", "qualifiedName", "qualifiedNameAllowEmpty", + "columnRef", "columnName", "emptyColumn", "tableName", "tableNameCreate", + "functionName", "nonReserved", ]; public get grammarFileName(): string { return "GenericSql.g4"; } @@ -276,21 +282,21 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 113; + this.state = 123; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 276824196) !== 0) || _la === 32 || _la === 49 || ((((_la - 76)) & ~0x1F) === 0 && ((1 << (_la - 76)) & 270337) !== 0)) { { { - this.state = 110; + this.state = 120; this.statements(); } } - this.state = 115; + this.state = 125; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 116; + this.state = 126; this.match(GenericSqlParser.EOF); } } @@ -314,7 +320,7 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 118; + this.state = 128; this.singleStatement(); } } @@ -339,14 +345,14 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 120; + this.state = 130; this.statement(); - this.state = 122; + this.state = 132; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 108) { { - this.state = 121; + this.state = 131; this.match(GenericSqlParser.SEMICOLON); } } @@ -371,7 +377,7 @@ export class GenericSqlParser extends SQLParserBase { let localContext = new StatementContext(this.context, this.state); this.enterRule(localContext, 6, GenericSqlParser.RULE_statement); try { - this.state = 131; + this.state = 141; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case GenericSqlParser.T__1: @@ -380,7 +386,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new StatementDefaultContext(localContext); this.enterOuterAlt(localContext, 1); { - this.state = 124; + this.state = 134; this.queryStatement(); } break; @@ -388,7 +394,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new InsertContext(localContext); this.enterOuterAlt(localContext, 2); { - this.state = 125; + this.state = 135; this.insertStatement(); } break; @@ -396,7 +402,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new UpdateContext(localContext); this.enterOuterAlt(localContext, 3); { - this.state = 126; + this.state = 136; this.updateStatement(); } break; @@ -404,7 +410,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new DeleteContext(localContext); this.enterOuterAlt(localContext, 4); { - this.state = 127; + this.state = 137; this.deleteStatement(); } break; @@ -412,7 +418,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new CreateTableContext(localContext); this.enterOuterAlt(localContext, 5); { - this.state = 128; + this.state = 138; this.createTableStatement(); } break; @@ -420,7 +426,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new AlterTableContext(localContext); this.enterOuterAlt(localContext, 6); { - this.state = 129; + this.state = 139; this.alterTableStatement(); } break; @@ -428,7 +434,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new DropTableContext(localContext); this.enterOuterAlt(localContext, 7); { - this.state = 130; + this.state = 140; this.dropTableStatement(); } break; @@ -457,17 +463,17 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 134; + this.state = 144; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 94) { { - this.state = 133; + this.state = 143; this.withClause(); } } - this.state = 136; + this.state = 146; this.queryNoWith(); } } @@ -492,33 +498,33 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 138; + this.state = 148; this.match(GenericSqlParser.KW_WITH); - this.state = 140; + this.state = 150; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 72) { { - this.state = 139; + this.state = 149; this.match(GenericSqlParser.KW_RECURSIVE); } } - this.state = 142; + this.state = 152; this.namedQuery(); - this.state = 147; + this.state = 157; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 143; + this.state = 153; this.match(GenericSqlParser.T__0); - this.state = 144; + this.state = 154; this.namedQuery(); } } - this.state = 149; + this.state = 159; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -545,25 +551,25 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 150; + this.state = 160; localContext._name = this.identifier(); - this.state = 152; + this.state = 162; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 2) { { - this.state = 151; + this.state = 161; this.cteColumnList(); } } - this.state = 154; + this.state = 164; this.match(GenericSqlParser.KW_AS); - this.state = 155; + this.state = 165; this.match(GenericSqlParser.T__1); - this.state = 156; + this.state = 166; this.queryStatement(); - this.state = 157; + this.state = 167; this.match(GenericSqlParser.T__2); } } @@ -588,27 +594,27 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 159; + this.state = 169; this.match(GenericSqlParser.T__1); - this.state = 160; + this.state = 170; this.identifier(); - this.state = 165; + this.state = 175; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 161; + this.state = 171; this.match(GenericSqlParser.T__0); - this.state = 162; + this.state = 172; this.identifier(); } } - this.state = 167; + this.state = 177; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 168; + this.state = 178; this.match(GenericSqlParser.T__2); } } @@ -633,15 +639,15 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 170; + this.state = 180; this.queryTerm(); - this.state = 178; + this.state = 188; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 36 || _la === 52 || _la === 87) { { { - this.state = 171; + this.state = 181; _la = this.tokenStream.LA(1); if(!(_la === 36 || _la === 52 || _la === 87)) { this.errorHandler.recoverInline(this); @@ -650,21 +656,21 @@ export class GenericSqlParser extends SQLParserBase { this.errorHandler.reportMatch(this); this.consume(); } - this.state = 173; + this.state = 183; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 6) { { - this.state = 172; + this.state = 182; this.match(GenericSqlParser.KW_ALL); } } - this.state = 175; + this.state = 185; this.queryTerm(); } } - this.state = 180; + this.state = 190; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -690,7 +696,7 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 181; + this.state = 191; this.queryPrimary(); } } @@ -712,24 +718,24 @@ export class GenericSqlParser extends SQLParserBase { let localContext = new QueryPrimaryContext(this.context, this.state); this.enterRule(localContext, 20, GenericSqlParser.RULE_queryPrimary); try { - this.state = 188; + this.state = 198; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case GenericSqlParser.KW_SELECT: this.enterOuterAlt(localContext, 1); { - this.state = 183; + this.state = 193; this.querySpecification(); } break; case GenericSqlParser.T__1: this.enterOuterAlt(localContext, 2); { - this.state = 184; + this.state = 194; this.match(GenericSqlParser.T__1); - this.state = 185; + this.state = 195; this.queryStatement(); - this.state = 186; + this.state = 196; this.match(GenericSqlParser.T__2); } break; @@ -758,92 +764,92 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 190; + this.state = 200; this.match(GenericSqlParser.KW_SELECT); - this.state = 192; + this.state = 202; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 11, this.context) ) { case 1: { - this.state = 191; + this.state = 201; this.setQuantifier(); } break; } - this.state = 194; + this.state = 204; this.selectItem(); - this.state = 199; + this.state = 209; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 195; + this.state = 205; this.match(GenericSqlParser.T__0); - this.state = 196; + this.state = 206; this.selectItem(); } } - this.state = 201; + this.state = 211; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 203; + this.state = 213; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 42) { { - this.state = 202; + this.state = 212; this.fromClause(); } } - this.state = 206; + this.state = 216; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 93) { { - this.state = 205; + this.state = 215; this.whereClause(); } } - this.state = 209; + this.state = 219; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 44) { { - this.state = 208; + this.state = 218; this.groupByClause(); } } - this.state = 212; + this.state = 222; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 45) { { - this.state = 211; + this.state = 221; this.havingClause(); } } - this.state = 215; + this.state = 225; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 69) { { - this.state = 214; + this.state = 224; this.orderByClause(); } } - this.state = 218; + this.state = 228; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 60) { { - this.state = 217; + this.state = 227; this.limitClause(); } } @@ -871,7 +877,7 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 220; + this.state = 230; _la = this.tokenStream.LA(1); if(!(_la === 6 || _la === 30)) { this.errorHandler.recoverInline(this); @@ -901,54 +907,69 @@ export class GenericSqlParser extends SQLParserBase { this.enterRule(localContext, 26, GenericSqlParser.RULE_selectItem); let _la: number; try { - this.state = 234; + this.state = 246; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 21, this.context) ) { case 1: + localContext = new SelectExpressionElementContext(localContext); this.enterOuterAlt(localContext, 1); { - this.state = 222; + this.state = 232; this.expression(); - this.state = 227; + this.state = 237; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 20, this.context) ) { case 1: { - this.state = 224; + this.state = 234; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 9) { { - this.state = 223; + this.state = 233; this.match(GenericSqlParser.KW_AS); } } - this.state = 226; - localContext._alias = this.identifier(); + this.state = 236; + (localContext as SelectExpressionElementContext)._alias = this.identifier(); } break; } } break; case 2: + localContext = new SelectStarElementContext(localContext); this.enterOuterAlt(localContext, 2); { - this.state = 229; + this.state = 239; this.qualifiedName(); - this.state = 230; + this.state = 240; this.match(GenericSqlParser.T__3); - this.state = 231; + this.state = 241; this.match(GenericSqlParser.ASTERISK); } break; case 3: + localContext = new SelectAllElementContext(localContext); this.enterOuterAlt(localContext, 3); { - this.state = 233; + this.state = 243; this.match(GenericSqlParser.ASTERISK); } break; + case 4: + localContext = new SelectEmptyElementContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 244; + if (!(this.shouldMatchEmpty())) { + throw this.createFailedPredicateException("this.shouldMatchEmpty()"); + } + this.state = 245; + this.emptyColumn(); + } + break; } } catch (re) { @@ -972,23 +993,23 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 236; + this.state = 248; this.match(GenericSqlParser.KW_FROM); - this.state = 237; + this.state = 249; this.relation(0); - this.state = 242; + this.state = 254; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 238; + this.state = 250; this.match(GenericSqlParser.T__0); - this.state = 239; + this.state = 251; this.relation(0); } } - this.state = 244; + this.state = 256; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -1031,11 +1052,11 @@ export class GenericSqlParser extends SQLParserBase { this.context = localContext; previousContext = localContext; - this.state = 246; + this.state = 258; this.aliasedRelation(); } this.context!.stop = this.tokenStream.LT(-1); - this.state = 257; + this.state = 269; this.errorHandler.sync(this); alternative = this.interpreter.adaptivePredict(this.tokenStream, 23, this.context); while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { @@ -1049,24 +1070,24 @@ export class GenericSqlParser extends SQLParserBase { localContext = new JoinRelationContext(new RelationContext(parentContext, parentState)); (localContext as JoinRelationContext)._left = previousContext; this.pushNewRecursionContext(localContext, _startState, GenericSqlParser.RULE_relation); - this.state = 248; + this.state = 260; if (!(this.precpred(this.context, 2))) { throw this.createFailedPredicateException("this.precpred(this.context, 2)"); } - this.state = 249; + this.state = 261; this.joinType(); - this.state = 250; + this.state = 262; this.match(GenericSqlParser.KW_JOIN); - this.state = 251; + this.state = 263; (localContext as JoinRelationContext)._right = this.relation(0); - this.state = 252; + this.state = 264; this.match(GenericSqlParser.KW_ON); - this.state = 253; + this.state = 265; (localContext as JoinRelationContext)._condition = this.expression(); } } } - this.state = 259; + this.state = 271; this.errorHandler.sync(this); alternative = this.interpreter.adaptivePredict(this.tokenStream, 23, this.context); } @@ -1091,19 +1112,19 @@ export class GenericSqlParser extends SQLParserBase { this.enterRule(localContext, 32, GenericSqlParser.RULE_joinType); let _la: number; try { - this.state = 276; + this.state = 288; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case GenericSqlParser.KW_INNER: case GenericSqlParser.KW_JOIN: this.enterOuterAlt(localContext, 1); { - this.state = 261; + this.state = 273; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 48) { { - this.state = 260; + this.state = 272; this.match(GenericSqlParser.KW_INNER); } } @@ -1113,14 +1134,14 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_LEFT: this.enterOuterAlt(localContext, 2); { - this.state = 263; + this.state = 275; this.match(GenericSqlParser.KW_LEFT); - this.state = 265; + this.state = 277; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 70) { { - this.state = 264; + this.state = 276; this.match(GenericSqlParser.KW_OUTER); } } @@ -1130,14 +1151,14 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_RIGHT: this.enterOuterAlt(localContext, 3); { - this.state = 267; + this.state = 279; this.match(GenericSqlParser.KW_RIGHT); - this.state = 269; + this.state = 281; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 70) { { - this.state = 268; + this.state = 280; this.match(GenericSqlParser.KW_OUTER); } } @@ -1147,14 +1168,14 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_FULL: this.enterOuterAlt(localContext, 4); { - this.state = 271; + this.state = 283; this.match(GenericSqlParser.KW_FULL); - this.state = 273; + this.state = 285; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 70) { { - this.state = 272; + this.state = 284; this.match(GenericSqlParser.KW_OUTER); } } @@ -1164,7 +1185,7 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_CROSS: this.enterOuterAlt(localContext, 5); { - this.state = 275; + this.state = 287; this.match(GenericSqlParser.KW_CROSS); } break; @@ -1193,24 +1214,24 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 278; + this.state = 290; this.relationPrimary(); - this.state = 283; + this.state = 295; this.errorHandler.sync(this); switch (this.interpreter.adaptivePredict(this.tokenStream, 30, this.context) ) { case 1: { - this.state = 280; + this.state = 292; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 9) { { - this.state = 279; + this.state = 291; this.match(GenericSqlParser.KW_AS); } } - this.state = 282; + this.state = 294; localContext._alias = this.identifier(); } break; @@ -1235,7 +1256,7 @@ export class GenericSqlParser extends SQLParserBase { let localContext = new RelationPrimaryContext(this.context, this.state); this.enterRule(localContext, 36, GenericSqlParser.RULE_relationPrimary); try { - this.state = 290; + this.state = 302; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case GenericSqlParser.KW_ADD: @@ -1288,7 +1309,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new TableNameRelationContext(localContext); this.enterOuterAlt(localContext, 1); { - this.state = 285; + this.state = 297; this.tableName(); } break; @@ -1296,11 +1317,11 @@ export class GenericSqlParser extends SQLParserBase { localContext = new SubqueryRelationContext(localContext); this.enterOuterAlt(localContext, 2); { - this.state = 286; + this.state = 298; this.match(GenericSqlParser.T__1); - this.state = 287; + this.state = 299; this.queryStatement(); - this.state = 288; + this.state = 300; this.match(GenericSqlParser.T__2); } break; @@ -1328,10 +1349,28 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 292; + this.state = 304; this.match(GenericSqlParser.KW_WHERE); - this.state = 293; - this.expression(); + this.state = 308; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 32, this.context) ) { + case 1: + { + this.state = 305; + this.expression(); + } + break; + case 2: + { + this.state = 306; + if (!(this.shouldMatchEmpty())) { + throw this.createFailedPredicateException("this.shouldMatchEmpty()"); + } + this.state = 307; + this.emptyColumn(); + } + break; + } } } catch (re) { @@ -1355,35 +1394,35 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 295; + this.state = 310; this.match(GenericSqlParser.KW_GROUP); - this.state = 296; + this.state = 311; this.match(GenericSqlParser.KW_BY); - this.state = 298; + this.state = 313; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 32, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 33, this.context) ) { case 1: { - this.state = 297; + this.state = 312; this.setQuantifier(); } break; } - this.state = 300; + this.state = 315; this.expression(); - this.state = 305; + this.state = 320; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 301; + this.state = 316; this.match(GenericSqlParser.T__0); - this.state = 302; + this.state = 317; this.expression(); } } - this.state = 307; + this.state = 322; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -1409,10 +1448,28 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 308; + this.state = 323; this.match(GenericSqlParser.KW_HAVING); - this.state = 309; - this.expression(); + this.state = 327; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 35, this.context) ) { + case 1: + { + this.state = 324; + this.expression(); + } + break; + case 2: + { + this.state = 325; + if (!(this.shouldMatchEmpty())) { + throw this.createFailedPredicateException("this.shouldMatchEmpty()"); + } + this.state = 326; + this.emptyColumn(); + } + break; + } } } catch (re) { @@ -1436,25 +1493,25 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 311; + this.state = 329; this.match(GenericSqlParser.KW_ORDER); - this.state = 312; + this.state = 330; this.match(GenericSqlParser.KW_BY); - this.state = 313; + this.state = 331; this.sortItem(); - this.state = 318; + this.state = 336; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 314; + this.state = 332; this.match(GenericSqlParser.T__0); - this.state = 315; + this.state = 333; this.sortItem(); } } - this.state = 320; + this.state = 338; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } @@ -1481,14 +1538,14 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 321; + this.state = 339; this.expression(); - this.state = 323; + this.state = 341; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 10 || _la === 29) { { - this.state = 322; + this.state = 340; localContext._ordering = this.tokenStream.LT(1); _la = this.tokenStream.LA(1); if(!(_la === 10 || _la === 29)) { @@ -1501,14 +1558,14 @@ export class GenericSqlParser extends SQLParserBase { } } - this.state = 327; + this.state = 345; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 64) { { - this.state = 325; + this.state = 343; this.match(GenericSqlParser.KW_NULLS); - this.state = 326; + this.state = 344; localContext._nullOrdering = this.tokenStream.LT(1); _la = this.tokenStream.LA(1); if(!(_la === 39 || _la === 57)) { @@ -1544,18 +1601,18 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 329; + this.state = 347; this.match(GenericSqlParser.KW_LIMIT); - this.state = 330; + this.state = 348; localContext._limit = this.expression(); - this.state = 333; + this.state = 351; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 66) { { - this.state = 331; + this.state = 349; this.match(GenericSqlParser.KW_OFFSET); - this.state = 332; + this.state = 350; localContext._offset = this.expression(); } } @@ -1582,23 +1639,23 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 335; + this.state = 353; this.match(GenericSqlParser.KW_INSERT); - this.state = 336; + this.state = 354; this.match(GenericSqlParser.KW_INTO); - this.state = 337; + this.state = 355; this.tableName(); - this.state = 339; + this.state = 357; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 38, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 40, this.context) ) { case 1: { - this.state = 338; + this.state = 356; this.columnList(); } break; } - this.state = 341; + this.state = 359; this.queryStatement(); } } @@ -1623,27 +1680,27 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 343; + this.state = 361; this.match(GenericSqlParser.T__1); - this.state = 344; + this.state = 362; this.columnRef(); - this.state = 349; + this.state = 367; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 345; + this.state = 363; this.match(GenericSqlParser.T__0); - this.state = 346; + this.state = 364; this.columnRef(); } } - this.state = 351; + this.state = 369; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 352; + this.state = 370; this.match(GenericSqlParser.T__2); } } @@ -1668,36 +1725,36 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 354; + this.state = 372; this.match(GenericSqlParser.KW_UPDATE); - this.state = 355; + this.state = 373; this.tableName(); - this.state = 356; + this.state = 374; this.match(GenericSqlParser.KW_SET); - this.state = 357; + this.state = 375; this.updateAssignment(); - this.state = 362; + this.state = 380; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 358; + this.state = 376; this.match(GenericSqlParser.T__0); - this.state = 359; + this.state = 377; this.updateAssignment(); } } - this.state = 364; + this.state = 382; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 366; + this.state = 384; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 93) { { - this.state = 365; + this.state = 383; this.whereClause(); } } @@ -1724,11 +1781,11 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 368; + this.state = 386; this.columnRef(); - this.state = 369; + this.state = 387; this.match(GenericSqlParser.EQ); - this.state = 370; + this.state = 388; this.expression(); } } @@ -1753,18 +1810,18 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 372; + this.state = 390; this.match(GenericSqlParser.KW_DELETE); - this.state = 373; + this.state = 391; this.match(GenericSqlParser.KW_FROM); - this.state = 374; + this.state = 392; this.tableName(); - this.state = 376; + this.state = 394; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 93) { { - this.state = 375; + this.state = 393; this.whereClause(); } } @@ -1792,56 +1849,56 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 378; + this.state = 396; this.match(GenericSqlParser.KW_CREATE); - this.state = 379; + this.state = 397; this.match(GenericSqlParser.KW_TABLE); - this.state = 383; + this.state = 401; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 43, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 45, this.context) ) { case 1: { - this.state = 380; + this.state = 398; this.match(GenericSqlParser.KW_IF); - this.state = 381; + this.state = 399; this.match(GenericSqlParser.KW_NOT); - this.state = 382; + this.state = 400; this.match(GenericSqlParser.KW_EXISTS); } break; } - this.state = 385; + this.state = 403; this.tableNameCreate(); - this.state = 386; + this.state = 404; this.match(GenericSqlParser.T__1); - this.state = 387; + this.state = 405; this.tableElement(); - this.state = 392; + this.state = 410; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 388; + this.state = 406; this.match(GenericSqlParser.T__0); - this.state = 389; + this.state = 407; this.tableElement(); } } - this.state = 394; + this.state = 412; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 395; + this.state = 413; this.match(GenericSqlParser.T__2); - this.state = 398; + this.state = 416; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 45, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 47, this.context) ) { case 1: { - this.state = 396; + this.state = 414; this.match(GenericSqlParser.KW_WITH); - this.state = 397; + this.state = 415; this.properties(); } break; @@ -1866,20 +1923,20 @@ export class GenericSqlParser extends SQLParserBase { let localContext = new TableElementContext(this.context, this.state); this.enterRule(localContext, 62, GenericSqlParser.RULE_tableElement); try { - this.state = 402; + this.state = 420; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 46, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 48, this.context) ) { case 1: this.enterOuterAlt(localContext, 1); { - this.state = 400; + this.state = 418; this.columnDefinition(); } break; case 2: this.enterOuterAlt(localContext, 2); { - this.state = 401; + this.state = 419; this.tableConstraint(); } break; @@ -1906,42 +1963,42 @@ export class GenericSqlParser extends SQLParserBase { try { this.enterOuterAlt(localContext, 1); { - this.state = 404; - this.columnRef(); - this.state = 405; - this.dataType(); - this.state = 408; + this.state = 422; + this.columnRefCreate(); + this.state = 423; + localContext._colType = this.dataType(); + this.state = 426; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 61) { { - this.state = 406; + this.state = 424; this.match(GenericSqlParser.KW_NOT); - this.state = 407; + this.state = 425; this.match(GenericSqlParser.KW_NULL); } } - this.state = 412; + this.state = 430; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 27) { { - this.state = 410; + this.state = 428; this.match(GenericSqlParser.KW_DEFAULT); - this.state = 411; + this.state = 429; this.expression(); } } - this.state = 416; + this.state = 434; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 71) { { - this.state = 414; + this.state = 432; this.match(GenericSqlParser.KW_PRIMARY); - this.state = 415; + this.state = 433; this.match(GenericSqlParser.KW_KEY); } } @@ -1962,151 +2019,175 @@ export class GenericSqlParser extends SQLParserBase { } return localContext; } + public columnRefCreate(): ColumnRefCreateContext { + let localContext = new ColumnRefCreateContext(this.context, this.state); + this.enterRule(localContext, 66, GenericSqlParser.RULE_columnRefCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 436; + this.identifier(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } public tableConstraint(): TableConstraintContext { let localContext = new TableConstraintContext(this.context, this.state); - this.enterRule(localContext, 66, GenericSqlParser.RULE_tableConstraint); + this.enterRule(localContext, 68, GenericSqlParser.RULE_tableConstraint); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 420; + this.state = 440; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 22) { { - this.state = 418; + this.state = 438; this.match(GenericSqlParser.KW_CONSTRAINT); - this.state = 419; + this.state = 439; this.identifier(); } } - this.state = 477; + this.state = 497; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case GenericSqlParser.KW_PRIMARY: { - this.state = 422; + this.state = 442; this.match(GenericSqlParser.KW_PRIMARY); - this.state = 423; + this.state = 443; this.match(GenericSqlParser.KW_KEY); - this.state = 424; + this.state = 444; this.match(GenericSqlParser.T__1); - this.state = 425; + this.state = 445; this.columnRef(); - this.state = 430; + this.state = 450; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 426; + this.state = 446; this.match(GenericSqlParser.T__0); - this.state = 427; + this.state = 447; this.columnRef(); } } - this.state = 432; + this.state = 452; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 433; + this.state = 453; this.match(GenericSqlParser.T__2); } break; case GenericSqlParser.KW_UNIQUE: { - this.state = 435; + this.state = 455; this.match(GenericSqlParser.KW_UNIQUE); - this.state = 436; + this.state = 456; this.match(GenericSqlParser.T__1); - this.state = 437; + this.state = 457; this.columnRef(); - this.state = 442; + this.state = 462; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 438; + this.state = 458; this.match(GenericSqlParser.T__0); - this.state = 439; + this.state = 459; this.columnRef(); } } - this.state = 444; + this.state = 464; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 445; + this.state = 465; this.match(GenericSqlParser.T__2); } break; case GenericSqlParser.KW_CHECK: { - this.state = 447; + this.state = 467; this.match(GenericSqlParser.KW_CHECK); - this.state = 448; + this.state = 468; this.match(GenericSqlParser.T__1); - this.state = 449; + this.state = 469; this.expression(); - this.state = 450; + this.state = 470; this.match(GenericSqlParser.T__2); } break; case GenericSqlParser.KW_FOREIGN: { - this.state = 452; + this.state = 472; this.match(GenericSqlParser.KW_FOREIGN); - this.state = 453; + this.state = 473; this.match(GenericSqlParser.KW_KEY); - this.state = 454; + this.state = 474; this.match(GenericSqlParser.T__1); - this.state = 455; + this.state = 475; this.columnRef(); - this.state = 460; + this.state = 480; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 456; + this.state = 476; this.match(GenericSqlParser.T__0); - this.state = 457; + this.state = 477; this.columnRef(); } } - this.state = 462; + this.state = 482; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 463; + this.state = 483; this.match(GenericSqlParser.T__2); - this.state = 464; + this.state = 484; this.match(GenericSqlParser.KW_REFERENCES); - this.state = 465; + this.state = 485; this.tableName(); - this.state = 466; + this.state = 486; this.match(GenericSqlParser.T__1); - this.state = 467; + this.state = 487; this.columnRef(); - this.state = 472; + this.state = 492; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 468; + this.state = 488; this.match(GenericSqlParser.T__0); - this.state = 469; + this.state = 489; this.columnRef(); } } - this.state = 474; + this.state = 494; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 475; + this.state = 495; this.match(GenericSqlParser.T__2); } break; @@ -2131,114 +2212,114 @@ export class GenericSqlParser extends SQLParserBase { } public alterTableStatement(): AlterTableStatementContext { let localContext = new AlterTableStatementContext(this.context, this.state); - this.enterRule(localContext, 68, GenericSqlParser.RULE_alterTableStatement); + this.enterRule(localContext, 70, GenericSqlParser.RULE_alterTableStatement); try { this.enterOuterAlt(localContext, 1); { - this.state = 479; + this.state = 499; this.match(GenericSqlParser.KW_ALTER); - this.state = 480; + this.state = 500; this.match(GenericSqlParser.KW_TABLE); - this.state = 483; + this.state = 503; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 56, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 58, this.context) ) { case 1: { - this.state = 481; + this.state = 501; this.match(GenericSqlParser.KW_IF); - this.state = 482; + this.state = 502; this.match(GenericSqlParser.KW_EXISTS); } break; } - this.state = 485; + this.state = 505; this.tableName(); - this.state = 517; + this.state = 537; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 59, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 61, this.context) ) { case 1: { - this.state = 486; + this.state = 506; this.match(GenericSqlParser.KW_ADD); - this.state = 487; + this.state = 507; this.match(GenericSqlParser.KW_COLUMN); - this.state = 491; + this.state = 511; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 57, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 59, this.context) ) { case 1: { - this.state = 488; + this.state = 508; this.match(GenericSqlParser.KW_IF); - this.state = 489; + this.state = 509; this.match(GenericSqlParser.KW_NOT); - this.state = 490; + this.state = 510; this.match(GenericSqlParser.KW_EXISTS); } break; } - this.state = 493; + this.state = 513; this.columnDefinition(); } break; case 2: { - this.state = 494; + this.state = 514; this.match(GenericSqlParser.KW_DROP); - this.state = 495; + this.state = 515; this.match(GenericSqlParser.KW_COLUMN); - this.state = 498; + this.state = 518; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 58, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 60, this.context) ) { case 1: { - this.state = 496; + this.state = 516; this.match(GenericSqlParser.KW_IF); - this.state = 497; + this.state = 517; this.match(GenericSqlParser.KW_EXISTS); } break; } - this.state = 500; + this.state = 520; this.columnRef(); } break; case 3: { - this.state = 501; + this.state = 521; this.match(GenericSqlParser.KW_RENAME); - this.state = 502; + this.state = 522; this.match(GenericSqlParser.KW_TO); - this.state = 503; + this.state = 523; this.tableNameCreate(); } break; case 4: { - this.state = 504; + this.state = 524; this.match(GenericSqlParser.KW_ALTER); - this.state = 505; + this.state = 525; this.match(GenericSqlParser.KW_COLUMN); - this.state = 506; + this.state = 526; this.columnRef(); - this.state = 507; + this.state = 527; this.match(GenericSqlParser.KW_SET); - this.state = 508; + this.state = 528; this.match(GenericSqlParser.KW_DEFAULT); - this.state = 509; + this.state = 529; this.expression(); } break; case 5: { - this.state = 511; + this.state = 531; this.match(GenericSqlParser.KW_ALTER); - this.state = 512; + this.state = 532; this.match(GenericSqlParser.KW_COLUMN); - this.state = 513; + this.state = 533; this.columnRef(); - this.state = 514; + this.state = 534; this.match(GenericSqlParser.KW_DROP); - this.state = 515; + this.state = 535; this.match(GenericSqlParser.KW_DEFAULT); } break; @@ -2261,27 +2342,27 @@ export class GenericSqlParser extends SQLParserBase { } public dropTableStatement(): DropTableStatementContext { let localContext = new DropTableStatementContext(this.context, this.state); - this.enterRule(localContext, 70, GenericSqlParser.RULE_dropTableStatement); + this.enterRule(localContext, 72, GenericSqlParser.RULE_dropTableStatement); try { this.enterOuterAlt(localContext, 1); { - this.state = 519; + this.state = 539; this.match(GenericSqlParser.KW_DROP); - this.state = 520; + this.state = 540; this.match(GenericSqlParser.KW_TABLE); - this.state = 523; + this.state = 543; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 60, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 62, this.context) ) { case 1: { - this.state = 521; + this.state = 541; this.match(GenericSqlParser.KW_IF); - this.state = 522; + this.state = 542; this.match(GenericSqlParser.KW_EXISTS); } break; } - this.state = 525; + this.state = 545; this.tableName(); } } @@ -2301,11 +2382,11 @@ export class GenericSqlParser extends SQLParserBase { } public expression(): ExpressionContext { let localContext = new ExpressionContext(this.context, this.state); - this.enterRule(localContext, 72, GenericSqlParser.RULE_expression); + this.enterRule(localContext, 74, GenericSqlParser.RULE_expression); try { this.enterOuterAlt(localContext, 1); { - this.state = 527; + this.state = 547; this.booleanExpression(0); } } @@ -2335,101 +2416,41 @@ export class GenericSqlParser extends SQLParserBase { let parentState = this.state; let localContext = new BooleanExpressionContext(this.context, parentState); let previousContext = localContext; - let _startState = 74; - this.enterRecursionRule(localContext, 74, GenericSqlParser.RULE_booleanExpression, _p); + let _startState = 76; + this.enterRecursionRule(localContext, 76, GenericSqlParser.RULE_booleanExpression, _p); try { let alternative: number; this.enterOuterAlt(localContext, 1); { - this.state = 533; + this.state = 553; this.errorHandler.sync(this); - switch (this.tokenStream.LA(1)) { - case GenericSqlParser.T__1: - case GenericSqlParser.KW_ADD: - case GenericSqlParser.KW_ALL: - case GenericSqlParser.KW_ASC: - case GenericSqlParser.KW_BIGINT: - case GenericSqlParser.KW_BINARY: - case GenericSqlParser.KW_BOOLEAN: - case GenericSqlParser.KW_BY: - case GenericSqlParser.KW_CASE: - case GenericSqlParser.KW_CAST: - case GenericSqlParser.KW_CHAR: - case GenericSqlParser.KW_COALESCE: - case GenericSqlParser.KW_COLUMN: - case GenericSqlParser.KW_CROSS: - case GenericSqlParser.KW_DATE: - case GenericSqlParser.KW_DECIMAL: - case GenericSqlParser.KW_DEFAULT: - case GenericSqlParser.KW_DESC: - case GenericSqlParser.KW_DOUBLE: - case GenericSqlParser.KW_EXISTS: - case GenericSqlParser.KW_FALSE: - case GenericSqlParser.KW_FIRST: - case GenericSqlParser.KW_FLOAT: - case GenericSqlParser.KW_FULL: - case GenericSqlParser.KW_IF: - case GenericSqlParser.KW_INT: - case GenericSqlParser.KW_INTEGER: - case GenericSqlParser.KW_KEY: - case GenericSqlParser.KW_LAST: - case GenericSqlParser.KW_LEFT: - case GenericSqlParser.KW_LIMIT: - case GenericSqlParser.KW_NULL: - case GenericSqlParser.KW_NULLIF: - case GenericSqlParser.KW_NULLS: - case GenericSqlParser.KW_NUMERIC: - case GenericSqlParser.KW_OFFSET: - case GenericSqlParser.KW_OUTER: - case GenericSqlParser.KW_RIGHT: - case GenericSqlParser.KW_SMALLINT: - case GenericSqlParser.KW_TEXT: - case GenericSqlParser.KW_TIME: - case GenericSqlParser.KW_TIMESTAMP: - case GenericSqlParser.KW_TINYINT: - case GenericSqlParser.KW_TO: - case GenericSqlParser.KW_TRUE: - case GenericSqlParser.KW_UNIQUE: - case GenericSqlParser.KW_VARCHAR: - case GenericSqlParser.KW_VARBINARY: - case GenericSqlParser.PLUS: - case GenericSqlParser.MINUS: - case GenericSqlParser.STRING: - case GenericSqlParser.BINARY_LITERAL: - case GenericSqlParser.INTEGER_VALUE: - case GenericSqlParser.DECIMAL_VALUE: - case GenericSqlParser.DOUBLE_VALUE: - case GenericSqlParser.IDENTIFIER: - case GenericSqlParser.DIGIT_IDENTIFIER: - case GenericSqlParser.QUOTED_IDENTIFIER: - case GenericSqlParser.BACKQUOTED_IDENTIFIER: + switch (this.interpreter.adaptivePredict(this.tokenStream, 63, this.context) ) { + case 1: { localContext = new PredicatedContext(localContext); this.context = localContext; previousContext = localContext; - this.state = 530; + this.state = 550; this.predicatedExpression(); } break; - case GenericSqlParser.KW_NOT: + case 2: { localContext = new NotExpressionContext(localContext); this.context = localContext; previousContext = localContext; - this.state = 531; + this.state = 551; this.match(GenericSqlParser.KW_NOT); - this.state = 532; + this.state = 552; this.booleanExpression(3); } break; - default: - throw new antlr.NoViableAltException(this); } this.context!.stop = this.tokenStream.LT(-1); - this.state = 543; + this.state = 563; this.errorHandler.sync(this); - alternative = this.interpreter.adaptivePredict(this.tokenStream, 63, this.context); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 65, this.context); while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { if (alternative === 1) { if (this._parseListeners != null) { @@ -2437,21 +2458,21 @@ export class GenericSqlParser extends SQLParserBase { } previousContext = localContext; { - this.state = 541; + this.state = 561; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 62, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 64, this.context) ) { case 1: { localContext = new AndExpressionContext(new BooleanExpressionContext(parentContext, parentState)); (localContext as AndExpressionContext)._left = previousContext; this.pushNewRecursionContext(localContext, _startState, GenericSqlParser.RULE_booleanExpression); - this.state = 535; + this.state = 555; if (!(this.precpred(this.context, 2))) { throw this.createFailedPredicateException("this.precpred(this.context, 2)"); } - this.state = 536; + this.state = 556; this.match(GenericSqlParser.KW_AND); - this.state = 537; + this.state = 557; (localContext as AndExpressionContext)._right = this.booleanExpression(3); } break; @@ -2460,22 +2481,22 @@ export class GenericSqlParser extends SQLParserBase { localContext = new OrExpressionContext(new BooleanExpressionContext(parentContext, parentState)); (localContext as OrExpressionContext)._left = previousContext; this.pushNewRecursionContext(localContext, _startState, GenericSqlParser.RULE_booleanExpression); - this.state = 538; + this.state = 558; if (!(this.precpred(this.context, 1))) { throw this.createFailedPredicateException("this.precpred(this.context, 1)"); } - this.state = 539; + this.state = 559; this.match(GenericSqlParser.KW_OR); - this.state = 540; + this.state = 560; (localContext as OrExpressionContext)._right = this.booleanExpression(2); } break; } } } - this.state = 545; + this.state = 565; this.errorHandler.sync(this); - alternative = this.interpreter.adaptivePredict(this.tokenStream, 63, this.context); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 65, this.context); } } } @@ -2495,18 +2516,18 @@ export class GenericSqlParser extends SQLParserBase { } public predicatedExpression(): PredicatedExpressionContext { let localContext = new PredicatedExpressionContext(this.context, this.state); - this.enterRule(localContext, 76, GenericSqlParser.RULE_predicatedExpression); + this.enterRule(localContext, 78, GenericSqlParser.RULE_predicatedExpression); try { this.enterOuterAlt(localContext, 1); { - this.state = 546; + this.state = 566; this.valueExpression(0); - this.state = 548; + this.state = 568; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 64, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 66, this.context) ) { case 1: { - this.state = 547; + this.state = 567; this.predicate(); } break; @@ -2529,19 +2550,19 @@ export class GenericSqlParser extends SQLParserBase { } public predicate(): PredicateContext { let localContext = new PredicateContext(this.context, this.state); - this.enterRule(localContext, 78, GenericSqlParser.RULE_predicate); + this.enterRule(localContext, 80, GenericSqlParser.RULE_predicate); let _la: number; try { - this.state = 605; + this.state = 625; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 73, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 75, this.context) ) { case 1: localContext = new ComparisonPredicateContext(localContext); this.enterOuterAlt(localContext, 1); { - this.state = 550; + this.state = 570; this.comparisonOperator(); - this.state = 551; + this.state = 571; (localContext as ComparisonPredicateContext)._right = this.valueExpression(0); } break; @@ -2549,39 +2570,39 @@ export class GenericSqlParser extends SQLParserBase { localContext = new InPredicateContext(localContext); this.enterOuterAlt(localContext, 2); { - this.state = 554; + this.state = 574; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 61) { { - this.state = 553; + this.state = 573; this.match(GenericSqlParser.KW_NOT); } } - this.state = 556; + this.state = 576; this.match(GenericSqlParser.KW_IN); - this.state = 557; + this.state = 577; this.match(GenericSqlParser.T__1); - this.state = 558; + this.state = 578; this.expression(); - this.state = 563; + this.state = 583; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 559; + this.state = 579; this.match(GenericSqlParser.T__0); - this.state = 560; + this.state = 580; this.expression(); } } - this.state = 565; + this.state = 585; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 566; + this.state = 586; this.match(GenericSqlParser.T__2); } break; @@ -2589,23 +2610,23 @@ export class GenericSqlParser extends SQLParserBase { localContext = new InSubqueryPredicateContext(localContext); this.enterOuterAlt(localContext, 3); { - this.state = 569; + this.state = 589; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 61) { { - this.state = 568; + this.state = 588; this.match(GenericSqlParser.KW_NOT); } } - this.state = 571; + this.state = 591; this.match(GenericSqlParser.KW_IN); - this.state = 572; + this.state = 592; this.match(GenericSqlParser.T__1); - this.state = 573; + this.state = 593; this.queryStatement(); - this.state = 574; + this.state = 594; this.match(GenericSqlParser.T__2); } break; @@ -2613,23 +2634,23 @@ export class GenericSqlParser extends SQLParserBase { localContext = new BetweenPredicateContext(localContext); this.enterOuterAlt(localContext, 4); { - this.state = 577; + this.state = 597; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 61) { { - this.state = 576; + this.state = 596; this.match(GenericSqlParser.KW_NOT); } } - this.state = 579; + this.state = 599; this.match(GenericSqlParser.KW_BETWEEN); - this.state = 580; + this.state = 600; (localContext as BetweenPredicateContext)._lower = this.valueExpression(0); - this.state = 581; + this.state = 601; this.match(GenericSqlParser.KW_AND); - this.state = 582; + this.state = 602; (localContext as BetweenPredicateContext)._upper = this.valueExpression(0); } break; @@ -2637,28 +2658,28 @@ export class GenericSqlParser extends SQLParserBase { localContext = new LikePredicateContext(localContext); this.enterOuterAlt(localContext, 5); { - this.state = 585; + this.state = 605; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 61) { { - this.state = 584; + this.state = 604; this.match(GenericSqlParser.KW_NOT); } } - this.state = 587; + this.state = 607; this.match(GenericSqlParser.KW_LIKE); - this.state = 588; + this.state = 608; (localContext as LikePredicateContext)._pattern = this.valueExpression(0); - this.state = 591; + this.state = 611; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 70, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 72, this.context) ) { case 1: { - this.state = 589; + this.state = 609; this.match(GenericSqlParser.KW_ESCAPE); - this.state = 590; + this.state = 610; (localContext as LikePredicateContext)._escape = this.valueExpression(0); } break; @@ -2669,19 +2690,19 @@ export class GenericSqlParser extends SQLParserBase { localContext = new NullPredicateContext(localContext); this.enterOuterAlt(localContext, 6); { - this.state = 593; + this.state = 613; this.match(GenericSqlParser.KW_IS); - this.state = 595; + this.state = 615; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 61) { { - this.state = 594; + this.state = 614; this.match(GenericSqlParser.KW_NOT); } } - this.state = 597; + this.state = 617; this.match(GenericSqlParser.KW_NULL); } break; @@ -2689,23 +2710,23 @@ export class GenericSqlParser extends SQLParserBase { localContext = new DistinctFromPredicateContext(localContext); this.enterOuterAlt(localContext, 7); { - this.state = 598; + this.state = 618; this.match(GenericSqlParser.KW_IS); - this.state = 600; + this.state = 620; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 61) { { - this.state = 599; + this.state = 619; this.match(GenericSqlParser.KW_NOT); } } - this.state = 602; + this.state = 622; this.match(GenericSqlParser.KW_DISTINCT); - this.state = 603; + this.state = 623; this.match(GenericSqlParser.KW_FROM); - this.state = 604; + this.state = 624; (localContext as DistinctFromPredicateContext)._right = this.valueExpression(0); } break; @@ -2727,12 +2748,12 @@ export class GenericSqlParser extends SQLParserBase { } public comparisonOperator(): ComparisonOperatorContext { let localContext = new ComparisonOperatorContext(this.context, this.state); - this.enterRule(localContext, 80, GenericSqlParser.RULE_comparisonOperator); + this.enterRule(localContext, 82, GenericSqlParser.RULE_comparisonOperator); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 607; + this.state = 627; _la = this.tokenStream.LA(1); if(!(((((_la - 95)) & ~0x1F) === 0 && ((1 << (_la - 95)) & 63) !== 0))) { this.errorHandler.recoverInline(this); @@ -2769,89 +2790,32 @@ export class GenericSqlParser extends SQLParserBase { let parentState = this.state; let localContext = new ValueExpressionContext(this.context, parentState); let previousContext = localContext; - let _startState = 82; - this.enterRecursionRule(localContext, 82, GenericSqlParser.RULE_valueExpression, _p); + let _startState = 84; + this.enterRecursionRule(localContext, 84, GenericSqlParser.RULE_valueExpression, _p); let _la: number; try { let alternative: number; this.enterOuterAlt(localContext, 1); { - this.state = 613; + this.state = 633; this.errorHandler.sync(this); - switch (this.tokenStream.LA(1)) { - case GenericSqlParser.T__1: - case GenericSqlParser.KW_ADD: - case GenericSqlParser.KW_ALL: - case GenericSqlParser.KW_ASC: - case GenericSqlParser.KW_BIGINT: - case GenericSqlParser.KW_BINARY: - case GenericSqlParser.KW_BOOLEAN: - case GenericSqlParser.KW_BY: - case GenericSqlParser.KW_CASE: - case GenericSqlParser.KW_CAST: - case GenericSqlParser.KW_CHAR: - case GenericSqlParser.KW_COALESCE: - case GenericSqlParser.KW_COLUMN: - case GenericSqlParser.KW_CROSS: - case GenericSqlParser.KW_DATE: - case GenericSqlParser.KW_DECIMAL: - case GenericSqlParser.KW_DEFAULT: - case GenericSqlParser.KW_DESC: - case GenericSqlParser.KW_DOUBLE: - case GenericSqlParser.KW_EXISTS: - case GenericSqlParser.KW_FALSE: - case GenericSqlParser.KW_FIRST: - case GenericSqlParser.KW_FLOAT: - case GenericSqlParser.KW_FULL: - case GenericSqlParser.KW_IF: - case GenericSqlParser.KW_INT: - case GenericSqlParser.KW_INTEGER: - case GenericSqlParser.KW_KEY: - case GenericSqlParser.KW_LAST: - case GenericSqlParser.KW_LEFT: - case GenericSqlParser.KW_LIMIT: - case GenericSqlParser.KW_NULL: - case GenericSqlParser.KW_NULLIF: - case GenericSqlParser.KW_NULLS: - case GenericSqlParser.KW_NUMERIC: - case GenericSqlParser.KW_OFFSET: - case GenericSqlParser.KW_OUTER: - case GenericSqlParser.KW_RIGHT: - case GenericSqlParser.KW_SMALLINT: - case GenericSqlParser.KW_TEXT: - case GenericSqlParser.KW_TIME: - case GenericSqlParser.KW_TIMESTAMP: - case GenericSqlParser.KW_TINYINT: - case GenericSqlParser.KW_TO: - case GenericSqlParser.KW_TRUE: - case GenericSqlParser.KW_UNIQUE: - case GenericSqlParser.KW_VARCHAR: - case GenericSqlParser.KW_VARBINARY: - case GenericSqlParser.STRING: - case GenericSqlParser.BINARY_LITERAL: - case GenericSqlParser.INTEGER_VALUE: - case GenericSqlParser.DECIMAL_VALUE: - case GenericSqlParser.DOUBLE_VALUE: - case GenericSqlParser.IDENTIFIER: - case GenericSqlParser.DIGIT_IDENTIFIER: - case GenericSqlParser.QUOTED_IDENTIFIER: - case GenericSqlParser.BACKQUOTED_IDENTIFIER: + switch (this.interpreter.adaptivePredict(this.tokenStream, 76, this.context) ) { + case 1: { localContext = new ValueExpressionDefaultContext(localContext); this.context = localContext; previousContext = localContext; - this.state = 610; + this.state = 630; this.primaryExpression(); } break; - case GenericSqlParser.PLUS: - case GenericSqlParser.MINUS: + case 2: { localContext = new ArithmeticUnaryContext(localContext); this.context = localContext; previousContext = localContext; - this.state = 611; + this.state = 631; (localContext as ArithmeticUnaryContext)._operator = this.tokenStream.LT(1); _la = this.tokenStream.LA(1); if(!(_la === 101 || _la === 102)) { @@ -2861,17 +2825,15 @@ export class GenericSqlParser extends SQLParserBase { this.errorHandler.reportMatch(this); this.consume(); } - this.state = 612; + this.state = 632; this.valueExpression(4); } break; - default: - throw new antlr.NoViableAltException(this); } this.context!.stop = this.tokenStream.LT(-1); - this.state = 626; + this.state = 646; this.errorHandler.sync(this); - alternative = this.interpreter.adaptivePredict(this.tokenStream, 76, this.context); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 78, this.context); while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { if (alternative === 1) { if (this._parseListeners != null) { @@ -2879,19 +2841,19 @@ export class GenericSqlParser extends SQLParserBase { } previousContext = localContext; { - this.state = 624; + this.state = 644; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 75, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 77, this.context) ) { case 1: { localContext = new ArithmeticBinaryContext(new ValueExpressionContext(parentContext, parentState)); (localContext as ArithmeticBinaryContext)._left = previousContext; this.pushNewRecursionContext(localContext, _startState, GenericSqlParser.RULE_valueExpression); - this.state = 615; + this.state = 635; if (!(this.precpred(this.context, 3))) { throw this.createFailedPredicateException("this.precpred(this.context, 3)"); } - this.state = 616; + this.state = 636; (localContext as ArithmeticBinaryContext)._operator = this.tokenStream.LT(1); _la = this.tokenStream.LA(1); if(!(((((_la - 103)) & ~0x1F) === 0 && ((1 << (_la - 103)) & 7) !== 0))) { @@ -2901,7 +2863,7 @@ export class GenericSqlParser extends SQLParserBase { this.errorHandler.reportMatch(this); this.consume(); } - this.state = 617; + this.state = 637; (localContext as ArithmeticBinaryContext)._right = this.valueExpression(4); } break; @@ -2910,11 +2872,11 @@ export class GenericSqlParser extends SQLParserBase { localContext = new ArithmeticBinaryContext(new ValueExpressionContext(parentContext, parentState)); (localContext as ArithmeticBinaryContext)._left = previousContext; this.pushNewRecursionContext(localContext, _startState, GenericSqlParser.RULE_valueExpression); - this.state = 618; + this.state = 638; if (!(this.precpred(this.context, 2))) { throw this.createFailedPredicateException("this.precpred(this.context, 2)"); } - this.state = 619; + this.state = 639; (localContext as ArithmeticBinaryContext)._operator = this.tokenStream.LT(1); _la = this.tokenStream.LA(1); if(!(_la === 101 || _la === 102)) { @@ -2924,7 +2886,7 @@ export class GenericSqlParser extends SQLParserBase { this.errorHandler.reportMatch(this); this.consume(); } - this.state = 620; + this.state = 640; (localContext as ArithmeticBinaryContext)._right = this.valueExpression(3); } break; @@ -2933,22 +2895,22 @@ export class GenericSqlParser extends SQLParserBase { localContext = new ConcatenationContext(new ValueExpressionContext(parentContext, parentState)); (localContext as ConcatenationContext)._left = previousContext; this.pushNewRecursionContext(localContext, _startState, GenericSqlParser.RULE_valueExpression); - this.state = 621; + this.state = 641; if (!(this.precpred(this.context, 1))) { throw this.createFailedPredicateException("this.precpred(this.context, 1)"); } - this.state = 622; + this.state = 642; this.match(GenericSqlParser.CONCAT); - this.state = 623; + this.state = 643; (localContext as ConcatenationContext)._right = this.valueExpression(2); } break; } } } - this.state = 628; + this.state = 648; this.errorHandler.sync(this); - alternative = this.interpreter.adaptivePredict(this.tokenStream, 76, this.context); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 78, this.context); } } } @@ -2968,17 +2930,17 @@ export class GenericSqlParser extends SQLParserBase { } public primaryExpression(): PrimaryExpressionContext { let localContext = new PrimaryExpressionContext(this.context, this.state); - this.enterRule(localContext, 84, GenericSqlParser.RULE_primaryExpression); + this.enterRule(localContext, 86, GenericSqlParser.RULE_primaryExpression); let _la: number; try { - this.state = 709; + this.state = 729; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 85, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 87, this.context) ) { case 1: localContext = new LiteralExpressionContext(localContext); this.enterOuterAlt(localContext, 1); { - this.state = 629; + this.state = 649; this.literal(); } break; @@ -2986,47 +2948,47 @@ export class GenericSqlParser extends SQLParserBase { localContext = new FunctionCallContext(localContext); this.enterOuterAlt(localContext, 2); { - this.state = 630; - this.qualifiedName(); - this.state = 631; + this.state = 650; + this.functionName(); + this.state = 651; this.match(GenericSqlParser.T__1); - this.state = 643; + this.state = 663; this.errorHandler.sync(this); - _la = this.tokenStream.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 4013421668) !== 0) || ((((_la - 37)) & ~0x1F) === 0 && ((1 << (_la - 37)) & 1069048399) !== 0) || ((((_la - 70)) & ~0x1F) === 0 && ((1 << (_la - 70)) & 2151019809) !== 0) || ((((_la - 102)) & ~0x1F) === 0 && ((1 << (_la - 102)) & 65409) !== 0)) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 81, this.context) ) { + case 1: { - this.state = 633; + this.state = 653; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 77, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 79, this.context) ) { case 1: { - this.state = 632; + this.state = 652; this.setQuantifier(); } break; } - this.state = 635; + this.state = 655; this.expression(); - this.state = 640; + this.state = 660; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 636; + this.state = 656; this.match(GenericSqlParser.T__0); - this.state = 637; + this.state = 657; this.expression(); } } - this.state = 642; + this.state = 662; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } } + break; } - - this.state = 645; + this.state = 665; this.match(GenericSqlParser.T__2); } break; @@ -3034,35 +2996,35 @@ export class GenericSqlParser extends SQLParserBase { localContext = new SearchedCaseExpressionContext(localContext); this.enterOuterAlt(localContext, 3); { - this.state = 647; + this.state = 667; this.match(GenericSqlParser.KW_CASE); - this.state = 649; + this.state = 669; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); do { { { - this.state = 648; + this.state = 668; this.whenClause(); } } - this.state = 651; + this.state = 671; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } while (_la === 92); - this.state = 655; + this.state = 675; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 33) { { - this.state = 653; + this.state = 673; this.match(GenericSqlParser.KW_ELSE); - this.state = 654; + this.state = 674; this.expression(); } } - this.state = 657; + this.state = 677; this.match(GenericSqlParser.KW_END); } break; @@ -3070,37 +3032,37 @@ export class GenericSqlParser extends SQLParserBase { localContext = new SimpleCaseExpressionContext(localContext); this.enterOuterAlt(localContext, 4); { - this.state = 659; + this.state = 679; this.match(GenericSqlParser.KW_CASE); - this.state = 660; + this.state = 680; this.expression(); - this.state = 662; + this.state = 682; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); do { { { - this.state = 661; + this.state = 681; this.whenClause(); } } - this.state = 664; + this.state = 684; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } while (_la === 92); - this.state = 668; + this.state = 688; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 33) { { - this.state = 666; + this.state = 686; this.match(GenericSqlParser.KW_ELSE); - this.state = 667; + this.state = 687; this.expression(); } } - this.state = 670; + this.state = 690; this.match(GenericSqlParser.KW_END); } break; @@ -3108,17 +3070,17 @@ export class GenericSqlParser extends SQLParserBase { localContext = new CastExpressionContext(localContext); this.enterOuterAlt(localContext, 5); { - this.state = 672; + this.state = 692; this.match(GenericSqlParser.KW_CAST); - this.state = 673; + this.state = 693; this.match(GenericSqlParser.T__1); - this.state = 674; + this.state = 694; this.expression(); - this.state = 675; + this.state = 695; this.match(GenericSqlParser.KW_AS); - this.state = 676; + this.state = 696; this.dataType(); - this.state = 677; + this.state = 697; this.match(GenericSqlParser.T__2); } break; @@ -3126,29 +3088,29 @@ export class GenericSqlParser extends SQLParserBase { localContext = new CoalesceExpressionContext(localContext); this.enterOuterAlt(localContext, 6); { - this.state = 679; + this.state = 699; this.match(GenericSqlParser.KW_COALESCE); - this.state = 680; + this.state = 700; this.match(GenericSqlParser.T__1); - this.state = 681; + this.state = 701; this.expression(); - this.state = 686; + this.state = 706; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 682; + this.state = 702; this.match(GenericSqlParser.T__0); - this.state = 683; + this.state = 703; this.expression(); } } - this.state = 688; + this.state = 708; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 689; + this.state = 709; this.match(GenericSqlParser.T__2); } break; @@ -3156,17 +3118,17 @@ export class GenericSqlParser extends SQLParserBase { localContext = new NullIfExpressionContext(localContext); this.enterOuterAlt(localContext, 7); { - this.state = 691; + this.state = 711; this.match(GenericSqlParser.KW_NULLIF); - this.state = 692; + this.state = 712; this.match(GenericSqlParser.T__1); - this.state = 693; + this.state = 713; this.valueExpression(0); - this.state = 694; + this.state = 714; this.match(GenericSqlParser.T__0); - this.state = 695; + this.state = 715; this.valueExpression(0); - this.state = 696; + this.state = 716; this.match(GenericSqlParser.T__2); } break; @@ -3174,11 +3136,11 @@ export class GenericSqlParser extends SQLParserBase { localContext = new ParenthesizedExpressionContext(localContext); this.enterOuterAlt(localContext, 8); { - this.state = 698; + this.state = 718; this.match(GenericSqlParser.T__1); - this.state = 699; + this.state = 719; this.expression(); - this.state = 700; + this.state = 720; this.match(GenericSqlParser.T__2); } break; @@ -3186,13 +3148,13 @@ export class GenericSqlParser extends SQLParserBase { localContext = new ExistsExpressionContext(localContext); this.enterOuterAlt(localContext, 9); { - this.state = 702; + this.state = 722; this.match(GenericSqlParser.KW_EXISTS); - this.state = 703; + this.state = 723; this.match(GenericSqlParser.T__1); - this.state = 704; + this.state = 724; this.queryStatement(); - this.state = 705; + this.state = 725; this.match(GenericSqlParser.T__2); } break; @@ -3200,7 +3162,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new SubqueryExpressionDefaultContext(localContext); this.enterOuterAlt(localContext, 10); { - this.state = 707; + this.state = 727; this.subqueryExpression(); } break; @@ -3208,8 +3170,8 @@ export class GenericSqlParser extends SQLParserBase { localContext = new ColumnReferenceContext(localContext); this.enterOuterAlt(localContext, 11); { - this.state = 708; - this.qualifiedName(); + this.state = 728; + this.columnName(); } break; } @@ -3230,17 +3192,17 @@ export class GenericSqlParser extends SQLParserBase { } public whenClause(): WhenClauseContext { let localContext = new WhenClauseContext(this.context, this.state); - this.enterRule(localContext, 86, GenericSqlParser.RULE_whenClause); + this.enterRule(localContext, 88, GenericSqlParser.RULE_whenClause); try { this.enterOuterAlt(localContext, 1); { - this.state = 711; + this.state = 731; this.match(GenericSqlParser.KW_WHEN); - this.state = 712; + this.state = 732; localContext._condition = this.expression(); - this.state = 713; + this.state = 733; this.match(GenericSqlParser.KW_THEN); - this.state = 714; + this.state = 734; localContext._result = this.expression(); } } @@ -3260,15 +3222,15 @@ export class GenericSqlParser extends SQLParserBase { } public subqueryExpression(): SubqueryExpressionContext { let localContext = new SubqueryExpressionContext(this.context, this.state); - this.enterRule(localContext, 88, GenericSqlParser.RULE_subqueryExpression); + this.enterRule(localContext, 90, GenericSqlParser.RULE_subqueryExpression); try { this.enterOuterAlt(localContext, 1); { - this.state = 716; + this.state = 736; this.match(GenericSqlParser.T__1); - this.state = 717; + this.state = 737; this.queryStatement(); - this.state = 718; + this.state = 738; this.match(GenericSqlParser.T__2); } } @@ -3288,95 +3250,95 @@ export class GenericSqlParser extends SQLParserBase { } public dataType(): DataTypeContext { let localContext = new DataTypeContext(this.context, this.state); - this.enterRule(localContext, 90, GenericSqlParser.RULE_dataType); + this.enterRule(localContext, 92, GenericSqlParser.RULE_dataType); let _la: number; try { - this.state = 766; + this.state = 786; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case GenericSqlParser.KW_BOOLEAN: this.enterOuterAlt(localContext, 1); { - this.state = 720; + this.state = 740; this.match(GenericSqlParser.KW_BOOLEAN); } break; case GenericSqlParser.KW_TINYINT: this.enterOuterAlt(localContext, 2); { - this.state = 721; + this.state = 741; this.match(GenericSqlParser.KW_TINYINT); } break; case GenericSqlParser.KW_SMALLINT: this.enterOuterAlt(localContext, 3); { - this.state = 722; + this.state = 742; this.match(GenericSqlParser.KW_SMALLINT); } break; case GenericSqlParser.KW_INT: this.enterOuterAlt(localContext, 4); { - this.state = 723; + this.state = 743; this.match(GenericSqlParser.KW_INT); } break; case GenericSqlParser.KW_INTEGER: this.enterOuterAlt(localContext, 5); { - this.state = 724; + this.state = 744; this.match(GenericSqlParser.KW_INTEGER); } break; case GenericSqlParser.KW_BIGINT: this.enterOuterAlt(localContext, 6); { - this.state = 725; + this.state = 745; this.match(GenericSqlParser.KW_BIGINT); } break; case GenericSqlParser.KW_FLOAT: this.enterOuterAlt(localContext, 7); { - this.state = 726; + this.state = 746; this.match(GenericSqlParser.KW_FLOAT); } break; case GenericSqlParser.KW_DOUBLE: this.enterOuterAlt(localContext, 8); { - this.state = 727; + this.state = 747; this.match(GenericSqlParser.KW_DOUBLE); } break; case GenericSqlParser.KW_DECIMAL: this.enterOuterAlt(localContext, 9); { - this.state = 728; + this.state = 748; this.match(GenericSqlParser.KW_DECIMAL); - this.state = 736; + this.state = 756; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 87, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 89, this.context) ) { case 1: { - this.state = 729; + this.state = 749; this.match(GenericSqlParser.T__1); - this.state = 730; + this.state = 750; localContext._precision = this.match(GenericSqlParser.INTEGER_VALUE); - this.state = 733; + this.state = 753; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 1) { { - this.state = 731; + this.state = 751; this.match(GenericSqlParser.T__0); - this.state = 732; + this.state = 752; localContext._scale = this.match(GenericSqlParser.INTEGER_VALUE); } } - this.state = 735; + this.state = 755; this.match(GenericSqlParser.T__2); } break; @@ -3386,30 +3348,30 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_NUMERIC: this.enterOuterAlt(localContext, 10); { - this.state = 738; + this.state = 758; this.match(GenericSqlParser.KW_NUMERIC); - this.state = 746; + this.state = 766; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 89, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 91, this.context) ) { case 1: { - this.state = 739; + this.state = 759; this.match(GenericSqlParser.T__1); - this.state = 740; + this.state = 760; localContext._precision = this.match(GenericSqlParser.INTEGER_VALUE); - this.state = 743; + this.state = 763; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); if (_la === 1) { { - this.state = 741; + this.state = 761; this.match(GenericSqlParser.T__0); - this.state = 742; + this.state = 762; localContext._scale = this.match(GenericSqlParser.INTEGER_VALUE); } } - this.state = 745; + this.state = 765; this.match(GenericSqlParser.T__2); } break; @@ -3419,18 +3381,18 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_VARCHAR: this.enterOuterAlt(localContext, 11); { - this.state = 748; + this.state = 768; this.match(GenericSqlParser.KW_VARCHAR); - this.state = 752; + this.state = 772; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 90, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 92, this.context) ) { case 1: { - this.state = 749; + this.state = 769; this.match(GenericSqlParser.T__1); - this.state = 750; + this.state = 770; localContext._maxLength = this.match(GenericSqlParser.INTEGER_VALUE); - this.state = 751; + this.state = 771; this.match(GenericSqlParser.T__2); } break; @@ -3440,18 +3402,18 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_CHAR: this.enterOuterAlt(localContext, 12); { - this.state = 754; + this.state = 774; this.match(GenericSqlParser.KW_CHAR); - this.state = 758; + this.state = 778; this.errorHandler.sync(this); - switch (this.interpreter.adaptivePredict(this.tokenStream, 91, this.context) ) { + switch (this.interpreter.adaptivePredict(this.tokenStream, 93, this.context) ) { case 1: { - this.state = 755; + this.state = 775; this.match(GenericSqlParser.T__1); - this.state = 756; + this.state = 776; localContext._length = this.match(GenericSqlParser.INTEGER_VALUE); - this.state = 757; + this.state = 777; this.match(GenericSqlParser.T__2); } break; @@ -3461,42 +3423,42 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_TEXT: this.enterOuterAlt(localContext, 13); { - this.state = 760; + this.state = 780; this.match(GenericSqlParser.KW_TEXT); } break; case GenericSqlParser.KW_DATE: this.enterOuterAlt(localContext, 14); { - this.state = 761; + this.state = 781; this.match(GenericSqlParser.KW_DATE); } break; case GenericSqlParser.KW_TIME: this.enterOuterAlt(localContext, 15); { - this.state = 762; + this.state = 782; this.match(GenericSqlParser.KW_TIME); } break; case GenericSqlParser.KW_TIMESTAMP: this.enterOuterAlt(localContext, 16); { - this.state = 763; + this.state = 783; this.match(GenericSqlParser.KW_TIMESTAMP); } break; case GenericSqlParser.KW_BINARY: this.enterOuterAlt(localContext, 17); { - this.state = 764; + this.state = 784; this.match(GenericSqlParser.KW_BINARY); } break; case GenericSqlParser.KW_VARBINARY: this.enterOuterAlt(localContext, 18); { - this.state = 765; + this.state = 785; this.match(GenericSqlParser.KW_VARBINARY); } break; @@ -3520,32 +3482,32 @@ export class GenericSqlParser extends SQLParserBase { } public properties(): PropertiesContext { let localContext = new PropertiesContext(this.context, this.state); - this.enterRule(localContext, 92, GenericSqlParser.RULE_properties); + this.enterRule(localContext, 94, GenericSqlParser.RULE_properties); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 768; + this.state = 788; this.match(GenericSqlParser.T__1); - this.state = 769; + this.state = 789; this.property(); - this.state = 774; + this.state = 794; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); while (_la === 1) { { { - this.state = 770; + this.state = 790; this.match(GenericSqlParser.T__0); - this.state = 771; + this.state = 791; this.property(); } } - this.state = 776; + this.state = 796; this.errorHandler.sync(this); _la = this.tokenStream.LA(1); } - this.state = 777; + this.state = 797; this.match(GenericSqlParser.T__2); } } @@ -3565,15 +3527,15 @@ export class GenericSqlParser extends SQLParserBase { } public property(): PropertyContext { let localContext = new PropertyContext(this.context, this.state); - this.enterRule(localContext, 94, GenericSqlParser.RULE_property); + this.enterRule(localContext, 96, GenericSqlParser.RULE_property); try { this.enterOuterAlt(localContext, 1); { - this.state = 779; + this.state = 799; this.identifier(); - this.state = 780; + this.state = 800; this.match(GenericSqlParser.EQ); - this.state = 781; + this.state = 801; this.literal(); } } @@ -3593,16 +3555,16 @@ export class GenericSqlParser extends SQLParserBase { } public literal(): LiteralContext { let localContext = new LiteralContext(this.context, this.state); - this.enterRule(localContext, 96, GenericSqlParser.RULE_literal); + this.enterRule(localContext, 98, GenericSqlParser.RULE_literal); try { - this.state = 791; + this.state = 811; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case GenericSqlParser.KW_NULL: localContext = new NullLiteralContext(localContext); this.enterOuterAlt(localContext, 1); { - this.state = 783; + this.state = 803; this.match(GenericSqlParser.KW_NULL); } break; @@ -3610,7 +3572,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new BooleanLiteralContext(localContext); this.enterOuterAlt(localContext, 2); { - this.state = 784; + this.state = 804; this.match(GenericSqlParser.KW_TRUE); } break; @@ -3618,7 +3580,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new BooleanLiteralContext(localContext); this.enterOuterAlt(localContext, 3); { - this.state = 785; + this.state = 805; this.match(GenericSqlParser.KW_FALSE); } break; @@ -3626,7 +3588,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new IntegerLiteralContext(localContext); this.enterOuterAlt(localContext, 4); { - this.state = 786; + this.state = 806; this.match(GenericSqlParser.INTEGER_VALUE); } break; @@ -3634,7 +3596,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new DecimalLiteralContext(localContext); this.enterOuterAlt(localContext, 5); { - this.state = 787; + this.state = 807; this.match(GenericSqlParser.DECIMAL_VALUE); } break; @@ -3642,7 +3604,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new DoubleLiteralContext(localContext); this.enterOuterAlt(localContext, 6); { - this.state = 788; + this.state = 808; this.match(GenericSqlParser.DOUBLE_VALUE); } break; @@ -3650,7 +3612,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new StringLiteralContext(localContext); this.enterOuterAlt(localContext, 7); { - this.state = 789; + this.state = 809; this.match(GenericSqlParser.STRING); } break; @@ -3658,7 +3620,7 @@ export class GenericSqlParser extends SQLParserBase { localContext = new BinaryLiteralContext(localContext); this.enterOuterAlt(localContext, 8); { - this.state = 790; + this.state = 810; this.match(GenericSqlParser.BINARY_LITERAL); } break; @@ -3682,36 +3644,36 @@ export class GenericSqlParser extends SQLParserBase { } public identifier(): IdentifierContext { let localContext = new IdentifierContext(this.context, this.state); - this.enterRule(localContext, 98, GenericSqlParser.RULE_identifier); + this.enterRule(localContext, 100, GenericSqlParser.RULE_identifier); try { - this.state = 798; + this.state = 818; this.errorHandler.sync(this); switch (this.tokenStream.LA(1)) { case GenericSqlParser.IDENTIFIER: this.enterOuterAlt(localContext, 1); { - this.state = 793; + this.state = 813; this.match(GenericSqlParser.IDENTIFIER); } break; case GenericSqlParser.DIGIT_IDENTIFIER: this.enterOuterAlt(localContext, 2); { - this.state = 794; + this.state = 814; this.match(GenericSqlParser.DIGIT_IDENTIFIER); } break; case GenericSqlParser.QUOTED_IDENTIFIER: this.enterOuterAlt(localContext, 3); { - this.state = 795; + this.state = 815; this.match(GenericSqlParser.QUOTED_IDENTIFIER); } break; case GenericSqlParser.BACKQUOTED_IDENTIFIER: this.enterOuterAlt(localContext, 4); { - this.state = 796; + this.state = 816; this.match(GenericSqlParser.BACKQUOTED_IDENTIFIER); } break; @@ -3760,7 +3722,7 @@ export class GenericSqlParser extends SQLParserBase { case GenericSqlParser.KW_VARBINARY: this.enterOuterAlt(localContext, 5); { - this.state = 797; + this.state = 817; this.nonReserved(); } break; @@ -3782,33 +3744,166 @@ export class GenericSqlParser extends SQLParserBase { } return localContext; } - public qualifiedName(): QualifiedNameContext { - let localContext = new QualifiedNameContext(this.context, this.state); - this.enterRule(localContext, 100, GenericSqlParser.RULE_qualifiedName); + public qualifiedName(): QualifiedNameContext { + let localContext = new QualifiedNameContext(this.context, this.state); + this.enterRule(localContext, 102, GenericSqlParser.RULE_qualifiedName); + try { + let alternative: number; + this.enterOuterAlt(localContext, 1); + { + this.state = 820; + this.identifier(); + this.state = 825; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 98, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 821; + this.match(GenericSqlParser.T__3); + this.state = 822; + this.identifier(); + } + } + } + this.state = 827; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 98, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public qualifiedNameAllowEmpty(): QualifiedNameAllowEmptyContext { + let localContext = new QualifiedNameAllowEmptyContext(this.context, this.state); + this.enterRule(localContext, 104, GenericSqlParser.RULE_qualifiedNameAllowEmpty); + try { + this.state = 834; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 99, this.context) ) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 828; + this.qualifiedName(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 829; + if (!(this.shouldMatchEmpty())) { + throw this.createFailedPredicateException("this.shouldMatchEmpty()"); + } + this.state = 830; + this.qualifiedName(); + this.state = 831; + this.match(GenericSqlParser.T__3); + this.state = 832; + this.emptyColumn(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public columnRef(): ColumnRefContext { + let localContext = new ColumnRefContext(this.context, this.state); + this.enterRule(localContext, 106, GenericSqlParser.RULE_columnRef); + try { + this.state = 839; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 100, this.context) ) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 836; + this.identifier(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 837; + if (!(this.shouldMatchEmpty())) { + throw this.createFailedPredicateException("this.shouldMatchEmpty()"); + } + this.state = 838; + this.emptyColumn(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public columnName(): ColumnNameContext { + let localContext = new ColumnNameContext(this.context, this.state); + this.enterRule(localContext, 108, GenericSqlParser.RULE_columnName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 841; + this.qualifiedNameAllowEmpty(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + public emptyColumn(): EmptyColumnContext { + let localContext = new EmptyColumnContext(this.context, this.state); + this.enterRule(localContext, 110, GenericSqlParser.RULE_emptyColumn); try { - let alternative: number; this.enterOuterAlt(localContext, 1); + // tslint:disable-next-line:no-empty { - this.state = 800; - this.identifier(); - this.state = 805; - this.errorHandler.sync(this); - alternative = this.interpreter.adaptivePredict(this.tokenStream, 96, this.context); - while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { - if (alternative === 1) { - { - { - this.state = 801; - this.match(GenericSqlParser.T__3); - this.state = 802; - this.identifier(); - } - } - } - this.state = 807; - this.errorHandler.sync(this); - alternative = this.interpreter.adaptivePredict(this.tokenStream, 96, this.context); - } } } catch (re) { @@ -3825,14 +3920,14 @@ export class GenericSqlParser extends SQLParserBase { } return localContext; } - public columnRef(): ColumnRefContext { - let localContext = new ColumnRefContext(this.context, this.state); - this.enterRule(localContext, 102, GenericSqlParser.RULE_columnRef); + public tableName(): TableNameContext { + let localContext = new TableNameContext(this.context, this.state); + this.enterRule(localContext, 112, GenericSqlParser.RULE_tableName); try { this.enterOuterAlt(localContext, 1); { - this.state = 808; - this.identifier(); + this.state = 845; + this.qualifiedName(); } } catch (re) { @@ -3849,13 +3944,13 @@ export class GenericSqlParser extends SQLParserBase { } return localContext; } - public tableName(): TableNameContext { - let localContext = new TableNameContext(this.context, this.state); - this.enterRule(localContext, 104, GenericSqlParser.RULE_tableName); + public tableNameCreate(): TableNameCreateContext { + let localContext = new TableNameCreateContext(this.context, this.state); + this.enterRule(localContext, 114, GenericSqlParser.RULE_tableNameCreate); try { this.enterOuterAlt(localContext, 1); { - this.state = 810; + this.state = 847; this.qualifiedName(); } } @@ -3873,13 +3968,13 @@ export class GenericSqlParser extends SQLParserBase { } return localContext; } - public tableNameCreate(): TableNameCreateContext { - let localContext = new TableNameCreateContext(this.context, this.state); - this.enterRule(localContext, 106, GenericSqlParser.RULE_tableNameCreate); + public functionName(): FunctionNameContext { + let localContext = new FunctionNameContext(this.context, this.state); + this.enterRule(localContext, 116, GenericSqlParser.RULE_functionName); try { this.enterOuterAlt(localContext, 1); { - this.state = 812; + this.state = 849; this.qualifiedName(); } } @@ -3899,12 +3994,12 @@ export class GenericSqlParser extends SQLParserBase { } public nonReserved(): NonReservedContext { let localContext = new NonReservedContext(this.context, this.state); - this.enterRule(localContext, 108, GenericSqlParser.RULE_nonReserved); + this.enterRule(localContext, 118, GenericSqlParser.RULE_nonReserved); let _la: number; try { this.enterOuterAlt(localContext, 1); { - this.state = 814; + this.state = 851; _la = this.tokenStream.LA(1); if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 2939483232) !== 0) || ((((_la - 38)) & ~0x1F) === 0 && ((1 << (_la - 38)) & 509358375) !== 0) || ((((_la - 70)) & ~0x1F) === 0 && ((1 << (_la - 70)) & 3536161) !== 0))) { this.errorHandler.recoverInline(this); @@ -3932,35 +4027,55 @@ export class GenericSqlParser extends SQLParserBase { public override sempred(localContext: antlr.RuleContext | null, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { + case 13: + return this.selectItem_sempred(localContext as SelectItemContext, predIndex); case 15: return this.relation_sempred(localContext as RelationContext, predIndex); - case 37: + case 19: + return this.whereClause_sempred(localContext as WhereClauseContext, predIndex); + case 21: + return this.havingClause_sempred(localContext as HavingClauseContext, predIndex); + case 38: return this.booleanExpression_sempred(localContext as BooleanExpressionContext, predIndex); - case 41: + case 42: return this.valueExpression_sempred(localContext as ValueExpressionContext, predIndex); + case 52: + return this.qualifiedNameAllowEmpty_sempred(localContext as QualifiedNameAllowEmptyContext, predIndex); + case 53: + return this.columnRef_sempred(localContext as ColumnRefContext, predIndex); } return true; } - private relation_sempred(localContext: RelationContext | null, predIndex: number): boolean { + private selectItem_sempred(localContext: SelectItemContext | null, predIndex: number): boolean { switch (predIndex) { case 0: - return this.precpred(this.context, 2); + return this.shouldMatchEmpty(); } return true; } - private booleanExpression_sempred(localContext: BooleanExpressionContext | null, predIndex: number): boolean { + private relation_sempred(localContext: RelationContext | null, predIndex: number): boolean { switch (predIndex) { case 1: return this.precpred(this.context, 2); + } + return true; + } + private whereClause_sempred(localContext: WhereClauseContext | null, predIndex: number): boolean { + switch (predIndex) { case 2: - return this.precpred(this.context, 1); + return this.shouldMatchEmpty(); } return true; } - private valueExpression_sempred(localContext: ValueExpressionContext | null, predIndex: number): boolean { + private havingClause_sempred(localContext: HavingClauseContext | null, predIndex: number): boolean { switch (predIndex) { case 3: - return this.precpred(this.context, 3); + return this.shouldMatchEmpty(); + } + return true; + } + private booleanExpression_sempred(localContext: BooleanExpressionContext | null, predIndex: number): boolean { + switch (predIndex) { case 4: return this.precpred(this.context, 2); case 5: @@ -3968,9 +4083,34 @@ export class GenericSqlParser extends SQLParserBase { } return true; } + private valueExpression_sempred(localContext: ValueExpressionContext | null, predIndex: number): boolean { + switch (predIndex) { + case 6: + return this.precpred(this.context, 3); + case 7: + return this.precpred(this.context, 2); + case 8: + return this.precpred(this.context, 1); + } + return true; + } + private qualifiedNameAllowEmpty_sempred(localContext: QualifiedNameAllowEmptyContext | null, predIndex: number): boolean { + switch (predIndex) { + case 9: + return this.shouldMatchEmpty(); + } + return true; + } + private columnRef_sempred(localContext: ColumnRefContext | null, predIndex: number): boolean { + switch (predIndex) { + case 10: + return this.shouldMatchEmpty(); + } + return true; + } public static readonly _serializedATN: number[] = [ - 4,1,122,817,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6, + 4,1,122,854,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6, 7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7, 13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2, 20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7, @@ -3978,311 +4118,324 @@ export class GenericSqlParser extends SQLParserBase { 33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7, 39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2, 46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7, - 52,2,53,7,53,2,54,7,54,1,0,5,0,112,8,0,10,0,12,0,115,9,0,1,0,1,0, - 1,1,1,1,1,2,1,2,3,2,123,8,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,3,132, - 8,3,1,4,3,4,135,8,4,1,4,1,4,1,5,1,5,3,5,141,8,5,1,5,1,5,1,5,5,5, - 146,8,5,10,5,12,5,149,9,5,1,6,1,6,3,6,153,8,6,1,6,1,6,1,6,1,6,1, - 6,1,7,1,7,1,7,1,7,5,7,164,8,7,10,7,12,7,167,9,7,1,7,1,7,1,8,1,8, - 1,8,3,8,174,8,8,1,8,5,8,177,8,8,10,8,12,8,180,9,8,1,9,1,9,1,10,1, - 10,1,10,1,10,1,10,3,10,189,8,10,1,11,1,11,3,11,193,8,11,1,11,1,11, - 1,11,5,11,198,8,11,10,11,12,11,201,9,11,1,11,3,11,204,8,11,1,11, - 3,11,207,8,11,1,11,3,11,210,8,11,1,11,3,11,213,8,11,1,11,3,11,216, - 8,11,1,11,3,11,219,8,11,1,12,1,12,1,13,1,13,3,13,225,8,13,1,13,3, - 13,228,8,13,1,13,1,13,1,13,1,13,1,13,3,13,235,8,13,1,14,1,14,1,14, - 1,14,5,14,241,8,14,10,14,12,14,244,9,14,1,15,1,15,1,15,1,15,1,15, - 1,15,1,15,1,15,1,15,1,15,5,15,256,8,15,10,15,12,15,259,9,15,1,16, - 3,16,262,8,16,1,16,1,16,3,16,266,8,16,1,16,1,16,3,16,270,8,16,1, - 16,1,16,3,16,274,8,16,1,16,3,16,277,8,16,1,17,1,17,3,17,281,8,17, - 1,17,3,17,284,8,17,1,18,1,18,1,18,1,18,1,18,3,18,291,8,18,1,19,1, - 19,1,19,1,20,1,20,1,20,3,20,299,8,20,1,20,1,20,1,20,5,20,304,8,20, - 10,20,12,20,307,9,20,1,21,1,21,1,21,1,22,1,22,1,22,1,22,1,22,5,22, - 317,8,22,10,22,12,22,320,9,22,1,23,1,23,3,23,324,8,23,1,23,1,23, - 3,23,328,8,23,1,24,1,24,1,24,1,24,3,24,334,8,24,1,25,1,25,1,25,1, - 25,3,25,340,8,25,1,25,1,25,1,26,1,26,1,26,1,26,5,26,348,8,26,10, - 26,12,26,351,9,26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,1,27,5,27,361, - 8,27,10,27,12,27,364,9,27,1,27,3,27,367,8,27,1,28,1,28,1,28,1,28, - 1,29,1,29,1,29,1,29,3,29,377,8,29,1,30,1,30,1,30,1,30,1,30,3,30, - 384,8,30,1,30,1,30,1,30,1,30,1,30,5,30,391,8,30,10,30,12,30,394, - 9,30,1,30,1,30,1,30,3,30,399,8,30,1,31,1,31,3,31,403,8,31,1,32,1, - 32,1,32,1,32,3,32,409,8,32,1,32,1,32,3,32,413,8,32,1,32,1,32,3,32, - 417,8,32,1,33,1,33,3,33,421,8,33,1,33,1,33,1,33,1,33,1,33,1,33,5, - 33,429,8,33,10,33,12,33,432,9,33,1,33,1,33,1,33,1,33,1,33,1,33,1, - 33,5,33,441,8,33,10,33,12,33,444,9,33,1,33,1,33,1,33,1,33,1,33,1, - 33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,5,33,459,8,33,10,33,12,33, - 462,9,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,5,33,471,8,33,10,33, - 12,33,474,9,33,1,33,1,33,3,33,478,8,33,1,34,1,34,1,34,1,34,3,34, - 484,8,34,1,34,1,34,1,34,1,34,1,34,1,34,3,34,492,8,34,1,34,1,34,1, - 34,1,34,1,34,3,34,499,8,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1, - 34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,3,34,518,8,34,1, - 35,1,35,1,35,1,35,3,35,524,8,35,1,35,1,35,1,36,1,36,1,37,1,37,1, - 37,1,37,3,37,534,8,37,1,37,1,37,1,37,1,37,1,37,1,37,5,37,542,8,37, - 10,37,12,37,545,9,37,1,38,1,38,3,38,549,8,38,1,39,1,39,1,39,1,39, - 3,39,555,8,39,1,39,1,39,1,39,1,39,1,39,5,39,562,8,39,10,39,12,39, - 565,9,39,1,39,1,39,1,39,3,39,570,8,39,1,39,1,39,1,39,1,39,1,39,1, - 39,3,39,578,8,39,1,39,1,39,1,39,1,39,1,39,1,39,3,39,586,8,39,1,39, - 1,39,1,39,1,39,3,39,592,8,39,1,39,1,39,3,39,596,8,39,1,39,1,39,1, - 39,3,39,601,8,39,1,39,1,39,1,39,3,39,606,8,39,1,40,1,40,1,41,1,41, - 1,41,1,41,3,41,614,8,41,1,41,1,41,1,41,1,41,1,41,1,41,1,41,1,41, - 1,41,5,41,625,8,41,10,41,12,41,628,9,41,1,42,1,42,1,42,1,42,3,42, - 634,8,42,1,42,1,42,1,42,5,42,639,8,42,10,42,12,42,642,9,42,3,42, - 644,8,42,1,42,1,42,1,42,1,42,4,42,650,8,42,11,42,12,42,651,1,42, - 1,42,3,42,656,8,42,1,42,1,42,1,42,1,42,1,42,4,42,663,8,42,11,42, - 12,42,664,1,42,1,42,3,42,669,8,42,1,42,1,42,1,42,1,42,1,42,1,42, - 1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,5,42,685,8,42,10,42,12,42, - 688,9,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42, - 1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,3,42,710,8,42,1,43, - 1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,45,1,45,1,45,1,45,1,45, - 1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,3,45,734,8,45,1,45,3,45, - 737,8,45,1,45,1,45,1,45,1,45,1,45,3,45,744,8,45,1,45,3,45,747,8, - 45,1,45,1,45,1,45,1,45,3,45,753,8,45,1,45,1,45,1,45,1,45,3,45,759, - 8,45,1,45,1,45,1,45,1,45,1,45,1,45,3,45,767,8,45,1,46,1,46,1,46, - 1,46,5,46,773,8,46,10,46,12,46,776,9,46,1,46,1,46,1,47,1,47,1,47, - 1,47,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,3,48,792,8,48,1,49, - 1,49,1,49,1,49,1,49,3,49,799,8,49,1,50,1,50,1,50,5,50,804,8,50,10, - 50,12,50,807,9,50,1,51,1,51,1,52,1,52,1,53,1,53,1,54,1,54,1,54,0, - 3,30,74,82,55,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36, + 52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2, + 59,7,59,1,0,5,0,122,8,0,10,0,12,0,125,9,0,1,0,1,0,1,1,1,1,1,2,1, + 2,3,2,133,8,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,3,142,8,3,1,4,3,4,145, + 8,4,1,4,1,4,1,5,1,5,3,5,151,8,5,1,5,1,5,1,5,5,5,156,8,5,10,5,12, + 5,159,9,5,1,6,1,6,3,6,163,8,6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1, + 7,5,7,174,8,7,10,7,12,7,177,9,7,1,7,1,7,1,8,1,8,1,8,3,8,184,8,8, + 1,8,5,8,187,8,8,10,8,12,8,190,9,8,1,9,1,9,1,10,1,10,1,10,1,10,1, + 10,3,10,199,8,10,1,11,1,11,3,11,203,8,11,1,11,1,11,1,11,5,11,208, + 8,11,10,11,12,11,211,9,11,1,11,3,11,214,8,11,1,11,3,11,217,8,11, + 1,11,3,11,220,8,11,1,11,3,11,223,8,11,1,11,3,11,226,8,11,1,11,3, + 11,229,8,11,1,12,1,12,1,13,1,13,3,13,235,8,13,1,13,3,13,238,8,13, + 1,13,1,13,1,13,1,13,1,13,1,13,1,13,3,13,247,8,13,1,14,1,14,1,14, + 1,14,5,14,253,8,14,10,14,12,14,256,9,14,1,15,1,15,1,15,1,15,1,15, + 1,15,1,15,1,15,1,15,1,15,5,15,268,8,15,10,15,12,15,271,9,15,1,16, + 3,16,274,8,16,1,16,1,16,3,16,278,8,16,1,16,1,16,3,16,282,8,16,1, + 16,1,16,3,16,286,8,16,1,16,3,16,289,8,16,1,17,1,17,3,17,293,8,17, + 1,17,3,17,296,8,17,1,18,1,18,1,18,1,18,1,18,3,18,303,8,18,1,19,1, + 19,1,19,1,19,3,19,309,8,19,1,20,1,20,1,20,3,20,314,8,20,1,20,1,20, + 1,20,5,20,319,8,20,10,20,12,20,322,9,20,1,21,1,21,1,21,1,21,3,21, + 328,8,21,1,22,1,22,1,22,1,22,1,22,5,22,335,8,22,10,22,12,22,338, + 9,22,1,23,1,23,3,23,342,8,23,1,23,1,23,3,23,346,8,23,1,24,1,24,1, + 24,1,24,3,24,352,8,24,1,25,1,25,1,25,1,25,3,25,358,8,25,1,25,1,25, + 1,26,1,26,1,26,1,26,5,26,366,8,26,10,26,12,26,369,9,26,1,26,1,26, + 1,27,1,27,1,27,1,27,1,27,1,27,5,27,379,8,27,10,27,12,27,382,9,27, + 1,27,3,27,385,8,27,1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,3,29, + 395,8,29,1,30,1,30,1,30,1,30,1,30,3,30,402,8,30,1,30,1,30,1,30,1, + 30,1,30,5,30,409,8,30,10,30,12,30,412,9,30,1,30,1,30,1,30,3,30,417, + 8,30,1,31,1,31,3,31,421,8,31,1,32,1,32,1,32,1,32,3,32,427,8,32,1, + 32,1,32,3,32,431,8,32,1,32,1,32,3,32,435,8,32,1,33,1,33,1,34,1,34, + 3,34,441,8,34,1,34,1,34,1,34,1,34,1,34,1,34,5,34,449,8,34,10,34, + 12,34,452,9,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,5,34,461,8,34, + 10,34,12,34,464,9,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34, + 1,34,1,34,1,34,1,34,5,34,479,8,34,10,34,12,34,482,9,34,1,34,1,34, + 1,34,1,34,1,34,1,34,1,34,5,34,491,8,34,10,34,12,34,494,9,34,1,34, + 1,34,3,34,498,8,34,1,35,1,35,1,35,1,35,3,35,504,8,35,1,35,1,35,1, + 35,1,35,1,35,1,35,3,35,512,8,35,1,35,1,35,1,35,1,35,1,35,3,35,519, + 8,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35, + 1,35,1,35,1,35,1,35,1,35,3,35,538,8,35,1,36,1,36,1,36,1,36,3,36, + 544,8,36,1,36,1,36,1,37,1,37,1,38,1,38,1,38,1,38,3,38,554,8,38,1, + 38,1,38,1,38,1,38,1,38,1,38,5,38,562,8,38,10,38,12,38,565,9,38,1, + 39,1,39,3,39,569,8,39,1,40,1,40,1,40,1,40,3,40,575,8,40,1,40,1,40, + 1,40,1,40,1,40,5,40,582,8,40,10,40,12,40,585,9,40,1,40,1,40,1,40, + 3,40,590,8,40,1,40,1,40,1,40,1,40,1,40,1,40,3,40,598,8,40,1,40,1, + 40,1,40,1,40,1,40,1,40,3,40,606,8,40,1,40,1,40,1,40,1,40,3,40,612, + 8,40,1,40,1,40,3,40,616,8,40,1,40,1,40,1,40,3,40,621,8,40,1,40,1, + 40,1,40,3,40,626,8,40,1,41,1,41,1,42,1,42,1,42,1,42,3,42,634,8,42, + 1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,5,42,645,8,42,10,42, + 12,42,648,9,42,1,43,1,43,1,43,1,43,3,43,654,8,43,1,43,1,43,1,43, + 5,43,659,8,43,10,43,12,43,662,9,43,3,43,664,8,43,1,43,1,43,1,43, + 1,43,4,43,670,8,43,11,43,12,43,671,1,43,1,43,3,43,676,8,43,1,43, + 1,43,1,43,1,43,1,43,4,43,683,8,43,11,43,12,43,684,1,43,1,43,3,43, + 689,8,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43, + 1,43,1,43,1,43,5,43,705,8,43,10,43,12,43,708,9,43,1,43,1,43,1,43, + 1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,43, + 1,43,1,43,1,43,1,43,3,43,730,8,43,1,44,1,44,1,44,1,44,1,44,1,45, + 1,45,1,45,1,45,1,46,1,46,1,46,1,46,1,46,1,46,1,46,1,46,1,46,1,46, + 1,46,1,46,1,46,3,46,754,8,46,1,46,3,46,757,8,46,1,46,1,46,1,46,1, + 46,1,46,3,46,764,8,46,1,46,3,46,767,8,46,1,46,1,46,1,46,1,46,3,46, + 773,8,46,1,46,1,46,1,46,1,46,3,46,779,8,46,1,46,1,46,1,46,1,46,1, + 46,1,46,3,46,787,8,46,1,47,1,47,1,47,1,47,5,47,793,8,47,10,47,12, + 47,796,9,47,1,47,1,47,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1, + 49,1,49,1,49,1,49,3,49,812,8,49,1,50,1,50,1,50,1,50,1,50,3,50,819, + 8,50,1,51,1,51,1,51,5,51,824,8,51,10,51,12,51,827,9,51,1,52,1,52, + 1,52,1,52,1,52,1,52,3,52,835,8,52,1,53,1,53,1,53,3,53,840,8,53,1, + 54,1,54,1,55,1,55,1,56,1,56,1,57,1,57,1,58,1,58,1,59,1,59,1,59,0, + 3,30,76,84,60,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36, 38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80, - 82,84,86,88,90,92,94,96,98,100,102,104,106,108,0,8,3,0,36,36,52, - 52,87,87,2,0,6,6,30,30,2,0,10,10,29,29,2,0,39,39,57,57,1,0,95,100, - 1,0,101,102,1,0,103,105,22,0,5,6,10,10,12,15,18,18,20,21,24,27,29, - 29,31,31,38,40,43,43,46,46,50,51,56,58,60,60,63,66,70,70,75,75,78, - 78,80,80,82,86,88,88,90,91,912,0,113,1,0,0,0,2,118,1,0,0,0,4,120, - 1,0,0,0,6,131,1,0,0,0,8,134,1,0,0,0,10,138,1,0,0,0,12,150,1,0,0, - 0,14,159,1,0,0,0,16,170,1,0,0,0,18,181,1,0,0,0,20,188,1,0,0,0,22, - 190,1,0,0,0,24,220,1,0,0,0,26,234,1,0,0,0,28,236,1,0,0,0,30,245, - 1,0,0,0,32,276,1,0,0,0,34,278,1,0,0,0,36,290,1,0,0,0,38,292,1,0, - 0,0,40,295,1,0,0,0,42,308,1,0,0,0,44,311,1,0,0,0,46,321,1,0,0,0, - 48,329,1,0,0,0,50,335,1,0,0,0,52,343,1,0,0,0,54,354,1,0,0,0,56,368, - 1,0,0,0,58,372,1,0,0,0,60,378,1,0,0,0,62,402,1,0,0,0,64,404,1,0, - 0,0,66,420,1,0,0,0,68,479,1,0,0,0,70,519,1,0,0,0,72,527,1,0,0,0, - 74,533,1,0,0,0,76,546,1,0,0,0,78,605,1,0,0,0,80,607,1,0,0,0,82,613, - 1,0,0,0,84,709,1,0,0,0,86,711,1,0,0,0,88,716,1,0,0,0,90,766,1,0, - 0,0,92,768,1,0,0,0,94,779,1,0,0,0,96,791,1,0,0,0,98,798,1,0,0,0, - 100,800,1,0,0,0,102,808,1,0,0,0,104,810,1,0,0,0,106,812,1,0,0,0, - 108,814,1,0,0,0,110,112,3,2,1,0,111,110,1,0,0,0,112,115,1,0,0,0, - 113,111,1,0,0,0,113,114,1,0,0,0,114,116,1,0,0,0,115,113,1,0,0,0, - 116,117,5,0,0,1,117,1,1,0,0,0,118,119,3,4,2,0,119,3,1,0,0,0,120, - 122,3,6,3,0,121,123,5,108,0,0,122,121,1,0,0,0,122,123,1,0,0,0,123, - 5,1,0,0,0,124,132,3,8,4,0,125,132,3,50,25,0,126,132,3,54,27,0,127, - 132,3,58,29,0,128,132,3,60,30,0,129,132,3,68,34,0,130,132,3,70,35, - 0,131,124,1,0,0,0,131,125,1,0,0,0,131,126,1,0,0,0,131,127,1,0,0, - 0,131,128,1,0,0,0,131,129,1,0,0,0,131,130,1,0,0,0,132,7,1,0,0,0, - 133,135,3,10,5,0,134,133,1,0,0,0,134,135,1,0,0,0,135,136,1,0,0,0, - 136,137,3,16,8,0,137,9,1,0,0,0,138,140,5,94,0,0,139,141,5,72,0,0, - 140,139,1,0,0,0,140,141,1,0,0,0,141,142,1,0,0,0,142,147,3,12,6,0, - 143,144,5,1,0,0,144,146,3,12,6,0,145,143,1,0,0,0,146,149,1,0,0,0, - 147,145,1,0,0,0,147,148,1,0,0,0,148,11,1,0,0,0,149,147,1,0,0,0,150, - 152,3,98,49,0,151,153,3,14,7,0,152,151,1,0,0,0,152,153,1,0,0,0,153, - 154,1,0,0,0,154,155,5,9,0,0,155,156,5,2,0,0,156,157,3,8,4,0,157, - 158,5,3,0,0,158,13,1,0,0,0,159,160,5,2,0,0,160,165,3,98,49,0,161, - 162,5,1,0,0,162,164,3,98,49,0,163,161,1,0,0,0,164,167,1,0,0,0,165, - 163,1,0,0,0,165,166,1,0,0,0,166,168,1,0,0,0,167,165,1,0,0,0,168, - 169,5,3,0,0,169,15,1,0,0,0,170,178,3,18,9,0,171,173,7,0,0,0,172, - 174,5,6,0,0,173,172,1,0,0,0,173,174,1,0,0,0,174,175,1,0,0,0,175, - 177,3,18,9,0,176,171,1,0,0,0,177,180,1,0,0,0,178,176,1,0,0,0,178, - 179,1,0,0,0,179,17,1,0,0,0,180,178,1,0,0,0,181,182,3,20,10,0,182, - 19,1,0,0,0,183,189,3,22,11,0,184,185,5,2,0,0,185,186,3,8,4,0,186, - 187,5,3,0,0,187,189,1,0,0,0,188,183,1,0,0,0,188,184,1,0,0,0,189, - 21,1,0,0,0,190,192,5,76,0,0,191,193,3,24,12,0,192,191,1,0,0,0,192, - 193,1,0,0,0,193,194,1,0,0,0,194,199,3,26,13,0,195,196,5,1,0,0,196, - 198,3,26,13,0,197,195,1,0,0,0,198,201,1,0,0,0,199,197,1,0,0,0,199, - 200,1,0,0,0,200,203,1,0,0,0,201,199,1,0,0,0,202,204,3,28,14,0,203, - 202,1,0,0,0,203,204,1,0,0,0,204,206,1,0,0,0,205,207,3,38,19,0,206, - 205,1,0,0,0,206,207,1,0,0,0,207,209,1,0,0,0,208,210,3,40,20,0,209, - 208,1,0,0,0,209,210,1,0,0,0,210,212,1,0,0,0,211,213,3,42,21,0,212, - 211,1,0,0,0,212,213,1,0,0,0,213,215,1,0,0,0,214,216,3,44,22,0,215, - 214,1,0,0,0,215,216,1,0,0,0,216,218,1,0,0,0,217,219,3,48,24,0,218, - 217,1,0,0,0,218,219,1,0,0,0,219,23,1,0,0,0,220,221,7,1,0,0,221,25, - 1,0,0,0,222,227,3,72,36,0,223,225,5,9,0,0,224,223,1,0,0,0,224,225, - 1,0,0,0,225,226,1,0,0,0,226,228,3,98,49,0,227,224,1,0,0,0,227,228, - 1,0,0,0,228,235,1,0,0,0,229,230,3,100,50,0,230,231,5,4,0,0,231,232, - 5,103,0,0,232,235,1,0,0,0,233,235,5,103,0,0,234,222,1,0,0,0,234, - 229,1,0,0,0,234,233,1,0,0,0,235,27,1,0,0,0,236,237,5,42,0,0,237, - 242,3,30,15,0,238,239,5,1,0,0,239,241,3,30,15,0,240,238,1,0,0,0, - 241,244,1,0,0,0,242,240,1,0,0,0,242,243,1,0,0,0,243,29,1,0,0,0,244, - 242,1,0,0,0,245,246,6,15,-1,0,246,247,3,34,17,0,247,257,1,0,0,0, - 248,249,10,2,0,0,249,250,3,32,16,0,250,251,5,55,0,0,251,252,3,30, - 15,0,252,253,5,67,0,0,253,254,3,72,36,0,254,256,1,0,0,0,255,248, - 1,0,0,0,256,259,1,0,0,0,257,255,1,0,0,0,257,258,1,0,0,0,258,31,1, - 0,0,0,259,257,1,0,0,0,260,262,5,48,0,0,261,260,1,0,0,0,261,262,1, - 0,0,0,262,277,1,0,0,0,263,265,5,58,0,0,264,266,5,70,0,0,265,264, - 1,0,0,0,265,266,1,0,0,0,266,277,1,0,0,0,267,269,5,75,0,0,268,270, - 5,70,0,0,269,268,1,0,0,0,269,270,1,0,0,0,270,277,1,0,0,0,271,273, - 5,43,0,0,272,274,5,70,0,0,273,272,1,0,0,0,273,274,1,0,0,0,274,277, - 1,0,0,0,275,277,5,24,0,0,276,261,1,0,0,0,276,263,1,0,0,0,276,267, - 1,0,0,0,276,271,1,0,0,0,276,275,1,0,0,0,277,33,1,0,0,0,278,283,3, - 36,18,0,279,281,5,9,0,0,280,279,1,0,0,0,280,281,1,0,0,0,281,282, - 1,0,0,0,282,284,3,98,49,0,283,280,1,0,0,0,283,284,1,0,0,0,284,35, - 1,0,0,0,285,291,3,104,52,0,286,287,5,2,0,0,287,288,3,8,4,0,288,289, - 5,3,0,0,289,291,1,0,0,0,290,285,1,0,0,0,290,286,1,0,0,0,291,37,1, - 0,0,0,292,293,5,93,0,0,293,294,3,72,36,0,294,39,1,0,0,0,295,296, - 5,44,0,0,296,298,5,15,0,0,297,299,3,24,12,0,298,297,1,0,0,0,298, - 299,1,0,0,0,299,300,1,0,0,0,300,305,3,72,36,0,301,302,5,1,0,0,302, - 304,3,72,36,0,303,301,1,0,0,0,304,307,1,0,0,0,305,303,1,0,0,0,305, - 306,1,0,0,0,306,41,1,0,0,0,307,305,1,0,0,0,308,309,5,45,0,0,309, - 310,3,72,36,0,310,43,1,0,0,0,311,312,5,69,0,0,312,313,5,15,0,0,313, - 318,3,46,23,0,314,315,5,1,0,0,315,317,3,46,23,0,316,314,1,0,0,0, - 317,320,1,0,0,0,318,316,1,0,0,0,318,319,1,0,0,0,319,45,1,0,0,0,320, - 318,1,0,0,0,321,323,3,72,36,0,322,324,7,2,0,0,323,322,1,0,0,0,323, - 324,1,0,0,0,324,327,1,0,0,0,325,326,5,64,0,0,326,328,7,3,0,0,327, - 325,1,0,0,0,327,328,1,0,0,0,328,47,1,0,0,0,329,330,5,60,0,0,330, - 333,3,72,36,0,331,332,5,66,0,0,332,334,3,72,36,0,333,331,1,0,0,0, - 333,334,1,0,0,0,334,49,1,0,0,0,335,336,5,49,0,0,336,337,5,53,0,0, - 337,339,3,104,52,0,338,340,3,52,26,0,339,338,1,0,0,0,339,340,1,0, - 0,0,340,341,1,0,0,0,341,342,3,8,4,0,342,51,1,0,0,0,343,344,5,2,0, - 0,344,349,3,102,51,0,345,346,5,1,0,0,346,348,3,102,51,0,347,345, - 1,0,0,0,348,351,1,0,0,0,349,347,1,0,0,0,349,350,1,0,0,0,350,352, - 1,0,0,0,351,349,1,0,0,0,352,353,5,3,0,0,353,53,1,0,0,0,354,355,5, - 89,0,0,355,356,3,104,52,0,356,357,5,77,0,0,357,362,3,56,28,0,358, - 359,5,1,0,0,359,361,3,56,28,0,360,358,1,0,0,0,361,364,1,0,0,0,362, - 360,1,0,0,0,362,363,1,0,0,0,363,366,1,0,0,0,364,362,1,0,0,0,365, - 367,3,38,19,0,366,365,1,0,0,0,366,367,1,0,0,0,367,55,1,0,0,0,368, - 369,3,102,51,0,369,370,5,95,0,0,370,371,3,72,36,0,371,57,1,0,0,0, - 372,373,5,28,0,0,373,374,5,42,0,0,374,376,3,104,52,0,375,377,3,38, - 19,0,376,375,1,0,0,0,376,377,1,0,0,0,377,59,1,0,0,0,378,379,5,23, - 0,0,379,383,5,79,0,0,380,381,5,46,0,0,381,382,5,61,0,0,382,384,5, - 37,0,0,383,380,1,0,0,0,383,384,1,0,0,0,384,385,1,0,0,0,385,386,3, - 106,53,0,386,387,5,2,0,0,387,392,3,62,31,0,388,389,5,1,0,0,389,391, - 3,62,31,0,390,388,1,0,0,0,391,394,1,0,0,0,392,390,1,0,0,0,392,393, - 1,0,0,0,393,395,1,0,0,0,394,392,1,0,0,0,395,398,5,3,0,0,396,397, - 5,94,0,0,397,399,3,92,46,0,398,396,1,0,0,0,398,399,1,0,0,0,399,61, - 1,0,0,0,400,403,3,64,32,0,401,403,3,66,33,0,402,400,1,0,0,0,402, - 401,1,0,0,0,403,63,1,0,0,0,404,405,3,102,51,0,405,408,3,90,45,0, - 406,407,5,61,0,0,407,409,5,62,0,0,408,406,1,0,0,0,408,409,1,0,0, - 0,409,412,1,0,0,0,410,411,5,27,0,0,411,413,3,72,36,0,412,410,1,0, - 0,0,412,413,1,0,0,0,413,416,1,0,0,0,414,415,5,71,0,0,415,417,5,56, - 0,0,416,414,1,0,0,0,416,417,1,0,0,0,417,65,1,0,0,0,418,419,5,22, - 0,0,419,421,3,98,49,0,420,418,1,0,0,0,420,421,1,0,0,0,421,477,1, - 0,0,0,422,423,5,71,0,0,423,424,5,56,0,0,424,425,5,2,0,0,425,430, - 3,102,51,0,426,427,5,1,0,0,427,429,3,102,51,0,428,426,1,0,0,0,429, - 432,1,0,0,0,430,428,1,0,0,0,430,431,1,0,0,0,431,433,1,0,0,0,432, - 430,1,0,0,0,433,434,5,3,0,0,434,478,1,0,0,0,435,436,5,88,0,0,436, - 437,5,2,0,0,437,442,3,102,51,0,438,439,5,1,0,0,439,441,3,102,51, - 0,440,438,1,0,0,0,441,444,1,0,0,0,442,440,1,0,0,0,442,443,1,0,0, - 0,443,445,1,0,0,0,444,442,1,0,0,0,445,446,5,3,0,0,446,478,1,0,0, - 0,447,448,5,19,0,0,448,449,5,2,0,0,449,450,3,72,36,0,450,451,5,3, - 0,0,451,478,1,0,0,0,452,453,5,41,0,0,453,454,5,56,0,0,454,455,5, - 2,0,0,455,460,3,102,51,0,456,457,5,1,0,0,457,459,3,102,51,0,458, - 456,1,0,0,0,459,462,1,0,0,0,460,458,1,0,0,0,460,461,1,0,0,0,461, - 463,1,0,0,0,462,460,1,0,0,0,463,464,5,3,0,0,464,465,5,73,0,0,465, - 466,3,104,52,0,466,467,5,2,0,0,467,472,3,102,51,0,468,469,5,1,0, - 0,469,471,3,102,51,0,470,468,1,0,0,0,471,474,1,0,0,0,472,470,1,0, - 0,0,472,473,1,0,0,0,473,475,1,0,0,0,474,472,1,0,0,0,475,476,5,3, - 0,0,476,478,1,0,0,0,477,422,1,0,0,0,477,435,1,0,0,0,477,447,1,0, - 0,0,477,452,1,0,0,0,478,67,1,0,0,0,479,480,5,7,0,0,480,483,5,79, - 0,0,481,482,5,46,0,0,482,484,5,37,0,0,483,481,1,0,0,0,483,484,1, - 0,0,0,484,485,1,0,0,0,485,517,3,104,52,0,486,487,5,5,0,0,487,491, - 5,21,0,0,488,489,5,46,0,0,489,490,5,61,0,0,490,492,5,37,0,0,491, - 488,1,0,0,0,491,492,1,0,0,0,492,493,1,0,0,0,493,518,3,64,32,0,494, - 495,5,32,0,0,495,498,5,21,0,0,496,497,5,46,0,0,497,499,5,37,0,0, - 498,496,1,0,0,0,498,499,1,0,0,0,499,500,1,0,0,0,500,518,3,102,51, - 0,501,502,5,74,0,0,502,503,5,85,0,0,503,518,3,106,53,0,504,505,5, - 7,0,0,505,506,5,21,0,0,506,507,3,102,51,0,507,508,5,77,0,0,508,509, - 5,27,0,0,509,510,3,72,36,0,510,518,1,0,0,0,511,512,5,7,0,0,512,513, - 5,21,0,0,513,514,3,102,51,0,514,515,5,32,0,0,515,516,5,27,0,0,516, - 518,1,0,0,0,517,486,1,0,0,0,517,494,1,0,0,0,517,501,1,0,0,0,517, - 504,1,0,0,0,517,511,1,0,0,0,518,69,1,0,0,0,519,520,5,32,0,0,520, - 523,5,79,0,0,521,522,5,46,0,0,522,524,5,37,0,0,523,521,1,0,0,0,523, - 524,1,0,0,0,524,525,1,0,0,0,525,526,3,104,52,0,526,71,1,0,0,0,527, - 528,3,74,37,0,528,73,1,0,0,0,529,530,6,37,-1,0,530,534,3,76,38,0, - 531,532,5,61,0,0,532,534,3,74,37,3,533,529,1,0,0,0,533,531,1,0,0, - 0,534,543,1,0,0,0,535,536,10,2,0,0,536,537,5,8,0,0,537,542,3,74, - 37,3,538,539,10,1,0,0,539,540,5,68,0,0,540,542,3,74,37,2,541,535, - 1,0,0,0,541,538,1,0,0,0,542,545,1,0,0,0,543,541,1,0,0,0,543,544, - 1,0,0,0,544,75,1,0,0,0,545,543,1,0,0,0,546,548,3,82,41,0,547,549, - 3,78,39,0,548,547,1,0,0,0,548,549,1,0,0,0,549,77,1,0,0,0,550,551, - 3,80,40,0,551,552,3,82,41,0,552,606,1,0,0,0,553,555,5,61,0,0,554, - 553,1,0,0,0,554,555,1,0,0,0,555,556,1,0,0,0,556,557,5,47,0,0,557, - 558,5,2,0,0,558,563,3,72,36,0,559,560,5,1,0,0,560,562,3,72,36,0, - 561,559,1,0,0,0,562,565,1,0,0,0,563,561,1,0,0,0,563,564,1,0,0,0, - 564,566,1,0,0,0,565,563,1,0,0,0,566,567,5,3,0,0,567,606,1,0,0,0, - 568,570,5,61,0,0,569,568,1,0,0,0,569,570,1,0,0,0,570,571,1,0,0,0, - 571,572,5,47,0,0,572,573,5,2,0,0,573,574,3,8,4,0,574,575,5,3,0,0, - 575,606,1,0,0,0,576,578,5,61,0,0,577,576,1,0,0,0,577,578,1,0,0,0, - 578,579,1,0,0,0,579,580,5,11,0,0,580,581,3,82,41,0,581,582,5,8,0, - 0,582,583,3,82,41,0,583,606,1,0,0,0,584,586,5,61,0,0,585,584,1,0, - 0,0,585,586,1,0,0,0,586,587,1,0,0,0,587,588,5,59,0,0,588,591,3,82, - 41,0,589,590,5,35,0,0,590,592,3,82,41,0,591,589,1,0,0,0,591,592, - 1,0,0,0,592,606,1,0,0,0,593,595,5,54,0,0,594,596,5,61,0,0,595,594, - 1,0,0,0,595,596,1,0,0,0,596,597,1,0,0,0,597,606,5,62,0,0,598,600, - 5,54,0,0,599,601,5,61,0,0,600,599,1,0,0,0,600,601,1,0,0,0,601,602, - 1,0,0,0,602,603,5,30,0,0,603,604,5,42,0,0,604,606,3,82,41,0,605, - 550,1,0,0,0,605,554,1,0,0,0,605,569,1,0,0,0,605,577,1,0,0,0,605, - 585,1,0,0,0,605,593,1,0,0,0,605,598,1,0,0,0,606,79,1,0,0,0,607,608, - 7,4,0,0,608,81,1,0,0,0,609,610,6,41,-1,0,610,614,3,84,42,0,611,612, - 7,5,0,0,612,614,3,82,41,4,613,609,1,0,0,0,613,611,1,0,0,0,614,626, - 1,0,0,0,615,616,10,3,0,0,616,617,7,6,0,0,617,625,3,82,41,4,618,619, - 10,2,0,0,619,620,7,5,0,0,620,625,3,82,41,3,621,622,10,1,0,0,622, - 623,5,106,0,0,623,625,3,82,41,2,624,615,1,0,0,0,624,618,1,0,0,0, - 624,621,1,0,0,0,625,628,1,0,0,0,626,624,1,0,0,0,626,627,1,0,0,0, - 627,83,1,0,0,0,628,626,1,0,0,0,629,710,3,96,48,0,630,631,3,100,50, - 0,631,643,5,2,0,0,632,634,3,24,12,0,633,632,1,0,0,0,633,634,1,0, - 0,0,634,635,1,0,0,0,635,640,3,72,36,0,636,637,5,1,0,0,637,639,3, - 72,36,0,638,636,1,0,0,0,639,642,1,0,0,0,640,638,1,0,0,0,640,641, - 1,0,0,0,641,644,1,0,0,0,642,640,1,0,0,0,643,633,1,0,0,0,643,644, - 1,0,0,0,644,645,1,0,0,0,645,646,5,3,0,0,646,710,1,0,0,0,647,649, - 5,16,0,0,648,650,3,86,43,0,649,648,1,0,0,0,650,651,1,0,0,0,651,649, - 1,0,0,0,651,652,1,0,0,0,652,655,1,0,0,0,653,654,5,33,0,0,654,656, - 3,72,36,0,655,653,1,0,0,0,655,656,1,0,0,0,656,657,1,0,0,0,657,658, - 5,34,0,0,658,710,1,0,0,0,659,660,5,16,0,0,660,662,3,72,36,0,661, - 663,3,86,43,0,662,661,1,0,0,0,663,664,1,0,0,0,664,662,1,0,0,0,664, - 665,1,0,0,0,665,668,1,0,0,0,666,667,5,33,0,0,667,669,3,72,36,0,668, - 666,1,0,0,0,668,669,1,0,0,0,669,670,1,0,0,0,670,671,5,34,0,0,671, - 710,1,0,0,0,672,673,5,17,0,0,673,674,5,2,0,0,674,675,3,72,36,0,675, - 676,5,9,0,0,676,677,3,90,45,0,677,678,5,3,0,0,678,710,1,0,0,0,679, - 680,5,20,0,0,680,681,5,2,0,0,681,686,3,72,36,0,682,683,5,1,0,0,683, - 685,3,72,36,0,684,682,1,0,0,0,685,688,1,0,0,0,686,684,1,0,0,0,686, - 687,1,0,0,0,687,689,1,0,0,0,688,686,1,0,0,0,689,690,5,3,0,0,690, - 710,1,0,0,0,691,692,5,63,0,0,692,693,5,2,0,0,693,694,3,82,41,0,694, - 695,5,1,0,0,695,696,3,82,41,0,696,697,5,3,0,0,697,710,1,0,0,0,698, - 699,5,2,0,0,699,700,3,72,36,0,700,701,5,3,0,0,701,710,1,0,0,0,702, - 703,5,37,0,0,703,704,5,2,0,0,704,705,3,8,4,0,705,706,5,3,0,0,706, - 710,1,0,0,0,707,710,3,88,44,0,708,710,3,100,50,0,709,629,1,0,0,0, - 709,630,1,0,0,0,709,647,1,0,0,0,709,659,1,0,0,0,709,672,1,0,0,0, - 709,679,1,0,0,0,709,691,1,0,0,0,709,698,1,0,0,0,709,702,1,0,0,0, - 709,707,1,0,0,0,709,708,1,0,0,0,710,85,1,0,0,0,711,712,5,92,0,0, - 712,713,3,72,36,0,713,714,5,81,0,0,714,715,3,72,36,0,715,87,1,0, - 0,0,716,717,5,2,0,0,717,718,3,8,4,0,718,719,5,3,0,0,719,89,1,0,0, - 0,720,767,5,14,0,0,721,767,5,84,0,0,722,767,5,78,0,0,723,767,5,50, - 0,0,724,767,5,51,0,0,725,767,5,12,0,0,726,767,5,40,0,0,727,767,5, - 31,0,0,728,736,5,26,0,0,729,730,5,2,0,0,730,733,5,111,0,0,731,732, - 5,1,0,0,732,734,5,111,0,0,733,731,1,0,0,0,733,734,1,0,0,0,734,735, - 1,0,0,0,735,737,5,3,0,0,736,729,1,0,0,0,736,737,1,0,0,0,737,767, - 1,0,0,0,738,746,5,65,0,0,739,740,5,2,0,0,740,743,5,111,0,0,741,742, - 5,1,0,0,742,744,5,111,0,0,743,741,1,0,0,0,743,744,1,0,0,0,744,745, - 1,0,0,0,745,747,5,3,0,0,746,739,1,0,0,0,746,747,1,0,0,0,747,767, - 1,0,0,0,748,752,5,90,0,0,749,750,5,2,0,0,750,751,5,111,0,0,751,753, - 5,3,0,0,752,749,1,0,0,0,752,753,1,0,0,0,753,767,1,0,0,0,754,758, - 5,18,0,0,755,756,5,2,0,0,756,757,5,111,0,0,757,759,5,3,0,0,758,755, - 1,0,0,0,758,759,1,0,0,0,759,767,1,0,0,0,760,767,5,80,0,0,761,767, - 5,25,0,0,762,767,5,82,0,0,763,767,5,83,0,0,764,767,5,13,0,0,765, - 767,5,91,0,0,766,720,1,0,0,0,766,721,1,0,0,0,766,722,1,0,0,0,766, - 723,1,0,0,0,766,724,1,0,0,0,766,725,1,0,0,0,766,726,1,0,0,0,766, - 727,1,0,0,0,766,728,1,0,0,0,766,738,1,0,0,0,766,748,1,0,0,0,766, - 754,1,0,0,0,766,760,1,0,0,0,766,761,1,0,0,0,766,762,1,0,0,0,766, - 763,1,0,0,0,766,764,1,0,0,0,766,765,1,0,0,0,767,91,1,0,0,0,768,769, - 5,2,0,0,769,774,3,94,47,0,770,771,5,1,0,0,771,773,3,94,47,0,772, - 770,1,0,0,0,773,776,1,0,0,0,774,772,1,0,0,0,774,775,1,0,0,0,775, - 777,1,0,0,0,776,774,1,0,0,0,777,778,5,3,0,0,778,93,1,0,0,0,779,780, - 3,98,49,0,780,781,5,95,0,0,781,782,3,96,48,0,782,95,1,0,0,0,783, - 792,5,62,0,0,784,792,5,86,0,0,785,792,5,38,0,0,786,792,5,111,0,0, - 787,792,5,112,0,0,788,792,5,113,0,0,789,792,5,109,0,0,790,792,5, - 110,0,0,791,783,1,0,0,0,791,784,1,0,0,0,791,785,1,0,0,0,791,786, - 1,0,0,0,791,787,1,0,0,0,791,788,1,0,0,0,791,789,1,0,0,0,791,790, - 1,0,0,0,792,97,1,0,0,0,793,799,5,114,0,0,794,799,5,115,0,0,795,799, - 5,116,0,0,796,799,5,117,0,0,797,799,3,108,54,0,798,793,1,0,0,0,798, - 794,1,0,0,0,798,795,1,0,0,0,798,796,1,0,0,0,798,797,1,0,0,0,799, - 99,1,0,0,0,800,805,3,98,49,0,801,802,5,4,0,0,802,804,3,98,49,0,803, - 801,1,0,0,0,804,807,1,0,0,0,805,803,1,0,0,0,805,806,1,0,0,0,806, - 101,1,0,0,0,807,805,1,0,0,0,808,809,3,98,49,0,809,103,1,0,0,0,810, - 811,3,100,50,0,811,105,1,0,0,0,812,813,3,100,50,0,813,107,1,0,0, - 0,814,815,7,7,0,0,815,109,1,0,0,0,97,113,122,131,134,140,147,152, - 165,173,178,188,192,199,203,206,209,212,215,218,224,227,234,242, - 257,261,265,269,273,276,280,283,290,298,305,318,323,327,333,339, - 349,362,366,376,383,392,398,402,408,412,416,420,430,442,460,472, - 477,483,491,498,517,523,533,541,543,548,554,563,569,577,585,591, - 595,600,605,613,624,626,633,640,643,651,655,664,668,686,709,733, - 736,743,746,752,758,766,774,791,798,805 + 82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118, + 0,8,3,0,36,36,52,52,87,87,2,0,6,6,30,30,2,0,10,10,29,29,2,0,39,39, + 57,57,1,0,95,100,1,0,101,102,1,0,103,105,22,0,5,6,10,10,12,15,18, + 18,20,21,24,27,29,29,31,31,38,40,43,43,46,46,50,51,56,58,60,60,63, + 66,70,70,75,75,78,78,80,80,82,86,88,88,90,91,949,0,123,1,0,0,0,2, + 128,1,0,0,0,4,130,1,0,0,0,6,141,1,0,0,0,8,144,1,0,0,0,10,148,1,0, + 0,0,12,160,1,0,0,0,14,169,1,0,0,0,16,180,1,0,0,0,18,191,1,0,0,0, + 20,198,1,0,0,0,22,200,1,0,0,0,24,230,1,0,0,0,26,246,1,0,0,0,28,248, + 1,0,0,0,30,257,1,0,0,0,32,288,1,0,0,0,34,290,1,0,0,0,36,302,1,0, + 0,0,38,304,1,0,0,0,40,310,1,0,0,0,42,323,1,0,0,0,44,329,1,0,0,0, + 46,339,1,0,0,0,48,347,1,0,0,0,50,353,1,0,0,0,52,361,1,0,0,0,54,372, + 1,0,0,0,56,386,1,0,0,0,58,390,1,0,0,0,60,396,1,0,0,0,62,420,1,0, + 0,0,64,422,1,0,0,0,66,436,1,0,0,0,68,440,1,0,0,0,70,499,1,0,0,0, + 72,539,1,0,0,0,74,547,1,0,0,0,76,553,1,0,0,0,78,566,1,0,0,0,80,625, + 1,0,0,0,82,627,1,0,0,0,84,633,1,0,0,0,86,729,1,0,0,0,88,731,1,0, + 0,0,90,736,1,0,0,0,92,786,1,0,0,0,94,788,1,0,0,0,96,799,1,0,0,0, + 98,811,1,0,0,0,100,818,1,0,0,0,102,820,1,0,0,0,104,834,1,0,0,0,106, + 839,1,0,0,0,108,841,1,0,0,0,110,843,1,0,0,0,112,845,1,0,0,0,114, + 847,1,0,0,0,116,849,1,0,0,0,118,851,1,0,0,0,120,122,3,2,1,0,121, + 120,1,0,0,0,122,125,1,0,0,0,123,121,1,0,0,0,123,124,1,0,0,0,124, + 126,1,0,0,0,125,123,1,0,0,0,126,127,5,0,0,1,127,1,1,0,0,0,128,129, + 3,4,2,0,129,3,1,0,0,0,130,132,3,6,3,0,131,133,5,108,0,0,132,131, + 1,0,0,0,132,133,1,0,0,0,133,5,1,0,0,0,134,142,3,8,4,0,135,142,3, + 50,25,0,136,142,3,54,27,0,137,142,3,58,29,0,138,142,3,60,30,0,139, + 142,3,70,35,0,140,142,3,72,36,0,141,134,1,0,0,0,141,135,1,0,0,0, + 141,136,1,0,0,0,141,137,1,0,0,0,141,138,1,0,0,0,141,139,1,0,0,0, + 141,140,1,0,0,0,142,7,1,0,0,0,143,145,3,10,5,0,144,143,1,0,0,0,144, + 145,1,0,0,0,145,146,1,0,0,0,146,147,3,16,8,0,147,9,1,0,0,0,148,150, + 5,94,0,0,149,151,5,72,0,0,150,149,1,0,0,0,150,151,1,0,0,0,151,152, + 1,0,0,0,152,157,3,12,6,0,153,154,5,1,0,0,154,156,3,12,6,0,155,153, + 1,0,0,0,156,159,1,0,0,0,157,155,1,0,0,0,157,158,1,0,0,0,158,11,1, + 0,0,0,159,157,1,0,0,0,160,162,3,100,50,0,161,163,3,14,7,0,162,161, + 1,0,0,0,162,163,1,0,0,0,163,164,1,0,0,0,164,165,5,9,0,0,165,166, + 5,2,0,0,166,167,3,8,4,0,167,168,5,3,0,0,168,13,1,0,0,0,169,170,5, + 2,0,0,170,175,3,100,50,0,171,172,5,1,0,0,172,174,3,100,50,0,173, + 171,1,0,0,0,174,177,1,0,0,0,175,173,1,0,0,0,175,176,1,0,0,0,176, + 178,1,0,0,0,177,175,1,0,0,0,178,179,5,3,0,0,179,15,1,0,0,0,180,188, + 3,18,9,0,181,183,7,0,0,0,182,184,5,6,0,0,183,182,1,0,0,0,183,184, + 1,0,0,0,184,185,1,0,0,0,185,187,3,18,9,0,186,181,1,0,0,0,187,190, + 1,0,0,0,188,186,1,0,0,0,188,189,1,0,0,0,189,17,1,0,0,0,190,188,1, + 0,0,0,191,192,3,20,10,0,192,19,1,0,0,0,193,199,3,22,11,0,194,195, + 5,2,0,0,195,196,3,8,4,0,196,197,5,3,0,0,197,199,1,0,0,0,198,193, + 1,0,0,0,198,194,1,0,0,0,199,21,1,0,0,0,200,202,5,76,0,0,201,203, + 3,24,12,0,202,201,1,0,0,0,202,203,1,0,0,0,203,204,1,0,0,0,204,209, + 3,26,13,0,205,206,5,1,0,0,206,208,3,26,13,0,207,205,1,0,0,0,208, + 211,1,0,0,0,209,207,1,0,0,0,209,210,1,0,0,0,210,213,1,0,0,0,211, + 209,1,0,0,0,212,214,3,28,14,0,213,212,1,0,0,0,213,214,1,0,0,0,214, + 216,1,0,0,0,215,217,3,38,19,0,216,215,1,0,0,0,216,217,1,0,0,0,217, + 219,1,0,0,0,218,220,3,40,20,0,219,218,1,0,0,0,219,220,1,0,0,0,220, + 222,1,0,0,0,221,223,3,42,21,0,222,221,1,0,0,0,222,223,1,0,0,0,223, + 225,1,0,0,0,224,226,3,44,22,0,225,224,1,0,0,0,225,226,1,0,0,0,226, + 228,1,0,0,0,227,229,3,48,24,0,228,227,1,0,0,0,228,229,1,0,0,0,229, + 23,1,0,0,0,230,231,7,1,0,0,231,25,1,0,0,0,232,237,3,74,37,0,233, + 235,5,9,0,0,234,233,1,0,0,0,234,235,1,0,0,0,235,236,1,0,0,0,236, + 238,3,100,50,0,237,234,1,0,0,0,237,238,1,0,0,0,238,247,1,0,0,0,239, + 240,3,102,51,0,240,241,5,4,0,0,241,242,5,103,0,0,242,247,1,0,0,0, + 243,247,5,103,0,0,244,245,4,13,0,0,245,247,3,110,55,0,246,232,1, + 0,0,0,246,239,1,0,0,0,246,243,1,0,0,0,246,244,1,0,0,0,247,27,1,0, + 0,0,248,249,5,42,0,0,249,254,3,30,15,0,250,251,5,1,0,0,251,253,3, + 30,15,0,252,250,1,0,0,0,253,256,1,0,0,0,254,252,1,0,0,0,254,255, + 1,0,0,0,255,29,1,0,0,0,256,254,1,0,0,0,257,258,6,15,-1,0,258,259, + 3,34,17,0,259,269,1,0,0,0,260,261,10,2,0,0,261,262,3,32,16,0,262, + 263,5,55,0,0,263,264,3,30,15,0,264,265,5,67,0,0,265,266,3,74,37, + 0,266,268,1,0,0,0,267,260,1,0,0,0,268,271,1,0,0,0,269,267,1,0,0, + 0,269,270,1,0,0,0,270,31,1,0,0,0,271,269,1,0,0,0,272,274,5,48,0, + 0,273,272,1,0,0,0,273,274,1,0,0,0,274,289,1,0,0,0,275,277,5,58,0, + 0,276,278,5,70,0,0,277,276,1,0,0,0,277,278,1,0,0,0,278,289,1,0,0, + 0,279,281,5,75,0,0,280,282,5,70,0,0,281,280,1,0,0,0,281,282,1,0, + 0,0,282,289,1,0,0,0,283,285,5,43,0,0,284,286,5,70,0,0,285,284,1, + 0,0,0,285,286,1,0,0,0,286,289,1,0,0,0,287,289,5,24,0,0,288,273,1, + 0,0,0,288,275,1,0,0,0,288,279,1,0,0,0,288,283,1,0,0,0,288,287,1, + 0,0,0,289,33,1,0,0,0,290,295,3,36,18,0,291,293,5,9,0,0,292,291,1, + 0,0,0,292,293,1,0,0,0,293,294,1,0,0,0,294,296,3,100,50,0,295,292, + 1,0,0,0,295,296,1,0,0,0,296,35,1,0,0,0,297,303,3,112,56,0,298,299, + 5,2,0,0,299,300,3,8,4,0,300,301,5,3,0,0,301,303,1,0,0,0,302,297, + 1,0,0,0,302,298,1,0,0,0,303,37,1,0,0,0,304,308,5,93,0,0,305,309, + 3,74,37,0,306,307,4,19,2,0,307,309,3,110,55,0,308,305,1,0,0,0,308, + 306,1,0,0,0,309,39,1,0,0,0,310,311,5,44,0,0,311,313,5,15,0,0,312, + 314,3,24,12,0,313,312,1,0,0,0,313,314,1,0,0,0,314,315,1,0,0,0,315, + 320,3,74,37,0,316,317,5,1,0,0,317,319,3,74,37,0,318,316,1,0,0,0, + 319,322,1,0,0,0,320,318,1,0,0,0,320,321,1,0,0,0,321,41,1,0,0,0,322, + 320,1,0,0,0,323,327,5,45,0,0,324,328,3,74,37,0,325,326,4,21,3,0, + 326,328,3,110,55,0,327,324,1,0,0,0,327,325,1,0,0,0,328,43,1,0,0, + 0,329,330,5,69,0,0,330,331,5,15,0,0,331,336,3,46,23,0,332,333,5, + 1,0,0,333,335,3,46,23,0,334,332,1,0,0,0,335,338,1,0,0,0,336,334, + 1,0,0,0,336,337,1,0,0,0,337,45,1,0,0,0,338,336,1,0,0,0,339,341,3, + 74,37,0,340,342,7,2,0,0,341,340,1,0,0,0,341,342,1,0,0,0,342,345, + 1,0,0,0,343,344,5,64,0,0,344,346,7,3,0,0,345,343,1,0,0,0,345,346, + 1,0,0,0,346,47,1,0,0,0,347,348,5,60,0,0,348,351,3,74,37,0,349,350, + 5,66,0,0,350,352,3,74,37,0,351,349,1,0,0,0,351,352,1,0,0,0,352,49, + 1,0,0,0,353,354,5,49,0,0,354,355,5,53,0,0,355,357,3,112,56,0,356, + 358,3,52,26,0,357,356,1,0,0,0,357,358,1,0,0,0,358,359,1,0,0,0,359, + 360,3,8,4,0,360,51,1,0,0,0,361,362,5,2,0,0,362,367,3,106,53,0,363, + 364,5,1,0,0,364,366,3,106,53,0,365,363,1,0,0,0,366,369,1,0,0,0,367, + 365,1,0,0,0,367,368,1,0,0,0,368,370,1,0,0,0,369,367,1,0,0,0,370, + 371,5,3,0,0,371,53,1,0,0,0,372,373,5,89,0,0,373,374,3,112,56,0,374, + 375,5,77,0,0,375,380,3,56,28,0,376,377,5,1,0,0,377,379,3,56,28,0, + 378,376,1,0,0,0,379,382,1,0,0,0,380,378,1,0,0,0,380,381,1,0,0,0, + 381,384,1,0,0,0,382,380,1,0,0,0,383,385,3,38,19,0,384,383,1,0,0, + 0,384,385,1,0,0,0,385,55,1,0,0,0,386,387,3,106,53,0,387,388,5,95, + 0,0,388,389,3,74,37,0,389,57,1,0,0,0,390,391,5,28,0,0,391,392,5, + 42,0,0,392,394,3,112,56,0,393,395,3,38,19,0,394,393,1,0,0,0,394, + 395,1,0,0,0,395,59,1,0,0,0,396,397,5,23,0,0,397,401,5,79,0,0,398, + 399,5,46,0,0,399,400,5,61,0,0,400,402,5,37,0,0,401,398,1,0,0,0,401, + 402,1,0,0,0,402,403,1,0,0,0,403,404,3,114,57,0,404,405,5,2,0,0,405, + 410,3,62,31,0,406,407,5,1,0,0,407,409,3,62,31,0,408,406,1,0,0,0, + 409,412,1,0,0,0,410,408,1,0,0,0,410,411,1,0,0,0,411,413,1,0,0,0, + 412,410,1,0,0,0,413,416,5,3,0,0,414,415,5,94,0,0,415,417,3,94,47, + 0,416,414,1,0,0,0,416,417,1,0,0,0,417,61,1,0,0,0,418,421,3,64,32, + 0,419,421,3,68,34,0,420,418,1,0,0,0,420,419,1,0,0,0,421,63,1,0,0, + 0,422,423,3,66,33,0,423,426,3,92,46,0,424,425,5,61,0,0,425,427,5, + 62,0,0,426,424,1,0,0,0,426,427,1,0,0,0,427,430,1,0,0,0,428,429,5, + 27,0,0,429,431,3,74,37,0,430,428,1,0,0,0,430,431,1,0,0,0,431,434, + 1,0,0,0,432,433,5,71,0,0,433,435,5,56,0,0,434,432,1,0,0,0,434,435, + 1,0,0,0,435,65,1,0,0,0,436,437,3,100,50,0,437,67,1,0,0,0,438,439, + 5,22,0,0,439,441,3,100,50,0,440,438,1,0,0,0,440,441,1,0,0,0,441, + 497,1,0,0,0,442,443,5,71,0,0,443,444,5,56,0,0,444,445,5,2,0,0,445, + 450,3,106,53,0,446,447,5,1,0,0,447,449,3,106,53,0,448,446,1,0,0, + 0,449,452,1,0,0,0,450,448,1,0,0,0,450,451,1,0,0,0,451,453,1,0,0, + 0,452,450,1,0,0,0,453,454,5,3,0,0,454,498,1,0,0,0,455,456,5,88,0, + 0,456,457,5,2,0,0,457,462,3,106,53,0,458,459,5,1,0,0,459,461,3,106, + 53,0,460,458,1,0,0,0,461,464,1,0,0,0,462,460,1,0,0,0,462,463,1,0, + 0,0,463,465,1,0,0,0,464,462,1,0,0,0,465,466,5,3,0,0,466,498,1,0, + 0,0,467,468,5,19,0,0,468,469,5,2,0,0,469,470,3,74,37,0,470,471,5, + 3,0,0,471,498,1,0,0,0,472,473,5,41,0,0,473,474,5,56,0,0,474,475, + 5,2,0,0,475,480,3,106,53,0,476,477,5,1,0,0,477,479,3,106,53,0,478, + 476,1,0,0,0,479,482,1,0,0,0,480,478,1,0,0,0,480,481,1,0,0,0,481, + 483,1,0,0,0,482,480,1,0,0,0,483,484,5,3,0,0,484,485,5,73,0,0,485, + 486,3,112,56,0,486,487,5,2,0,0,487,492,3,106,53,0,488,489,5,1,0, + 0,489,491,3,106,53,0,490,488,1,0,0,0,491,494,1,0,0,0,492,490,1,0, + 0,0,492,493,1,0,0,0,493,495,1,0,0,0,494,492,1,0,0,0,495,496,5,3, + 0,0,496,498,1,0,0,0,497,442,1,0,0,0,497,455,1,0,0,0,497,467,1,0, + 0,0,497,472,1,0,0,0,498,69,1,0,0,0,499,500,5,7,0,0,500,503,5,79, + 0,0,501,502,5,46,0,0,502,504,5,37,0,0,503,501,1,0,0,0,503,504,1, + 0,0,0,504,505,1,0,0,0,505,537,3,112,56,0,506,507,5,5,0,0,507,511, + 5,21,0,0,508,509,5,46,0,0,509,510,5,61,0,0,510,512,5,37,0,0,511, + 508,1,0,0,0,511,512,1,0,0,0,512,513,1,0,0,0,513,538,3,64,32,0,514, + 515,5,32,0,0,515,518,5,21,0,0,516,517,5,46,0,0,517,519,5,37,0,0, + 518,516,1,0,0,0,518,519,1,0,0,0,519,520,1,0,0,0,520,538,3,106,53, + 0,521,522,5,74,0,0,522,523,5,85,0,0,523,538,3,114,57,0,524,525,5, + 7,0,0,525,526,5,21,0,0,526,527,3,106,53,0,527,528,5,77,0,0,528,529, + 5,27,0,0,529,530,3,74,37,0,530,538,1,0,0,0,531,532,5,7,0,0,532,533, + 5,21,0,0,533,534,3,106,53,0,534,535,5,32,0,0,535,536,5,27,0,0,536, + 538,1,0,0,0,537,506,1,0,0,0,537,514,1,0,0,0,537,521,1,0,0,0,537, + 524,1,0,0,0,537,531,1,0,0,0,538,71,1,0,0,0,539,540,5,32,0,0,540, + 543,5,79,0,0,541,542,5,46,0,0,542,544,5,37,0,0,543,541,1,0,0,0,543, + 544,1,0,0,0,544,545,1,0,0,0,545,546,3,112,56,0,546,73,1,0,0,0,547, + 548,3,76,38,0,548,75,1,0,0,0,549,550,6,38,-1,0,550,554,3,78,39,0, + 551,552,5,61,0,0,552,554,3,76,38,3,553,549,1,0,0,0,553,551,1,0,0, + 0,554,563,1,0,0,0,555,556,10,2,0,0,556,557,5,8,0,0,557,562,3,76, + 38,3,558,559,10,1,0,0,559,560,5,68,0,0,560,562,3,76,38,2,561,555, + 1,0,0,0,561,558,1,0,0,0,562,565,1,0,0,0,563,561,1,0,0,0,563,564, + 1,0,0,0,564,77,1,0,0,0,565,563,1,0,0,0,566,568,3,84,42,0,567,569, + 3,80,40,0,568,567,1,0,0,0,568,569,1,0,0,0,569,79,1,0,0,0,570,571, + 3,82,41,0,571,572,3,84,42,0,572,626,1,0,0,0,573,575,5,61,0,0,574, + 573,1,0,0,0,574,575,1,0,0,0,575,576,1,0,0,0,576,577,5,47,0,0,577, + 578,5,2,0,0,578,583,3,74,37,0,579,580,5,1,0,0,580,582,3,74,37,0, + 581,579,1,0,0,0,582,585,1,0,0,0,583,581,1,0,0,0,583,584,1,0,0,0, + 584,586,1,0,0,0,585,583,1,0,0,0,586,587,5,3,0,0,587,626,1,0,0,0, + 588,590,5,61,0,0,589,588,1,0,0,0,589,590,1,0,0,0,590,591,1,0,0,0, + 591,592,5,47,0,0,592,593,5,2,0,0,593,594,3,8,4,0,594,595,5,3,0,0, + 595,626,1,0,0,0,596,598,5,61,0,0,597,596,1,0,0,0,597,598,1,0,0,0, + 598,599,1,0,0,0,599,600,5,11,0,0,600,601,3,84,42,0,601,602,5,8,0, + 0,602,603,3,84,42,0,603,626,1,0,0,0,604,606,5,61,0,0,605,604,1,0, + 0,0,605,606,1,0,0,0,606,607,1,0,0,0,607,608,5,59,0,0,608,611,3,84, + 42,0,609,610,5,35,0,0,610,612,3,84,42,0,611,609,1,0,0,0,611,612, + 1,0,0,0,612,626,1,0,0,0,613,615,5,54,0,0,614,616,5,61,0,0,615,614, + 1,0,0,0,615,616,1,0,0,0,616,617,1,0,0,0,617,626,5,62,0,0,618,620, + 5,54,0,0,619,621,5,61,0,0,620,619,1,0,0,0,620,621,1,0,0,0,621,622, + 1,0,0,0,622,623,5,30,0,0,623,624,5,42,0,0,624,626,3,84,42,0,625, + 570,1,0,0,0,625,574,1,0,0,0,625,589,1,0,0,0,625,597,1,0,0,0,625, + 605,1,0,0,0,625,613,1,0,0,0,625,618,1,0,0,0,626,81,1,0,0,0,627,628, + 7,4,0,0,628,83,1,0,0,0,629,630,6,42,-1,0,630,634,3,86,43,0,631,632, + 7,5,0,0,632,634,3,84,42,4,633,629,1,0,0,0,633,631,1,0,0,0,634,646, + 1,0,0,0,635,636,10,3,0,0,636,637,7,6,0,0,637,645,3,84,42,4,638,639, + 10,2,0,0,639,640,7,5,0,0,640,645,3,84,42,3,641,642,10,1,0,0,642, + 643,5,106,0,0,643,645,3,84,42,2,644,635,1,0,0,0,644,638,1,0,0,0, + 644,641,1,0,0,0,645,648,1,0,0,0,646,644,1,0,0,0,646,647,1,0,0,0, + 647,85,1,0,0,0,648,646,1,0,0,0,649,730,3,98,49,0,650,651,3,116,58, + 0,651,663,5,2,0,0,652,654,3,24,12,0,653,652,1,0,0,0,653,654,1,0, + 0,0,654,655,1,0,0,0,655,660,3,74,37,0,656,657,5,1,0,0,657,659,3, + 74,37,0,658,656,1,0,0,0,659,662,1,0,0,0,660,658,1,0,0,0,660,661, + 1,0,0,0,661,664,1,0,0,0,662,660,1,0,0,0,663,653,1,0,0,0,663,664, + 1,0,0,0,664,665,1,0,0,0,665,666,5,3,0,0,666,730,1,0,0,0,667,669, + 5,16,0,0,668,670,3,88,44,0,669,668,1,0,0,0,670,671,1,0,0,0,671,669, + 1,0,0,0,671,672,1,0,0,0,672,675,1,0,0,0,673,674,5,33,0,0,674,676, + 3,74,37,0,675,673,1,0,0,0,675,676,1,0,0,0,676,677,1,0,0,0,677,678, + 5,34,0,0,678,730,1,0,0,0,679,680,5,16,0,0,680,682,3,74,37,0,681, + 683,3,88,44,0,682,681,1,0,0,0,683,684,1,0,0,0,684,682,1,0,0,0,684, + 685,1,0,0,0,685,688,1,0,0,0,686,687,5,33,0,0,687,689,3,74,37,0,688, + 686,1,0,0,0,688,689,1,0,0,0,689,690,1,0,0,0,690,691,5,34,0,0,691, + 730,1,0,0,0,692,693,5,17,0,0,693,694,5,2,0,0,694,695,3,74,37,0,695, + 696,5,9,0,0,696,697,3,92,46,0,697,698,5,3,0,0,698,730,1,0,0,0,699, + 700,5,20,0,0,700,701,5,2,0,0,701,706,3,74,37,0,702,703,5,1,0,0,703, + 705,3,74,37,0,704,702,1,0,0,0,705,708,1,0,0,0,706,704,1,0,0,0,706, + 707,1,0,0,0,707,709,1,0,0,0,708,706,1,0,0,0,709,710,5,3,0,0,710, + 730,1,0,0,0,711,712,5,63,0,0,712,713,5,2,0,0,713,714,3,84,42,0,714, + 715,5,1,0,0,715,716,3,84,42,0,716,717,5,3,0,0,717,730,1,0,0,0,718, + 719,5,2,0,0,719,720,3,74,37,0,720,721,5,3,0,0,721,730,1,0,0,0,722, + 723,5,37,0,0,723,724,5,2,0,0,724,725,3,8,4,0,725,726,5,3,0,0,726, + 730,1,0,0,0,727,730,3,90,45,0,728,730,3,108,54,0,729,649,1,0,0,0, + 729,650,1,0,0,0,729,667,1,0,0,0,729,679,1,0,0,0,729,692,1,0,0,0, + 729,699,1,0,0,0,729,711,1,0,0,0,729,718,1,0,0,0,729,722,1,0,0,0, + 729,727,1,0,0,0,729,728,1,0,0,0,730,87,1,0,0,0,731,732,5,92,0,0, + 732,733,3,74,37,0,733,734,5,81,0,0,734,735,3,74,37,0,735,89,1,0, + 0,0,736,737,5,2,0,0,737,738,3,8,4,0,738,739,5,3,0,0,739,91,1,0,0, + 0,740,787,5,14,0,0,741,787,5,84,0,0,742,787,5,78,0,0,743,787,5,50, + 0,0,744,787,5,51,0,0,745,787,5,12,0,0,746,787,5,40,0,0,747,787,5, + 31,0,0,748,756,5,26,0,0,749,750,5,2,0,0,750,753,5,111,0,0,751,752, + 5,1,0,0,752,754,5,111,0,0,753,751,1,0,0,0,753,754,1,0,0,0,754,755, + 1,0,0,0,755,757,5,3,0,0,756,749,1,0,0,0,756,757,1,0,0,0,757,787, + 1,0,0,0,758,766,5,65,0,0,759,760,5,2,0,0,760,763,5,111,0,0,761,762, + 5,1,0,0,762,764,5,111,0,0,763,761,1,0,0,0,763,764,1,0,0,0,764,765, + 1,0,0,0,765,767,5,3,0,0,766,759,1,0,0,0,766,767,1,0,0,0,767,787, + 1,0,0,0,768,772,5,90,0,0,769,770,5,2,0,0,770,771,5,111,0,0,771,773, + 5,3,0,0,772,769,1,0,0,0,772,773,1,0,0,0,773,787,1,0,0,0,774,778, + 5,18,0,0,775,776,5,2,0,0,776,777,5,111,0,0,777,779,5,3,0,0,778,775, + 1,0,0,0,778,779,1,0,0,0,779,787,1,0,0,0,780,787,5,80,0,0,781,787, + 5,25,0,0,782,787,5,82,0,0,783,787,5,83,0,0,784,787,5,13,0,0,785, + 787,5,91,0,0,786,740,1,0,0,0,786,741,1,0,0,0,786,742,1,0,0,0,786, + 743,1,0,0,0,786,744,1,0,0,0,786,745,1,0,0,0,786,746,1,0,0,0,786, + 747,1,0,0,0,786,748,1,0,0,0,786,758,1,0,0,0,786,768,1,0,0,0,786, + 774,1,0,0,0,786,780,1,0,0,0,786,781,1,0,0,0,786,782,1,0,0,0,786, + 783,1,0,0,0,786,784,1,0,0,0,786,785,1,0,0,0,787,93,1,0,0,0,788,789, + 5,2,0,0,789,794,3,96,48,0,790,791,5,1,0,0,791,793,3,96,48,0,792, + 790,1,0,0,0,793,796,1,0,0,0,794,792,1,0,0,0,794,795,1,0,0,0,795, + 797,1,0,0,0,796,794,1,0,0,0,797,798,5,3,0,0,798,95,1,0,0,0,799,800, + 3,100,50,0,800,801,5,95,0,0,801,802,3,98,49,0,802,97,1,0,0,0,803, + 812,5,62,0,0,804,812,5,86,0,0,805,812,5,38,0,0,806,812,5,111,0,0, + 807,812,5,112,0,0,808,812,5,113,0,0,809,812,5,109,0,0,810,812,5, + 110,0,0,811,803,1,0,0,0,811,804,1,0,0,0,811,805,1,0,0,0,811,806, + 1,0,0,0,811,807,1,0,0,0,811,808,1,0,0,0,811,809,1,0,0,0,811,810, + 1,0,0,0,812,99,1,0,0,0,813,819,5,114,0,0,814,819,5,115,0,0,815,819, + 5,116,0,0,816,819,5,117,0,0,817,819,3,118,59,0,818,813,1,0,0,0,818, + 814,1,0,0,0,818,815,1,0,0,0,818,816,1,0,0,0,818,817,1,0,0,0,819, + 101,1,0,0,0,820,825,3,100,50,0,821,822,5,4,0,0,822,824,3,100,50, + 0,823,821,1,0,0,0,824,827,1,0,0,0,825,823,1,0,0,0,825,826,1,0,0, + 0,826,103,1,0,0,0,827,825,1,0,0,0,828,835,3,102,51,0,829,830,4,52, + 9,0,830,831,3,102,51,0,831,832,5,4,0,0,832,833,3,110,55,0,833,835, + 1,0,0,0,834,828,1,0,0,0,834,829,1,0,0,0,835,105,1,0,0,0,836,840, + 3,100,50,0,837,838,4,53,10,0,838,840,3,110,55,0,839,836,1,0,0,0, + 839,837,1,0,0,0,840,107,1,0,0,0,841,842,3,104,52,0,842,109,1,0,0, + 0,843,844,1,0,0,0,844,111,1,0,0,0,845,846,3,102,51,0,846,113,1,0, + 0,0,847,848,3,102,51,0,848,115,1,0,0,0,849,850,3,102,51,0,850,117, + 1,0,0,0,851,852,7,7,0,0,852,119,1,0,0,0,101,123,132,141,144,150, + 157,162,175,183,188,198,202,209,213,216,219,222,225,228,234,237, + 246,254,269,273,277,281,285,288,292,295,302,308,313,320,327,336, + 341,345,351,357,367,380,384,394,401,410,416,420,426,430,434,440, + 450,462,480,492,497,503,511,518,537,543,553,561,563,568,574,583, + 589,597,605,611,615,620,625,633,644,646,653,660,663,671,675,684, + 688,706,729,753,756,763,766,772,778,786,794,811,818,825,834,839 ]; private static __ATN: antlr.ATN; @@ -4981,12 +5134,24 @@ export class SetQuantifierContext extends antlr.ParserRuleContext { export class SelectItemContext extends antlr.ParserRuleContext { - public _alias?: IdentifierContext; public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public expression(): ExpressionContext | null { - return this.getRuleContext(0, ExpressionContext); + public override get ruleIndex(): number { + return GenericSqlParser.RULE_selectItem; + } + public override copyFrom(ctx: SelectItemContext): void { + super.copyFrom(ctx); + } +} +export class SelectExpressionElementContext extends SelectItemContext { + public _alias?: IdentifierContext; + public constructor(ctx: SelectItemContext) { + super(ctx.parent, ctx.invokingState); + super.copyFrom(ctx); + } + public expression(): ExpressionContext { + return this.getRuleContext(0, ExpressionContext)!; } public identifier(): IdentifierContext | null { return this.getRuleContext(0, IdentifierContext); @@ -4994,28 +5159,100 @@ export class SelectItemContext extends antlr.ParserRuleContext { public KW_AS(): antlr.TerminalNode | null { return this.getToken(GenericSqlParser.KW_AS, 0); } - public qualifiedName(): QualifiedNameContext | null { - return this.getRuleContext(0, QualifiedNameContext); + public override enterRule(listener: GenericSqlListener): void { + if(listener.enterSelectExpressionElement) { + listener.enterSelectExpressionElement(this); + } } - public ASTERISK(): antlr.TerminalNode | null { - return this.getToken(GenericSqlParser.ASTERISK, 0); + public override exitRule(listener: GenericSqlListener): void { + if(listener.exitSelectExpressionElement) { + listener.exitSelectExpressionElement(this); + } } - public override get ruleIndex(): number { - return GenericSqlParser.RULE_selectItem; + public override accept(visitor: GenericSqlVisitor): Result | null { + if (visitor.visitSelectExpressionElement) { + return visitor.visitSelectExpressionElement(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class SelectEmptyElementContext extends SelectItemContext { + public constructor(ctx: SelectItemContext) { + super(ctx.parent, ctx.invokingState); + super.copyFrom(ctx); + } + public emptyColumn(): EmptyColumnContext { + return this.getRuleContext(0, EmptyColumnContext)!; + } + public override enterRule(listener: GenericSqlListener): void { + if(listener.enterSelectEmptyElement) { + listener.enterSelectEmptyElement(this); + } + } + public override exitRule(listener: GenericSqlListener): void { + if(listener.exitSelectEmptyElement) { + listener.exitSelectEmptyElement(this); + } + } + public override accept(visitor: GenericSqlVisitor): Result | null { + if (visitor.visitSelectEmptyElement) { + return visitor.visitSelectEmptyElement(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class SelectStarElementContext extends SelectItemContext { + public constructor(ctx: SelectItemContext) { + super(ctx.parent, ctx.invokingState); + super.copyFrom(ctx); + } + public qualifiedName(): QualifiedNameContext { + return this.getRuleContext(0, QualifiedNameContext)!; + } + public ASTERISK(): antlr.TerminalNode { + return this.getToken(GenericSqlParser.ASTERISK, 0)!; + } + public override enterRule(listener: GenericSqlListener): void { + if(listener.enterSelectStarElement) { + listener.enterSelectStarElement(this); + } + } + public override exitRule(listener: GenericSqlListener): void { + if(listener.exitSelectStarElement) { + listener.exitSelectStarElement(this); + } + } + public override accept(visitor: GenericSqlVisitor): Result | null { + if (visitor.visitSelectStarElement) { + return visitor.visitSelectStarElement(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class SelectAllElementContext extends SelectItemContext { + public constructor(ctx: SelectItemContext) { + super(ctx.parent, ctx.invokingState); + super.copyFrom(ctx); + } + public ASTERISK(): antlr.TerminalNode { + return this.getToken(GenericSqlParser.ASTERISK, 0)!; } public override enterRule(listener: GenericSqlListener): void { - if(listener.enterSelectItem) { - listener.enterSelectItem(this); + if(listener.enterSelectAllElement) { + listener.enterSelectAllElement(this); } } public override exitRule(listener: GenericSqlListener): void { - if(listener.exitSelectItem) { - listener.exitSelectItem(this); + if(listener.exitSelectAllElement) { + listener.exitSelectAllElement(this); } } public override accept(visitor: GenericSqlVisitor): Result | null { - if (visitor.visitSelectItem) { - return visitor.visitSelectItem(this); + if (visitor.visitSelectAllElement) { + return visitor.visitSelectAllElement(this); } else { return visitor.visitChildren(this); } @@ -5302,8 +5539,11 @@ export class WhereClauseContext extends antlr.ParserRuleContext { public KW_WHERE(): antlr.TerminalNode { return this.getToken(GenericSqlParser.KW_WHERE, 0)!; } - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext)!; + public expression(): ExpressionContext | null { + return this.getRuleContext(0, ExpressionContext); + } + public emptyColumn(): EmptyColumnContext | null { + return this.getRuleContext(0, EmptyColumnContext); } public override get ruleIndex(): number { return GenericSqlParser.RULE_whereClause; @@ -5380,8 +5620,11 @@ export class HavingClauseContext extends antlr.ParserRuleContext { public KW_HAVING(): antlr.TerminalNode { return this.getToken(GenericSqlParser.KW_HAVING, 0)!; } - public expression(): ExpressionContext { - return this.getRuleContext(0, ExpressionContext)!; + public expression(): ExpressionContext | null { + return this.getRuleContext(0, ExpressionContext); + } + public emptyColumn(): EmptyColumnContext | null { + return this.getRuleContext(0, EmptyColumnContext); } public override get ruleIndex(): number { return GenericSqlParser.RULE_havingClause; @@ -5834,11 +6077,12 @@ export class TableElementContext extends antlr.ParserRuleContext { export class ColumnDefinitionContext extends antlr.ParserRuleContext { + public _colType?: DataTypeContext; public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public columnRef(): ColumnRefContext { - return this.getRuleContext(0, ColumnRefContext)!; + public columnRefCreate(): ColumnRefCreateContext { + return this.getRuleContext(0, ColumnRefCreateContext)!; } public dataType(): DataTypeContext { return this.getRuleContext(0, DataTypeContext)!; @@ -5884,6 +6128,36 @@ export class ColumnDefinitionContext extends antlr.ParserRuleContext { } +export class ColumnRefCreateContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public identifier(): IdentifierContext { + return this.getRuleContext(0, IdentifierContext)!; + } + public override get ruleIndex(): number { + return GenericSqlParser.RULE_columnRefCreate; + } + public override enterRule(listener: GenericSqlListener): void { + if(listener.enterColumnRefCreate) { + listener.enterColumnRefCreate(this); + } + } + public override exitRule(listener: GenericSqlListener): void { + if(listener.exitColumnRefCreate) { + listener.exitColumnRefCreate(this); + } + } + public override accept(visitor: GenericSqlVisitor): Result | null { + if (visitor.visitColumnRefCreate) { + return visitor.visitColumnRefCreate(this); + } else { + return visitor.visitChildren(this); + } + } +} + + export class TableConstraintContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); @@ -6879,8 +7153,8 @@ export class ColumnReferenceContext extends PrimaryExpressionContext { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } - public qualifiedName(): QualifiedNameContext { - return this.getRuleContext(0, QualifiedNameContext)!; + public columnName(): ColumnNameContext { + return this.getRuleContext(0, ColumnNameContext)!; } public override enterRule(listener: GenericSqlListener): void { if(listener.enterColumnReference) { @@ -6960,8 +7234,8 @@ export class FunctionCallContext extends PrimaryExpressionContext { super(ctx.parent, ctx.invokingState); super.copyFrom(ctx); } - public qualifiedName(): QualifiedNameContext { - return this.getRuleContext(0, QualifiedNameContext)!; + public functionName(): FunctionNameContext { + return this.getRuleContext(0, FunctionNameContext)!; } public expression(): ExpressionContext[]; public expression(i: number): ExpressionContext | null; @@ -7666,12 +7940,48 @@ export class QualifiedNameContext extends antlr.ParserRuleContext { } +export class QualifiedNameAllowEmptyContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public qualifiedName(): QualifiedNameContext { + return this.getRuleContext(0, QualifiedNameContext)!; + } + public emptyColumn(): EmptyColumnContext | null { + return this.getRuleContext(0, EmptyColumnContext); + } + public override get ruleIndex(): number { + return GenericSqlParser.RULE_qualifiedNameAllowEmpty; + } + public override enterRule(listener: GenericSqlListener): void { + if(listener.enterQualifiedNameAllowEmpty) { + listener.enterQualifiedNameAllowEmpty(this); + } + } + public override exitRule(listener: GenericSqlListener): void { + if(listener.exitQualifiedNameAllowEmpty) { + listener.exitQualifiedNameAllowEmpty(this); + } + } + public override accept(visitor: GenericSqlVisitor): Result | null { + if (visitor.visitQualifiedNameAllowEmpty) { + return visitor.visitQualifiedNameAllowEmpty(this); + } else { + return visitor.visitChildren(this); + } + } +} + + export class ColumnRefContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); } - public identifier(): IdentifierContext { - return this.getRuleContext(0, IdentifierContext)!; + public identifier(): IdentifierContext | null { + return this.getRuleContext(0, IdentifierContext); + } + public emptyColumn(): EmptyColumnContext | null { + return this.getRuleContext(0, EmptyColumnContext); } public override get ruleIndex(): number { return GenericSqlParser.RULE_columnRef; @@ -7696,6 +8006,63 @@ export class ColumnRefContext extends antlr.ParserRuleContext { } +export class ColumnNameContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public qualifiedNameAllowEmpty(): QualifiedNameAllowEmptyContext { + return this.getRuleContext(0, QualifiedNameAllowEmptyContext)!; + } + public override get ruleIndex(): number { + return GenericSqlParser.RULE_columnName; + } + public override enterRule(listener: GenericSqlListener): void { + if(listener.enterColumnName) { + listener.enterColumnName(this); + } + } + public override exitRule(listener: GenericSqlListener): void { + if(listener.exitColumnName) { + listener.exitColumnName(this); + } + } + public override accept(visitor: GenericSqlVisitor): Result | null { + if (visitor.visitColumnName) { + return visitor.visitColumnName(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class EmptyColumnContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public override get ruleIndex(): number { + return GenericSqlParser.RULE_emptyColumn; + } + public override enterRule(listener: GenericSqlListener): void { + if(listener.enterEmptyColumn) { + listener.enterEmptyColumn(this); + } + } + public override exitRule(listener: GenericSqlListener): void { + if(listener.exitEmptyColumn) { + listener.exitEmptyColumn(this); + } + } + public override accept(visitor: GenericSqlVisitor): Result | null { + if (visitor.visitEmptyColumn) { + return visitor.visitEmptyColumn(this); + } else { + return visitor.visitChildren(this); + } + } +} + + export class TableNameContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); @@ -7756,6 +8123,36 @@ export class TableNameCreateContext extends antlr.ParserRuleContext { } +export class FunctionNameContext extends antlr.ParserRuleContext { + public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { + super(parent, invokingState); + } + public qualifiedName(): QualifiedNameContext { + return this.getRuleContext(0, QualifiedNameContext)!; + } + public override get ruleIndex(): number { + return GenericSqlParser.RULE_functionName; + } + public override enterRule(listener: GenericSqlListener): void { + if(listener.enterFunctionName) { + listener.enterFunctionName(this); + } + } + public override exitRule(listener: GenericSqlListener): void { + if(listener.exitFunctionName) { + listener.exitFunctionName(this); + } + } + public override accept(visitor: GenericSqlVisitor): Result | null { + if (visitor.visitFunctionName) { + return visitor.visitFunctionName(this); + } else { + return visitor.visitChildren(this); + } + } +} + + export class NonReservedContext extends antlr.ParserRuleContext { public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) { super(parent, invokingState); diff --git a/src/lib/generic/GenericSqlVisitor.ts b/src/lib/generic/GenericSqlVisitor.ts index 7cf8390e..747f5382 100644 --- a/src/lib/generic/GenericSqlVisitor.ts +++ b/src/lib/generic/GenericSqlVisitor.ts @@ -27,7 +27,10 @@ import { QueryTermContext } from "./GenericSqlParser.js"; import { QueryPrimaryContext } from "./GenericSqlParser.js"; import { QuerySpecificationContext } from "./GenericSqlParser.js"; import { SetQuantifierContext } from "./GenericSqlParser.js"; -import { SelectItemContext } from "./GenericSqlParser.js"; +import { SelectExpressionElementContext } from "./GenericSqlParser.js"; +import { SelectStarElementContext } from "./GenericSqlParser.js"; +import { SelectAllElementContext } from "./GenericSqlParser.js"; +import { SelectEmptyElementContext } from "./GenericSqlParser.js"; import { FromClauseContext } from "./GenericSqlParser.js"; import { SimpleRelationContext } from "./GenericSqlParser.js"; import { JoinRelationContext } from "./GenericSqlParser.js"; @@ -49,6 +52,7 @@ import { DeleteStatementContext } from "./GenericSqlParser.js"; import { CreateTableStatementContext } from "./GenericSqlParser.js"; import { TableElementContext } from "./GenericSqlParser.js"; import { ColumnDefinitionContext } from "./GenericSqlParser.js"; +import { ColumnRefCreateContext } from "./GenericSqlParser.js"; import { TableConstraintContext } from "./GenericSqlParser.js"; import { AlterTableStatementContext } from "./GenericSqlParser.js"; import { DropTableStatementContext } from "./GenericSqlParser.js"; @@ -95,9 +99,13 @@ import { StringLiteralContext } from "./GenericSqlParser.js"; import { BinaryLiteralContext } from "./GenericSqlParser.js"; import { IdentifierContext } from "./GenericSqlParser.js"; import { QualifiedNameContext } from "./GenericSqlParser.js"; +import { QualifiedNameAllowEmptyContext } from "./GenericSqlParser.js"; import { ColumnRefContext } from "./GenericSqlParser.js"; +import { ColumnNameContext } from "./GenericSqlParser.js"; +import { EmptyColumnContext } from "./GenericSqlParser.js"; import { TableNameContext } from "./GenericSqlParser.js"; import { TableNameCreateContext } from "./GenericSqlParser.js"; +import { FunctionNameContext } from "./GenericSqlParser.js"; import { NonReservedContext } from "./GenericSqlParser.js"; @@ -231,11 +239,33 @@ export class GenericSqlVisitor extends AbstractParseTreeVisitor */ visitSetQuantifier?: (ctx: SetQuantifierContext) => Result; /** - * Visit a parse tree produced by `GenericSqlParser.selectItem`. + * Visit a parse tree produced by the `selectExpressionElement` + * labeled alternative in `GenericSqlParser.selectItem`. * @param ctx the parse tree * @return the visitor result */ - visitSelectItem?: (ctx: SelectItemContext) => Result; + visitSelectExpressionElement?: (ctx: SelectExpressionElementContext) => Result; + /** + * Visit a parse tree produced by the `selectStarElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSelectStarElement?: (ctx: SelectStarElementContext) => Result; + /** + * Visit a parse tree produced by the `selectAllElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSelectAllElement?: (ctx: SelectAllElementContext) => Result; + /** + * Visit a parse tree produced by the `selectEmptyElement` + * labeled alternative in `GenericSqlParser.selectItem`. + * @param ctx the parse tree + * @return the visitor result + */ + visitSelectEmptyElement?: (ctx: SelectEmptyElementContext) => Result; /** * Visit a parse tree produced by `GenericSqlParser.fromClause`. * @param ctx the parse tree @@ -366,6 +396,12 @@ export class GenericSqlVisitor extends AbstractParseTreeVisitor * @return the visitor result */ visitColumnDefinition?: (ctx: ColumnDefinitionContext) => Result; + /** + * Visit a parse tree produced by `GenericSqlParser.columnRefCreate`. + * @param ctx the parse tree + * @return the visitor result + */ + visitColumnRefCreate?: (ctx: ColumnRefCreateContext) => Result; /** * Visit a parse tree produced by `GenericSqlParser.tableConstraint`. * @param ctx the parse tree @@ -675,12 +711,30 @@ export class GenericSqlVisitor extends AbstractParseTreeVisitor * @return the visitor result */ visitQualifiedName?: (ctx: QualifiedNameContext) => Result; + /** + * Visit a parse tree produced by `GenericSqlParser.qualifiedNameAllowEmpty`. + * @param ctx the parse tree + * @return the visitor result + */ + visitQualifiedNameAllowEmpty?: (ctx: QualifiedNameAllowEmptyContext) => Result; /** * Visit a parse tree produced by `GenericSqlParser.columnRef`. * @param ctx the parse tree * @return the visitor result */ visitColumnRef?: (ctx: ColumnRefContext) => Result; + /** + * Visit a parse tree produced by `GenericSqlParser.columnName`. + * @param ctx the parse tree + * @return the visitor result + */ + visitColumnName?: (ctx: ColumnNameContext) => Result; + /** + * Visit a parse tree produced by `GenericSqlParser.emptyColumn`. + * @param ctx the parse tree + * @return the visitor result + */ + visitEmptyColumn?: (ctx: EmptyColumnContext) => Result; /** * Visit a parse tree produced by `GenericSqlParser.tableName`. * @param ctx the parse tree @@ -693,6 +747,12 @@ export class GenericSqlVisitor extends AbstractParseTreeVisitor * @return the visitor result */ visitTableNameCreate?: (ctx: TableNameCreateContext) => Result; + /** + * Visit a parse tree produced by `GenericSqlParser.functionName`. + * @param ctx the parse tree + * @return the visitor result + */ + visitFunctionName?: (ctx: FunctionNameContext) => Result; /** * Visit a parse tree produced by `GenericSqlParser.nonReserved`. * @param ctx the parse tree diff --git a/src/parser/generic/genericEntityCollector.ts b/src/parser/generic/genericEntityCollector.ts index 1e4fb5fc..ff4785d1 100644 --- a/src/parser/generic/genericEntityCollector.ts +++ b/src/parser/generic/genericEntityCollector.ts @@ -4,6 +4,7 @@ import { ColumnDefinitionContext, ColumnRefContext, AliasedRelationContext, + ColumnRefCreateContext, CreateTableContext, CreateTableStatementContext, DeleteContext, @@ -12,7 +13,10 @@ import { NamedQueryContext, QuerySpecificationContext, QueryStatementContext, - SelectItemContext, + SelectAllElementContext, + SelectEmptyElementContext, + SelectExpressionElementContext, + SelectStarElementContext, SingleStatementContext, TableNameContext, TableNameCreateContext, @@ -23,7 +27,6 @@ import { ColumnDeclareType, CommonEntityContext, EntityCollector, - isColumnEntityContext, isCommonEntityContext, StmtContextType, TableDeclareType, @@ -43,7 +46,7 @@ export class GenericEntityCollector extends EntityCollector implements GenericSq /** ====== Entity Begin */ exitTableName(ctx: TableNameContext) { - this.pushEntity( + const entity = this.pushEntity( ctx, EntityContextType.TABLE, [ @@ -56,6 +59,17 @@ export class GenericEntityCollector extends EntityCollector implements GenericSq declareType: TableDeclareType.LITERAL, } ); + // 如果通用属性查找未找到 alias,尝试从 AliasedRelationContext._alias 获取 + if (entity && !entity[AttrName.alias]) { + let parent = ctx.parent; + while (parent && !(parent instanceof AliasedRelationContext)) { + parent = parent.parent; + } + const aliasToken = (parent as AliasedRelationContext)?._alias?.start; + if (aliasToken) { + entity[AttrName.alias] = tokenToWord(aliasToken, ''); + } + } } exitNamedQuery(ctx: NamedQueryContext) { @@ -82,33 +96,17 @@ export class GenericEntityCollector extends EntityCollector implements GenericSq this.pushEntity(ctx, EntityContextType.COLUMN); } - exitColumnDefinition(ctx: ColumnDefinitionContext) { - // The name is only `columnRef`. Pushing the whole definition made the - // completion label `age int` and inserted the type into the SQL. - const entity = this.pushEntity(ctx.columnRef(), EntityContextType.COLUMN_CREATE, [ + exitColumnRefCreate(ctx: ColumnRefCreateContext) { + this.pushEntity(ctx, EntityContextType.COLUMN_CREATE, [ + { + attrName: AttrName.colType, + endContextList: [ColumnDefinitionContext.name], + }, { attrName: AttrName.comment, endContextList: [ColumnDefinitionContext.name], }, ]); - const dataType = ctx.dataType(); - if (entity && isColumnEntityContext(entity) && dataType?.start && dataType.stop) { - const startIndex = dataType.start.start; - const endIndex = dataType.stop.stop; - const typeText = this.sourceSlice(startIndex, endIndex); - const startColumn = dataType.start.column + 1; - entity[AttrName.colType] = { - text: typeText, - line: dataType.start.line, - startIndex, - endIndex, - startColumn, - endColumn: - dataType.stop.line === dataType.start.line - ? startColumn + typeText.length - : dataType.stop.column + 1 + (dataType.stop.text?.length ?? 0), - }; - } } exitQuerySpecification(ctx: QuerySpecificationContext) { @@ -127,28 +125,36 @@ export class GenericEntityCollector extends EntityCollector implements GenericSq return { ...entity, text }; } - exitSelectItem(ctx: SelectItemContext) { - if (ctx.ASTERISK()) { - this.pushEntity(ctx, EntityContextType.COLUMN, [], { - declareType: ColumnDeclareType.ALL, - }); - } else { - const isSimpleColumn = this.isSimpleColumnReference(ctx); - const entity = this.pushEntity(ctx, EntityContextType.COLUMN, [], { - declareType: isSimpleColumn - ? ColumnDeclareType.LITERAL - : ColumnDeclareType.EXPRESSION, - }); - // The alias sits on this select item. Searching parents would pick a - // later item's alias and label every column with that name. - const aliasToken = ctx._alias?.start; - if (entity && aliasToken) { - entity[AttrName.alias] = tokenToWord(aliasToken, ''); - } + exitSelectExpressionElement(ctx: SelectExpressionElementContext) { + const isSimpleColumn = this.isSimpleColumnReference(ctx); + const entity = this.pushEntity(ctx, EntityContextType.COLUMN, [], { + declareType: isSimpleColumn ? ColumnDeclareType.LITERAL : ColumnDeclareType.EXPRESSION, + }); + const aliasToken = ctx._alias?.start; + if (entity && aliasToken) { + entity[AttrName.alias] = tokenToWord(aliasToken, ''); } } - private isSimpleColumnReference(ctx: SelectItemContext): boolean { + exitSelectStarElement(ctx: SelectStarElementContext) { + this.pushEntity(ctx, EntityContextType.COLUMN, [], { + declareType: ColumnDeclareType.ALL, + }); + } + + exitSelectAllElement(ctx: SelectAllElementContext) { + this.pushEntity(ctx, EntityContextType.COLUMN, [], { + declareType: ColumnDeclareType.ALL, + }); + } + + exitSelectEmptyElement(ctx: SelectEmptyElementContext) { + this.pushEntity(ctx, EntityContextType.COLUMN, [], { + declareType: ColumnDeclareType.LITERAL, + }); + } + + private isSimpleColumnReference(ctx: SelectExpressionElementContext): boolean { const text = ctx.getText(); // Simple column reference: no parentheses, no operators, no spaces return ( diff --git a/src/parser/generic/index.ts b/src/parser/generic/index.ts index 824c974f..4e3f3def 100644 --- a/src/parser/generic/index.ts +++ b/src/parser/generic/index.ts @@ -56,7 +56,9 @@ export class GenericSQL extends BasicSQL { @@ -72,4 +73,143 @@ describe('GenericSQL Syntax Suggestion with collect entity', () => { expect(firstStmtEntities[0].belongStmt.isContainCaret).toBeFalsy(); } }); + + test('select with empty column after dot (a.)', () => { + const sql = `SELECT a. FROM tb1 a`; + const pos: CaretPosition = { + lineNumber: 1, + column: 9, + }; + + const syntaxes = parser.getSuggestionAtCaretPosition(sql, pos)?.syntax; + const suggestion = syntaxes?.find( + (syn) => syn.syntaxContextType === EntityContextType.COLUMN + ); + expect(suggestion).not.toBeUndefined(); + expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['a']); + + const entities = parser.getAllEntities(sql, pos); + const tableEntity = entities.find((e) => e.entityContextType === EntityContextType.TABLE); + expect(tableEntity).toBeDefined(); + expect(tableEntity?.text).toBe('tb1'); + expect(tableEntity?.belongStmt.isContainCaret).toBeTruthy(); + }); + + test('select with empty column (trailing comma)', () => { + const sql = `SELECT id, FROM tb`; + const pos: CaretPosition = { + lineNumber: 1, + column: 12, + }; + + const entities = parser.getAllEntities(sql, pos); + const tableEntity = entities.find((e) => e.entityContextType === EntityContextType.TABLE); + expect(tableEntity).toBeDefined(); + expect(tableEntity?.text).toBe('tb'); + expect(tableEntity?.belongStmt.isContainCaret).toBeTruthy(); + }); + + test('should get columns from CREATE TABLE for suggestion', () => { + const sql = `CREATE TABLE students (id int, name varchar(100), score decimal);\nSELECT FROM students;`; + const pos: CaretPosition = { + lineNumber: 2, + column: 8, + }; + + const entities = parser.getAllEntities(sql, pos); + + // Find the table in FROM clause + const tableEntity = entities.find( + (e) => e.entityContextType === EntityContextType.TABLE && e.text === 'students' + ); + expect(tableEntity).toBeDefined(); + + // Find the table definition in CREATE TABLE statement + const tableCreateEntity = entities.find( + (e) => e.entityContextType === EntityContextType.TABLE_CREATE && e.text === 'students' + ); + expect(tableCreateEntity).toBeDefined(); + + // Verify column information + if (isCommonEntityContext(tableCreateEntity)) { + expect(tableCreateEntity.columns?.length).toBe(3); + const columnTexts = tableCreateEntity.columns?.map((col) => col.text); + expect(columnTexts).toEqual(expect.arrayContaining(['id', 'name', 'score'])); + // Verify colType is extracted + const idColumn = tableCreateEntity.columns?.find((col) => col.text === 'id'); + expect(idColumn?.[AttrName.colType]?.text).toBe('int'); + } + }); + + test('select with join on dot empty column (o. and u.)', () => { + const sql1 = `create table orders ( id BIGINT, age int, name VARCHAR ); create table t1 ( id1 BIGINT, age1 int, name1 VARCHAR ); SELECT o.age, u.age1 FROM orders o JOIN t1 u ON o.`; + const pos1: CaretPosition = { + lineNumber: 1, + column: sql1.length + 1, + }; + const syntaxes1 = parser.getSuggestionAtCaretPosition(sql1, pos1)?.syntax; + const col1 = syntaxes1?.find((s) => s.syntaxContextType === EntityContextType.COLUMN); + expect(col1).toBeDefined(); + expect(col1?.wordRanges.map((w) => w.text)).toEqual(['o', '.']); + + const sql2 = `create table orders ( id BIGINT, age int, name VARCHAR ); create table t1 ( id1 BIGINT, age1 int, name1 VARCHAR ); SELECT o.age, u.age1 FROM orders o JOIN t1 u ON o.id = u.`; + const pos2: CaretPosition = { + lineNumber: 1, + column: sql2.length + 1, + }; + const syntaxes2 = parser.getSuggestionAtCaretPosition(sql2, pos2)?.syntax; + const col2 = syntaxes2?.find((s) => s.syntaxContextType === EntityContextType.COLUMN); + expect(col2).toBeDefined(); + expect(col2?.wordRanges.map((w) => w.text)).toEqual(['u', '.']); + + const entities = parser.getAllEntities(sql2, pos2); + const ordersTable = entities.find( + (e) => e.entityContextType === EntityContextType.TABLE && e.text === 'orders' + ); + expect(ordersTable).toBeDefined(); + expect(ordersTable?.[AttrName.alias]?.text).toBe('o'); + + const t1Table = entities.find( + (e) => e.entityContextType === EntityContextType.TABLE && e.text === 't1' + ); + expect(t1Table).toBeDefined(); + expect(t1Table?.[AttrName.alias]?.text).toBe('u'); + }); + + test('select with where empty column', () => { + const sql = `create table orders ( id BIGINT, age int, name VARCHAR ); create table t1 ( id1 BIGINT, age1 int, name1 VARCHAR ); SELECT age FROM orders o where `; + const pos: CaretPosition = { + lineNumber: 1, + column: sql.length + 1, + }; + const syntaxes = parser.getSuggestionAtCaretPosition(sql, pos)?.syntax; + const col = syntaxes?.find((s) => s.syntaxContextType === EntityContextType.COLUMN); + expect(col).toBeDefined(); + + const entities = parser.getAllEntities(sql, pos); + const ordersTable = entities.find( + (e) => e.entityContextType === EntityContextType.TABLE && e.text === 'orders' + ); + expect(ordersTable).toBeDefined(); + expect(ordersTable?.[AttrName.alias]?.text).toBe('o'); + }); + + test('select with where dot empty column (o.)', () => { + const sql = `SELECT * FROM orders o WHERE o.`; + const pos: CaretPosition = { + lineNumber: 1, + column: sql.length + 1, + }; + const syntaxes = parser.getSuggestionAtCaretPosition(sql, pos)?.syntax; + const col = syntaxes?.find((s) => s.syntaxContextType === EntityContextType.COLUMN); + expect(col).toBeDefined(); + expect(col?.wordRanges.map((w) => w.text)).toEqual(['o', '.']); + + const entities = parser.getAllEntities(sql, pos); + const ordersTable = entities.find( + (e) => e.entityContextType === EntityContextType.TABLE && e.text === 'orders' + ); + expect(ordersTable).toBeDefined(); + expect(ordersTable?.[AttrName.alias]?.text).toBe('o'); + }); }); diff --git a/test/parser/generic/suggestion/syntaxSuggestion.test.ts b/test/parser/generic/suggestion/syntaxSuggestion.test.ts index 8c9e7275..418c3319 100644 --- a/test/parser/generic/suggestion/syntaxSuggestion.test.ts +++ b/test/parser/generic/suggestion/syntaxSuggestion.test.ts @@ -83,4 +83,37 @@ describe('GenericSQL Syntax Suggestion', () => { expect(tables?.map((table) => table.text).sort()).toEqual(['orders', 't1']); expect(tables?.every((table) => table.isAccessible)).toBe(true); }); + + test('Function call', () => { + const pos: CaretPosition = { + lineNumber: 29, + column: 9, + }; + const syntaxes = parser.getSuggestionAtCaretPosition( + commentOtherLine(syntaxSql, pos.lineNumber), + pos + )?.syntax; + + const suggestion = syntaxes?.find( + (syn) => syn.syntaxContextType === EntityContextType.FUNCTION + ); + expect(suggestion).not.toBeUndefined(); + expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['CONCAT']); + }); + + test('Create table column', () => { + const pos: CaretPosition = { + lineNumber: 31, + column: 26, + }; + const syntaxes = parser.getSuggestionAtCaretPosition( + commentOtherLine(syntaxSql, pos.lineNumber), + pos + )?.syntax; + + const suggestion = syntaxes?.find( + (syn) => syn.syntaxContextType === EntityContextType.COLUMN_CREATE + ); + expect(suggestion).not.toBeUndefined(); + }); }); diff --git a/test/parser/generic/validateInvalidSql.test.ts b/test/parser/generic/validateInvalidSql.test.ts index 3ec0c3b8..5800a4f7 100644 --- a/test/parser/generic/validateInvalidSql.test.ts +++ b/test/parser/generic/validateInvalidSql.test.ts @@ -13,4 +13,9 @@ describe('GenericSQL validate invalid sql', () => { test('validate unComplete sql', () => { expect(parser.validate(unCompleteSQL).length).not.toBe(0); }); + + test('validate empty where and having clause', () => { + expect(parser.validate('SELECT * FROM tb WHERE;').length).not.toBe(0); + expect(parser.validate('SELECT * FROM tb HAVING;').length).not.toBe(0); + }); });