From caacf604bbf3f96a47f94bb47d7abc0aafdd3754 Mon Sep 17 00:00:00 2001 From: Jeckerson Date: Wed, 10 Jun 2026 20:00:20 +0000 Subject: [PATCH] Sync changes from phalcon/cphalcon#17109 --- c/parser.php.lemon | 41 +- c/scanner.re | 101 +- resources/files/parser.php | 5698 ++++++++++------- src/Parser.php | 9 + src/Scanner/Opcode.php | 24 +- src/Scanner/Scanner.php | 101 +- .../unit/Phql/Select/CustomOperatorsTest.php | 232 + tests/unit/Scanner/ScannerTest.php | 36 +- 8 files changed, 3815 insertions(+), 2427 deletions(-) create mode 100644 tests/unit/Phql/Select/CustomOperatorsTest.php diff --git a/c/parser.php.lemon b/c/parser.php.lemon index 5d8ee12..9c6eeb6 100644 --- a/c/parser.php.lemon +++ b/c/parser.php.lemon @@ -16,15 +16,16 @@ %right AGAINST . %left BETWEEN BETWEEN_NOT . -%left EQUALS NOTEQUALS LESS GREATER GREATEREQUAL LESSEQUAL . +%left EQUALS NOTEQUALS LESS GREATER GREATEREQUAL LESSEQUAL OP_MATCHES OP_CONTAINS OP_CONTAINED OP_OVERLAPS . %left AND OR . %left LIKE ILIKE . %left BITWISE_AND BITWISE_OR BITWISE_XOR . %left DIVIDE TIMES MOD . -%left PLUS MINUS . +%left PLUS MINUS OP_CONCAT . %left IS . %right IN . %right NOT BITWISE_NOT . +%left OP_JSON_GET OP_JSON_GET_TEXT OP_JSON_PATH OP_JSON_PATH_TEXT . %left COMMA . %include { @@ -701,6 +702,42 @@ expr(R) ::= expr(O1) BITWISE_XOR expr(O2) . { phql_ret_expr(&R, PHQL_T_BITWISE_XOR, &O1, &O2); } +expr(R) ::= expr(O1) OP_MATCHES expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_MATCHES, &O1, &O2); +} + +expr(R) ::= expr(O1) OP_CONTAINS expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_CONTAINS, &O1, &O2); +} + +expr(R) ::= expr(O1) OP_CONTAINED expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_CONTAINED, &O1, &O2); +} + +expr(R) ::= expr(O1) OP_OVERLAPS expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_OVERLAPS, &O1, &O2); +} + +expr(R) ::= expr(O1) OP_CONCAT expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_CONCAT, &O1, &O2); +} + +expr(R) ::= expr(O1) OP_JSON_GET expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_JSON_GET, &O1, &O2); +} + +expr(R) ::= expr(O1) OP_JSON_GET_TEXT expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_JSON_GET_TEXT, &O1, &O2); +} + +expr(R) ::= expr(O1) OP_JSON_PATH expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_JSON_PATH, &O1, &O2); +} + +expr(R) ::= expr(O1) OP_JSON_PATH_TEXT expr(O2) . { + phql_ret_expr(&R, PHQL_T_OP_JSON_PATH_TEXT, &O1, &O2); +} + expr(R) ::= expr(O1) EQUALS expr(O2) . { phql_ret_expr(&R, PHQL_T_EQUALS, &O1, &O2); } diff --git a/c/scanner.re b/c/scanner.re index 453a676..86de875 100644 --- a/c/scanner.re +++ b/c/scanner.re @@ -55,6 +55,9 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { case '"': $yystate = 8; break 2; + case '#': + $yystate = 319; + break 2; case '%': $yystate = 9; break 2; @@ -270,10 +273,6 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { case 6: $yych = $yyinput[$yycursor]; switch ($yych) { - case '!': - $yycursor += 1; - $yystate = 65; - break 2; case '=': $yycursor += 1; $yystate = 66; @@ -354,10 +353,16 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { return 0; case 18: - - token->opcode = PHQL_T_SUB; - return 0; - + $yych = $yyinput[$yycursor]; + switch ($yych) { + case '>': + $yycursor += 1; + $yystate = 323; + break 2; + default: + $yystate = 324; + break 2; + } case 19: $yych = $yyinput[$yycursor]; switch ($yych) { @@ -528,6 +533,10 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { $yycursor += 1; $yystate = 81; break 2; + case '@': + $yycursor += 1; + $yystate = 327; + break 2; default: $yystate = 27; break 2; @@ -1346,11 +1355,6 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { token->opcode = PHQL_T_BITWISE_NOT; return 0; - case 65: - - token->opcode = PHQL_T_TS_NEGATE; - return 0; - case 66: token->opcode = PHQL_T_NOTEQUALS; @@ -1415,7 +1419,7 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { } case 72: - token->opcode = PHQL_T_TS_AND; + token->opcode = PHQL_T_OP_OVERLAPS; return 0; case 73: @@ -1635,12 +1639,12 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { case 85: - token->opcode = PHQL_T_TS_CONTAINS_ANOTHER; + token->opcode = PHQL_T_OP_CONTAINS; return 0; case 86: - token->opcode = PHQL_T_TS_MATCHES; + token->opcode = PHQL_T_OP_MATCHES; return 0; case 87: @@ -2783,7 +2787,7 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { } case 141: - token->opcode = PHQL_T_TS_OR; + token->opcode = PHQL_T_OP_CONCAT; return 0; case 142: @@ -7473,6 +7477,69 @@ int phql_get_token(phql_scanner_state *s, phql_scanner_token *token) { token->opcode = PHQL_T_BETWEEN_NOT; return 0; + case 319: + $yych = $yyinput[$yycursor]; + switch ($yych) { + case '>': + $yycursor += 1; + $yystate = 320; + break 2; + default: + $yystate = 3; + break 2; + } + case 320: + $yych = $yyinput[$yycursor]; + switch ($yych) { + case '>': + $yycursor += 1; + $yystate = 321; + break 2; + default: + $yystate = 322; + break 2; + } + case 321: + + token->opcode = PHQL_T_OP_JSON_PATH_TEXT; + return 0; + + case 322: + + token->opcode = PHQL_T_OP_JSON_PATH; + return 0; + + case 323: + $yych = $yyinput[$yycursor]; + switch ($yych) { + case '>': + $yycursor += 1; + $yystate = 325; + break 2; + default: + $yystate = 326; + break 2; + } + case 324: + + token->opcode = PHQL_T_SUB; + return 0; + + case 325: + + token->opcode = PHQL_T_OP_JSON_GET_TEXT; + return 0; + + case 326: + + token->opcode = PHQL_T_OP_JSON_GET; + return 0; + + case 327: + + token->opcode = PHQL_T_OP_CONTAINED; + return 0; + default: throw new \Exception("internal lexer error"); } diff --git a/resources/files/parser.php b/resources/files/parser.php index 172f571..9446677 100644 --- a/resources/files/parser.php +++ b/resources/files/parser.php @@ -39,12 +39,12 @@ public function getOutput(): mixed } const PHQL_AGAINST = 1; /* Index of top element in stack */ - const PHQL_ALL = 30; /* Shifts left before out of the error */ + const PHQL_ALL = 39; /* Shifts left before out of the error */ // phql_ARG_SDECL /* A place to hold %extra_argument */ /* The parser's stack */ - const PHQL_AND = 10; /* of YYSTACKDEPTH elements */ - const PHQL_AS = 33; - const PHQL_ASC = 54; + const PHQL_AND = 14; /* of YYSTACKDEPTH elements */ + const PHQL_AS = 42; + const PHQL_ASC = 63; /* Next is all token values, in a form suitable for use by makeheaders. @@ -59,83 +59,92 @@ public function getOutput(): mixed */ const PHQL_BETWEEN = 2; const PHQL_BETWEEN_NOT = 3; - const PHQL_BITWISE_AND = 14; - const PHQL_BITWISE_NOT = 25; - const PHQL_BITWISE_OR = 15; - const PHQL_BITWISE_XOR = 16; - const PHQL_BPLACEHOLDER = 65; - const PHQL_BY = 53; - const PHQL_CASE = 70; - const PHQL_CAST = 67; - const PHQL_COMMA = 26; - const PHQL_CONVERT = 68; - const PHQL_CROSS = 36; - const PHQL_DELETE = 49; - const PHQL_DESC = 55; - const PHQL_DISTINCT = 29; - const PHQL_DIVIDE = 17; - const PHQL_DOT = 32; - const PHQL_DOUBLE = 77; - const PHQL_ELSE = 74; - const PHQL_END = 71; + const PHQL_BITWISE_AND = 18; + const PHQL_BITWISE_NOT = 30; + const PHQL_BITWISE_OR = 19; + const PHQL_BITWISE_XOR = 20; + const PHQL_BPLACEHOLDER = 74; + const PHQL_BY = 62; + const PHQL_CASE = 79; + const PHQL_CAST = 76; + const PHQL_COMMA = 35; + const PHQL_CONVERT = 77; + const PHQL_CROSS = 45; + const PHQL_DELETE = 58; + const PHQL_DESC = 64; + const PHQL_DISTINCT = 38; + const PHQL_DIVIDE = 21; + const PHQL_DOT = 41; + const PHQL_DOUBLE = 86; + const PHQL_ELSE = 83; + const PHQL_END = 80; const PHQL_EQUALS = 4; - const PHQL_EXISTS = 66; - const PHQL_FALSE = 79; - const PHQL_FOR = 58; - const PHQL_FROM = 28; - const PHQL_FULL = 40; + const PHQL_EXISTS = 75; + const PHQL_FALSE = 88; + const PHQL_FOR = 67; + const PHQL_FROM = 37; + const PHQL_FULL = 49; const PHQL_GREATER = 7; const PHQL_GREATEREQUAL = 8; - const PHQL_GROUP = 56; - const PHQL_HAVING = 57; - const PHQL_HINTEGER = 62; - const PHQL_IDENTIFIER = 31; - const PHQL_ILIKE = 13; - const PHQL_IN = 23; - const PHQL_INNER = 34; - const PHQL_INSERT = 42; - const PHQL_INTEGER = 61; - const PHQL_INTO = 43; - const PHQL_IS = 22; - const PHQL_JOIN = 35; - const PHQL_LEFT = 37; + const PHQL_GROUP = 65; + const PHQL_HAVING = 66; + const PHQL_HINTEGER = 71; + const PHQL_IDENTIFIER = 40; + const PHQL_ILIKE = 17; + const PHQL_IN = 28; + const PHQL_INNER = 43; + const PHQL_INSERT = 51; + const PHQL_INTEGER = 70; + const PHQL_INTO = 52; + const PHQL_IS = 27; + const PHQL_JOIN = 44; + const PHQL_LEFT = 46; const PHQL_LESS = 6; const PHQL_LESSEQUAL = 9; - const PHQL_LIKE = 12; - const PHQL_LIMIT = 59; - const PHQL_MINUS = 21; - const PHQL_MOD = 19; - const PHQL_NOT = 24; + const PHQL_LIKE = 16; + const PHQL_LIMIT = 68; + const PHQL_MINUS = 25; + const PHQL_MOD = 23; + const PHQL_NOT = 29; const PHQL_NOTEQUALS = 5; - const PHQL_NPLACEHOLDER = 63; - const PHQL_NULL = 75; - const PHQL_OFFSET = 60; - const PHQL_ON = 41; - const PHQL_OR = 11; - const PHQL_ORDER = 52; - const PHQL_OUTER = 38; - const PHQL_PARENTHESES_CLOSE = 46; - const PHQL_PARENTHESES_OPEN = 45; - const PHQL_PLUS = 20; - const PHQL_RIGHT = 39; - const PHQL_SELECT = 27; - const PHQL_SET = 48; - const PHQL_SPLACEHOLDER = 64; - const PHQL_STRING = 76; - const PHQL_THEN = 73; - const PHQL_TIMES = 18; - const PHQL_TRUE = 78; - const PHQL_UPDATE = 47; - const PHQL_USING = 69; - const PHQL_VALUES = 44; - const PHQL_WHEN = 72; - const PHQL_WHERE = 51; - const PHQL_WITH = 50; - const YYERRORSYMBOL = 80; - const YYNOCODE = 135; - const YYWILDCARD = 135; /* No %wildcard in this grammar; use YYNOCODE so the wildcard path never matches */ - const YYNRULE = 162; - const YYNSTATE = 295; + const PHQL_NPLACEHOLDER = 72; + const PHQL_NULL = 84; + const PHQL_OFFSET = 69; + const PHQL_ON = 50; + const PHQL_OP_CONCAT = 26; + const PHQL_OP_CONTAINED = 12; + const PHQL_OP_CONTAINS = 11; + const PHQL_OP_JSON_GET = 31; + const PHQL_OP_JSON_GET_TEXT = 32; + const PHQL_OP_JSON_PATH = 33; + const PHQL_OP_JSON_PATH_TEXT = 34; + const PHQL_OP_MATCHES = 10; + const PHQL_OP_OVERLAPS = 13; + const PHQL_OR = 15; + const PHQL_ORDER = 61; + const PHQL_OUTER = 47; + const PHQL_PARENTHESES_CLOSE = 55; + const PHQL_PARENTHESES_OPEN = 54; + const PHQL_PLUS = 24; + const PHQL_RIGHT = 48; + const PHQL_SELECT = 36; + const PHQL_SET = 57; + const PHQL_SPLACEHOLDER = 73; + const PHQL_STRING = 85; + const PHQL_THEN = 82; + const PHQL_TIMES = 22; + const PHQL_TRUE = 87; + const PHQL_UPDATE = 56; + const PHQL_USING = 78; + const PHQL_VALUES = 53; + const PHQL_WHEN = 81; + const PHQL_WHERE = 60; + const PHQL_WITH = 59; + const YYERRORSYMBOL = 89; + const YYNOCODE = 144; + const YYWILDCARD = 144; /* No %wildcard in this grammar; use YYNOCODE so the wildcard path never matches */ + const YYNRULE = 171; + const YYNSTATE = 313; const YYSTACKDEPTH = 100; /* The next thing included is series of defines which control ** various aspects of the generated parser. @@ -170,11 +179,11 @@ public function getOutput(): mixed ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. */ - const YY_REDUCE_MAX = 90; + const YY_REDUCE_MAX = 312; #define phql_TOKENTYPE phql_parser_token* - const YY_REDUCE_USE_DFLT = -67; - const YY_SHIFT_MAX = 192; - const YY_SHIFT_USE_DFLT = -3; + const YY_REDUCE_USE_DFLT = -1; + const YY_SHIFT_MAX = 312; + const YY_SHIFT_USE_DFLT = -37; var $YY_ACCEPT_ACTION; /* since we cant use expressions to initialize these as class @@ -240,333 +249,351 @@ public function getOutput(): mixed * unsigned char nrhs; // Number of right-hand side symbols in the rule * } yyRuleInfo[] = { */ - static $yyRuleInfo = [ - 81, + static $yyRuleInfo = [ + 90, 1, - 82, + 91, 1, - 82, + 91, 1, - 82, + 91, 1, - 82, + 91, 1, - 83, + 92, 7, - 87, + 96, 6, - 94, + 103, 1, - 94, + 103, 1, - 94, + 103, 0, - 95, + 104, 3, - 95, + 104, 1, - 98, + 107, 1, - 98, + 107, 3, - 98, + 107, 3, - 98, + 107, 2, - 98, + 107, 1, - 96, + 105, 3, - 96, + 105, 1, - 97, + 106, 1, - 97, + 106, 0, - 101, + 110, 2, - 101, + 110, 1, - 102, + 111, 1, - 103, + 112, 4, - 106, + 115, 2, - 106, + 115, 1, - 106, + 115, 0, - 104, + 113, 2, - 104, + 113, 2, - 104, + 113, 3, - 104, + 113, 2, - 104, + 113, 3, - 104, + 113, 2, - 104, + 113, 3, - 104, + 113, 2, - 104, + 113, 1, - 107, + 116, 2, - 107, + 116, 0, - 84, + 93, 7, - 84, + 93, 10, - 108, + 117, 3, - 108, + 117, 1, - 111, + 120, 1, - 109, + 118, 3, - 109, + 118, 1, - 112, + 121, 1, - 85, + 94, 3, - 113, + 122, 4, - 115, + 124, 3, - 115, + 124, 1, - 116, + 125, 3, - 118, + 127, 1, - 86, + 95, 3, - 119, + 128, 3, - 100, + 109, 3, - 100, + 109, 2, - 100, + 109, 1, - 100, + 109, 5, - 100, + 109, 7, - 100, + 109, 6, - 100, + 109, 4, - 100, + 109, 5, - 100, + 109, 3, - 121, + 130, 3, - 121, + 130, 1, - 120, + 129, 1, - 105, + 114, 1, - 88, + 97, 2, - 88, + 97, 0, - 91, + 100, 3, - 91, + 100, 0, - 122, + 131, 3, - 122, + 131, 1, - 123, + 132, 1, - 123, + 132, 2, - 123, + 132, 2, - 89, + 98, 3, - 89, + 98, 0, - 124, + 133, 3, - 124, + 133, 1, - 125, + 134, 1, - 90, + 99, 2, - 90, + 99, 0, - 93, + 102, 2, - 93, + 102, 0, - 92, + 101, 2, - 92, + 101, 4, - 92, + 101, 4, - 92, + 101, 0, - 114, + 123, 2, - 114, + 123, 0, - 126, + 135, 1, - 126, + 135, 1, - 126, + 135, 1, - 126, + 135, 1, - 126, + 135, 1, - 99, + 108, 2, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, + 3, + 108, + 3, + 108, + 3, + 108, + 3, + 108, + 3, + 108, + 3, + 108, + 3, + 108, + 3, + 108, + 3, + 108, 4, - 99, + 108, 3, - 99, + 108, 4, - 99, + 108, 5, - 99, + 108, 6, - 99, + 108, 3, - 99, + 108, 5, - 99, + 108, 6, - 99, + 108, 4, - 99, + 108, 3, - 99, + 108, 6, - 99, + 108, 6, - 99, + 108, 4, - 128, + 137, 2, - 128, + 137, 1, - 129, + 138, 4, - 129, + 138, 2, - 99, + 108, 1, - 130, + 139, 5, - 131, + 140, 1, - 131, + 140, 0, - 132, + 141, 1, - 132, + 141, 0, - 127, + 136, 3, - 127, + 136, 1, - 133, + 142, 1, - 133, + 142, 1, - 99, + 108, 3, - 99, + 108, 4, - 99, + 108, 3, - 99, + 108, 3, - 99, + 108, 2, - 99, + 108, 2, - 99, + 108, 3, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 99, + 108, 1, - 117, + 126, 3, - 117, + 126, 1, ]; - static $yyRuleName = [ + static $yyRuleName = [ /* 0 */ "program ::= query_language", /* 1 */ @@ -784,115 +811,133 @@ public function getOutput(): mixed /* 107 */ "expr ::= expr BITWISE_XOR expr", /* 108 */ - "expr ::= expr EQUALS expr", + "expr ::= expr OP_MATCHES expr", /* 109 */ - "expr ::= expr NOTEQUALS expr", + "expr ::= expr OP_CONTAINS expr", /* 110 */ - "expr ::= expr LESS expr", + "expr ::= expr OP_CONTAINED expr", /* 111 */ - "expr ::= expr GREATER expr", + "expr ::= expr OP_OVERLAPS expr", /* 112 */ - "expr ::= expr GREATEREQUAL expr", + "expr ::= expr OP_CONCAT expr", /* 113 */ - "expr ::= expr LESSEQUAL expr", + "expr ::= expr OP_JSON_GET expr", /* 114 */ - "expr ::= expr LIKE expr", + "expr ::= expr OP_JSON_GET_TEXT expr", /* 115 */ - "expr ::= expr NOT LIKE expr", + "expr ::= expr OP_JSON_PATH expr", /* 116 */ - "expr ::= expr ILIKE expr", + "expr ::= expr OP_JSON_PATH_TEXT expr", /* 117 */ - "expr ::= expr NOT ILIKE expr", + "expr ::= expr EQUALS expr", /* 118 */ - "expr ::= expr IN PARENTHESES_OPEN argument_list PARENTHESES_CLOSE", + "expr ::= expr NOTEQUALS expr", /* 119 */ - "expr ::= expr NOT IN PARENTHESES_OPEN argument_list PARENTHESES_CLOSE", + "expr ::= expr LESS expr", /* 120 */ - "expr ::= PARENTHESES_OPEN select_statement PARENTHESES_CLOSE", + "expr ::= expr GREATER expr", /* 121 */ - "expr ::= expr IN PARENTHESES_OPEN select_statement PARENTHESES_CLOSE", + "expr ::= expr GREATEREQUAL expr", /* 122 */ - "expr ::= expr NOT IN PARENTHESES_OPEN select_statement PARENTHESES_CLOSE", + "expr ::= expr LESSEQUAL expr", /* 123 */ - "expr ::= EXISTS PARENTHESES_OPEN select_statement PARENTHESES_CLOSE", + "expr ::= expr LIKE expr", /* 124 */ - "expr ::= expr AGAINST expr", + "expr ::= expr NOT LIKE expr", /* 125 */ - "expr ::= CAST PARENTHESES_OPEN expr AS IDENTIFIER PARENTHESES_CLOSE", + "expr ::= expr ILIKE expr", /* 126 */ - "expr ::= CONVERT PARENTHESES_OPEN expr USING IDENTIFIER PARENTHESES_CLOSE", + "expr ::= expr NOT ILIKE expr", /* 127 */ - "expr ::= CASE expr when_clauses END", + "expr ::= expr IN PARENTHESES_OPEN argument_list PARENTHESES_CLOSE", /* 128 */ - "when_clauses ::= when_clauses when_clause", + "expr ::= expr NOT IN PARENTHESES_OPEN argument_list PARENTHESES_CLOSE", /* 129 */ - "when_clauses ::= when_clause", + "expr ::= PARENTHESES_OPEN select_statement PARENTHESES_CLOSE", /* 130 */ - "when_clause ::= WHEN expr THEN expr", + "expr ::= expr IN PARENTHESES_OPEN select_statement PARENTHESES_CLOSE", /* 131 */ - "when_clause ::= ELSE expr", + "expr ::= expr NOT IN PARENTHESES_OPEN select_statement PARENTHESES_CLOSE", /* 132 */ - "expr ::= function_call", + "expr ::= EXISTS PARENTHESES_OPEN select_statement PARENTHESES_CLOSE", /* 133 */ - "function_call ::= IDENTIFIER PARENTHESES_OPEN distinct_or_null argument_list_or_null PARENTHESES_CLOSE", + "expr ::= expr AGAINST expr", /* 134 */ - "distinct_or_null ::= DISTINCT", + "expr ::= CAST PARENTHESES_OPEN expr AS IDENTIFIER PARENTHESES_CLOSE", /* 135 */ - "distinct_or_null ::=", + "expr ::= CONVERT PARENTHESES_OPEN expr USING IDENTIFIER PARENTHESES_CLOSE", /* 136 */ - "argument_list_or_null ::= argument_list", + "expr ::= CASE expr when_clauses END", /* 137 */ - "argument_list_or_null ::=", + "when_clauses ::= when_clauses when_clause", /* 138 */ - "argument_list ::= argument_list COMMA argument_item", + "when_clauses ::= when_clause", /* 139 */ - "argument_list ::= argument_item", + "when_clause ::= WHEN expr THEN expr", /* 140 */ - "argument_item ::= TIMES", + "when_clause ::= ELSE expr", /* 141 */ - "argument_item ::= expr", + "expr ::= function_call", /* 142 */ - "expr ::= expr IS NULL", + "function_call ::= IDENTIFIER PARENTHESES_OPEN distinct_or_null argument_list_or_null PARENTHESES_CLOSE", /* 143 */ - "expr ::= expr IS NOT NULL", + "distinct_or_null ::= DISTINCT", /* 144 */ - "expr ::= expr BETWEEN expr", + "distinct_or_null ::=", /* 145 */ - "expr ::= expr BETWEEN_NOT expr", + "argument_list_or_null ::= argument_list", /* 146 */ - "expr ::= NOT expr", + "argument_list_or_null ::=", /* 147 */ - "expr ::= BITWISE_NOT expr", + "argument_list ::= argument_list COMMA argument_item", /* 148 */ - "expr ::= PARENTHESES_OPEN expr PARENTHESES_CLOSE", + "argument_list ::= argument_item", /* 149 */ - "expr ::= qualified_name", + "argument_item ::= TIMES", /* 150 */ - "expr ::= INTEGER", + "argument_item ::= expr", /* 151 */ - "expr ::= HINTEGER", + "expr ::= expr IS NULL", /* 152 */ - "expr ::= STRING", + "expr ::= expr IS NOT NULL", /* 153 */ - "expr ::= DOUBLE", + "expr ::= expr BETWEEN expr", /* 154 */ - "expr ::= NULL", + "expr ::= expr BETWEEN_NOT expr", /* 155 */ - "expr ::= TRUE", + "expr ::= NOT expr", /* 156 */ - "expr ::= FALSE", + "expr ::= BITWISE_NOT expr", /* 157 */ - "expr ::= NPLACEHOLDER", + "expr ::= PARENTHESES_OPEN expr PARENTHESES_CLOSE", /* 158 */ - "expr ::= SPLACEHOLDER", + "expr ::= qualified_name", /* 159 */ - "expr ::= BPLACEHOLDER", + "expr ::= INTEGER", /* 160 */ - "qualified_name ::= IDENTIFIER DOT IDENTIFIER", + "expr ::= HINTEGER", /* 161 */ + "expr ::= STRING", + /* 162 */ + "expr ::= DOUBLE", + /* 163 */ + "expr ::= NULL", + /* 164 */ + "expr ::= TRUE", + /* 165 */ + "expr ::= FALSE", + /* 166 */ + "expr ::= NPLACEHOLDER", + /* 167 */ + "expr ::= SPLACEHOLDER", + /* 168 */ + "expr ::= BPLACEHOLDER", + /* 169 */ + "qualified_name ::= IDENTIFIER DOT IDENTIFIER", + /* 170 */ "qualified_name ::= IDENTIFIER", ]; - static $yyTokenName = [ + static $yyTokenName = [ '$', 'AGAINST', 'BETWEEN', @@ -903,6 +948,10 @@ public function getOutput(): mixed 'GREATER', 'GREATEREQUAL', 'LESSEQUAL', + 'OP_MATCHES', + 'OP_CONTAINS', + 'OP_CONTAINED', + 'OP_OVERLAPS', 'AND', 'OR', 'LIKE', @@ -915,10 +964,15 @@ public function getOutput(): mixed 'MOD', 'PLUS', 'MINUS', + 'OP_CONCAT', 'IS', 'IN', 'NOT', 'BITWISE_NOT', + 'OP_JSON_GET', + 'OP_JSON_GET_TEXT', + 'OP_JSON_PATH', + 'OP_JSON_PATH_TEXT', 'COMMA', 'SELECT', 'FROM', @@ -1030,1179 +1084,1399 @@ public function getOutput(): mixed ]; public mixed $yyTraceFILE = null; public ?string $yyTracePrompt = ''; - static $yy_action = [ + static $yy_action = [ /* 0 */ - 50, - 46, + 138, + 144, + 146, + 73, + 75, + 77, + 79, + 81, + 83, + 55, + /* 10 */ + 57, + 59, + 61, 45, - 19, - 52, + 47, + 85, + 90, 49, - 40, - 42, - 20, - 28, - /* 10 */ - 25, - 24, - 30, - 23, - 22, - 21, - 33, - 37, - 31, - 41, + 51, + 53, /* 20 */ - 48, - 134, - 162, - 129, + 41, + 39, + 43, + 37, + 34, + 63, + 140, + 92, + 87, + 127, + /* 30 */ + 65, + 67, 69, - 50, - 46, - 45, + 71, 19, - 52, - /* 30 */ - 49, - 40, - 42, 20, - 28, - 25, - 24, - 30, - 23, + 21, 22, + 23, + 240, /* 40 */ - 21, - 33, - 37, - 31, - 41, - 48, - 134, - 162, - 129, - 182, + 126, + 238, + 180, + 138, + 144, + 146, + 73, + 75, + 77, + 79, /* 50 */ - 292, - 154, - 183, - 208, - 209, - 270, - 82, - 157, - 68, - 50, - /* 60 */ - 46, + 81, + 83, + 55, + 57, + 59, + 61, 45, - 19, - 52, + 47, + 85, + 90, + /* 60 */ 49, - 40, - 42, - 20, - 28, - 25, - /* 70 */ - 24, - 30, - 23, - 22, - 21, - 33, - 37, - 31, + 51, + 53, 41, - 48, + 39, + 43, + 37, + 34, + 63, + 140, + /* 70 */ + 92, + 87, + 17, + 65, + 67, + 69, + 71, + 138, + 144, + 146, /* 80 */ - 134, - 162, - 129, - 50, - 46, + 73, + 75, + 77, + 79, + 81, + 83, + 55, + 57, + 59, + 61, + /* 90 */ 45, - 19, - 52, + 47, + 85, + 90, 49, - 40, - /* 90 */ - 42, - 20, - 28, - 25, - 24, - 30, - 23, - 22, - 21, - 33, + 51, + 53, + 41, + 39, + 43, /* 100 */ 37, - 31, - 41, - 48, - 134, - 162, - 129, - 19, - 52, - 49, - /* 110 */ - 40, - 42, - 20, - 28, - 25, + 34, + 63, + 140, + 92, + 87, 24, - 30, - 23, - 22, - 21, - /* 120 */ - 33, + 65, + 67, + 69, + /* 110 */ + 71, 37, - 31, - 41, - 48, - 134, - 162, - 129, - 216, - 147, + 34, + 63, + 140, + 92, + 87, + 308, + 65, + 67, + /* 120 */ + 69, + 71, + 112, + 174, + 100, + 206, + 87, + 292, + 65, + 67, /* 130 */ + 69, + 71, + 212, + 228, + 214, + 216, + 116, + 220, + 224, 32, - 38, - 44, - 28, - 25, - 24, - 30, - 23, - 22, - 21, /* 140 */ 33, - 37, - 31, - 41, - 48, - 134, - 162, - 129, - 223, - 224, + 138, + 144, + 146, + 73, + 75, + 77, + 79, + 81, + 83, /* 150 */ - 60, - 192, - 160, - 50, - 46, + 55, + 57, + 59, + 61, 45, - 19, - 52, + 47, + 85, + 90, 49, - 40, + 51, /* 160 */ - 42, - 20, - 28, - 25, - 24, - 30, - 23, - 22, - 21, - 33, - /* 170 */ - 37, - 31, + 53, 41, - 48, - 134, - 162, - 129, - 24, - 30, - 23, - /* 180 */ - 22, - 21, - 33, + 39, + 43, 37, - 31, + 34, + 63, + 140, + 92, + 87, + /* 170 */ + 247, + 65, + 67, + 69, + 71, + 85, + 90, + 49, + 51, + 53, + /* 180 */ 41, - 48, - 134, - 162, - 129, - /* 190 */ - 33, + 39, + 43, 37, - 31, - 41, - 48, - 134, - 162, - 129, - 228, - 72, + 34, + 63, + 140, + 92, + 87, + 251, + /* 190 */ + 65, + 67, + 69, + 71, + 211, + 150, + 209, + 138, + 144, + 146, /* 200 */ - 50, - 46, + 73, + 75, + 77, + 79, + 81, + 83, + 55, + 57, + 59, + 61, + /* 210 */ 45, - 19, - 52, + 47, + 85, + 90, 49, - 40, - 42, - 20, - 28, - /* 210 */ - 25, - 24, - 30, - 23, - 22, - 21, - 33, - 37, - 31, + 51, + 53, 41, + 39, + 43, /* 220 */ - 48, - 134, - 162, - 129, - 170, - 263, - 161, - 146, - 133, - 145, + 37, + 34, + 63, + 140, + 92, + 87, + 300, + 65, + 67, + 69, /* 230 */ + 71, + 138, 144, - 287, - 187, - 215, - 50, - 46, + 146, + 73, + 75, + 77, + 79, + 81, + 83, + /* 240 */ + 55, + 57, + 59, + 61, 45, - 19, - 52, + 47, + 85, + 90, 49, - /* 240 */ - 40, - 42, - 20, - 28, - 25, - 24, - 30, - 23, - 22, - 21, + 51, /* 250 */ - 33, - 37, - 31, + 53, 41, - 48, - 134, - 162, - 129, - 50, - 46, + 39, + 43, + 37, + 34, + 63, + 140, + 92, + 87, /* 260 */ - 45, - 19, - 52, - 49, - 40, - 42, - 20, - 28, - 25, - 24, + 309, + 65, + 67, + 69, + 71, + 212, + 228, + 214, + 216, + 155, /* 270 */ - 30, - 23, - 22, - 21, - 33, - 37, - 31, - 41, - 48, - 134, + 220, + 224, + 160, + 6, + 166, + 267, + 138, + 144, + 146, + 73, /* 280 */ - 162, - 129, - 238, - 233, - 32, - 47, - 44, - 101, - 27, - 26, + 75, + 77, + 79, + 81, + 83, + 55, + 57, + 59, + 61, + 45, /* 290 */ - 286, - 72, - 92, - 16, - 268, - 143, - 132, - 72, - 234, - 283, - /* 300 */ - 41, - 48, - 134, - 162, - 129, - 239, - 18, - 222, - 238, - 4, - /* 310 */ - 239, 47, - 163, - 284, - 27, - 26, - 207, - 55, - 235, - 173, + 85, + 90, + 49, + 51, + 53, + 41, + 39, + 43, + 37, + /* 300 */ + 34, + 63, + 140, + 92, + 87, + 293, + 65, + 67, + 69, + 71, + /* 310 */ + 138, + 144, + 146, + 73, + 75, + 77, + 79, + 81, + 83, + 55, /* 320 */ - 141, - 143, - 131, - 235, - 169, - 240, - 241, - 247, - 248, - 249, - /* 330 */ - 191, - 184, - 190, + 57, + 59, + 61, + 45, + 47, + 85, 90, - 35, - 4, - 56, - 290, - 154, - 244, + 49, + 51, + 53, + /* 330 */ + 41, + 39, + 43, + 37, + 34, + 63, + 140, + 92, + 87, + 289, /* 340 */ - 242, - 243, - 245, - 246, - 170, - 263, - 161, - 146, - 158, - 145, + 65, + 67, + 69, + 71, + 142, + 49, + 51, + 53, + 41, + 39, /* 350 */ - 144, - 240, - 241, - 247, - 248, - 249, - 191, - 184, - 190, - 137, + 43, + 37, + 34, + 63, + 140, + 92, + 87, + 176, + 65, + 67, /* 360 */ - 35, - 90, - 206, - 266, - 91, - 244, - 242, - 243, - 245, - 246, + 69, + 71, + 73, + 75, + 77, + 79, + 81, + 83, + 55, + 57, /* 370 */ - 267, - 221, - 200, + 59, + 61, + 45, 47, - 210, - 226, - 27, - 26, + 85, + 90, + 49, + 51, 53, - 264, + 41, /* 380 */ - 224, - 60, - 239, - 142, - 23, - 22, - 21, - 33, + 39, + 43, 37, - 31, + 34, + 63, + 140, + 92, + 87, + 366, + 65, /* 390 */ - 41, - 48, - 134, - 162, - 129, - 235, - 5, - 4, - 75, - 47, + 67, + 69, + 71, + 188, + 172, + 174, + 35, + 206, + 255, + 141, /* 400 */ - 29, + 189, + 191, + 41, + 39, + 43, + 37, 34, - 27, - 26, - 289, - 72, - 180, - 181, - 186, - 143, + 63, + 140, + 92, /* 410 */ - 221, - 151, - 128, - 240, - 241, - 247, - 248, - 249, - 191, - 184, + 87, + 179, + 65, + 67, + 69, + 71, + 404, + 140, + 92, + 87, /* 420 */ - 190, - 212, - 35, - 4, - 221, - 74, - 220, - 244, - 242, - 243, + 182, + 65, + 67, + 69, + 71, + 148, + 459, + 271, + 485, + 1, /* 430 */ - 245, + 2, + 3, + 4, + 5, + 6, + 112, 246, - 78, - 189, - 155, - 216, - 135, - 82, - 82, - 240, + 261, + 193, + 125, /* 440 */ - 241, - 247, - 248, - 249, - 191, - 184, - 190, - 88, - 35, - 105, - /* 450 */ - 95, - 218, - 175, - 244, - 242, - 243, - 245, - 246, - 101, - 262, - /* 460 */ - 260, - 47, - 171, - 177, - 27, - 26, - 214, - 239, - 239, - 211, - /* 470 */ - 282, - 143, - 71, - 252, - 128, - 285, - 239, - 138, - 10, - 150, - /* 480 */ - 235, - 235, - 265, - 250, - 215, - 4, - 221, - 128, - 254, - 235, - /* 490 */ - 164, - 458, - 294, + 6, 194, 195, + 201, + 202, + 203, + 153, + 157, + 163, + 121, + /* 450 */ + 169, + 178, + 182, + 186, + 187, + 198, 196, 197, - 82, - 64, - 221, - /* 500 */ - 89, - 240, - 241, - 247, + 199, + 200, + /* 460 */ + 291, + 254, + 88, 248, - 249, - 191, - 184, - 190, - 12, - /* 510 */ + 188, + 6, + 307, 35, - 17, - 293, - 105, - 92, - 244, - 242, - 243, + 284, + 182, + /* 470 */ + 193, + 189, + 191, 245, - 246, - /* 520 */ - 134, - 162, - 129, - 84, - 153, - 272, - 273, - 70, - 82, - 86, - /* 530 */ - 140, - 239, - 239, - 271, - 91, - 87, - 215, + 250, + 31, + 278, + 182, + 94, + 231, + /* 480 */ + 244, + 97, 179, + 178, + 294, + 274, + 204, + 193, + 279, + 29, + /* 490 */ + 232, + 237, 278, - 258, - /* 540 */ - 105, - 167, + 193, + 193, + 193, 148, + 185, + 28, + 257, + /* 500 */ + 178, + 285, + 183, + 204, + 279, + 252, + 178, + 178, + 178, 193, - 235, - 235, - 165, - 250, - 128, - 105, - /* 550 */ - 65, - 156, - 239, + /* 510 */ + 193, + 204, + 194, + 195, 201, 202, 203, - 204, - 205, - 239, - 43, - /* 560 */ - 221, - 101, - 166, - 66, - 99, - 235, - 79, - 239, - 139, - 152, - /* 570 */ - 136, - 235, + 153, + 157, + 163, + /* 520 */ 288, - 283, - 250, + 169, 178, - 99, - 198, - 102, - 239, - /* 580 */ - 235, - 94, - 239, - 237, - 67, - 58, - 124, - 239, - 51, - 159, - /* 590 */ + 178, + 272, 280, + 198, + 196, + 197, + 199, + /* 530 */ + 200, + 45, + 47, 85, - 235, - 93, - 239, - 235, - 239, - 291, - 77, - 239, - /* 600 */ - 235, - 123, - 279, - 239, - 239, - 118, - 39, - 235, - 168, - 235, - /* 610 */ + 90, + 49, + 51, + 53, + 41, + 39, + /* 540 */ + 43, + 37, + 34, + 63, + 140, + 92, + 87, + 27, + 65, + 67, + /* 550 */ + 69, + 71, + 35, + 278, + 99, + 112, + 189, + 191, + 129, + 229, + /* 560 */ + 131, + 132, + 25, + 94, + 352, + 277, + 263, + 179, + 186, + 107, + /* 570 */ + 96, + 193, + 297, + 241, + 237, + 188, + 110, + 102, + 35, + 113, + /* 580 */ 117, - 239, - 235, - 115, - 80, - 97, - 235, + 148, + 189, + 191, + 178, + 299, + 306, + 302, + 253, + 125, + /* 590 */ + 110, + 265, + 193, + 179, + 18, 235, - 219, - 239, - /* 620 */ - 216, + 123, + 194, + 195, + 201, + /* 600 */ + 202, + 203, + 153, + 157, + 163, + 178, + 169, + 148, + 180, + 193, + /* 610 */ + 118, + 198, + 196, + 197, + 199, + 200, + 262, + 266, 130, - 77, - 239, - 235, - 83, - 239, - 225, - 239, - 103, + 131, + /* 620 */ + 132, + 16, + 178, + 194, + 195, + 201, + 202, + 203, + 153, + 157, /* 630 */ - 98, - 239, - 235, - 239, - 113, - 81, - 235, - 96, - 122, - 235, + 163, + 312, + 169, + 236, + 353, + 94, + 102, + 198, + 196, + 197, /* 640 */ - 116, - 235, - 213, - 251, - 235, - 172, - 235, - 239, - 239, - 174, + 199, + 200, + 31, + 265, + 227, + 14, + 233, + 225, + 125, + 35, /* 650 */ + 269, + 128, + 52, + 189, + 191, + 296, + 281, + 310, 11, - 232, - 239, - 3, - 104, - 239, - 239, - 112, - 239, - 9, + 290, /* 660 */ - 235, - 235, - 257, - 239, - 110, - 235, - 16, - 239, - 235, - 235, + 193, + 193, + 270, + 114, + 234, + 103, + 30, + 98, + 151, + 264, /* 670 */ - 276, - 235, - 239, - 121, - 119, - 239, - 235, - 2, - 120, - 107, + 193, + 230, + 6, + 178, + 178, + 35, + 102, + 124, + 148, + 189, /* 680 */ - 235, + 191, + 222, + 120, + 178, + 149, + 113, 108, - 239, - 106, - 215, - 235, - 281, - 129, - 235, + 305, 125, + 219, /* 690 */ - 100, - 239, - 239, - 127, - 275, - 235, - 239, - 239, - 63, - 239, + 179, + 115, + 217, + 205, + 194, + 195, + 201, + 202, + 203, + 153, /* 700 */ - 109, - 239, - 11, - 77, - 235, - 235, - 14, - 239, - 239, - 235, + 157, + 163, + 193, + 169, + 148, + 193, + 304, + 119, + 198, + 196, /* 710 */ - 235, - 239, - 235, - 229, - 235, - 114, - 126, + 197, + 199, + 200, + 50, + 48, + 178, + 223, 111, - 239, - 6, + 178, + 221, /* 720 */ - 235, - 235, - 274, - 217, - 235, - 269, - 222, - 15, - 158, - 1, + 194, + 195, + 201, + 202, + 203, + 153, + 157, + 163, + 133, + 169, /* 730 */ - 62, - 235, - 256, - 239, - 239, - 239, - 253, - 236, - 7, - 11, + 112, + 193, + 193, + 44, + 198, + 196, + 197, + 199, + 200, + 42, /* 740 */ - 227, - 255, - 261, + 125, + 40, + 276, + 298, + 178, + 178, + 167, + 46, + 256, + 36, + /* 750 */ + 38, + 193, + 242, + 243, + 276, 54, - 176, + 106, + 193, + 105, + 193, + /* 760 */ + 104, + 239, + 286, + 295, + 178, + 193, + 193, + 193, + 193, + 89, + /* 770 */ + 178, + 186, + 178, + 193, + 275, 259, - 235, - 235, - 235, - 8, - /* 750 */ - 199, + 139, + 137, + 178, + 178, + /* 780 */ + 178, + 178, + 95, + 175, + 268, + 91, + 178, + 193, + 171, + 208, + /* 790 */ + 403, + 458, + 147, + 193, + 193, + 193, + 301, + 302, + 93, + 145, + /* 800 */ + 178, + 193, + 193, + 193, + 159, + 287, + 178, + 178, + 178, + 74, + /* 810 */ + 193, + 72, + 303, + 70, + 178, + 178, + 178, + 193, + 192, + 68, + /* 820 */ + 165, + 66, + 193, + 178, + 134, + 282, + 343, + 193, + 168, + 193, + /* 830 */ + 178, + 193, + 128, + 113, + 122, + 178, + 193, + 193, + 193, + 193, + /* 840 */ + 178, + 170, + 178, + 64, + 178, + 60, + 58, + 56, + 62, + 178, + /* 850 */ + 178, + 178, + 178, + 249, + 173, + 181, + 184, + 80, + 127, + 193, + /* 860 */ + 136, + 193, + 135, + 193, + 193, + 193, + 193, + 143, + 82, + 346, + /* 870 */ + 15, + 193, + 178, + 78, + 178, + 193, + 178, + 178, + 178, + 178, + /* 880 */ 13, - 59, - 185, - 188, - 149, - 298, - 57, + 110, 76, - 298, - /* 760 */ - 230, - 73, - 231, - 277, - 36, - 61, - ]; - static $yy_default = [ - /* 0 */ - 457, - 457, - 457, - 432, - 457, - 457, - 457, - 457, - 457, - 457, - /* 10 */ + 26, + 178, + 84, + 193, + 86, + 178, + 177, + /* 890 */ + 207, + 193, + 190, + 258, + 8, + 10, + 9, + 101, + 317, + 178, + /* 900 */ + 193, + 109, + 102, + 193, + 178, + 193, + 12, + 193, + 193, + 7, + /* 910 */ + 193, + 283, 315, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, + 178, + 125, + 260, + 178, + 314, + 178, + 313, + /* 920 */ + 178, + 178, + 316, + 178, + 273, + 360, + 311, + 347, + 154, + 94, + /* 930 */ + 152, + 156, + 213, + 164, + 210, + 218, + 342, + 158, + 316, + 226, + /* 940 */ + 161, + 344, + 341, + 215, + 349, + 162, + 348, + 345, + ]; + static $yy_default = [ + /* 0 */ + 484, + 484, + 484, + 484, + 484, + 484, + 382, + 391, + 396, + 384, + /* 10 */ + 402, + 398, + 318, + 484, + 397, + 484, + 399, + 484, + 400, + 405, /* 20 */ - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, + 406, + 407, + 408, + 409, + 484, + 401, + 484, + 484, + 383, + 484, /* 30 */ - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, + 385, + 387, + 388, + 389, + 484, + 484, + 410, + 484, + 412, + 484, /* 40 */ - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, + 413, + 484, + 414, + 484, + 415, + 484, + 416, + 484, + 417, + 484, /* 50 */ - 457, - 457, - 457, - 314, - 457, - 457, - 457, - 457, - 457, - 457, + 418, + 484, + 419, + 484, + 420, + 484, + 421, + 484, + 422, + 484, /* 60 */ - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, + 423, + 484, + 424, + 484, + 425, + 484, + 426, + 484, + 427, + 484, /* 70 */ - 457, - 457, - 304, - 457, - 457, - 322, - 457, - 457, - 457, - 373, + 428, + 484, + 429, + 484, + 430, + 484, + 431, + 484, + 432, + 484, /* 80 */ - 386, - 366, - 364, - 380, - 364, - 386, - 364, - 384, - 333, - 378, + 433, + 484, + 434, + 484, + 435, + 484, + 436, + 484, + 484, + 437, /* 90 */ - 430, - 311, - 369, - 457, - 457, - 457, - 457, - 419, - 377, - 376, + 484, + 438, + 484, + 484, + 322, + 484, + 484, + 484, + 333, + 319, /* 100 */ - 363, - 338, - 347, - 332, - 425, - 436, - 426, - 440, - 439, - 407, + 484, + 330, + 370, + 484, + 368, + 484, + 371, + 484, + 484, + 372, /* 110 */ - 408, - 406, - 403, - 404, - 405, - 398, - 399, - 409, - 411, - 401, + 484, + 377, + 379, + 378, + 369, + 484, + 484, + 484, + 373, + 374, /* 120 */ - 400, - 402, - 395, - 397, - 396, - 392, - 394, - 393, - 352, - 457, + 484, + 484, + 484, + 375, + 376, + 380, + 483, + 484, + 482, + 332, /* 130 */ - 457, - 381, - 457, - 457, - 457, - 457, - 457, - 457, - 457, - 457, + 334, + 336, + 484, + 340, + 351, + 337, + 484, + 350, + 484, + 446, /* 140 */ - 457, - 457, - 456, - 456, - 457, - 457, - 457, - 457, - 457, - 457, + 484, + 464, + 484, + 465, + 484, + 466, + 484, + 467, + 484, + 484, /* 150 */ - 457, - 457, - 412, - 457, - 457, - 457, - 457, - 457, - 457, - 372, + 470, + 484, + 442, + 484, + 484, + 484, + 445, + 484, + 484, + 484, /* 160 */ - 456, - 457, - 457, - 457, - 457, - 457, - 457, - 431, - 410, - 457, + 484, + 484, + 447, + 484, + 484, + 484, + 484, + 484, + 448, + 484, /* 170 */ - 457, - 457, - 441, - 457, - 442, - 457, - 457, - 457, - 457, - 365, + 484, + 484, + 449, + 450, + 484, + 484, + 484, + 452, + 454, + 483, /* 180 */ - 351, - 457, - 343, - 457, - 457, - 350, - 457, - 457, - 457, 457, + 484, + 463, + 484, + 455, + 484, + 484, + 460, + 462, + 484, /* 190 */ - 457, - 457, - 457, - 349, - 296, - 297, - 298, - 299, - 300, - 379, + 468, + 484, + 469, + 471, + 472, + 473, + 474, + 475, + 476, + 477, /* 200 */ - 382, - 387, - 388, - 389, - 390, - 391, - 383, - 367, - 370, - 371, + 478, + 479, + 480, + 481, + 461, + 456, + 484, + 453, + 451, + 484, /* 210 */ - 301, - 312, - 353, - 354, - 359, - 361, - 360, - 355, - 356, - 357, + 338, + 339, + 484, + 484, + 484, + 484, + 484, + 484, + 484, + 484, /* 220 */ - 358, - 362, - 455, - 316, - 318, - 319, - 437, - 438, - 443, - 415, + 484, + 484, + 484, + 484, + 484, + 484, + 484, + 484, + 484, + 335, /* 230 */ - 418, - 420, - 421, - 422, - 423, - 427, - 428, - 433, - 435, - 444, - /* 240 */ - 445, - 446, - 447, - 448, - 449, - 450, - 451, - 452, - 453, - 454, - /* 250 */ - 434, - 429, - 424, - 320, - 321, + 331, + 484, 323, - 324, 325, + 483, + 484, 326, + 329, + 484, 327, - /* 260 */ + /* 240 */ 328, - 329, - 330, - 331, - 317, - 313, - 305, - 307, - 308, - 309, + 324, + 320, + 321, + 484, + 440, + 484, + 443, + 484, + 439, + /* 250 */ + 484, + 484, + 484, + 441, + 484, + 444, + 411, + 386, + 484, + 395, + /* 260 */ + 484, + 484, + 390, + 484, + 392, + 394, + 393, + 484, + 381, + 484, /* 270 */ - 310, - 306, - 302, - 303, - 413, - 416, - 414, - 417, - 368, - 374, + 484, + 484, + 484, + 484, + 484, + 484, + 484, + 354, + 356, + 355, /* 280 */ - 375, - 334, - 336, - 337, - 335, - 339, - 341, - 340, - 342, - 385, + 484, + 484, + 484, + 484, + 484, + 484, + 484, + 484, + 357, + 359, /* 290 */ - 344, - 346, - 345, - 348, - 295, + 358, + 382, + 484, + 484, + 484, + 484, + 484, + 484, + 484, + 361, + /* 300 */ + 484, + 362, + 484, + 484, + 364, + 365, + 363, + 382, + 484, + 484, + /* 310 */ + 484, + 484, + 367, ]; - static $yy_lookahead = [ + static $yy_lookahead = [ /* 0 */ 1, 2, @@ -2230,15 +2504,35 @@ public function getOutput(): mixed 22, 23, 24, + 25, 26, + 27, + 28, + 29, + 41, + /* 30 */ + 31, + 32, + 33, + 34, + 70, + 71, + 72, + 73, + 74, + 40, + /* 40 */ + 40, + 42, + 54, 1, 2, 3, 4, 5, - /* 30 */ 6, 7, + /* 50 */ 8, 9, 10, @@ -2247,9 +2541,9 @@ public function getOutput(): mixed 13, 14, 15, - /* 40 */ 16, 17, + /* 60 */ 18, 19, 20, @@ -2257,21 +2551,21 @@ public function getOutput(): mixed 22, 23, 24, - 115, - /* 50 */ - 116, - 117, - 83, - 54, - 55, + 25, + 26, + 27, + /* 70 */ + 28, + 29, + 35, 31, - 87, + 32, 33, - 60, + 34, 1, - /* 60 */ 2, 3, + /* 80 */ 4, 5, 6, @@ -2280,9 +2574,9 @@ public function getOutput(): mixed 9, 10, 11, - /* 70 */ 12, 13, + /* 90 */ 14, 15, 16, @@ -2291,10 +2585,54 @@ public function getOutput(): mixed 19, 20, 21, - /* 80 */ 22, 23, + /* 100 */ + 24, + 25, + 26, + 27, + 28, + 29, + 69, + 31, + 32, + 33, + /* 110 */ + 34, 24, + 25, + 26, + 27, + 28, + 29, + 97, + 31, + 32, + /* 120 */ + 33, + 34, + 40, + 81, + 35, + 83, + 29, + 97, + 31, + 32, + /* 130 */ + 33, + 34, + 43, + 44, + 45, + 46, + 54, + 48, + 49, + 63, + /* 140 */ + 64, 1, 2, 3, @@ -2302,9 +2640,9 @@ public function getOutput(): mixed 5, 6, 7, - /* 90 */ 8, 9, + /* 150 */ 10, 11, 12, @@ -2313,51 +2651,67 @@ public function getOutput(): mixed 15, 16, 17, - /* 100 */ 18, 19, + /* 160 */ 20, 21, 22, 23, 24, - 4, - 5, - 6, - /* 110 */ - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, + 25, + 26, + 27, + 28, + 29, + /* 170 */ + 55, + 31, + 32, + 33, + 34, 16, - /* 120 */ 17, 18, 19, 20, + /* 180 */ 21, 22, 23, 24, - 120, - 121, - /* 130 */ - 72, - 45, - 74, + 25, + 26, + 27, + 28, + 29, + 54, + /* 190 */ + 31, + 32, + 33, + 34, + 40, + 55, + 42, + 1, + 2, + 3, + /* 200 */ + 4, + 5, + 6, + 7, + 8, + 9, 10, 11, 12, 13, + /* 210 */ 14, 15, 16, - /* 140 */ 17, 18, 19, @@ -2365,13 +2719,19 @@ public function getOutput(): mixed 21, 22, 23, + /* 220 */ 24, - 102, - 103, - /* 150 */ - 104, - 69, + 25, + 26, + 27, + 28, + 29, + 35, 31, + 32, + 33, + /* 230 */ + 34, 1, 2, 3, @@ -2379,9 +2739,9 @@ public function getOutput(): mixed 5, 6, 7, - /* 160 */ 8, 9, + /* 240 */ 10, 11, 12, @@ -2390,107 +2750,132 @@ public function getOutput(): mixed 15, 16, 17, - /* 170 */ - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 12, - 13, - 14, - /* 180 */ - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - /* 190 */ - 17, 18, 19, + /* 250 */ 20, 21, 22, 23, 24, - 46, + 25, + 26, 27, - /* 200 */ + 28, + 29, + /* 260 */ + 123, + 31, + 32, + 33, + 34, + 43, + 44, + 45, + 46, + 92, + /* 270 */ + 48, + 49, + 42, + 96, + 78, + 60, 1, 2, 3, 4, + /* 280 */ 5, 6, 7, 8, 9, 10, - /* 210 */ 11, 12, 13, 14, + /* 290 */ 15, 16, 17, 18, 19, 20, - /* 220 */ 21, 22, 23, 24, - 34, - 35, - 36, - 37, - 109, - 39, - /* 230 */ - 40, - 112, - 33, + /* 300 */ + 25, + 26, + 27, + 28, + 29, + 123, 31, + 32, + 33, + 34, + /* 310 */ 1, 2, 3, 4, 5, 6, - /* 240 */ 7, 8, 9, 10, + /* 320 */ 11, 12, 13, 14, 15, 16, - /* 250 */ 17, 18, 19, 20, + /* 330 */ 21, 22, 23, 24, - 1, - 2, - /* 260 */ - 3, + 25, + 26, + 27, + 28, + 29, + 40, + /* 340 */ + 31, + 32, + 33, + 34, + 29, + 18, + 19, + 20, + 21, + 22, + /* 350 */ + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 82, + 31, + 32, + /* 360 */ + 33, + 34, 4, 5, 6, @@ -2499,8 +2884,8 @@ public function getOutput(): mixed 9, 10, 11, + /* 370 */ 12, - /* 270 */ 13, 14, 15, @@ -2510,645 +2895,978 @@ public function getOutput(): mixed 19, 20, 21, + /* 380 */ 22, - /* 280 */ 23, 24, - 18, - 71, - 72, - 21, - 74, - 99, - 24, 25, - /* 290 */ - 31, - 27, - 99, 26, - 18, - 31, - 108, 27, - 129, - 111, - /* 300 */ - 20, + 28, + 29, + 0, + 31, + /* 390 */ + 32, + 33, + 34, + 22, + 80, + 81, + 25, + 83, + 55, + 84, + /* 400 */ + 29, + 30, 21, 22, 23, 24, - 117, - 73, - 31, - 18, - 45, - /* 310 */ - 117, - 21, - 42, - 46, - 24, 25, - 123, - 47, - 130, - 49, - /* 320 */ + 26, + 27, + 28, + /* 410 */ + 29, + 40, + 31, 32, + 33, + 34, + 0, + 27, + 28, + 29, + /* 420 */ + 108, 31, - 126, - 130, - 24, - 61, + 32, + 33, + 34, + 54, + 55, + 114, + 90, + 91, + /* 430 */ + 92, + 93, + 94, + 95, + 96, + 40, + 92, 62, - 63, - 64, - 65, - /* 330 */ - 66, - 67, - 68, - 45, + 126, + 126, + /* 440 */ + 96, 70, - 45, - 26, - 116, - 117, + 71, + 72, + 73, + 74, 75, - /* 340 */ 76, 77, - 78, + 54, + /* 450 */ 79, - 34, + 139, + 108, 35, + 142, + 84, + 85, + 86, + 87, + 88, + /* 460 */ + 122, + 92, + 16, + 17, + 22, + 96, + 128, + 25, + 54, + 108, + /* 470 */ + 126, + 29, + 30, + 55, + 28, + 108, + 108, + 108, 36, + 35, + /* 480 */ + 136, 37, - 32, - 39, - /* 350 */ 40, - 61, - 62, - 63, - 64, - 65, - 66, - 67, + 139, 68, - 105, - /* 360 */ - 70, - 45, + 117, + 142, 126, - 98, - 99, + 120, + 35, + /* 490 */ + 107, + 108, + 108, + 126, + 126, + 126, + 54, + 136, + 131, + 132, + /* 500 */ + 139, + 117, + 141, + 142, + 120, + 136, + 139, + 139, + 139, + 126, + /* 510 */ + 126, + 142, + 70, + 71, + 72, + 73, + 74, 75, 76, 77, - 78, + /* 520 */ + 121, 79, - /* 370 */ - 18, - 117, - 126, - 21, - 97, - 75, - 24, - 25, - 101, - 102, - /* 380 */ - 103, - 104, - 117, - 31, + 139, + 139, + 53, + 54, + 84, + 85, + 86, + 87, + /* 530 */ + 88, 14, 15, 16, 17, 18, 19, - /* 390 */ 20, 21, 22, + /* 540 */ 23, 24, - 130, - 94, - 45, - 105, - 21, - /* 400 */ - 12, - 13, - 24, 25, - 126, + 26, 27, + 28, + 29, + 62, 31, - 100, + 32, + /* 550 */ 33, - 31, - /* 410 */ - 117, - 23, - 105, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - /* 420 */ - 68, - 120, - 70, - 45, - 117, - 50, - 120, - 75, - 76, - 77, - /* 430 */ - 78, - 79, - 26, - 83, - 83, - 120, - 121, - 87, - 87, - 61, - /* 440 */ - 62, - 63, - 64, - 65, - 66, - 67, - 68, + 34, + 25, + 108, 106, - 70, - 99, - /* 450 */ - 99, + 40, + 29, + 30, + 110, + 111, + /* 560 */ + 112, + 113, + 135, + 36, + 0, 120, - 46, - 75, - 76, - 77, - 78, - 79, - 99, 35, - /* 460 */ + 40, 35, - 21, - 38, - 38, - 24, + 54, + /* 570 */ + 104, + 126, + 109, + 107, + 108, + 22, + 35, + 114, 25, - 120, - 117, - 117, - 100, - /* 470 */ - 111, - 31, - 128, 129, - 105, - 112, - 117, - 127, - 96, - 56, - /* 480 */ - 130, + /* 580 */ 130, - 100, - 133, - 31, - 45, - 117, - 105, - 31, - 130, - /* 490 */ - 33, - 81, - 82, - 83, + 54, + 29, + 30, + 139, + 124, + 125, + 126, + 55, + 126, + /* 590 */ + 35, + 108, + 126, + 40, + 135, + 41, + 55, + 70, + 71, + 72, + /* 600 */ + 73, + 74, + 75, + 76, + 77, + 139, + 79, + 54, + 54, + 126, + /* 610 */ + 55, 84, 85, 86, 87, - 45, - 117, - /* 500 */ - 89, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 26, - /* 510 */ + 88, + 133, + 134, + 111, + 112, + /* 620 */ + 113, + 135, + 139, 70, - 28, - 114, - 99, - 99, + 71, + 72, + 73, + 74, 75, 76, + /* 630 */ 77, - 78, + 109, 79, - /* 520 */ 22, - 23, - 24, - 113, - 83, + 0, + 36, + 114, + 84, + 85, + 86, + /* 640 */ + 87, + 88, + 108, + 108, + 44, + 56, + 22, + 47, + 126, + 25, + /* 650 */ + 51, + 40, + 108, 29, 30, - 59, - 87, - 119, - /* 530 */ - 95, - 117, - 117, - 98, - 99, - 91, - 31, - 122, - 123, - 35, - /* 540 */ - 99, - 127, - 38, - 100, - 130, - 130, + 56, + 118, + 58, + 101, + 121, + /* 660 */ + 126, + 126, + 52, + 40, + 40, + 42, 132, - 133, 105, - 99, - /* 550 */ - 45, - 52, - 117, - 61, - 62, - 63, - 64, - 65, - 117, - 51, - /* 560 */ - 117, - 99, + 92, + 134, + /* 670 */ + 126, + 109, + 96, + 139, + 139, + 25, + 114, + 129, + 54, + 29, + /* 680 */ + 30, 44, - 45, - 99, + 59, + 139, + 108, + 129, 130, - 88, - 117, + 108, + 126, + 44, + /* 690 */ + 40, + 59, + 47, + 38, + 70, + 71, + 72, + 73, + 74, + 75, + /* 700 */ + 76, + 77, + 126, + 79, + 54, + 126, 127, - 99, - /* 570 */ + 129, + 84, + 85, + /* 710 */ + 86, + 87, + 88, 108, - 130, + 108, + 139, + 44, + 129, + 139, + 47, + /* 720 */ + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, 114, - 111, - 133, - 58, - 99, - 93, - 99, - 117, - /* 580 */ - 130, - 99, - 117, - 133, - 59, - 99, - 99, - 117, - 41, - 124, - /* 590 */ - 125, + 79, + /* 730 */ + 40, + 126, + 126, + 108, + 84, + 85, + 86, + 87, 88, - 130, - 99, - 117, - 130, - 117, - 118, - 26, - 117, - /* 600 */ - 130, - 99, - 125, - 117, - 117, - 99, + 108, + /* 740 */ + 126, + 108, + 35, 57, - 130, - 99, - 130, - /* 610 */ - 99, - 117, - 130, - 99, - 88, - 99, - 130, - 130, - 46, - 117, - /* 620 */ - 120, - 121, - 26, - 117, - 130, - 92, - 117, - 107, - 117, - 99, - /* 630 */ - 99, - 117, - 130, - 117, - 99, - 90, - 130, - 99, - 99, - 130, - /* 640 */ - 99, - 130, - 46, - 29, - 130, - 99, - 130, - 117, - 117, - 99, - /* 650 */ - 26, - 46, - 117, - 131, - 99, - 117, - 117, - 99, - 117, - 53, - /* 660 */ - 130, - 130, + 139, + 139, + 40, + 108, + 108, + 108, + /* 750 */ + 108, + 126, + 38, + 39, 35, - 117, - 99, - 130, - 26, - 117, - 130, - 130, - /* 670 */ - 46, - 130, - 117, - 99, - 99, - 117, - 130, - 45, - 99, - 99, - /* 680 */ - 130, - 99, - 117, - 99, - 31, - 130, - 46, - 24, - 130, - 99, - /* 690 */ - 99, - 117, - 117, - 99, - 46, - 130, - 117, - 117, - 45, - 117, - /* 700 */ - 99, - 117, - 26, - 26, - 130, - 130, + 108, + 129, + 126, + 59, + 126, + /* 760 */ + 40, + 40, + 55, + 135, + 139, + 126, + 126, + 126, + 126, + 108, + /* 770 */ + 139, + 35, + 139, + 126, + 55, + 108, + 108, + 108, + 139, + 139, + /* 780 */ + 139, + 139, + 103, + 108, + 108, + 108, + 139, + 126, + 137, + 138, + /* 790 */ + 0, + 55, + 108, + 126, + 126, + 126, + 125, + 126, + 54, + 108, + /* 800 */ + 139, + 126, + 126, + 126, + 108, + 35, + 139, + 139, + 139, + 108, + /* 810 */ + 126, + 108, 4, - 117, - 117, - 130, - /* 710 */ - 130, - 117, - 130, - 46, + 108, + 139, + 139, + 139, + 126, + 108, + 108, + /* 820 */ + 108, + 108, + 126, + 139, + 115, + 55, + 40, + 126, + 55, + 126, + /* 830 */ + 139, + 126, + 40, + 129, 130, + 139, + 126, + 126, + 126, + 126, + /* 840 */ + 139, + 108, + 139, + 108, + 139, + 108, + 108, + 108, + 108, + 139, + /* 850 */ + 139, + 139, + 139, + 108, + 138, + 140, + 55, + 108, + 41, + 126, + /* 860 */ + 50, + 126, + 116, + 126, + 126, + 126, + 126, + 84, + 108, + 40, + /* 870 */ + 68, + 126, + 139, + 108, + 139, + 126, + 139, + 139, + 139, + 139, + /* 880 */ + 67, + 35, + 108, + 61, + 139, + 108, + 126, + 108, + 139, + 108, + /* 890 */ + 108, + 126, + 108, + 66, + 98, + 100, 99, - 99, - 99, - 117, + 109, + 0, + 139, + /* 900 */ + 126, + 55, + 114, + 126, + 139, + 126, + 102, + 126, + 126, + 97, + /* 910 */ + 126, 53, - /* 720 */ - 130, - 130, - 46, - 46, - 130, - 31, - 31, - 26, - 32, - 45, - /* 730 */ - 43, - 130, - 35, - 117, - 117, - 117, - 31, - 46, - 45, - 26, - /* 740 */ - 75, - 35, - 35, - 28, + 0, + 139, + 126, + 65, + 139, + 0, + 139, + 0, + /* 920 */ + 139, + 139, + 0, + 139, + 54, + 0, + 37, + 40, + 54, + 36, + /* 930 */ + 55, + 55, 44, - 35, - 130, - 130, - 130, - 45, - /* 750 */ - 47, - 26, - 26, - 31, - 31, - 31, - 134, - 48, - 50, - 134, - /* 760 */ - 46, - 50, - 46, - 46, - 45, - 45, + 54, + 40, + 44, + 40, + 54, + 143, + 44, + /* 940 */ + 40, + 40, + 40, + 44, + 40, + 55, + 40, + 40, ]; - static $yy_reduce_ofst = [ + static $yy_reduce_ofst = [ /* 0 */ - 410, - 441, - 350, - 414, - 351, - 435, - 415, - 462, - 188, - 465, + 338, + -1, + -1, + -1, + -1, + -1, + 812, + 796, + 797, + 795, /* 10 */ - 277, - 450, - 265, - 193, - 479, - 477, - 359, - 382, - 555, - 558, + 557, + 804, + -1, + -1, + -1, + 486, + -1, + 459, + -1, + -1, /* 20 */ - 565, - 574, - 575, - 579, - 511, - 541, - 550, - 546, - 514, - 509, + -1, + -1, + -1, + -1, + 427, + -1, + -1, + 367, + -1, + 534, /* 30 */ - 506, - 502, - 494, - 487, - 470, - 486, - 482, - 539, - 538, - 531, + -1, + -1, + -1, + -1, + 640, + 641, + -1, + 642, + -1, + 633, /* 40 */ - 618, - 617, - 601, - 591, - 584, - 580, - 582, - 590, - 594, - 616, + -1, + 631, + -1, + 625, + -1, + 639, + -1, + 606, + -1, + 605, /* 50 */ - 516, - 530, - 535, - 46, - 443, - 307, + -1, + 544, + -1, + 647, + -1, + 739, + -1, + 738, + -1, + 737, + /* 60 */ + -1, + 740, + -1, + 735, + -1, + 713, + -1, + 711, + -1, + 705, + /* 70 */ + -1, + 703, + -1, + 701, + -1, + 774, + -1, + 765, + -1, + 749, + /* 80 */ + -1, + 760, + -1, + 777, + -1, + 779, + -1, + -1, + 661, + -1, + /* 90 */ + 677, + -1, + -1, + 344, + 679, + 466, + -1, + 562, + 448, + -1, + /* 100 */ + 788, + -1, + -1, + -1, + -1, + 627, + -1, + 556, + -1, + -1, + /* 110 */ + 588, + -1, + -1, + -1, + -1, + 578, + 450, + -1, + -1, + -1, + /* 120 */ + 548, + 704, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 507, + /* 130 */ + -1, + -1, + 614, + 709, + 746, + -1, + 669, + -1, + 668, + -1, + /* 140 */ + -1, + -1, + -1, + -1, + 691, + -1, + 684, + -1, + 576, + -1, + /* 150 */ + -1, + -1, + -1, + -1, + 177, + -1, + -1, + -1, + 696, + -1, + /* 160 */ + -1, + -1, + -1, + -1, + 712, + -1, + -1, + -1, + -1, + 733, + /* 170 */ + 651, + 716, + -1, + -1, + 675, + -1, + 781, + -1, + -1, + -1, + /* 180 */ + 715, + 361, + -1, + -1, + -1, + -1, + 312, + -1, + -1, + 784, + /* 190 */ + -1, + 710, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /* 200 */ + -1, + -1, + -1, + -1, + -1, + -1, + 782, + -1, + -1, + -1, + /* 210 */ + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /* 220 */ + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /* 230 */ + -1, + 383, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + /* 240 */ + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 745, + -1, + /* 250 */ + -1, 369, - -66, - 344, - 221, - /* 60 */ - 293, - -31, - 254, - 500, - 315, - 8, - 119, - 196, - 236, - 246, - /* 70 */ - 278, - 169, - 302, - 301, - 306, - 341, - 331, - 346, - 363, - 411, - /* 80 */ - 398, - 444, - 478, - 484, - 503, - 458, - 526, - 533, - 520, - 545, - /* 90 */ + -1, + -1, + -1, + -1, + -1, + -1, + 667, + -1, + /* 260 */ + -1, + 483, + -1, + 535, + -1, + -1, + -1, + 676, + -1, + -1, + /* 270 */ + 313, + -1, + -1, + 368, + -1, + -1, + 445, + -1, + -1, + -1, + /* 280 */ + 538, + -1, + -1, + -1, + 384, + -1, + -1, + 399, + -1, + -1, + /* 290 */ + -1, + 30, + 182, + -1, + 628, + -1, + 463, + -1, + 461, + -1, + /* 300 */ + 671, + -1, + -1, + 579, + -1, + -1, + -1, + 20, + 137, + -1, + /* 310 */ + -1, 522, + -1, ]; /* The next table maps tokens into fallback tokens. If a construct @@ -3161,220 +3879,352 @@ public function getOutput(): mixed ** but it does not parse, the type of the token is changed to ID and ** the parse is retried before an error is thrown. */ - static $yy_shift_ofst = [ + static $yy_shift_ofst = [ /* 0 */ - 270, - 264, - 264, - 290, - 378, - 352, - 440, - 440, - 440, - 440, + 599, + 919, + 917, + 912, + 922, + 898, + 215, + 850, + 827, + 822, /* 10 */ - 310, - 290, - 352, - 440, - 440, - 440, - 440, - 121, - 440, - 440, + 802, + 813, + -37, + 589, + -37, + -36, + 37, + -36, + -37, + -37, /* 20 */ - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, + -37, + -37, + -37, + -37, + -36, + -37, + 485, + 650, + 454, + 650, /* 30 */ - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, - /* 40 */ - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, - 440, + -37, + 76, + -37, + -37, + 650, + 650, + 390, + 650, + 390, + 650, + /* 40 */ + 87, + 650, + 87, + 650, + 87, + 650, + 159, + 650, + 159, + 650, /* 50 */ - 440, - 440, - 440, - 190, - 121, - 121, - 121, - 121, - 58, - 121, + 381, + 650, + 381, + 650, + 381, + 650, + 517, + 650, + 517, + 650, /* 60 */ - 121, - 172, - 121, - 202, - 202, - 202, - 259, - 492, - 492, - 492, + 517, + 650, + 517, + 650, + 390, + 650, + -37, + 650, + -37, + 650, /* 70 */ - 492, - 212, - 496, - 453, - 505, - 457, - 653, - 202, - 259, - 423, + -37, + 650, + -37, + 650, + 517, + 650, + 517, + 650, + 517, + 650, /* 80 */ - 468, - 499, - 508, 517, - 508, - 468, - 508, - 525, - 547, - 549, + 650, + 517, + 650, + 517, + 650, + 327, + 446, + 650, + 97, /* 90 */ - 614, - 24, - -1, - 233, - 82, - 152, - 199, - 257, - 257, - 257, + 650, + 327, + 744, + 442, + 714, + 624, + 444, + 0, + 89, + -37, /* 100 */ - 257, - 257, - 257, - 257, - 257, - 257, - 257, - 103, - 103, - 123, + 0, + -37, + 623, + 720, + 699, + 515, + -37, + 690, + 846, + -37, /* 110 */ - 123, - 123, - 123, - 123, - 123, - 165, - 165, - 370, - 370, - 173, + 690, + -37, + -37, + -37, + 632, + 82, + 690, + 555, + -37, + -37, /* 120 */ - 173, - 173, - 280, - 280, - 280, - 498, - 498, - 498, - 375, - 388, + 395, + 690, + 541, + -37, + -37, + -37, + 817, + 792, + -37, + 222, /* 130 */ - 677, - -2, - 267, - 406, - 300, - 596, - 640, - 518, - 624, - 676, + -37, + -37, + 0, + 154, + 810, + -37, + 650, + 309, + 650, + 309, /* 140 */ - 483, - 276, - 288, - 316, - 424, - 425, - 504, - 572, - 627, - 605, + 315, + -37, + 783, + -37, + 650, + 358, + 650, + 358, + 527, + 140, /* 150 */ - 606, - 632, - 663, - 648, - 702, - 667, - 666, - 694, - 695, - 701, + -37, + 875, + -37, + 874, + 893, + 876, + -37, + 883, + 650, + 230, /* 160 */ - 696, - 697, - 684, - 687, - 705, - 691, - 693, - 713, - 663, - 665, - /* 170 */ + 900, + 890, + -37, + 879, + 650, + 196, 706, - 707, - 663, - 715, - 663, - 700, - 704, - 710, - 703, - 725, + 773, + -37, + 650, + /* 170 */ + 42, + 314, + -37, + -37, + 650, + 275, + 650, + 309, + -37, + -12, /* 180 */ - 708, - 709, - 726, - 714, - 86, - 711, - 722, - 723, - 716, - 717, + 655, + 371, + 309, + 801, + -37, + 736, + 553, + -37, + -37, + 650, /* 190 */ + 97, + 650, + 97, + -37, + -37, + -37, + -37, + -37, + -37, + -37, + /* 200 */ + -37, + -37, + -37, + -37, + -37, + -37, + 650, + 309, + -37, + 894, + /* 210 */ + -37, + -37, + 888, + 902, + 899, + 896, + 645, + 891, + 786, + 901, + /* 220 */ + 672, + 637, + 907, + 829, + 600, + 895, + 887, + 906, + 904, + -37, + /* 230 */ + -37, + 624, + -37, + -37, + 554, + 611, + -37, + -1, + 721, + -37, + /* 240 */ + -37, + -37, + -37, + -37, + 418, + -37, + 115, + -37, + 650, + 97, + /* 250 */ + 135, + 442, + 533, + -37, + 343, + -37, + 390, + -37, + 650, + 309, + /* 260 */ + 375, + 650, + 531, + 650, + -37, + 309, + -37, + 650, + 309, + 610, + /* 270 */ + 0, + 471, + 870, + 650, 719, - 720, - 724, + 564, + 650, + -37, + 309, + -37, + /* 280 */ + 299, + 770, + 858, + 414, + 650, + 707, + 634, + 299, + -37, + -37, + /* 290 */ + -37, + 215, + 416, + 925, + -36, + 790, + 0, + 686, + 0, + 191, + /* 300 */ + 0, + -37, + 808, + 650, + -37, + 309, + -37, + 215, + 416, + 388, + /* 310 */ + 889, + 0, + -37, ]; /* @@ -3720,6 +4570,15 @@ private function yy_destructor($yymajor, $yypminor) case 77: case 78: case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 85: + case 86: + case 87: + case 88: if (isset($yypminor->yy0)) { if (($yypminor->yy0)->free_flag) { unset(($yypminor->yy0)->token); @@ -3727,53 +4586,53 @@ private function yy_destructor($yymajor, $yypminor) unset($yypminor->yy0); } break; - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 89: + case 91: + case 92: + case 93: + case 94: case 95: case 96: case 98: - case 99: - case 100: - case 101: - case 102: - case 103: case 104: case 105: + case 107: + case 108: case 109: case 110: + case 111: case 112: case 113: - case 115: - case 116: - case 117: + case 114: + case 118: case 119: - case 120: case 121: case 122: - case 123: case 124: case 125: - case 127: + case 126: + case 128: + case 129: case 130: + case 131: + case 132: case 133: + case 134: + case 136: + case 139: + case 142: unset($yypminor->yy202); break; - case 88: - case 90: - case 91: - case 92: - case 93: - case 94: - case 106: - case 107: - case 114: - case 131: - case 132: + case 97: + case 99: + case 100: + case 101: + case 102: + case 103: + case 115: + case 116: + case 123: + case 140: + case 141: unset($yypminor->yy202); break; default: @@ -3931,10 +4790,10 @@ private function yy_reduce(int $yyruleno): void case 73: case 80: case 81: - case 132: - case 136: case 141: - case 149: + case 145: + case 150: + case 158: $yygotominor = $this->yystack[$this->yyidx + 0]->minor; break; case 5: @@ -3958,23 +4817,23 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(27, $this->yystack[$this->yyidx + -5]->minor); - $this->yy_destructor(28, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(36, $this->yystack[$this->yyidx + -5]->minor); + $this->yy_destructor(37, $this->yystack[$this->yyidx + -2]->minor); } break; case 7: $yygotominor = 1; - $this->yy_destructor(29, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(38, $this->yystack[$this->yyidx + 0]->minor); break; case 8: $yygotominor = 0; - $this->yy_destructor(30, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(39, $this->yystack[$this->yyidx + 0]->minor); break; case 9: // distinct_all ::= (no DISTINCT or ALL keyword) - no distinct $yygotominor = null; break; - case 135: + case 144: // distinct_or_null ::= (no DISTINCT keyword in function call) $yygotominor = null; break; @@ -3985,7 +4844,7 @@ private function yy_reduce(int $yyruleno): void case 85: case 89: case 91: - case 137: + case 146: // Empty optional clause (where, limit, order, group, having, for_update, etc.) // Matches cphalcon ZVAL_UNDEF — must be null so phql_ret_*_statement skips adding the key $yygotominor = null; @@ -4005,25 +4864,25 @@ private function yy_reduce(int $yyruleno): void case 64: case 72: case 79: - case 138: + case 147: phql_ret_zval_list( $yygotominor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(26, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(35, $this->yystack[$this->yyidx + -1]->minor); break; case 11: case 42: case 45: - case 129: - case 139: + case 138: + case 148: phql_ret_zval_list($yygotominor, $this->yystack[$this->yyidx + 0]->minor); break; case 12: - case 140: + case 149: phql_ret_column_item($yygotominor, Opcode::STARALL->value); - $this->yy_destructor(18, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(22, $this->yystack[$this->yyidx + 0]->minor); break; case 13: phql_ret_column_item( @@ -4032,8 +4891,8 @@ private function yy_reduce(int $yyruleno): void null, $this->yystack[$this->yyidx + -2]->minor, ); - $this->yy_destructor(32, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(18, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(41, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(22, $this->yystack[$this->yyidx + 0]->minor); break; case 14: phql_ret_column_item( @@ -4043,7 +4902,7 @@ private function yy_reduce(int $yyruleno): void null, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(33, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(42, $this->yystack[$this->yyidx + -1]->minor); break; case 15: phql_ret_column_item( @@ -4062,7 +4921,7 @@ private function yy_reduce(int $yyruleno): void ); break; case 21: - case 128: + case 137: phql_ret_zval_list( $yygotominor, $this->yystack[$this->yyidx + -1]->minor, @@ -4080,64 +4939,64 @@ private function yy_reduce(int $yyruleno): void break; case 25: phql_ret_qualified_name($yygotominor, null, null, $this->yystack[$this->yyidx + 0]->minor); - $this->yy_destructor(33, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(42, $this->yystack[$this->yyidx + -1]->minor); break; case 26: case 46: case 66: - case 161: + case 170: phql_ret_qualified_name($yygotominor, null, null, $this->yystack[$this->yyidx + 0]->minor); break; case 28: $yygotominor = Opcode::INNERJOIN->value; - $this->yy_destructor(34, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(43, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 29: $yygotominor = Opcode::CROSSJOIN->value; - $this->yy_destructor(36, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(45, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 30: $yygotominor = Opcode::LEFTJOIN->value; - $this->yy_destructor(37, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(38, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(46, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(47, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 31: $yygotominor = Opcode::LEFTJOIN->value; - $this->yy_destructor(37, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(46, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 32: $yygotominor = Opcode::RIGHTJOIN->value; - $this->yy_destructor(39, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(38, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(48, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(47, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 33: $yygotominor = Opcode::RIGHTJOIN->value; - $this->yy_destructor(39, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(48, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 34: $yygotominor = Opcode::FULLJOIN->value; - $this->yy_destructor(40, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(38, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(49, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(47, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 35: $yygotominor = Opcode::FULLJOIN->value; - $this->yy_destructor(40, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(49, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 36: $yygotominor = Opcode::INNERJOIN->value; - $this->yy_destructor(35, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(44, $this->yystack[$this->yyidx + 0]->minor); break; case 37: $yygotominor = $this->yystack[$this->yyidx + 0]->minor; - $this->yy_destructor(41, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(50, $this->yystack[$this->yyidx + -1]->minor); break; case 39: phql_ret_insert_statement( @@ -4146,11 +5005,11 @@ private function yy_reduce(int $yyruleno): void null, $this->yystack[$this->yyidx + -1]->minor ); - $this->yy_destructor(42, $this->yystack[$this->yyidx + -6]->minor); - $this->yy_destructor(43, $this->yystack[$this->yyidx + -5]->minor); - $this->yy_destructor(44, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(51, $this->yystack[$this->yyidx + -6]->minor); + $this->yy_destructor(52, $this->yystack[$this->yyidx + -5]->minor); + $this->yy_destructor(53, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; case 40: phql_ret_insert_statement( @@ -4159,13 +5018,13 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -1]->minor ); - $this->yy_destructor(42, $this->yystack[$this->yyidx + -9]->minor); - $this->yy_destructor(43, $this->yystack[$this->yyidx + -8]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -6]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + -4]->minor); - $this->yy_destructor(44, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(51, $this->yystack[$this->yyidx + -9]->minor); + $this->yy_destructor(52, $this->yystack[$this->yyidx + -8]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -6]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + -4]->minor); + $this->yy_destructor(53, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; case 47: phql_ret_update_statement( @@ -4181,8 +5040,8 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(47, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(48, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(56, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(57, $this->yystack[$this->yyidx + -1]->minor); break; case 51: phql_ret_update_item( @@ -4202,8 +5061,8 @@ private function yy_reduce(int $yyruleno): void break; case 54: phql_ret_delete_clause($yygotominor, $this->yystack[$this->yyidx + 0]->minor); - $this->yy_destructor(49, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(28, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(58, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(37, $this->yystack[$this->yyidx + -1]->minor); break; case 55: phql_ret_assoc_name( @@ -4211,7 +5070,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, ); - $this->yy_destructor(33, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(42, $this->yystack[$this->yyidx + -1]->minor); break; case 56: phql_ret_assoc_name( @@ -4230,8 +5089,8 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(33, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(50, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(42, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(59, $this->yystack[$this->yyidx + -1]->minor); break; case 59: phql_ret_assoc_name( @@ -4240,10 +5099,10 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -1]->minor ); - $this->yy_destructor(33, $this->yystack[$this->yyidx + -5]->minor); - $this->yy_destructor(50, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(42, $this->yystack[$this->yyidx + -5]->minor); + $this->yy_destructor(59, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; case 60: phql_ret_assoc_name( @@ -4252,9 +5111,9 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -1]->minor ); - $this->yy_destructor(50, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(59, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; case 61: phql_ret_assoc_name( @@ -4263,7 +5122,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(50, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(59, $this->yystack[$this->yyidx + -1]->minor); break; case 62: phql_ret_assoc_name( @@ -4272,9 +5131,9 @@ private function yy_reduce(int $yyruleno): void null, $this->yystack[$this->yyidx + -1]->minor ); - $this->yy_destructor(50, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(59, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; case 63: phql_ret_assoc_name( @@ -4283,46 +5142,46 @@ private function yy_reduce(int $yyruleno): void null, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(50, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(59, $this->yystack[$this->yyidx + -1]->minor); break; case 68: $yygotominor = $this->yystack[$this->yyidx + 0]->minor; - $this->yy_destructor(51, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(60, $this->yystack[$this->yyidx + -1]->minor); break; case 70: $yygotominor = $this->yystack[$this->yyidx + 0]->minor; - $this->yy_destructor(52, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(53, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(61, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(62, $this->yystack[$this->yyidx + -1]->minor); break; case 74: phql_ret_order_item($yygotominor, $this->yystack[$this->yyidx + 0]->minor); break; case 75: phql_ret_order_item($yygotominor, $this->yystack[$this->yyidx + -1]->minor, Opcode::ASC->value); - $this->yy_destructor(54, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(63, $this->yystack[$this->yyidx + 0]->minor); break; case 76: phql_ret_order_item($yygotominor, $this->yystack[$this->yyidx + -1]->minor, Opcode::DESC->value); - $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(64, $this->yystack[$this->yyidx + 0]->minor); break; case 77: $yygotominor = $this->yystack[$this->yyidx + 0]->minor; - $this->yy_destructor(56, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(53, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(65, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(62, $this->yystack[$this->yyidx + -1]->minor); break; case 82: $yygotominor = $this->yystack[$this->yyidx + 0]->minor; - $this->yy_destructor(57, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(66, $this->yystack[$this->yyidx + -1]->minor); break; case 84: $yygotominor = true; - $this->yy_destructor(58, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(47, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(67, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(56, $this->yystack[$this->yyidx + 0]->minor); break; case 86: case 90: phql_ret_limit_clause($yygotominor, $this->yystack[$this->yyidx + 0]->minor, null); - $this->yy_destructor(59, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(68, $this->yystack[$this->yyidx + -1]->minor); break; case 87: phql_ret_limit_clause( @@ -4330,8 +5189,8 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -2]->minor ); - $this->yy_destructor(59, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(26, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(68, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(35, $this->yystack[$this->yyidx + -1]->minor); break; case 88: phql_ret_limit_clause( @@ -4339,11 +5198,11 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(59, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(60, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(68, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(69, $this->yystack[$this->yyidx + -1]->minor); break; case 92: - case 150: + case 159: phql_ret_literal_zval( $yygotominor, Opcode::INTEGER->value, @@ -4351,7 +5210,7 @@ private function yy_reduce(int $yyruleno): void ); break; case 93: - case 151: + case 160: phql_ret_literal_zval( $yygotominor, Opcode::HINTEGER->value, @@ -4359,7 +5218,7 @@ private function yy_reduce(int $yyruleno): void ); break; case 94: - case 157: + case 166: phql_ret_placeholder_zval( $yygotominor, Opcode::NPLACEHOLDER->value, @@ -4367,7 +5226,7 @@ private function yy_reduce(int $yyruleno): void ); break; case 95: - case 158: + case 167: phql_ret_placeholder_zval( $yygotominor, Opcode::SPLACEHOLDER->value, @@ -4375,7 +5234,7 @@ private function yy_reduce(int $yyruleno): void ); break; case 96: - case 159: + case 168: phql_ret_placeholder_zval( $yygotominor, Opcode::BPLACEHOLDER->value, @@ -4384,7 +5243,7 @@ private function yy_reduce(int $yyruleno): void break; case 97: phql_ret_expr($yygotominor, Opcode::MINUS->value, null, $this->yystack[$this->yyidx + 0]->minor); - $this->yy_destructor(21, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(25, $this->yystack[$this->yyidx + -1]->minor); break; case 98: phql_ret_expr( @@ -4393,7 +5252,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(21, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(25, $this->yystack[$this->yyidx + -1]->minor); break; case 99: phql_ret_expr( @@ -4402,7 +5261,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(20, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(24, $this->yystack[$this->yyidx + -1]->minor); break; case 100: phql_ret_expr( @@ -4411,7 +5270,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(18, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(22, $this->yystack[$this->yyidx + -1]->minor); break; case 101: phql_ret_expr( @@ -4420,7 +5279,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(17, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(21, $this->yystack[$this->yyidx + -1]->minor); break; case 102: phql_ret_expr( @@ -4429,7 +5288,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(19, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(23, $this->yystack[$this->yyidx + -1]->minor); break; case 103: phql_ret_expr( @@ -4438,7 +5297,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(10, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(14, $this->yystack[$this->yyidx + -1]->minor); break; case 104: phql_ret_expr( @@ -4447,7 +5306,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(15, $this->yystack[$this->yyidx + -1]->minor); break; case 105: phql_ret_expr( @@ -4456,7 +5315,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(14, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(18, $this->yystack[$this->yyidx + -1]->minor); break; case 106: phql_ret_expr( @@ -4465,7 +5324,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(15, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(19, $this->yystack[$this->yyidx + -1]->minor); break; case 107: phql_ret_expr( @@ -4474,9 +5333,90 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(16, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(20, $this->yystack[$this->yyidx + -1]->minor); break; case 108: + phql_ret_expr( + $yygotominor, + Opcode::OP_MATCHES->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(10, $this->yystack[$this->yyidx + -1]->minor); + break; + case 109: + phql_ret_expr( + $yygotominor, + Opcode::OP_CONTAINS->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(11, $this->yystack[$this->yyidx + -1]->minor); + break; + case 110: + phql_ret_expr( + $yygotominor, + Opcode::OP_CONTAINED->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(12, $this->yystack[$this->yyidx + -1]->minor); + break; + case 111: + phql_ret_expr( + $yygotominor, + Opcode::OP_OVERLAPS->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(13, $this->yystack[$this->yyidx + -1]->minor); + break; + case 112: + phql_ret_expr( + $yygotominor, + Opcode::OP_CONCAT->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(26, $this->yystack[$this->yyidx + -1]->minor); + break; + case 113: + phql_ret_expr( + $yygotominor, + Opcode::OP_JSON_GET->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(31, $this->yystack[$this->yyidx + -1]->minor); + break; + case 114: + phql_ret_expr( + $yygotominor, + Opcode::OP_JSON_GET_TEXT->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(32, $this->yystack[$this->yyidx + -1]->minor); + break; + case 115: + phql_ret_expr( + $yygotominor, + Opcode::OP_JSON_PATH->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(33, $this->yystack[$this->yyidx + -1]->minor); + break; + case 116: + phql_ret_expr( + $yygotominor, + Opcode::OP_JSON_PATH_TEXT->value, + $this->yystack[$this->yyidx + -2]->minor, + $this->yystack[$this->yyidx + 0]->minor + ); + $this->yy_destructor(34, $this->yystack[$this->yyidx + -1]->minor); + break; + case 117: phql_ret_expr( $yygotominor, Opcode::EQUALS->value, @@ -4485,7 +5425,7 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(4, $this->yystack[$this->yyidx + -1]->minor); break; - case 109: + case 118: phql_ret_expr( $yygotominor, Opcode::NOTEQUALS->value, @@ -4494,7 +5434,7 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(5, $this->yystack[$this->yyidx + -1]->minor); break; - case 110: + case 119: phql_ret_expr( $yygotominor, Opcode::LESS->value, @@ -4503,7 +5443,7 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(6, $this->yystack[$this->yyidx + -1]->minor); break; - case 111: + case 120: phql_ret_expr( $yygotominor, Opcode::GREATER->value, @@ -4512,7 +5452,7 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(7, $this->yystack[$this->yyidx + -1]->minor); break; - case 112: + case 121: phql_ret_expr( $yygotominor, Opcode::GREATEREQUAL->value, @@ -4521,7 +5461,7 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(8, $this->yystack[$this->yyidx + -1]->minor); break; - case 113: + case 122: phql_ret_expr( $yygotominor, Opcode::LESSEQUAL->value, @@ -4530,86 +5470,86 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(9, $this->yystack[$this->yyidx + -1]->minor); break; - case 114: + case 123: phql_ret_expr( $yygotominor, Opcode::LIKE->value, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(12, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(16, $this->yystack[$this->yyidx + -1]->minor); break; - case 115: + case 124: phql_ret_expr( $yygotominor, Opcode::NLIKE->value, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(24, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(12, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(29, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(16, $this->yystack[$this->yyidx + -1]->minor); break; - case 116: + case 125: phql_ret_expr( $yygotominor, Opcode::ILIKE->value, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(13, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(17, $this->yystack[$this->yyidx + -1]->minor); break; - case 117: + case 126: phql_ret_expr( $yygotominor, Opcode::NILIKE->value, $this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(24, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(13, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(29, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(17, $this->yystack[$this->yyidx + -1]->minor); break; - case 118: - case 121: + case 127: + case 130: phql_ret_expr( $yygotominor, Opcode::IN->value, $this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -1]->minor ); - $this->yy_destructor(23, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(28, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; - case 119: - case 122: + case 128: + case 131: phql_ret_expr( $yygotominor, Opcode::NOTIN->value, $this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -1]->minor ); - $this->yy_destructor(24, $this->yystack[$this->yyidx + -4]->minor); - $this->yy_destructor(23, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(29, $this->yystack[$this->yyidx + -4]->minor); + $this->yy_destructor(28, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; - case 120: + case 129: phql_ret_expr( $yygotominor, Opcode::SUBQUERY->value, $this->yystack[$this->yyidx + -1]->minor, null ); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; - case 123: + case 132: phql_ret_expr($yygotominor, Opcode::EXISTS->value, null, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(66, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(75, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; - case 124: + case 133: phql_ret_expr( $yygotominor, Opcode::AGAINST->value, @@ -4618,7 +5558,7 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(1, $this->yystack[$this->yyidx + -1]->minor); break; - case 125: + case 134: $qualified = []; phql_ret_raw_qualified_name($qualified, $this->yystack[$this->yyidx + -1]->minor); phql_ret_expr( @@ -4627,12 +5567,12 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -3]->minor, $qualified ); - $this->yy_destructor(67, $this->yystack[$this->yyidx + -5]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -4]->minor); - $this->yy_destructor(33, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(76, $this->yystack[$this->yyidx + -5]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -4]->minor); + $this->yy_destructor(42, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; - case 126: + case 135: $qualified = []; phql_ret_raw_qualified_name($qualified, $this->yystack[$this->yyidx + -1]->minor, null); phql_ret_expr( @@ -4641,67 +5581,67 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -3]->minor, $qualified ); - $this->yy_destructor(68, $this->yystack[$this->yyidx + -5]->minor); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -4]->minor); - $this->yy_destructor(69, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(77, $this->yystack[$this->yyidx + -5]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -4]->minor); + $this->yy_destructor(78, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; - case 127: + case 136: phql_ret_expr( $yygotominor, Opcode::CASE->value, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor ); - $this->yy_destructor(70, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(71, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(79, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(80, $this->yystack[$this->yyidx + 0]->minor); break; - case 130: + case 139: phql_ret_expr( $yygotominor, Opcode::WHEN->value, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(72, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(73, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(81, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(82, $this->yystack[$this->yyidx + -1]->minor); break; - case 131: + case 140: phql_ret_expr($yygotominor, Opcode::ELSE->value, $this->yystack[$this->yyidx + 0]->minor, null); - $this->yy_destructor(74, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(83, $this->yystack[$this->yyidx + -1]->minor); break; - case 133: + case 142: phql_ret_func_call( $yygotominor, $this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -2]->minor ); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -3]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -3]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; - case 134: + case 143: // distinct_or_null ::= DISTINCT (DISTINCT keyword present in function call) $yygotominor = true; - $this->yy_destructor(29, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(38, $this->yystack[$this->yyidx + 0]->minor); break; - case 142: + case 151: phql_ret_expr($yygotominor, Opcode::ISNULL->value, $this->yystack[$this->yyidx + -2]->minor, null); - $this->yy_destructor(22, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(75, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(27, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(84, $this->yystack[$this->yyidx + 0]->minor); break; - case 143: + case 152: phql_ret_expr( $yygotominor, Opcode::ISNOTNULL->value, $this->yystack[$this->yyidx + -3]->minor, null ); - $this->yy_destructor(22, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(24, $this->yystack[$this->yyidx + -1]->minor); - $this->yy_destructor(75, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(27, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(29, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(84, $this->yystack[$this->yyidx + 0]->minor); break; - case 144: + case 153: phql_ret_expr( $yygotominor, Opcode::BETWEEN->value, @@ -4710,7 +5650,7 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(2, $this->yystack[$this->yyidx + -1]->minor); break; - case 145: + case 154: phql_ret_expr( $yygotominor, Opcode::BETWEEN_NOT->value, @@ -4719,56 +5659,56 @@ private function yy_reduce(int $yyruleno): void ); $this->yy_destructor(3, $this->yystack[$this->yyidx + -1]->minor); break; - case 146: + case 155: phql_ret_expr($yygotominor, Opcode::NOT->value, null, $this->yystack[$this->yyidx + 0]->minor); - $this->yy_destructor(24, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(29, $this->yystack[$this->yyidx + -1]->minor); break; - case 147: + case 156: phql_ret_expr( $yygotominor, Opcode::BITWISE_NOT->value, null, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(25, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(30, $this->yystack[$this->yyidx + -1]->minor); break; - case 148: + case 157: phql_ret_expr( $yygotominor, Opcode::ENCLOSED->value, $this->yystack[$this->yyidx + -1]->minor, null ); - $this->yy_destructor(45, $this->yystack[$this->yyidx + -2]->minor); - $this->yy_destructor(46, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(54, $this->yystack[$this->yyidx + -2]->minor); + $this->yy_destructor(55, $this->yystack[$this->yyidx + 0]->minor); break; - case 152: + case 161: phql_ret_literal_zval($yygotominor, Opcode::STRING->value, $this->yystack[$this->yyidx + 0]->minor); break; - case 153: + case 162: phql_ret_literal_zval($yygotominor, Opcode::DOUBLE->value, $this->yystack[$this->yyidx + 0]->minor); break; - case 154: + case 163: phql_ret_literal_zval($yygotominor, Opcode::NULL->value); - $this->yy_destructor(75, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(84, $this->yystack[$this->yyidx + 0]->minor); break; - case 155: + case 164: #line 920 "c/parser.php.lemon" { phql_ret_literal_zval($yygotominor, Opcode::TRUE->value, null); - $this->yy_destructor(78, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(87, $this->yystack[$this->yyidx + 0]->minor); } #line 2086 "c/parser.php.php" break; - case 156: + case 165: #line 924 "c/parser.php.lemon" { phql_ret_literal_zval($yygotominor, Opcode::FALSE->value, null); - $this->yy_destructor(79, $this->yystack[$this->yyidx + 0]->minor); + $this->yy_destructor(88, $this->yystack[$this->yyidx + 0]->minor); } #line 2094 "c/parser.php.php" break; - case 160: + case 169: #line 947 "c/parser.php.lemon" { phql_ret_qualified_name( @@ -4777,7 +5717,7 @@ private function yy_reduce(int $yyruleno): void $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor ); - $this->yy_destructor(32, $this->yystack[$this->yyidx + -1]->minor); + $this->yy_destructor(41, $this->yystack[$this->yyidx + -1]->minor); } #line 2102 "c/parser.php.php" break; diff --git a/src/Parser.php b/src/Parser.php index 70f173c..1aca9e1 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -74,6 +74,15 @@ public function parse(string $phql): array Opcode::BITWISE_OR => $parserObject->phql_(\phql_Parser::PHQL_BITWISE_OR), Opcode::BITWISE_NOT => $parserObject->phql_(\phql_Parser::PHQL_BITWISE_NOT), Opcode::BITWISE_XOR => $parserObject->phql_(\phql_Parser::PHQL_BITWISE_XOR), + Opcode::OP_MATCHES => $parserObject->phql_(\phql_Parser::PHQL_OP_MATCHES), + Opcode::OP_CONTAINS => $parserObject->phql_(\phql_Parser::PHQL_OP_CONTAINS), + Opcode::OP_CONTAINED => $parserObject->phql_(\phql_Parser::PHQL_OP_CONTAINED), + Opcode::OP_OVERLAPS => $parserObject->phql_(\phql_Parser::PHQL_OP_OVERLAPS), + Opcode::OP_CONCAT => $parserObject->phql_(\phql_Parser::PHQL_OP_CONCAT), + Opcode::OP_JSON_GET => $parserObject->phql_(\phql_Parser::PHQL_OP_JSON_GET), + Opcode::OP_JSON_GET_TEXT => $parserObject->phql_(\phql_Parser::PHQL_OP_JSON_GET_TEXT), + Opcode::OP_JSON_PATH => $parserObject->phql_(\phql_Parser::PHQL_OP_JSON_PATH), + Opcode::OP_JSON_PATH_TEXT => $parserObject->phql_(\phql_Parser::PHQL_OP_JSON_PATH_TEXT), Opcode::AGAINST => $parserObject->phql_(\phql_Parser::PHQL_AGAINST), Opcode::CASE => $parserObject->phql_(\phql_Parser::PHQL_CASE), Opcode::WHEN => $parserObject->phql_(\phql_Parser::PHQL_WHEN), diff --git a/src/Scanner/Opcode.php b/src/Scanner/Opcode.php index 140f618..094c1fb 100644 --- a/src/Scanner/Opcode.php +++ b/src/Scanner/Opcode.php @@ -82,6 +82,15 @@ enum Opcode: int case NULL = 322; case OFFSET = 329; case ON = 316; + case OP_CONCAT = 405; + case OP_CONTAINED = 403; + case OP_CONTAINS = 402; + case OP_JSON_GET = 406; + case OP_JSON_GET_TEXT = 416; + case OP_JSON_PATH = 417; + case OP_JSON_PATH_TEXT = 418; + case OP_MATCHES = 401; + case OP_OVERLAPS = 404; case OR = 267; case ORDER = 310; case OUTER = 326; @@ -100,12 +109,6 @@ enum Opcode: int case SUBQUERY = 407; case THEN = 413; case TRUE = 334; - case TS_AND = 403; - case TS_CONTAINS_ANOTHER = 405; - case TS_CONTAINS_IN = 406; - case TS_MATCHES = 401; - case TS_NEGATE = 404; - case TS_OR = 402; case UPDATE = 300; case USING = 337; case VALUES = 308; @@ -133,6 +136,15 @@ public function label(): string self::MUL => '*', self::NOT => '!', self::NOTEQUALS => '<>', + self::OP_CONCAT => '||', + self::OP_CONTAINED => '<@', + self::OP_CONTAINS => '@>', + self::OP_JSON_GET => '->', + self::OP_JSON_GET_TEXT => '->>', + self::OP_JSON_PATH => '#>', + self::OP_JSON_PATH_TEXT => '#>>', + self::OP_MATCHES => '@@', + self::OP_OVERLAPS => '&&', self::PARENTHESES_CLOSE => ')', self::PARENTHESES_OPEN => '(', self::SUB => '-', diff --git a/src/Scanner/Scanner.php b/src/Scanner/Scanner.php index 0584986..50b9ea1 100644 --- a/src/Scanner/Scanner.php +++ b/src/Scanner/Scanner.php @@ -65,6 +65,9 @@ public function scanForToken(): ScannerStatus case '"': $yystate = 8; break 2; + case '#': + $yystate = 319; + break 2; case '%': $yystate = 9; break 2; @@ -278,10 +281,6 @@ public function scanForToken(): ScannerStatus case 6: $yych = $yyinput[$yycursor]; switch ($yych) { - case '!': - $yycursor += 1; - $yystate = 65; - break 2; case '=': $yycursor += 1; $yystate = 66; @@ -362,10 +361,16 @@ public function scanForToken(): ScannerStatus return ScannerStatus::OK; case 18: - $this->token = new Token(Opcode::SUB); - $this->state->setCursor($yycursor); - return ScannerStatus::OK; - + $yych = $yyinput[$yycursor]; + switch ($yych) { + case '>': + $yycursor += 1; + $yystate = 323; + break 2; + default: + $yystate = 324; + break 2; + } case 19: $yych = $yyinput[$yycursor]; switch ($yych) { @@ -534,6 +539,10 @@ public function scanForToken(): ScannerStatus $yycursor += 1; $yystate = 81; break 2; + case '@': + $yycursor += 1; + $yystate = 327; + break 2; default: $yystate = 27; break 2; @@ -1357,11 +1366,6 @@ public function scanForToken(): ScannerStatus $this->state->setCursor($yycursor); return ScannerStatus::OK; - case 65: - $this->token = new Token(Opcode::TS_NEGATE); - $this->state->setCursor($yycursor); - return ScannerStatus::OK; - case 66: $this->token = new Token(Opcode::NOTEQUALS); $this->state->setCursor($yycursor); @@ -1428,7 +1432,7 @@ public function scanForToken(): ScannerStatus break 2; } case 72: - $this->token = new Token(Opcode::TS_AND); + $this->token = new Token(Opcode::OP_OVERLAPS); $this->state->setCursor($yycursor); return ScannerStatus::OK; @@ -1643,11 +1647,11 @@ public function scanForToken(): ScannerStatus $this->state->setCursor($yycursor); return ScannerStatus::OK; case 85: - $this->token = new Token(Opcode::TS_CONTAINS_ANOTHER); + $this->token = new Token(Opcode::OP_CONTAINS); $this->state->setCursor($yycursor); return ScannerStatus::OK; case 86: - $this->token = new Token(Opcode::TS_MATCHES); + $this->token = new Token(Opcode::OP_MATCHES); $this->state->setCursor($yycursor); return ScannerStatus::OK; case 87: @@ -2797,7 +2801,7 @@ public function scanForToken(): ScannerStatus break 2; } case 141: - $this->token = new Token(Opcode::TS_OR); + $this->token = new Token(Opcode::OP_CONCAT); $this->state->setCursor($yycursor); return ScannerStatus::OK; @@ -7494,6 +7498,69 @@ public function scanForToken(): ScannerStatus $this->state->setCursor($yycursor); return ScannerStatus::OK; + case 319: + $yych = $yyinput[$yycursor]; + switch ($yych) { + case '>': + $yycursor += 1; + $yystate = 320; + break 2; + default: + $yystate = 3; + break 2; + } + case 320: + $yych = $yyinput[$yycursor]; + switch ($yych) { + case '>': + $yycursor += 1; + $yystate = 321; + break 2; + default: + $yystate = 322; + break 2; + } + case 321: + $this->token = new Token(Opcode::OP_JSON_PATH_TEXT); + $this->state->setCursor($yycursor); + return ScannerStatus::OK; + + case 322: + $this->token = new Token(Opcode::OP_JSON_PATH); + $this->state->setCursor($yycursor); + return ScannerStatus::OK; + + case 323: + $yych = $yyinput[$yycursor]; + switch ($yych) { + case '>': + $yycursor += 1; + $yystate = 325; + break 2; + default: + $yystate = 326; + break 2; + } + case 324: + $this->token = new Token(Opcode::SUB); + $this->state->setCursor($yycursor); + return ScannerStatus::OK; + + case 325: + $this->token = new Token(Opcode::OP_JSON_GET_TEXT); + $this->state->setCursor($yycursor); + return ScannerStatus::OK; + + case 326: + $this->token = new Token(Opcode::OP_JSON_GET); + $this->state->setCursor($yycursor); + return ScannerStatus::OK; + + case 327: + $this->token = new Token(Opcode::OP_CONTAINED); + $this->state->setCursor($yycursor); + return ScannerStatus::OK; + default: throw new Exception("internal lexer error"); } diff --git a/tests/unit/Phql/Select/CustomOperatorsTest.php b/tests/unit/Phql/Select/CustomOperatorsTest.php new file mode 100644 index 0000000..7d62c92 --- /dev/null +++ b/tests/unit/Phql/Select/CustomOperatorsTest.php @@ -0,0 +1,232 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Phql\Tests\Unit\Phql\Select; + +use Phalcon\Phql\Parser; +use Phalcon\Phql\Scanner\Opcode; +use Phalcon\Phql\Tests\AbstractUnitTestCase; + +final class CustomOperatorsTest extends AbstractUnitTestCase +{ + /** + * @return array + */ + public static function getOperators(): array + { + return [ + ['@@', Opcode::OP_MATCHES], + ['@>', Opcode::OP_CONTAINS], + ['<@', Opcode::OP_CONTAINED], + ['&&', Opcode::OP_OVERLAPS], + ['||', Opcode::OP_CONCAT], + ['->', Opcode::OP_JSON_GET], + ['->>', Opcode::OP_JSON_GET_TEXT], + ['#>', Opcode::OP_JSON_PATH], + ['#>>', Opcode::OP_JSON_PATH_TEXT], + ]; + } + + /** + * @return void + * + * @author Phalcon Team + * @since 2026-06-10 + * + * @dataProvider getOperators + */ + public function testMvcModelQueryPhqlSelectCustomOperator( + string $operator, + Opcode $opcode + ): void { + $source = "SELECT * " + . "FROM Invoices " + . "WHERE inv_title " . $operator . " 'x'"; + $expected = [ + 'type' => Opcode::SELECT->value, + 'select' => [ + 'columns' => [ + 0 => [ + 'type' => Opcode::STARALL->value, + ], + ], + 'tables' => [ + 'qualifiedName' => [ + 'type' => Opcode::QUALIFIED->value, + 'name' => 'Invoices', + ], + ], + ], + 'where' => [ + 'type' => $opcode->value, + 'left' => [ + 'type' => Opcode::QUALIFIED->value, + 'name' => 'inv_title', + ], + 'right' => [ + 'type' => Opcode::STRING->value, + 'value' => 'x', + ], + ], + ]; + $actual = (new Parser())->parse($source); + $this->assertSame($expected, $actual); + } + + /** + * The json accessors must bind tighter than '=': + * inv_title ->> 'a' = 'b' parses as (inv_title ->> 'a') = 'b' + * + * @return void + * + * @author Phalcon Team + * @since 2026-06-10 + */ + public function testMvcModelQueryPhqlSelectJsonGetTextBindsTighterThanEquals(): void + { + $source = "SELECT * " + . "FROM Invoices " + . "WHERE inv_title ->> 'a' = 'b'"; + $expected = [ + 'type' => Opcode::SELECT->value, + 'select' => [ + 'columns' => [ + 0 => [ + 'type' => Opcode::STARALL->value, + ], + ], + 'tables' => [ + 'qualifiedName' => [ + 'type' => Opcode::QUALIFIED->value, + 'name' => 'Invoices', + ], + ], + ], + 'where' => [ + 'type' => Opcode::EQUALS->value, + 'left' => [ + 'type' => Opcode::OP_JSON_GET_TEXT->value, + 'left' => [ + 'type' => Opcode::QUALIFIED->value, + 'name' => 'inv_title', + ], + 'right' => [ + 'type' => Opcode::STRING->value, + 'value' => 'a', + ], + ], + 'right' => [ + 'type' => Opcode::STRING->value, + 'value' => 'b', + ], + ], + ]; + $actual = (new Parser())->parse($source); + $this->assertSame($expected, $actual); + } + + /** + * OP_CONCAT has PLUS/MINUS precedence, so it binds tighter than '=' + * + * @return void + * + * @author Phalcon Team + * @since 2026-06-10 + */ + public function testMvcModelQueryPhqlSelectConcatInsideComparison(): void + { + $source = "SELECT * " + . "FROM Invoices " + . "WHERE inv_title || 'a' = 'b'"; + $expected = [ + 'type' => Opcode::SELECT->value, + 'select' => [ + 'columns' => [ + 0 => [ + 'type' => Opcode::STARALL->value, + ], + ], + 'tables' => [ + 'qualifiedName' => [ + 'type' => Opcode::QUALIFIED->value, + 'name' => 'Invoices', + ], + ], + ], + 'where' => [ + 'type' => Opcode::EQUALS->value, + 'left' => [ + 'type' => Opcode::OP_CONCAT->value, + 'left' => [ + 'type' => Opcode::QUALIFIED->value, + 'name' => 'inv_title', + ], + 'right' => [ + 'type' => Opcode::STRING->value, + 'value' => 'a', + ], + ], + 'right' => [ + 'type' => Opcode::STRING->value, + 'value' => 'b', + ], + ], + ]; + $actual = (new Parser())->parse($source); + $this->assertSame($expected, $actual); + } + + /** + * Custom operators are usable in the column list with an alias + * + * @return void + * + * @author Phalcon Team + * @since 2026-06-10 + */ + public function testMvcModelQueryPhqlSelectJsonGetInColumnList(): void + { + $source = "SELECT inv_meta -> 'currency' AS currency " + . "FROM Invoices"; + $expected = [ + 'type' => Opcode::SELECT->value, + 'select' => [ + 'columns' => [ + 0 => [ + 'type' => Opcode::EXPR->value, + 'column' => [ + 'type' => Opcode::OP_JSON_GET->value, + 'left' => [ + 'type' => Opcode::QUALIFIED->value, + 'name' => 'inv_meta', + ], + 'right' => [ + 'type' => Opcode::STRING->value, + 'value' => 'currency', + ], + ], + 'alias' => 'currency', + ], + ], + 'tables' => [ + 'qualifiedName' => [ + 'type' => Opcode::QUALIFIED->value, + 'name' => 'Invoices', + ], + ], + ], + ]; + $actual = (new Parser())->parse($source); + $this->assertSame($expected, $actual); + } +} diff --git a/tests/unit/Scanner/ScannerTest.php b/tests/unit/Scanner/ScannerTest.php index ea18a80..029786b 100644 --- a/tests/unit/Scanner/ScannerTest.php +++ b/tests/unit/Scanner/ScannerTest.php @@ -14,17 +14,41 @@ final class ScannerTest extends AbstractUnitTestCase { public function testBitwiseOperators(): void { - $opcodes = $this->scanAll('& && | || ~ ^ !! @@ @>'); + $opcodes = $this->scanAll('& | ~ ^'); $this->assertSame([ Opcode::BITWISE_AND, - Opcode::TS_AND, Opcode::BITWISE_OR, - Opcode::TS_OR, Opcode::BITWISE_NOT, Opcode::BITWISE_XOR, - Opcode::TS_NEGATE, - Opcode::TS_MATCHES, - Opcode::TS_CONTAINS_ANOTHER, + ], $opcodes); + } + + public function testDialectSpecificOperators(): void + { + $opcodes = $this->scanAll('@@ @> <@ && || -> ->> #> #>>'); + $this->assertSame([ + Opcode::OP_MATCHES, + Opcode::OP_CONTAINS, + Opcode::OP_CONTAINED, + Opcode::OP_OVERLAPS, + Opcode::OP_CONCAT, + Opcode::OP_JSON_GET, + Opcode::OP_JSON_GET_TEXT, + Opcode::OP_JSON_PATH, + Opcode::OP_JSON_PATH_TEXT, + ], $opcodes); + } + + public function testDialectSpecificOperatorsDoNotBreakNeighbours(): void + { + $opcodes = $this->scanAll('- < > !! ->'); + $this->assertSame([ + Opcode::SUB, + Opcode::LESS, + Opcode::GREATER, + Opcode::NOT, + Opcode::NOT, + Opcode::OP_JSON_GET, ], $opcodes); }