diff --git a/cosmosdb/CosmosDBLexer.g4 b/cosmosdb/CosmosDBLexer.g4 index 7166dc4..b35324f 100644 --- a/cosmosdb/CosmosDBLexer.g4 +++ b/cosmosdb/CosmosDBLexer.g4 @@ -46,6 +46,21 @@ UDF_SYMBOL: 'UDF'; WHERE_SYMBOL: 'WHERE'; AND_SYMBOL: 'AND'; OR_SYMBOL: 'OR'; +IN_SYMBOL: 'IN'; +BETWEEN_SYMBOL: 'BETWEEN'; +TOP_SYMBOL: 'TOP'; +VALUE_SYMBOL: 'VALUE'; +ORDER_SYMBOL: 'ORDER'; +BY_SYMBOL: 'BY'; +GROUP_SYMBOL: 'GROUP'; +OFFSET_SYMBOL: 'OFFSET'; +LIMIT_SYMBOL: 'LIMIT'; +ASC_SYMBOL: 'ASC'; +DESC_SYMBOL: 'DESC'; +EXISTS_SYMBOL: 'EXISTS'; +LIKE_SYMBOL: 'LIKE'; +HAVING_SYMBOL: 'HAVING'; +JOIN_SYMBOL: 'JOIN'; AT_SYMBOL: '@'; LC_BRACKET_SYMBOL: '{'; @@ -77,10 +92,11 @@ GREATER_THAN_EQUAL_OPERATOR: '>='; LEFT_SHIFT_OPERATOR: '<<'; RIGHT_SHIFT_OPERATOR: '>>'; ZERO_FILL_RIGHT_SHIFT_OPERATOR: '>>>'; +NOT_EQUAL_OPERATOR: '!='; /* Identifiers */ -IDENTIFIER: [a-z] [a-z_0-9]*; +IDENTIFIER: [a-z_] [a-z_0-9]*; // White space handling WHITESPACE: diff --git a/cosmosdb/CosmosDBParser.g4 b/cosmosdb/CosmosDBParser.g4 index a07e34b..d960880 100644 --- a/cosmosdb/CosmosDBParser.g4 +++ b/cosmosdb/CosmosDBParser.g4 @@ -6,110 +6,147 @@ options { root: select EOF; -select: select_clause from_clause where_clause?; +select: + select_clause from_clause? where_clause? group_by_clause? having_clause? order_by_clause? + offset_limit_clause?; -select_clause: SELECT_SYMBOL select_specification; +select_clause: SELECT_SYMBOL top_clause? select_specification; + +top_clause: TOP_SYMBOL DECIMAL; select_specification: MULTIPLY_OPERATOR - | DISTINCT_SYMBOL? object_property_list; + | DISTINCT_SYMBOL? VALUE_SYMBOL? object_property_list; from_clause: FROM_SYMBOL from_specification; -where_clause: WHERE_SYMBOL scalar_expression_in_where; +where_clause: WHERE_SYMBOL scalar_expression; + +group_by_clause: + GROUP_SYMBOL BY_SYMBOL scalar_expression ( + COMMA_SYMBOL scalar_expression + )*; + +having_clause: HAVING_SYMBOL scalar_expression; + +order_by_clause: + ORDER_SYMBOL BY_SYMBOL sort_expression ( + COMMA_SYMBOL sort_expression + )*; + +sort_expression: scalar_expression (ASC_SYMBOL | DESC_SYMBOL)?; + +offset_limit_clause: OFFSET_SYMBOL DECIMAL LIMIT_SYMBOL DECIMAL; from_specification: from_source; -from_source: container_expression; +from_source: container_expression (join_clause)*; -container_expression: container_name (AS_SYMBOL? IDENTIFIER)?; +container_expression: container_name (AS_SYMBOL? identifier)?; -container_name: IDENTIFIER; +join_clause: + JOIN_SYMBOL identifier IN_SYMBOL scalar_expression; + +container_name: identifier; object_property_list: object_property (COMMA_SYMBOL object_property)*; -object_property: scalar_expression (AS_SYMBOL? property_alias)?; +object_property: + scalar_expression (AS_SYMBOL? property_alias)?; -property_alias: IDENTIFIER; +property_alias: identifier; -// scalar_expression: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/scalar-expressions +// Unified scalar_expression - used in both SELECT projections and WHERE clause. +// https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/scalar-expressions +// Alternatives are ordered from highest precedence (first) to lowest (last) per ANTLR4 semantics. scalar_expression: - input_alias - | scalar_expression DOT_SYMBOL property_name - | scalar_expression LS_BRACKET_SYMBOL ( - (DOUBLE_QUOTE_STRING_LITERAL) - | (array_index) - ) RS_BRACKET_SYMBOL - | unary_operator scalar_expression; - -// TODO(zp): Merge scalar_expression and scalar_expression_in_where while supporting the project -// fully. https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/scalar-expressions -scalar_expression_in_where: constant | input_alias | parameter_name - | scalar_expression_in_where AND_SYMBOL scalar_expression_in_where - | scalar_expression_in_where OR_SYMBOL scalar_expression_in_where - | scalar_expression_in_where DOT_SYMBOL property_name - | scalar_expression_in_where LS_BRACKET_SYMBOL ( - (DOUBLE_QUOTE_STRING_LITERAL) - | (array_index) - ) RS_BRACKET_SYMBOL - | unary_operator scalar_expression_in_where - | scalar_expression_in_where binary_operator scalar_expression_in_where - | scalar_expression_in_where QUESTION_MARK_SYMBOL scalar_expression_in_where COLON_SYMBOL - scalar_expression_in_where | scalar_function_expression | create_object_expression | create_array_expression - | LR_BRACKET_SYMBOL scalar_expression_in_where RR_BRACKET_SYMBOL; - -create_array_expression: array_constant; + | LR_BRACKET_SYMBOL scalar_expression RR_BRACKET_SYMBOL + | LR_BRACKET_SYMBOL select RR_BRACKET_SYMBOL + | EXISTS_SYMBOL LR_BRACKET_SYMBOL select RR_BRACKET_SYMBOL + | scalar_expression DOT_SYMBOL property_name + | scalar_expression LS_BRACKET_SYMBOL ( + DOUBLE_QUOTE_STRING_LITERAL + | SINGLE_QUOTE_STRING_LITERAL + | array_index + ) RS_BRACKET_SYMBOL + | unary_operator scalar_expression + | NOT_SYMBOL scalar_expression + | scalar_expression multiplicative_operator scalar_expression + | scalar_expression additive_operator scalar_expression + | scalar_expression shift_operator scalar_expression + | scalar_expression BIT_AND_SYMBOL scalar_expression + | scalar_expression BIT_XOR_SYMBOL scalar_expression + | scalar_expression BIT_OR_SYMBOL scalar_expression + | scalar_expression DOUBLE_BAR_SYMBOL scalar_expression + | scalar_expression comparison_operator scalar_expression + | scalar_expression NOT_SYMBOL? IN_SYMBOL LR_BRACKET_SYMBOL ( + scalar_expression (COMMA_SYMBOL scalar_expression)* + )? RR_BRACKET_SYMBOL + | scalar_expression NOT_SYMBOL? BETWEEN_SYMBOL scalar_expression AND_SYMBOL scalar_expression + | scalar_expression NOT_SYMBOL? LIKE_SYMBOL scalar_expression + | scalar_expression AND_SYMBOL scalar_expression + | scalar_expression OR_SYMBOL scalar_expression + | scalar_expression QUESTION_MARK_SYMBOL scalar_expression COLON_SYMBOL scalar_expression; + +create_array_expression: + LS_BRACKET_SYMBOL ( + scalar_expression (COMMA_SYMBOL scalar_expression)* + )? RS_BRACKET_SYMBOL; + +create_object_expression: + LC_BRACKET_SYMBOL ( + object_field_pair (COMMA_SYMBOL object_field_pair)* + )? RC_BRACKET_SYMBOL; -create_object_expression: object_constant; +object_field_pair: + (string_literal | property_name) COLON_SYMBOL scalar_expression; scalar_function_expression: udf_scalar_function_expression | builtin_function_expression; udf_scalar_function_expression: - UDF_SYMBOL DOT_SYMBOL IDENTIFIER LR_BRACKET_SYMBOL ( - scalar_expression_in_where ( - COMMA_SYMBOL scalar_expression_in_where - )* - ) RR_BRACKET_SYMBOL; + UDF_SYMBOL DOT_SYMBOL identifier LR_BRACKET_SYMBOL ( + scalar_expression (COMMA_SYMBOL scalar_expression)* + )? RR_BRACKET_SYMBOL; builtin_function_expression: - IDENTIFIER LR_BRACKET_SYMBOL ( - scalar_expression_in_where ( - COMMA_SYMBOL scalar_expression_in_where + identifier LR_BRACKET_SYMBOL ( + (MULTIPLY_OPERATOR | scalar_expression) ( + COMMA_SYMBOL scalar_expression )* - ) RR_BRACKET_SYMBOL; + )? RR_BRACKET_SYMBOL; -binary_operator: +multiplicative_operator: MULTIPLY_OPERATOR | DIVIDE_SYMBOL - | MODULO_SYMBOL - | PLUS_SYMBOL - | MINUS_SYMBOL - | BIT_AND_SYMBOL - | BIT_XOR_SYMBOL - | BIT_OR_SYMBOL - | DOUBLE_BAR_SYMBOL - | EQUAL_SYMBOL + | MODULO_SYMBOL; + +additive_operator: PLUS_SYMBOL | MINUS_SYMBOL; + +shift_operator: + LEFT_SHIFT_OPERATOR + | RIGHT_SHIFT_OPERATOR + | ZERO_FILL_RIGHT_SHIFT_OPERATOR; + +comparison_operator: + EQUAL_SYMBOL + | NOT_EQUAL_OPERATOR | LESS_THAN_OPERATOR | LESS_THAN_EQUAL_OPERATOR | GREATER_THAN_OPERATOR - | GREATER_THAN_EQUAL_OPERATOR - | LEFT_SHIFT_OPERATOR - | RIGHT_SHIFT_OPERATOR - | ZERO_FILL_RIGHT_SHIFT_OPERATOR - ; + | GREATER_THAN_EQUAL_OPERATOR; unary_operator: BIT_NOT_SYMBOL | PLUS_SYMBOL | MINUS_SYMBOL; -parameter_name: AT_SYMBOL IDENTIFIER; +parameter_name: AT_SYMBOL identifier; // https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/constants constant: @@ -117,26 +154,7 @@ constant: | null_constant | boolean_constant | number_constant - | string_constant - | array_constant - | object_constant; - -object_constant: - LC_BRACKET_SYMBOL ( - object_constant_field_pair ( - COMMA_SYMBOL object_constant_field_pair - )* - ) RC_BRACKET_SYMBOL; - -object_constant_field_pair: ( - property_name - | (DOUBLE_QUOTE_SYMBOL property_name DOUBLE_QUOTE_SYMBOL) - ) COMMA_SYMBOL constant; - -array_constant: - LS_BRACKET_SYMBOL (constant (COMMA_SYMBOL constant)*)? RS_BRACKET_SYMBOL; - -string_constant: string_literal; + | string_constant; undefined_constant: UNDEFINED_SYMBOL; @@ -146,6 +164,8 @@ boolean_constant: TRUE_SYMBOL | FALSE_SYMBOL; number_constant: decimal_literal | hexadecimal_literal; +string_constant: string_literal; + string_literal: SINGLE_QUOTE_STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL; @@ -154,8 +174,28 @@ decimal_literal: DECIMAL | REAL | FLOAT; hexadecimal_literal: HEXADECIMAL; -property_name: IDENTIFIER; +// Allow keywords to be used as identifiers (property names, aliases, etc.) +// This is necessary because CosmosDB allows keywords as property names. +identifier: + IDENTIFIER + | IN_SYMBOL + | BETWEEN_SYMBOL + | TOP_SYMBOL + | VALUE_SYMBOL + | ORDER_SYMBOL + | BY_SYMBOL + | GROUP_SYMBOL + | OFFSET_SYMBOL + | LIMIT_SYMBOL + | ASC_SYMBOL + | DESC_SYMBOL + | EXISTS_SYMBOL + | LIKE_SYMBOL + | HAVING_SYMBOL + | JOIN_SYMBOL; + +property_name: identifier; array_index: DECIMAL; -input_alias: IDENTIFIER; \ No newline at end of file +input_alias: identifier; diff --git a/cosmosdb/cosmosdb_lexer.go b/cosmosdb/cosmosdb_lexer.go index 9e380ca..c337105 100644 --- a/cosmosdb/cosmosdb_lexer.go +++ b/cosmosdb/cosmosdb_lexer.go @@ -45,16 +45,21 @@ func cosmosdblexerLexerInit() { staticData.LiteralNames = []string{ "", "'*'", "'AS'", "'SELECT'", "'FROM'", "'DISTINCT'", "'UNDEFINED'", "'NULL'", "'FALSE'", "'TRUE'", "'NOT'", "'UDF'", "'WHERE'", "'AND'", - "'OR'", "'@'", "'{'", "'}'", "'['", "']'", "'('", "')'", "'''", "'\"'", - "','", "'.'", "'?'", "':'", "'+'", "'-'", "'~'", "'/'", "'%'", "'&'", - "'|'", "'||'", "'^'", "'='", "'<'", "'<='", "'>'", "'>='", "'<<'", "'>>'", - "'>>>'", + "'OR'", "'IN'", "'BETWEEN'", "'TOP'", "'VALUE'", "'ORDER'", "'BY'", + "'GROUP'", "'OFFSET'", "'LIMIT'", "'ASC'", "'DESC'", "'EXISTS'", "'LIKE'", + "'HAVING'", "'JOIN'", "'@'", "'{'", "'}'", "'['", "']'", "'('", "')'", + "'''", "'\"'", "','", "'.'", "'?'", "':'", "'+'", "'-'", "'~'", "'/'", + "'%'", "'&'", "'|'", "'||'", "'^'", "'='", "'<'", "'<='", "'>'", "'>='", + "'<<'", "'>>'", "'>>>'", "'!='", } staticData.SymbolicNames = []string{ "", "MULTIPLY_OPERATOR", "AS_SYMBOL", "SELECT_SYMBOL", "FROM_SYMBOL", "DISTINCT_SYMBOL", "UNDEFINED_SYMBOL", "NULL_SYMBOL", "FALSE_SYMBOL", "TRUE_SYMBOL", "NOT_SYMBOL", "UDF_SYMBOL", "WHERE_SYMBOL", "AND_SYMBOL", - "OR_SYMBOL", "AT_SYMBOL", "LC_BRACKET_SYMBOL", "RC_BRACKET_SYMBOL", + "OR_SYMBOL", "IN_SYMBOL", "BETWEEN_SYMBOL", "TOP_SYMBOL", "VALUE_SYMBOL", + "ORDER_SYMBOL", "BY_SYMBOL", "GROUP_SYMBOL", "OFFSET_SYMBOL", "LIMIT_SYMBOL", + "ASC_SYMBOL", "DESC_SYMBOL", "EXISTS_SYMBOL", "LIKE_SYMBOL", "HAVING_SYMBOL", + "JOIN_SYMBOL", "AT_SYMBOL", "LC_BRACKET_SYMBOL", "RC_BRACKET_SYMBOL", "LS_BRACKET_SYMBOL", "RS_BRACKET_SYMBOL", "LR_BRACKET_SYMBOL", "RR_BRACKET_SYMBOL", "SINGLE_QUOTE_SYMBOL", "DOUBLE_QUOTE_SYMBOL", "COMMA_SYMBOL", "DOT_SYMBOL", "QUESTION_MARK_SYMBOL", "COLON_SYMBOL", "PLUS_SYMBOL", "MINUS_SYMBOL", @@ -62,15 +67,19 @@ func cosmosdblexerLexerInit() { "BIT_OR_SYMBOL", "DOUBLE_BAR_SYMBOL", "BIT_XOR_SYMBOL", "EQUAL_SYMBOL", "LESS_THAN_OPERATOR", "LESS_THAN_EQUAL_OPERATOR", "GREATER_THAN_OPERATOR", "GREATER_THAN_EQUAL_OPERATOR", "LEFT_SHIFT_OPERATOR", "RIGHT_SHIFT_OPERATOR", - "ZERO_FILL_RIGHT_SHIFT_OPERATOR", "IDENTIFIER", "WHITESPACE", "DECIMAL", - "REAL", "FLOAT", "HEXADECIMAL", "SINGLE_QUOTE_STRING_LITERAL", "DOUBLE_QUOTE_STRING_LITERAL", + "ZERO_FILL_RIGHT_SHIFT_OPERATOR", "NOT_EQUAL_OPERATOR", "IDENTIFIER", + "WHITESPACE", "DECIMAL", "REAL", "FLOAT", "HEXADECIMAL", "SINGLE_QUOTE_STRING_LITERAL", + "DOUBLE_QUOTE_STRING_LITERAL", } staticData.RuleNames = []string{ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "MULTIPLY_OPERATOR", "AS_SYMBOL", "SELECT_SYMBOL", "FROM_SYMBOL", "DISTINCT_SYMBOL", "UNDEFINED_SYMBOL", "NULL_SYMBOL", "FALSE_SYMBOL", "TRUE_SYMBOL", "NOT_SYMBOL", "UDF_SYMBOL", - "WHERE_SYMBOL", "AND_SYMBOL", "OR_SYMBOL", "AT_SYMBOL", "LC_BRACKET_SYMBOL", + "WHERE_SYMBOL", "AND_SYMBOL", "OR_SYMBOL", "IN_SYMBOL", "BETWEEN_SYMBOL", + "TOP_SYMBOL", "VALUE_SYMBOL", "ORDER_SYMBOL", "BY_SYMBOL", "GROUP_SYMBOL", + "OFFSET_SYMBOL", "LIMIT_SYMBOL", "ASC_SYMBOL", "DESC_SYMBOL", "EXISTS_SYMBOL", + "LIKE_SYMBOL", "HAVING_SYMBOL", "JOIN_SYMBOL", "AT_SYMBOL", "LC_BRACKET_SYMBOL", "RC_BRACKET_SYMBOL", "LS_BRACKET_SYMBOL", "RS_BRACKET_SYMBOL", "LR_BRACKET_SYMBOL", "RR_BRACKET_SYMBOL", "SINGLE_QUOTE_SYMBOL", "DOUBLE_QUOTE_SYMBOL", "COMMA_SYMBOL", "DOT_SYMBOL", "QUESTION_MARK_SYMBOL", "COLON_SYMBOL", "PLUS_SYMBOL", @@ -78,14 +87,14 @@ func cosmosdblexerLexerInit() { "BIT_AND_SYMBOL", "BIT_OR_SYMBOL", "DOUBLE_BAR_SYMBOL", "BIT_XOR_SYMBOL", "EQUAL_SYMBOL", "LESS_THAN_OPERATOR", "LESS_THAN_EQUAL_OPERATOR", "GREATER_THAN_OPERATOR", "GREATER_THAN_EQUAL_OPERATOR", "LEFT_SHIFT_OPERATOR", "RIGHT_SHIFT_OPERATOR", - "ZERO_FILL_RIGHT_SHIFT_OPERATOR", "IDENTIFIER", "WHITESPACE", "DEC_DIGIT", - "DEC_DOT_DEC", "DECIMAL", "REAL", "FLOAT", "HEX_DIGIT", "HEXADECIMAL", - "FullWidthLetter", "ESCAPE_SEQUENCE", "STRING_CHAR", "SINGLE_QUOTE_STRING_LITERAL", - "DOUBLE_QUOTE_STRING_LITERAL", + "ZERO_FILL_RIGHT_SHIFT_OPERATOR", "NOT_EQUAL_OPERATOR", "IDENTIFIER", + "WHITESPACE", "DEC_DIGIT", "DEC_DOT_DEC", "DECIMAL", "REAL", "FLOAT", + "HEX_DIGIT", "HEXADECIMAL", "FullWidthLetter", "ESCAPE_SEQUENCE", "STRING_CHAR", + "SINGLE_QUOTE_STRING_LITERAL", "DOUBLE_QUOTE_STRING_LITERAL", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 52, 465, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 68, 582, 6, -1, 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, @@ -101,197 +110,247 @@ func cosmosdblexerLexerInit() { 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, - 83, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, - 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, - 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, - 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, - 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, - 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, - 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, - 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, - 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, - 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, - 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, - 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, - 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, - 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, - 1, 52, 1, 52, 1, 53, 1, 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, 60, 1, 60, 1, 60, 1, 61, 1, 61, - 1, 62, 1, 62, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, - 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, - 1, 69, 1, 70, 1, 70, 5, 70, 364, 8, 70, 10, 70, 12, 70, 367, 9, 70, 1, - 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 73, 4, 73, 376, 8, 73, 11, 73, - 12, 73, 377, 1, 73, 1, 73, 4, 73, 382, 8, 73, 11, 73, 12, 73, 383, 1, 73, - 4, 73, 387, 8, 73, 11, 73, 12, 73, 388, 1, 73, 1, 73, 1, 73, 1, 73, 4, - 73, 395, 8, 73, 11, 73, 12, 73, 396, 3, 73, 399, 8, 73, 1, 74, 4, 74, 402, - 8, 74, 11, 74, 12, 74, 403, 1, 75, 1, 75, 3, 75, 408, 8, 75, 1, 75, 1, - 75, 3, 75, 412, 8, 75, 1, 75, 4, 75, 415, 8, 75, 11, 75, 12, 75, 416, 1, - 76, 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 4, 78, 426, 8, 78, 11, 78, - 12, 78, 427, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, - 80, 1, 80, 1, 80, 1, 80, 3, 80, 442, 8, 80, 1, 81, 1, 81, 3, 81, 446, 8, - 81, 1, 82, 1, 82, 5, 82, 450, 8, 82, 10, 82, 12, 82, 453, 9, 82, 1, 82, - 1, 82, 1, 83, 1, 83, 5, 83, 459, 8, 83, 10, 83, 12, 83, 462, 9, 83, 1, - 83, 1, 83, 0, 0, 84, 1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0, - 17, 0, 19, 0, 21, 0, 23, 0, 25, 0, 27, 0, 29, 0, 31, 0, 33, 0, 35, 0, 37, - 0, 39, 0, 41, 0, 43, 0, 45, 0, 47, 0, 49, 0, 51, 0, 53, 1, 55, 2, 57, 3, - 59, 4, 61, 5, 63, 6, 65, 7, 67, 8, 69, 9, 71, 10, 73, 11, 75, 12, 77, 13, - 79, 14, 81, 15, 83, 16, 85, 17, 87, 18, 89, 19, 91, 20, 93, 21, 95, 22, - 97, 23, 99, 24, 101, 25, 103, 26, 105, 27, 107, 28, 109, 29, 111, 30, 113, - 31, 115, 32, 117, 33, 119, 34, 121, 35, 123, 36, 125, 37, 127, 38, 129, - 39, 131, 40, 133, 41, 135, 42, 137, 43, 139, 44, 141, 45, 143, 46, 145, - 0, 147, 0, 149, 47, 151, 48, 153, 49, 155, 0, 157, 50, 159, 0, 161, 0, - 163, 0, 165, 51, 167, 52, 1, 0, 35, 2, 0, 65, 65, 97, 97, 2, 0, 66, 66, - 98, 98, 2, 0, 67, 67, 99, 99, 2, 0, 68, 68, 100, 100, 2, 0, 69, 69, 101, - 101, 2, 0, 70, 70, 102, 102, 2, 0, 71, 71, 103, 103, 2, 0, 72, 72, 104, - 104, 2, 0, 73, 73, 105, 105, 2, 0, 74, 74, 106, 106, 2, 0, 75, 75, 107, - 107, 2, 0, 76, 76, 108, 108, 2, 0, 77, 77, 109, 109, 2, 0, 78, 78, 110, - 110, 2, 0, 79, 79, 111, 111, 2, 0, 80, 80, 112, 112, 2, 0, 81, 81, 113, - 113, 2, 0, 82, 82, 114, 114, 2, 0, 83, 83, 115, 115, 2, 0, 84, 84, 116, - 116, 2, 0, 85, 85, 117, 117, 2, 0, 86, 86, 118, 118, 2, 0, 87, 87, 119, - 119, 2, 0, 88, 88, 120, 120, 2, 0, 89, 89, 121, 121, 2, 0, 90, 90, 122, - 122, 2, 0, 65, 90, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, - 9, 10, 12, 13, 32, 32, 1, 0, 48, 57, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, - 65, 70, 97, 102, 10, 0, 192, 214, 216, 246, 248, 8191, 11264, 12287, 12352, - 12687, 13056, 13183, 13312, 16383, 19968, 55295, 63744, 64255, 65280, 65520, - 14, 0, 34, 34, 39, 39, 47, 47, 66, 66, 70, 70, 78, 78, 82, 82, 84, 84, - 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 5, 0, 10, 10, 13, - 13, 34, 34, 39, 39, 92, 92, 448, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, - 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, - 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, - 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, - 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, - 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, - 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, - 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, - 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, - 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, - 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, - 131, 1, 0, 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, - 0, 0, 0, 139, 1, 0, 0, 0, 0, 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 0, 149, - 1, 0, 0, 0, 0, 151, 1, 0, 0, 0, 0, 153, 1, 0, 0, 0, 0, 157, 1, 0, 0, 0, - 0, 165, 1, 0, 0, 0, 0, 167, 1, 0, 0, 0, 1, 169, 1, 0, 0, 0, 3, 171, 1, - 0, 0, 0, 5, 173, 1, 0, 0, 0, 7, 175, 1, 0, 0, 0, 9, 177, 1, 0, 0, 0, 11, - 179, 1, 0, 0, 0, 13, 181, 1, 0, 0, 0, 15, 183, 1, 0, 0, 0, 17, 185, 1, - 0, 0, 0, 19, 187, 1, 0, 0, 0, 21, 189, 1, 0, 0, 0, 23, 191, 1, 0, 0, 0, - 25, 193, 1, 0, 0, 0, 27, 195, 1, 0, 0, 0, 29, 197, 1, 0, 0, 0, 31, 199, - 1, 0, 0, 0, 33, 201, 1, 0, 0, 0, 35, 203, 1, 0, 0, 0, 37, 205, 1, 0, 0, - 0, 39, 207, 1, 0, 0, 0, 41, 209, 1, 0, 0, 0, 43, 211, 1, 0, 0, 0, 45, 213, - 1, 0, 0, 0, 47, 215, 1, 0, 0, 0, 49, 217, 1, 0, 0, 0, 51, 219, 1, 0, 0, - 0, 53, 221, 1, 0, 0, 0, 55, 223, 1, 0, 0, 0, 57, 226, 1, 0, 0, 0, 59, 233, - 1, 0, 0, 0, 61, 238, 1, 0, 0, 0, 63, 247, 1, 0, 0, 0, 65, 257, 1, 0, 0, - 0, 67, 262, 1, 0, 0, 0, 69, 268, 1, 0, 0, 0, 71, 273, 1, 0, 0, 0, 73, 277, - 1, 0, 0, 0, 75, 281, 1, 0, 0, 0, 77, 287, 1, 0, 0, 0, 79, 291, 1, 0, 0, - 0, 81, 294, 1, 0, 0, 0, 83, 296, 1, 0, 0, 0, 85, 298, 1, 0, 0, 0, 87, 300, - 1, 0, 0, 0, 89, 302, 1, 0, 0, 0, 91, 304, 1, 0, 0, 0, 93, 306, 1, 0, 0, - 0, 95, 308, 1, 0, 0, 0, 97, 310, 1, 0, 0, 0, 99, 312, 1, 0, 0, 0, 101, - 314, 1, 0, 0, 0, 103, 316, 1, 0, 0, 0, 105, 318, 1, 0, 0, 0, 107, 320, - 1, 0, 0, 0, 109, 322, 1, 0, 0, 0, 111, 324, 1, 0, 0, 0, 113, 326, 1, 0, - 0, 0, 115, 328, 1, 0, 0, 0, 117, 330, 1, 0, 0, 0, 119, 332, 1, 0, 0, 0, - 121, 334, 1, 0, 0, 0, 123, 337, 1, 0, 0, 0, 125, 339, 1, 0, 0, 0, 127, - 341, 1, 0, 0, 0, 129, 343, 1, 0, 0, 0, 131, 346, 1, 0, 0, 0, 133, 348, - 1, 0, 0, 0, 135, 351, 1, 0, 0, 0, 137, 354, 1, 0, 0, 0, 139, 357, 1, 0, - 0, 0, 141, 361, 1, 0, 0, 0, 143, 368, 1, 0, 0, 0, 145, 372, 1, 0, 0, 0, - 147, 398, 1, 0, 0, 0, 149, 401, 1, 0, 0, 0, 151, 407, 1, 0, 0, 0, 153, - 418, 1, 0, 0, 0, 155, 420, 1, 0, 0, 0, 157, 422, 1, 0, 0, 0, 159, 429, - 1, 0, 0, 0, 161, 441, 1, 0, 0, 0, 163, 445, 1, 0, 0, 0, 165, 447, 1, 0, - 0, 0, 167, 456, 1, 0, 0, 0, 169, 170, 7, 0, 0, 0, 170, 2, 1, 0, 0, 0, 171, - 172, 7, 1, 0, 0, 172, 4, 1, 0, 0, 0, 173, 174, 7, 2, 0, 0, 174, 6, 1, 0, - 0, 0, 175, 176, 7, 3, 0, 0, 176, 8, 1, 0, 0, 0, 177, 178, 7, 4, 0, 0, 178, - 10, 1, 0, 0, 0, 179, 180, 7, 5, 0, 0, 180, 12, 1, 0, 0, 0, 181, 182, 7, - 6, 0, 0, 182, 14, 1, 0, 0, 0, 183, 184, 7, 7, 0, 0, 184, 16, 1, 0, 0, 0, - 185, 186, 7, 8, 0, 0, 186, 18, 1, 0, 0, 0, 187, 188, 7, 9, 0, 0, 188, 20, - 1, 0, 0, 0, 189, 190, 7, 10, 0, 0, 190, 22, 1, 0, 0, 0, 191, 192, 7, 11, - 0, 0, 192, 24, 1, 0, 0, 0, 193, 194, 7, 12, 0, 0, 194, 26, 1, 0, 0, 0, - 195, 196, 7, 13, 0, 0, 196, 28, 1, 0, 0, 0, 197, 198, 7, 14, 0, 0, 198, - 30, 1, 0, 0, 0, 199, 200, 7, 15, 0, 0, 200, 32, 1, 0, 0, 0, 201, 202, 7, - 16, 0, 0, 202, 34, 1, 0, 0, 0, 203, 204, 7, 17, 0, 0, 204, 36, 1, 0, 0, - 0, 205, 206, 7, 18, 0, 0, 206, 38, 1, 0, 0, 0, 207, 208, 7, 19, 0, 0, 208, - 40, 1, 0, 0, 0, 209, 210, 7, 20, 0, 0, 210, 42, 1, 0, 0, 0, 211, 212, 7, - 21, 0, 0, 212, 44, 1, 0, 0, 0, 213, 214, 7, 22, 0, 0, 214, 46, 1, 0, 0, - 0, 215, 216, 7, 23, 0, 0, 216, 48, 1, 0, 0, 0, 217, 218, 7, 24, 0, 0, 218, - 50, 1, 0, 0, 0, 219, 220, 7, 25, 0, 0, 220, 52, 1, 0, 0, 0, 221, 222, 5, - 42, 0, 0, 222, 54, 1, 0, 0, 0, 223, 224, 7, 0, 0, 0, 224, 225, 7, 18, 0, - 0, 225, 56, 1, 0, 0, 0, 226, 227, 7, 18, 0, 0, 227, 228, 7, 4, 0, 0, 228, - 229, 7, 11, 0, 0, 229, 230, 7, 4, 0, 0, 230, 231, 7, 2, 0, 0, 231, 232, - 7, 19, 0, 0, 232, 58, 1, 0, 0, 0, 233, 234, 7, 5, 0, 0, 234, 235, 7, 17, - 0, 0, 235, 236, 7, 14, 0, 0, 236, 237, 7, 12, 0, 0, 237, 60, 1, 0, 0, 0, - 238, 239, 7, 3, 0, 0, 239, 240, 7, 8, 0, 0, 240, 241, 7, 18, 0, 0, 241, - 242, 7, 19, 0, 0, 242, 243, 7, 8, 0, 0, 243, 244, 7, 13, 0, 0, 244, 245, - 7, 2, 0, 0, 245, 246, 7, 19, 0, 0, 246, 62, 1, 0, 0, 0, 247, 248, 7, 20, - 0, 0, 248, 249, 7, 13, 0, 0, 249, 250, 7, 3, 0, 0, 250, 251, 7, 4, 0, 0, - 251, 252, 7, 5, 0, 0, 252, 253, 7, 8, 0, 0, 253, 254, 7, 13, 0, 0, 254, - 255, 7, 4, 0, 0, 255, 256, 7, 3, 0, 0, 256, 64, 1, 0, 0, 0, 257, 258, 7, - 13, 0, 0, 258, 259, 7, 20, 0, 0, 259, 260, 7, 11, 0, 0, 260, 261, 7, 11, - 0, 0, 261, 66, 1, 0, 0, 0, 262, 263, 7, 5, 0, 0, 263, 264, 7, 0, 0, 0, - 264, 265, 7, 11, 0, 0, 265, 266, 7, 18, 0, 0, 266, 267, 7, 4, 0, 0, 267, - 68, 1, 0, 0, 0, 268, 269, 7, 19, 0, 0, 269, 270, 7, 17, 0, 0, 270, 271, - 7, 20, 0, 0, 271, 272, 7, 4, 0, 0, 272, 70, 1, 0, 0, 0, 273, 274, 7, 13, - 0, 0, 274, 275, 7, 14, 0, 0, 275, 276, 7, 19, 0, 0, 276, 72, 1, 0, 0, 0, - 277, 278, 7, 20, 0, 0, 278, 279, 7, 3, 0, 0, 279, 280, 7, 5, 0, 0, 280, - 74, 1, 0, 0, 0, 281, 282, 7, 22, 0, 0, 282, 283, 7, 7, 0, 0, 283, 284, - 7, 4, 0, 0, 284, 285, 7, 17, 0, 0, 285, 286, 7, 4, 0, 0, 286, 76, 1, 0, - 0, 0, 287, 288, 7, 0, 0, 0, 288, 289, 7, 13, 0, 0, 289, 290, 7, 3, 0, 0, - 290, 78, 1, 0, 0, 0, 291, 292, 7, 14, 0, 0, 292, 293, 7, 17, 0, 0, 293, - 80, 1, 0, 0, 0, 294, 295, 5, 64, 0, 0, 295, 82, 1, 0, 0, 0, 296, 297, 5, - 123, 0, 0, 297, 84, 1, 0, 0, 0, 298, 299, 5, 125, 0, 0, 299, 86, 1, 0, - 0, 0, 300, 301, 5, 91, 0, 0, 301, 88, 1, 0, 0, 0, 302, 303, 5, 93, 0, 0, - 303, 90, 1, 0, 0, 0, 304, 305, 5, 40, 0, 0, 305, 92, 1, 0, 0, 0, 306, 307, - 5, 41, 0, 0, 307, 94, 1, 0, 0, 0, 308, 309, 5, 39, 0, 0, 309, 96, 1, 0, - 0, 0, 310, 311, 5, 34, 0, 0, 311, 98, 1, 0, 0, 0, 312, 313, 5, 44, 0, 0, - 313, 100, 1, 0, 0, 0, 314, 315, 5, 46, 0, 0, 315, 102, 1, 0, 0, 0, 316, - 317, 5, 63, 0, 0, 317, 104, 1, 0, 0, 0, 318, 319, 5, 58, 0, 0, 319, 106, - 1, 0, 0, 0, 320, 321, 5, 43, 0, 0, 321, 108, 1, 0, 0, 0, 322, 323, 5, 45, - 0, 0, 323, 110, 1, 0, 0, 0, 324, 325, 5, 126, 0, 0, 325, 112, 1, 0, 0, - 0, 326, 327, 5, 47, 0, 0, 327, 114, 1, 0, 0, 0, 328, 329, 5, 37, 0, 0, - 329, 116, 1, 0, 0, 0, 330, 331, 5, 38, 0, 0, 331, 118, 1, 0, 0, 0, 332, - 333, 5, 124, 0, 0, 333, 120, 1, 0, 0, 0, 334, 335, 5, 124, 0, 0, 335, 336, - 5, 124, 0, 0, 336, 122, 1, 0, 0, 0, 337, 338, 5, 94, 0, 0, 338, 124, 1, - 0, 0, 0, 339, 340, 5, 61, 0, 0, 340, 126, 1, 0, 0, 0, 341, 342, 5, 60, - 0, 0, 342, 128, 1, 0, 0, 0, 343, 344, 5, 60, 0, 0, 344, 345, 5, 61, 0, - 0, 345, 130, 1, 0, 0, 0, 346, 347, 5, 62, 0, 0, 347, 132, 1, 0, 0, 0, 348, - 349, 5, 62, 0, 0, 349, 350, 5, 61, 0, 0, 350, 134, 1, 0, 0, 0, 351, 352, - 5, 60, 0, 0, 352, 353, 5, 60, 0, 0, 353, 136, 1, 0, 0, 0, 354, 355, 5, - 62, 0, 0, 355, 356, 5, 62, 0, 0, 356, 138, 1, 0, 0, 0, 357, 358, 5, 62, - 0, 0, 358, 359, 5, 62, 0, 0, 359, 360, 5, 62, 0, 0, 360, 140, 1, 0, 0, - 0, 361, 365, 7, 26, 0, 0, 362, 364, 7, 27, 0, 0, 363, 362, 1, 0, 0, 0, - 364, 367, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, - 142, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 368, 369, 7, 28, 0, 0, 369, 370, - 1, 0, 0, 0, 370, 371, 6, 71, 0, 0, 371, 144, 1, 0, 0, 0, 372, 373, 7, 29, - 0, 0, 373, 146, 1, 0, 0, 0, 374, 376, 3, 145, 72, 0, 375, 374, 1, 0, 0, - 0, 376, 377, 1, 0, 0, 0, 377, 375, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, - 379, 1, 0, 0, 0, 379, 381, 5, 46, 0, 0, 380, 382, 3, 145, 72, 0, 381, 380, - 1, 0, 0, 0, 382, 383, 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 383, 384, 1, 0, - 0, 0, 384, 399, 1, 0, 0, 0, 385, 387, 3, 145, 72, 0, 386, 385, 1, 0, 0, - 0, 387, 388, 1, 0, 0, 0, 388, 386, 1, 0, 0, 0, 388, 389, 1, 0, 0, 0, 389, - 390, 1, 0, 0, 0, 390, 391, 5, 46, 0, 0, 391, 399, 1, 0, 0, 0, 392, 394, - 5, 46, 0, 0, 393, 395, 3, 145, 72, 0, 394, 393, 1, 0, 0, 0, 395, 396, 1, - 0, 0, 0, 396, 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 399, 1, 0, 0, - 0, 398, 375, 1, 0, 0, 0, 398, 386, 1, 0, 0, 0, 398, 392, 1, 0, 0, 0, 399, - 148, 1, 0, 0, 0, 400, 402, 3, 145, 72, 0, 401, 400, 1, 0, 0, 0, 402, 403, - 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 403, 404, 1, 0, 0, 0, 404, 150, 1, 0, - 0, 0, 405, 408, 3, 149, 74, 0, 406, 408, 3, 147, 73, 0, 407, 405, 1, 0, - 0, 0, 407, 406, 1, 0, 0, 0, 408, 409, 1, 0, 0, 0, 409, 411, 7, 4, 0, 0, - 410, 412, 7, 30, 0, 0, 411, 410, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, - 414, 1, 0, 0, 0, 413, 415, 3, 145, 72, 0, 414, 413, 1, 0, 0, 0, 415, 416, - 1, 0, 0, 0, 416, 414, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 152, 1, 0, - 0, 0, 418, 419, 3, 147, 73, 0, 419, 154, 1, 0, 0, 0, 420, 421, 7, 31, 0, - 0, 421, 156, 1, 0, 0, 0, 422, 423, 5, 48, 0, 0, 423, 425, 7, 23, 0, 0, - 424, 426, 3, 155, 77, 0, 425, 424, 1, 0, 0, 0, 426, 427, 1, 0, 0, 0, 427, - 425, 1, 0, 0, 0, 427, 428, 1, 0, 0, 0, 428, 158, 1, 0, 0, 0, 429, 430, - 7, 32, 0, 0, 430, 160, 1, 0, 0, 0, 431, 432, 5, 92, 0, 0, 432, 442, 7, - 33, 0, 0, 433, 434, 5, 92, 0, 0, 434, 435, 7, 20, 0, 0, 435, 436, 1, 0, - 0, 0, 436, 437, 3, 155, 77, 0, 437, 438, 3, 155, 77, 0, 438, 439, 3, 155, - 77, 0, 439, 440, 3, 155, 77, 0, 440, 442, 1, 0, 0, 0, 441, 431, 1, 0, 0, - 0, 441, 433, 1, 0, 0, 0, 442, 162, 1, 0, 0, 0, 443, 446, 3, 161, 80, 0, - 444, 446, 8, 34, 0, 0, 445, 443, 1, 0, 0, 0, 445, 444, 1, 0, 0, 0, 446, - 164, 1, 0, 0, 0, 447, 451, 3, 95, 47, 0, 448, 450, 3, 163, 81, 0, 449, - 448, 1, 0, 0, 0, 450, 453, 1, 0, 0, 0, 451, 449, 1, 0, 0, 0, 451, 452, - 1, 0, 0, 0, 452, 454, 1, 0, 0, 0, 453, 451, 1, 0, 0, 0, 454, 455, 3, 95, - 47, 0, 455, 166, 1, 0, 0, 0, 456, 460, 3, 97, 48, 0, 457, 459, 3, 163, - 81, 0, 458, 457, 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, 3, 97, 48, 0, 464, 168, 1, 0, 0, 0, 16, 0, 365, 377, 383, 388, 396, - 398, 403, 407, 411, 416, 427, 441, 445, 451, 460, 1, 0, 1, 0, + 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, + 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, + 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, + 7, 99, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, + 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, + 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, + 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, + 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, + 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, + 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, + 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, + 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, + 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, + 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, + 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, + 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, + 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, + 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, + 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, + 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, + 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, + 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, + 1, 53, 1, 54, 1, 54, 1, 54, 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, 60, 1, 60, 1, 61, 1, 61, 1, 62, + 1, 62, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, + 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 72, 1, 72, + 1, 73, 1, 73, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, + 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, + 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, + 85, 1, 85, 1, 85, 1, 86, 1, 86, 5, 86, 481, 8, 86, 10, 86, 12, 86, 484, + 9, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 89, 4, 89, 493, 8, + 89, 11, 89, 12, 89, 494, 1, 89, 1, 89, 4, 89, 499, 8, 89, 11, 89, 12, 89, + 500, 1, 89, 4, 89, 504, 8, 89, 11, 89, 12, 89, 505, 1, 89, 1, 89, 1, 89, + 1, 89, 4, 89, 512, 8, 89, 11, 89, 12, 89, 513, 3, 89, 516, 8, 89, 1, 90, + 4, 90, 519, 8, 90, 11, 90, 12, 90, 520, 1, 91, 1, 91, 3, 91, 525, 8, 91, + 1, 91, 1, 91, 3, 91, 529, 8, 91, 1, 91, 4, 91, 532, 8, 91, 11, 91, 12, + 91, 533, 1, 92, 1, 92, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 4, 94, 543, 8, + 94, 11, 94, 12, 94, 544, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, + 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 3, 96, 559, 8, 96, 1, 97, 1, 97, 3, + 97, 563, 8, 97, 1, 98, 1, 98, 5, 98, 567, 8, 98, 10, 98, 12, 98, 570, 9, + 98, 1, 98, 1, 98, 1, 99, 1, 99, 5, 99, 576, 8, 99, 10, 99, 12, 99, 579, + 9, 99, 1, 99, 1, 99, 0, 0, 100, 1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, + 0, 15, 0, 17, 0, 19, 0, 21, 0, 23, 0, 25, 0, 27, 0, 29, 0, 31, 0, 33, 0, + 35, 0, 37, 0, 39, 0, 41, 0, 43, 0, 45, 0, 47, 0, 49, 0, 51, 0, 53, 1, 55, + 2, 57, 3, 59, 4, 61, 5, 63, 6, 65, 7, 67, 8, 69, 9, 71, 10, 73, 11, 75, + 12, 77, 13, 79, 14, 81, 15, 83, 16, 85, 17, 87, 18, 89, 19, 91, 20, 93, + 21, 95, 22, 97, 23, 99, 24, 101, 25, 103, 26, 105, 27, 107, 28, 109, 29, + 111, 30, 113, 31, 115, 32, 117, 33, 119, 34, 121, 35, 123, 36, 125, 37, + 127, 38, 129, 39, 131, 40, 133, 41, 135, 42, 137, 43, 139, 44, 141, 45, + 143, 46, 145, 47, 147, 48, 149, 49, 151, 50, 153, 51, 155, 52, 157, 53, + 159, 54, 161, 55, 163, 56, 165, 57, 167, 58, 169, 59, 171, 60, 173, 61, + 175, 62, 177, 0, 179, 0, 181, 63, 183, 64, 185, 65, 187, 0, 189, 66, 191, + 0, 193, 0, 195, 0, 197, 67, 199, 68, 1, 0, 35, 2, 0, 65, 65, 97, 97, 2, + 0, 66, 66, 98, 98, 2, 0, 67, 67, 99, 99, 2, 0, 68, 68, 100, 100, 2, 0, + 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, 0, 71, 71, 103, 103, 2, 0, + 72, 72, 104, 104, 2, 0, 73, 73, 105, 105, 2, 0, 74, 74, 106, 106, 2, 0, + 75, 75, 107, 107, 2, 0, 76, 76, 108, 108, 2, 0, 77, 77, 109, 109, 2, 0, + 78, 78, 110, 110, 2, 0, 79, 79, 111, 111, 2, 0, 80, 80, 112, 112, 2, 0, + 81, 81, 113, 113, 2, 0, 82, 82, 114, 114, 2, 0, 83, 83, 115, 115, 2, 0, + 84, 84, 116, 116, 2, 0, 85, 85, 117, 117, 2, 0, 86, 86, 118, 118, 2, 0, + 87, 87, 119, 119, 2, 0, 88, 88, 120, 120, 2, 0, 89, 89, 121, 121, 2, 0, + 90, 90, 122, 122, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, + 95, 95, 97, 122, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 48, 57, 2, 0, 43, 43, + 45, 45, 3, 0, 48, 57, 65, 70, 97, 102, 10, 0, 192, 214, 216, 246, 248, + 8191, 11264, 12287, 12352, 12687, 13056, 13183, 13312, 16383, 19968, 55295, + 63744, 64255, 65280, 65520, 14, 0, 34, 34, 39, 39, 47, 47, 66, 66, 70, + 70, 78, 78, 82, 82, 84, 84, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, + 116, 116, 5, 0, 10, 10, 13, 13, 34, 34, 39, 39, 92, 92, 565, 0, 53, 1, + 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, + 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, + 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, + 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, + 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, + 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, + 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, + 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, + 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, + 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, + 0, 129, 1, 0, 0, 0, 0, 131, 1, 0, 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, + 0, 0, 0, 0, 137, 1, 0, 0, 0, 0, 139, 1, 0, 0, 0, 0, 141, 1, 0, 0, 0, 0, + 143, 1, 0, 0, 0, 0, 145, 1, 0, 0, 0, 0, 147, 1, 0, 0, 0, 0, 149, 1, 0, + 0, 0, 0, 151, 1, 0, 0, 0, 0, 153, 1, 0, 0, 0, 0, 155, 1, 0, 0, 0, 0, 157, + 1, 0, 0, 0, 0, 159, 1, 0, 0, 0, 0, 161, 1, 0, 0, 0, 0, 163, 1, 0, 0, 0, + 0, 165, 1, 0, 0, 0, 0, 167, 1, 0, 0, 0, 0, 169, 1, 0, 0, 0, 0, 171, 1, + 0, 0, 0, 0, 173, 1, 0, 0, 0, 0, 175, 1, 0, 0, 0, 0, 181, 1, 0, 0, 0, 0, + 183, 1, 0, 0, 0, 0, 185, 1, 0, 0, 0, 0, 189, 1, 0, 0, 0, 0, 197, 1, 0, + 0, 0, 0, 199, 1, 0, 0, 0, 1, 201, 1, 0, 0, 0, 3, 203, 1, 0, 0, 0, 5, 205, + 1, 0, 0, 0, 7, 207, 1, 0, 0, 0, 9, 209, 1, 0, 0, 0, 11, 211, 1, 0, 0, 0, + 13, 213, 1, 0, 0, 0, 15, 215, 1, 0, 0, 0, 17, 217, 1, 0, 0, 0, 19, 219, + 1, 0, 0, 0, 21, 221, 1, 0, 0, 0, 23, 223, 1, 0, 0, 0, 25, 225, 1, 0, 0, + 0, 27, 227, 1, 0, 0, 0, 29, 229, 1, 0, 0, 0, 31, 231, 1, 0, 0, 0, 33, 233, + 1, 0, 0, 0, 35, 235, 1, 0, 0, 0, 37, 237, 1, 0, 0, 0, 39, 239, 1, 0, 0, + 0, 41, 241, 1, 0, 0, 0, 43, 243, 1, 0, 0, 0, 45, 245, 1, 0, 0, 0, 47, 247, + 1, 0, 0, 0, 49, 249, 1, 0, 0, 0, 51, 251, 1, 0, 0, 0, 53, 253, 1, 0, 0, + 0, 55, 255, 1, 0, 0, 0, 57, 258, 1, 0, 0, 0, 59, 265, 1, 0, 0, 0, 61, 270, + 1, 0, 0, 0, 63, 279, 1, 0, 0, 0, 65, 289, 1, 0, 0, 0, 67, 294, 1, 0, 0, + 0, 69, 300, 1, 0, 0, 0, 71, 305, 1, 0, 0, 0, 73, 309, 1, 0, 0, 0, 75, 313, + 1, 0, 0, 0, 77, 319, 1, 0, 0, 0, 79, 323, 1, 0, 0, 0, 81, 326, 1, 0, 0, + 0, 83, 329, 1, 0, 0, 0, 85, 337, 1, 0, 0, 0, 87, 341, 1, 0, 0, 0, 89, 347, + 1, 0, 0, 0, 91, 353, 1, 0, 0, 0, 93, 356, 1, 0, 0, 0, 95, 362, 1, 0, 0, + 0, 97, 369, 1, 0, 0, 0, 99, 375, 1, 0, 0, 0, 101, 379, 1, 0, 0, 0, 103, + 384, 1, 0, 0, 0, 105, 391, 1, 0, 0, 0, 107, 396, 1, 0, 0, 0, 109, 403, + 1, 0, 0, 0, 111, 408, 1, 0, 0, 0, 113, 410, 1, 0, 0, 0, 115, 412, 1, 0, + 0, 0, 117, 414, 1, 0, 0, 0, 119, 416, 1, 0, 0, 0, 121, 418, 1, 0, 0, 0, + 123, 420, 1, 0, 0, 0, 125, 422, 1, 0, 0, 0, 127, 424, 1, 0, 0, 0, 129, + 426, 1, 0, 0, 0, 131, 428, 1, 0, 0, 0, 133, 430, 1, 0, 0, 0, 135, 432, + 1, 0, 0, 0, 137, 434, 1, 0, 0, 0, 139, 436, 1, 0, 0, 0, 141, 438, 1, 0, + 0, 0, 143, 440, 1, 0, 0, 0, 145, 442, 1, 0, 0, 0, 147, 444, 1, 0, 0, 0, + 149, 446, 1, 0, 0, 0, 151, 448, 1, 0, 0, 0, 153, 451, 1, 0, 0, 0, 155, + 453, 1, 0, 0, 0, 157, 455, 1, 0, 0, 0, 159, 457, 1, 0, 0, 0, 161, 460, + 1, 0, 0, 0, 163, 462, 1, 0, 0, 0, 165, 465, 1, 0, 0, 0, 167, 468, 1, 0, + 0, 0, 169, 471, 1, 0, 0, 0, 171, 475, 1, 0, 0, 0, 173, 478, 1, 0, 0, 0, + 175, 485, 1, 0, 0, 0, 177, 489, 1, 0, 0, 0, 179, 515, 1, 0, 0, 0, 181, + 518, 1, 0, 0, 0, 183, 524, 1, 0, 0, 0, 185, 535, 1, 0, 0, 0, 187, 537, + 1, 0, 0, 0, 189, 539, 1, 0, 0, 0, 191, 546, 1, 0, 0, 0, 193, 558, 1, 0, + 0, 0, 195, 562, 1, 0, 0, 0, 197, 564, 1, 0, 0, 0, 199, 573, 1, 0, 0, 0, + 201, 202, 7, 0, 0, 0, 202, 2, 1, 0, 0, 0, 203, 204, 7, 1, 0, 0, 204, 4, + 1, 0, 0, 0, 205, 206, 7, 2, 0, 0, 206, 6, 1, 0, 0, 0, 207, 208, 7, 3, 0, + 0, 208, 8, 1, 0, 0, 0, 209, 210, 7, 4, 0, 0, 210, 10, 1, 0, 0, 0, 211, + 212, 7, 5, 0, 0, 212, 12, 1, 0, 0, 0, 213, 214, 7, 6, 0, 0, 214, 14, 1, + 0, 0, 0, 215, 216, 7, 7, 0, 0, 216, 16, 1, 0, 0, 0, 217, 218, 7, 8, 0, + 0, 218, 18, 1, 0, 0, 0, 219, 220, 7, 9, 0, 0, 220, 20, 1, 0, 0, 0, 221, + 222, 7, 10, 0, 0, 222, 22, 1, 0, 0, 0, 223, 224, 7, 11, 0, 0, 224, 24, + 1, 0, 0, 0, 225, 226, 7, 12, 0, 0, 226, 26, 1, 0, 0, 0, 227, 228, 7, 13, + 0, 0, 228, 28, 1, 0, 0, 0, 229, 230, 7, 14, 0, 0, 230, 30, 1, 0, 0, 0, + 231, 232, 7, 15, 0, 0, 232, 32, 1, 0, 0, 0, 233, 234, 7, 16, 0, 0, 234, + 34, 1, 0, 0, 0, 235, 236, 7, 17, 0, 0, 236, 36, 1, 0, 0, 0, 237, 238, 7, + 18, 0, 0, 238, 38, 1, 0, 0, 0, 239, 240, 7, 19, 0, 0, 240, 40, 1, 0, 0, + 0, 241, 242, 7, 20, 0, 0, 242, 42, 1, 0, 0, 0, 243, 244, 7, 21, 0, 0, 244, + 44, 1, 0, 0, 0, 245, 246, 7, 22, 0, 0, 246, 46, 1, 0, 0, 0, 247, 248, 7, + 23, 0, 0, 248, 48, 1, 0, 0, 0, 249, 250, 7, 24, 0, 0, 250, 50, 1, 0, 0, + 0, 251, 252, 7, 25, 0, 0, 252, 52, 1, 0, 0, 0, 253, 254, 5, 42, 0, 0, 254, + 54, 1, 0, 0, 0, 255, 256, 7, 0, 0, 0, 256, 257, 7, 18, 0, 0, 257, 56, 1, + 0, 0, 0, 258, 259, 7, 18, 0, 0, 259, 260, 7, 4, 0, 0, 260, 261, 7, 11, + 0, 0, 261, 262, 7, 4, 0, 0, 262, 263, 7, 2, 0, 0, 263, 264, 7, 19, 0, 0, + 264, 58, 1, 0, 0, 0, 265, 266, 7, 5, 0, 0, 266, 267, 7, 17, 0, 0, 267, + 268, 7, 14, 0, 0, 268, 269, 7, 12, 0, 0, 269, 60, 1, 0, 0, 0, 270, 271, + 7, 3, 0, 0, 271, 272, 7, 8, 0, 0, 272, 273, 7, 18, 0, 0, 273, 274, 7, 19, + 0, 0, 274, 275, 7, 8, 0, 0, 275, 276, 7, 13, 0, 0, 276, 277, 7, 2, 0, 0, + 277, 278, 7, 19, 0, 0, 278, 62, 1, 0, 0, 0, 279, 280, 7, 20, 0, 0, 280, + 281, 7, 13, 0, 0, 281, 282, 7, 3, 0, 0, 282, 283, 7, 4, 0, 0, 283, 284, + 7, 5, 0, 0, 284, 285, 7, 8, 0, 0, 285, 286, 7, 13, 0, 0, 286, 287, 7, 4, + 0, 0, 287, 288, 7, 3, 0, 0, 288, 64, 1, 0, 0, 0, 289, 290, 7, 13, 0, 0, + 290, 291, 7, 20, 0, 0, 291, 292, 7, 11, 0, 0, 292, 293, 7, 11, 0, 0, 293, + 66, 1, 0, 0, 0, 294, 295, 7, 5, 0, 0, 295, 296, 7, 0, 0, 0, 296, 297, 7, + 11, 0, 0, 297, 298, 7, 18, 0, 0, 298, 299, 7, 4, 0, 0, 299, 68, 1, 0, 0, + 0, 300, 301, 7, 19, 0, 0, 301, 302, 7, 17, 0, 0, 302, 303, 7, 20, 0, 0, + 303, 304, 7, 4, 0, 0, 304, 70, 1, 0, 0, 0, 305, 306, 7, 13, 0, 0, 306, + 307, 7, 14, 0, 0, 307, 308, 7, 19, 0, 0, 308, 72, 1, 0, 0, 0, 309, 310, + 7, 20, 0, 0, 310, 311, 7, 3, 0, 0, 311, 312, 7, 5, 0, 0, 312, 74, 1, 0, + 0, 0, 313, 314, 7, 22, 0, 0, 314, 315, 7, 7, 0, 0, 315, 316, 7, 4, 0, 0, + 316, 317, 7, 17, 0, 0, 317, 318, 7, 4, 0, 0, 318, 76, 1, 0, 0, 0, 319, + 320, 7, 0, 0, 0, 320, 321, 7, 13, 0, 0, 321, 322, 7, 3, 0, 0, 322, 78, + 1, 0, 0, 0, 323, 324, 7, 14, 0, 0, 324, 325, 7, 17, 0, 0, 325, 80, 1, 0, + 0, 0, 326, 327, 7, 8, 0, 0, 327, 328, 7, 13, 0, 0, 328, 82, 1, 0, 0, 0, + 329, 330, 7, 1, 0, 0, 330, 331, 7, 4, 0, 0, 331, 332, 7, 19, 0, 0, 332, + 333, 7, 22, 0, 0, 333, 334, 7, 4, 0, 0, 334, 335, 7, 4, 0, 0, 335, 336, + 7, 13, 0, 0, 336, 84, 1, 0, 0, 0, 337, 338, 7, 19, 0, 0, 338, 339, 7, 14, + 0, 0, 339, 340, 7, 15, 0, 0, 340, 86, 1, 0, 0, 0, 341, 342, 7, 21, 0, 0, + 342, 343, 7, 0, 0, 0, 343, 344, 7, 11, 0, 0, 344, 345, 7, 20, 0, 0, 345, + 346, 7, 4, 0, 0, 346, 88, 1, 0, 0, 0, 347, 348, 7, 14, 0, 0, 348, 349, + 7, 17, 0, 0, 349, 350, 7, 3, 0, 0, 350, 351, 7, 4, 0, 0, 351, 352, 7, 17, + 0, 0, 352, 90, 1, 0, 0, 0, 353, 354, 7, 1, 0, 0, 354, 355, 7, 24, 0, 0, + 355, 92, 1, 0, 0, 0, 356, 357, 7, 6, 0, 0, 357, 358, 7, 17, 0, 0, 358, + 359, 7, 14, 0, 0, 359, 360, 7, 20, 0, 0, 360, 361, 7, 15, 0, 0, 361, 94, + 1, 0, 0, 0, 362, 363, 7, 14, 0, 0, 363, 364, 7, 5, 0, 0, 364, 365, 7, 5, + 0, 0, 365, 366, 7, 18, 0, 0, 366, 367, 7, 4, 0, 0, 367, 368, 7, 19, 0, + 0, 368, 96, 1, 0, 0, 0, 369, 370, 7, 11, 0, 0, 370, 371, 7, 8, 0, 0, 371, + 372, 7, 12, 0, 0, 372, 373, 7, 8, 0, 0, 373, 374, 7, 19, 0, 0, 374, 98, + 1, 0, 0, 0, 375, 376, 7, 0, 0, 0, 376, 377, 7, 18, 0, 0, 377, 378, 7, 2, + 0, 0, 378, 100, 1, 0, 0, 0, 379, 380, 7, 3, 0, 0, 380, 381, 7, 4, 0, 0, + 381, 382, 7, 18, 0, 0, 382, 383, 7, 2, 0, 0, 383, 102, 1, 0, 0, 0, 384, + 385, 7, 4, 0, 0, 385, 386, 7, 23, 0, 0, 386, 387, 7, 8, 0, 0, 387, 388, + 7, 18, 0, 0, 388, 389, 7, 19, 0, 0, 389, 390, 7, 18, 0, 0, 390, 104, 1, + 0, 0, 0, 391, 392, 7, 11, 0, 0, 392, 393, 7, 8, 0, 0, 393, 394, 7, 10, + 0, 0, 394, 395, 7, 4, 0, 0, 395, 106, 1, 0, 0, 0, 396, 397, 7, 7, 0, 0, + 397, 398, 7, 0, 0, 0, 398, 399, 7, 21, 0, 0, 399, 400, 7, 8, 0, 0, 400, + 401, 7, 13, 0, 0, 401, 402, 7, 6, 0, 0, 402, 108, 1, 0, 0, 0, 403, 404, + 7, 9, 0, 0, 404, 405, 7, 14, 0, 0, 405, 406, 7, 8, 0, 0, 406, 407, 7, 13, + 0, 0, 407, 110, 1, 0, 0, 0, 408, 409, 5, 64, 0, 0, 409, 112, 1, 0, 0, 0, + 410, 411, 5, 123, 0, 0, 411, 114, 1, 0, 0, 0, 412, 413, 5, 125, 0, 0, 413, + 116, 1, 0, 0, 0, 414, 415, 5, 91, 0, 0, 415, 118, 1, 0, 0, 0, 416, 417, + 5, 93, 0, 0, 417, 120, 1, 0, 0, 0, 418, 419, 5, 40, 0, 0, 419, 122, 1, + 0, 0, 0, 420, 421, 5, 41, 0, 0, 421, 124, 1, 0, 0, 0, 422, 423, 5, 39, + 0, 0, 423, 126, 1, 0, 0, 0, 424, 425, 5, 34, 0, 0, 425, 128, 1, 0, 0, 0, + 426, 427, 5, 44, 0, 0, 427, 130, 1, 0, 0, 0, 428, 429, 5, 46, 0, 0, 429, + 132, 1, 0, 0, 0, 430, 431, 5, 63, 0, 0, 431, 134, 1, 0, 0, 0, 432, 433, + 5, 58, 0, 0, 433, 136, 1, 0, 0, 0, 434, 435, 5, 43, 0, 0, 435, 138, 1, + 0, 0, 0, 436, 437, 5, 45, 0, 0, 437, 140, 1, 0, 0, 0, 438, 439, 5, 126, + 0, 0, 439, 142, 1, 0, 0, 0, 440, 441, 5, 47, 0, 0, 441, 144, 1, 0, 0, 0, + 442, 443, 5, 37, 0, 0, 443, 146, 1, 0, 0, 0, 444, 445, 5, 38, 0, 0, 445, + 148, 1, 0, 0, 0, 446, 447, 5, 124, 0, 0, 447, 150, 1, 0, 0, 0, 448, 449, + 5, 124, 0, 0, 449, 450, 5, 124, 0, 0, 450, 152, 1, 0, 0, 0, 451, 452, 5, + 94, 0, 0, 452, 154, 1, 0, 0, 0, 453, 454, 5, 61, 0, 0, 454, 156, 1, 0, + 0, 0, 455, 456, 5, 60, 0, 0, 456, 158, 1, 0, 0, 0, 457, 458, 5, 60, 0, + 0, 458, 459, 5, 61, 0, 0, 459, 160, 1, 0, 0, 0, 460, 461, 5, 62, 0, 0, + 461, 162, 1, 0, 0, 0, 462, 463, 5, 62, 0, 0, 463, 464, 5, 61, 0, 0, 464, + 164, 1, 0, 0, 0, 465, 466, 5, 60, 0, 0, 466, 467, 5, 60, 0, 0, 467, 166, + 1, 0, 0, 0, 468, 469, 5, 62, 0, 0, 469, 470, 5, 62, 0, 0, 470, 168, 1, + 0, 0, 0, 471, 472, 5, 62, 0, 0, 472, 473, 5, 62, 0, 0, 473, 474, 5, 62, + 0, 0, 474, 170, 1, 0, 0, 0, 475, 476, 5, 33, 0, 0, 476, 477, 5, 61, 0, + 0, 477, 172, 1, 0, 0, 0, 478, 482, 7, 26, 0, 0, 479, 481, 7, 27, 0, 0, + 480, 479, 1, 0, 0, 0, 481, 484, 1, 0, 0, 0, 482, 480, 1, 0, 0, 0, 482, + 483, 1, 0, 0, 0, 483, 174, 1, 0, 0, 0, 484, 482, 1, 0, 0, 0, 485, 486, + 7, 28, 0, 0, 486, 487, 1, 0, 0, 0, 487, 488, 6, 87, 0, 0, 488, 176, 1, + 0, 0, 0, 489, 490, 7, 29, 0, 0, 490, 178, 1, 0, 0, 0, 491, 493, 3, 177, + 88, 0, 492, 491, 1, 0, 0, 0, 493, 494, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, + 494, 495, 1, 0, 0, 0, 495, 496, 1, 0, 0, 0, 496, 498, 5, 46, 0, 0, 497, + 499, 3, 177, 88, 0, 498, 497, 1, 0, 0, 0, 499, 500, 1, 0, 0, 0, 500, 498, + 1, 0, 0, 0, 500, 501, 1, 0, 0, 0, 501, 516, 1, 0, 0, 0, 502, 504, 3, 177, + 88, 0, 503, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 503, 1, 0, 0, 0, + 505, 506, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 508, 5, 46, 0, 0, 508, + 516, 1, 0, 0, 0, 509, 511, 5, 46, 0, 0, 510, 512, 3, 177, 88, 0, 511, 510, + 1, 0, 0, 0, 512, 513, 1, 0, 0, 0, 513, 511, 1, 0, 0, 0, 513, 514, 1, 0, + 0, 0, 514, 516, 1, 0, 0, 0, 515, 492, 1, 0, 0, 0, 515, 503, 1, 0, 0, 0, + 515, 509, 1, 0, 0, 0, 516, 180, 1, 0, 0, 0, 517, 519, 3, 177, 88, 0, 518, + 517, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 518, 1, 0, 0, 0, 520, 521, + 1, 0, 0, 0, 521, 182, 1, 0, 0, 0, 522, 525, 3, 181, 90, 0, 523, 525, 3, + 179, 89, 0, 524, 522, 1, 0, 0, 0, 524, 523, 1, 0, 0, 0, 525, 526, 1, 0, + 0, 0, 526, 528, 7, 4, 0, 0, 527, 529, 7, 30, 0, 0, 528, 527, 1, 0, 0, 0, + 528, 529, 1, 0, 0, 0, 529, 531, 1, 0, 0, 0, 530, 532, 3, 177, 88, 0, 531, + 530, 1, 0, 0, 0, 532, 533, 1, 0, 0, 0, 533, 531, 1, 0, 0, 0, 533, 534, + 1, 0, 0, 0, 534, 184, 1, 0, 0, 0, 535, 536, 3, 179, 89, 0, 536, 186, 1, + 0, 0, 0, 537, 538, 7, 31, 0, 0, 538, 188, 1, 0, 0, 0, 539, 540, 5, 48, + 0, 0, 540, 542, 7, 23, 0, 0, 541, 543, 3, 187, 93, 0, 542, 541, 1, 0, 0, + 0, 543, 544, 1, 0, 0, 0, 544, 542, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, + 190, 1, 0, 0, 0, 546, 547, 7, 32, 0, 0, 547, 192, 1, 0, 0, 0, 548, 549, + 5, 92, 0, 0, 549, 559, 7, 33, 0, 0, 550, 551, 5, 92, 0, 0, 551, 552, 7, + 20, 0, 0, 552, 553, 1, 0, 0, 0, 553, 554, 3, 187, 93, 0, 554, 555, 3, 187, + 93, 0, 555, 556, 3, 187, 93, 0, 556, 557, 3, 187, 93, 0, 557, 559, 1, 0, + 0, 0, 558, 548, 1, 0, 0, 0, 558, 550, 1, 0, 0, 0, 559, 194, 1, 0, 0, 0, + 560, 563, 3, 193, 96, 0, 561, 563, 8, 34, 0, 0, 562, 560, 1, 0, 0, 0, 562, + 561, 1, 0, 0, 0, 563, 196, 1, 0, 0, 0, 564, 568, 3, 125, 62, 0, 565, 567, + 3, 195, 97, 0, 566, 565, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 566, 1, + 0, 0, 0, 568, 569, 1, 0, 0, 0, 569, 571, 1, 0, 0, 0, 570, 568, 1, 0, 0, + 0, 571, 572, 3, 125, 62, 0, 572, 198, 1, 0, 0, 0, 573, 577, 3, 127, 63, + 0, 574, 576, 3, 195, 97, 0, 575, 574, 1, 0, 0, 0, 576, 579, 1, 0, 0, 0, + 577, 575, 1, 0, 0, 0, 577, 578, 1, 0, 0, 0, 578, 580, 1, 0, 0, 0, 579, + 577, 1, 0, 0, 0, 580, 581, 3, 127, 63, 0, 581, 200, 1, 0, 0, 0, 16, 0, + 482, 494, 500, 505, 513, 515, 520, 524, 528, 533, 544, 558, 562, 568, 577, + 1, 0, 1, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -346,42 +405,58 @@ const ( CosmosDBLexerWHERE_SYMBOL = 12 CosmosDBLexerAND_SYMBOL = 13 CosmosDBLexerOR_SYMBOL = 14 - CosmosDBLexerAT_SYMBOL = 15 - CosmosDBLexerLC_BRACKET_SYMBOL = 16 - CosmosDBLexerRC_BRACKET_SYMBOL = 17 - CosmosDBLexerLS_BRACKET_SYMBOL = 18 - CosmosDBLexerRS_BRACKET_SYMBOL = 19 - CosmosDBLexerLR_BRACKET_SYMBOL = 20 - CosmosDBLexerRR_BRACKET_SYMBOL = 21 - CosmosDBLexerSINGLE_QUOTE_SYMBOL = 22 - CosmosDBLexerDOUBLE_QUOTE_SYMBOL = 23 - CosmosDBLexerCOMMA_SYMBOL = 24 - CosmosDBLexerDOT_SYMBOL = 25 - CosmosDBLexerQUESTION_MARK_SYMBOL = 26 - CosmosDBLexerCOLON_SYMBOL = 27 - CosmosDBLexerPLUS_SYMBOL = 28 - CosmosDBLexerMINUS_SYMBOL = 29 - CosmosDBLexerBIT_NOT_SYMBOL = 30 - CosmosDBLexerDIVIDE_SYMBOL = 31 - CosmosDBLexerMODULO_SYMBOL = 32 - CosmosDBLexerBIT_AND_SYMBOL = 33 - CosmosDBLexerBIT_OR_SYMBOL = 34 - CosmosDBLexerDOUBLE_BAR_SYMBOL = 35 - CosmosDBLexerBIT_XOR_SYMBOL = 36 - CosmosDBLexerEQUAL_SYMBOL = 37 - CosmosDBLexerLESS_THAN_OPERATOR = 38 - CosmosDBLexerLESS_THAN_EQUAL_OPERATOR = 39 - CosmosDBLexerGREATER_THAN_OPERATOR = 40 - CosmosDBLexerGREATER_THAN_EQUAL_OPERATOR = 41 - CosmosDBLexerLEFT_SHIFT_OPERATOR = 42 - CosmosDBLexerRIGHT_SHIFT_OPERATOR = 43 - CosmosDBLexerZERO_FILL_RIGHT_SHIFT_OPERATOR = 44 - CosmosDBLexerIDENTIFIER = 45 - CosmosDBLexerWHITESPACE = 46 - CosmosDBLexerDECIMAL = 47 - CosmosDBLexerREAL = 48 - CosmosDBLexerFLOAT = 49 - CosmosDBLexerHEXADECIMAL = 50 - CosmosDBLexerSINGLE_QUOTE_STRING_LITERAL = 51 - CosmosDBLexerDOUBLE_QUOTE_STRING_LITERAL = 52 + CosmosDBLexerIN_SYMBOL = 15 + CosmosDBLexerBETWEEN_SYMBOL = 16 + CosmosDBLexerTOP_SYMBOL = 17 + CosmosDBLexerVALUE_SYMBOL = 18 + CosmosDBLexerORDER_SYMBOL = 19 + CosmosDBLexerBY_SYMBOL = 20 + CosmosDBLexerGROUP_SYMBOL = 21 + CosmosDBLexerOFFSET_SYMBOL = 22 + CosmosDBLexerLIMIT_SYMBOL = 23 + CosmosDBLexerASC_SYMBOL = 24 + CosmosDBLexerDESC_SYMBOL = 25 + CosmosDBLexerEXISTS_SYMBOL = 26 + CosmosDBLexerLIKE_SYMBOL = 27 + CosmosDBLexerHAVING_SYMBOL = 28 + CosmosDBLexerJOIN_SYMBOL = 29 + CosmosDBLexerAT_SYMBOL = 30 + CosmosDBLexerLC_BRACKET_SYMBOL = 31 + CosmosDBLexerRC_BRACKET_SYMBOL = 32 + CosmosDBLexerLS_BRACKET_SYMBOL = 33 + CosmosDBLexerRS_BRACKET_SYMBOL = 34 + CosmosDBLexerLR_BRACKET_SYMBOL = 35 + CosmosDBLexerRR_BRACKET_SYMBOL = 36 + CosmosDBLexerSINGLE_QUOTE_SYMBOL = 37 + CosmosDBLexerDOUBLE_QUOTE_SYMBOL = 38 + CosmosDBLexerCOMMA_SYMBOL = 39 + CosmosDBLexerDOT_SYMBOL = 40 + CosmosDBLexerQUESTION_MARK_SYMBOL = 41 + CosmosDBLexerCOLON_SYMBOL = 42 + CosmosDBLexerPLUS_SYMBOL = 43 + CosmosDBLexerMINUS_SYMBOL = 44 + CosmosDBLexerBIT_NOT_SYMBOL = 45 + CosmosDBLexerDIVIDE_SYMBOL = 46 + CosmosDBLexerMODULO_SYMBOL = 47 + CosmosDBLexerBIT_AND_SYMBOL = 48 + CosmosDBLexerBIT_OR_SYMBOL = 49 + CosmosDBLexerDOUBLE_BAR_SYMBOL = 50 + CosmosDBLexerBIT_XOR_SYMBOL = 51 + CosmosDBLexerEQUAL_SYMBOL = 52 + CosmosDBLexerLESS_THAN_OPERATOR = 53 + CosmosDBLexerLESS_THAN_EQUAL_OPERATOR = 54 + CosmosDBLexerGREATER_THAN_OPERATOR = 55 + CosmosDBLexerGREATER_THAN_EQUAL_OPERATOR = 56 + CosmosDBLexerLEFT_SHIFT_OPERATOR = 57 + CosmosDBLexerRIGHT_SHIFT_OPERATOR = 58 + CosmosDBLexerZERO_FILL_RIGHT_SHIFT_OPERATOR = 59 + CosmosDBLexerNOT_EQUAL_OPERATOR = 60 + CosmosDBLexerIDENTIFIER = 61 + CosmosDBLexerWHITESPACE = 62 + CosmosDBLexerDECIMAL = 63 + CosmosDBLexerREAL = 64 + CosmosDBLexerFLOAT = 65 + CosmosDBLexerHEXADECIMAL = 66 + CosmosDBLexerSINGLE_QUOTE_STRING_LITERAL = 67 + CosmosDBLexerDOUBLE_QUOTE_STRING_LITERAL = 68 ) diff --git a/cosmosdb/cosmosdb_parser.go b/cosmosdb/cosmosdb_parser.go index 19ec7ae..32f0da6 100644 --- a/cosmosdb/cosmosdb_parser.go +++ b/cosmosdb/cosmosdb_parser.go @@ -34,16 +34,21 @@ func cosmosdbparserParserInit() { staticData.LiteralNames = []string{ "", "'*'", "'AS'", "'SELECT'", "'FROM'", "'DISTINCT'", "'UNDEFINED'", "'NULL'", "'FALSE'", "'TRUE'", "'NOT'", "'UDF'", "'WHERE'", "'AND'", - "'OR'", "'@'", "'{'", "'}'", "'['", "']'", "'('", "')'", "'''", "'\"'", - "','", "'.'", "'?'", "':'", "'+'", "'-'", "'~'", "'/'", "'%'", "'&'", - "'|'", "'||'", "'^'", "'='", "'<'", "'<='", "'>'", "'>='", "'<<'", "'>>'", - "'>>>'", + "'OR'", "'IN'", "'BETWEEN'", "'TOP'", "'VALUE'", "'ORDER'", "'BY'", + "'GROUP'", "'OFFSET'", "'LIMIT'", "'ASC'", "'DESC'", "'EXISTS'", "'LIKE'", + "'HAVING'", "'JOIN'", "'@'", "'{'", "'}'", "'['", "']'", "'('", "')'", + "'''", "'\"'", "','", "'.'", "'?'", "':'", "'+'", "'-'", "'~'", "'/'", + "'%'", "'&'", "'|'", "'||'", "'^'", "'='", "'<'", "'<='", "'>'", "'>='", + "'<<'", "'>>'", "'>>>'", "'!='", } staticData.SymbolicNames = []string{ "", "MULTIPLY_OPERATOR", "AS_SYMBOL", "SELECT_SYMBOL", "FROM_SYMBOL", "DISTINCT_SYMBOL", "UNDEFINED_SYMBOL", "NULL_SYMBOL", "FALSE_SYMBOL", "TRUE_SYMBOL", "NOT_SYMBOL", "UDF_SYMBOL", "WHERE_SYMBOL", "AND_SYMBOL", - "OR_SYMBOL", "AT_SYMBOL", "LC_BRACKET_SYMBOL", "RC_BRACKET_SYMBOL", + "OR_SYMBOL", "IN_SYMBOL", "BETWEEN_SYMBOL", "TOP_SYMBOL", "VALUE_SYMBOL", + "ORDER_SYMBOL", "BY_SYMBOL", "GROUP_SYMBOL", "OFFSET_SYMBOL", "LIMIT_SYMBOL", + "ASC_SYMBOL", "DESC_SYMBOL", "EXISTS_SYMBOL", "LIKE_SYMBOL", "HAVING_SYMBOL", + "JOIN_SYMBOL", "AT_SYMBOL", "LC_BRACKET_SYMBOL", "RC_BRACKET_SYMBOL", "LS_BRACKET_SYMBOL", "RS_BRACKET_SYMBOL", "LR_BRACKET_SYMBOL", "RR_BRACKET_SYMBOL", "SINGLE_QUOTE_SYMBOL", "DOUBLE_QUOTE_SYMBOL", "COMMA_SYMBOL", "DOT_SYMBOL", "QUESTION_MARK_SYMBOL", "COLON_SYMBOL", "PLUS_SYMBOL", "MINUS_SYMBOL", @@ -51,154 +56,223 @@ func cosmosdbparserParserInit() { "BIT_OR_SYMBOL", "DOUBLE_BAR_SYMBOL", "BIT_XOR_SYMBOL", "EQUAL_SYMBOL", "LESS_THAN_OPERATOR", "LESS_THAN_EQUAL_OPERATOR", "GREATER_THAN_OPERATOR", "GREATER_THAN_EQUAL_OPERATOR", "LEFT_SHIFT_OPERATOR", "RIGHT_SHIFT_OPERATOR", - "ZERO_FILL_RIGHT_SHIFT_OPERATOR", "IDENTIFIER", "WHITESPACE", "DECIMAL", - "REAL", "FLOAT", "HEXADECIMAL", "SINGLE_QUOTE_STRING_LITERAL", "DOUBLE_QUOTE_STRING_LITERAL", + "ZERO_FILL_RIGHT_SHIFT_OPERATOR", "NOT_EQUAL_OPERATOR", "IDENTIFIER", + "WHITESPACE", "DECIMAL", "REAL", "FLOAT", "HEXADECIMAL", "SINGLE_QUOTE_STRING_LITERAL", + "DOUBLE_QUOTE_STRING_LITERAL", } staticData.RuleNames = []string{ - "root", "select", "select_clause", "select_specification", "from_clause", - "where_clause", "from_specification", "from_source", "container_expression", - "container_name", "object_property_list", "object_property", "property_alias", - "scalar_expression", "scalar_expression_in_where", "create_array_expression", - "create_object_expression", "scalar_function_expression", "udf_scalar_function_expression", - "builtin_function_expression", "binary_operator", "unary_operator", - "parameter_name", "constant", "object_constant", "object_constant_field_pair", - "array_constant", "string_constant", "undefined_constant", "null_constant", - "boolean_constant", "number_constant", "string_literal", "decimal_literal", - "hexadecimal_literal", "property_name", "array_index", "input_alias", + "root", "select", "select_clause", "top_clause", "select_specification", + "from_clause", "where_clause", "group_by_clause", "having_clause", "order_by_clause", + "sort_expression", "offset_limit_clause", "from_specification", "from_source", + "container_expression", "join_clause", "container_name", "object_property_list", + "object_property", "property_alias", "scalar_expression", "create_array_expression", + "create_object_expression", "object_field_pair", "scalar_function_expression", + "udf_scalar_function_expression", "builtin_function_expression", "multiplicative_operator", + "additive_operator", "shift_operator", "comparison_operator", "unary_operator", + "parameter_name", "constant", "undefined_constant", "null_constant", + "boolean_constant", "number_constant", "string_constant", "string_literal", + "decimal_literal", "hexadecimal_literal", "identifier", "property_name", + "array_index", "input_alias", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 52, 308, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 68, 443, 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, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 3, 1, 83, 8, 1, 1, 2, - 1, 2, 1, 2, 1, 3, 1, 3, 3, 3, 90, 8, 3, 1, 3, 3, 3, 93, 8, 3, 1, 4, 1, - 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 3, 8, 107, - 8, 8, 1, 8, 3, 8, 110, 8, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 117, - 8, 10, 10, 10, 12, 10, 120, 9, 10, 1, 11, 1, 11, 3, 11, 124, 8, 11, 1, - 11, 3, 11, 127, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, - 3, 13, 136, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, - 13, 145, 8, 13, 1, 13, 5, 13, 148, 8, 13, 10, 13, 12, 13, 151, 9, 13, 1, - 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, - 1, 14, 1, 14, 1, 14, 3, 14, 167, 8, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, - 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, - 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 192, 8, - 14, 1, 14, 5, 14, 195, 8, 14, 10, 14, 12, 14, 198, 9, 14, 1, 15, 1, 15, - 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 206, 8, 17, 1, 18, 1, 18, 1, 18, 1, - 18, 1, 18, 1, 18, 1, 18, 5, 18, 215, 8, 18, 10, 18, 12, 18, 218, 9, 18, - 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 5, 19, 227, 8, 19, 10, - 19, 12, 19, 230, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, - 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 248, - 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 254, 8, 24, 10, 24, 12, 24, 257, - 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 266, 8, - 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 5, 26, 275, 8, 26, - 10, 26, 12, 26, 278, 9, 26, 3, 26, 280, 8, 26, 1, 26, 1, 26, 1, 27, 1, - 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 294, - 8, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, - 36, 1, 37, 1, 37, 1, 37, 0, 2, 26, 28, 38, 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, 0, 5, 3, 0, 1, 1, 28, 29, 31, - 44, 1, 0, 28, 30, 1, 0, 8, 9, 1, 0, 51, 52, 1, 0, 47, 49, 309, 0, 76, 1, - 0, 0, 0, 2, 79, 1, 0, 0, 0, 4, 84, 1, 0, 0, 0, 6, 92, 1, 0, 0, 0, 8, 94, - 1, 0, 0, 0, 10, 97, 1, 0, 0, 0, 12, 100, 1, 0, 0, 0, 14, 102, 1, 0, 0, - 0, 16, 104, 1, 0, 0, 0, 18, 111, 1, 0, 0, 0, 20, 113, 1, 0, 0, 0, 22, 121, - 1, 0, 0, 0, 24, 128, 1, 0, 0, 0, 26, 135, 1, 0, 0, 0, 28, 166, 1, 0, 0, - 0, 30, 199, 1, 0, 0, 0, 32, 201, 1, 0, 0, 0, 34, 205, 1, 0, 0, 0, 36, 207, - 1, 0, 0, 0, 38, 221, 1, 0, 0, 0, 40, 233, 1, 0, 0, 0, 42, 235, 1, 0, 0, - 0, 44, 237, 1, 0, 0, 0, 46, 247, 1, 0, 0, 0, 48, 249, 1, 0, 0, 0, 50, 265, - 1, 0, 0, 0, 52, 270, 1, 0, 0, 0, 54, 283, 1, 0, 0, 0, 56, 285, 1, 0, 0, - 0, 58, 287, 1, 0, 0, 0, 60, 289, 1, 0, 0, 0, 62, 293, 1, 0, 0, 0, 64, 295, - 1, 0, 0, 0, 66, 297, 1, 0, 0, 0, 68, 299, 1, 0, 0, 0, 70, 301, 1, 0, 0, - 0, 72, 303, 1, 0, 0, 0, 74, 305, 1, 0, 0, 0, 76, 77, 3, 2, 1, 0, 77, 78, - 5, 0, 0, 1, 78, 1, 1, 0, 0, 0, 79, 80, 3, 4, 2, 0, 80, 82, 3, 8, 4, 0, - 81, 83, 3, 10, 5, 0, 82, 81, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 3, 1, - 0, 0, 0, 84, 85, 5, 3, 0, 0, 85, 86, 3, 6, 3, 0, 86, 5, 1, 0, 0, 0, 87, - 93, 5, 1, 0, 0, 88, 90, 5, 5, 0, 0, 89, 88, 1, 0, 0, 0, 89, 90, 1, 0, 0, - 0, 90, 91, 1, 0, 0, 0, 91, 93, 3, 20, 10, 0, 92, 87, 1, 0, 0, 0, 92, 89, - 1, 0, 0, 0, 93, 7, 1, 0, 0, 0, 94, 95, 5, 4, 0, 0, 95, 96, 3, 12, 6, 0, - 96, 9, 1, 0, 0, 0, 97, 98, 5, 12, 0, 0, 98, 99, 3, 28, 14, 0, 99, 11, 1, - 0, 0, 0, 100, 101, 3, 14, 7, 0, 101, 13, 1, 0, 0, 0, 102, 103, 3, 16, 8, - 0, 103, 15, 1, 0, 0, 0, 104, 109, 3, 18, 9, 0, 105, 107, 5, 2, 0, 0, 106, - 105, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 110, - 5, 45, 0, 0, 109, 106, 1, 0, 0, 0, 109, 110, 1, 0, 0, 0, 110, 17, 1, 0, - 0, 0, 111, 112, 5, 45, 0, 0, 112, 19, 1, 0, 0, 0, 113, 118, 3, 22, 11, - 0, 114, 115, 5, 24, 0, 0, 115, 117, 3, 22, 11, 0, 116, 114, 1, 0, 0, 0, - 117, 120, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, - 21, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 121, 126, 3, 26, 13, 0, 122, 124, - 5, 2, 0, 0, 123, 122, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 1, 0, - 0, 0, 125, 127, 3, 24, 12, 0, 126, 123, 1, 0, 0, 0, 126, 127, 1, 0, 0, - 0, 127, 23, 1, 0, 0, 0, 128, 129, 5, 45, 0, 0, 129, 25, 1, 0, 0, 0, 130, - 131, 6, 13, -1, 0, 131, 136, 3, 74, 37, 0, 132, 133, 3, 42, 21, 0, 133, - 134, 3, 26, 13, 1, 134, 136, 1, 0, 0, 0, 135, 130, 1, 0, 0, 0, 135, 132, - 1, 0, 0, 0, 136, 149, 1, 0, 0, 0, 137, 138, 10, 3, 0, 0, 138, 139, 5, 25, - 0, 0, 139, 148, 3, 70, 35, 0, 140, 141, 10, 2, 0, 0, 141, 144, 5, 18, 0, - 0, 142, 145, 5, 52, 0, 0, 143, 145, 3, 72, 36, 0, 144, 142, 1, 0, 0, 0, - 144, 143, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 148, 5, 19, 0, 0, 147, - 137, 1, 0, 0, 0, 147, 140, 1, 0, 0, 0, 148, 151, 1, 0, 0, 0, 149, 147, - 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 27, 1, 0, 0, 0, 151, 149, 1, 0, - 0, 0, 152, 153, 6, 14, -1, 0, 153, 167, 3, 46, 23, 0, 154, 167, 3, 74, - 37, 0, 155, 167, 3, 44, 22, 0, 156, 157, 3, 42, 21, 0, 157, 158, 3, 28, - 14, 7, 158, 167, 1, 0, 0, 0, 159, 167, 3, 34, 17, 0, 160, 167, 3, 32, 16, - 0, 161, 167, 3, 30, 15, 0, 162, 163, 5, 20, 0, 0, 163, 164, 3, 28, 14, - 0, 164, 165, 5, 21, 0, 0, 165, 167, 1, 0, 0, 0, 166, 152, 1, 0, 0, 0, 166, - 154, 1, 0, 0, 0, 166, 155, 1, 0, 0, 0, 166, 156, 1, 0, 0, 0, 166, 159, - 1, 0, 0, 0, 166, 160, 1, 0, 0, 0, 166, 161, 1, 0, 0, 0, 166, 162, 1, 0, - 0, 0, 167, 196, 1, 0, 0, 0, 168, 169, 10, 11, 0, 0, 169, 170, 5, 13, 0, - 0, 170, 195, 3, 28, 14, 12, 171, 172, 10, 10, 0, 0, 172, 173, 5, 14, 0, - 0, 173, 195, 3, 28, 14, 11, 174, 175, 10, 6, 0, 0, 175, 176, 3, 40, 20, - 0, 176, 177, 3, 28, 14, 7, 177, 195, 1, 0, 0, 0, 178, 179, 10, 5, 0, 0, - 179, 180, 5, 26, 0, 0, 180, 181, 3, 28, 14, 0, 181, 182, 5, 27, 0, 0, 182, - 183, 3, 28, 14, 6, 183, 195, 1, 0, 0, 0, 184, 185, 10, 9, 0, 0, 185, 186, - 5, 25, 0, 0, 186, 195, 3, 70, 35, 0, 187, 188, 10, 8, 0, 0, 188, 191, 5, - 18, 0, 0, 189, 192, 5, 52, 0, 0, 190, 192, 3, 72, 36, 0, 191, 189, 1, 0, - 0, 0, 191, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 195, 5, 19, 0, 0, - 194, 168, 1, 0, 0, 0, 194, 171, 1, 0, 0, 0, 194, 174, 1, 0, 0, 0, 194, - 178, 1, 0, 0, 0, 194, 184, 1, 0, 0, 0, 194, 187, 1, 0, 0, 0, 195, 198, - 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 29, 1, 0, - 0, 0, 198, 196, 1, 0, 0, 0, 199, 200, 3, 52, 26, 0, 200, 31, 1, 0, 0, 0, - 201, 202, 3, 48, 24, 0, 202, 33, 1, 0, 0, 0, 203, 206, 3, 36, 18, 0, 204, - 206, 3, 38, 19, 0, 205, 203, 1, 0, 0, 0, 205, 204, 1, 0, 0, 0, 206, 35, - 1, 0, 0, 0, 207, 208, 5, 11, 0, 0, 208, 209, 5, 25, 0, 0, 209, 210, 5, - 45, 0, 0, 210, 211, 5, 20, 0, 0, 211, 216, 3, 28, 14, 0, 212, 213, 5, 24, - 0, 0, 213, 215, 3, 28, 14, 0, 214, 212, 1, 0, 0, 0, 215, 218, 1, 0, 0, - 0, 216, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 219, 1, 0, 0, 0, 218, - 216, 1, 0, 0, 0, 219, 220, 5, 21, 0, 0, 220, 37, 1, 0, 0, 0, 221, 222, - 5, 45, 0, 0, 222, 223, 5, 20, 0, 0, 223, 228, 3, 28, 14, 0, 224, 225, 5, - 24, 0, 0, 225, 227, 3, 28, 14, 0, 226, 224, 1, 0, 0, 0, 227, 230, 1, 0, - 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 231, 1, 0, 0, 0, - 230, 228, 1, 0, 0, 0, 231, 232, 5, 21, 0, 0, 232, 39, 1, 0, 0, 0, 233, - 234, 7, 0, 0, 0, 234, 41, 1, 0, 0, 0, 235, 236, 7, 1, 0, 0, 236, 43, 1, - 0, 0, 0, 237, 238, 5, 15, 0, 0, 238, 239, 5, 45, 0, 0, 239, 45, 1, 0, 0, - 0, 240, 248, 3, 56, 28, 0, 241, 248, 3, 58, 29, 0, 242, 248, 3, 60, 30, - 0, 243, 248, 3, 62, 31, 0, 244, 248, 3, 54, 27, 0, 245, 248, 3, 52, 26, - 0, 246, 248, 3, 48, 24, 0, 247, 240, 1, 0, 0, 0, 247, 241, 1, 0, 0, 0, - 247, 242, 1, 0, 0, 0, 247, 243, 1, 0, 0, 0, 247, 244, 1, 0, 0, 0, 247, - 245, 1, 0, 0, 0, 247, 246, 1, 0, 0, 0, 248, 47, 1, 0, 0, 0, 249, 250, 5, - 16, 0, 0, 250, 255, 3, 50, 25, 0, 251, 252, 5, 24, 0, 0, 252, 254, 3, 50, - 25, 0, 253, 251, 1, 0, 0, 0, 254, 257, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, - 255, 256, 1, 0, 0, 0, 256, 258, 1, 0, 0, 0, 257, 255, 1, 0, 0, 0, 258, - 259, 5, 17, 0, 0, 259, 49, 1, 0, 0, 0, 260, 266, 3, 70, 35, 0, 261, 262, - 5, 23, 0, 0, 262, 263, 3, 70, 35, 0, 263, 264, 5, 23, 0, 0, 264, 266, 1, - 0, 0, 0, 265, 260, 1, 0, 0, 0, 265, 261, 1, 0, 0, 0, 266, 267, 1, 0, 0, - 0, 267, 268, 5, 24, 0, 0, 268, 269, 3, 46, 23, 0, 269, 51, 1, 0, 0, 0, - 270, 279, 5, 18, 0, 0, 271, 276, 3, 46, 23, 0, 272, 273, 5, 24, 0, 0, 273, - 275, 3, 46, 23, 0, 274, 272, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, - 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 280, 1, 0, 0, 0, 278, 276, 1, 0, - 0, 0, 279, 271, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, - 281, 282, 5, 19, 0, 0, 282, 53, 1, 0, 0, 0, 283, 284, 3, 64, 32, 0, 284, - 55, 1, 0, 0, 0, 285, 286, 5, 6, 0, 0, 286, 57, 1, 0, 0, 0, 287, 288, 5, - 7, 0, 0, 288, 59, 1, 0, 0, 0, 289, 290, 7, 2, 0, 0, 290, 61, 1, 0, 0, 0, - 291, 294, 3, 66, 33, 0, 292, 294, 3, 68, 34, 0, 293, 291, 1, 0, 0, 0, 293, - 292, 1, 0, 0, 0, 294, 63, 1, 0, 0, 0, 295, 296, 7, 3, 0, 0, 296, 65, 1, - 0, 0, 0, 297, 298, 7, 4, 0, 0, 298, 67, 1, 0, 0, 0, 299, 300, 5, 50, 0, - 0, 300, 69, 1, 0, 0, 0, 301, 302, 5, 45, 0, 0, 302, 71, 1, 0, 0, 0, 303, - 304, 5, 47, 0, 0, 304, 73, 1, 0, 0, 0, 305, 306, 5, 45, 0, 0, 306, 75, - 1, 0, 0, 0, 25, 82, 89, 92, 106, 109, 118, 123, 126, 135, 144, 147, 149, - 166, 191, 194, 196, 205, 216, 228, 247, 255, 265, 276, 279, 293, + 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, 1, 0, 1, 0, 1, 0, + 1, 1, 1, 1, 3, 1, 98, 8, 1, 1, 1, 3, 1, 101, 8, 1, 1, 1, 3, 1, 104, 8, + 1, 1, 1, 3, 1, 107, 8, 1, 1, 1, 3, 1, 110, 8, 1, 1, 1, 3, 1, 113, 8, 1, + 1, 2, 1, 2, 3, 2, 117, 8, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, + 3, 4, 126, 8, 4, 1, 4, 3, 4, 129, 8, 4, 1, 4, 3, 4, 132, 8, 4, 1, 5, 1, + 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 145, 8, + 7, 10, 7, 12, 7, 148, 9, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, + 9, 5, 9, 158, 8, 9, 10, 9, 12, 9, 161, 9, 9, 1, 10, 1, 10, 3, 10, 165, + 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 5, + 13, 176, 8, 13, 10, 13, 12, 13, 179, 9, 13, 1, 14, 1, 14, 3, 14, 183, 8, + 14, 1, 14, 3, 14, 186, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, + 1, 16, 1, 17, 1, 17, 1, 17, 5, 17, 198, 8, 17, 10, 17, 12, 17, 201, 9, + 17, 1, 18, 1, 18, 3, 18, 205, 8, 18, 1, 18, 3, 18, 208, 8, 18, 1, 19, 1, + 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 237, 8, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 269, 8, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 278, 8, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, + 302, 8, 20, 1, 20, 1, 20, 1, 20, 3, 20, 307, 8, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 5, 20, 314, 8, 20, 10, 20, 12, 20, 317, 9, 20, 3, 20, 319, + 8, 20, 1, 20, 5, 20, 322, 8, 20, 10, 20, 12, 20, 325, 9, 20, 1, 21, 1, + 21, 1, 21, 1, 21, 5, 21, 331, 8, 21, 10, 21, 12, 21, 334, 9, 21, 3, 21, + 336, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 5, 22, 344, 8, 22, + 10, 22, 12, 22, 347, 9, 22, 3, 22, 349, 8, 22, 1, 22, 1, 22, 1, 23, 1, + 23, 3, 23, 355, 8, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 3, 24, 362, 8, + 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 5, 25, 371, 8, 25, + 10, 25, 12, 25, 374, 9, 25, 3, 25, 376, 8, 25, 1, 25, 1, 25, 1, 26, 1, + 26, 1, 26, 1, 26, 3, 26, 384, 8, 26, 1, 26, 1, 26, 5, 26, 388, 8, 26, 10, + 26, 12, 26, 391, 9, 26, 3, 26, 393, 8, 26, 1, 26, 1, 26, 1, 27, 1, 27, + 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, + 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 3, 33, 415, 8, 33, 1, 34, 1, 34, + 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 3, 37, 425, 8, 37, 1, 38, 1, + 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, + 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 0, 1, 40, 46, 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, 0, 10, 1, 0, 24, 25, 2, 0, 1, 1, 46, 47, 1, 0, 43, 44, 1, 0, + 57, 59, 2, 0, 52, 56, 60, 60, 1, 0, 43, 45, 1, 0, 8, 9, 1, 0, 67, 68, 1, + 0, 63, 65, 2, 0, 15, 29, 61, 61, 464, 0, 92, 1, 0, 0, 0, 2, 95, 1, 0, 0, + 0, 4, 114, 1, 0, 0, 0, 6, 120, 1, 0, 0, 0, 8, 131, 1, 0, 0, 0, 10, 133, + 1, 0, 0, 0, 12, 136, 1, 0, 0, 0, 14, 139, 1, 0, 0, 0, 16, 149, 1, 0, 0, + 0, 18, 152, 1, 0, 0, 0, 20, 162, 1, 0, 0, 0, 22, 166, 1, 0, 0, 0, 24, 171, + 1, 0, 0, 0, 26, 173, 1, 0, 0, 0, 28, 180, 1, 0, 0, 0, 30, 187, 1, 0, 0, + 0, 32, 192, 1, 0, 0, 0, 34, 194, 1, 0, 0, 0, 36, 202, 1, 0, 0, 0, 38, 209, + 1, 0, 0, 0, 40, 236, 1, 0, 0, 0, 42, 326, 1, 0, 0, 0, 44, 339, 1, 0, 0, + 0, 46, 354, 1, 0, 0, 0, 48, 361, 1, 0, 0, 0, 50, 363, 1, 0, 0, 0, 52, 379, + 1, 0, 0, 0, 54, 396, 1, 0, 0, 0, 56, 398, 1, 0, 0, 0, 58, 400, 1, 0, 0, + 0, 60, 402, 1, 0, 0, 0, 62, 404, 1, 0, 0, 0, 64, 406, 1, 0, 0, 0, 66, 414, + 1, 0, 0, 0, 68, 416, 1, 0, 0, 0, 70, 418, 1, 0, 0, 0, 72, 420, 1, 0, 0, + 0, 74, 424, 1, 0, 0, 0, 76, 426, 1, 0, 0, 0, 78, 428, 1, 0, 0, 0, 80, 430, + 1, 0, 0, 0, 82, 432, 1, 0, 0, 0, 84, 434, 1, 0, 0, 0, 86, 436, 1, 0, 0, + 0, 88, 438, 1, 0, 0, 0, 90, 440, 1, 0, 0, 0, 92, 93, 3, 2, 1, 0, 93, 94, + 5, 0, 0, 1, 94, 1, 1, 0, 0, 0, 95, 97, 3, 4, 2, 0, 96, 98, 3, 10, 5, 0, + 97, 96, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 100, 1, 0, 0, 0, 99, 101, 3, + 12, 6, 0, 100, 99, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 101, 103, 1, 0, 0, + 0, 102, 104, 3, 14, 7, 0, 103, 102, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, + 106, 1, 0, 0, 0, 105, 107, 3, 16, 8, 0, 106, 105, 1, 0, 0, 0, 106, 107, + 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 110, 3, 18, 9, 0, 109, 108, 1, 0, + 0, 0, 109, 110, 1, 0, 0, 0, 110, 112, 1, 0, 0, 0, 111, 113, 3, 22, 11, + 0, 112, 111, 1, 0, 0, 0, 112, 113, 1, 0, 0, 0, 113, 3, 1, 0, 0, 0, 114, + 116, 5, 3, 0, 0, 115, 117, 3, 6, 3, 0, 116, 115, 1, 0, 0, 0, 116, 117, + 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 119, 3, 8, 4, 0, 119, 5, 1, 0, 0, + 0, 120, 121, 5, 17, 0, 0, 121, 122, 5, 63, 0, 0, 122, 7, 1, 0, 0, 0, 123, + 132, 5, 1, 0, 0, 124, 126, 5, 5, 0, 0, 125, 124, 1, 0, 0, 0, 125, 126, + 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 129, 5, 18, 0, 0, 128, 127, 1, 0, + 0, 0, 128, 129, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 132, 3, 34, 17, + 0, 131, 123, 1, 0, 0, 0, 131, 125, 1, 0, 0, 0, 132, 9, 1, 0, 0, 0, 133, + 134, 5, 4, 0, 0, 134, 135, 3, 24, 12, 0, 135, 11, 1, 0, 0, 0, 136, 137, + 5, 12, 0, 0, 137, 138, 3, 40, 20, 0, 138, 13, 1, 0, 0, 0, 139, 140, 5, + 21, 0, 0, 140, 141, 5, 20, 0, 0, 141, 146, 3, 40, 20, 0, 142, 143, 5, 39, + 0, 0, 143, 145, 3, 40, 20, 0, 144, 142, 1, 0, 0, 0, 145, 148, 1, 0, 0, + 0, 146, 144, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 15, 1, 0, 0, 0, 148, + 146, 1, 0, 0, 0, 149, 150, 5, 28, 0, 0, 150, 151, 3, 40, 20, 0, 151, 17, + 1, 0, 0, 0, 152, 153, 5, 19, 0, 0, 153, 154, 5, 20, 0, 0, 154, 159, 3, + 20, 10, 0, 155, 156, 5, 39, 0, 0, 156, 158, 3, 20, 10, 0, 157, 155, 1, + 0, 0, 0, 158, 161, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 159, 160, 1, 0, 0, + 0, 160, 19, 1, 0, 0, 0, 161, 159, 1, 0, 0, 0, 162, 164, 3, 40, 20, 0, 163, + 165, 7, 0, 0, 0, 164, 163, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 21, 1, + 0, 0, 0, 166, 167, 5, 22, 0, 0, 167, 168, 5, 63, 0, 0, 168, 169, 5, 23, + 0, 0, 169, 170, 5, 63, 0, 0, 170, 23, 1, 0, 0, 0, 171, 172, 3, 26, 13, + 0, 172, 25, 1, 0, 0, 0, 173, 177, 3, 28, 14, 0, 174, 176, 3, 30, 15, 0, + 175, 174, 1, 0, 0, 0, 176, 179, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 177, + 178, 1, 0, 0, 0, 178, 27, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 180, 185, 3, + 32, 16, 0, 181, 183, 5, 2, 0, 0, 182, 181, 1, 0, 0, 0, 182, 183, 1, 0, + 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 3, 84, 42, 0, 185, 182, 1, 0, 0, + 0, 185, 186, 1, 0, 0, 0, 186, 29, 1, 0, 0, 0, 187, 188, 5, 29, 0, 0, 188, + 189, 3, 84, 42, 0, 189, 190, 5, 15, 0, 0, 190, 191, 3, 40, 20, 0, 191, + 31, 1, 0, 0, 0, 192, 193, 3, 84, 42, 0, 193, 33, 1, 0, 0, 0, 194, 199, + 3, 36, 18, 0, 195, 196, 5, 39, 0, 0, 196, 198, 3, 36, 18, 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, 35, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 207, 3, 40, 20, 0, + 203, 205, 5, 2, 0, 0, 204, 203, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, + 206, 1, 0, 0, 0, 206, 208, 3, 38, 19, 0, 207, 204, 1, 0, 0, 0, 207, 208, + 1, 0, 0, 0, 208, 37, 1, 0, 0, 0, 209, 210, 3, 84, 42, 0, 210, 39, 1, 0, + 0, 0, 211, 212, 6, 20, -1, 0, 212, 237, 3, 66, 33, 0, 213, 237, 3, 90, + 45, 0, 214, 237, 3, 64, 32, 0, 215, 237, 3, 48, 24, 0, 216, 237, 3, 44, + 22, 0, 217, 237, 3, 42, 21, 0, 218, 219, 5, 35, 0, 0, 219, 220, 3, 40, + 20, 0, 220, 221, 5, 36, 0, 0, 221, 237, 1, 0, 0, 0, 222, 223, 5, 35, 0, + 0, 223, 224, 3, 2, 1, 0, 224, 225, 5, 36, 0, 0, 225, 237, 1, 0, 0, 0, 226, + 227, 5, 26, 0, 0, 227, 228, 5, 35, 0, 0, 228, 229, 3, 2, 1, 0, 229, 230, + 5, 36, 0, 0, 230, 237, 1, 0, 0, 0, 231, 232, 3, 62, 31, 0, 232, 233, 3, + 40, 20, 16, 233, 237, 1, 0, 0, 0, 234, 235, 5, 10, 0, 0, 235, 237, 3, 40, + 20, 15, 236, 211, 1, 0, 0, 0, 236, 213, 1, 0, 0, 0, 236, 214, 1, 0, 0, + 0, 236, 215, 1, 0, 0, 0, 236, 216, 1, 0, 0, 0, 236, 217, 1, 0, 0, 0, 236, + 218, 1, 0, 0, 0, 236, 222, 1, 0, 0, 0, 236, 226, 1, 0, 0, 0, 236, 231, + 1, 0, 0, 0, 236, 234, 1, 0, 0, 0, 237, 323, 1, 0, 0, 0, 238, 239, 10, 14, + 0, 0, 239, 240, 3, 54, 27, 0, 240, 241, 3, 40, 20, 15, 241, 322, 1, 0, + 0, 0, 242, 243, 10, 13, 0, 0, 243, 244, 3, 56, 28, 0, 244, 245, 3, 40, + 20, 14, 245, 322, 1, 0, 0, 0, 246, 247, 10, 12, 0, 0, 247, 248, 3, 58, + 29, 0, 248, 249, 3, 40, 20, 13, 249, 322, 1, 0, 0, 0, 250, 251, 10, 11, + 0, 0, 251, 252, 5, 48, 0, 0, 252, 322, 3, 40, 20, 12, 253, 254, 10, 10, + 0, 0, 254, 255, 5, 51, 0, 0, 255, 322, 3, 40, 20, 11, 256, 257, 10, 9, + 0, 0, 257, 258, 5, 49, 0, 0, 258, 322, 3, 40, 20, 10, 259, 260, 10, 8, + 0, 0, 260, 261, 5, 50, 0, 0, 261, 322, 3, 40, 20, 9, 262, 263, 10, 7, 0, + 0, 263, 264, 3, 60, 30, 0, 264, 265, 3, 40, 20, 8, 265, 322, 1, 0, 0, 0, + 266, 268, 10, 5, 0, 0, 267, 269, 5, 10, 0, 0, 268, 267, 1, 0, 0, 0, 268, + 269, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 271, 5, 16, 0, 0, 271, 272, + 3, 40, 20, 0, 272, 273, 5, 13, 0, 0, 273, 274, 3, 40, 20, 6, 274, 322, + 1, 0, 0, 0, 275, 277, 10, 4, 0, 0, 276, 278, 5, 10, 0, 0, 277, 276, 1, + 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 280, 5, 27, 0, + 0, 280, 322, 3, 40, 20, 5, 281, 282, 10, 3, 0, 0, 282, 283, 5, 13, 0, 0, + 283, 322, 3, 40, 20, 4, 284, 285, 10, 2, 0, 0, 285, 286, 5, 14, 0, 0, 286, + 322, 3, 40, 20, 3, 287, 288, 10, 1, 0, 0, 288, 289, 5, 41, 0, 0, 289, 290, + 3, 40, 20, 0, 290, 291, 5, 42, 0, 0, 291, 292, 3, 40, 20, 2, 292, 322, + 1, 0, 0, 0, 293, 294, 10, 18, 0, 0, 294, 295, 5, 40, 0, 0, 295, 322, 3, + 86, 43, 0, 296, 297, 10, 17, 0, 0, 297, 301, 5, 33, 0, 0, 298, 302, 5, + 68, 0, 0, 299, 302, 5, 67, 0, 0, 300, 302, 3, 88, 44, 0, 301, 298, 1, 0, + 0, 0, 301, 299, 1, 0, 0, 0, 301, 300, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, + 303, 322, 5, 34, 0, 0, 304, 306, 10, 6, 0, 0, 305, 307, 5, 10, 0, 0, 306, + 305, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 309, + 5, 15, 0, 0, 309, 318, 5, 35, 0, 0, 310, 315, 3, 40, 20, 0, 311, 312, 5, + 39, 0, 0, 312, 314, 3, 40, 20, 0, 313, 311, 1, 0, 0, 0, 314, 317, 1, 0, + 0, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, + 317, 315, 1, 0, 0, 0, 318, 310, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, + 320, 1, 0, 0, 0, 320, 322, 5, 36, 0, 0, 321, 238, 1, 0, 0, 0, 321, 242, + 1, 0, 0, 0, 321, 246, 1, 0, 0, 0, 321, 250, 1, 0, 0, 0, 321, 253, 1, 0, + 0, 0, 321, 256, 1, 0, 0, 0, 321, 259, 1, 0, 0, 0, 321, 262, 1, 0, 0, 0, + 321, 266, 1, 0, 0, 0, 321, 275, 1, 0, 0, 0, 321, 281, 1, 0, 0, 0, 321, + 284, 1, 0, 0, 0, 321, 287, 1, 0, 0, 0, 321, 293, 1, 0, 0, 0, 321, 296, + 1, 0, 0, 0, 321, 304, 1, 0, 0, 0, 322, 325, 1, 0, 0, 0, 323, 321, 1, 0, + 0, 0, 323, 324, 1, 0, 0, 0, 324, 41, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, + 326, 335, 5, 33, 0, 0, 327, 332, 3, 40, 20, 0, 328, 329, 5, 39, 0, 0, 329, + 331, 3, 40, 20, 0, 330, 328, 1, 0, 0, 0, 331, 334, 1, 0, 0, 0, 332, 330, + 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 336, 1, 0, 0, 0, 334, 332, 1, 0, + 0, 0, 335, 327, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, + 337, 338, 5, 34, 0, 0, 338, 43, 1, 0, 0, 0, 339, 348, 5, 31, 0, 0, 340, + 345, 3, 46, 23, 0, 341, 342, 5, 39, 0, 0, 342, 344, 3, 46, 23, 0, 343, + 341, 1, 0, 0, 0, 344, 347, 1, 0, 0, 0, 345, 343, 1, 0, 0, 0, 345, 346, + 1, 0, 0, 0, 346, 349, 1, 0, 0, 0, 347, 345, 1, 0, 0, 0, 348, 340, 1, 0, + 0, 0, 348, 349, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 5, 32, 0, 0, + 351, 45, 1, 0, 0, 0, 352, 355, 3, 78, 39, 0, 353, 355, 3, 86, 43, 0, 354, + 352, 1, 0, 0, 0, 354, 353, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 357, + 5, 42, 0, 0, 357, 358, 3, 40, 20, 0, 358, 47, 1, 0, 0, 0, 359, 362, 3, + 50, 25, 0, 360, 362, 3, 52, 26, 0, 361, 359, 1, 0, 0, 0, 361, 360, 1, 0, + 0, 0, 362, 49, 1, 0, 0, 0, 363, 364, 5, 11, 0, 0, 364, 365, 5, 40, 0, 0, + 365, 366, 3, 84, 42, 0, 366, 375, 5, 35, 0, 0, 367, 372, 3, 40, 20, 0, + 368, 369, 5, 39, 0, 0, 369, 371, 3, 40, 20, 0, 370, 368, 1, 0, 0, 0, 371, + 374, 1, 0, 0, 0, 372, 370, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 376, + 1, 0, 0, 0, 374, 372, 1, 0, 0, 0, 375, 367, 1, 0, 0, 0, 375, 376, 1, 0, + 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 36, 0, 0, 378, 51, 1, 0, 0, 0, + 379, 380, 3, 84, 42, 0, 380, 392, 5, 35, 0, 0, 381, 384, 5, 1, 0, 0, 382, + 384, 3, 40, 20, 0, 383, 381, 1, 0, 0, 0, 383, 382, 1, 0, 0, 0, 384, 389, + 1, 0, 0, 0, 385, 386, 5, 39, 0, 0, 386, 388, 3, 40, 20, 0, 387, 385, 1, + 0, 0, 0, 388, 391, 1, 0, 0, 0, 389, 387, 1, 0, 0, 0, 389, 390, 1, 0, 0, + 0, 390, 393, 1, 0, 0, 0, 391, 389, 1, 0, 0, 0, 392, 383, 1, 0, 0, 0, 392, + 393, 1, 0, 0, 0, 393, 394, 1, 0, 0, 0, 394, 395, 5, 36, 0, 0, 395, 53, + 1, 0, 0, 0, 396, 397, 7, 1, 0, 0, 397, 55, 1, 0, 0, 0, 398, 399, 7, 2, + 0, 0, 399, 57, 1, 0, 0, 0, 400, 401, 7, 3, 0, 0, 401, 59, 1, 0, 0, 0, 402, + 403, 7, 4, 0, 0, 403, 61, 1, 0, 0, 0, 404, 405, 7, 5, 0, 0, 405, 63, 1, + 0, 0, 0, 406, 407, 5, 30, 0, 0, 407, 408, 3, 84, 42, 0, 408, 65, 1, 0, + 0, 0, 409, 415, 3, 68, 34, 0, 410, 415, 3, 70, 35, 0, 411, 415, 3, 72, + 36, 0, 412, 415, 3, 74, 37, 0, 413, 415, 3, 76, 38, 0, 414, 409, 1, 0, + 0, 0, 414, 410, 1, 0, 0, 0, 414, 411, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, + 414, 413, 1, 0, 0, 0, 415, 67, 1, 0, 0, 0, 416, 417, 5, 6, 0, 0, 417, 69, + 1, 0, 0, 0, 418, 419, 5, 7, 0, 0, 419, 71, 1, 0, 0, 0, 420, 421, 7, 6, + 0, 0, 421, 73, 1, 0, 0, 0, 422, 425, 3, 80, 40, 0, 423, 425, 3, 82, 41, + 0, 424, 422, 1, 0, 0, 0, 424, 423, 1, 0, 0, 0, 425, 75, 1, 0, 0, 0, 426, + 427, 3, 78, 39, 0, 427, 77, 1, 0, 0, 0, 428, 429, 7, 7, 0, 0, 429, 79, + 1, 0, 0, 0, 430, 431, 7, 8, 0, 0, 431, 81, 1, 0, 0, 0, 432, 433, 5, 66, + 0, 0, 433, 83, 1, 0, 0, 0, 434, 435, 7, 9, 0, 0, 435, 85, 1, 0, 0, 0, 436, + 437, 3, 84, 42, 0, 437, 87, 1, 0, 0, 0, 438, 439, 5, 63, 0, 0, 439, 89, + 1, 0, 0, 0, 440, 441, 3, 84, 42, 0, 441, 91, 1, 0, 0, 0, 41, 97, 100, 103, + 106, 109, 112, 116, 125, 128, 131, 146, 159, 164, 177, 182, 185, 199, 204, + 207, 236, 268, 277, 301, 306, 315, 318, 321, 323, 332, 335, 345, 348, 354, + 361, 372, 375, 383, 389, 392, 414, 424, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -251,44 +325,60 @@ const ( CosmosDBParserWHERE_SYMBOL = 12 CosmosDBParserAND_SYMBOL = 13 CosmosDBParserOR_SYMBOL = 14 - CosmosDBParserAT_SYMBOL = 15 - CosmosDBParserLC_BRACKET_SYMBOL = 16 - CosmosDBParserRC_BRACKET_SYMBOL = 17 - CosmosDBParserLS_BRACKET_SYMBOL = 18 - CosmosDBParserRS_BRACKET_SYMBOL = 19 - CosmosDBParserLR_BRACKET_SYMBOL = 20 - CosmosDBParserRR_BRACKET_SYMBOL = 21 - CosmosDBParserSINGLE_QUOTE_SYMBOL = 22 - CosmosDBParserDOUBLE_QUOTE_SYMBOL = 23 - CosmosDBParserCOMMA_SYMBOL = 24 - CosmosDBParserDOT_SYMBOL = 25 - CosmosDBParserQUESTION_MARK_SYMBOL = 26 - CosmosDBParserCOLON_SYMBOL = 27 - CosmosDBParserPLUS_SYMBOL = 28 - CosmosDBParserMINUS_SYMBOL = 29 - CosmosDBParserBIT_NOT_SYMBOL = 30 - CosmosDBParserDIVIDE_SYMBOL = 31 - CosmosDBParserMODULO_SYMBOL = 32 - CosmosDBParserBIT_AND_SYMBOL = 33 - CosmosDBParserBIT_OR_SYMBOL = 34 - CosmosDBParserDOUBLE_BAR_SYMBOL = 35 - CosmosDBParserBIT_XOR_SYMBOL = 36 - CosmosDBParserEQUAL_SYMBOL = 37 - CosmosDBParserLESS_THAN_OPERATOR = 38 - CosmosDBParserLESS_THAN_EQUAL_OPERATOR = 39 - CosmosDBParserGREATER_THAN_OPERATOR = 40 - CosmosDBParserGREATER_THAN_EQUAL_OPERATOR = 41 - CosmosDBParserLEFT_SHIFT_OPERATOR = 42 - CosmosDBParserRIGHT_SHIFT_OPERATOR = 43 - CosmosDBParserZERO_FILL_RIGHT_SHIFT_OPERATOR = 44 - CosmosDBParserIDENTIFIER = 45 - CosmosDBParserWHITESPACE = 46 - CosmosDBParserDECIMAL = 47 - CosmosDBParserREAL = 48 - CosmosDBParserFLOAT = 49 - CosmosDBParserHEXADECIMAL = 50 - CosmosDBParserSINGLE_QUOTE_STRING_LITERAL = 51 - CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL = 52 + CosmosDBParserIN_SYMBOL = 15 + CosmosDBParserBETWEEN_SYMBOL = 16 + CosmosDBParserTOP_SYMBOL = 17 + CosmosDBParserVALUE_SYMBOL = 18 + CosmosDBParserORDER_SYMBOL = 19 + CosmosDBParserBY_SYMBOL = 20 + CosmosDBParserGROUP_SYMBOL = 21 + CosmosDBParserOFFSET_SYMBOL = 22 + CosmosDBParserLIMIT_SYMBOL = 23 + CosmosDBParserASC_SYMBOL = 24 + CosmosDBParserDESC_SYMBOL = 25 + CosmosDBParserEXISTS_SYMBOL = 26 + CosmosDBParserLIKE_SYMBOL = 27 + CosmosDBParserHAVING_SYMBOL = 28 + CosmosDBParserJOIN_SYMBOL = 29 + CosmosDBParserAT_SYMBOL = 30 + CosmosDBParserLC_BRACKET_SYMBOL = 31 + CosmosDBParserRC_BRACKET_SYMBOL = 32 + CosmosDBParserLS_BRACKET_SYMBOL = 33 + CosmosDBParserRS_BRACKET_SYMBOL = 34 + CosmosDBParserLR_BRACKET_SYMBOL = 35 + CosmosDBParserRR_BRACKET_SYMBOL = 36 + CosmosDBParserSINGLE_QUOTE_SYMBOL = 37 + CosmosDBParserDOUBLE_QUOTE_SYMBOL = 38 + CosmosDBParserCOMMA_SYMBOL = 39 + CosmosDBParserDOT_SYMBOL = 40 + CosmosDBParserQUESTION_MARK_SYMBOL = 41 + CosmosDBParserCOLON_SYMBOL = 42 + CosmosDBParserPLUS_SYMBOL = 43 + CosmosDBParserMINUS_SYMBOL = 44 + CosmosDBParserBIT_NOT_SYMBOL = 45 + CosmosDBParserDIVIDE_SYMBOL = 46 + CosmosDBParserMODULO_SYMBOL = 47 + CosmosDBParserBIT_AND_SYMBOL = 48 + CosmosDBParserBIT_OR_SYMBOL = 49 + CosmosDBParserDOUBLE_BAR_SYMBOL = 50 + CosmosDBParserBIT_XOR_SYMBOL = 51 + CosmosDBParserEQUAL_SYMBOL = 52 + CosmosDBParserLESS_THAN_OPERATOR = 53 + CosmosDBParserLESS_THAN_EQUAL_OPERATOR = 54 + CosmosDBParserGREATER_THAN_OPERATOR = 55 + CosmosDBParserGREATER_THAN_EQUAL_OPERATOR = 56 + CosmosDBParserLEFT_SHIFT_OPERATOR = 57 + CosmosDBParserRIGHT_SHIFT_OPERATOR = 58 + CosmosDBParserZERO_FILL_RIGHT_SHIFT_OPERATOR = 59 + CosmosDBParserNOT_EQUAL_OPERATOR = 60 + CosmosDBParserIDENTIFIER = 61 + CosmosDBParserWHITESPACE = 62 + CosmosDBParserDECIMAL = 63 + CosmosDBParserREAL = 64 + CosmosDBParserFLOAT = 65 + CosmosDBParserHEXADECIMAL = 66 + CosmosDBParserSINGLE_QUOTE_STRING_LITERAL = 67 + CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL = 68 ) // CosmosDBParser rules. @@ -296,41 +386,49 @@ const ( CosmosDBParserRULE_root = 0 CosmosDBParserRULE_select = 1 CosmosDBParserRULE_select_clause = 2 - CosmosDBParserRULE_select_specification = 3 - CosmosDBParserRULE_from_clause = 4 - CosmosDBParserRULE_where_clause = 5 - CosmosDBParserRULE_from_specification = 6 - CosmosDBParserRULE_from_source = 7 - CosmosDBParserRULE_container_expression = 8 - CosmosDBParserRULE_container_name = 9 - CosmosDBParserRULE_object_property_list = 10 - CosmosDBParserRULE_object_property = 11 - CosmosDBParserRULE_property_alias = 12 - CosmosDBParserRULE_scalar_expression = 13 - CosmosDBParserRULE_scalar_expression_in_where = 14 - CosmosDBParserRULE_create_array_expression = 15 - CosmosDBParserRULE_create_object_expression = 16 - CosmosDBParserRULE_scalar_function_expression = 17 - CosmosDBParserRULE_udf_scalar_function_expression = 18 - CosmosDBParserRULE_builtin_function_expression = 19 - CosmosDBParserRULE_binary_operator = 20 - CosmosDBParserRULE_unary_operator = 21 - CosmosDBParserRULE_parameter_name = 22 - CosmosDBParserRULE_constant = 23 - CosmosDBParserRULE_object_constant = 24 - CosmosDBParserRULE_object_constant_field_pair = 25 - CosmosDBParserRULE_array_constant = 26 - CosmosDBParserRULE_string_constant = 27 - CosmosDBParserRULE_undefined_constant = 28 - CosmosDBParserRULE_null_constant = 29 - CosmosDBParserRULE_boolean_constant = 30 - CosmosDBParserRULE_number_constant = 31 - CosmosDBParserRULE_string_literal = 32 - CosmosDBParserRULE_decimal_literal = 33 - CosmosDBParserRULE_hexadecimal_literal = 34 - CosmosDBParserRULE_property_name = 35 - CosmosDBParserRULE_array_index = 36 - CosmosDBParserRULE_input_alias = 37 + CosmosDBParserRULE_top_clause = 3 + CosmosDBParserRULE_select_specification = 4 + CosmosDBParserRULE_from_clause = 5 + CosmosDBParserRULE_where_clause = 6 + CosmosDBParserRULE_group_by_clause = 7 + CosmosDBParserRULE_having_clause = 8 + CosmosDBParserRULE_order_by_clause = 9 + CosmosDBParserRULE_sort_expression = 10 + CosmosDBParserRULE_offset_limit_clause = 11 + CosmosDBParserRULE_from_specification = 12 + CosmosDBParserRULE_from_source = 13 + CosmosDBParserRULE_container_expression = 14 + CosmosDBParserRULE_join_clause = 15 + CosmosDBParserRULE_container_name = 16 + CosmosDBParserRULE_object_property_list = 17 + CosmosDBParserRULE_object_property = 18 + CosmosDBParserRULE_property_alias = 19 + CosmosDBParserRULE_scalar_expression = 20 + CosmosDBParserRULE_create_array_expression = 21 + CosmosDBParserRULE_create_object_expression = 22 + CosmosDBParserRULE_object_field_pair = 23 + CosmosDBParserRULE_scalar_function_expression = 24 + CosmosDBParserRULE_udf_scalar_function_expression = 25 + CosmosDBParserRULE_builtin_function_expression = 26 + CosmosDBParserRULE_multiplicative_operator = 27 + CosmosDBParserRULE_additive_operator = 28 + CosmosDBParserRULE_shift_operator = 29 + CosmosDBParserRULE_comparison_operator = 30 + CosmosDBParserRULE_unary_operator = 31 + CosmosDBParserRULE_parameter_name = 32 + CosmosDBParserRULE_constant = 33 + CosmosDBParserRULE_undefined_constant = 34 + CosmosDBParserRULE_null_constant = 35 + CosmosDBParserRULE_boolean_constant = 36 + CosmosDBParserRULE_number_constant = 37 + CosmosDBParserRULE_string_constant = 38 + CosmosDBParserRULE_string_literal = 39 + CosmosDBParserRULE_decimal_literal = 40 + CosmosDBParserRULE_hexadecimal_literal = 41 + CosmosDBParserRULE_identifier = 42 + CosmosDBParserRULE_property_name = 43 + CosmosDBParserRULE_array_index = 44 + CosmosDBParserRULE_input_alias = 45 ) // IRootContext is an interface to support dynamic dispatch. @@ -435,11 +533,11 @@ func (p *CosmosDBParser) Root() (localctx IRootContext) { p.EnterRule(localctx, 0, CosmosDBParserRULE_root) p.EnterOuterAlt(localctx, 1) { - p.SetState(76) + p.SetState(92) p.Select_() } { - p.SetState(77) + p.SetState(93) p.Match(CosmosDBParserEOF) if p.HasError() { // Recognition error - abort rule @@ -471,6 +569,10 @@ type ISelectContext interface { Select_clause() ISelect_clauseContext From_clause() IFrom_clauseContext Where_clause() IWhere_clauseContext + Group_by_clause() IGroup_by_clauseContext + Having_clause() IHaving_clauseContext + Order_by_clause() IOrder_by_clauseContext + Offset_limit_clause() IOffset_limit_clauseContext // IsSelectContext differentiates from other interfaces. IsSelectContext() @@ -556,6 +658,70 @@ func (s *SelectContext) Where_clause() IWhere_clauseContext { return t.(IWhere_clauseContext) } +func (s *SelectContext) Group_by_clause() IGroup_by_clauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGroup_by_clauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IGroup_by_clauseContext) +} + +func (s *SelectContext) Having_clause() IHaving_clauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IHaving_clauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IHaving_clauseContext) +} + +func (s *SelectContext) Order_by_clause() IOrder_by_clauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOrder_by_clauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOrder_by_clauseContext) +} + +func (s *SelectContext) Offset_limit_clause() IOffset_limit_clauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOffset_limit_clauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOffset_limit_clauseContext) +} + func (s *SelectContext) GetRuleContext() antlr.RuleContext { return s } @@ -593,14 +759,24 @@ func (p *CosmosDBParser) Select_() (localctx ISelectContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(79) + p.SetState(95) p.Select_clause() } - { - p.SetState(80) - p.From_clause() + p.SetState(97) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserFROM_SYMBOL { + { + p.SetState(96) + p.From_clause() + } + } - p.SetState(82) + p.SetState(100) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -609,11 +785,67 @@ func (p *CosmosDBParser) Select_() (localctx ISelectContext) { if _la == CosmosDBParserWHERE_SYMBOL { { - p.SetState(81) + p.SetState(99) p.Where_clause() } } + p.SetState(103) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserGROUP_SYMBOL { + { + p.SetState(102) + p.Group_by_clause() + } + + } + p.SetState(106) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserHAVING_SYMBOL { + { + p.SetState(105) + p.Having_clause() + } + + } + p.SetState(109) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserORDER_SYMBOL { + { + p.SetState(108) + p.Order_by_clause() + } + + } + p.SetState(112) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserOFFSET_SYMBOL { + { + p.SetState(111) + p.Offset_limit_clause() + } + + } errorExit: if p.HasError() { @@ -638,6 +870,7 @@ type ISelect_clauseContext interface { // Getter signatures SELECT_SYMBOL() antlr.TerminalNode Select_specification() ISelect_specificationContext + Top_clause() ITop_clauseContext // IsSelect_clauseContext differentiates from other interfaces. IsSelect_clauseContext() @@ -695,6 +928,22 @@ func (s *Select_clauseContext) Select_specification() ISelect_specificationConte return t.(ISelect_specificationContext) } +func (s *Select_clauseContext) Top_clause() ITop_clauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITop_clauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITop_clauseContext) +} + func (s *Select_clauseContext) GetRuleContext() antlr.RuleContext { return s } @@ -730,15 +979,27 @@ func (p *CosmosDBParser) Select_clause() (localctx ISelect_clauseContext) { p.EnterRule(localctx, 4, CosmosDBParserRULE_select_clause) p.EnterOuterAlt(localctx, 1) { - p.SetState(84) + p.SetState(114) p.Match(CosmosDBParserSELECT_SYMBOL) if p.HasError() { // Recognition error - abort rule goto errorExit } } + p.SetState(116) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 6, p.GetParserRuleContext()) == 1 { + { + p.SetState(115) + p.Top_clause() + } + + } else if p.HasError() { // JIM + goto errorExit + } { - p.SetState(85) + p.SetState(118) p.Select_specification() } @@ -755,6 +1016,125 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } +// ITop_clauseContext is an interface to support dynamic dispatch. +type ITop_clauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + TOP_SYMBOL() antlr.TerminalNode + DECIMAL() antlr.TerminalNode + + // IsTop_clauseContext differentiates from other interfaces. + IsTop_clauseContext() +} + +type Top_clauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTop_clauseContext() *Top_clauseContext { + var p = new(Top_clauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_top_clause + return p +} + +func InitEmptyTop_clauseContext(p *Top_clauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_top_clause +} + +func (*Top_clauseContext) IsTop_clauseContext() {} + +func NewTop_clauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Top_clauseContext { + var p = new(Top_clauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_top_clause + + return p +} + +func (s *Top_clauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *Top_clauseContext) TOP_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserTOP_SYMBOL, 0) +} + +func (s *Top_clauseContext) DECIMAL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserDECIMAL, 0) +} + +func (s *Top_clauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *Top_clauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *Top_clauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterTop_clause(s) + } +} + +func (s *Top_clauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitTop_clause(s) + } +} + +func (s *Top_clauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitTop_clause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *CosmosDBParser) Top_clause() (localctx ITop_clauseContext) { + localctx = NewTop_clauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, CosmosDBParserRULE_top_clause) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(120) + p.Match(CosmosDBParserTOP_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(121) + p.Match(CosmosDBParserDECIMAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + // ISelect_specificationContext is an interface to support dynamic dispatch. type ISelect_specificationContext interface { antlr.ParserRuleContext @@ -766,6 +1146,7 @@ type ISelect_specificationContext interface { MULTIPLY_OPERATOR() antlr.TerminalNode Object_property_list() IObject_property_listContext DISTINCT_SYMBOL() antlr.TerminalNode + VALUE_SYMBOL() antlr.TerminalNode // IsSelect_specificationContext differentiates from other interfaces. IsSelect_specificationContext() @@ -827,6 +1208,10 @@ func (s *Select_specificationContext) DISTINCT_SYMBOL() antlr.TerminalNode { return s.GetToken(CosmosDBParserDISTINCT_SYMBOL, 0) } +func (s *Select_specificationContext) VALUE_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserVALUE_SYMBOL, 0) +} + func (s *Select_specificationContext) GetRuleContext() antlr.RuleContext { return s } @@ -859,10 +1244,10 @@ func (s *Select_specificationContext) Accept(visitor antlr.ParseTreeVisitor) int func (p *CosmosDBParser) Select_specification() (localctx ISelect_specificationContext) { localctx = NewSelect_specificationContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 6, CosmosDBParserRULE_select_specification) + p.EnterRule(localctx, 8, CosmosDBParserRULE_select_specification) var _la int - p.SetState(92) + p.SetState(131) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -872,7 +1257,7 @@ func (p *CosmosDBParser) Select_specification() (localctx ISelect_specificationC case CosmosDBParserMULTIPLY_OPERATOR: p.EnterOuterAlt(localctx, 1) { - p.SetState(87) + p.SetState(123) p.Match(CosmosDBParserMULTIPLY_OPERATOR) if p.HasError() { // Recognition error - abort rule @@ -880,9 +1265,9 @@ func (p *CosmosDBParser) Select_specification() (localctx ISelect_specificationC } } - case CosmosDBParserDISTINCT_SYMBOL, CosmosDBParserPLUS_SYMBOL, CosmosDBParserMINUS_SYMBOL, CosmosDBParserBIT_NOT_SYMBOL, CosmosDBParserIDENTIFIER: + case CosmosDBParserDISTINCT_SYMBOL, CosmosDBParserUNDEFINED_SYMBOL, CosmosDBParserNULL_SYMBOL, CosmosDBParserFALSE_SYMBOL, CosmosDBParserTRUE_SYMBOL, CosmosDBParserNOT_SYMBOL, CosmosDBParserUDF_SYMBOL, CosmosDBParserIN_SYMBOL, CosmosDBParserBETWEEN_SYMBOL, CosmosDBParserTOP_SYMBOL, CosmosDBParserVALUE_SYMBOL, CosmosDBParserORDER_SYMBOL, CosmosDBParserBY_SYMBOL, CosmosDBParserGROUP_SYMBOL, CosmosDBParserOFFSET_SYMBOL, CosmosDBParserLIMIT_SYMBOL, CosmosDBParserASC_SYMBOL, CosmosDBParserDESC_SYMBOL, CosmosDBParserEXISTS_SYMBOL, CosmosDBParserLIKE_SYMBOL, CosmosDBParserHAVING_SYMBOL, CosmosDBParserJOIN_SYMBOL, CosmosDBParserAT_SYMBOL, CosmosDBParserLC_BRACKET_SYMBOL, CosmosDBParserLS_BRACKET_SYMBOL, CosmosDBParserLR_BRACKET_SYMBOL, CosmosDBParserPLUS_SYMBOL, CosmosDBParserMINUS_SYMBOL, CosmosDBParserBIT_NOT_SYMBOL, CosmosDBParserIDENTIFIER, CosmosDBParserDECIMAL, CosmosDBParserREAL, CosmosDBParserFLOAT, CosmosDBParserHEXADECIMAL, CosmosDBParserSINGLE_QUOTE_STRING_LITERAL, CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL: p.EnterOuterAlt(localctx, 2) - p.SetState(89) + p.SetState(125) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -891,7 +1276,7 @@ func (p *CosmosDBParser) Select_specification() (localctx ISelect_specificationC if _la == CosmosDBParserDISTINCT_SYMBOL { { - p.SetState(88) + p.SetState(124) p.Match(CosmosDBParserDISTINCT_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -900,8 +1285,24 @@ func (p *CosmosDBParser) Select_specification() (localctx ISelect_specificationC } } + p.SetState(128) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) == 1 { + { + p.SetState(127) + p.Match(CosmosDBParserVALUE_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } { - p.SetState(91) + p.SetState(130) p.Object_property_list() } @@ -1022,10 +1423,10 @@ func (s *From_clauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *CosmosDBParser) From_clause() (localctx IFrom_clauseContext) { localctx = NewFrom_clauseContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 8, CosmosDBParserRULE_from_clause) + p.EnterRule(localctx, 10, CosmosDBParserRULE_from_clause) p.EnterOuterAlt(localctx, 1) { - p.SetState(94) + p.SetState(133) p.Match(CosmosDBParserFROM_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -1033,7 +1434,7 @@ func (p *CosmosDBParser) From_clause() (localctx IFrom_clauseContext) { } } { - p.SetState(95) + p.SetState(134) p.From_specification() } @@ -1059,7 +1460,7 @@ type IWhere_clauseContext interface { // Getter signatures WHERE_SYMBOL() antlr.TerminalNode - Scalar_expression_in_where() IScalar_expression_in_whereContext + Scalar_expression() IScalar_expressionContext // IsWhere_clauseContext differentiates from other interfaces. IsWhere_clauseContext() @@ -1101,10 +1502,10 @@ func (s *Where_clauseContext) WHERE_SYMBOL() antlr.TerminalNode { return s.GetToken(CosmosDBParserWHERE_SYMBOL, 0) } -func (s *Where_clauseContext) Scalar_expression_in_where() IScalar_expression_in_whereContext { +func (s *Where_clauseContext) Scalar_expression() IScalar_expressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IScalar_expression_in_whereContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1114,7 +1515,7 @@ func (s *Where_clauseContext) Scalar_expression_in_where() IScalar_expression_in return nil } - return t.(IScalar_expression_in_whereContext) + return t.(IScalar_expressionContext) } func (s *Where_clauseContext) GetRuleContext() antlr.RuleContext { @@ -1149,10 +1550,10 @@ func (s *Where_clauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *CosmosDBParser) Where_clause() (localctx IWhere_clauseContext) { localctx = NewWhere_clauseContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 10, CosmosDBParserRULE_where_clause) + p.EnterRule(localctx, 12, CosmosDBParserRULE_where_clause) p.EnterOuterAlt(localctx, 1) { - p.SetState(97) + p.SetState(136) p.Match(CosmosDBParserWHERE_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -1160,8 +1561,8 @@ func (p *CosmosDBParser) Where_clause() (localctx IWhere_clauseContext) { } } { - p.SetState(98) - p.scalar_expression_in_where(0) + p.SetState(137) + p.scalar_expression(0) } errorExit: @@ -1177,58 +1578,96 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IFrom_specificationContext is an interface to support dynamic dispatch. -type IFrom_specificationContext interface { +// IGroup_by_clauseContext is an interface to support dynamic dispatch. +type IGroup_by_clauseContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - From_source() IFrom_sourceContext + GROUP_SYMBOL() antlr.TerminalNode + BY_SYMBOL() antlr.TerminalNode + AllScalar_expression() []IScalar_expressionContext + Scalar_expression(i int) IScalar_expressionContext + AllCOMMA_SYMBOL() []antlr.TerminalNode + COMMA_SYMBOL(i int) antlr.TerminalNode - // IsFrom_specificationContext differentiates from other interfaces. - IsFrom_specificationContext() + // IsGroup_by_clauseContext differentiates from other interfaces. + IsGroup_by_clauseContext() } -type From_specificationContext struct { +type Group_by_clauseContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyFrom_specificationContext() *From_specificationContext { - var p = new(From_specificationContext) +func NewEmptyGroup_by_clauseContext() *Group_by_clauseContext { + var p = new(Group_by_clauseContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_from_specification + p.RuleIndex = CosmosDBParserRULE_group_by_clause return p } -func InitEmptyFrom_specificationContext(p *From_specificationContext) { +func InitEmptyGroup_by_clauseContext(p *Group_by_clauseContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_from_specification + p.RuleIndex = CosmosDBParserRULE_group_by_clause } -func (*From_specificationContext) IsFrom_specificationContext() {} +func (*Group_by_clauseContext) IsGroup_by_clauseContext() {} -func NewFrom_specificationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *From_specificationContext { - var p = new(From_specificationContext) +func NewGroup_by_clauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Group_by_clauseContext { + var p = new(Group_by_clauseContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_from_specification + p.RuleIndex = CosmosDBParserRULE_group_by_clause return p } -func (s *From_specificationContext) GetParser() antlr.Parser { return s.parser } +func (s *Group_by_clauseContext) GetParser() antlr.Parser { return s.parser } -func (s *From_specificationContext) From_source() IFrom_sourceContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IFrom_sourceContext); ok { - t = ctx.(antlr.RuleContext) - break +func (s *Group_by_clauseContext) GROUP_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserGROUP_SYMBOL, 0) +} + +func (s *Group_by_clauseContext) BY_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBY_SYMBOL, 0) +} + +func (s *Group_by_clauseContext) AllScalar_expression() []IScalar_expressionContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IScalar_expressionContext); ok { + len++ + } + } + + tst := make([]IScalar_expressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IScalar_expressionContext); ok { + tst[i] = t.(IScalar_expressionContext) + i++ + } + } + + return tst +} + +func (s *Group_by_clauseContext) Scalar_expression(i int) IScalar_expressionContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalar_expressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -1236,46 +1675,100 @@ func (s *From_specificationContext) From_source() IFrom_sourceContext { return nil } - return t.(IFrom_sourceContext) + return t.(IScalar_expressionContext) } -func (s *From_specificationContext) GetRuleContext() antlr.RuleContext { +func (s *Group_by_clauseContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { + return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) +} + +func (s *Group_by_clauseContext) COMMA_SYMBOL(i int) antlr.TerminalNode { + return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) +} + +func (s *Group_by_clauseContext) GetRuleContext() antlr.RuleContext { return s } -func (s *From_specificationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Group_by_clauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *From_specificationContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Group_by_clauseContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterFrom_specification(s) + listenerT.EnterGroup_by_clause(s) } } -func (s *From_specificationContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Group_by_clauseContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitFrom_specification(s) + listenerT.ExitGroup_by_clause(s) } } -func (s *From_specificationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Group_by_clauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitFrom_specification(s) + return t.VisitGroup_by_clause(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) From_specification() (localctx IFrom_specificationContext) { - localctx = NewFrom_specificationContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 12, CosmosDBParserRULE_from_specification) +func (p *CosmosDBParser) Group_by_clause() (localctx IGroup_by_clauseContext) { + localctx = NewGroup_by_clauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, CosmosDBParserRULE_group_by_clause) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(100) - p.From_source() + p.SetState(139) + p.Match(CosmosDBParserGROUP_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(140) + p.Match(CosmosDBParserBY_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(141) + p.scalar_expression(0) + } + p.SetState(146) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == CosmosDBParserCOMMA_SYMBOL { + { + p.SetState(142) + p.Match(CosmosDBParserCOMMA_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(143) + p.scalar_expression(0) + } + + p.SetState(148) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } errorExit: @@ -1291,56 +1784,61 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IFrom_sourceContext is an interface to support dynamic dispatch. -type IFrom_sourceContext interface { +// IHaving_clauseContext is an interface to support dynamic dispatch. +type IHaving_clauseContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Container_expression() IContainer_expressionContext + HAVING_SYMBOL() antlr.TerminalNode + Scalar_expression() IScalar_expressionContext - // IsFrom_sourceContext differentiates from other interfaces. - IsFrom_sourceContext() + // IsHaving_clauseContext differentiates from other interfaces. + IsHaving_clauseContext() } -type From_sourceContext struct { +type Having_clauseContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyFrom_sourceContext() *From_sourceContext { - var p = new(From_sourceContext) +func NewEmptyHaving_clauseContext() *Having_clauseContext { + var p = new(Having_clauseContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_from_source + p.RuleIndex = CosmosDBParserRULE_having_clause return p } -func InitEmptyFrom_sourceContext(p *From_sourceContext) { +func InitEmptyHaving_clauseContext(p *Having_clauseContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_from_source + p.RuleIndex = CosmosDBParserRULE_having_clause } -func (*From_sourceContext) IsFrom_sourceContext() {} +func (*Having_clauseContext) IsHaving_clauseContext() {} -func NewFrom_sourceContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *From_sourceContext { - var p = new(From_sourceContext) +func NewHaving_clauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Having_clauseContext { + var p = new(Having_clauseContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_from_source + p.RuleIndex = CosmosDBParserRULE_having_clause return p } -func (s *From_sourceContext) GetParser() antlr.Parser { return s.parser } +func (s *Having_clauseContext) GetParser() antlr.Parser { return s.parser } -func (s *From_sourceContext) Container_expression() IContainer_expressionContext { +func (s *Having_clauseContext) HAVING_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserHAVING_SYMBOL, 0) +} + +func (s *Having_clauseContext) Scalar_expression() IScalar_expressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IContainer_expressionContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1350,46 +1848,54 @@ func (s *From_sourceContext) Container_expression() IContainer_expressionContext return nil } - return t.(IContainer_expressionContext) + return t.(IScalar_expressionContext) } -func (s *From_sourceContext) GetRuleContext() antlr.RuleContext { +func (s *Having_clauseContext) GetRuleContext() antlr.RuleContext { return s } -func (s *From_sourceContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Having_clauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *From_sourceContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Having_clauseContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterFrom_source(s) + listenerT.EnterHaving_clause(s) } } -func (s *From_sourceContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Having_clauseContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitFrom_source(s) + listenerT.ExitHaving_clause(s) } } -func (s *From_sourceContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Having_clauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitFrom_source(s) + return t.VisitHaving_clause(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) From_source() (localctx IFrom_sourceContext) { - localctx = NewFrom_sourceContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 14, CosmosDBParserRULE_from_source) +func (p *CosmosDBParser) Having_clause() (localctx IHaving_clauseContext) { + localctx = NewHaving_clauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, CosmosDBParserRULE_having_clause) p.EnterOuterAlt(localctx, 1) { - p.SetState(102) - p.Container_expression() + p.SetState(149) + p.Match(CosmosDBParserHAVING_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(150) + p.scalar_expression(0) } errorExit: @@ -1405,60 +1911,96 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IContainer_expressionContext is an interface to support dynamic dispatch. -type IContainer_expressionContext interface { +// IOrder_by_clauseContext is an interface to support dynamic dispatch. +type IOrder_by_clauseContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Container_name() IContainer_nameContext - IDENTIFIER() antlr.TerminalNode - AS_SYMBOL() antlr.TerminalNode + ORDER_SYMBOL() antlr.TerminalNode + BY_SYMBOL() antlr.TerminalNode + AllSort_expression() []ISort_expressionContext + Sort_expression(i int) ISort_expressionContext + AllCOMMA_SYMBOL() []antlr.TerminalNode + COMMA_SYMBOL(i int) antlr.TerminalNode - // IsContainer_expressionContext differentiates from other interfaces. - IsContainer_expressionContext() + // IsOrder_by_clauseContext differentiates from other interfaces. + IsOrder_by_clauseContext() } -type Container_expressionContext struct { +type Order_by_clauseContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyContainer_expressionContext() *Container_expressionContext { - var p = new(Container_expressionContext) +func NewEmptyOrder_by_clauseContext() *Order_by_clauseContext { + var p = new(Order_by_clauseContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_container_expression + p.RuleIndex = CosmosDBParserRULE_order_by_clause return p } -func InitEmptyContainer_expressionContext(p *Container_expressionContext) { +func InitEmptyOrder_by_clauseContext(p *Order_by_clauseContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_container_expression + p.RuleIndex = CosmosDBParserRULE_order_by_clause } -func (*Container_expressionContext) IsContainer_expressionContext() {} +func (*Order_by_clauseContext) IsOrder_by_clauseContext() {} -func NewContainer_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Container_expressionContext { - var p = new(Container_expressionContext) +func NewOrder_by_clauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Order_by_clauseContext { + var p = new(Order_by_clauseContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_container_expression + p.RuleIndex = CosmosDBParserRULE_order_by_clause return p } -func (s *Container_expressionContext) GetParser() antlr.Parser { return s.parser } +func (s *Order_by_clauseContext) GetParser() antlr.Parser { return s.parser } -func (s *Container_expressionContext) Container_name() IContainer_nameContext { +func (s *Order_by_clauseContext) ORDER_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserORDER_SYMBOL, 0) +} + +func (s *Order_by_clauseContext) BY_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBY_SYMBOL, 0) +} + +func (s *Order_by_clauseContext) AllSort_expression() []ISort_expressionContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ISort_expressionContext); ok { + len++ + } + } + + tst := make([]ISort_expressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ISort_expressionContext); ok { + tst[i] = t.(ISort_expressionContext) + i++ + } + } + + return tst +} + +func (s *Order_by_clauseContext) Sort_expression(i int) ISort_expressionContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IContainer_nameContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(ISort_expressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -1466,92 +2008,100 @@ func (s *Container_expressionContext) Container_name() IContainer_nameContext { return nil } - return t.(IContainer_nameContext) + return t.(ISort_expressionContext) } -func (s *Container_expressionContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CosmosDBParserIDENTIFIER, 0) +func (s *Order_by_clauseContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { + return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) } -func (s *Container_expressionContext) AS_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserAS_SYMBOL, 0) +func (s *Order_by_clauseContext) COMMA_SYMBOL(i int) antlr.TerminalNode { + return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) } -func (s *Container_expressionContext) GetRuleContext() antlr.RuleContext { +func (s *Order_by_clauseContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Container_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Order_by_clauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Container_expressionContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Order_by_clauseContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterContainer_expression(s) + listenerT.EnterOrder_by_clause(s) } } -func (s *Container_expressionContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Order_by_clauseContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitContainer_expression(s) + listenerT.ExitOrder_by_clause(s) } } -func (s *Container_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Order_by_clauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitContainer_expression(s) + return t.VisitOrder_by_clause(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Container_expression() (localctx IContainer_expressionContext) { - localctx = NewContainer_expressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, CosmosDBParserRULE_container_expression) +func (p *CosmosDBParser) Order_by_clause() (localctx IOrder_by_clauseContext) { + localctx = NewOrder_by_clauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, CosmosDBParserRULE_order_by_clause) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(104) - p.Container_name() + p.SetState(152) + p.Match(CosmosDBParserORDER_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - p.SetState(109) + { + p.SetState(153) + p.Match(CosmosDBParserBY_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(154) + p.Sort_expression() + } + p.SetState(159) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == CosmosDBParserAS_SYMBOL || _la == CosmosDBParserIDENTIFIER { - p.SetState(106) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CosmosDBParserAS_SYMBOL { - { - p.SetState(105) - p.Match(CosmosDBParserAS_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } + for _la == CosmosDBParserCOMMA_SYMBOL { { - p.SetState(108) - p.Match(CosmosDBParserIDENTIFIER) + p.SetState(155) + p.Match(CosmosDBParserCOMMA_SYMBOL) if p.HasError() { // Recognition error - abort rule goto errorExit } } + { + p.SetState(156) + p.Sort_expression() + } + p.SetState(161) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } errorExit: @@ -1567,97 +2117,138 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IContainer_nameContext is an interface to support dynamic dispatch. -type IContainer_nameContext interface { +// ISort_expressionContext is an interface to support dynamic dispatch. +type ISort_expressionContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode + Scalar_expression() IScalar_expressionContext + ASC_SYMBOL() antlr.TerminalNode + DESC_SYMBOL() antlr.TerminalNode - // IsContainer_nameContext differentiates from other interfaces. - IsContainer_nameContext() + // IsSort_expressionContext differentiates from other interfaces. + IsSort_expressionContext() } -type Container_nameContext struct { +type Sort_expressionContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyContainer_nameContext() *Container_nameContext { - var p = new(Container_nameContext) +func NewEmptySort_expressionContext() *Sort_expressionContext { + var p = new(Sort_expressionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_container_name + p.RuleIndex = CosmosDBParserRULE_sort_expression return p } -func InitEmptyContainer_nameContext(p *Container_nameContext) { +func InitEmptySort_expressionContext(p *Sort_expressionContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_container_name + p.RuleIndex = CosmosDBParserRULE_sort_expression } -func (*Container_nameContext) IsContainer_nameContext() {} +func (*Sort_expressionContext) IsSort_expressionContext() {} -func NewContainer_nameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Container_nameContext { - var p = new(Container_nameContext) +func NewSort_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Sort_expressionContext { + var p = new(Sort_expressionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_container_name + p.RuleIndex = CosmosDBParserRULE_sort_expression return p } -func (s *Container_nameContext) GetParser() antlr.Parser { return s.parser } +func (s *Sort_expressionContext) GetParser() antlr.Parser { return s.parser } -func (s *Container_nameContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CosmosDBParserIDENTIFIER, 0) +func (s *Sort_expressionContext) Scalar_expression() IScalar_expressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalar_expressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IScalar_expressionContext) } -func (s *Container_nameContext) GetRuleContext() antlr.RuleContext { +func (s *Sort_expressionContext) ASC_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserASC_SYMBOL, 0) +} + +func (s *Sort_expressionContext) DESC_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserDESC_SYMBOL, 0) +} + +func (s *Sort_expressionContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Container_nameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Sort_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Container_nameContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Sort_expressionContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterContainer_name(s) + listenerT.EnterSort_expression(s) } } -func (s *Container_nameContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Sort_expressionContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitContainer_name(s) + listenerT.ExitSort_expression(s) } } -func (s *Container_nameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Sort_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitContainer_name(s) + return t.VisitSort_expression(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Container_name() (localctx IContainer_nameContext) { - localctx = NewContainer_nameContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, CosmosDBParserRULE_container_name) +func (p *CosmosDBParser) Sort_expression() (localctx ISort_expressionContext) { + localctx = NewSort_expressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, CosmosDBParserRULE_sort_expression) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(111) - p.Match(CosmosDBParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + p.SetState(162) + p.scalar_expression(0) + } + p.SetState(164) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserASC_SYMBOL || _la == CosmosDBParserDESC_SYMBOL { + { + p.SetState(163) + _la = p.GetTokenStream().LA(1) + + if !(_la == CosmosDBParserASC_SYMBOL || _la == CosmosDBParserDESC_SYMBOL) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } } + } errorExit: @@ -1673,171 +2264,136 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IObject_property_listContext is an interface to support dynamic dispatch. -type IObject_property_listContext interface { +// IOffset_limit_clauseContext is an interface to support dynamic dispatch. +type IOffset_limit_clauseContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AllObject_property() []IObject_propertyContext - Object_property(i int) IObject_propertyContext - AllCOMMA_SYMBOL() []antlr.TerminalNode - COMMA_SYMBOL(i int) antlr.TerminalNode + OFFSET_SYMBOL() antlr.TerminalNode + AllDECIMAL() []antlr.TerminalNode + DECIMAL(i int) antlr.TerminalNode + LIMIT_SYMBOL() antlr.TerminalNode - // IsObject_property_listContext differentiates from other interfaces. - IsObject_property_listContext() + // IsOffset_limit_clauseContext differentiates from other interfaces. + IsOffset_limit_clauseContext() } -type Object_property_listContext struct { +type Offset_limit_clauseContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyObject_property_listContext() *Object_property_listContext { - var p = new(Object_property_listContext) +func NewEmptyOffset_limit_clauseContext() *Offset_limit_clauseContext { + var p = new(Offset_limit_clauseContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_object_property_list + p.RuleIndex = CosmosDBParserRULE_offset_limit_clause return p } -func InitEmptyObject_property_listContext(p *Object_property_listContext) { +func InitEmptyOffset_limit_clauseContext(p *Offset_limit_clauseContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_object_property_list + p.RuleIndex = CosmosDBParserRULE_offset_limit_clause } -func (*Object_property_listContext) IsObject_property_listContext() {} +func (*Offset_limit_clauseContext) IsOffset_limit_clauseContext() {} -func NewObject_property_listContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Object_property_listContext { - var p = new(Object_property_listContext) +func NewOffset_limit_clauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Offset_limit_clauseContext { + var p = new(Offset_limit_clauseContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_object_property_list + p.RuleIndex = CosmosDBParserRULE_offset_limit_clause return p } -func (s *Object_property_listContext) GetParser() antlr.Parser { return s.parser } - -func (s *Object_property_listContext) AllObject_property() []IObject_propertyContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IObject_propertyContext); ok { - len++ - } - } - - tst := make([]IObject_propertyContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IObject_propertyContext); ok { - tst[i] = t.(IObject_propertyContext) - i++ - } - } +func (s *Offset_limit_clauseContext) GetParser() antlr.Parser { return s.parser } - return tst +func (s *Offset_limit_clauseContext) OFFSET_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserOFFSET_SYMBOL, 0) } -func (s *Object_property_listContext) Object_property(i int) IObject_propertyContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IObject_propertyContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IObject_propertyContext) +func (s *Offset_limit_clauseContext) AllDECIMAL() []antlr.TerminalNode { + return s.GetTokens(CosmosDBParserDECIMAL) } -func (s *Object_property_listContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { - return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) +func (s *Offset_limit_clauseContext) DECIMAL(i int) antlr.TerminalNode { + return s.GetToken(CosmosDBParserDECIMAL, i) } -func (s *Object_property_listContext) COMMA_SYMBOL(i int) antlr.TerminalNode { - return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) +func (s *Offset_limit_clauseContext) LIMIT_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLIMIT_SYMBOL, 0) } -func (s *Object_property_listContext) GetRuleContext() antlr.RuleContext { +func (s *Offset_limit_clauseContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Object_property_listContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Offset_limit_clauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Object_property_listContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Offset_limit_clauseContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterObject_property_list(s) + listenerT.EnterOffset_limit_clause(s) } } -func (s *Object_property_listContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Offset_limit_clauseContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitObject_property_list(s) + listenerT.ExitOffset_limit_clause(s) } } -func (s *Object_property_listContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Offset_limit_clauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitObject_property_list(s) + return t.VisitOffset_limit_clause(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Object_property_list() (localctx IObject_property_listContext) { - localctx = NewObject_property_listContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, CosmosDBParserRULE_object_property_list) - var _la int - +func (p *CosmosDBParser) Offset_limit_clause() (localctx IOffset_limit_clauseContext) { + localctx = NewOffset_limit_clauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, CosmosDBParserRULE_offset_limit_clause) p.EnterOuterAlt(localctx, 1) { - p.SetState(113) - p.Object_property() - } - p.SetState(118) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + p.SetState(166) + p.Match(CosmosDBParserOFFSET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - _la = p.GetTokenStream().LA(1) - - for _la == CosmosDBParserCOMMA_SYMBOL { - { - p.SetState(114) - p.Match(CosmosDBParserCOMMA_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + { + p.SetState(167) + p.Match(CosmosDBParserDECIMAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - { - p.SetState(115) - p.Object_property() + } + { + p.SetState(168) + p.Match(CosmosDBParserLIMIT_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - - p.SetState(120) - p.GetErrorHandler().Sync(p) + } + { + p.SetState(169) + p.Match(CosmosDBParserDECIMAL) if p.HasError() { + // Recognition error - abort rule goto errorExit } - _la = p.GetTokenStream().LA(1) } errorExit: @@ -1853,74 +2409,56 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IObject_propertyContext is an interface to support dynamic dispatch. -type IObject_propertyContext interface { +// IFrom_specificationContext is an interface to support dynamic dispatch. +type IFrom_specificationContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Scalar_expression() IScalar_expressionContext - Property_alias() IProperty_aliasContext - AS_SYMBOL() antlr.TerminalNode + From_source() IFrom_sourceContext - // IsObject_propertyContext differentiates from other interfaces. - IsObject_propertyContext() + // IsFrom_specificationContext differentiates from other interfaces. + IsFrom_specificationContext() } -type Object_propertyContext struct { +type From_specificationContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyObject_propertyContext() *Object_propertyContext { - var p = new(Object_propertyContext) +func NewEmptyFrom_specificationContext() *From_specificationContext { + var p = new(From_specificationContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_object_property + p.RuleIndex = CosmosDBParserRULE_from_specification return p } -func InitEmptyObject_propertyContext(p *Object_propertyContext) { +func InitEmptyFrom_specificationContext(p *From_specificationContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_object_property + p.RuleIndex = CosmosDBParserRULE_from_specification } -func (*Object_propertyContext) IsObject_propertyContext() {} +func (*From_specificationContext) IsFrom_specificationContext() {} -func NewObject_propertyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Object_propertyContext { - var p = new(Object_propertyContext) +func NewFrom_specificationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *From_specificationContext { + var p = new(From_specificationContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_object_property + p.RuleIndex = CosmosDBParserRULE_from_specification return p } -func (s *Object_propertyContext) GetParser() antlr.Parser { return s.parser } - -func (s *Object_propertyContext) Scalar_expression() IScalar_expressionContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IScalar_expressionContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IScalar_expressionContext) -} +func (s *From_specificationContext) GetParser() antlr.Parser { return s.parser } -func (s *Object_propertyContext) Property_alias() IProperty_aliasContext { +func (s *From_specificationContext) From_source() IFrom_sourceContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IProperty_aliasContext); ok { + if _, ok := ctx.(IFrom_sourceContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1930,190 +2468,225 @@ func (s *Object_propertyContext) Property_alias() IProperty_aliasContext { return nil } - return t.(IProperty_aliasContext) -} - -func (s *Object_propertyContext) AS_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserAS_SYMBOL, 0) + return t.(IFrom_sourceContext) } -func (s *Object_propertyContext) GetRuleContext() antlr.RuleContext { +func (s *From_specificationContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Object_propertyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *From_specificationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Object_propertyContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *From_specificationContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterObject_property(s) + listenerT.EnterFrom_specification(s) } } -func (s *Object_propertyContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *From_specificationContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitObject_property(s) + listenerT.ExitFrom_specification(s) } } -func (s *Object_propertyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *From_specificationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitObject_property(s) + return t.VisitFrom_specification(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Object_property() (localctx IObject_propertyContext) { - localctx = NewObject_propertyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, CosmosDBParserRULE_object_property) - var _la int - +func (p *CosmosDBParser) From_specification() (localctx IFrom_specificationContext) { + localctx = NewFrom_specificationContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 24, CosmosDBParserRULE_from_specification) p.EnterOuterAlt(localctx, 1) { - p.SetState(121) - p.scalar_expression(0) + p.SetState(171) + p.From_source() } - p.SetState(126) - p.GetErrorHandler().Sync(p) + +errorExit: if p.HasError() { - goto errorExit + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) } - _la = p.GetTokenStream().LA(1) + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} - if _la == CosmosDBParserAS_SYMBOL || _la == CosmosDBParserIDENTIFIER { - p.SetState(123) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == CosmosDBParserAS_SYMBOL { - { - p.SetState(122) - p.Match(CosmosDBParserAS_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - { - p.SetState(125) - p.Property_alias() - } - - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IProperty_aliasContext is an interface to support dynamic dispatch. -type IProperty_aliasContext interface { +// IFrom_sourceContext is an interface to support dynamic dispatch. +type IFrom_sourceContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode + Container_expression() IContainer_expressionContext + AllJoin_clause() []IJoin_clauseContext + Join_clause(i int) IJoin_clauseContext - // IsProperty_aliasContext differentiates from other interfaces. - IsProperty_aliasContext() + // IsFrom_sourceContext differentiates from other interfaces. + IsFrom_sourceContext() } -type Property_aliasContext struct { +type From_sourceContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyProperty_aliasContext() *Property_aliasContext { - var p = new(Property_aliasContext) +func NewEmptyFrom_sourceContext() *From_sourceContext { + var p = new(From_sourceContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_property_alias + p.RuleIndex = CosmosDBParserRULE_from_source return p } -func InitEmptyProperty_aliasContext(p *Property_aliasContext) { +func InitEmptyFrom_sourceContext(p *From_sourceContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_property_alias + p.RuleIndex = CosmosDBParserRULE_from_source } -func (*Property_aliasContext) IsProperty_aliasContext() {} +func (*From_sourceContext) IsFrom_sourceContext() {} -func NewProperty_aliasContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Property_aliasContext { - var p = new(Property_aliasContext) +func NewFrom_sourceContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *From_sourceContext { + var p = new(From_sourceContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_property_alias + p.RuleIndex = CosmosDBParserRULE_from_source return p } -func (s *Property_aliasContext) GetParser() antlr.Parser { return s.parser } +func (s *From_sourceContext) GetParser() antlr.Parser { return s.parser } -func (s *Property_aliasContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CosmosDBParserIDENTIFIER, 0) +func (s *From_sourceContext) Container_expression() IContainer_expressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IContainer_expressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IContainer_expressionContext) } -func (s *Property_aliasContext) GetRuleContext() antlr.RuleContext { +func (s *From_sourceContext) AllJoin_clause() []IJoin_clauseContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IJoin_clauseContext); ok { + len++ + } + } + + tst := make([]IJoin_clauseContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IJoin_clauseContext); ok { + tst[i] = t.(IJoin_clauseContext) + i++ + } + } + + return tst +} + +func (s *From_sourceContext) Join_clause(i int) IJoin_clauseContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IJoin_clauseContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IJoin_clauseContext) +} + +func (s *From_sourceContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Property_aliasContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *From_sourceContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Property_aliasContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *From_sourceContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterProperty_alias(s) + listenerT.EnterFrom_source(s) } } -func (s *Property_aliasContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *From_sourceContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitProperty_alias(s) + listenerT.ExitFrom_source(s) } } -func (s *Property_aliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *From_sourceContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitProperty_alias(s) + return t.VisitFrom_source(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Property_alias() (localctx IProperty_aliasContext) { - localctx = NewProperty_aliasContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, CosmosDBParserRULE_property_alias) +func (p *CosmosDBParser) From_source() (localctx IFrom_sourceContext) { + localctx = NewFrom_sourceContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 26, CosmosDBParserRULE_from_source) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(128) - p.Match(CosmosDBParserIDENTIFIER) + p.SetState(173) + p.Container_expression() + } + p.SetState(177) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == CosmosDBParserJOIN_SYMBOL { + { + p.SetState(174) + p.Join_clause() + } + + p.SetState(179) + p.GetErrorHandler().Sync(p) if p.HasError() { - // Recognition error - abort rule goto errorExit } + _la = p.GetTokenStream().LA(1) } errorExit: @@ -2129,64 +2702,58 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IScalar_expressionContext is an interface to support dynamic dispatch. -type IScalar_expressionContext interface { +// IContainer_expressionContext is an interface to support dynamic dispatch. +type IContainer_expressionContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Input_alias() IInput_aliasContext - Unary_operator() IUnary_operatorContext - Scalar_expression() IScalar_expressionContext - DOT_SYMBOL() antlr.TerminalNode - Property_name() IProperty_nameContext - LS_BRACKET_SYMBOL() antlr.TerminalNode - RS_BRACKET_SYMBOL() antlr.TerminalNode - DOUBLE_QUOTE_STRING_LITERAL() antlr.TerminalNode - Array_index() IArray_indexContext + Container_name() IContainer_nameContext + Identifier() IIdentifierContext + AS_SYMBOL() antlr.TerminalNode - // IsScalar_expressionContext differentiates from other interfaces. - IsScalar_expressionContext() + // IsContainer_expressionContext differentiates from other interfaces. + IsContainer_expressionContext() } -type Scalar_expressionContext struct { +type Container_expressionContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyScalar_expressionContext() *Scalar_expressionContext { - var p = new(Scalar_expressionContext) +func NewEmptyContainer_expressionContext() *Container_expressionContext { + var p = new(Container_expressionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_scalar_expression + p.RuleIndex = CosmosDBParserRULE_container_expression return p } -func InitEmptyScalar_expressionContext(p *Scalar_expressionContext) { +func InitEmptyContainer_expressionContext(p *Container_expressionContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_scalar_expression + p.RuleIndex = CosmosDBParserRULE_container_expression } -func (*Scalar_expressionContext) IsScalar_expressionContext() {} +func (*Container_expressionContext) IsContainer_expressionContext() {} -func NewScalar_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Scalar_expressionContext { - var p = new(Scalar_expressionContext) +func NewContainer_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Container_expressionContext { + var p = new(Container_expressionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_scalar_expression + p.RuleIndex = CosmosDBParserRULE_container_expression return p } -func (s *Scalar_expressionContext) GetParser() antlr.Parser { return s.parser } +func (s *Container_expressionContext) GetParser() antlr.Parser { return s.parser } -func (s *Scalar_expressionContext) Input_alias() IInput_aliasContext { +func (s *Container_expressionContext) Container_name() IContainer_nameContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInput_aliasContext); ok { + if _, ok := ctx.(IContainer_nameContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2196,13 +2763,13 @@ func (s *Scalar_expressionContext) Input_alias() IInput_aliasContext { return nil } - return t.(IInput_aliasContext) + return t.(IContainer_nameContext) } -func (s *Scalar_expressionContext) Unary_operator() IUnary_operatorContext { +func (s *Container_expressionContext) Identifier() IIdentifierContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IUnary_operatorContext); ok { + if _, ok := ctx.(IIdentifierContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2212,61 +2779,604 @@ func (s *Scalar_expressionContext) Unary_operator() IUnary_operatorContext { return nil } - return t.(IUnary_operatorContext) + return t.(IIdentifierContext) } -func (s *Scalar_expressionContext) Scalar_expression() IScalar_expressionContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IScalar_expressionContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } +func (s *Container_expressionContext) AS_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserAS_SYMBOL, 0) +} - return t.(IScalar_expressionContext) +func (s *Container_expressionContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *Scalar_expressionContext) DOT_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserDOT_SYMBOL, 0) +func (s *Container_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Scalar_expressionContext) Property_name() IProperty_nameContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IProperty_nameContext); ok { - t = ctx.(antlr.RuleContext) - break - } +func (s *Container_expressionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterContainer_expression(s) } +} - if t == nil { - return nil +func (s *Container_expressionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitContainer_expression(s) } - - return t.(IProperty_nameContext) } -func (s *Scalar_expressionContext) LS_BRACKET_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserLS_BRACKET_SYMBOL, 0) -} +func (s *Container_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitContainer_expression(s) -func (s *Scalar_expressionContext) RS_BRACKET_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserRS_BRACKET_SYMBOL, 0) + default: + return t.VisitChildren(s) + } } -func (s *Scalar_expressionContext) DOUBLE_QUOTE_STRING_LITERAL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL, 0) -} +func (p *CosmosDBParser) Container_expression() (localctx IContainer_expressionContext) { + localctx = NewContainer_expressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 28, CosmosDBParserRULE_container_expression) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(180) + p.Container_name() + } + p.SetState(185) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) == 1 { + p.SetState(182) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserAS_SYMBOL { + { + p.SetState(181) + p.Match(CosmosDBParserAS_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(184) + p.Identifier() + } + + } else if p.HasError() { // JIM + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IJoin_clauseContext is an interface to support dynamic dispatch. +type IJoin_clauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + JOIN_SYMBOL() antlr.TerminalNode + Identifier() IIdentifierContext + IN_SYMBOL() antlr.TerminalNode + Scalar_expression() IScalar_expressionContext + + // IsJoin_clauseContext differentiates from other interfaces. + IsJoin_clauseContext() +} + +type Join_clauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyJoin_clauseContext() *Join_clauseContext { + var p = new(Join_clauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_join_clause + return p +} + +func InitEmptyJoin_clauseContext(p *Join_clauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_join_clause +} + +func (*Join_clauseContext) IsJoin_clauseContext() {} + +func NewJoin_clauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Join_clauseContext { + var p = new(Join_clauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_join_clause + + return p +} + +func (s *Join_clauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *Join_clauseContext) JOIN_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserJOIN_SYMBOL, 0) +} + +func (s *Join_clauseContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *Join_clauseContext) IN_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserIN_SYMBOL, 0) +} + +func (s *Join_clauseContext) Scalar_expression() IScalar_expressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalar_expressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IScalar_expressionContext) +} + +func (s *Join_clauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *Join_clauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *Join_clauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterJoin_clause(s) + } +} + +func (s *Join_clauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitJoin_clause(s) + } +} + +func (s *Join_clauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitJoin_clause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *CosmosDBParser) Join_clause() (localctx IJoin_clauseContext) { + localctx = NewJoin_clauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 30, CosmosDBParserRULE_join_clause) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(187) + p.Match(CosmosDBParserJOIN_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(188) + p.Identifier() + } + { + p.SetState(189) + p.Match(CosmosDBParserIN_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(190) + p.scalar_expression(0) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IContainer_nameContext is an interface to support dynamic dispatch. +type IContainer_nameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Identifier() IIdentifierContext + + // IsContainer_nameContext differentiates from other interfaces. + IsContainer_nameContext() +} + +type Container_nameContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyContainer_nameContext() *Container_nameContext { + var p = new(Container_nameContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_container_name + return p +} + +func InitEmptyContainer_nameContext(p *Container_nameContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_container_name +} + +func (*Container_nameContext) IsContainer_nameContext() {} + +func NewContainer_nameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Container_nameContext { + var p = new(Container_nameContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_container_name + + return p +} + +func (s *Container_nameContext) GetParser() antlr.Parser { return s.parser } + +func (s *Container_nameContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *Container_nameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *Container_nameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *Container_nameContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterContainer_name(s) + } +} + +func (s *Container_nameContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitContainer_name(s) + } +} + +func (s *Container_nameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitContainer_name(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *CosmosDBParser) Container_name() (localctx IContainer_nameContext) { + localctx = NewContainer_nameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 32, CosmosDBParserRULE_container_name) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(192) + p.Identifier() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IObject_property_listContext is an interface to support dynamic dispatch. +type IObject_property_listContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllObject_property() []IObject_propertyContext + Object_property(i int) IObject_propertyContext + AllCOMMA_SYMBOL() []antlr.TerminalNode + COMMA_SYMBOL(i int) antlr.TerminalNode + + // IsObject_property_listContext differentiates from other interfaces. + IsObject_property_listContext() +} + +type Object_property_listContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyObject_property_listContext() *Object_property_listContext { + var p = new(Object_property_listContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_object_property_list + return p +} + +func InitEmptyObject_property_listContext(p *Object_property_listContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_object_property_list +} + +func (*Object_property_listContext) IsObject_property_listContext() {} + +func NewObject_property_listContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Object_property_listContext { + var p = new(Object_property_listContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_object_property_list + + return p +} + +func (s *Object_property_listContext) GetParser() antlr.Parser { return s.parser } + +func (s *Object_property_listContext) AllObject_property() []IObject_propertyContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IObject_propertyContext); ok { + len++ + } + } + + tst := make([]IObject_propertyContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IObject_propertyContext); ok { + tst[i] = t.(IObject_propertyContext) + i++ + } + } + + return tst +} + +func (s *Object_property_listContext) Object_property(i int) IObject_propertyContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObject_propertyContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IObject_propertyContext) +} + +func (s *Object_property_listContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { + return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) +} + +func (s *Object_property_listContext) COMMA_SYMBOL(i int) antlr.TerminalNode { + return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) +} + +func (s *Object_property_listContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *Object_property_listContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *Object_property_listContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterObject_property_list(s) + } +} + +func (s *Object_property_listContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitObject_property_list(s) + } +} + +func (s *Object_property_listContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitObject_property_list(s) + + default: + return t.VisitChildren(s) + } +} -func (s *Scalar_expressionContext) Array_index() IArray_indexContext { +func (p *CosmosDBParser) Object_property_list() (localctx IObject_property_listContext) { + localctx = NewObject_property_listContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 34, CosmosDBParserRULE_object_property_list) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(194) + p.Object_property() + } + p.SetState(199) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == CosmosDBParserCOMMA_SYMBOL { + { + p.SetState(195) + p.Match(CosmosDBParserCOMMA_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(196) + p.Object_property() + } + + p.SetState(201) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IObject_propertyContext is an interface to support dynamic dispatch. +type IObject_propertyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Scalar_expression() IScalar_expressionContext + Property_alias() IProperty_aliasContext + AS_SYMBOL() antlr.TerminalNode + + // IsObject_propertyContext differentiates from other interfaces. + IsObject_propertyContext() +} + +type Object_propertyContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyObject_propertyContext() *Object_propertyContext { + var p = new(Object_propertyContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_object_property + return p +} + +func InitEmptyObject_propertyContext(p *Object_propertyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_object_property +} + +func (*Object_propertyContext) IsObject_propertyContext() {} + +func NewObject_propertyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Object_propertyContext { + var p = new(Object_propertyContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_object_property + + return p +} + +func (s *Object_propertyContext) GetParser() antlr.Parser { return s.parser } + +func (s *Object_propertyContext) Scalar_expression() IScalar_expressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArray_indexContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2276,194 +3386,212 @@ func (s *Scalar_expressionContext) Array_index() IArray_indexContext { return nil } - return t.(IArray_indexContext) + return t.(IScalar_expressionContext) } -func (s *Scalar_expressionContext) GetRuleContext() antlr.RuleContext { +func (s *Object_propertyContext) Property_alias() IProperty_aliasContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IProperty_aliasContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IProperty_aliasContext) +} + +func (s *Object_propertyContext) AS_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserAS_SYMBOL, 0) +} + +func (s *Object_propertyContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Scalar_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Object_propertyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Scalar_expressionContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Object_propertyContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterScalar_expression(s) + listenerT.EnterObject_property(s) } } -func (s *Scalar_expressionContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Object_propertyContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitScalar_expression(s) + listenerT.ExitObject_property(s) } } -func (s *Scalar_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Object_propertyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitScalar_expression(s) + return t.VisitObject_property(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Scalar_expression() (localctx IScalar_expressionContext) { - return p.scalar_expression(0) -} - -func (p *CosmosDBParser) scalar_expression(_p int) (localctx IScalar_expressionContext) { - var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() - - _parentState := p.GetState() - localctx = NewScalar_expressionContext(p, p.GetParserRuleContext(), _parentState) - var _prevctx IScalar_expressionContext = localctx - var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 26 - p.EnterRecursionRule(localctx, 26, CosmosDBParserRULE_scalar_expression, _p) - var _alt int +func (p *CosmosDBParser) Object_property() (localctx IObject_propertyContext) { + localctx = NewObject_propertyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 36, CosmosDBParserRULE_object_property) + var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(135) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + { + p.SetState(202) + p.scalar_expression(0) } + p.SetState(207) + p.GetErrorHandler().Sync(p) - switch p.GetTokenStream().LA(1) { - case CosmosDBParserIDENTIFIER: - { - p.SetState(131) - p.Input_alias() + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) == 1 { + p.SetState(204) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserAS_SYMBOL { + { + p.SetState(203) + p.Match(CosmosDBParserAS_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - case CosmosDBParserPLUS_SYMBOL, CosmosDBParserMINUS_SYMBOL, CosmosDBParserBIT_NOT_SYMBOL: - { - p.SetState(132) - p.Unary_operator() } { - p.SetState(133) - p.scalar_expression(1) + p.SetState(206) + p.Property_alias() } - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } - p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(149) - p.GetErrorHandler().Sync(p) - if p.HasError() { + } else if p.HasError() { // JIM goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) + +errorExit: if p.HasError() { - goto errorExit + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IProperty_aliasContext is an interface to support dynamic dispatch. +type IProperty_aliasContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Identifier() IIdentifierContext + + // IsProperty_aliasContext differentiates from other interfaces. + IsProperty_aliasContext() +} + +type Property_aliasContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyProperty_aliasContext() *Property_aliasContext { + var p = new(Property_aliasContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_property_alias + return p +} + +func InitEmptyProperty_aliasContext(p *Property_aliasContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_property_alias +} + +func (*Property_aliasContext) IsProperty_aliasContext() {} + +func NewProperty_aliasContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Property_aliasContext { + var p = new(Property_aliasContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_property_alias + + return p +} + +func (s *Property_aliasContext) GetParser() antlr.Parser { return s.parser } + +func (s *Property_aliasContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - if p.GetParseListeners() != nil { - p.TriggerExitRuleEvent() - } - _prevctx = localctx - p.SetState(147) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) { - case 1: - localctx = NewScalar_expressionContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) - p.SetState(137) + if t == nil { + return nil + } - if !(p.Precpred(p.GetParserRuleContext(), 3)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) - goto errorExit - } - { - p.SetState(138) - p.Match(CosmosDBParserDOT_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(139) - p.Property_name() - } + return t.(IIdentifierContext) +} - case 2: - localctx = NewScalar_expressionContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) - p.SetState(140) +func (s *Property_aliasContext) GetRuleContext() antlr.RuleContext { + return s +} - if !(p.Precpred(p.GetParserRuleContext(), 2)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) - goto errorExit - } - { - p.SetState(141) - p.Match(CosmosDBParserLS_BRACKET_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(144) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } +func (s *Property_aliasContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} - switch p.GetTokenStream().LA(1) { - case CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL: - { - p.SetState(142) - p.Match(CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } +func (s *Property_aliasContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterProperty_alias(s) + } +} - case CosmosDBParserDECIMAL: - { - p.SetState(143) - p.Array_index() - } +func (s *Property_aliasContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitProperty_alias(s) + } +} - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } - { - p.SetState(146) - p.Match(CosmosDBParserRS_BRACKET_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } +func (s *Property_aliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitProperty_alias(s) - case antlr.ATNInvalidAltNumber: - goto errorExit - } + default: + return t.VisitChildren(s) + } +} - } - p.SetState(151) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } +func (p *CosmosDBParser) Property_alias() (localctx IProperty_aliasContext) { + localctx = NewProperty_aliasContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 38, CosmosDBParserRULE_property_alias) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(209) + p.Identifier() } errorExit: @@ -2474,13 +3602,13 @@ errorExit: p.GetErrorHandler().Recover(p, v) p.SetError(nil) } - p.UnrollRecursionContexts(_parentctx) + p.ExitRule() return localctx goto errorExit // Trick to prevent compiler error if the label is not used } -// IScalar_expression_in_whereContext is an interface to support dynamic dispatch. -type IScalar_expression_in_whereContext interface { +// IScalar_expressionContext is an interface to support dynamic dispatch. +type IScalar_expressionContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -2490,17 +3618,29 @@ type IScalar_expression_in_whereContext interface { Constant() IConstantContext Input_alias() IInput_aliasContext Parameter_name() IParameter_nameContext - Unary_operator() IUnary_operatorContext - AllScalar_expression_in_where() []IScalar_expression_in_whereContext - Scalar_expression_in_where(i int) IScalar_expression_in_whereContext Scalar_function_expression() IScalar_function_expressionContext Create_object_expression() ICreate_object_expressionContext Create_array_expression() ICreate_array_expressionContext LR_BRACKET_SYMBOL() antlr.TerminalNode + AllScalar_expression() []IScalar_expressionContext + Scalar_expression(i int) IScalar_expressionContext RR_BRACKET_SYMBOL() antlr.TerminalNode + Select_() ISelectContext + EXISTS_SYMBOL() antlr.TerminalNode + Unary_operator() IUnary_operatorContext + NOT_SYMBOL() antlr.TerminalNode + Multiplicative_operator() IMultiplicative_operatorContext + Additive_operator() IAdditive_operatorContext + Shift_operator() IShift_operatorContext + BIT_AND_SYMBOL() antlr.TerminalNode + BIT_XOR_SYMBOL() antlr.TerminalNode + BIT_OR_SYMBOL() antlr.TerminalNode + DOUBLE_BAR_SYMBOL() antlr.TerminalNode + Comparison_operator() IComparison_operatorContext + BETWEEN_SYMBOL() antlr.TerminalNode AND_SYMBOL() antlr.TerminalNode + LIKE_SYMBOL() antlr.TerminalNode OR_SYMBOL() antlr.TerminalNode - Binary_operator() IBinary_operatorContext QUESTION_MARK_SYMBOL() antlr.TerminalNode COLON_SYMBOL() antlr.TerminalNode DOT_SYMBOL() antlr.TerminalNode @@ -2508,45 +3648,49 @@ type IScalar_expression_in_whereContext interface { LS_BRACKET_SYMBOL() antlr.TerminalNode RS_BRACKET_SYMBOL() antlr.TerminalNode DOUBLE_QUOTE_STRING_LITERAL() antlr.TerminalNode + SINGLE_QUOTE_STRING_LITERAL() antlr.TerminalNode Array_index() IArray_indexContext + IN_SYMBOL() antlr.TerminalNode + AllCOMMA_SYMBOL() []antlr.TerminalNode + COMMA_SYMBOL(i int) antlr.TerminalNode - // IsScalar_expression_in_whereContext differentiates from other interfaces. - IsScalar_expression_in_whereContext() + // IsScalar_expressionContext differentiates from other interfaces. + IsScalar_expressionContext() } -type Scalar_expression_in_whereContext struct { +type Scalar_expressionContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyScalar_expression_in_whereContext() *Scalar_expression_in_whereContext { - var p = new(Scalar_expression_in_whereContext) +func NewEmptyScalar_expressionContext() *Scalar_expressionContext { + var p = new(Scalar_expressionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_scalar_expression_in_where + p.RuleIndex = CosmosDBParserRULE_scalar_expression return p } -func InitEmptyScalar_expression_in_whereContext(p *Scalar_expression_in_whereContext) { +func InitEmptyScalar_expressionContext(p *Scalar_expressionContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_scalar_expression_in_where + p.RuleIndex = CosmosDBParserRULE_scalar_expression } -func (*Scalar_expression_in_whereContext) IsScalar_expression_in_whereContext() {} +func (*Scalar_expressionContext) IsScalar_expressionContext() {} -func NewScalar_expression_in_whereContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Scalar_expression_in_whereContext { - var p = new(Scalar_expression_in_whereContext) +func NewScalar_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Scalar_expressionContext { + var p = new(Scalar_expressionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_scalar_expression_in_where + p.RuleIndex = CosmosDBParserRULE_scalar_expression return p } -func (s *Scalar_expression_in_whereContext) GetParser() antlr.Parser { return s.parser } +func (s *Scalar_expressionContext) GetParser() antlr.Parser { return s.parser } -func (s *Scalar_expression_in_whereContext) Constant() IConstantContext { +func (s *Scalar_expressionContext) Constant() IConstantContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IConstantContext); ok { @@ -2562,7 +3706,7 @@ func (s *Scalar_expression_in_whereContext) Constant() IConstantContext { return t.(IConstantContext) } -func (s *Scalar_expression_in_whereContext) Input_alias() IInput_aliasContext { +func (s *Scalar_expressionContext) Input_alias() IInput_aliasContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IInput_aliasContext); ok { @@ -2578,7 +3722,7 @@ func (s *Scalar_expression_in_whereContext) Input_alias() IInput_aliasContext { return t.(IInput_aliasContext) } -func (s *Scalar_expression_in_whereContext) Parameter_name() IParameter_nameContext { +func (s *Scalar_expressionContext) Parameter_name() IParameter_nameContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IParameter_nameContext); ok { @@ -2594,10 +3738,10 @@ func (s *Scalar_expression_in_whereContext) Parameter_name() IParameter_nameCont return t.(IParameter_nameContext) } -func (s *Scalar_expression_in_whereContext) Unary_operator() IUnary_operatorContext { +func (s *Scalar_expressionContext) Scalar_function_expression() IScalar_function_expressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IUnary_operatorContext); ok { + if _, ok := ctx.(IScalar_function_expressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2607,23 +3751,59 @@ func (s *Scalar_expression_in_whereContext) Unary_operator() IUnary_operatorCont return nil } - return t.(IUnary_operatorContext) + return t.(IScalar_function_expressionContext) +} + +func (s *Scalar_expressionContext) Create_object_expression() ICreate_object_expressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICreate_object_expressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICreate_object_expressionContext) +} + +func (s *Scalar_expressionContext) Create_array_expression() ICreate_array_expressionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICreate_array_expressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICreate_array_expressionContext) +} + +func (s *Scalar_expressionContext) LR_BRACKET_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLR_BRACKET_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) AllScalar_expression_in_where() []IScalar_expression_in_whereContext { +func (s *Scalar_expressionContext) AllScalar_expression() []IScalar_expressionContext { children := s.GetChildren() len := 0 for _, ctx := range children { - if _, ok := ctx.(IScalar_expression_in_whereContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { len++ } } - tst := make([]IScalar_expression_in_whereContext, len) + tst := make([]IScalar_expressionContext, len) i := 0 for _, ctx := range children { - if t, ok := ctx.(IScalar_expression_in_whereContext); ok { - tst[i] = t.(IScalar_expression_in_whereContext) + if t, ok := ctx.(IScalar_expressionContext); ok { + tst[i] = t.(IScalar_expressionContext) i++ } } @@ -2631,11 +3811,11 @@ func (s *Scalar_expression_in_whereContext) AllScalar_expression_in_where() []IS return tst } -func (s *Scalar_expression_in_whereContext) Scalar_expression_in_where(i int) IScalar_expression_in_whereContext { +func (s *Scalar_expressionContext) Scalar_expression(i int) IScalar_expressionContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IScalar_expression_in_whereContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { if j == i { t = ctx.(antlr.RuleContext) break @@ -2648,13 +3828,17 @@ func (s *Scalar_expression_in_whereContext) Scalar_expression_in_where(i int) IS return nil } - return t.(IScalar_expression_in_whereContext) + return t.(IScalar_expressionContext) +} + +func (s *Scalar_expressionContext) RR_BRACKET_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserRR_BRACKET_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) Scalar_function_expression() IScalar_function_expressionContext { +func (s *Scalar_expressionContext) Select_() ISelectContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IScalar_function_expressionContext); ok { + if _, ok := ctx.(ISelectContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2664,13 +3848,17 @@ func (s *Scalar_expression_in_whereContext) Scalar_function_expression() IScalar return nil } - return t.(IScalar_function_expressionContext) + return t.(ISelectContext) +} + +func (s *Scalar_expressionContext) EXISTS_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserEXISTS_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) Create_object_expression() ICreate_object_expressionContext { +func (s *Scalar_expressionContext) Unary_operator() IUnary_operatorContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ICreate_object_expressionContext); ok { + if _, ok := ctx.(IUnary_operatorContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2680,13 +3868,17 @@ func (s *Scalar_expression_in_whereContext) Create_object_expression() ICreate_o return nil } - return t.(ICreate_object_expressionContext) + return t.(IUnary_operatorContext) +} + +func (s *Scalar_expressionContext) NOT_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserNOT_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) Create_array_expression() ICreate_array_expressionContext { +func (s *Scalar_expressionContext) Multiplicative_operator() IMultiplicative_operatorContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ICreate_array_expressionContext); ok { + if _, ok := ctx.(IMultiplicative_operatorContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2696,29 +3888,61 @@ func (s *Scalar_expression_in_whereContext) Create_array_expression() ICreate_ar return nil } - return t.(ICreate_array_expressionContext) + return t.(IMultiplicative_operatorContext) } -func (s *Scalar_expression_in_whereContext) LR_BRACKET_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserLR_BRACKET_SYMBOL, 0) +func (s *Scalar_expressionContext) Additive_operator() IAdditive_operatorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAdditive_operatorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAdditive_operatorContext) } -func (s *Scalar_expression_in_whereContext) RR_BRACKET_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserRR_BRACKET_SYMBOL, 0) +func (s *Scalar_expressionContext) Shift_operator() IShift_operatorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IShift_operatorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IShift_operatorContext) } -func (s *Scalar_expression_in_whereContext) AND_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserAND_SYMBOL, 0) +func (s *Scalar_expressionContext) BIT_AND_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBIT_AND_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) OR_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserOR_SYMBOL, 0) +func (s *Scalar_expressionContext) BIT_XOR_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBIT_XOR_SYMBOL, 0) +} + +func (s *Scalar_expressionContext) BIT_OR_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBIT_OR_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) Binary_operator() IBinary_operatorContext { +func (s *Scalar_expressionContext) DOUBLE_BAR_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserDOUBLE_BAR_SYMBOL, 0) +} + +func (s *Scalar_expressionContext) Comparison_operator() IComparison_operatorContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IBinary_operatorContext); ok { + if _, ok := ctx.(IComparison_operatorContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2728,22 +3952,38 @@ func (s *Scalar_expression_in_whereContext) Binary_operator() IBinary_operatorCo return nil } - return t.(IBinary_operatorContext) + return t.(IComparison_operatorContext) +} + +func (s *Scalar_expressionContext) BETWEEN_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBETWEEN_SYMBOL, 0) +} + +func (s *Scalar_expressionContext) AND_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserAND_SYMBOL, 0) +} + +func (s *Scalar_expressionContext) LIKE_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLIKE_SYMBOL, 0) +} + +func (s *Scalar_expressionContext) OR_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserOR_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) QUESTION_MARK_SYMBOL() antlr.TerminalNode { +func (s *Scalar_expressionContext) QUESTION_MARK_SYMBOL() antlr.TerminalNode { return s.GetToken(CosmosDBParserQUESTION_MARK_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) COLON_SYMBOL() antlr.TerminalNode { +func (s *Scalar_expressionContext) COLON_SYMBOL() antlr.TerminalNode { return s.GetToken(CosmosDBParserCOLON_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) DOT_SYMBOL() antlr.TerminalNode { +func (s *Scalar_expressionContext) DOT_SYMBOL() antlr.TerminalNode { return s.GetToken(CosmosDBParserDOT_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) Property_name() IProperty_nameContext { +func (s *Scalar_expressionContext) Property_name() IProperty_nameContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IProperty_nameContext); ok { @@ -2759,19 +3999,23 @@ func (s *Scalar_expression_in_whereContext) Property_name() IProperty_nameContex return t.(IProperty_nameContext) } -func (s *Scalar_expression_in_whereContext) LS_BRACKET_SYMBOL() antlr.TerminalNode { +func (s *Scalar_expressionContext) LS_BRACKET_SYMBOL() antlr.TerminalNode { return s.GetToken(CosmosDBParserLS_BRACKET_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) RS_BRACKET_SYMBOL() antlr.TerminalNode { +func (s *Scalar_expressionContext) RS_BRACKET_SYMBOL() antlr.TerminalNode { return s.GetToken(CosmosDBParserRS_BRACKET_SYMBOL, 0) } -func (s *Scalar_expression_in_whereContext) DOUBLE_QUOTE_STRING_LITERAL() antlr.TerminalNode { +func (s *Scalar_expressionContext) DOUBLE_QUOTE_STRING_LITERAL() antlr.TerminalNode { return s.GetToken(CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL, 0) } -func (s *Scalar_expression_in_whereContext) Array_index() IArray_indexContext { +func (s *Scalar_expressionContext) SINGLE_QUOTE_STRING_LITERAL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserSINGLE_QUOTE_STRING_LITERAL, 0) +} + +func (s *Scalar_expressionContext) Array_index() IArray_indexContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IArray_indexContext); ok { @@ -2787,108 +4031,134 @@ func (s *Scalar_expression_in_whereContext) Array_index() IArray_indexContext { return t.(IArray_indexContext) } -func (s *Scalar_expression_in_whereContext) GetRuleContext() antlr.RuleContext { +func (s *Scalar_expressionContext) IN_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserIN_SYMBOL, 0) +} + +func (s *Scalar_expressionContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { + return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) +} + +func (s *Scalar_expressionContext) COMMA_SYMBOL(i int) antlr.TerminalNode { + return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) +} + +func (s *Scalar_expressionContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Scalar_expression_in_whereContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Scalar_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Scalar_expression_in_whereContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Scalar_expressionContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterScalar_expression_in_where(s) + listenerT.EnterScalar_expression(s) } } -func (s *Scalar_expression_in_whereContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Scalar_expressionContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitScalar_expression_in_where(s) + listenerT.ExitScalar_expression(s) } } -func (s *Scalar_expression_in_whereContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Scalar_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitScalar_expression_in_where(s) + return t.VisitScalar_expression(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Scalar_expression_in_where() (localctx IScalar_expression_in_whereContext) { - return p.scalar_expression_in_where(0) +func (p *CosmosDBParser) Scalar_expression() (localctx IScalar_expressionContext) { + return p.scalar_expression(0) } -func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_expression_in_whereContext) { +func (p *CosmosDBParser) scalar_expression(_p int) (localctx IScalar_expressionContext) { var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() _parentState := p.GetState() - localctx = NewScalar_expression_in_whereContext(p, p.GetParserRuleContext(), _parentState) - var _prevctx IScalar_expression_in_whereContext = localctx + localctx = NewScalar_expressionContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IScalar_expressionContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. - _startState := 28 - p.EnterRecursionRule(localctx, 28, CosmosDBParserRULE_scalar_expression_in_where, _p) + _startState := 40 + p.EnterRecursionRule(localctx, 40, CosmosDBParserRULE_scalar_expression, _p) + var _la int + var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(166) + p.SetState(236) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) { case 1: { - p.SetState(153) + p.SetState(212) p.Constant() } case 2: { - p.SetState(154) + p.SetState(213) p.Input_alias() } case 3: { - p.SetState(155) + p.SetState(214) p.Parameter_name() } case 4: { - p.SetState(156) - p.Unary_operator() - } - { - p.SetState(157) - p.scalar_expression_in_where(7) + p.SetState(215) + p.Scalar_function_expression() } case 5: { - p.SetState(159) - p.Scalar_function_expression() + p.SetState(216) + p.Create_object_expression() } case 6: { - p.SetState(160) - p.Create_object_expression() + p.SetState(217) + p.Create_array_expression() } case 7: { - p.SetState(161) - p.Create_array_expression() + p.SetState(218) + p.Match(CosmosDBParserLR_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(219) + p.scalar_expression(0) + } + { + p.SetState(220) + p.Match(CosmosDBParserRR_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case 8: { - p.SetState(162) + p.SetState(222) p.Match(CosmosDBParserLR_BRACKET_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -2896,11 +4166,41 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } { - p.SetState(163) - p.scalar_expression_in_where(0) + p.SetState(223) + p.Select_() + } + { + p.SetState(224) + p.Match(CosmosDBParserRR_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 9: + { + p.SetState(226) + p.Match(CosmosDBParserEXISTS_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(227) + p.Match(CosmosDBParserLR_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(228) + p.Select_() } { - p.SetState(164) + p.SetState(229) p.Match(CosmosDBParserRR_BRACKET_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -2908,16 +4208,40 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } + case 10: + { + p.SetState(231) + p.Unary_operator() + } + { + p.SetState(232) + p.scalar_expression(16) + } + + case 11: + { + p.SetState(234) + p.Match(CosmosDBParserNOT_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(235) + p.scalar_expression(15) + } + case antlr.ATNInvalidAltNumber: goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(196) + p.SetState(323) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -2927,24 +4251,276 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(194) + p.SetState(321) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) { case 1: - localctx = NewScalar_expression_in_whereContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression_in_where) - p.SetState(168) + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(238) + + if !(p.Precpred(p.GetParserRuleContext(), 14)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 14)", "")) + goto errorExit + } + { + p.SetState(239) + p.Multiplicative_operator() + } + { + p.SetState(240) + p.scalar_expression(15) + } + + case 2: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(242) + + if !(p.Precpred(p.GetParserRuleContext(), 13)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 13)", "")) + goto errorExit + } + { + p.SetState(243) + p.Additive_operator() + } + { + p.SetState(244) + p.scalar_expression(14) + } + + case 3: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(246) + + if !(p.Precpred(p.GetParserRuleContext(), 12)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 12)", "")) + goto errorExit + } + { + p.SetState(247) + p.Shift_operator() + } + { + p.SetState(248) + p.scalar_expression(13) + } + + case 4: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(250) if !(p.Precpred(p.GetParserRuleContext(), 11)) { p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 11)", "")) goto errorExit } { - p.SetState(169) + p.SetState(251) + p.Match(CosmosDBParserBIT_AND_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(252) + p.scalar_expression(12) + } + + case 5: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(253) + + if !(p.Precpred(p.GetParserRuleContext(), 10)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 10)", "")) + goto errorExit + } + { + p.SetState(254) + p.Match(CosmosDBParserBIT_XOR_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(255) + p.scalar_expression(11) + } + + case 6: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(256) + + if !(p.Precpred(p.GetParserRuleContext(), 9)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 9)", "")) + goto errorExit + } + { + p.SetState(257) + p.Match(CosmosDBParserBIT_OR_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(258) + p.scalar_expression(10) + } + + case 7: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(259) + + if !(p.Precpred(p.GetParserRuleContext(), 8)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 8)", "")) + goto errorExit + } + { + p.SetState(260) + p.Match(CosmosDBParserDOUBLE_BAR_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(261) + p.scalar_expression(9) + } + + case 8: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(262) + + if !(p.Precpred(p.GetParserRuleContext(), 7)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) + goto errorExit + } + { + p.SetState(263) + p.Comparison_operator() + } + { + p.SetState(264) + p.scalar_expression(8) + } + + case 9: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(266) + + if !(p.Precpred(p.GetParserRuleContext(), 5)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + goto errorExit + } + p.SetState(268) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserNOT_SYMBOL { + { + p.SetState(267) + p.Match(CosmosDBParserNOT_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(270) + p.Match(CosmosDBParserBETWEEN_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(271) + p.scalar_expression(0) + } + { + p.SetState(272) + p.Match(CosmosDBParserAND_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(273) + p.scalar_expression(6) + } + + case 10: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(275) + + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + goto errorExit + } + p.SetState(277) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserNOT_SYMBOL { + { + p.SetState(276) + p.Match(CosmosDBParserNOT_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(279) + p.Match(CosmosDBParserLIKE_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(280) + p.scalar_expression(5) + } + + case 11: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(281) + + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit + } + { + p.SetState(282) p.Match(CosmosDBParserAND_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -2952,21 +4528,21 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } { - p.SetState(170) - p.scalar_expression_in_where(12) + p.SetState(283) + p.scalar_expression(4) } - case 2: - localctx = NewScalar_expression_in_whereContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression_in_where) - p.SetState(171) + case 12: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(284) - if !(p.Precpred(p.GetParserRuleContext(), 10)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 10)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) goto errorExit } { - p.SetState(172) + p.SetState(285) p.Match(CosmosDBParserOR_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -2974,39 +4550,21 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } { - p.SetState(173) - p.scalar_expression_in_where(11) - } - - case 3: - localctx = NewScalar_expression_in_whereContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression_in_where) - p.SetState(174) - - if !(p.Precpred(p.GetParserRuleContext(), 6)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) - goto errorExit - } - { - p.SetState(175) - p.Binary_operator() - } - { - p.SetState(176) - p.scalar_expression_in_where(7) + p.SetState(286) + p.scalar_expression(3) } - case 4: - localctx = NewScalar_expression_in_whereContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression_in_where) - p.SetState(178) + case 13: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(287) - if !(p.Precpred(p.GetParserRuleContext(), 5)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 1)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) goto errorExit } { - p.SetState(179) + p.SetState(288) p.Match(CosmosDBParserQUESTION_MARK_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -3014,11 +4572,11 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } { - p.SetState(180) - p.scalar_expression_in_where(0) + p.SetState(289) + p.scalar_expression(0) } { - p.SetState(181) + p.SetState(290) p.Match(CosmosDBParserCOLON_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -3026,21 +4584,21 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } { - p.SetState(182) - p.scalar_expression_in_where(6) + p.SetState(291) + p.scalar_expression(2) } - case 5: - localctx = NewScalar_expression_in_whereContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression_in_where) - p.SetState(184) + case 14: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(293) - if !(p.Precpred(p.GetParserRuleContext(), 9)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 9)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 18)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 18)", "")) goto errorExit } { - p.SetState(185) + p.SetState(294) p.Match(CosmosDBParserDOT_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -3048,28 +4606,28 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } { - p.SetState(186) + p.SetState(295) p.Property_name() } - case 6: - localctx = NewScalar_expression_in_whereContext(p, _parentctx, _parentState) - p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression_in_where) - p.SetState(187) + case 15: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(296) - if !(p.Precpred(p.GetParserRuleContext(), 8)) { - p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 8)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 17)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 17)", "")) goto errorExit } { - p.SetState(188) + p.SetState(297) p.Match(CosmosDBParserLS_BRACKET_SYMBOL) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(191) + p.SetState(301) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3078,7 +4636,7 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex switch p.GetTokenStream().LA(1) { case CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL: { - p.SetState(189) + p.SetState(298) p.Match(CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL) if p.HasError() { // Recognition error - abort rule @@ -3086,9 +4644,19 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } + case CosmosDBParserSINGLE_QUOTE_STRING_LITERAL: + { + p.SetState(299) + p.Match(CosmosDBParserSINGLE_QUOTE_STRING_LITERAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + case CosmosDBParserDECIMAL: { - p.SetState(190) + p.SetState(300) p.Array_index() } @@ -3097,7 +4665,7 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex goto errorExit } { - p.SetState(193) + p.SetState(303) p.Match(CosmosDBParserRS_BRACKET_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -3105,18 +4673,328 @@ func (p *CosmosDBParser) scalar_expression_in_where(_p int) (localctx IScalar_ex } } - case antlr.ATNInvalidAltNumber: - goto errorExit - } + case 16: + localctx = NewScalar_expressionContext(p, _parentctx, _parentState) + p.PushNewRecursionContext(localctx, _startState, CosmosDBParserRULE_scalar_expression) + p.SetState(304) + + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) + goto errorExit + } + p.SetState(306) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == CosmosDBParserNOT_SYMBOL { + { + p.SetState(305) + p.Match(CosmosDBParserNOT_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(308) + p.Match(CosmosDBParserIN_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(309) + p.Match(CosmosDBParserLR_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(318) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if (int64((_la-6)) & ^0x3f) == 0 && ((int64(1)<<(_la-6))&9115286608608755263) != 0 { + { + p.SetState(310) + p.scalar_expression(0) + } + p.SetState(315) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == CosmosDBParserCOMMA_SYMBOL { + { + p.SetState(311) + p.Match(CosmosDBParserCOMMA_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(312) + p.scalar_expression(0) + } + + p.SetState(317) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(320) + p.Match(CosmosDBParserRR_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + + } + p.SetState(325) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ICreate_array_expressionContext is an interface to support dynamic dispatch. +type ICreate_array_expressionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + LS_BRACKET_SYMBOL() antlr.TerminalNode + RS_BRACKET_SYMBOL() antlr.TerminalNode + AllScalar_expression() []IScalar_expressionContext + Scalar_expression(i int) IScalar_expressionContext + AllCOMMA_SYMBOL() []antlr.TerminalNode + COMMA_SYMBOL(i int) antlr.TerminalNode + + // IsCreate_array_expressionContext differentiates from other interfaces. + IsCreate_array_expressionContext() +} + +type Create_array_expressionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreate_array_expressionContext() *Create_array_expressionContext { + var p = new(Create_array_expressionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_create_array_expression + return p +} + +func InitEmptyCreate_array_expressionContext(p *Create_array_expressionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_create_array_expression +} + +func (*Create_array_expressionContext) IsCreate_array_expressionContext() {} + +func NewCreate_array_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Create_array_expressionContext { + var p = new(Create_array_expressionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_create_array_expression + + return p +} + +func (s *Create_array_expressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *Create_array_expressionContext) LS_BRACKET_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLS_BRACKET_SYMBOL, 0) +} + +func (s *Create_array_expressionContext) RS_BRACKET_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserRS_BRACKET_SYMBOL, 0) +} + +func (s *Create_array_expressionContext) AllScalar_expression() []IScalar_expressionContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IScalar_expressionContext); ok { + len++ + } + } + + tst := make([]IScalar_expressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IScalar_expressionContext); ok { + tst[i] = t.(IScalar_expressionContext) + i++ + } + } + + return tst +} + +func (s *Create_array_expressionContext) Scalar_expression(i int) IScalar_expressionContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalar_expressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IScalar_expressionContext) +} + +func (s *Create_array_expressionContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { + return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) +} + +func (s *Create_array_expressionContext) COMMA_SYMBOL(i int) antlr.TerminalNode { + return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) +} + +func (s *Create_array_expressionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *Create_array_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *Create_array_expressionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterCreate_array_expression(s) + } +} + +func (s *Create_array_expressionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitCreate_array_expression(s) + } +} + +func (s *Create_array_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitCreate_array_expression(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *CosmosDBParser) Create_array_expression() (localctx ICreate_array_expressionContext) { + localctx = NewCreate_array_expressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 42, CosmosDBParserRULE_create_array_expression) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(326) + p.Match(CosmosDBParserLS_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(335) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + if (int64((_la-6)) & ^0x3f) == 0 && ((int64(1)<<(_la-6))&9115286608608755263) != 0 { + { + p.SetState(327) + p.scalar_expression(0) } - p.SetState(198) + p.SetState(332) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) + _la = p.GetTokenStream().LA(1) + + for _la == CosmosDBParserCOMMA_SYMBOL { + { + p.SetState(328) + p.Match(CosmosDBParserCOMMA_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(329) + p.scalar_expression(0) + } + + p.SetState(334) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(337) + p.Match(CosmosDBParserRS_BRACKET_SYMBOL) if p.HasError() { + // Recognition error - abort rule goto errorExit } } @@ -3129,63 +5007,101 @@ errorExit: p.GetErrorHandler().Recover(p, v) p.SetError(nil) } - p.UnrollRecursionContexts(_parentctx) + p.ExitRule() return localctx goto errorExit // Trick to prevent compiler error if the label is not used } -// ICreate_array_expressionContext is an interface to support dynamic dispatch. -type ICreate_array_expressionContext interface { +// ICreate_object_expressionContext is an interface to support dynamic dispatch. +type ICreate_object_expressionContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Array_constant() IArray_constantContext + LC_BRACKET_SYMBOL() antlr.TerminalNode + RC_BRACKET_SYMBOL() antlr.TerminalNode + AllObject_field_pair() []IObject_field_pairContext + Object_field_pair(i int) IObject_field_pairContext + AllCOMMA_SYMBOL() []antlr.TerminalNode + COMMA_SYMBOL(i int) antlr.TerminalNode - // IsCreate_array_expressionContext differentiates from other interfaces. - IsCreate_array_expressionContext() + // IsCreate_object_expressionContext differentiates from other interfaces. + IsCreate_object_expressionContext() } -type Create_array_expressionContext struct { +type Create_object_expressionContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyCreate_array_expressionContext() *Create_array_expressionContext { - var p = new(Create_array_expressionContext) +func NewEmptyCreate_object_expressionContext() *Create_object_expressionContext { + var p = new(Create_object_expressionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_create_array_expression + p.RuleIndex = CosmosDBParserRULE_create_object_expression return p } -func InitEmptyCreate_array_expressionContext(p *Create_array_expressionContext) { +func InitEmptyCreate_object_expressionContext(p *Create_object_expressionContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_create_array_expression + p.RuleIndex = CosmosDBParserRULE_create_object_expression } -func (*Create_array_expressionContext) IsCreate_array_expressionContext() {} +func (*Create_object_expressionContext) IsCreate_object_expressionContext() {} -func NewCreate_array_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Create_array_expressionContext { - var p = new(Create_array_expressionContext) +func NewCreate_object_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Create_object_expressionContext { + var p = new(Create_object_expressionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_create_array_expression + p.RuleIndex = CosmosDBParserRULE_create_object_expression return p } -func (s *Create_array_expressionContext) GetParser() antlr.Parser { return s.parser } +func (s *Create_object_expressionContext) GetParser() antlr.Parser { return s.parser } + +func (s *Create_object_expressionContext) LC_BRACKET_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLC_BRACKET_SYMBOL, 0) +} + +func (s *Create_object_expressionContext) RC_BRACKET_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserRC_BRACKET_SYMBOL, 0) +} + +func (s *Create_object_expressionContext) AllObject_field_pair() []IObject_field_pairContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IObject_field_pairContext); ok { + len++ + } + } + + tst := make([]IObject_field_pairContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IObject_field_pairContext); ok { + tst[i] = t.(IObject_field_pairContext) + i++ + } + } -func (s *Create_array_expressionContext) Array_constant() IArray_constantContext { + return tst +} + +func (s *Create_object_expressionContext) Object_field_pair(i int) IObject_field_pairContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArray_constantContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(IObject_field_pairContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -3193,46 +5109,110 @@ func (s *Create_array_expressionContext) Array_constant() IArray_constantContext return nil } - return t.(IArray_constantContext) + return t.(IObject_field_pairContext) } -func (s *Create_array_expressionContext) GetRuleContext() antlr.RuleContext { +func (s *Create_object_expressionContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { + return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) +} + +func (s *Create_object_expressionContext) COMMA_SYMBOL(i int) antlr.TerminalNode { + return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) +} + +func (s *Create_object_expressionContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Create_array_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Create_object_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Create_array_expressionContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Create_object_expressionContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterCreate_array_expression(s) + listenerT.EnterCreate_object_expression(s) } } -func (s *Create_array_expressionContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Create_object_expressionContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitCreate_array_expression(s) + listenerT.ExitCreate_object_expression(s) } } -func (s *Create_array_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Create_object_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitCreate_array_expression(s) + return t.VisitCreate_object_expression(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Create_array_expression() (localctx ICreate_array_expressionContext) { - localctx = NewCreate_array_expressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 30, CosmosDBParserRULE_create_array_expression) +func (p *CosmosDBParser) Create_object_expression() (localctx ICreate_object_expressionContext) { + localctx = NewCreate_object_expressionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 44, CosmosDBParserRULE_create_object_expression) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(199) - p.Array_constant() + p.SetState(339) + p.Match(CosmosDBParserLC_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(348) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if (int64((_la-15)) & ^0x3f) == 0 && ((int64(1)<<(_la-15))&13581167626321919) != 0 { + { + p.SetState(340) + p.Object_field_pair() + } + p.SetState(345) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == CosmosDBParserCOMMA_SYMBOL { + { + p.SetState(341) + p.Match(CosmosDBParserCOMMA_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(342) + p.Object_field_pair() + } + + p.SetState(347) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(350) + p.Match(CosmosDBParserRC_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } errorExit: @@ -3248,56 +5228,63 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ICreate_object_expressionContext is an interface to support dynamic dispatch. -type ICreate_object_expressionContext interface { +// IObject_field_pairContext is an interface to support dynamic dispatch. +type IObject_field_pairContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Object_constant() IObject_constantContext + COLON_SYMBOL() antlr.TerminalNode + Scalar_expression() IScalar_expressionContext + String_literal() IString_literalContext + Property_name() IProperty_nameContext - // IsCreate_object_expressionContext differentiates from other interfaces. - IsCreate_object_expressionContext() + // IsObject_field_pairContext differentiates from other interfaces. + IsObject_field_pairContext() } -type Create_object_expressionContext struct { +type Object_field_pairContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyCreate_object_expressionContext() *Create_object_expressionContext { - var p = new(Create_object_expressionContext) +func NewEmptyObject_field_pairContext() *Object_field_pairContext { + var p = new(Object_field_pairContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_create_object_expression + p.RuleIndex = CosmosDBParserRULE_object_field_pair return p } -func InitEmptyCreate_object_expressionContext(p *Create_object_expressionContext) { +func InitEmptyObject_field_pairContext(p *Object_field_pairContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_create_object_expression + p.RuleIndex = CosmosDBParserRULE_object_field_pair } -func (*Create_object_expressionContext) IsCreate_object_expressionContext() {} +func (*Object_field_pairContext) IsObject_field_pairContext() {} -func NewCreate_object_expressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Create_object_expressionContext { - var p = new(Create_object_expressionContext) +func NewObject_field_pairContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Object_field_pairContext { + var p = new(Object_field_pairContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_create_object_expression + p.RuleIndex = CosmosDBParserRULE_object_field_pair return p } -func (s *Create_object_expressionContext) GetParser() antlr.Parser { return s.parser } +func (s *Object_field_pairContext) GetParser() antlr.Parser { return s.parser } + +func (s *Object_field_pairContext) COLON_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserCOLON_SYMBOL, 0) +} -func (s *Create_object_expressionContext) Object_constant() IObject_constantContext { +func (s *Object_field_pairContext) Scalar_expression() IScalar_expressionContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IObject_constantContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3307,46 +5294,109 @@ func (s *Create_object_expressionContext) Object_constant() IObject_constantCont return nil } - return t.(IObject_constantContext) + return t.(IScalar_expressionContext) } -func (s *Create_object_expressionContext) GetRuleContext() antlr.RuleContext { +func (s *Object_field_pairContext) String_literal() IString_literalContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IString_literalContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IString_literalContext) +} + +func (s *Object_field_pairContext) Property_name() IProperty_nameContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IProperty_nameContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IProperty_nameContext) +} + +func (s *Object_field_pairContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Create_object_expressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Object_field_pairContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Create_object_expressionContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Object_field_pairContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterCreate_object_expression(s) + listenerT.EnterObject_field_pair(s) } } -func (s *Create_object_expressionContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Object_field_pairContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitCreate_object_expression(s) + listenerT.ExitObject_field_pair(s) } } -func (s *Create_object_expressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Object_field_pairContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitCreate_object_expression(s) + return t.VisitObject_field_pair(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *CosmosDBParser) Object_field_pair() (localctx IObject_field_pairContext) { + localctx = NewObject_field_pairContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 46, CosmosDBParserRULE_object_field_pair) + p.EnterOuterAlt(localctx, 1) + p.SetState(354) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case CosmosDBParserSINGLE_QUOTE_STRING_LITERAL, CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL: + { + p.SetState(352) + p.String_literal() + } + + case CosmosDBParserIN_SYMBOL, CosmosDBParserBETWEEN_SYMBOL, CosmosDBParserTOP_SYMBOL, CosmosDBParserVALUE_SYMBOL, CosmosDBParserORDER_SYMBOL, CosmosDBParserBY_SYMBOL, CosmosDBParserGROUP_SYMBOL, CosmosDBParserOFFSET_SYMBOL, CosmosDBParserLIMIT_SYMBOL, CosmosDBParserASC_SYMBOL, CosmosDBParserDESC_SYMBOL, CosmosDBParserEXISTS_SYMBOL, CosmosDBParserLIKE_SYMBOL, CosmosDBParserHAVING_SYMBOL, CosmosDBParserJOIN_SYMBOL, CosmosDBParserIDENTIFIER: + { + p.SetState(353) + p.Property_name() + } default: - return t.VisitChildren(s) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } -} - -func (p *CosmosDBParser) Create_object_expression() (localctx ICreate_object_expressionContext) { - localctx = NewCreate_object_expressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, CosmosDBParserRULE_create_object_expression) - p.EnterOuterAlt(localctx, 1) { - p.SetState(201) - p.Object_constant() + p.SetState(356) + p.Match(CosmosDBParserCOLON_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(357) + p.scalar_expression(0) } errorExit: @@ -3473,8 +5523,8 @@ func (s *Scalar_function_expressionContext) Accept(visitor antlr.ParseTreeVisito func (p *CosmosDBParser) Scalar_function_expression() (localctx IScalar_function_expressionContext) { localctx = NewScalar_function_expressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 34, CosmosDBParserRULE_scalar_function_expression) - p.SetState(205) + p.EnterRule(localctx, 48, CosmosDBParserRULE_scalar_function_expression) + p.SetState(361) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3484,14 +5534,14 @@ func (p *CosmosDBParser) Scalar_function_expression() (localctx IScalar_function case CosmosDBParserUDF_SYMBOL: p.EnterOuterAlt(localctx, 1) { - p.SetState(203) + p.SetState(359) p.Udf_scalar_function_expression() } - case CosmosDBParserIDENTIFIER: + case CosmosDBParserIN_SYMBOL, CosmosDBParserBETWEEN_SYMBOL, CosmosDBParserTOP_SYMBOL, CosmosDBParserVALUE_SYMBOL, CosmosDBParserORDER_SYMBOL, CosmosDBParserBY_SYMBOL, CosmosDBParserGROUP_SYMBOL, CosmosDBParserOFFSET_SYMBOL, CosmosDBParserLIMIT_SYMBOL, CosmosDBParserASC_SYMBOL, CosmosDBParserDESC_SYMBOL, CosmosDBParserEXISTS_SYMBOL, CosmosDBParserLIKE_SYMBOL, CosmosDBParserHAVING_SYMBOL, CosmosDBParserJOIN_SYMBOL, CosmosDBParserIDENTIFIER: p.EnterOuterAlt(localctx, 2) { - p.SetState(204) + p.SetState(360) p.Builtin_function_expression() } @@ -3523,11 +5573,11 @@ type IUdf_scalar_function_expressionContext interface { // Getter signatures UDF_SYMBOL() antlr.TerminalNode DOT_SYMBOL() antlr.TerminalNode - IDENTIFIER() antlr.TerminalNode + Identifier() IIdentifierContext LR_BRACKET_SYMBOL() antlr.TerminalNode RR_BRACKET_SYMBOL() antlr.TerminalNode - AllScalar_expression_in_where() []IScalar_expression_in_whereContext - Scalar_expression_in_where(i int) IScalar_expression_in_whereContext + AllScalar_expression() []IScalar_expressionContext + Scalar_expression(i int) IScalar_expressionContext AllCOMMA_SYMBOL() []antlr.TerminalNode COMMA_SYMBOL(i int) antlr.TerminalNode @@ -3575,8 +5625,20 @@ func (s *Udf_scalar_function_expressionContext) DOT_SYMBOL() antlr.TerminalNode return s.GetToken(CosmosDBParserDOT_SYMBOL, 0) } -func (s *Udf_scalar_function_expressionContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CosmosDBParserIDENTIFIER, 0) +func (s *Udf_scalar_function_expressionContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) } func (s *Udf_scalar_function_expressionContext) LR_BRACKET_SYMBOL() antlr.TerminalNode { @@ -3587,20 +5649,20 @@ func (s *Udf_scalar_function_expressionContext) RR_BRACKET_SYMBOL() antlr.Termin return s.GetToken(CosmosDBParserRR_BRACKET_SYMBOL, 0) } -func (s *Udf_scalar_function_expressionContext) AllScalar_expression_in_where() []IScalar_expression_in_whereContext { +func (s *Udf_scalar_function_expressionContext) AllScalar_expression() []IScalar_expressionContext { children := s.GetChildren() len := 0 for _, ctx := range children { - if _, ok := ctx.(IScalar_expression_in_whereContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { len++ } } - tst := make([]IScalar_expression_in_whereContext, len) + tst := make([]IScalar_expressionContext, len) i := 0 for _, ctx := range children { - if t, ok := ctx.(IScalar_expression_in_whereContext); ok { - tst[i] = t.(IScalar_expression_in_whereContext) + if t, ok := ctx.(IScalar_expressionContext); ok { + tst[i] = t.(IScalar_expressionContext) i++ } } @@ -3608,11 +5670,11 @@ func (s *Udf_scalar_function_expressionContext) AllScalar_expression_in_where() return tst } -func (s *Udf_scalar_function_expressionContext) Scalar_expression_in_where(i int) IScalar_expression_in_whereContext { +func (s *Udf_scalar_function_expressionContext) Scalar_expression(i int) IScalar_expressionContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IScalar_expression_in_whereContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { if j == i { t = ctx.(antlr.RuleContext) break @@ -3625,7 +5687,7 @@ func (s *Udf_scalar_function_expressionContext) Scalar_expression_in_where(i int return nil } - return t.(IScalar_expression_in_whereContext) + return t.(IScalar_expressionContext) } func (s *Udf_scalar_function_expressionContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { @@ -3668,12 +5730,12 @@ func (s *Udf_scalar_function_expressionContext) Accept(visitor antlr.ParseTreeVi func (p *CosmosDBParser) Udf_scalar_function_expression() (localctx IUdf_scalar_function_expressionContext) { localctx = NewUdf_scalar_function_expressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, CosmosDBParserRULE_udf_scalar_function_expression) + p.EnterRule(localctx, 50, CosmosDBParserRULE_udf_scalar_function_expression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(207) + p.SetState(363) p.Match(CosmosDBParserUDF_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -3681,7 +5743,7 @@ func (p *CosmosDBParser) Udf_scalar_function_expression() (localctx IUdf_scalar_ } } { - p.SetState(208) + p.SetState(364) p.Match(CosmosDBParserDOT_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -3689,57 +5751,61 @@ func (p *CosmosDBParser) Udf_scalar_function_expression() (localctx IUdf_scalar_ } } { - p.SetState(209) - p.Match(CosmosDBParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(365) + p.Identifier() } { - p.SetState(210) + p.SetState(366) p.Match(CosmosDBParserLR_BRACKET_SYMBOL) if p.HasError() { // Recognition error - abort rule goto errorExit } } - - { - p.SetState(211) - p.scalar_expression_in_where(0) - } - p.SetState(216) + p.SetState(375) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for _la == CosmosDBParserCOMMA_SYMBOL { - { - p.SetState(212) - p.Match(CosmosDBParserCOMMA_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + if (int64((_la-6)) & ^0x3f) == 0 && ((int64(1)<<(_la-6))&9115286608608755263) != 0 { { - p.SetState(213) - p.scalar_expression_in_where(0) + p.SetState(367) + p.scalar_expression(0) } - - p.SetState(218) + p.SetState(372) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - } + for _la == CosmosDBParserCOMMA_SYMBOL { + { + p.SetState(368) + p.Match(CosmosDBParserCOMMA_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(369) + p.scalar_expression(0) + } + + p.SetState(374) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } { - p.SetState(219) + p.SetState(377) p.Match(CosmosDBParserRR_BRACKET_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -3768,11 +5834,12 @@ type IBuiltin_function_expressionContext interface { GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode + Identifier() IIdentifierContext LR_BRACKET_SYMBOL() antlr.TerminalNode RR_BRACKET_SYMBOL() antlr.TerminalNode - AllScalar_expression_in_where() []IScalar_expression_in_whereContext - Scalar_expression_in_where(i int) IScalar_expression_in_whereContext + MULTIPLY_OPERATOR() antlr.TerminalNode + AllScalar_expression() []IScalar_expressionContext + Scalar_expression(i int) IScalar_expressionContext AllCOMMA_SYMBOL() []antlr.TerminalNode COMMA_SYMBOL(i int) antlr.TerminalNode @@ -3812,8 +5879,20 @@ func NewBuiltin_function_expressionContext(parser antlr.Parser, parent antlr.Par func (s *Builtin_function_expressionContext) GetParser() antlr.Parser { return s.parser } -func (s *Builtin_function_expressionContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CosmosDBParserIDENTIFIER, 0) +func (s *Builtin_function_expressionContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) } func (s *Builtin_function_expressionContext) LR_BRACKET_SYMBOL() antlr.TerminalNode { @@ -3824,20 +5903,24 @@ func (s *Builtin_function_expressionContext) RR_BRACKET_SYMBOL() antlr.TerminalN return s.GetToken(CosmosDBParserRR_BRACKET_SYMBOL, 0) } -func (s *Builtin_function_expressionContext) AllScalar_expression_in_where() []IScalar_expression_in_whereContext { +func (s *Builtin_function_expressionContext) MULTIPLY_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserMULTIPLY_OPERATOR, 0) +} + +func (s *Builtin_function_expressionContext) AllScalar_expression() []IScalar_expressionContext { children := s.GetChildren() len := 0 for _, ctx := range children { - if _, ok := ctx.(IScalar_expression_in_whereContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { len++ } } - tst := make([]IScalar_expression_in_whereContext, len) + tst := make([]IScalar_expressionContext, len) i := 0 for _, ctx := range children { - if t, ok := ctx.(IScalar_expression_in_whereContext); ok { - tst[i] = t.(IScalar_expression_in_whereContext) + if t, ok := ctx.(IScalar_expressionContext); ok { + tst[i] = t.(IScalar_expressionContext) i++ } } @@ -3845,11 +5928,11 @@ func (s *Builtin_function_expressionContext) AllScalar_expression_in_where() []I return tst } -func (s *Builtin_function_expressionContext) Scalar_expression_in_where(i int) IScalar_expression_in_whereContext { +func (s *Builtin_function_expressionContext) Scalar_expression(i int) IScalar_expressionContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IScalar_expression_in_whereContext); ok { + if _, ok := ctx.(IScalar_expressionContext); ok { if j == i { t = ctx.(antlr.RuleContext) break @@ -3862,7 +5945,7 @@ func (s *Builtin_function_expressionContext) Scalar_expression_in_where(i int) I return nil } - return t.(IScalar_expression_in_whereContext) + return t.(IScalar_expressionContext) } func (s *Builtin_function_expressionContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { @@ -3905,257 +5988,93 @@ func (s *Builtin_function_expressionContext) Accept(visitor antlr.ParseTreeVisit func (p *CosmosDBParser) Builtin_function_expression() (localctx IBuiltin_function_expressionContext) { localctx = NewBuiltin_function_expressionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, CosmosDBParserRULE_builtin_function_expression) + p.EnterRule(localctx, 52, CosmosDBParserRULE_builtin_function_expression) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(221) - p.Match(CosmosDBParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(379) + p.Identifier() } { - p.SetState(222) + p.SetState(380) p.Match(CosmosDBParserLR_BRACKET_SYMBOL) if p.HasError() { // Recognition error - abort rule goto errorExit } } - - { - p.SetState(223) - p.scalar_expression_in_where(0) - } - p.SetState(228) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == CosmosDBParserCOMMA_SYMBOL { - { - p.SetState(224) - p.Match(CosmosDBParserCOMMA_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(225) - p.scalar_expression_in_where(0) - } - - p.SetState(230) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - - { - p.SetState(231) - p.Match(CosmosDBParserRR_BRACKET_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IBinary_operatorContext is an interface to support dynamic dispatch. -type IBinary_operatorContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // Getter signatures - MULTIPLY_OPERATOR() antlr.TerminalNode - DIVIDE_SYMBOL() antlr.TerminalNode - MODULO_SYMBOL() antlr.TerminalNode - PLUS_SYMBOL() antlr.TerminalNode - MINUS_SYMBOL() antlr.TerminalNode - BIT_AND_SYMBOL() antlr.TerminalNode - BIT_XOR_SYMBOL() antlr.TerminalNode - BIT_OR_SYMBOL() antlr.TerminalNode - DOUBLE_BAR_SYMBOL() antlr.TerminalNode - EQUAL_SYMBOL() antlr.TerminalNode - LESS_THAN_OPERATOR() antlr.TerminalNode - LESS_THAN_EQUAL_OPERATOR() antlr.TerminalNode - GREATER_THAN_OPERATOR() antlr.TerminalNode - GREATER_THAN_EQUAL_OPERATOR() antlr.TerminalNode - LEFT_SHIFT_OPERATOR() antlr.TerminalNode - RIGHT_SHIFT_OPERATOR() antlr.TerminalNode - ZERO_FILL_RIGHT_SHIFT_OPERATOR() antlr.TerminalNode - - // IsBinary_operatorContext differentiates from other interfaces. - IsBinary_operatorContext() -} - -type Binary_operatorContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyBinary_operatorContext() *Binary_operatorContext { - var p = new(Binary_operatorContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_binary_operator - return p -} - -func InitEmptyBinary_operatorContext(p *Binary_operatorContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_binary_operator -} - -func (*Binary_operatorContext) IsBinary_operatorContext() {} - -func NewBinary_operatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Binary_operatorContext { - var p = new(Binary_operatorContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CosmosDBParserRULE_binary_operator - - return p -} - -func (s *Binary_operatorContext) GetParser() antlr.Parser { return s.parser } - -func (s *Binary_operatorContext) MULTIPLY_OPERATOR() antlr.TerminalNode { - return s.GetToken(CosmosDBParserMULTIPLY_OPERATOR, 0) -} - -func (s *Binary_operatorContext) DIVIDE_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserDIVIDE_SYMBOL, 0) -} - -func (s *Binary_operatorContext) MODULO_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserMODULO_SYMBOL, 0) -} - -func (s *Binary_operatorContext) PLUS_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserPLUS_SYMBOL, 0) -} - -func (s *Binary_operatorContext) MINUS_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserMINUS_SYMBOL, 0) -} - -func (s *Binary_operatorContext) BIT_AND_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserBIT_AND_SYMBOL, 0) -} - -func (s *Binary_operatorContext) BIT_XOR_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserBIT_XOR_SYMBOL, 0) -} - -func (s *Binary_operatorContext) BIT_OR_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserBIT_OR_SYMBOL, 0) -} - -func (s *Binary_operatorContext) DOUBLE_BAR_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserDOUBLE_BAR_SYMBOL, 0) -} - -func (s *Binary_operatorContext) EQUAL_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserEQUAL_SYMBOL, 0) -} - -func (s *Binary_operatorContext) LESS_THAN_OPERATOR() antlr.TerminalNode { - return s.GetToken(CosmosDBParserLESS_THAN_OPERATOR, 0) -} - -func (s *Binary_operatorContext) LESS_THAN_EQUAL_OPERATOR() antlr.TerminalNode { - return s.GetToken(CosmosDBParserLESS_THAN_EQUAL_OPERATOR, 0) -} - -func (s *Binary_operatorContext) GREATER_THAN_OPERATOR() antlr.TerminalNode { - return s.GetToken(CosmosDBParserGREATER_THAN_OPERATOR, 0) -} - -func (s *Binary_operatorContext) GREATER_THAN_EQUAL_OPERATOR() antlr.TerminalNode { - return s.GetToken(CosmosDBParserGREATER_THAN_EQUAL_OPERATOR, 0) -} - -func (s *Binary_operatorContext) LEFT_SHIFT_OPERATOR() antlr.TerminalNode { - return s.GetToken(CosmosDBParserLEFT_SHIFT_OPERATOR, 0) -} - -func (s *Binary_operatorContext) RIGHT_SHIFT_OPERATOR() antlr.TerminalNode { - return s.GetToken(CosmosDBParserRIGHT_SHIFT_OPERATOR, 0) -} - -func (s *Binary_operatorContext) ZERO_FILL_RIGHT_SHIFT_OPERATOR() antlr.TerminalNode { - return s.GetToken(CosmosDBParserZERO_FILL_RIGHT_SHIFT_OPERATOR, 0) -} - -func (s *Binary_operatorContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *Binary_operatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} - -func (s *Binary_operatorContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterBinary_operator(s) - } -} - -func (s *Binary_operatorContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitBinary_operator(s) + p.SetState(392) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } -} + _la = p.GetTokenStream().LA(1) -func (s *Binary_operatorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case CosmosDBParserVisitor: - return t.VisitBinary_operator(s) + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&-6917467407745314878) != 0) || ((int64((_la-64)) & ^0x3f) == 0 && ((int64(1)<<(_la-64))&31) != 0) { + p.SetState(383) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } - default: - return t.VisitChildren(s) - } -} + switch p.GetTokenStream().LA(1) { + case CosmosDBParserMULTIPLY_OPERATOR: + { + p.SetState(381) + p.Match(CosmosDBParserMULTIPLY_OPERATOR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (p *CosmosDBParser) Binary_operator() (localctx IBinary_operatorContext) { - localctx = NewBinary_operatorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, CosmosDBParserRULE_binary_operator) - var _la int + case CosmosDBParserUNDEFINED_SYMBOL, CosmosDBParserNULL_SYMBOL, CosmosDBParserFALSE_SYMBOL, CosmosDBParserTRUE_SYMBOL, CosmosDBParserNOT_SYMBOL, CosmosDBParserUDF_SYMBOL, CosmosDBParserIN_SYMBOL, CosmosDBParserBETWEEN_SYMBOL, CosmosDBParserTOP_SYMBOL, CosmosDBParserVALUE_SYMBOL, CosmosDBParserORDER_SYMBOL, CosmosDBParserBY_SYMBOL, CosmosDBParserGROUP_SYMBOL, CosmosDBParserOFFSET_SYMBOL, CosmosDBParserLIMIT_SYMBOL, CosmosDBParserASC_SYMBOL, CosmosDBParserDESC_SYMBOL, CosmosDBParserEXISTS_SYMBOL, CosmosDBParserLIKE_SYMBOL, CosmosDBParserHAVING_SYMBOL, CosmosDBParserJOIN_SYMBOL, CosmosDBParserAT_SYMBOL, CosmosDBParserLC_BRACKET_SYMBOL, CosmosDBParserLS_BRACKET_SYMBOL, CosmosDBParserLR_BRACKET_SYMBOL, CosmosDBParserPLUS_SYMBOL, CosmosDBParserMINUS_SYMBOL, CosmosDBParserBIT_NOT_SYMBOL, CosmosDBParserIDENTIFIER, CosmosDBParserDECIMAL, CosmosDBParserREAL, CosmosDBParserFLOAT, CosmosDBParserHEXADECIMAL, CosmosDBParserSINGLE_QUOTE_STRING_LITERAL, CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL: + { + p.SetState(382) + p.scalar_expression(0) + } - p.EnterOuterAlt(localctx, 1) - { - p.SetState(233) + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + p.SetState(389) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&35183029911554) != 0) { - p.GetErrorHandler().RecoverInline(p) - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() + for _la == CosmosDBParserCOMMA_SYMBOL { + { + p.SetState(385) + p.Match(CosmosDBParserCOMMA_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(386) + p.scalar_expression(0) + } + + p.SetState(391) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(394) + p.Match(CosmosDBParserRR_BRACKET_SYMBOL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } @@ -4172,107 +6091,107 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IUnary_operatorContext is an interface to support dynamic dispatch. -type IUnary_operatorContext interface { +// IMultiplicative_operatorContext is an interface to support dynamic dispatch. +type IMultiplicative_operatorContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - BIT_NOT_SYMBOL() antlr.TerminalNode - PLUS_SYMBOL() antlr.TerminalNode - MINUS_SYMBOL() antlr.TerminalNode + MULTIPLY_OPERATOR() antlr.TerminalNode + DIVIDE_SYMBOL() antlr.TerminalNode + MODULO_SYMBOL() antlr.TerminalNode - // IsUnary_operatorContext differentiates from other interfaces. - IsUnary_operatorContext() + // IsMultiplicative_operatorContext differentiates from other interfaces. + IsMultiplicative_operatorContext() } -type Unary_operatorContext struct { +type Multiplicative_operatorContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyUnary_operatorContext() *Unary_operatorContext { - var p = new(Unary_operatorContext) +func NewEmptyMultiplicative_operatorContext() *Multiplicative_operatorContext { + var p = new(Multiplicative_operatorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_unary_operator + p.RuleIndex = CosmosDBParserRULE_multiplicative_operator return p } -func InitEmptyUnary_operatorContext(p *Unary_operatorContext) { +func InitEmptyMultiplicative_operatorContext(p *Multiplicative_operatorContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_unary_operator + p.RuleIndex = CosmosDBParserRULE_multiplicative_operator } -func (*Unary_operatorContext) IsUnary_operatorContext() {} +func (*Multiplicative_operatorContext) IsMultiplicative_operatorContext() {} -func NewUnary_operatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Unary_operatorContext { - var p = new(Unary_operatorContext) +func NewMultiplicative_operatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Multiplicative_operatorContext { + var p = new(Multiplicative_operatorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_unary_operator + p.RuleIndex = CosmosDBParserRULE_multiplicative_operator return p } -func (s *Unary_operatorContext) GetParser() antlr.Parser { return s.parser } +func (s *Multiplicative_operatorContext) GetParser() antlr.Parser { return s.parser } -func (s *Unary_operatorContext) BIT_NOT_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserBIT_NOT_SYMBOL, 0) +func (s *Multiplicative_operatorContext) MULTIPLY_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserMULTIPLY_OPERATOR, 0) } -func (s *Unary_operatorContext) PLUS_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserPLUS_SYMBOL, 0) +func (s *Multiplicative_operatorContext) DIVIDE_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserDIVIDE_SYMBOL, 0) } -func (s *Unary_operatorContext) MINUS_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserMINUS_SYMBOL, 0) +func (s *Multiplicative_operatorContext) MODULO_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserMODULO_SYMBOL, 0) } -func (s *Unary_operatorContext) GetRuleContext() antlr.RuleContext { +func (s *Multiplicative_operatorContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Unary_operatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Multiplicative_operatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Unary_operatorContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Multiplicative_operatorContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterUnary_operator(s) + listenerT.EnterMultiplicative_operator(s) } } -func (s *Unary_operatorContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Multiplicative_operatorContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitUnary_operator(s) + listenerT.ExitMultiplicative_operator(s) } } -func (s *Unary_operatorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Multiplicative_operatorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitUnary_operator(s) + return t.VisitMultiplicative_operator(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Unary_operator() (localctx IUnary_operatorContext) { - localctx = NewUnary_operatorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 42, CosmosDBParserRULE_unary_operator) +func (p *CosmosDBParser) Multiplicative_operator() (localctx IMultiplicative_operatorContext) { + localctx = NewMultiplicative_operatorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 54, CosmosDBParserRULE_multiplicative_operator) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(235) + p.SetState(396) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1879048192) != 0) { + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&211106232532994) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -4293,109 +6212,106 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IParameter_nameContext is an interface to support dynamic dispatch. -type IParameter_nameContext interface { +// IAdditive_operatorContext is an interface to support dynamic dispatch. +type IAdditive_operatorContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AT_SYMBOL() antlr.TerminalNode - IDENTIFIER() antlr.TerminalNode + PLUS_SYMBOL() antlr.TerminalNode + MINUS_SYMBOL() antlr.TerminalNode - // IsParameter_nameContext differentiates from other interfaces. - IsParameter_nameContext() + // IsAdditive_operatorContext differentiates from other interfaces. + IsAdditive_operatorContext() } -type Parameter_nameContext struct { +type Additive_operatorContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyParameter_nameContext() *Parameter_nameContext { - var p = new(Parameter_nameContext) +func NewEmptyAdditive_operatorContext() *Additive_operatorContext { + var p = new(Additive_operatorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_parameter_name + p.RuleIndex = CosmosDBParserRULE_additive_operator return p } -func InitEmptyParameter_nameContext(p *Parameter_nameContext) { +func InitEmptyAdditive_operatorContext(p *Additive_operatorContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_parameter_name + p.RuleIndex = CosmosDBParserRULE_additive_operator } -func (*Parameter_nameContext) IsParameter_nameContext() {} +func (*Additive_operatorContext) IsAdditive_operatorContext() {} -func NewParameter_nameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Parameter_nameContext { - var p = new(Parameter_nameContext) +func NewAdditive_operatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Additive_operatorContext { + var p = new(Additive_operatorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_parameter_name + p.RuleIndex = CosmosDBParserRULE_additive_operator return p } -func (s *Parameter_nameContext) GetParser() antlr.Parser { return s.parser } +func (s *Additive_operatorContext) GetParser() antlr.Parser { return s.parser } -func (s *Parameter_nameContext) AT_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserAT_SYMBOL, 0) +func (s *Additive_operatorContext) PLUS_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserPLUS_SYMBOL, 0) } -func (s *Parameter_nameContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CosmosDBParserIDENTIFIER, 0) +func (s *Additive_operatorContext) MINUS_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserMINUS_SYMBOL, 0) } -func (s *Parameter_nameContext) GetRuleContext() antlr.RuleContext { +func (s *Additive_operatorContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Parameter_nameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Additive_operatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Parameter_nameContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Additive_operatorContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterParameter_name(s) + listenerT.EnterAdditive_operator(s) } } -func (s *Parameter_nameContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Additive_operatorContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitParameter_name(s) + listenerT.ExitAdditive_operator(s) } } -func (s *Parameter_nameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Additive_operatorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitParameter_name(s) + return t.VisitAdditive_operator(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Parameter_name() (localctx IParameter_nameContext) { - localctx = NewParameter_nameContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 44, CosmosDBParserRULE_parameter_name) +func (p *CosmosDBParser) Additive_operator() (localctx IAdditive_operatorContext) { + localctx = NewAdditive_operatorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 56, CosmosDBParserRULE_additive_operator) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(237) - p.Match(CosmosDBParserAT_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(238) - p.Match(CosmosDBParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + p.SetState(398) + _la = p.GetTokenStream().LA(1) + + if !(_la == CosmosDBParserPLUS_SYMBOL || _la == CosmosDBParserMINUS_SYMBOL) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() } } @@ -4407,267 +6323,117 @@ errorExit: p.GetErrorHandler().Recover(p, v) p.SetError(nil) } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// IConstantContext is an interface to support dynamic dispatch. -type IConstantContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // Getter signatures - Undefined_constant() IUndefined_constantContext - Null_constant() INull_constantContext - Boolean_constant() IBoolean_constantContext - Number_constant() INumber_constantContext - String_constant() IString_constantContext - Array_constant() IArray_constantContext - Object_constant() IObject_constantContext - - // IsConstantContext differentiates from other interfaces. - IsConstantContext() -} - -type ConstantContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyConstantContext() *ConstantContext { - var p = new(ConstantContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_constant - return p -} - -func InitEmptyConstantContext(p *ConstantContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_constant -} - -func (*ConstantContext) IsConstantContext() {} - -func NewConstantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstantContext { - var p = new(ConstantContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = CosmosDBParserRULE_constant - - return p -} - -func (s *ConstantContext) GetParser() antlr.Parser { return s.parser } - -func (s *ConstantContext) Undefined_constant() IUndefined_constantContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IUndefined_constantContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IUndefined_constantContext) -} - -func (s *ConstantContext) Null_constant() INull_constantContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(INull_constantContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(INull_constantContext) -} - -func (s *ConstantContext) Boolean_constant() IBoolean_constantContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IBoolean_constantContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IBoolean_constantContext) + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } -func (s *ConstantContext) Number_constant() INumber_constantContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(INumber_constantContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +// IShift_operatorContext is an interface to support dynamic dispatch. +type IShift_operatorContext interface { + antlr.ParserRuleContext - if t == nil { - return nil - } + // GetParser returns the parser. + GetParser() antlr.Parser - return t.(INumber_constantContext) + // Getter signatures + LEFT_SHIFT_OPERATOR() antlr.TerminalNode + RIGHT_SHIFT_OPERATOR() antlr.TerminalNode + ZERO_FILL_RIGHT_SHIFT_OPERATOR() antlr.TerminalNode + + // IsShift_operatorContext differentiates from other interfaces. + IsShift_operatorContext() } -func (s *ConstantContext) String_constant() IString_constantContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IString_constantContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +type Shift_operatorContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} - if t == nil { - return nil - } +func NewEmptyShift_operatorContext() *Shift_operatorContext { + var p = new(Shift_operatorContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_shift_operator + return p +} - return t.(IString_constantContext) +func InitEmptyShift_operatorContext(p *Shift_operatorContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_shift_operator } -func (s *ConstantContext) Array_constant() IArray_constantContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArray_constantContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (*Shift_operatorContext) IsShift_operatorContext() {} - if t == nil { - return nil - } +func NewShift_operatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Shift_operatorContext { + var p = new(Shift_operatorContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_shift_operator - return t.(IArray_constantContext) + return p } -func (s *ConstantContext) Object_constant() IObject_constantContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IObject_constantContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *Shift_operatorContext) GetParser() antlr.Parser { return s.parser } - if t == nil { - return nil - } +func (s *Shift_operatorContext) LEFT_SHIFT_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLEFT_SHIFT_OPERATOR, 0) +} + +func (s *Shift_operatorContext) RIGHT_SHIFT_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserRIGHT_SHIFT_OPERATOR, 0) +} - return t.(IObject_constantContext) +func (s *Shift_operatorContext) ZERO_FILL_RIGHT_SHIFT_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserZERO_FILL_RIGHT_SHIFT_OPERATOR, 0) } -func (s *ConstantContext) GetRuleContext() antlr.RuleContext { +func (s *Shift_operatorContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ConstantContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Shift_operatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ConstantContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Shift_operatorContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterConstant(s) + listenerT.EnterShift_operator(s) } } -func (s *ConstantContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Shift_operatorContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitConstant(s) + listenerT.ExitShift_operator(s) } } -func (s *ConstantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Shift_operatorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitConstant(s) + return t.VisitShift_operator(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Constant() (localctx IConstantContext) { - localctx = NewConstantContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 46, CosmosDBParserRULE_constant) - p.SetState(247) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case CosmosDBParserUNDEFINED_SYMBOL: - p.EnterOuterAlt(localctx, 1) - { - p.SetState(240) - p.Undefined_constant() - } - - case CosmosDBParserNULL_SYMBOL: - p.EnterOuterAlt(localctx, 2) - { - p.SetState(241) - p.Null_constant() - } - - case CosmosDBParserFALSE_SYMBOL, CosmosDBParserTRUE_SYMBOL: - p.EnterOuterAlt(localctx, 3) - { - p.SetState(242) - p.Boolean_constant() - } - - case CosmosDBParserDECIMAL, CosmosDBParserREAL, CosmosDBParserFLOAT, CosmosDBParserHEXADECIMAL: - p.EnterOuterAlt(localctx, 4) - { - p.SetState(243) - p.Number_constant() - } - - case CosmosDBParserSINGLE_QUOTE_STRING_LITERAL, CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL: - p.EnterOuterAlt(localctx, 5) - { - p.SetState(244) - p.String_constant() - } +func (p *CosmosDBParser) Shift_operator() (localctx IShift_operatorContext) { + localctx = NewShift_operatorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 58, CosmosDBParserRULE_shift_operator) + var _la int - case CosmosDBParserLS_BRACKET_SYMBOL: - p.EnterOuterAlt(localctx, 6) - { - p.SetState(245) - p.Array_constant() - } + p.EnterOuterAlt(localctx, 1) + { + p.SetState(400) + _la = p.GetTokenStream().LA(1) - case CosmosDBParserLC_BRACKET_SYMBOL: - p.EnterOuterAlt(localctx, 7) - { - p.SetState(246) - p.Object_constant() + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1008806316530991104) != 0) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit } errorExit: @@ -4683,198 +6449,126 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IObject_constantContext is an interface to support dynamic dispatch. -type IObject_constantContext interface { +// IComparison_operatorContext is an interface to support dynamic dispatch. +type IComparison_operatorContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - LC_BRACKET_SYMBOL() antlr.TerminalNode - RC_BRACKET_SYMBOL() antlr.TerminalNode - AllObject_constant_field_pair() []IObject_constant_field_pairContext - Object_constant_field_pair(i int) IObject_constant_field_pairContext - AllCOMMA_SYMBOL() []antlr.TerminalNode - COMMA_SYMBOL(i int) antlr.TerminalNode + EQUAL_SYMBOL() antlr.TerminalNode + NOT_EQUAL_OPERATOR() antlr.TerminalNode + LESS_THAN_OPERATOR() antlr.TerminalNode + LESS_THAN_EQUAL_OPERATOR() antlr.TerminalNode + GREATER_THAN_OPERATOR() antlr.TerminalNode + GREATER_THAN_EQUAL_OPERATOR() antlr.TerminalNode - // IsObject_constantContext differentiates from other interfaces. - IsObject_constantContext() + // IsComparison_operatorContext differentiates from other interfaces. + IsComparison_operatorContext() } -type Object_constantContext struct { +type Comparison_operatorContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyObject_constantContext() *Object_constantContext { - var p = new(Object_constantContext) +func NewEmptyComparison_operatorContext() *Comparison_operatorContext { + var p = new(Comparison_operatorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_object_constant + p.RuleIndex = CosmosDBParserRULE_comparison_operator return p } -func InitEmptyObject_constantContext(p *Object_constantContext) { +func InitEmptyComparison_operatorContext(p *Comparison_operatorContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_object_constant + p.RuleIndex = CosmosDBParserRULE_comparison_operator } -func (*Object_constantContext) IsObject_constantContext() {} +func (*Comparison_operatorContext) IsComparison_operatorContext() {} -func NewObject_constantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Object_constantContext { - var p = new(Object_constantContext) +func NewComparison_operatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Comparison_operatorContext { + var p = new(Comparison_operatorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_object_constant + p.RuleIndex = CosmosDBParserRULE_comparison_operator return p } -func (s *Object_constantContext) GetParser() antlr.Parser { return s.parser } +func (s *Comparison_operatorContext) GetParser() antlr.Parser { return s.parser } -func (s *Object_constantContext) LC_BRACKET_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserLC_BRACKET_SYMBOL, 0) +func (s *Comparison_operatorContext) EQUAL_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserEQUAL_SYMBOL, 0) } -func (s *Object_constantContext) RC_BRACKET_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserRC_BRACKET_SYMBOL, 0) +func (s *Comparison_operatorContext) NOT_EQUAL_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserNOT_EQUAL_OPERATOR, 0) } -func (s *Object_constantContext) AllObject_constant_field_pair() []IObject_constant_field_pairContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IObject_constant_field_pairContext); ok { - len++ - } - } - - tst := make([]IObject_constant_field_pairContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IObject_constant_field_pairContext); ok { - tst[i] = t.(IObject_constant_field_pairContext) - i++ - } - } - - return tst +func (s *Comparison_operatorContext) LESS_THAN_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLESS_THAN_OPERATOR, 0) } -func (s *Object_constantContext) Object_constant_field_pair(i int) IObject_constant_field_pairContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IObject_constant_field_pairContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } - - if t == nil { - return nil - } - - return t.(IObject_constant_field_pairContext) +func (s *Comparison_operatorContext) LESS_THAN_EQUAL_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLESS_THAN_EQUAL_OPERATOR, 0) } -func (s *Object_constantContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { - return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) +func (s *Comparison_operatorContext) GREATER_THAN_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserGREATER_THAN_OPERATOR, 0) } -func (s *Object_constantContext) COMMA_SYMBOL(i int) antlr.TerminalNode { - return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) +func (s *Comparison_operatorContext) GREATER_THAN_EQUAL_OPERATOR() antlr.TerminalNode { + return s.GetToken(CosmosDBParserGREATER_THAN_EQUAL_OPERATOR, 0) } -func (s *Object_constantContext) GetRuleContext() antlr.RuleContext { +func (s *Comparison_operatorContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Object_constantContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Comparison_operatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Object_constantContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Comparison_operatorContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterObject_constant(s) + listenerT.EnterComparison_operator(s) } } -func (s *Object_constantContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Comparison_operatorContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitObject_constant(s) + listenerT.ExitComparison_operator(s) } } -func (s *Object_constantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Comparison_operatorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitObject_constant(s) + return t.VisitComparison_operator(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Object_constant() (localctx IObject_constantContext) { - localctx = NewObject_constantContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 48, CosmosDBParserRULE_object_constant) +func (p *CosmosDBParser) Comparison_operator() (localctx IComparison_operatorContext) { + localctx = NewComparison_operatorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 60, CosmosDBParserRULE_comparison_operator) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(249) - p.Match(CosmosDBParserLC_BRACKET_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - { - p.SetState(250) - p.Object_constant_field_pair() - } - p.SetState(255) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == CosmosDBParserCOMMA_SYMBOL { - { - p.SetState(251) - p.Match(CosmosDBParserCOMMA_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(252) - p.Object_constant_field_pair() - } - - p.SetState(257) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } + p.SetState(402) _la = p.GetTokenStream().LA(1) - } - { - p.SetState(258) - p.Match(CosmosDBParserRC_BRACKET_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1292533093055332352) != 0) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() } } @@ -4891,185 +6585,113 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IObject_constant_field_pairContext is an interface to support dynamic dispatch. -type IObject_constant_field_pairContext interface { +// IUnary_operatorContext is an interface to support dynamic dispatch. +type IUnary_operatorContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - COMMA_SYMBOL() antlr.TerminalNode - Constant() IConstantContext - Property_name() IProperty_nameContext - AllDOUBLE_QUOTE_SYMBOL() []antlr.TerminalNode - DOUBLE_QUOTE_SYMBOL(i int) antlr.TerminalNode + BIT_NOT_SYMBOL() antlr.TerminalNode + PLUS_SYMBOL() antlr.TerminalNode + MINUS_SYMBOL() antlr.TerminalNode - // IsObject_constant_field_pairContext differentiates from other interfaces. - IsObject_constant_field_pairContext() + // IsUnary_operatorContext differentiates from other interfaces. + IsUnary_operatorContext() } -type Object_constant_field_pairContext struct { +type Unary_operatorContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyObject_constant_field_pairContext() *Object_constant_field_pairContext { - var p = new(Object_constant_field_pairContext) +func NewEmptyUnary_operatorContext() *Unary_operatorContext { + var p = new(Unary_operatorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_object_constant_field_pair + p.RuleIndex = CosmosDBParserRULE_unary_operator return p } -func InitEmptyObject_constant_field_pairContext(p *Object_constant_field_pairContext) { +func InitEmptyUnary_operatorContext(p *Unary_operatorContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_object_constant_field_pair + p.RuleIndex = CosmosDBParserRULE_unary_operator } -func (*Object_constant_field_pairContext) IsObject_constant_field_pairContext() {} +func (*Unary_operatorContext) IsUnary_operatorContext() {} -func NewObject_constant_field_pairContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Object_constant_field_pairContext { - var p = new(Object_constant_field_pairContext) +func NewUnary_operatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Unary_operatorContext { + var p = new(Unary_operatorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - p.parser = parser - p.RuleIndex = CosmosDBParserRULE_object_constant_field_pair - - return p -} - -func (s *Object_constant_field_pairContext) GetParser() antlr.Parser { return s.parser } - -func (s *Object_constant_field_pairContext) COMMA_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserCOMMA_SYMBOL, 0) -} - -func (s *Object_constant_field_pairContext) Constant() IConstantContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IConstantContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IConstantContext) -} + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_unary_operator -func (s *Object_constant_field_pairContext) Property_name() IProperty_nameContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IProperty_nameContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } + return p +} - if t == nil { - return nil - } +func (s *Unary_operatorContext) GetParser() antlr.Parser { return s.parser } - return t.(IProperty_nameContext) +func (s *Unary_operatorContext) BIT_NOT_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBIT_NOT_SYMBOL, 0) } -func (s *Object_constant_field_pairContext) AllDOUBLE_QUOTE_SYMBOL() []antlr.TerminalNode { - return s.GetTokens(CosmosDBParserDOUBLE_QUOTE_SYMBOL) +func (s *Unary_operatorContext) PLUS_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserPLUS_SYMBOL, 0) } -func (s *Object_constant_field_pairContext) DOUBLE_QUOTE_SYMBOL(i int) antlr.TerminalNode { - return s.GetToken(CosmosDBParserDOUBLE_QUOTE_SYMBOL, i) +func (s *Unary_operatorContext) MINUS_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserMINUS_SYMBOL, 0) } -func (s *Object_constant_field_pairContext) GetRuleContext() antlr.RuleContext { +func (s *Unary_operatorContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Object_constant_field_pairContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Unary_operatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Object_constant_field_pairContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Unary_operatorContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterObject_constant_field_pair(s) + listenerT.EnterUnary_operator(s) } } -func (s *Object_constant_field_pairContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Unary_operatorContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitObject_constant_field_pair(s) + listenerT.ExitUnary_operator(s) } } -func (s *Object_constant_field_pairContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Unary_operatorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitObject_constant_field_pair(s) + return t.VisitUnary_operator(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Object_constant_field_pair() (localctx IObject_constant_field_pairContext) { - localctx = NewObject_constant_field_pairContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 50, CosmosDBParserRULE_object_constant_field_pair) - p.EnterOuterAlt(localctx, 1) - p.SetState(265) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case CosmosDBParserIDENTIFIER: - { - p.SetState(260) - p.Property_name() - } - - case CosmosDBParserDOUBLE_QUOTE_SYMBOL: - { - p.SetState(261) - p.Match(CosmosDBParserDOUBLE_QUOTE_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(262) - p.Property_name() - } - { - p.SetState(263) - p.Match(CosmosDBParserDOUBLE_QUOTE_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } +func (p *CosmosDBParser) Unary_operator() (localctx IUnary_operatorContext) { + localctx = NewUnary_operatorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 62, CosmosDBParserRULE_unary_operator) + var _la int - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } + p.EnterOuterAlt(localctx, 1) { - p.SetState(267) - p.Match(CosmosDBParserCOMMA_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + p.SetState(404) + _la = p.GetTokenStream().LA(1) + + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&61572651155456) != 0) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() } } - { - p.SetState(268) - p.Constant() - } errorExit: if p.HasError() { @@ -5084,96 +6706,63 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IArray_constantContext is an interface to support dynamic dispatch. -type IArray_constantContext interface { +// IParameter_nameContext is an interface to support dynamic dispatch. +type IParameter_nameContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - LS_BRACKET_SYMBOL() antlr.TerminalNode - RS_BRACKET_SYMBOL() antlr.TerminalNode - AllConstant() []IConstantContext - Constant(i int) IConstantContext - AllCOMMA_SYMBOL() []antlr.TerminalNode - COMMA_SYMBOL(i int) antlr.TerminalNode + AT_SYMBOL() antlr.TerminalNode + Identifier() IIdentifierContext - // IsArray_constantContext differentiates from other interfaces. - IsArray_constantContext() + // IsParameter_nameContext differentiates from other interfaces. + IsParameter_nameContext() } -type Array_constantContext struct { +type Parameter_nameContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyArray_constantContext() *Array_constantContext { - var p = new(Array_constantContext) +func NewEmptyParameter_nameContext() *Parameter_nameContext { + var p = new(Parameter_nameContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_array_constant + p.RuleIndex = CosmosDBParserRULE_parameter_name return p } -func InitEmptyArray_constantContext(p *Array_constantContext) { +func InitEmptyParameter_nameContext(p *Parameter_nameContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_array_constant + p.RuleIndex = CosmosDBParserRULE_parameter_name } -func (*Array_constantContext) IsArray_constantContext() {} +func (*Parameter_nameContext) IsParameter_nameContext() {} -func NewArray_constantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Array_constantContext { - var p = new(Array_constantContext) +func NewParameter_nameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Parameter_nameContext { + var p = new(Parameter_nameContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_array_constant + p.RuleIndex = CosmosDBParserRULE_parameter_name return p } -func (s *Array_constantContext) GetParser() antlr.Parser { return s.parser } - -func (s *Array_constantContext) LS_BRACKET_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserLS_BRACKET_SYMBOL, 0) -} - -func (s *Array_constantContext) RS_BRACKET_SYMBOL() antlr.TerminalNode { - return s.GetToken(CosmosDBParserRS_BRACKET_SYMBOL, 0) -} - -func (s *Array_constantContext) AllConstant() []IConstantContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IConstantContext); ok { - len++ - } - } - - tst := make([]IConstantContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IConstantContext); ok { - tst[i] = t.(IConstantContext) - i++ - } - } +func (s *Parameter_nameContext) GetParser() antlr.Parser { return s.parser } - return tst +func (s *Parameter_nameContext) AT_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserAT_SYMBOL, 0) } -func (s *Array_constantContext) Constant(i int) IConstantContext { +func (s *Parameter_nameContext) Identifier() IIdentifierContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IConstantContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -5181,110 +6770,54 @@ func (s *Array_constantContext) Constant(i int) IConstantContext { return nil } - return t.(IConstantContext) -} - -func (s *Array_constantContext) AllCOMMA_SYMBOL() []antlr.TerminalNode { - return s.GetTokens(CosmosDBParserCOMMA_SYMBOL) -} - -func (s *Array_constantContext) COMMA_SYMBOL(i int) antlr.TerminalNode { - return s.GetToken(CosmosDBParserCOMMA_SYMBOL, i) + return t.(IIdentifierContext) } -func (s *Array_constantContext) GetRuleContext() antlr.RuleContext { +func (s *Parameter_nameContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Array_constantContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Parameter_nameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Array_constantContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Parameter_nameContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterArray_constant(s) + listenerT.EnterParameter_name(s) } } -func (s *Array_constantContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Parameter_nameContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitArray_constant(s) + listenerT.ExitParameter_name(s) } } -func (s *Array_constantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Parameter_nameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitArray_constant(s) + return t.VisitParameter_name(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Array_constant() (localctx IArray_constantContext) { - localctx = NewArray_constantContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 52, CosmosDBParserRULE_array_constant) - var _la int - +func (p *CosmosDBParser) Parameter_name() (localctx IParameter_nameContext) { + localctx = NewParameter_nameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 64, CosmosDBParserRULE_parameter_name) p.EnterOuterAlt(localctx, 1) { - p.SetState(270) - p.Match(CosmosDBParserLS_BRACKET_SYMBOL) + p.SetState(406) + p.Match(CosmosDBParserAT_SYMBOL) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(279) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&8866461766714304) != 0 { - { - p.SetState(271) - p.Constant() - } - p.SetState(276) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == CosmosDBParserCOMMA_SYMBOL { - { - p.SetState(272) - p.Match(CosmosDBParserCOMMA_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(273) - p.Constant() - } - - p.SetState(278) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - - } { - p.SetState(281) - p.Match(CosmosDBParserRS_BRACKET_SYMBOL) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(407) + p.Identifier() } errorExit: @@ -5300,56 +6833,124 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IString_constantContext is an interface to support dynamic dispatch. -type IString_constantContext interface { +// IConstantContext is an interface to support dynamic dispatch. +type IConstantContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - String_literal() IString_literalContext + Undefined_constant() IUndefined_constantContext + Null_constant() INull_constantContext + Boolean_constant() IBoolean_constantContext + Number_constant() INumber_constantContext + String_constant() IString_constantContext - // IsString_constantContext differentiates from other interfaces. - IsString_constantContext() + // IsConstantContext differentiates from other interfaces. + IsConstantContext() } -type String_constantContext struct { +type ConstantContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyString_constantContext() *String_constantContext { - var p = new(String_constantContext) +func NewEmptyConstantContext() *ConstantContext { + var p = new(ConstantContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_string_constant + p.RuleIndex = CosmosDBParserRULE_constant + return p +} + +func InitEmptyConstantContext(p *ConstantContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_constant +} + +func (*ConstantContext) IsConstantContext() {} + +func NewConstantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstantContext { + var p = new(ConstantContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_constant + return p } -func InitEmptyString_constantContext(p *String_constantContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = CosmosDBParserRULE_string_constant +func (s *ConstantContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConstantContext) Undefined_constant() IUndefined_constantContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUndefined_constantContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IUndefined_constantContext) +} + +func (s *ConstantContext) Null_constant() INull_constantContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INull_constantContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(INull_constantContext) } -func (*String_constantContext) IsString_constantContext() {} +func (s *ConstantContext) Boolean_constant() IBoolean_constantContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBoolean_constantContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func NewString_constantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *String_constantContext { - var p = new(String_constantContext) + if t == nil { + return nil + } - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + return t.(IBoolean_constantContext) +} - p.parser = parser - p.RuleIndex = CosmosDBParserRULE_string_constant +func (s *ConstantContext) Number_constant() INumber_constantContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INumber_constantContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } - return p -} + if t == nil { + return nil + } -func (s *String_constantContext) GetParser() antlr.Parser { return s.parser } + return t.(INumber_constantContext) +} -func (s *String_constantContext) String_literal() IString_literalContext { +func (s *ConstantContext) String_constant() IString_constantContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IString_literalContext); ok { + if _, ok := ctx.(IString_constantContext); ok { t = ctx.(antlr.RuleContext) break } @@ -5359,46 +6960,87 @@ func (s *String_constantContext) String_literal() IString_literalContext { return nil } - return t.(IString_literalContext) + return t.(IString_constantContext) } -func (s *String_constantContext) GetRuleContext() antlr.RuleContext { +func (s *ConstantContext) GetRuleContext() antlr.RuleContext { return s } -func (s *String_constantContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ConstantContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *String_constantContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ConstantContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterString_constant(s) + listenerT.EnterConstant(s) } } -func (s *String_constantContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *ConstantContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitString_constant(s) + listenerT.ExitConstant(s) } } -func (s *String_constantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ConstantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitString_constant(s) + return t.VisitConstant(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) String_constant() (localctx IString_constantContext) { - localctx = NewString_constantContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 54, CosmosDBParserRULE_string_constant) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(283) - p.String_literal() +func (p *CosmosDBParser) Constant() (localctx IConstantContext) { + localctx = NewConstantContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 66, CosmosDBParserRULE_constant) + p.SetState(414) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case CosmosDBParserUNDEFINED_SYMBOL: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(409) + p.Undefined_constant() + } + + case CosmosDBParserNULL_SYMBOL: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(410) + p.Null_constant() + } + + case CosmosDBParserFALSE_SYMBOL, CosmosDBParserTRUE_SYMBOL: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(411) + p.Boolean_constant() + } + + case CosmosDBParserDECIMAL, CosmosDBParserREAL, CosmosDBParserFLOAT, CosmosDBParserHEXADECIMAL: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(412) + p.Number_constant() + } + + case CosmosDBParserSINGLE_QUOTE_STRING_LITERAL, CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(413) + p.String_constant() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } errorExit: @@ -5496,10 +7138,10 @@ func (s *Undefined_constantContext) Accept(visitor antlr.ParseTreeVisitor) inter func (p *CosmosDBParser) Undefined_constant() (localctx IUndefined_constantContext) { localctx = NewUndefined_constantContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 56, CosmosDBParserRULE_undefined_constant) + p.EnterRule(localctx, 68, CosmosDBParserRULE_undefined_constant) p.EnterOuterAlt(localctx, 1) { - p.SetState(285) + p.SetState(416) p.Match(CosmosDBParserUNDEFINED_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -5602,10 +7244,10 @@ func (s *Null_constantContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *CosmosDBParser) Null_constant() (localctx INull_constantContext) { localctx = NewNull_constantContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 58, CosmosDBParserRULE_null_constant) + p.EnterRule(localctx, 70, CosmosDBParserRULE_null_constant) p.EnterOuterAlt(localctx, 1) { - p.SetState(287) + p.SetState(418) p.Match(CosmosDBParserNULL_SYMBOL) if p.HasError() { // Recognition error - abort rule @@ -5713,12 +7355,12 @@ func (s *Boolean_constantContext) Accept(visitor antlr.ParseTreeVisitor) interfa func (p *CosmosDBParser) Boolean_constant() (localctx IBoolean_constantContext) { localctx = NewBoolean_constantContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 60, CosmosDBParserRULE_boolean_constant) + p.EnterRule(localctx, 72, CosmosDBParserRULE_boolean_constant) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(289) + p.SetState(420) _la = p.GetTokenStream().LA(1) if !(_la == CosmosDBParserFALSE_SYMBOL || _la == CosmosDBParserTRUE_SYMBOL) { @@ -5776,39 +7418,173 @@ func InitEmptyNumber_constantContext(p *Number_constantContext) { func (*Number_constantContext) IsNumber_constantContext() {} -func NewNumber_constantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Number_constantContext { - var p = new(Number_constantContext) +func NewNumber_constantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Number_constantContext { + var p = new(Number_constantContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_number_constant + + return p +} + +func (s *Number_constantContext) GetParser() antlr.Parser { return s.parser } + +func (s *Number_constantContext) Decimal_literal() IDecimal_literalContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecimal_literalContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDecimal_literalContext) +} + +func (s *Number_constantContext) Hexadecimal_literal() IHexadecimal_literalContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IHexadecimal_literalContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IHexadecimal_literalContext) +} + +func (s *Number_constantContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *Number_constantContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *Number_constantContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterNumber_constant(s) + } +} + +func (s *Number_constantContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitNumber_constant(s) + } +} + +func (s *Number_constantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitNumber_constant(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *CosmosDBParser) Number_constant() (localctx INumber_constantContext) { + localctx = NewNumber_constantContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 74, CosmosDBParserRULE_number_constant) + p.SetState(424) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case CosmosDBParserDECIMAL, CosmosDBParserREAL, CosmosDBParserFLOAT: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(422) + p.Decimal_literal() + } + + case CosmosDBParserHEXADECIMAL: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(423) + p.Hexadecimal_literal() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IString_constantContext is an interface to support dynamic dispatch. +type IString_constantContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + String_literal() IString_literalContext + + // IsString_constantContext differentiates from other interfaces. + IsString_constantContext() +} + +type String_constantContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyString_constantContext() *String_constantContext { + var p = new(String_constantContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_string_constant + return p +} + +func InitEmptyString_constantContext(p *String_constantContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_string_constant +} + +func (*String_constantContext) IsString_constantContext() {} + +func NewString_constantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *String_constantContext { + var p = new(String_constantContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = CosmosDBParserRULE_number_constant + p.RuleIndex = CosmosDBParserRULE_string_constant return p } -func (s *Number_constantContext) GetParser() antlr.Parser { return s.parser } - -func (s *Number_constantContext) Decimal_literal() IDecimal_literalContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDecimal_literalContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IDecimal_literalContext) -} +func (s *String_constantContext) GetParser() antlr.Parser { return s.parser } -func (s *Number_constantContext) Hexadecimal_literal() IHexadecimal_literalContext { +func (s *String_constantContext) String_literal() IString_literalContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IHexadecimal_literalContext); ok { + if _, ok := ctx.(IString_literalContext); ok { t = ctx.(antlr.RuleContext) break } @@ -5818,66 +7594,46 @@ func (s *Number_constantContext) Hexadecimal_literal() IHexadecimal_literalConte return nil } - return t.(IHexadecimal_literalContext) + return t.(IString_literalContext) } -func (s *Number_constantContext) GetRuleContext() antlr.RuleContext { +func (s *String_constantContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Number_constantContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *String_constantContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Number_constantContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *String_constantContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.EnterNumber_constant(s) + listenerT.EnterString_constant(s) } } -func (s *Number_constantContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *String_constantContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(CosmosDBParserListener); ok { - listenerT.ExitNumber_constant(s) + listenerT.ExitString_constant(s) } } -func (s *Number_constantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *String_constantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case CosmosDBParserVisitor: - return t.VisitNumber_constant(s) + return t.VisitString_constant(s) default: return t.VisitChildren(s) } } -func (p *CosmosDBParser) Number_constant() (localctx INumber_constantContext) { - localctx = NewNumber_constantContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 62, CosmosDBParserRULE_number_constant) - p.SetState(293) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case CosmosDBParserDECIMAL, CosmosDBParserREAL, CosmosDBParserFLOAT: - p.EnterOuterAlt(localctx, 1) - { - p.SetState(291) - p.Decimal_literal() - } - - case CosmosDBParserHEXADECIMAL: - p.EnterOuterAlt(localctx, 2) - { - p.SetState(292) - p.Hexadecimal_literal() - } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit +func (p *CosmosDBParser) String_constant() (localctx IString_constantContext) { + localctx = NewString_constantContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 76, CosmosDBParserRULE_string_constant) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(426) + p.String_literal() } errorExit: @@ -5980,12 +7736,12 @@ func (s *String_literalContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *CosmosDBParser) String_literal() (localctx IString_literalContext) { localctx = NewString_literalContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 64, CosmosDBParserRULE_string_literal) + p.EnterRule(localctx, 78, CosmosDBParserRULE_string_literal) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(295) + p.SetState(428) _la = p.GetTokenStream().LA(1) if !(_la == CosmosDBParserSINGLE_QUOTE_STRING_LITERAL || _la == CosmosDBParserDOUBLE_QUOTE_STRING_LITERAL) { @@ -6101,15 +7857,15 @@ func (s *Decimal_literalContext) Accept(visitor antlr.ParseTreeVisitor) interfac func (p *CosmosDBParser) Decimal_literal() (localctx IDecimal_literalContext) { localctx = NewDecimal_literalContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 66, CosmosDBParserRULE_decimal_literal) + p.EnterRule(localctx, 80, CosmosDBParserRULE_decimal_literal) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(297) + p.SetState(430) _la = p.GetTokenStream().LA(1) - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&985162418487296) != 0) { + if !((int64((_la-63)) & ^0x3f) == 0 && ((int64(1)<<(_la-63))&7) != 0) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) @@ -6212,10 +7968,10 @@ func (s *Hexadecimal_literalContext) Accept(visitor antlr.ParseTreeVisitor) inte func (p *CosmosDBParser) Hexadecimal_literal() (localctx IHexadecimal_literalContext) { localctx = NewHexadecimal_literalContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 68, CosmosDBParserRULE_hexadecimal_literal) + p.EnterRule(localctx, 82, CosmosDBParserRULE_hexadecimal_literal) p.EnterOuterAlt(localctx, 1) { - p.SetState(299) + p.SetState(432) p.Match(CosmosDBParserHEXADECIMAL) if p.HasError() { // Recognition error - abort rule @@ -6236,6 +7992,192 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } +// IIdentifierContext is an interface to support dynamic dispatch. +type IIdentifierContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + IDENTIFIER() antlr.TerminalNode + IN_SYMBOL() antlr.TerminalNode + BETWEEN_SYMBOL() antlr.TerminalNode + TOP_SYMBOL() antlr.TerminalNode + VALUE_SYMBOL() antlr.TerminalNode + ORDER_SYMBOL() antlr.TerminalNode + BY_SYMBOL() antlr.TerminalNode + GROUP_SYMBOL() antlr.TerminalNode + OFFSET_SYMBOL() antlr.TerminalNode + LIMIT_SYMBOL() antlr.TerminalNode + ASC_SYMBOL() antlr.TerminalNode + DESC_SYMBOL() antlr.TerminalNode + EXISTS_SYMBOL() antlr.TerminalNode + LIKE_SYMBOL() antlr.TerminalNode + HAVING_SYMBOL() antlr.TerminalNode + JOIN_SYMBOL() antlr.TerminalNode + + // IsIdentifierContext differentiates from other interfaces. + IsIdentifierContext() +} + +type IdentifierContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIdentifierContext() *IdentifierContext { + var p = new(IdentifierContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_identifier + return p +} + +func InitEmptyIdentifierContext(p *IdentifierContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = CosmosDBParserRULE_identifier +} + +func (*IdentifierContext) IsIdentifierContext() {} + +func NewIdentifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IdentifierContext { + var p = new(IdentifierContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = CosmosDBParserRULE_identifier + + return p +} + +func (s *IdentifierContext) GetParser() antlr.Parser { return s.parser } + +func (s *IdentifierContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(CosmosDBParserIDENTIFIER, 0) +} + +func (s *IdentifierContext) IN_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserIN_SYMBOL, 0) +} + +func (s *IdentifierContext) BETWEEN_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBETWEEN_SYMBOL, 0) +} + +func (s *IdentifierContext) TOP_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserTOP_SYMBOL, 0) +} + +func (s *IdentifierContext) VALUE_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserVALUE_SYMBOL, 0) +} + +func (s *IdentifierContext) ORDER_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserORDER_SYMBOL, 0) +} + +func (s *IdentifierContext) BY_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserBY_SYMBOL, 0) +} + +func (s *IdentifierContext) GROUP_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserGROUP_SYMBOL, 0) +} + +func (s *IdentifierContext) OFFSET_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserOFFSET_SYMBOL, 0) +} + +func (s *IdentifierContext) LIMIT_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLIMIT_SYMBOL, 0) +} + +func (s *IdentifierContext) ASC_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserASC_SYMBOL, 0) +} + +func (s *IdentifierContext) DESC_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserDESC_SYMBOL, 0) +} + +func (s *IdentifierContext) EXISTS_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserEXISTS_SYMBOL, 0) +} + +func (s *IdentifierContext) LIKE_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserLIKE_SYMBOL, 0) +} + +func (s *IdentifierContext) HAVING_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserHAVING_SYMBOL, 0) +} + +func (s *IdentifierContext) JOIN_SYMBOL() antlr.TerminalNode { + return s.GetToken(CosmosDBParserJOIN_SYMBOL, 0) +} + +func (s *IdentifierContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IdentifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IdentifierContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.EnterIdentifier(s) + } +} + +func (s *IdentifierContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(CosmosDBParserListener); ok { + listenerT.ExitIdentifier(s) + } +} + +func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case CosmosDBParserVisitor: + return t.VisitIdentifier(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *CosmosDBParser) Identifier() (localctx IIdentifierContext) { + localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 84, CosmosDBParserRULE_identifier) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(434) + _la = p.GetTokenStream().LA(1) + + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&2305843010287403008) != 0) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + // IProperty_nameContext is an interface to support dynamic dispatch. type IProperty_nameContext interface { antlr.ParserRuleContext @@ -6244,7 +8186,7 @@ type IProperty_nameContext interface { GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode + Identifier() IIdentifierContext // IsProperty_nameContext differentiates from other interfaces. IsProperty_nameContext() @@ -6282,8 +8224,20 @@ func NewProperty_nameContext(parser antlr.Parser, parent antlr.ParserRuleContext func (s *Property_nameContext) GetParser() antlr.Parser { return s.parser } -func (s *Property_nameContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CosmosDBParserIDENTIFIER, 0) +func (s *Property_nameContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) } func (s *Property_nameContext) GetRuleContext() antlr.RuleContext { @@ -6318,15 +8272,11 @@ func (s *Property_nameContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *CosmosDBParser) Property_name() (localctx IProperty_nameContext) { localctx = NewProperty_nameContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 70, CosmosDBParserRULE_property_name) + p.EnterRule(localctx, 86, CosmosDBParserRULE_property_name) p.EnterOuterAlt(localctx, 1) { - p.SetState(301) - p.Match(CosmosDBParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(436) + p.Identifier() } errorExit: @@ -6424,10 +8374,10 @@ func (s *Array_indexContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *CosmosDBParser) Array_index() (localctx IArray_indexContext) { localctx = NewArray_indexContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 72, CosmosDBParserRULE_array_index) + p.EnterRule(localctx, 88, CosmosDBParserRULE_array_index) p.EnterOuterAlt(localctx, 1) { - p.SetState(303) + p.SetState(438) p.Match(CosmosDBParserDECIMAL) if p.HasError() { // Recognition error - abort rule @@ -6456,7 +8406,7 @@ type IInput_aliasContext interface { GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode + Identifier() IIdentifierContext // IsInput_aliasContext differentiates from other interfaces. IsInput_aliasContext() @@ -6494,8 +8444,20 @@ func NewInput_aliasContext(parser antlr.Parser, parent antlr.ParserRuleContext, func (s *Input_aliasContext) GetParser() antlr.Parser { return s.parser } -func (s *Input_aliasContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(CosmosDBParserIDENTIFIER, 0) +func (s *Input_aliasContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) } func (s *Input_aliasContext) GetRuleContext() antlr.RuleContext { @@ -6530,15 +8492,11 @@ func (s *Input_aliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *CosmosDBParser) Input_alias() (localctx IInput_aliasContext) { localctx = NewInput_aliasContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 74, CosmosDBParserRULE_input_alias) + p.EnterRule(localctx, 90, CosmosDBParserRULE_input_alias) p.EnterOuterAlt(localctx, 1) { - p.SetState(305) - p.Match(CosmosDBParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(440) + p.Identifier() } errorExit: @@ -6556,20 +8514,13 @@ errorExit: func (p *CosmosDBParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { switch ruleIndex { - case 13: + case 20: var t *Scalar_expressionContext = nil if localctx != nil { t = localctx.(*Scalar_expressionContext) } return p.Scalar_expression_Sempred(t, predIndex) - case 14: - var t *Scalar_expression_in_whereContext = nil - if localctx != nil { - t = localctx.(*Scalar_expression_in_whereContext) - } - return p.Scalar_expression_in_where_Sempred(t, predIndex) - default: panic("No predicate with index: " + fmt.Sprint(ruleIndex)) } @@ -6578,35 +8529,52 @@ func (p *CosmosDBParser) Sempred(localctx antlr.RuleContext, ruleIndex, predInde func (p *CosmosDBParser) Scalar_expression_Sempred(localctx antlr.RuleContext, predIndex int) bool { switch predIndex { case 0: - return p.Precpred(p.GetParserRuleContext(), 3) + return p.Precpred(p.GetParserRuleContext(), 14) case 1: - return p.Precpred(p.GetParserRuleContext(), 2) - - default: - panic("No predicate with index: " + fmt.Sprint(predIndex)) - } -} + return p.Precpred(p.GetParserRuleContext(), 13) -func (p *CosmosDBParser) Scalar_expression_in_where_Sempred(localctx antlr.RuleContext, predIndex int) bool { - switch predIndex { case 2: - return p.Precpred(p.GetParserRuleContext(), 11) + return p.Precpred(p.GetParserRuleContext(), 12) case 3: - return p.Precpred(p.GetParserRuleContext(), 10) + return p.Precpred(p.GetParserRuleContext(), 11) case 4: - return p.Precpred(p.GetParserRuleContext(), 6) + return p.Precpred(p.GetParserRuleContext(), 10) case 5: - return p.Precpred(p.GetParserRuleContext(), 5) + return p.Precpred(p.GetParserRuleContext(), 9) case 6: - return p.Precpred(p.GetParserRuleContext(), 9) + return p.Precpred(p.GetParserRuleContext(), 8) case 7: - return p.Precpred(p.GetParserRuleContext(), 8) + return p.Precpred(p.GetParserRuleContext(), 7) + + case 8: + return p.Precpred(p.GetParserRuleContext(), 5) + + case 9: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 10: + return p.Precpred(p.GetParserRuleContext(), 3) + + case 11: + return p.Precpred(p.GetParserRuleContext(), 2) + + case 12: + return p.Precpred(p.GetParserRuleContext(), 1) + + case 13: + return p.Precpred(p.GetParserRuleContext(), 18) + + case 14: + return p.Precpred(p.GetParserRuleContext(), 17) + + case 15: + return p.Precpred(p.GetParserRuleContext(), 6) default: panic("No predicate with index: " + fmt.Sprint(predIndex)) diff --git a/cosmosdb/cosmosdbparser_base_listener.go b/cosmosdb/cosmosdbparser_base_listener.go index bc94e4c..19c9088 100644 --- a/cosmosdb/cosmosdbparser_base_listener.go +++ b/cosmosdb/cosmosdbparser_base_listener.go @@ -38,6 +38,12 @@ func (s *BaseCosmosDBParserListener) EnterSelect_clause(ctx *Select_clauseContex // ExitSelect_clause is called when production select_clause is exited. func (s *BaseCosmosDBParserListener) ExitSelect_clause(ctx *Select_clauseContext) {} +// EnterTop_clause is called when production top_clause is entered. +func (s *BaseCosmosDBParserListener) EnterTop_clause(ctx *Top_clauseContext) {} + +// ExitTop_clause is called when production top_clause is exited. +func (s *BaseCosmosDBParserListener) ExitTop_clause(ctx *Top_clauseContext) {} + // EnterSelect_specification is called when production select_specification is entered. func (s *BaseCosmosDBParserListener) EnterSelect_specification(ctx *Select_specificationContext) {} @@ -56,6 +62,36 @@ func (s *BaseCosmosDBParserListener) EnterWhere_clause(ctx *Where_clauseContext) // ExitWhere_clause is called when production where_clause is exited. func (s *BaseCosmosDBParserListener) ExitWhere_clause(ctx *Where_clauseContext) {} +// EnterGroup_by_clause is called when production group_by_clause is entered. +func (s *BaseCosmosDBParserListener) EnterGroup_by_clause(ctx *Group_by_clauseContext) {} + +// ExitGroup_by_clause is called when production group_by_clause is exited. +func (s *BaseCosmosDBParserListener) ExitGroup_by_clause(ctx *Group_by_clauseContext) {} + +// EnterHaving_clause is called when production having_clause is entered. +func (s *BaseCosmosDBParserListener) EnterHaving_clause(ctx *Having_clauseContext) {} + +// ExitHaving_clause is called when production having_clause is exited. +func (s *BaseCosmosDBParserListener) ExitHaving_clause(ctx *Having_clauseContext) {} + +// EnterOrder_by_clause is called when production order_by_clause is entered. +func (s *BaseCosmosDBParserListener) EnterOrder_by_clause(ctx *Order_by_clauseContext) {} + +// ExitOrder_by_clause is called when production order_by_clause is exited. +func (s *BaseCosmosDBParserListener) ExitOrder_by_clause(ctx *Order_by_clauseContext) {} + +// EnterSort_expression is called when production sort_expression is entered. +func (s *BaseCosmosDBParserListener) EnterSort_expression(ctx *Sort_expressionContext) {} + +// ExitSort_expression is called when production sort_expression is exited. +func (s *BaseCosmosDBParserListener) ExitSort_expression(ctx *Sort_expressionContext) {} + +// EnterOffset_limit_clause is called when production offset_limit_clause is entered. +func (s *BaseCosmosDBParserListener) EnterOffset_limit_clause(ctx *Offset_limit_clauseContext) {} + +// ExitOffset_limit_clause is called when production offset_limit_clause is exited. +func (s *BaseCosmosDBParserListener) ExitOffset_limit_clause(ctx *Offset_limit_clauseContext) {} + // EnterFrom_specification is called when production from_specification is entered. func (s *BaseCosmosDBParserListener) EnterFrom_specification(ctx *From_specificationContext) {} @@ -74,6 +110,12 @@ func (s *BaseCosmosDBParserListener) EnterContainer_expression(ctx *Container_ex // ExitContainer_expression is called when production container_expression is exited. func (s *BaseCosmosDBParserListener) ExitContainer_expression(ctx *Container_expressionContext) {} +// EnterJoin_clause is called when production join_clause is entered. +func (s *BaseCosmosDBParserListener) EnterJoin_clause(ctx *Join_clauseContext) {} + +// ExitJoin_clause is called when production join_clause is exited. +func (s *BaseCosmosDBParserListener) ExitJoin_clause(ctx *Join_clauseContext) {} + // EnterContainer_name is called when production container_name is entered. func (s *BaseCosmosDBParserListener) EnterContainer_name(ctx *Container_nameContext) {} @@ -104,14 +146,6 @@ func (s *BaseCosmosDBParserListener) EnterScalar_expression(ctx *Scalar_expressi // ExitScalar_expression is called when production scalar_expression is exited. func (s *BaseCosmosDBParserListener) ExitScalar_expression(ctx *Scalar_expressionContext) {} -// EnterScalar_expression_in_where is called when production scalar_expression_in_where is entered. -func (s *BaseCosmosDBParserListener) EnterScalar_expression_in_where(ctx *Scalar_expression_in_whereContext) { -} - -// ExitScalar_expression_in_where is called when production scalar_expression_in_where is exited. -func (s *BaseCosmosDBParserListener) ExitScalar_expression_in_where(ctx *Scalar_expression_in_whereContext) { -} - // EnterCreate_array_expression is called when production create_array_expression is entered. func (s *BaseCosmosDBParserListener) EnterCreate_array_expression(ctx *Create_array_expressionContext) { } @@ -128,6 +162,12 @@ func (s *BaseCosmosDBParserListener) EnterCreate_object_expression(ctx *Create_o func (s *BaseCosmosDBParserListener) ExitCreate_object_expression(ctx *Create_object_expressionContext) { } +// EnterObject_field_pair is called when production object_field_pair is entered. +func (s *BaseCosmosDBParserListener) EnterObject_field_pair(ctx *Object_field_pairContext) {} + +// ExitObject_field_pair is called when production object_field_pair is exited. +func (s *BaseCosmosDBParserListener) ExitObject_field_pair(ctx *Object_field_pairContext) {} + // EnterScalar_function_expression is called when production scalar_function_expression is entered. func (s *BaseCosmosDBParserListener) EnterScalar_function_expression(ctx *Scalar_function_expressionContext) { } @@ -152,11 +192,31 @@ func (s *BaseCosmosDBParserListener) EnterBuiltin_function_expression(ctx *Built func (s *BaseCosmosDBParserListener) ExitBuiltin_function_expression(ctx *Builtin_function_expressionContext) { } -// EnterBinary_operator is called when production binary_operator is entered. -func (s *BaseCosmosDBParserListener) EnterBinary_operator(ctx *Binary_operatorContext) {} +// EnterMultiplicative_operator is called when production multiplicative_operator is entered. +func (s *BaseCosmosDBParserListener) EnterMultiplicative_operator(ctx *Multiplicative_operatorContext) { +} + +// ExitMultiplicative_operator is called when production multiplicative_operator is exited. +func (s *BaseCosmosDBParserListener) ExitMultiplicative_operator(ctx *Multiplicative_operatorContext) { +} + +// EnterAdditive_operator is called when production additive_operator is entered. +func (s *BaseCosmosDBParserListener) EnterAdditive_operator(ctx *Additive_operatorContext) {} + +// ExitAdditive_operator is called when production additive_operator is exited. +func (s *BaseCosmosDBParserListener) ExitAdditive_operator(ctx *Additive_operatorContext) {} -// ExitBinary_operator is called when production binary_operator is exited. -func (s *BaseCosmosDBParserListener) ExitBinary_operator(ctx *Binary_operatorContext) {} +// EnterShift_operator is called when production shift_operator is entered. +func (s *BaseCosmosDBParserListener) EnterShift_operator(ctx *Shift_operatorContext) {} + +// ExitShift_operator is called when production shift_operator is exited. +func (s *BaseCosmosDBParserListener) ExitShift_operator(ctx *Shift_operatorContext) {} + +// EnterComparison_operator is called when production comparison_operator is entered. +func (s *BaseCosmosDBParserListener) EnterComparison_operator(ctx *Comparison_operatorContext) {} + +// ExitComparison_operator is called when production comparison_operator is exited. +func (s *BaseCosmosDBParserListener) ExitComparison_operator(ctx *Comparison_operatorContext) {} // EnterUnary_operator is called when production unary_operator is entered. func (s *BaseCosmosDBParserListener) EnterUnary_operator(ctx *Unary_operatorContext) {} @@ -176,32 +236,6 @@ func (s *BaseCosmosDBParserListener) EnterConstant(ctx *ConstantContext) {} // ExitConstant is called when production constant is exited. func (s *BaseCosmosDBParserListener) ExitConstant(ctx *ConstantContext) {} -// EnterObject_constant is called when production object_constant is entered. -func (s *BaseCosmosDBParserListener) EnterObject_constant(ctx *Object_constantContext) {} - -// ExitObject_constant is called when production object_constant is exited. -func (s *BaseCosmosDBParserListener) ExitObject_constant(ctx *Object_constantContext) {} - -// EnterObject_constant_field_pair is called when production object_constant_field_pair is entered. -func (s *BaseCosmosDBParserListener) EnterObject_constant_field_pair(ctx *Object_constant_field_pairContext) { -} - -// ExitObject_constant_field_pair is called when production object_constant_field_pair is exited. -func (s *BaseCosmosDBParserListener) ExitObject_constant_field_pair(ctx *Object_constant_field_pairContext) { -} - -// EnterArray_constant is called when production array_constant is entered. -func (s *BaseCosmosDBParserListener) EnterArray_constant(ctx *Array_constantContext) {} - -// ExitArray_constant is called when production array_constant is exited. -func (s *BaseCosmosDBParserListener) ExitArray_constant(ctx *Array_constantContext) {} - -// EnterString_constant is called when production string_constant is entered. -func (s *BaseCosmosDBParserListener) EnterString_constant(ctx *String_constantContext) {} - -// ExitString_constant is called when production string_constant is exited. -func (s *BaseCosmosDBParserListener) ExitString_constant(ctx *String_constantContext) {} - // EnterUndefined_constant is called when production undefined_constant is entered. func (s *BaseCosmosDBParserListener) EnterUndefined_constant(ctx *Undefined_constantContext) {} @@ -226,6 +260,12 @@ func (s *BaseCosmosDBParserListener) EnterNumber_constant(ctx *Number_constantCo // ExitNumber_constant is called when production number_constant is exited. func (s *BaseCosmosDBParserListener) ExitNumber_constant(ctx *Number_constantContext) {} +// EnterString_constant is called when production string_constant is entered. +func (s *BaseCosmosDBParserListener) EnterString_constant(ctx *String_constantContext) {} + +// ExitString_constant is called when production string_constant is exited. +func (s *BaseCosmosDBParserListener) ExitString_constant(ctx *String_constantContext) {} + // EnterString_literal is called when production string_literal is entered. func (s *BaseCosmosDBParserListener) EnterString_literal(ctx *String_literalContext) {} @@ -244,6 +284,12 @@ func (s *BaseCosmosDBParserListener) EnterHexadecimal_literal(ctx *Hexadecimal_l // ExitHexadecimal_literal is called when production hexadecimal_literal is exited. func (s *BaseCosmosDBParserListener) ExitHexadecimal_literal(ctx *Hexadecimal_literalContext) {} +// EnterIdentifier is called when production identifier is entered. +func (s *BaseCosmosDBParserListener) EnterIdentifier(ctx *IdentifierContext) {} + +// ExitIdentifier is called when production identifier is exited. +func (s *BaseCosmosDBParserListener) ExitIdentifier(ctx *IdentifierContext) {} + // EnterProperty_name is called when production property_name is entered. func (s *BaseCosmosDBParserListener) EnterProperty_name(ctx *Property_nameContext) {} diff --git a/cosmosdb/cosmosdbparser_base_visitor.go b/cosmosdb/cosmosdbparser_base_visitor.go index f8b3b7b..fb7f09a 100644 --- a/cosmosdb/cosmosdbparser_base_visitor.go +++ b/cosmosdb/cosmosdbparser_base_visitor.go @@ -19,6 +19,10 @@ func (v *BaseCosmosDBParserVisitor) VisitSelect_clause(ctx *Select_clauseContext return v.VisitChildren(ctx) } +func (v *BaseCosmosDBParserVisitor) VisitTop_clause(ctx *Top_clauseContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseCosmosDBParserVisitor) VisitSelect_specification(ctx *Select_specificationContext) interface{} { return v.VisitChildren(ctx) } @@ -31,6 +35,26 @@ func (v *BaseCosmosDBParserVisitor) VisitWhere_clause(ctx *Where_clauseContext) return v.VisitChildren(ctx) } +func (v *BaseCosmosDBParserVisitor) VisitGroup_by_clause(ctx *Group_by_clauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseCosmosDBParserVisitor) VisitHaving_clause(ctx *Having_clauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseCosmosDBParserVisitor) VisitOrder_by_clause(ctx *Order_by_clauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseCosmosDBParserVisitor) VisitSort_expression(ctx *Sort_expressionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseCosmosDBParserVisitor) VisitOffset_limit_clause(ctx *Offset_limit_clauseContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseCosmosDBParserVisitor) VisitFrom_specification(ctx *From_specificationContext) interface{} { return v.VisitChildren(ctx) } @@ -43,6 +67,10 @@ func (v *BaseCosmosDBParserVisitor) VisitContainer_expression(ctx *Container_exp return v.VisitChildren(ctx) } +func (v *BaseCosmosDBParserVisitor) VisitJoin_clause(ctx *Join_clauseContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseCosmosDBParserVisitor) VisitContainer_name(ctx *Container_nameContext) interface{} { return v.VisitChildren(ctx) } @@ -63,15 +91,15 @@ func (v *BaseCosmosDBParserVisitor) VisitScalar_expression(ctx *Scalar_expressio return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitScalar_expression_in_where(ctx *Scalar_expression_in_whereContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitCreate_array_expression(ctx *Create_array_expressionContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitCreate_array_expression(ctx *Create_array_expressionContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitCreate_object_expression(ctx *Create_object_expressionContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitCreate_object_expression(ctx *Create_object_expressionContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitObject_field_pair(ctx *Object_field_pairContext) interface{} { return v.VisitChildren(ctx) } @@ -87,35 +115,31 @@ func (v *BaseCosmosDBParserVisitor) VisitBuiltin_function_expression(ctx *Builti return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitBinary_operator(ctx *Binary_operatorContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitMultiplicative_operator(ctx *Multiplicative_operatorContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitUnary_operator(ctx *Unary_operatorContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitAdditive_operator(ctx *Additive_operatorContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitParameter_name(ctx *Parameter_nameContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitShift_operator(ctx *Shift_operatorContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitConstant(ctx *ConstantContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitComparison_operator(ctx *Comparison_operatorContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitObject_constant(ctx *Object_constantContext) interface{} { - return v.VisitChildren(ctx) -} - -func (v *BaseCosmosDBParserVisitor) VisitObject_constant_field_pair(ctx *Object_constant_field_pairContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitUnary_operator(ctx *Unary_operatorContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitArray_constant(ctx *Array_constantContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitParameter_name(ctx *Parameter_nameContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseCosmosDBParserVisitor) VisitString_constant(ctx *String_constantContext) interface{} { +func (v *BaseCosmosDBParserVisitor) VisitConstant(ctx *ConstantContext) interface{} { return v.VisitChildren(ctx) } @@ -135,6 +159,10 @@ func (v *BaseCosmosDBParserVisitor) VisitNumber_constant(ctx *Number_constantCon return v.VisitChildren(ctx) } +func (v *BaseCosmosDBParserVisitor) VisitString_constant(ctx *String_constantContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseCosmosDBParserVisitor) VisitString_literal(ctx *String_literalContext) interface{} { return v.VisitChildren(ctx) } @@ -147,6 +175,10 @@ func (v *BaseCosmosDBParserVisitor) VisitHexadecimal_literal(ctx *Hexadecimal_li return v.VisitChildren(ctx) } +func (v *BaseCosmosDBParserVisitor) VisitIdentifier(ctx *IdentifierContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseCosmosDBParserVisitor) VisitProperty_name(ctx *Property_nameContext) interface{} { return v.VisitChildren(ctx) } diff --git a/cosmosdb/cosmosdbparser_listener.go b/cosmosdb/cosmosdbparser_listener.go index 1751445..d89c97e 100644 --- a/cosmosdb/cosmosdbparser_listener.go +++ b/cosmosdb/cosmosdbparser_listener.go @@ -16,6 +16,9 @@ type CosmosDBParserListener interface { // EnterSelect_clause is called when entering the select_clause production. EnterSelect_clause(c *Select_clauseContext) + // EnterTop_clause is called when entering the top_clause production. + EnterTop_clause(c *Top_clauseContext) + // EnterSelect_specification is called when entering the select_specification production. EnterSelect_specification(c *Select_specificationContext) @@ -25,6 +28,21 @@ type CosmosDBParserListener interface { // EnterWhere_clause is called when entering the where_clause production. EnterWhere_clause(c *Where_clauseContext) + // EnterGroup_by_clause is called when entering the group_by_clause production. + EnterGroup_by_clause(c *Group_by_clauseContext) + + // EnterHaving_clause is called when entering the having_clause production. + EnterHaving_clause(c *Having_clauseContext) + + // EnterOrder_by_clause is called when entering the order_by_clause production. + EnterOrder_by_clause(c *Order_by_clauseContext) + + // EnterSort_expression is called when entering the sort_expression production. + EnterSort_expression(c *Sort_expressionContext) + + // EnterOffset_limit_clause is called when entering the offset_limit_clause production. + EnterOffset_limit_clause(c *Offset_limit_clauseContext) + // EnterFrom_specification is called when entering the from_specification production. EnterFrom_specification(c *From_specificationContext) @@ -34,6 +52,9 @@ type CosmosDBParserListener interface { // EnterContainer_expression is called when entering the container_expression production. EnterContainer_expression(c *Container_expressionContext) + // EnterJoin_clause is called when entering the join_clause production. + EnterJoin_clause(c *Join_clauseContext) + // EnterContainer_name is called when entering the container_name production. EnterContainer_name(c *Container_nameContext) @@ -49,15 +70,15 @@ type CosmosDBParserListener interface { // EnterScalar_expression is called when entering the scalar_expression production. EnterScalar_expression(c *Scalar_expressionContext) - // EnterScalar_expression_in_where is called when entering the scalar_expression_in_where production. - EnterScalar_expression_in_where(c *Scalar_expression_in_whereContext) - // EnterCreate_array_expression is called when entering the create_array_expression production. EnterCreate_array_expression(c *Create_array_expressionContext) // EnterCreate_object_expression is called when entering the create_object_expression production. EnterCreate_object_expression(c *Create_object_expressionContext) + // EnterObject_field_pair is called when entering the object_field_pair production. + EnterObject_field_pair(c *Object_field_pairContext) + // EnterScalar_function_expression is called when entering the scalar_function_expression production. EnterScalar_function_expression(c *Scalar_function_expressionContext) @@ -67,8 +88,17 @@ type CosmosDBParserListener interface { // EnterBuiltin_function_expression is called when entering the builtin_function_expression production. EnterBuiltin_function_expression(c *Builtin_function_expressionContext) - // EnterBinary_operator is called when entering the binary_operator production. - EnterBinary_operator(c *Binary_operatorContext) + // EnterMultiplicative_operator is called when entering the multiplicative_operator production. + EnterMultiplicative_operator(c *Multiplicative_operatorContext) + + // EnterAdditive_operator is called when entering the additive_operator production. + EnterAdditive_operator(c *Additive_operatorContext) + + // EnterShift_operator is called when entering the shift_operator production. + EnterShift_operator(c *Shift_operatorContext) + + // EnterComparison_operator is called when entering the comparison_operator production. + EnterComparison_operator(c *Comparison_operatorContext) // EnterUnary_operator is called when entering the unary_operator production. EnterUnary_operator(c *Unary_operatorContext) @@ -79,18 +109,6 @@ type CosmosDBParserListener interface { // EnterConstant is called when entering the constant production. EnterConstant(c *ConstantContext) - // EnterObject_constant is called when entering the object_constant production. - EnterObject_constant(c *Object_constantContext) - - // EnterObject_constant_field_pair is called when entering the object_constant_field_pair production. - EnterObject_constant_field_pair(c *Object_constant_field_pairContext) - - // EnterArray_constant is called when entering the array_constant production. - EnterArray_constant(c *Array_constantContext) - - // EnterString_constant is called when entering the string_constant production. - EnterString_constant(c *String_constantContext) - // EnterUndefined_constant is called when entering the undefined_constant production. EnterUndefined_constant(c *Undefined_constantContext) @@ -103,6 +121,9 @@ type CosmosDBParserListener interface { // EnterNumber_constant is called when entering the number_constant production. EnterNumber_constant(c *Number_constantContext) + // EnterString_constant is called when entering the string_constant production. + EnterString_constant(c *String_constantContext) + // EnterString_literal is called when entering the string_literal production. EnterString_literal(c *String_literalContext) @@ -112,6 +133,9 @@ type CosmosDBParserListener interface { // EnterHexadecimal_literal is called when entering the hexadecimal_literal production. EnterHexadecimal_literal(c *Hexadecimal_literalContext) + // EnterIdentifier is called when entering the identifier production. + EnterIdentifier(c *IdentifierContext) + // EnterProperty_name is called when entering the property_name production. EnterProperty_name(c *Property_nameContext) @@ -130,6 +154,9 @@ type CosmosDBParserListener interface { // ExitSelect_clause is called when exiting the select_clause production. ExitSelect_clause(c *Select_clauseContext) + // ExitTop_clause is called when exiting the top_clause production. + ExitTop_clause(c *Top_clauseContext) + // ExitSelect_specification is called when exiting the select_specification production. ExitSelect_specification(c *Select_specificationContext) @@ -139,6 +166,21 @@ type CosmosDBParserListener interface { // ExitWhere_clause is called when exiting the where_clause production. ExitWhere_clause(c *Where_clauseContext) + // ExitGroup_by_clause is called when exiting the group_by_clause production. + ExitGroup_by_clause(c *Group_by_clauseContext) + + // ExitHaving_clause is called when exiting the having_clause production. + ExitHaving_clause(c *Having_clauseContext) + + // ExitOrder_by_clause is called when exiting the order_by_clause production. + ExitOrder_by_clause(c *Order_by_clauseContext) + + // ExitSort_expression is called when exiting the sort_expression production. + ExitSort_expression(c *Sort_expressionContext) + + // ExitOffset_limit_clause is called when exiting the offset_limit_clause production. + ExitOffset_limit_clause(c *Offset_limit_clauseContext) + // ExitFrom_specification is called when exiting the from_specification production. ExitFrom_specification(c *From_specificationContext) @@ -148,6 +190,9 @@ type CosmosDBParserListener interface { // ExitContainer_expression is called when exiting the container_expression production. ExitContainer_expression(c *Container_expressionContext) + // ExitJoin_clause is called when exiting the join_clause production. + ExitJoin_clause(c *Join_clauseContext) + // ExitContainer_name is called when exiting the container_name production. ExitContainer_name(c *Container_nameContext) @@ -163,15 +208,15 @@ type CosmosDBParserListener interface { // ExitScalar_expression is called when exiting the scalar_expression production. ExitScalar_expression(c *Scalar_expressionContext) - // ExitScalar_expression_in_where is called when exiting the scalar_expression_in_where production. - ExitScalar_expression_in_where(c *Scalar_expression_in_whereContext) - // ExitCreate_array_expression is called when exiting the create_array_expression production. ExitCreate_array_expression(c *Create_array_expressionContext) // ExitCreate_object_expression is called when exiting the create_object_expression production. ExitCreate_object_expression(c *Create_object_expressionContext) + // ExitObject_field_pair is called when exiting the object_field_pair production. + ExitObject_field_pair(c *Object_field_pairContext) + // ExitScalar_function_expression is called when exiting the scalar_function_expression production. ExitScalar_function_expression(c *Scalar_function_expressionContext) @@ -181,8 +226,17 @@ type CosmosDBParserListener interface { // ExitBuiltin_function_expression is called when exiting the builtin_function_expression production. ExitBuiltin_function_expression(c *Builtin_function_expressionContext) - // ExitBinary_operator is called when exiting the binary_operator production. - ExitBinary_operator(c *Binary_operatorContext) + // ExitMultiplicative_operator is called when exiting the multiplicative_operator production. + ExitMultiplicative_operator(c *Multiplicative_operatorContext) + + // ExitAdditive_operator is called when exiting the additive_operator production. + ExitAdditive_operator(c *Additive_operatorContext) + + // ExitShift_operator is called when exiting the shift_operator production. + ExitShift_operator(c *Shift_operatorContext) + + // ExitComparison_operator is called when exiting the comparison_operator production. + ExitComparison_operator(c *Comparison_operatorContext) // ExitUnary_operator is called when exiting the unary_operator production. ExitUnary_operator(c *Unary_operatorContext) @@ -193,18 +247,6 @@ type CosmosDBParserListener interface { // ExitConstant is called when exiting the constant production. ExitConstant(c *ConstantContext) - // ExitObject_constant is called when exiting the object_constant production. - ExitObject_constant(c *Object_constantContext) - - // ExitObject_constant_field_pair is called when exiting the object_constant_field_pair production. - ExitObject_constant_field_pair(c *Object_constant_field_pairContext) - - // ExitArray_constant is called when exiting the array_constant production. - ExitArray_constant(c *Array_constantContext) - - // ExitString_constant is called when exiting the string_constant production. - ExitString_constant(c *String_constantContext) - // ExitUndefined_constant is called when exiting the undefined_constant production. ExitUndefined_constant(c *Undefined_constantContext) @@ -217,6 +259,9 @@ type CosmosDBParserListener interface { // ExitNumber_constant is called when exiting the number_constant production. ExitNumber_constant(c *Number_constantContext) + // ExitString_constant is called when exiting the string_constant production. + ExitString_constant(c *String_constantContext) + // ExitString_literal is called when exiting the string_literal production. ExitString_literal(c *String_literalContext) @@ -226,6 +271,9 @@ type CosmosDBParserListener interface { // ExitHexadecimal_literal is called when exiting the hexadecimal_literal production. ExitHexadecimal_literal(c *Hexadecimal_literalContext) + // ExitIdentifier is called when exiting the identifier production. + ExitIdentifier(c *IdentifierContext) + // ExitProperty_name is called when exiting the property_name production. ExitProperty_name(c *Property_nameContext) diff --git a/cosmosdb/cosmosdbparser_visitor.go b/cosmosdb/cosmosdbparser_visitor.go index 05fa330..84215ca 100644 --- a/cosmosdb/cosmosdbparser_visitor.go +++ b/cosmosdb/cosmosdbparser_visitor.go @@ -16,6 +16,9 @@ type CosmosDBParserVisitor interface { // Visit a parse tree produced by CosmosDBParser#select_clause. VisitSelect_clause(ctx *Select_clauseContext) interface{} + // Visit a parse tree produced by CosmosDBParser#top_clause. + VisitTop_clause(ctx *Top_clauseContext) interface{} + // Visit a parse tree produced by CosmosDBParser#select_specification. VisitSelect_specification(ctx *Select_specificationContext) interface{} @@ -25,6 +28,21 @@ type CosmosDBParserVisitor interface { // Visit a parse tree produced by CosmosDBParser#where_clause. VisitWhere_clause(ctx *Where_clauseContext) interface{} + // Visit a parse tree produced by CosmosDBParser#group_by_clause. + VisitGroup_by_clause(ctx *Group_by_clauseContext) interface{} + + // Visit a parse tree produced by CosmosDBParser#having_clause. + VisitHaving_clause(ctx *Having_clauseContext) interface{} + + // Visit a parse tree produced by CosmosDBParser#order_by_clause. + VisitOrder_by_clause(ctx *Order_by_clauseContext) interface{} + + // Visit a parse tree produced by CosmosDBParser#sort_expression. + VisitSort_expression(ctx *Sort_expressionContext) interface{} + + // Visit a parse tree produced by CosmosDBParser#offset_limit_clause. + VisitOffset_limit_clause(ctx *Offset_limit_clauseContext) interface{} + // Visit a parse tree produced by CosmosDBParser#from_specification. VisitFrom_specification(ctx *From_specificationContext) interface{} @@ -34,6 +52,9 @@ type CosmosDBParserVisitor interface { // Visit a parse tree produced by CosmosDBParser#container_expression. VisitContainer_expression(ctx *Container_expressionContext) interface{} + // Visit a parse tree produced by CosmosDBParser#join_clause. + VisitJoin_clause(ctx *Join_clauseContext) interface{} + // Visit a parse tree produced by CosmosDBParser#container_name. VisitContainer_name(ctx *Container_nameContext) interface{} @@ -49,15 +70,15 @@ type CosmosDBParserVisitor interface { // Visit a parse tree produced by CosmosDBParser#scalar_expression. VisitScalar_expression(ctx *Scalar_expressionContext) interface{} - // Visit a parse tree produced by CosmosDBParser#scalar_expression_in_where. - VisitScalar_expression_in_where(ctx *Scalar_expression_in_whereContext) interface{} - // Visit a parse tree produced by CosmosDBParser#create_array_expression. VisitCreate_array_expression(ctx *Create_array_expressionContext) interface{} // Visit a parse tree produced by CosmosDBParser#create_object_expression. VisitCreate_object_expression(ctx *Create_object_expressionContext) interface{} + // Visit a parse tree produced by CosmosDBParser#object_field_pair. + VisitObject_field_pair(ctx *Object_field_pairContext) interface{} + // Visit a parse tree produced by CosmosDBParser#scalar_function_expression. VisitScalar_function_expression(ctx *Scalar_function_expressionContext) interface{} @@ -67,8 +88,17 @@ type CosmosDBParserVisitor interface { // Visit a parse tree produced by CosmosDBParser#builtin_function_expression. VisitBuiltin_function_expression(ctx *Builtin_function_expressionContext) interface{} - // Visit a parse tree produced by CosmosDBParser#binary_operator. - VisitBinary_operator(ctx *Binary_operatorContext) interface{} + // Visit a parse tree produced by CosmosDBParser#multiplicative_operator. + VisitMultiplicative_operator(ctx *Multiplicative_operatorContext) interface{} + + // Visit a parse tree produced by CosmosDBParser#additive_operator. + VisitAdditive_operator(ctx *Additive_operatorContext) interface{} + + // Visit a parse tree produced by CosmosDBParser#shift_operator. + VisitShift_operator(ctx *Shift_operatorContext) interface{} + + // Visit a parse tree produced by CosmosDBParser#comparison_operator. + VisitComparison_operator(ctx *Comparison_operatorContext) interface{} // Visit a parse tree produced by CosmosDBParser#unary_operator. VisitUnary_operator(ctx *Unary_operatorContext) interface{} @@ -79,18 +109,6 @@ type CosmosDBParserVisitor interface { // Visit a parse tree produced by CosmosDBParser#constant. VisitConstant(ctx *ConstantContext) interface{} - // Visit a parse tree produced by CosmosDBParser#object_constant. - VisitObject_constant(ctx *Object_constantContext) interface{} - - // Visit a parse tree produced by CosmosDBParser#object_constant_field_pair. - VisitObject_constant_field_pair(ctx *Object_constant_field_pairContext) interface{} - - // Visit a parse tree produced by CosmosDBParser#array_constant. - VisitArray_constant(ctx *Array_constantContext) interface{} - - // Visit a parse tree produced by CosmosDBParser#string_constant. - VisitString_constant(ctx *String_constantContext) interface{} - // Visit a parse tree produced by CosmosDBParser#undefined_constant. VisitUndefined_constant(ctx *Undefined_constantContext) interface{} @@ -103,6 +121,9 @@ type CosmosDBParserVisitor interface { // Visit a parse tree produced by CosmosDBParser#number_constant. VisitNumber_constant(ctx *Number_constantContext) interface{} + // Visit a parse tree produced by CosmosDBParser#string_constant. + VisitString_constant(ctx *String_constantContext) interface{} + // Visit a parse tree produced by CosmosDBParser#string_literal. VisitString_literal(ctx *String_literalContext) interface{} @@ -112,6 +133,9 @@ type CosmosDBParserVisitor interface { // Visit a parse tree produced by CosmosDBParser#hexadecimal_literal. VisitHexadecimal_literal(ctx *Hexadecimal_literalContext) interface{} + // Visit a parse tree produced by CosmosDBParser#identifier. + VisitIdentifier(ctx *IdentifierContext) interface{} + // Visit a parse tree produced by CosmosDBParser#property_name. VisitProperty_name(ctx *Property_nameContext) interface{} diff --git a/cosmosdb/examples/aggregation.sql b/cosmosdb/examples/aggregation.sql new file mode 100644 index 0000000..b0c8a00 --- /dev/null +++ b/cosmosdb/examples/aggregation.sql @@ -0,0 +1 @@ +SELECT COUNT(1) AS totalRecords FROM c diff --git a/cosmosdb/examples/between_expression.sql b/cosmosdb/examples/between_expression.sql new file mode 100644 index 0000000..bd2de18 --- /dev/null +++ b/cosmosdb/examples/between_expression.sql @@ -0,0 +1 @@ +SELECT * FROM c WHERE c.population BETWEEN 100000 AND 5000000 diff --git a/cosmosdb/examples/distinct_value.sql b/cosmosdb/examples/distinct_value.sql new file mode 100644 index 0000000..7822679 --- /dev/null +++ b/cosmosdb/examples/distinct_value.sql @@ -0,0 +1 @@ +SELECT DISTINCT VALUE c.countryRegion FROM c diff --git a/cosmosdb/examples/geospatial.sql b/cosmosdb/examples/geospatial.sql new file mode 100644 index 0000000..679869c --- /dev/null +++ b/cosmosdb/examples/geospatial.sql @@ -0,0 +1 @@ +SELECT c.name, ST_DISTANCE(c.location, {"type": "Point", "coordinates": [55.2708, 25.2048]}) AS distFromDubaiInMeters FROM c diff --git a/cosmosdb/examples/group_by.sql b/cosmosdb/examples/group_by.sql new file mode 100644 index 0000000..86b84b1 --- /dev/null +++ b/cosmosdb/examples/group_by.sql @@ -0,0 +1 @@ +SELECT c.country, COUNT(1) AS cityCount FROM c GROUP BY c.country diff --git a/cosmosdb/examples/in_expression.sql b/cosmosdb/examples/in_expression.sql new file mode 100644 index 0000000..264a814 --- /dev/null +++ b/cosmosdb/examples/in_expression.sql @@ -0,0 +1 @@ +SELECT * FROM c WHERE c.country IN ("US", "UK", "CA") diff --git a/cosmosdb/examples/math_functions.sql b/cosmosdb/examples/math_functions.sql new file mode 100644 index 0000000..56d9aad --- /dev/null +++ b/cosmosdb/examples/math_functions.sql @@ -0,0 +1 @@ +SELECT c.name, ROUND(StringToNumber(c.latitude)) AS lat FROM c diff --git a/cosmosdb/examples/not_equal.sql b/cosmosdb/examples/not_equal.sql new file mode 100644 index 0000000..0ae71fd --- /dev/null +++ b/cosmosdb/examples/not_equal.sql @@ -0,0 +1 @@ +SELECT * FROM c WHERE c.status != "inactive" diff --git a/cosmosdb/examples/offset_limit.sql b/cosmosdb/examples/offset_limit.sql new file mode 100644 index 0000000..5c22348 --- /dev/null +++ b/cosmosdb/examples/offset_limit.sql @@ -0,0 +1 @@ +SELECT * FROM c ORDER BY c.name OFFSET 0 LIMIT 10 diff --git a/cosmosdb/examples/order_by.sql b/cosmosdb/examples/order_by.sql new file mode 100644 index 0000000..73e780b --- /dev/null +++ b/cosmosdb/examples/order_by.sql @@ -0,0 +1 @@ +SELECT c.name, c.population FROM c ORDER BY c.population DESC diff --git a/cosmosdb/examples/select_functions.sql b/cosmosdb/examples/select_functions.sql new file mode 100644 index 0000000..70f04e3 --- /dev/null +++ b/cosmosdb/examples/select_functions.sql @@ -0,0 +1 @@ +SELECT CONCAT(c.name, ' - ', c.country) AS label, StringToNumber(c.population) / 1000 AS populationInThousands FROM c diff --git a/cosmosdb/examples/select_top.sql b/cosmosdb/examples/select_top.sql new file mode 100644 index 0000000..79d77c0 --- /dev/null +++ b/cosmosdb/examples/select_top.sql @@ -0,0 +1 @@ +SELECT TOP 10 * FROM c diff --git a/cosmosdb/examples/string_functions.sql b/cosmosdb/examples/string_functions.sql new file mode 100644 index 0000000..1c063d8 --- /dev/null +++ b/cosmosdb/examples/string_functions.sql @@ -0,0 +1 @@ +SELECT UPPER(c.name) AS upperName, LOWER(c.country) AS lowerCountry, LENGTH(c.name) AS nameLen FROM c diff --git a/cosmosdb/examples/type_check_functions.sql b/cosmosdb/examples/type_check_functions.sql new file mode 100644 index 0000000..4db6982 --- /dev/null +++ b/cosmosdb/examples/type_check_functions.sql @@ -0,0 +1 @@ +SELECT c.name, IS_STRING(c.name) AS isStr, IS_NUMBER(c.population) AS isNum, IS_DEFINED(c.extra) AS isDef FROM c diff --git a/cosmosdb/examples/underscore_fields.sql b/cosmosdb/examples/underscore_fields.sql new file mode 100644 index 0000000..709e752 --- /dev/null +++ b/cosmosdb/examples/underscore_fields.sql @@ -0,0 +1 @@ +SELECT c._ts, c._etag, c._rid FROM c WHERE c._ts > 1000 diff --git a/cosmosdb/examples/value_count.sql b/cosmosdb/examples/value_count.sql new file mode 100644 index 0000000..7894bb4 --- /dev/null +++ b/cosmosdb/examples/value_count.sql @@ -0,0 +1 @@ +SELECT VALUE COUNT(1) FROM c diff --git a/cosmosdb/examples/value_keyword.sql b/cosmosdb/examples/value_keyword.sql new file mode 100644 index 0000000..4362621 --- /dev/null +++ b/cosmosdb/examples/value_keyword.sql @@ -0,0 +1 @@ +SELECT VALUE c.name FROM c WHERE c.country = "AE" diff --git a/cosmosdb/examples/where_operators.sql b/cosmosdb/examples/where_operators.sql new file mode 100644 index 0000000..f1882a4 --- /dev/null +++ b/cosmosdb/examples/where_operators.sql @@ -0,0 +1 @@ +SELECT * FROM c WHERE c.countryRegion != "4" AND c._ts > 1743702439