/* Driver template for the LEMON parser generator. ** The author disclaims copyright to this source code. ** ** This version of "lempar.c" is modified, slightly, for use by SQLite. ** The only modifications are the addition of a couple of NEVER() ** macros to disable tests that are needed in the case of a general ** LALR(1) grammar but which are always false in the ** specific grammar used by SQLite. */ /* First off, code is included that follows the "include" declaration ** in the input grammar file. */ #include #line 49 "parse.y" #include "sqliteInt.h" /* ** Disable all error recovery processing in the parser push-down ** automaton. */ #define YYNOERRORRECOVERY 1 /* ** Make yytestcase() the same as testcase() */ #define yytestcase(X) testcase(X) /* ** An instance of this structure holds information about the ** LIMIT clause of a SELECT statement. */ struct LimitVal { Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */ Expr *pOffset; /* The OFFSET expression. NULL if there is none */ }; /* ** An instance of this structure is used to store the LIKE, ** GLOB, NOT LIKE, and NOT GLOB operators. */ struct LikeOp { Token eOperator; /* "like" or "glob" or "regexp" */ int not; /* True if the NOT keyword is present */ }; /* ** An instance of the following structure describes the event of a ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, ** TK_DELETE, or TK_INSTEAD. If the event is of the form ** ** UPDATE ON (a,b,c) ** ** Then the "b" IdList records the list "a,b,c". */ struct TrigEvent { int a; IdList * b; }; /* ** An instance of this structure holds the ATTACH key and the key type. */ struct AttachKey { int type; Token key; }; /* ** One or more VALUES claues */ struct ValueList { ExprList *pList; Select *pSelect; }; #line 759 "parse.y" /* This is a utility routine used to set the ExprSpan.zStart and ** ExprSpan.zEnd values of pOut so that the span covers the complete ** range of text beginning with pStart and going to the end of pEnd. */ static void spanSet(ExprSpan *pOut, Token *pStart, Token *pEnd){ pOut->zStart = pStart->z; pOut->zEnd = &pEnd->z[pEnd->n]; } /* Construct a new Expr object from a single identifier. Use the ** new Expr to populate pOut. Set the span of pOut to be the identifier ** that created the expression. */ static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){ pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue); pOut->zStart = pValue->z; pOut->zEnd = &pValue->z[pValue->n]; } #line 854 "parse.y" /* This routine constructs a binary expression node out of two ExprSpan ** objects and uses the result to populate a new ExprSpan object. */ static void spanBinaryExpr( ExprSpan *pOut, /* Write the result here */ Parse *pParse, /* The parsing context. Errors accumulate here */ int op, /* The binary operation */ ExprSpan *pLeft, /* The left operand */ ExprSpan *pRight /* The right operand */ ){ pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0); pOut->zStart = pLeft->zStart; pOut->zEnd = pRight->zEnd; } #line 910 "parse.y" /* Construct an expression node for a unary postfix operator */ static void spanUnaryPostfix( ExprSpan *pOut, /* Write the new expression node here */ Parse *pParse, /* Parsing context to record errors */ int op, /* The operator */ ExprSpan *pOperand, /* The operand */ Token *pPostOp /* The operand token for setting the span */ ){ pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0); pOut->zStart = pOperand->zStart; pOut->zEnd = &pPostOp->z[pPostOp->n]; } #line 929 "parse.y" /* A routine to convert a binary TK_IS or TK_ISNOT expression into a ** unary TK_ISNULL or TK_NOTNULL expression. */ static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){ sqlite3 *db = pParse->db; if( db->mallocFailed==0 && pY->op==TK_NULL ){ pA->op = (u8)op; sqlite3ExprDelete(db, pA->pRight); pA->pRight = 0; } } #line 957 "parse.y" /* Construct an expression node for a unary prefix operator */ static void spanUnaryPrefix( ExprSpan *pOut, /* Write the new expression node here */ Parse *pParse, /* Parsing context to record errors */ int op, /* The operator */ ExprSpan *pOperand, /* The operand */ Token *pPreOp /* The operand token for setting the span */ ){ pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0); pOut->zStart = pPreOp->z; pOut->zEnd = pOperand->zEnd; } #line 149 "parse.c" /* Next is all token values, in a form suitable for use by makeheaders. ** This section will be null unless lemon is run with the -m switch. */ /* ** These constants (all generated automatically by the parser generator) ** specify the various kinds of tokens (terminals) that the parser ** understands. ** ** Each symbol here is a terminal symbol in the grammar. */ /* Make sure the INTERFACE macro is defined. */ #ifndef INTERFACE # define INTERFACE 1 #endif /* The next thing included is series of defines which control ** various aspects of the generated parser. ** YYCODETYPE is the data type used for storing terminal ** and nonterminal numbers. "unsigned char" is ** used if there are fewer than 250 terminals ** and nonterminals. "int" is used otherwise. ** YYNOCODE is a number of type YYCODETYPE which corresponds ** to no legal terminal or nonterminal number. This ** number is used to fill in empty slots of the hash ** table. ** YYFALLBACK If defined, this indicates that one or more tokens ** have fall-back values which should be used if the ** original value of the token will not parse. ** YYACTIONTYPE is the data type used for storing terminal ** and nonterminal numbers. "unsigned char" is ** used if there are fewer than 250 rules and ** states combined. "int" is used otherwise. ** sqlite3ParserTOKENTYPE is the data type used for minor tokens given ** directly to the parser from the tokenizer. ** YYMINORTYPE is the data type used for all minor tokens. ** This is typically a union of many types, one of ** which is sqlite3ParserTOKENTYPE. The entry in the union ** for base tokens is called "yy0". ** YYSTACKDEPTH is the maximum depth of the parser's stack. If ** zero the stack is dynamically sized using realloc() ** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument ** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument ** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser ** YYNSTATE the combined number of states. ** YYNRULE the number of rules in the grammar ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. */ #define YYCODETYPE unsigned char #define YYNOCODE 251 #define YYACTIONTYPE unsigned short int #define YYWILDCARD 67 #define sqlite3ParserTOKENTYPE Token typedef union { int yyinit; sqlite3ParserTOKENTYPE yy0; struct LimitVal yy64; Expr* yy122; Select* yy159; IdList* yy180; struct {int value; int mask;} yy207; u8 yy258; struct LikeOp yy318; TriggerStep* yy327; ExprSpan yy342; SrcList* yy347; int yy392; struct TrigEvent yy410; ExprList* yy442; struct ValueList yy487; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 #endif #define sqlite3ParserARG_SDECL Parse *pParse; #define sqlite3ParserARG_PDECL ,Parse *pParse #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse #define sqlite3ParserARG_STORE yypParser->pParse = pParse #define YYNSTATE 629 #define YYNRULE 327 #define YYFALLBACK 1 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) /* The yyzerominor constant is used to initialize instances of ** YYMINORTYPE objects to zero. */ static const YYMINORTYPE yyzerominor = { 0 }; /* Define the yytestcase() macro to be a no-op if is not already defined ** otherwise. ** ** Applications can choose to define yytestcase() in the %include section ** to a macro that can assist in verifying code coverage. For production ** code the yytestcase() macro should be turned off. But it is useful ** for testing. */ #ifndef yytestcase # define yytestcase(X) #endif /* Next are the tables used to determine what action to take based on the ** current state and lookahead token. These tables are used to implement ** functions that take a state number and lookahead value and return an ** action integer. ** ** Suppose the action integer is N. Then the action is determined as ** follows ** ** 0 <= N < YYNSTATE Shift N. That is, push the lookahead ** token onto the stack and goto state N. ** ** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. ** ** N == YYNSTATE+YYNRULE A syntax error has occurred. ** ** N == YYNSTATE+YYNRULE+1 The parser accepts its input. ** ** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused ** slots in the yy_action[] table. ** ** The action table is constructed as a single large table named yy_action[]. ** Given state S and lookahead X, the action is computed as ** ** yy_action[ yy_shift_ofst[S] + X ] ** ** If the index value yy_shift_ofst[S]+X is out of range or if the value ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table ** and that yy_default[S] should be used instead. ** ** The formula above is for computing the action when the lookahead is ** a terminal symbol. If the lookahead is a non-terminal (as occurs after ** a reduce action) then the yy_reduce_ofst[] array is used in place of ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of ** YY_SHIFT_USE_DFLT. ** ** The following are the tables generated in this section: ** ** yy_action[] A single table containing all actions. ** yy_lookahead[] A table containing the lookahead for each entry in ** yy_action. Used to detect hash collisions. ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. */ #define YY_ACTTAB_COUNT (1580) static const YYACTIONTYPE yy_action[] = { /* 0 */ 310, 328, 574, 573, 15, 172, 187, 596, 56, 56, /* 10 */ 56, 56, 49, 54, 54, 54, 54, 53, 53, 52, /* 20 */ 52, 52, 51, 234, 622, 621, 626, 622, 621, 299, /* 30 */ 589, 583, 56, 56, 56, 56, 236, 54, 54, 54, /* 40 */ 54, 53, 53, 52, 52, 52, 51, 234, 351, 57, /* 50 */ 58, 48, 581, 580, 582, 582, 55, 55, 56, 56, /* 60 */ 56, 56, 570, 54, 54, 54, 54, 53, 53, 52, /* 70 */ 52, 52, 51, 234, 310, 596, 326, 607, 233, 232, /* 80 */ 33, 54, 54, 54, 54, 53, 53, 52, 52, 52, /* 90 */ 51, 234, 619, 618, 326, 619, 618, 166, 605, 492, /* 100 */ 381, 378, 377, 235, 589, 583, 554, 495, 1, 59, /* 110 */ 19, 376, 622, 621, 53, 53, 52, 52, 52, 51, /* 120 */ 234, 571, 571, 57, 58, 48, 581, 580, 582, 582, /* 130 */ 55, 55, 56, 56, 56, 56, 215, 54, 54, 54, /* 140 */ 54, 53, 53, 52, 52, 52, 51, 234, 310, 224, /* 150 */ 50, 47, 147, 177, 139, 281, 384, 276, 383, 169, /* 160 */ 408, 553, 578, 578, 622, 621, 272, 224, 439, 550, /* 170 */ 552, 410, 139, 281, 384, 276, 383, 169, 589, 583, /* 180 */ 619, 618, 280, 620, 272, 195, 413, 309, 440, 441, /* 190 */ 567, 491, 214, 279, 560, 600, 92, 57, 58, 48, /* 200 */ 581, 580, 582, 582, 55, 55, 56, 56, 56, 56, /* 210 */ 559, 54, 54, 54, 54, 53, 53, 52, 52, 52, /* 220 */ 51, 234, 310, 464, 233, 232, 558, 133, 519, 50, /* 230 */ 47, 147, 619, 618, 565, 436, 397, 515, 514, 518, /* 240 */ 410, 387, 438, 389, 437, 622, 621, 442, 570, 433, /* 250 */ 203, 390, 589, 583, 6, 413, 166, 670, 250, 381, /* 260 */ 378, 377, 525, 190, 600, 92, 594, 571, 571, 465, /* 270 */ 376, 57, 58, 48, 581, 580, 582, 582, 55, 55, /* 280 */ 56, 56, 56, 56, 599, 54, 54, 54, 54, 53, /* 290 */ 53, 52, 52, 52, 51, 234, 310, 592, 592, 592, /* 300 */ 490, 182, 247, 548, 249, 397, 273, 410, 7, 439, /* 310 */ 398, 606, 67, 619, 618, 620, 472, 256, 347, 255, /* 320 */ 473, 620, 413, 576, 620, 65, 589, 583, 236, 440, /* 330 */ 336, 600, 92, 68, 364, 192, 481, 622, 621, 547, /* 340 */ 622, 621, 560, 323, 207, 57, 58, 48, 581, 580, /* 350 */ 582, 582, 55, 55, 56, 56, 56, 56, 559, 54, /* 360 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234, /* 370 */ 310, 410, 397, 146, 558, 531, 401, 348, 599, 166, /* 380 */ 248, 204, 381, 378, 377, 541, 413, 171, 337, 570, /* 390 */ 622, 621, 40, 376, 38, 600, 74, 465, 548, 490, /* 400 */ 589, 583, 532, 350, 579, 619, 618, 297, 619, 618, /* 410 */ 480, 67, 470, 39, 620, 599, 406, 574, 573, 57, /* 420 */ 58, 48, 581, 580, 582, 582, 55, 55, 56, 56, /* 430 */ 56, 56, 577, 54, 54, 54, 54, 53, 53, 52, /* 440 */ 52, 52, 51, 234, 310, 256, 347, 255, 530, 52, /* 450 */ 52, 52, 51, 234, 345, 564, 236, 386, 619, 618, /* 460 */ 957, 185, 418, 2, 408, 410, 578, 578, 198, 197, /* 470 */ 196, 499, 183, 167, 589, 583, 671, 570, 505, 506, /* 480 */ 413, 267, 601, 672, 546, 208, 602, 36, 601, 600, /* 490 */ 91, 468, 602, 57, 58, 48, 581, 580, 582, 582, /* 500 */ 55, 55, 56, 56, 56, 56, 202, 54, 54, 54, /* 510 */ 54, 53, 53, 52, 52, 52, 51, 234, 310, 599, /* 520 */ 157, 408, 527, 578, 578, 263, 490, 265, 410, 873, /* 530 */ 410, 474, 474, 366, 373, 410, 504, 428, 67, 290, /* 540 */ 599, 620, 352, 413, 408, 413, 578, 578, 589, 583, /* 550 */ 413, 382, 600, 92, 600, 16, 543, 62, 503, 600, /* 560 */ 92, 408, 346, 578, 578, 168, 45, 57, 58, 48, /* 570 */ 581, 580, 582, 582, 55, 55, 56, 56, 56, 56, /* 580 */ 200, 54, 54, 54, 54, 53, 53, 52, 52, 52, /* 590 */ 51, 234, 310, 393, 395, 534, 510, 617, 616, 615, /* 600 */ 318, 314, 172, 66, 596, 410, 338, 596, 324, 571, /* 610 */ 571, 50, 47, 147, 599, 629, 627, 330, 539, 315, /* 620 */ 413, 30, 589, 583, 272, 236, 199, 144, 176, 600, /* 630 */ 73, 420, 947, 620, 947, 420, 946, 351, 946, 175, /* 640 */ 596, 57, 58, 48, 581, 580, 582, 582, 55, 55, /* 650 */ 56, 56, 56, 56, 410, 54, 54, 54, 54, 53, /* 660 */ 53, 52, 52, 52, 51, 234, 310, 261, 410, 413, /* 670 */ 269, 208, 596, 363, 410, 596, 424, 360, 600, 69, /* 680 */ 424, 327, 620, 413, 50, 47, 147, 410, 358, 413, /* 690 */ 575, 553, 600, 94, 483, 509, 589, 583, 600, 97, /* 700 */ 552, 484, 413, 620, 188, 599, 551, 563, 596, 566, /* 710 */ 334, 600, 95, 205, 201, 57, 58, 48, 581, 580, /* 720 */ 582, 582, 55, 55, 56, 56, 56, 56, 352, 54, /* 730 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234, /* 740 */ 310, 410, 261, 410, 167, 22, 356, 599, 359, 623, /* 750 */ 50, 47, 147, 548, 357, 562, 413, 620, 413, 332, /* 760 */ 523, 270, 410, 167, 620, 600, 104, 600, 103, 603, /* 770 */ 589, 583, 339, 539, 304, 423, 222, 413, 174, 304, /* 780 */ 422, 561, 567, 405, 214, 260, 600, 106, 620, 57, /* 790 */ 58, 48, 581, 580, 582, 582, 55, 55, 56, 56, /* 800 */ 56, 56, 410, 54, 54, 54, 54, 53, 53, 52, /* 810 */ 52, 52, 51, 234, 310, 410, 557, 413, 410, 421, /* 820 */ 273, 35, 512, 146, 421, 12, 600, 107, 213, 144, /* 830 */ 413, 410, 32, 413, 410, 620, 365, 353, 358, 600, /* 840 */ 134, 11, 600, 135, 589, 583, 413, 21, 548, 413, /* 850 */ 316, 148, 620, 620, 170, 600, 98, 223, 600, 102, /* 860 */ 374, 168, 167, 57, 58, 48, 581, 580, 582, 582, /* 870 */ 55, 55, 56, 56, 56, 56, 410, 54, 54, 54, /* 880 */ 54, 53, 53, 52, 52, 52, 51, 234, 310, 410, /* 890 */ 273, 413, 410, 273, 212, 469, 410, 167, 628, 2, /* 900 */ 600, 101, 545, 221, 413, 620, 130, 413, 620, 410, /* 910 */ 539, 413, 537, 600, 93, 315, 600, 100, 589, 583, /* 920 */ 600, 77, 425, 305, 413, 620, 254, 322, 599, 458, /* 930 */ 320, 171, 543, 600, 96, 521, 520, 57, 58, 48, /* 940 */ 581, 580, 582, 582, 55, 55, 56, 56, 56, 56, /* 950 */ 410, 54, 54, 54, 54, 53, 53, 52, 52, 52, /* 960 */ 51, 234, 310, 410, 273, 413, 410, 457, 358, 35, /* 970 */ 426, 230, 306, 319, 600, 138, 467, 520, 413, 620, /* 980 */ 143, 413, 410, 620, 410, 353, 529, 600, 137, 142, /* 990 */ 600, 136, 589, 583, 604, 261, 528, 413, 229, 413, /* 1000 */ 620, 321, 495, 28, 543, 543, 600, 76, 600, 90, /* 1010 */ 620, 57, 46, 48, 581, 580, 582, 582, 55, 55, /* 1020 */ 56, 56, 56, 56, 410, 54, 54, 54, 54, 53, /* 1030 */ 53, 52, 52, 52, 51, 234, 310, 261, 451, 413, /* 1040 */ 410, 211, 611, 285, 283, 610, 609, 502, 600, 89, /* 1050 */ 380, 217, 620, 128, 140, 413, 220, 620, 410, 409, /* 1060 */ 620, 620, 588, 587, 600, 75, 589, 583, 271, 620, /* 1070 */ 51, 234, 127, 413, 620, 599, 627, 330, 27, 375, /* 1080 */ 449, 279, 600, 88, 585, 584, 58, 48, 581, 580, /* 1090 */ 582, 582, 55, 55, 56, 56, 56, 56, 410, 54, /* 1100 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 234, /* 1110 */ 310, 586, 410, 413, 410, 261, 593, 165, 399, 556, /* 1120 */ 126, 371, 600, 87, 478, 186, 123, 413, 367, 413, /* 1130 */ 620, 620, 410, 620, 620, 410, 600, 99, 600, 86, /* 1140 */ 589, 583, 475, 122, 258, 171, 471, 413, 160, 121, /* 1150 */ 413, 14, 159, 463, 25, 24, 600, 17, 448, 600, /* 1160 */ 85, 48, 581, 580, 582, 582, 55, 55, 56, 56, /* 1170 */ 56, 56, 158, 54, 54, 54, 54, 53, 53, 52, /* 1180 */ 52, 52, 51, 234, 44, 404, 261, 3, 544, 261, /* 1190 */ 540, 414, 621, 460, 119, 118, 538, 275, 10, 349, /* 1200 */ 4, 620, 407, 620, 620, 620, 116, 44, 404, 410, /* 1210 */ 3, 620, 620, 410, 414, 621, 456, 454, 252, 450, /* 1220 */ 508, 402, 111, 109, 413, 407, 155, 444, 413, 447, /* 1230 */ 435, 565, 219, 600, 84, 620, 108, 600, 83, 64, /* 1240 */ 434, 417, 625, 150, 402, 333, 410, 237, 238, 124, /* 1250 */ 274, 41, 42, 533, 565, 206, 189, 261, 43, 412, /* 1260 */ 411, 413, 261, 594, 488, 620, 329, 149, 419, 268, /* 1270 */ 600, 72, 620, 266, 41, 42, 181, 620, 410, 620, /* 1280 */ 105, 43, 412, 411, 620, 624, 594, 614, 620, 599, /* 1290 */ 228, 125, 313, 413, 592, 592, 592, 591, 590, 13, /* 1300 */ 218, 410, 600, 71, 236, 244, 44, 404, 264, 3, /* 1310 */ 312, 613, 340, 414, 621, 180, 413, 592, 592, 592, /* 1320 */ 591, 590, 13, 620, 407, 600, 82, 410, 416, 34, /* 1330 */ 404, 410, 3, 410, 262, 410, 414, 621, 612, 331, /* 1340 */ 178, 415, 413, 402, 8, 236, 413, 407, 413, 620, /* 1350 */ 413, 600, 81, 565, 257, 600, 80, 600, 70, 600, /* 1360 */ 18, 598, 361, 462, 461, 30, 402, 294, 31, 620, /* 1370 */ 293, 354, 251, 41, 42, 410, 565, 620, 620, 620, /* 1380 */ 43, 412, 411, 453, 396, 594, 620, 620, 394, 61, /* 1390 */ 413, 292, 443, 622, 621, 243, 41, 42, 620, 600, /* 1400 */ 79, 597, 291, 43, 412, 411, 60, 620, 594, 240, /* 1410 */ 620, 410, 231, 37, 555, 173, 592, 592, 592, 591, /* 1420 */ 590, 13, 216, 239, 620, 184, 413, 302, 301, 300, /* 1430 */ 179, 298, 388, 565, 452, 600, 78, 286, 620, 592, /* 1440 */ 592, 592, 591, 590, 13, 429, 29, 413, 151, 289, /* 1450 */ 242, 145, 392, 194, 193, 288, 600, 9, 542, 241, /* 1460 */ 620, 525, 391, 284, 620, 594, 620, 620, 522, 536, /* 1470 */ 620, 535, 153, 385, 465, 516, 282, 325, 154, 517, /* 1480 */ 277, 152, 512, 511, 513, 129, 226, 308, 487, 486, /* 1490 */ 485, 164, 372, 493, 307, 227, 592, 592, 592, 225, /* 1500 */ 479, 163, 368, 370, 162, 476, 210, 477, 26, 259, /* 1510 */ 161, 466, 362, 141, 132, 120, 117, 455, 156, 115, /* 1520 */ 344, 343, 256, 342, 245, 114, 113, 446, 311, 112, /* 1530 */ 23, 317, 432, 236, 131, 431, 110, 430, 20, 427, /* 1540 */ 608, 595, 295, 63, 379, 287, 509, 191, 278, 403, /* 1550 */ 572, 569, 497, 498, 496, 494, 335, 459, 445, 303, /* 1560 */ 296, 246, 341, 355, 5, 568, 369, 507, 253, 549, /* 1570 */ 526, 209, 400, 501, 500, 524, 234, 958, 489, 482, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 19, 169, 170, 171, 22, 24, 24, 26, 77, 78, /* 10 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, /* 20 */ 89, 90, 91, 92, 26, 27, 1, 26, 27, 15, /* 30 */ 49, 50, 77, 78, 79, 80, 116, 82, 83, 84, /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 128, 68, /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 60 */ 79, 80, 230, 82, 83, 84, 85, 86, 87, 88, /* 70 */ 89, 90, 91, 92, 19, 94, 19, 23, 86, 87, /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90, /* 90 */ 91, 92, 94, 95, 19, 94, 95, 96, 172, 173, /* 100 */ 99, 100, 101, 197, 49, 50, 177, 181, 22, 54, /* 110 */ 204, 110, 26, 27, 86, 87, 88, 89, 90, 91, /* 120 */ 92, 129, 130, 68, 69, 70, 71, 72, 73, 74, /* 130 */ 75, 76, 77, 78, 79, 80, 22, 82, 83, 84, /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 92, /* 150 */ 221, 222, 223, 96, 97, 98, 99, 100, 101, 102, /* 160 */ 112, 32, 114, 115, 26, 27, 109, 92, 150, 25, /* 170 */ 41, 150, 97, 98, 99, 100, 101, 102, 49, 50, /* 180 */ 94, 95, 98, 165, 109, 25, 165, 163, 170, 171, /* 190 */ 166, 167, 168, 109, 12, 174, 175, 68, 69, 70, /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 210 */ 28, 82, 83, 84, 85, 86, 87, 88, 89, 90, /* 220 */ 91, 92, 19, 11, 86, 87, 44, 24, 46, 221, /* 230 */ 222, 223, 94, 95, 66, 97, 215, 7, 8, 57, /* 240 */ 150, 220, 104, 19, 106, 26, 27, 229, 230, 241, /* 250 */ 160, 27, 49, 50, 22, 165, 96, 118, 16, 99, /* 260 */ 100, 101, 94, 119, 174, 175, 98, 129, 130, 57, /* 270 */ 110, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* 280 */ 77, 78, 79, 80, 194, 82, 83, 84, 85, 86, /* 290 */ 87, 88, 89, 90, 91, 92, 19, 129, 130, 131, /* 300 */ 150, 23, 60, 25, 62, 215, 150, 150, 76, 150, /* 310 */ 220, 161, 162, 94, 95, 165, 30, 105, 106, 107, /* 320 */ 34, 165, 165, 23, 165, 25, 49, 50, 116, 170, /* 330 */ 171, 174, 175, 22, 48, 185, 186, 26, 27, 120, /* 340 */ 26, 27, 12, 187, 160, 68, 69, 70, 71, 72, /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 28, 82, /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, /* 370 */ 19, 150, 215, 95, 44, 23, 46, 220, 194, 96, /* 380 */ 138, 160, 99, 100, 101, 23, 165, 25, 229, 230, /* 390 */ 26, 27, 135, 110, 137, 174, 175, 57, 120, 150, /* 400 */ 49, 50, 88, 219, 113, 94, 95, 158, 94, 95, /* 410 */ 161, 162, 21, 136, 165, 194, 169, 170, 171, 68, /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 430 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, /* 440 */ 89, 90, 91, 92, 19, 105, 106, 107, 23, 88, /* 450 */ 89, 90, 91, 92, 63, 23, 116, 88, 94, 95, /* 460 */ 142, 143, 144, 145, 112, 150, 114, 115, 105, 106, /* 470 */ 107, 23, 23, 25, 49, 50, 118, 230, 97, 98, /* 480 */ 165, 16, 113, 118, 120, 160, 117, 136, 113, 174, /* 490 */ 175, 100, 117, 68, 69, 70, 71, 72, 73, 74, /* 500 */ 75, 76, 77, 78, 79, 80, 160, 82, 83, 84, /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 194, /* 520 */ 25, 112, 23, 114, 115, 60, 150, 62, 150, 138, /* 530 */ 150, 105, 106, 107, 19, 150, 36, 161, 162, 224, /* 540 */ 194, 165, 217, 165, 112, 165, 114, 115, 49, 50, /* 550 */ 165, 51, 174, 175, 174, 175, 166, 232, 58, 174, /* 560 */ 175, 112, 237, 114, 115, 50, 22, 68, 69, 70, /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 580 */ 160, 82, 83, 84, 85, 86, 87, 88, 89, 90, /* 590 */ 91, 92, 19, 215, 214, 205, 23, 7, 8, 9, /* 600 */ 215, 155, 24, 22, 26, 150, 97, 26, 108, 129, /* 610 */ 130, 221, 222, 223, 194, 0, 1, 2, 150, 104, /* 620 */ 165, 126, 49, 50, 109, 116, 206, 207, 118, 174, /* 630 */ 175, 22, 23, 165, 25, 22, 23, 128, 25, 118, /* 640 */ 26, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* 650 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 165, /* 670 */ 23, 160, 94, 227, 150, 94, 67, 231, 174, 175, /* 680 */ 67, 213, 165, 165, 221, 222, 223, 150, 150, 165, /* 690 */ 23, 32, 174, 175, 181, 182, 49, 50, 174, 175, /* 700 */ 41, 188, 165, 165, 22, 194, 177, 11, 94, 23, /* 710 */ 193, 174, 175, 160, 22, 68, 69, 70, 71, 72, /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 217, 82, /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, /* 740 */ 19, 150, 150, 150, 25, 24, 19, 194, 237, 150, /* 750 */ 221, 222, 223, 25, 27, 23, 165, 165, 165, 242, /* 760 */ 165, 23, 150, 25, 165, 174, 175, 174, 175, 174, /* 770 */ 49, 50, 219, 150, 22, 23, 238, 165, 25, 22, /* 780 */ 23, 23, 166, 167, 168, 193, 174, 175, 165, 68, /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88, /* 810 */ 89, 90, 91, 92, 19, 150, 23, 165, 150, 67, /* 820 */ 150, 25, 103, 95, 67, 35, 174, 175, 206, 207, /* 830 */ 165, 150, 25, 165, 150, 165, 213, 150, 150, 174, /* 840 */ 175, 35, 174, 175, 49, 50, 165, 52, 120, 165, /* 850 */ 245, 246, 165, 165, 35, 174, 175, 187, 174, 175, /* 860 */ 23, 50, 25, 68, 69, 70, 71, 72, 73, 74, /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84, /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, /* 890 */ 150, 165, 150, 150, 160, 23, 150, 25, 144, 145, /* 900 */ 174, 175, 120, 216, 165, 165, 22, 165, 165, 150, /* 910 */ 150, 165, 27, 174, 175, 104, 174, 175, 49, 50, /* 920 */ 174, 175, 247, 248, 165, 165, 238, 187, 194, 23, /* 930 */ 187, 25, 166, 174, 175, 190, 191, 68, 69, 70, /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90, /* 960 */ 91, 92, 19, 150, 150, 165, 150, 23, 150, 25, /* 970 */ 23, 205, 25, 213, 174, 175, 190, 191, 165, 165, /* 980 */ 118, 165, 150, 165, 150, 150, 23, 174, 175, 39, /* 990 */ 174, 175, 49, 50, 173, 150, 23, 165, 52, 165, /* 1000 */ 165, 187, 181, 22, 166, 166, 174, 175, 174, 175, /* 1010 */ 165, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 150, 193, 165, /* 1040 */ 150, 160, 150, 205, 205, 150, 150, 29, 174, 175, /* 1050 */ 52, 216, 165, 22, 150, 165, 238, 165, 150, 150, /* 1060 */ 165, 165, 49, 50, 174, 175, 49, 50, 23, 165, /* 1070 */ 91, 92, 22, 165, 165, 194, 1, 2, 22, 52, /* 1080 */ 193, 109, 174, 175, 71, 72, 69, 70, 71, 72, /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, /* 1110 */ 19, 98, 150, 165, 150, 150, 150, 102, 150, 150, /* 1120 */ 22, 19, 174, 175, 20, 24, 104, 165, 43, 165, /* 1130 */ 165, 165, 150, 165, 165, 150, 174, 175, 174, 175, /* 1140 */ 49, 50, 59, 53, 138, 25, 53, 165, 104, 22, /* 1150 */ 165, 5, 118, 1, 76, 76, 174, 175, 193, 174, /* 1160 */ 175, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 1170 */ 79, 80, 35, 82, 83, 84, 85, 86, 87, 88, /* 1180 */ 89, 90, 91, 92, 19, 20, 150, 22, 150, 150, /* 1190 */ 150, 26, 27, 27, 108, 127, 150, 150, 22, 25, /* 1200 */ 22, 165, 37, 165, 165, 165, 119, 19, 20, 150, /* 1210 */ 22, 165, 165, 150, 26, 27, 23, 1, 16, 20, /* 1220 */ 150, 56, 119, 108, 165, 37, 121, 128, 165, 193, /* 1230 */ 23, 66, 193, 174, 175, 165, 127, 174, 175, 16, /* 1240 */ 23, 146, 147, 15, 56, 65, 150, 152, 140, 154, /* 1250 */ 150, 86, 87, 88, 66, 160, 22, 150, 93, 94, /* 1260 */ 95, 165, 150, 98, 150, 165, 3, 246, 4, 150, /* 1270 */ 174, 175, 165, 150, 86, 87, 6, 165, 150, 165, /* 1280 */ 164, 93, 94, 95, 165, 149, 98, 149, 165, 194, /* 1290 */ 180, 180, 249, 165, 129, 130, 131, 132, 133, 134, /* 1300 */ 193, 150, 174, 175, 116, 193, 19, 20, 150, 22, /* 1310 */ 249, 149, 217, 26, 27, 151, 165, 129, 130, 131, /* 1320 */ 132, 133, 134, 165, 37, 174, 175, 150, 149, 19, /* 1330 */ 20, 150, 22, 150, 150, 150, 26, 27, 13, 244, /* 1340 */ 151, 159, 165, 56, 25, 116, 165, 37, 165, 165, /* 1350 */ 165, 174, 175, 66, 150, 174, 175, 174, 175, 174, /* 1360 */ 175, 194, 150, 150, 150, 126, 56, 199, 124, 165, /* 1370 */ 200, 150, 150, 86, 87, 150, 66, 165, 165, 165, /* 1380 */ 93, 94, 95, 150, 122, 98, 165, 165, 123, 22, /* 1390 */ 165, 201, 150, 26, 27, 150, 86, 87, 165, 174, /* 1400 */ 175, 203, 202, 93, 94, 95, 125, 165, 98, 150, /* 1410 */ 165, 150, 225, 135, 157, 118, 129, 130, 131, 132, /* 1420 */ 133, 134, 5, 150, 165, 157, 165, 10, 11, 12, /* 1430 */ 13, 14, 150, 66, 17, 174, 175, 210, 165, 129, /* 1440 */ 130, 131, 132, 133, 134, 150, 104, 165, 31, 150, /* 1450 */ 33, 150, 150, 86, 87, 150, 174, 175, 211, 42, /* 1460 */ 165, 94, 121, 210, 165, 98, 165, 165, 176, 211, /* 1470 */ 165, 211, 55, 104, 57, 184, 210, 47, 61, 176, /* 1480 */ 176, 64, 103, 176, 178, 22, 92, 179, 176, 176, /* 1490 */ 176, 156, 18, 184, 179, 228, 129, 130, 131, 228, /* 1500 */ 157, 156, 45, 157, 156, 236, 157, 157, 135, 235, /* 1510 */ 156, 189, 157, 68, 218, 189, 22, 199, 156, 192, /* 1520 */ 157, 18, 105, 106, 107, 192, 192, 199, 111, 192, /* 1530 */ 240, 157, 40, 116, 218, 157, 189, 157, 240, 38, /* 1540 */ 153, 166, 198, 243, 178, 209, 182, 196, 177, 226, /* 1550 */ 230, 230, 166, 177, 177, 166, 139, 199, 199, 148, /* 1560 */ 195, 209, 209, 239, 196, 166, 234, 183, 239, 208, /* 1570 */ 174, 233, 191, 183, 183, 174, 92, 250, 186, 186, }; #define YY_SHIFT_USE_DFLT (-81) #define YY_SHIFT_COUNT (417) #define YY_SHIFT_MIN (-80) #define YY_SHIFT_MAX (1503) static const short yy_shift_ofst[] = { /* 0 */ 1075, 1188, 1417, 1188, 1287, 1287, 138, 138, 1, -19, /* 10 */ 1287, 1287, 1287, 1287, 340, -2, 129, 129, 795, 1165, /* 20 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, /* 30 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, /* 40 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1310, 1287, /* 50 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, /* 60 */ 1287, 1287, 212, -2, -2, -8, -8, 614, 1229, 55, /* 70 */ 721, 647, 573, 499, 425, 351, 277, 203, 869, 869, /* 80 */ 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, /* 90 */ 869, 869, 869, 943, 869, 1017, 1091, 1091, -69, -45, /* 100 */ -45, -45, -45, -45, -1, 57, 28, 361, -2, -2, /* 110 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 120 */ -2, -2, -2, -2, 391, 515, -2, -2, -2, -2, /* 130 */ -2, 509, -80, 614, 979, 1484, -81, -81, -81, 1367, /* 140 */ 75, 182, 182, 314, 311, 364, 219, 86, 613, 609, /* 150 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 160 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 170 */ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 180 */ -2, -2, 578, 578, 578, 615, 1229, 1229, 1229, -81, /* 190 */ -81, -81, 160, 168, 168, 283, 500, 500, 500, 278, /* 200 */ 449, 330, 432, 409, 352, 48, 48, 48, 48, 426, /* 210 */ 286, 48, 48, 728, 581, 369, 590, 495, 224, 224, /* 220 */ 727, 495, 727, 719, 614, 659, 614, 659, 811, 659, /* 230 */ 224, 257, 480, 480, 614, 144, 375, -18, 1501, 1297, /* 240 */ 1297, 1492, 1492, 1297, 1494, 1445, 1239, 1503, 1503, 1503, /* 250 */ 1503, 1297, 1474, 1239, 1494, 1445, 1445, 1297, 1474, 1373, /* 260 */ 1457, 1297, 1297, 1474, 1297, 1474, 1297, 1474, 1463, 1369, /* 270 */ 1369, 1369, 1430, 1394, 1394, 1463, 1369, 1379, 1369, 1430, /* 280 */ 1369, 1369, 1341, 1342, 1341, 1342, 1341, 1342, 1297, 1297, /* 290 */ 1278, 1281, 1262, 1244, 1265, 1239, 1229, 1319, 1325, 1325, /* 300 */ 1270, 1270, 1270, 1270, -81, -81, -81, -81, -81, -81, /* 310 */ 1013, 242, 757, 752, 465, 363, 947, 232, 944, 906, /* 320 */ 872, 837, 738, 448, 381, 230, 84, 362, 300, 1264, /* 330 */ 1263, 1234, 1108, 1228, 1180, 1223, 1217, 1207, 1099, 1174, /* 340 */ 1109, 1115, 1103, 1199, 1105, 1202, 1216, 1087, 1193, 1178, /* 350 */ 1174, 1176, 1068, 1079, 1078, 1086, 1166, 1137, 1034, 1152, /* 360 */ 1146, 1127, 1044, 1006, 1093, 1120, 1090, 1083, 1085, 1022, /* 370 */ 1101, 1104, 1102, 972, 1015, 1098, 1027, 1056, 1050, 1045, /* 380 */ 1031, 998, 1018, 981, 946, 950, 973, 963, 862, 885, /* 390 */ 819, 884, 782, 796, 806, 807, 790, 796, 793, 758, /* 400 */ 753, 732, 692, 696, 682, 686, 667, 544, 291, 521, /* 410 */ 510, 365, 358, 139, 114, 54, 14, 25, }; #define YY_REDUCE_USE_DFLT (-169) #define YY_REDUCE_COUNT (309) #define YY_REDUCE_MIN (-168) #define YY_REDUCE_MAX (1411) static const short yy_reduce_ofst[] = { /* 0 */ 318, 90, 1095, 221, 157, 21, 159, 18, 150, 390, /* 10 */ 385, 378, 380, 315, 325, 249, 529, -71, 8, 1282, /* 20 */ 1261, 1225, 1185, 1183, 1181, 1177, 1151, 1128, 1096, 1063, /* 30 */ 1059, 985, 982, 964, 962, 948, 908, 890, 874, 834, /* 40 */ 832, 816, 813, 800, 759, 746, 742, 739, 726, 684, /* 50 */ 681, 668, 665, 652, 612, 593, 591, 537, 524, 518, /* 60 */ 504, 455, 511, 376, 517, 247, -168, 24, 420, 463, /* 70 */ 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, /* 80 */ 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, /* 90 */ 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, /* 100 */ 463, 463, 463, 463, 463, -74, 463, 463, 1112, 835, /* 110 */ 1107, 1039, 1036, 965, 887, 845, 818, 760, 688, 687, /* 120 */ 538, 743, 623, 592, 446, 513, 814, 740, 670, 156, /* 130 */ 468, 553, 184, 616, 463, 463, 463, 463, 463, 595, /* 140 */ 821, 786, 745, 909, 1305, 1302, 1301, 1299, 675, 675, /* 150 */ 1295, 1273, 1259, 1245, 1242, 1233, 1222, 1221, 1214, 1213, /* 160 */ 1212, 1204, 1184, 1158, 1123, 1119, 1114, 1100, 1070, 1047, /* 170 */ 1046, 1040, 1038, 969, 968, 966, 909, 904, 896, 895, /* 180 */ 892, 599, 839, 838, 766, 754, 881, 734, 346, 605, /* 190 */ 622, -94, 1393, 1401, 1396, 1392, 1391, 1390, 1384, 1361, /* 200 */ 1365, 1381, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1332, /* 210 */ 1338, 1365, 1365, 1361, 1399, 1368, 1411, 1359, 1353, 1352, /* 220 */ 1329, 1358, 1324, 1366, 1389, 1377, 1386, 1376, 1364, 1371, /* 230 */ 1336, 1323, 1321, 1320, 1375, 1344, 1351, 1387, 1300, 1380, /* 240 */ 1378, 1298, 1290, 1374, 1316, 1347, 1328, 1337, 1334, 1333, /* 250 */ 1327, 1363, 1362, 1318, 1296, 1326, 1322, 1355, 1354, 1269, /* 260 */ 1274, 1350, 1349, 1348, 1346, 1345, 1343, 1335, 1315, 1314, /* 270 */ 1313, 1312, 1309, 1271, 1267, 1308, 1307, 1306, 1304, 1291, /* 280 */ 1303, 1292, 1260, 1266, 1258, 1253, 1247, 1227, 1268, 1257, /* 290 */ 1187, 1198, 1200, 1190, 1170, 1168, 1167, 1182, 1189, 1164, /* 300 */ 1179, 1162, 1138, 1136, 1061, 1043, 1021, 1111, 1110, 1116, }; static const YYACTIONTYPE yy_default[] = { /* 0 */ 634, 868, 956, 956, 868, 868, 956, 956, 956, 758, /* 10 */ 956, 956, 956, 866, 956, 956, 786, 786, 930, 956, /* 20 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 30 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 40 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 50 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 60 */ 956, 956, 956, 956, 956, 956, 956, 673, 762, 792, /* 70 */ 956, 956, 956, 956, 956, 956, 956, 956, 929, 931, /* 80 */ 800, 799, 909, 773, 797, 790, 794, 869, 862, 863, /* 90 */ 861, 865, 870, 956, 793, 829, 846, 828, 840, 845, /* 100 */ 852, 844, 841, 831, 830, 665, 832, 833, 956, 956, /* 110 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 120 */ 956, 956, 956, 956, 660, 727, 956, 956, 956, 956, /* 130 */ 956, 956, 956, 956, 834, 835, 849, 848, 847, 956, /* 140 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 150 */ 956, 936, 934, 956, 881, 956, 956, 956, 956, 956, /* 160 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 170 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 180 */ 956, 640, 758, 758, 758, 634, 956, 956, 956, 948, /* 190 */ 762, 752, 718, 956, 956, 956, 956, 956, 956, 956, /* 200 */ 956, 956, 956, 956, 956, 802, 741, 919, 921, 956, /* 210 */ 902, 739, 662, 760, 675, 750, 642, 796, 775, 775, /* 220 */ 914, 796, 914, 699, 956, 786, 956, 786, 696, 786, /* 230 */ 775, 864, 956, 956, 956, 759, 750, 956, 941, 766, /* 240 */ 766, 933, 933, 766, 808, 731, 796, 738, 738, 738, /* 250 */ 738, 766, 657, 796, 808, 731, 731, 766, 657, 908, /* 260 */ 906, 766, 766, 657, 766, 657, 766, 657, 874, 729, /* 270 */ 729, 729, 714, 878, 878, 874, 729, 699, 729, 714, /* 280 */ 729, 729, 779, 774, 779, 774, 779, 774, 766, 766, /* 290 */ 956, 791, 780, 789, 787, 796, 956, 717, 650, 650, /* 300 */ 639, 639, 639, 639, 953, 953, 948, 701, 701, 683, /* 310 */ 956, 956, 956, 956, 956, 956, 956, 883, 956, 956, /* 320 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 330 */ 635, 943, 956, 956, 940, 956, 956, 956, 956, 801, /* 340 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 350 */ 918, 956, 956, 956, 956, 956, 956, 956, 912, 956, /* 360 */ 956, 956, 956, 956, 956, 905, 904, 956, 956, 956, /* 370 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 380 */ 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, /* 390 */ 956, 956, 956, 788, 956, 781, 956, 867, 956, 956, /* 400 */ 956, 956, 956, 956, 956, 956, 956, 956, 744, 817, /* 410 */ 956, 816, 820, 815, 667, 956, 648, 956, 631, 636, /* 420 */ 952, 955, 954, 951, 950, 949, 944, 942, 939, 938, /* 430 */ 937, 935, 932, 928, 887, 885, 892, 891, 890, 889, /* 440 */ 888, 886, 884, 882, 803, 798, 795, 927, 880, 740, /* 450 */ 737, 736, 656, 945, 911, 920, 807, 806, 809, 917, /* 460 */ 916, 915, 913, 910, 897, 805, 804, 732, 872, 871, /* 470 */ 659, 901, 900, 899, 903, 907, 898, 768, 658, 655, /* 480 */ 664, 721, 720, 728, 726, 725, 724, 723, 722, 719, /* 490 */ 666, 674, 685, 713, 698, 697, 877, 879, 876, 875, /* 500 */ 706, 705, 711, 710, 709, 708, 707, 704, 703, 702, /* 510 */ 695, 694, 700, 693, 716, 715, 712, 692, 735, 734, /* 520 */ 733, 730, 691, 690, 689, 820, 688, 687, 826, 825, /* 530 */ 813, 856, 755, 754, 753, 765, 764, 777, 776, 811, /* 540 */ 810, 778, 763, 757, 756, 772, 771, 770, 769, 761, /* 550 */ 751, 783, 785, 784, 782, 858, 767, 855, 926, 925, /* 560 */ 924, 923, 922, 860, 859, 827, 824, 678, 679, 895, /* 570 */ 894, 896, 893, 681, 680, 677, 676, 857, 746, 745, /* 580 */ 853, 850, 842, 838, 854, 851, 843, 839, 837, 836, /* 590 */ 822, 821, 819, 818, 814, 823, 669, 747, 743, 742, /* 600 */ 812, 749, 748, 686, 684, 682, 663, 661, 654, 652, /* 610 */ 651, 653, 649, 647, 646, 645, 644, 643, 672, 671, /* 620 */ 670, 668, 667, 641, 638, 637, 633, 632, 630, }; /* The next table maps tokens into fallback tokens. If a construct ** like the following: ** ** %fallback ID X Y Z. ** ** appears in the grammar, then ID becomes a fallback token for X, Y, ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser ** but it does not parse, the type of the token is changed to ID and ** the parse is retried before an error is thrown. */ #ifdef YYFALLBACK static const YYCODETYPE yyFallback[] = { 0, /* $ => nothing */ 0, /* SEMI => nothing */ 26, /* EXPLAIN => ID */ 26, /* QUERY => ID */ 26, /* PLAN => ID */ 26, /* BEGIN => ID */ 0, /* TRANSACTION => nothing */ 26, /* DEFERRED => ID */ 26, /* IMMEDIATE => ID */ 26, /* EXCLUSIVE => ID */ 0, /* COMMIT => nothing */ 26, /* END => ID */ 26, /* ROLLBACK => ID */ 26, /* SAVEPOINT => ID */ 26, /* RELEASE => ID */ 0, /* TO => nothing */ 0, /* TABLE => nothing */ 0, /* CREATE => nothing */ 26, /* IF => ID */ 0, /* NOT => nothing */ 0, /* EXISTS => nothing */ 26, /* TEMP => ID */ 0, /* LP => nothing */ 0, /* RP => nothing */ 0, /* AS => nothing */ 0, /* COMMA => nothing */ 0, /* ID => nothing */ 0, /* INDEXED => nothing */ 26, /* ABORT => ID */ 26, /* ACTION => ID */ 26, /* AFTER => ID */ 26, /* ANALYZE => ID */ 26, /* ASC => ID */ 26, /* ATTACH => ID */ 26, /* BEFORE => ID */ 26, /* BY => ID */ 26, /* CASCADE => ID */ 26, /* CAST => ID */ 26, /* COLUMNKW => ID */ 26, /* CONFLICT => ID */ 26, /* DATABASE => ID */ 26, /* DESC => ID */ 26, /* DETACH => ID */ 26, /* EACH => ID */ 26, /* FAIL => ID */ 26, /* FOR => ID */ 26, /* IGNORE => ID */ 26, /* INITIALLY => ID */ 26, /* INSTEAD => ID */ 26, /* LIKE_KW => ID */ 26, /* MATCH => ID */ 26, /* NO => ID */ 26, /* KEY => ID */ 26, /* OF => ID */ 26, /* OFFSET => ID */ 26, /* PRAGMA => ID */ 26, /* RAISE => ID */ 26, /* REPLACE => ID */ 26, /* RESTRICT => ID */ 26, /* ROW => ID */ 26, /* TRIGGER => ID */ 26, /* VACUUM => ID */ 26, /* VIEW => ID */ 26, /* VIRTUAL => ID */ 26, /* REINDEX => ID */ 26, /* RENAME => ID */ 26, /* CTIME_KW => ID */ }; #endif /* YYFALLBACK */ /* The following structure represents a single element of the ** parser's stack. Information stored includes: ** ** + The state number for the parser at this level of the stack. ** ** + The value of the token stored at this level of the stack. ** (In other words, the "major" token.) ** ** + The semantic value stored at this level of the stack. This is ** the information used by the action routines in the grammar. ** It is sometimes called the "minor" token. */ struct yyStackEntry { YYACTIONTYPE stateno; /* The state-number */ YYCODETYPE major; /* The major token value. This is the code ** number for the token at this stack level */ YYMINORTYPE minor; /* The user-supplied minor token value. This ** is the value of the token */ }; typedef struct yyStackEntry yyStackEntry; /* The state of the parser is completely contained in an instance of ** the following structure */ struct yyParser { int yyidx; /* Index of top element in stack */ #ifdef YYTRACKMAXSTACKDEPTH int yyidxMax; /* Maximum value of yyidx */ #endif int yyerrcnt; /* Shifts left before out of the error */ sqlite3ParserARG_SDECL /* A place to hold %extra_argument */ #if YYSTACKDEPTH<=0 int yystksz; /* Current side of the stack */ yyStackEntry *yystack; /* The parser's stack */ #else yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ #endif }; typedef struct yyParser yyParser; #ifndef NDEBUG #include static FILE *yyTraceFILE = 0; static char *yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG /* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message. Tracing is turned off ** by making either argument NULL ** ** Inputs: ** ** ** Outputs: ** None. */ void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){ yyTraceFILE = TraceFILE; yyTracePrompt = zTracePrompt; if( yyTraceFILE==0 ) yyTracePrompt = 0; else if( yyTracePrompt==0 ) yyTraceFILE = 0; } #endif /* NDEBUG */ #ifndef NDEBUG /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ static const char *const yyTokenName[] = { "$", "SEMI", "EXPLAIN", "QUERY", "PLAN", "BEGIN", "TRANSACTION", "DEFERRED", "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END", "ROLLBACK", "SAVEPOINT", "RELEASE", "TO", "TABLE", "CREATE", "IF", "NOT", "EXISTS", "TEMP", "LP", "RP", "AS", "COMMA", "ID", "INDEXED", "ABORT", "ACTION", "AFTER", "ANALYZE", "ASC", "ATTACH", "BEFORE", "BY", "CASCADE", "CAST", "COLUMNKW", "CONFLICT", "DATABASE", "DESC", "DETACH", "EACH", "FAIL", "FOR", "IGNORE", "INITIALLY", "INSTEAD", "LIKE_KW", "MATCH", "NO", "KEY", "OF", "OFFSET", "PRAGMA", "RAISE", "REPLACE", "RESTRICT", "ROW", "TRIGGER", "VACUUM", "VIEW", "VIRTUAL", "REINDEX", "RENAME", "CTIME_KW", "ANY", "OR", "AND", "IS", "BETWEEN", "IN", "ISNULL", "NOTNULL", "NE", "EQ", "GT", "LE", "LT", "GE", "ESCAPE", "BITAND", "BITOR", "LSHIFT", "RSHIFT", "PLUS", "MINUS", "STAR", "SLASH", "REM", "CONCAT", "COLLATE", "BITNOT", "STRING", "JOIN_KW", "CONSTRAINT", "DEFAULT", "NULL", "PRIMARY", "UNIQUE", "CHECK", "REFERENCES", "AUTOINCR", "ON", "INSERT", "DELETE", "UPDATE", "SET", "DEFERRABLE", "FOREIGN", "DROP", "UNION", "ALL", "EXCEPT", "INTERSECT", "SELECT", "DISTINCT", "DOT", "FROM", "JOIN", "USING", "ORDER", "GROUP", "HAVING", "LIMIT", "WHERE", "INTO", "VALUES", "INTEGER", "FLOAT", "BLOB", "REGISTER", "VARIABLE", "CASE", "WHEN", "THEN", "ELSE", "INDEX", "ALTER", "ADD", "error", "input", "cmdlist", "ecmd", "explain", "cmdx", "cmd", "transtype", "trans_opt", "nm", "savepoint_opt", "create_table", "create_table_args", "createkw", "temp", "ifnotexists", "dbnm", "columnlist", "conslist_opt", "select", "column", "columnid", "type", "carglist", "id", "ids", "typetoken", "typename", "signed", "plus_num", "minus_num", "carg", "ccons", "term", "expr", "onconf", "sortorder", "autoinc", "idxlist_opt", "refargs", "defer_subclause", "refarg", "refact", "init_deferred_pred_opt", "conslist", "tcons", "idxlist", "defer_subclause_opt", "orconf", "resolvetype", "raisetype", "ifexists", "fullname", "oneselect", "multiselect_op", "distinct", "selcollist", "from", "where_opt", "groupby_opt", "having_opt", "orderby_opt", "limit_opt", "sclp", "as", "seltablist", "stl_prefix", "joinop", "indexed_opt", "on_opt", "using_opt", "joinop2", "inscollist", "sortlist", "nexprlist", "setlist", "insert_cmd", "inscollist_opt", "valuelist", "exprlist", "likeop", "between_op", "in_op", "case_operand", "case_exprlist", "case_else", "uniqueflag", "collate", "nmnum", "number", "trigger_decl", "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", "when_clause", "trigger_cmd", "trnm", "tridxby", "database_kw_opt", "key_opt", "add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist", "vtabarg", "vtabargtoken", "lp", "anylist", }; #endif /* NDEBUG */ #ifndef NDEBUG /* For tracing reduce actions, the names of all rules are required. */ static const char *const yyRuleName[] = { /* 0 */ "input ::= cmdlist", /* 1 */ "cmdlist ::= cmdlist ecmd", /* 2 */ "cmdlist ::= ecmd", /* 3 */ "ecmd ::= SEMI", /* 4 */ "ecmd ::= explain cmdx SEMI", /* 5 */ "explain ::=", /* 6 */ "explain ::= EXPLAIN", /* 7 */ "explain ::= EXPLAIN QUERY PLAN", /* 8 */ "cmdx ::= cmd", /* 9 */ "cmd ::= BEGIN transtype trans_opt", /* 10 */ "trans_opt ::=", /* 11 */ "trans_opt ::= TRANSACTION", /* 12 */ "trans_opt ::= TRANSACTION nm", /* 13 */ "transtype ::=", /* 14 */ "transtype ::= DEFERRED", /* 15 */ "transtype ::= IMMEDIATE", /* 16 */ "transtype ::= EXCLUSIVE", /* 17 */ "cmd ::= COMMIT trans_opt", /* 18 */ "cmd ::= END trans_opt", /* 19 */ "cmd ::= ROLLBACK trans_opt", /* 20 */ "savepoint_opt ::= SAVEPOINT", /* 21 */ "savepoint_opt ::=", /* 22 */ "cmd ::= SAVEPOINT nm", /* 23 */ "cmd ::= RELEASE savepoint_opt nm", /* 24 */ "cmd ::= ROLLBACK trans_opt TO savepoint_opt nm", /* 25 */ "cmd ::= create_table create_table_args", /* 26 */ "create_table ::= createkw temp TABLE ifnotexists nm dbnm", /* 27 */ "createkw ::= CREATE", /* 28 */ "ifnotexists ::=", /* 29 */ "ifnotexists ::= IF NOT EXISTS", /* 30 */ "temp ::= TEMP", /* 31 */ "temp ::=", /* 32 */ "create_table_args ::= LP columnlist conslist_opt RP", /* 33 */ "create_table_args ::= AS select", /* 34 */ "columnlist ::= columnlist COMMA column", /* 35 */ "columnlist ::= column", /* 36 */ "column ::= columnid type carglist", /* 37 */ "columnid ::= nm", /* 38 */ "id ::= ID", /* 39 */ "id ::= INDEXED", /* 40 */ "ids ::= ID|STRING", /* 41 */ "nm ::= id", /* 42 */ "nm ::= STRING", /* 43 */ "nm ::= JOIN_KW", /* 44 */ "type ::=", /* 45 */ "type ::= typetoken", /* 46 */ "typetoken ::= typename", /* 47 */ "typetoken ::= typename LP signed RP", /* 48 */ "typetoken ::= typename LP signed COMMA signed RP", /* 49 */ "typename ::= ids", /* 50 */ "typename ::= typename ids", /* 51 */ "signed ::= plus_num", /* 52 */ "signed ::= minus_num", /* 53 */ "carglist ::= carglist carg", /* 54 */ "carglist ::=", /* 55 */ "carg ::= CONSTRAINT nm ccons", /* 56 */ "carg ::= ccons", /* 57 */ "ccons ::= DEFAULT term", /* 58 */ "ccons ::= DEFAULT LP expr RP", /* 59 */ "ccons ::= DEFAULT PLUS term", /* 60 */ "ccons ::= DEFAULT MINUS term", /* 61 */ "ccons ::= DEFAULT id", /* 62 */ "ccons ::= NULL onconf", /* 63 */ "ccons ::= NOT NULL onconf", /* 64 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc", /* 65 */ "ccons ::= UNIQUE onconf", /* 66 */ "ccons ::= CHECK LP expr RP", /* 67 */ "ccons ::= REFERENCES nm idxlist_opt refargs", /* 68 */ "ccons ::= defer_subclause", /* 69 */ "ccons ::= COLLATE ids", /* 70 */ "autoinc ::=", /* 71 */ "autoinc ::= AUTOINCR", /* 72 */ "refargs ::=", /* 73 */ "refargs ::= refargs refarg", /* 74 */ "refarg ::= MATCH nm", /* 75 */ "refarg ::= ON INSERT refact", /* 76 */ "refarg ::= ON DELETE refact", /* 77 */ "refarg ::= ON UPDATE refact", /* 78 */ "refact ::= SET NULL", /* 79 */ "refact ::= SET DEFAULT", /* 80 */ "refact ::= CASCADE", /* 81 */ "refact ::= RESTRICT", /* 82 */ "refact ::= NO ACTION", /* 83 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", /* 84 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", /* 85 */ "init_deferred_pred_opt ::=", /* 86 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", /* 87 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", /* 88 */ "conslist_opt ::=", /* 89 */ "conslist_opt ::= COMMA conslist", /* 90 */ "conslist ::= conslist COMMA tcons", /* 91 */ "conslist ::= conslist tcons", /* 92 */ "conslist ::= tcons", /* 93 */ "tcons ::= CONSTRAINT nm", /* 94 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf", /* 95 */ "tcons ::= UNIQUE LP idxlist RP onconf", /* 96 */ "tcons ::= CHECK LP expr RP onconf", /* 97 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", /* 98 */ "defer_subclause_opt ::=", /* 99 */ "defer_subclause_opt ::= defer_subclause", /* 100 */ "onconf ::=", /* 101 */ "onconf ::= ON CONFLICT resolvetype", /* 102 */ "orconf ::=", /* 103 */ "orconf ::= OR resolvetype", /* 104 */ "resolvetype ::= raisetype", /* 105 */ "resolvetype ::= IGNORE", /* 106 */ "resolvetype ::= REPLACE", /* 107 */ "cmd ::= DROP TABLE ifexists fullname", /* 108 */ "ifexists ::= IF EXISTS", /* 109 */ "ifexists ::=", /* 110 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select", /* 111 */ "cmd ::= DROP VIEW ifexists fullname", /* 112 */ "cmd ::= select", /* 113 */ "select ::= oneselect", /* 114 */ "select ::= select multiselect_op oneselect", /* 115 */ "multiselect_op ::= UNION", /* 116 */ "multiselect_op ::= UNION ALL", /* 117 */ "multiselect_op ::= EXCEPT|INTERSECT", /* 118 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", /* 119 */ "distinct ::= DISTINCT", /* 120 */ "distinct ::= ALL", /* 121 */ "distinct ::=", /* 122 */ "sclp ::= selcollist COMMA", /* 123 */ "sclp ::=", /* 124 */ "selcollist ::= sclp expr as", /* 125 */ "selcollist ::= sclp STAR", /* 126 */ "selcollist ::= sclp nm DOT STAR", /* 127 */ "as ::= AS nm", /* 128 */ "as ::= ids", /* 129 */ "as ::=", /* 130 */ "from ::=", /* 131 */ "from ::= FROM seltablist", /* 132 */ "stl_prefix ::= seltablist joinop", /* 133 */ "stl_prefix ::=", /* 134 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", /* 135 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt", /* 136 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt", /* 137 */ "dbnm ::=", /* 138 */ "dbnm ::= DOT nm", /* 139 */ "fullname ::= nm dbnm", /* 140 */ "joinop ::= COMMA|JOIN", /* 141 */ "joinop ::= JOIN_KW JOIN", /* 142 */ "joinop ::= JOIN_KW nm JOIN", /* 143 */ "joinop ::= JOIN_KW nm nm JOIN", /* 144 */ "on_opt ::= ON expr", /* 145 */ "on_opt ::=", /* 146 */ "indexed_opt ::=", /* 147 */ "indexed_opt ::= INDEXED BY nm", /* 148 */ "indexed_opt ::= NOT INDEXED", /* 149 */ "using_opt ::= USING LP inscollist RP", /* 150 */ "using_opt ::=", /* 151 */ "orderby_opt ::=", /* 152 */ "orderby_opt ::= ORDER BY sortlist", /* 153 */ "sortlist ::= sortlist COMMA expr sortorder", /* 154 */ "sortlist ::= expr sortorder", /* 155 */ "sortorder ::= ASC", /* 156 */ "sortorder ::= DESC", /* 157 */ "sortorder ::=", /* 158 */ "groupby_opt ::=", /* 159 */ "groupby_opt ::= GROUP BY nexprlist", /* 160 */ "having_opt ::=", /* 161 */ "having_opt ::= HAVING expr", /* 162 */ "limit_opt ::=", /* 163 */ "limit_opt ::= LIMIT expr", /* 164 */ "limit_opt ::= LIMIT expr OFFSET expr", /* 165 */ "limit_opt ::= LIMIT expr COMMA expr", /* 166 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", /* 167 */ "where_opt ::=", /* 168 */ "where_opt ::= WHERE expr", /* 169 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", /* 170 */ "setlist ::= setlist COMMA nm EQ expr", /* 171 */ "setlist ::= nm EQ expr", /* 172 */ "cmd ::= insert_cmd INTO fullname inscollist_opt valuelist", /* 173 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", /* 175 */ "insert_cmd ::= INSERT orconf", /* 176 */ "insert_cmd ::= REPLACE", /* 177 */ "valuelist ::= VALUES LP nexprlist RP", /* 178 */ "valuelist ::= valuelist COMMA LP exprlist RP", /* 179 */ "inscollist_opt ::=", /* 180 */ "inscollist_opt ::= LP inscollist RP", /* 181 */ "inscollist ::= inscollist COMMA nm", /* 182 */ "inscollist ::= nm", /* 183 */ "expr ::= term", /* 184 */ "expr ::= LP expr RP", /* 185 */ "term ::= NULL", /* 186 */ "expr ::= id", /* 187 */ "expr ::= JOIN_KW", /* 188 */ "expr ::= nm DOT nm", /* 189 */ "expr ::= nm DOT nm DOT nm", /* 190 */ "term ::= INTEGER|FLOAT|BLOB", /* 191 */ "term ::= STRING", /* 192 */ "expr ::= REGISTER", /* 193 */ "expr ::= VARIABLE", /* 194 */ "expr ::= expr COLLATE ids", /* 195 */ "expr ::= CAST LP expr AS typetoken RP", /* 196 */ "expr ::= ID LP distinct exprlist RP", /* 197 */ "expr ::= ID LP STAR RP", /* 198 */ "term ::= CTIME_KW", /* 199 */ "expr ::= expr AND expr", /* 200 */ "expr ::= expr OR expr", /* 201 */ "expr ::= expr LT|GT|GE|LE expr", /* 202 */ "expr ::= expr EQ|NE expr", /* 203 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", /* 204 */ "expr ::= expr PLUS|MINUS expr", /* 205 */ "expr ::= expr STAR|SLASH|REM expr", /* 206 */ "expr ::= expr CONCAT expr", /* 207 */ "likeop ::= LIKE_KW", /* 208 */ "likeop ::= NOT LIKE_KW", /* 209 */ "likeop ::= MATCH", /* 210 */ "likeop ::= NOT MATCH", /* 211 */ "expr ::= expr likeop expr", /* 212 */ "expr ::= expr likeop expr ESCAPE expr", /* 213 */ "expr ::= expr ISNULL|NOTNULL", /* 214 */ "expr ::= expr NOT NULL", /* 215 */ "expr ::= expr IS expr", /* 216 */ "expr ::= expr IS NOT expr", /* 217 */ "expr ::= NOT expr", /* 218 */ "expr ::= BITNOT expr", /* 219 */ "expr ::= MINUS expr", /* 220 */ "expr ::= PLUS expr", /* 221 */ "between_op ::= BETWEEN", /* 222 */ "between_op ::= NOT BETWEEN", /* 223 */ "expr ::= expr between_op expr AND expr", /* 224 */ "in_op ::= IN", /* 225 */ "in_op ::= NOT IN", /* 226 */ "expr ::= expr in_op LP exprlist RP", /* 227 */ "expr ::= LP select RP", /* 228 */ "expr ::= expr in_op LP select RP", /* 229 */ "expr ::= expr in_op nm dbnm", /* 230 */ "expr ::= EXISTS LP select RP", /* 231 */ "expr ::= CASE case_operand case_exprlist case_else END", /* 232 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", /* 233 */ "case_exprlist ::= WHEN expr THEN expr", /* 234 */ "case_else ::= ELSE expr", /* 235 */ "case_else ::=", /* 236 */ "case_operand ::= expr", /* 237 */ "case_operand ::=", /* 238 */ "exprlist ::= nexprlist", /* 239 */ "exprlist ::=", /* 240 */ "nexprlist ::= nexprlist COMMA expr", /* 241 */ "nexprlist ::= expr", /* 242 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP", /* 243 */ "uniqueflag ::= UNIQUE", /* 244 */ "uniqueflag ::=", /* 245 */ "idxlist_opt ::=", /* 246 */ "idxlist_opt ::= LP idxlist RP", /* 247 */ "idxlist ::= idxlist COMMA nm collate sortorder", /* 248 */ "idxlist ::= nm collate sortorder", /* 249 */ "collate ::=", /* 250 */ "collate ::= COLLATE ids", /* 251 */ "cmd ::= DROP INDEX ifexists fullname", /* 252 */ "cmd ::= VACUUM", /* 253 */ "cmd ::= VACUUM nm", /* 254 */ "cmd ::= PRAGMA nm dbnm", /* 255 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", /* 256 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", /* 257 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", /* 258 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", /* 259 */ "nmnum ::= plus_num", /* 260 */ "nmnum ::= nm", /* 261 */ "nmnum ::= ON", /* 262 */ "nmnum ::= DELETE", /* 263 */ "nmnum ::= DEFAULT", /* 264 */ "plus_num ::= PLUS number", /* 265 */ "plus_num ::= number", /* 266 */ "minus_num ::= MINUS number", /* 267 */ "number ::= INTEGER|FLOAT", /* 268 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", /* 269 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", /* 270 */ "trigger_time ::= BEFORE", /* 271 */ "trigger_time ::= AFTER", /* 272 */ "trigger_time ::= INSTEAD OF", /* 273 */ "trigger_time ::=", /* 274 */ "trigger_event ::= DELETE|INSERT", /* 275 */ "trigger_event ::= UPDATE", /* 276 */ "trigger_event ::= UPDATE OF inscollist", /* 277 */ "foreach_clause ::=", /* 278 */ "foreach_clause ::= FOR EACH ROW", /* 279 */ "when_clause ::=", /* 280 */ "when_clause ::= WHEN expr", /* 281 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", /* 282 */ "trigger_cmd_list ::= trigger_cmd SEMI", /* 283 */ "trnm ::= nm", /* 284 */ "trnm ::= nm DOT nm", /* 285 */ "tridxby ::=", /* 286 */ "tridxby ::= INDEXED BY nm", /* 287 */ "tridxby ::= NOT INDEXED", /* 288 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt", /* 289 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist", /* 290 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select", /* 291 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt", /* 292 */ "trigger_cmd ::= select", /* 293 */ "expr ::= RAISE LP IGNORE RP", /* 294 */ "expr ::= RAISE LP raisetype COMMA nm RP", /* 295 */ "raisetype ::= ROLLBACK", /* 296 */ "raisetype ::= ABORT", /* 297 */ "raisetype ::= FAIL", /* 298 */ "cmd ::= DROP TRIGGER ifexists fullname", /* 299 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", /* 300 */ "cmd ::= DETACH database_kw_opt expr", /* 301 */ "key_opt ::=", /* 302 */ "key_opt ::= KEY expr", /* 303 */ "database_kw_opt ::= DATABASE", /* 304 */ "database_kw_opt ::=", /* 305 */ "cmd ::= REINDEX", /* 306 */ "cmd ::= REINDEX nm dbnm", /* 307 */ "cmd ::= ANALYZE", /* 308 */ "cmd ::= ANALYZE nm dbnm", /* 309 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", /* 310 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", /* 311 */ "add_column_fullname ::= fullname", /* 312 */ "kwcolumn_opt ::=", /* 313 */ "kwcolumn_opt ::= COLUMNKW", /* 314 */ "cmd ::= create_vtab", /* 315 */ "cmd ::= create_vtab LP vtabarglist RP", /* 316 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", /* 317 */ "vtabarglist ::= vtabarg", /* 318 */ "vtabarglist ::= vtabarglist COMMA vtabarg", /* 319 */ "vtabarg ::=", /* 320 */ "vtabarg ::= vtabarg vtabargtoken", /* 321 */ "vtabargtoken ::= ANY", /* 322 */ "vtabargtoken ::= lp anylist RP", /* 323 */ "lp ::= LP", /* 324 */ "anylist ::=", /* 325 */ "anylist ::= anylist LP anylist RP", /* 326 */ "anylist ::= anylist ANY", }; #endif /* NDEBUG */ #if YYSTACKDEPTH<=0 /* ** Try to increase the size of the parser stack. */ static void yyGrowStack(yyParser *p){ int newSize; yyStackEntry *pNew; newSize = p->yystksz*2 + 100; pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); if( pNew ){ p->yystack = pNew; p->yystksz = newSize; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sStack grows to %d entries!\n", yyTracePrompt, p->yystksz); } #endif } } #endif /* ** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. ** ** Inputs: ** A pointer to the function used to allocate memory. ** ** Outputs: ** A pointer to a parser. This pointer is used in subsequent calls ** to sqlite3Parser and sqlite3ParserFree. */ void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){ yyParser *pParser; pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); if( pParser ){ pParser->yyidx = -1; #ifdef YYTRACKMAXSTACKDEPTH pParser->yyidxMax = 0; #endif #if YYSTACKDEPTH<=0 pParser->yystack = NULL; pParser->yystksz = 0; yyGrowStack(pParser); #endif } return pParser; } /* The following function deletes the value associated with a ** symbol. The symbol can be either a terminal or nonterminal. ** "yymajor" is the symbol code, and "yypminor" is a pointer to ** the value. */ static void yy_destructor( yyParser *yypParser, /* The parser */ YYCODETYPE yymajor, /* Type code for object to destroy */ YYMINORTYPE *yypminor /* The object to be destroyed */ ){ sqlite3ParserARG_FETCH; switch( yymajor ){ /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a ** reduce or during error processing or when a parser is ** being destroyed before it is finished parsing. ** ** Note: during a reduce, the only symbols destroyed are those ** which appear on the RHS of the rule, but which are not used ** inside the C code. */ case 160: /* select */ case 194: /* oneselect */ { #line 412 "parse.y" sqlite3SelectDelete(pParse->db, (yypminor->yy159)); #line 1409 "parse.c" } break; case 174: /* term */ case 175: /* expr */ { #line 757 "parse.y" sqlite3ExprDelete(pParse->db, (yypminor->yy342).pExpr); #line 1417 "parse.c" } break; case 179: /* idxlist_opt */ case 187: /* idxlist */ case 197: /* selcollist */ case 200: /* groupby_opt */ case 202: /* orderby_opt */ case 204: /* sclp */ case 214: /* sortlist */ case 215: /* nexprlist */ case 216: /* setlist */ case 220: /* exprlist */ case 225: /* case_exprlist */ { #line 1140 "parse.y" sqlite3ExprListDelete(pParse->db, (yypminor->yy442)); #line 1434 "parse.c" } break; case 193: /* fullname */ case 198: /* from */ case 206: /* seltablist */ case 207: /* stl_prefix */ { #line 543 "parse.y" sqlite3SrcListDelete(pParse->db, (yypminor->yy347)); #line 1444 "parse.c" } break; case 199: /* where_opt */ case 201: /* having_opt */ case 210: /* on_opt */ case 224: /* case_operand */ case 226: /* case_else */ case 236: /* when_clause */ case 241: /* key_opt */ { #line 650 "parse.y" sqlite3ExprDelete(pParse->db, (yypminor->yy122)); #line 1457 "parse.c" } break; case 211: /* using_opt */ case 213: /* inscollist */ case 218: /* inscollist_opt */ { #line 575 "parse.y" sqlite3IdListDelete(pParse->db, (yypminor->yy180)); #line 1466 "parse.c" } break; case 219: /* valuelist */ { #line 706 "parse.y" sqlite3ExprListDelete(pParse->db, (yypminor->yy487).pList); sqlite3SelectDelete(pParse->db, (yypminor->yy487).pSelect); #line 1476 "parse.c" } break; case 232: /* trigger_cmd_list */ case 237: /* trigger_cmd */ { #line 1246 "parse.y" sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy327)); #line 1484 "parse.c" } break; case 234: /* trigger_event */ { #line 1232 "parse.y" sqlite3IdListDelete(pParse->db, (yypminor->yy410).b); #line 1491 "parse.c" } break; default: break; /* If no destructor action specified: do nothing */ } } /* ** Pop the parser's stack once. ** ** If there is a destructor routine associated with the token which ** is popped from the stack, then call it. ** ** Return the major token number for the symbol popped. */ static int yy_pop_parser_stack(yyParser *pParser){ YYCODETYPE yymajor; yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; /* There is no mechanism by which the parser stack can be popped below ** empty in SQLite. */ if( NEVER(pParser->yyidx<0) ) return 0; #ifndef NDEBUG if( yyTraceFILE && pParser->yyidx>=0 ){ fprintf(yyTraceFILE,"%sPopping %s\n", yyTracePrompt, yyTokenName[yytos->major]); } #endif yymajor = yytos->major; yy_destructor(pParser, yymajor, &yytos->minor); pParser->yyidx--; return yymajor; } /* ** Deallocate and destroy a parser. Destructors are all called for ** all stack elements before shutting the parser down. ** ** Inputs: ** */ void sqlite3ParserFree( void *p, /* The parser to be deleted */ void (*freeProc)(void*) /* Function used to reclaim memory */ ){ yyParser *pParser = (yyParser*)p; /* In SQLite, we never try to destroy a parser that was not successfully ** created in the first place. */ if( NEVER(pParser==0) ) return; while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser); #if YYSTACKDEPTH<=0 free(pParser->yystack); #endif (*freeProc)((void*)pParser); } /* ** Return the peak depth of the stack for a parser. */ #ifdef YYTRACKMAXSTACKDEPTH int sqlite3ParserStackPeak(void *p){ yyParser *pParser = (yyParser*)p; return pParser->yyidxMax; } #endif /* ** Find the appropriate action for a parser given the terminal ** look-ahead token iLookAhead. ** ** If the look-ahead token is YYNOCODE, then check to see if the action is ** independent of the look-ahead. If it is, return the action, otherwise ** return YY_NO_ACTION. */ static int yy_find_shift_action( yyParser *pParser, /* The parser */ YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; int stateno = pParser->yystack[pParser->yyidx].stateno; if( stateno>YY_SHIFT_COUNT || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){ return yy_default[stateno]; } assert( iLookAhead!=YYNOCODE ); i += iLookAhead; if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ if( iLookAhead>0 ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ if( iLookAhead %s\n", yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); } #endif return yy_find_shift_action(pParser, iFallback); } #endif #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; if( #if YY_SHIFT_MIN+YYWILDCARD<0 j>=0 && #endif #if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT j %s\n", yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]); } #endif /* NDEBUG */ return yy_action[j]; } } #endif /* YYWILDCARD */ } return yy_default[stateno]; }else{ return yy_action[i]; } } /* ** Find the appropriate action for a parser given the non-terminal ** look-ahead token iLookAhead. ** ** If the look-ahead token is YYNOCODE, then check to see if the action is ** independent of the look-ahead. If it is, return the action, otherwise ** return YY_NO_ACTION. */ static int yy_find_reduce_action( int stateno, /* Current state number */ YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; #ifdef YYERRORSYMBOL if( stateno>YY_REDUCE_COUNT ){ return yy_default[stateno]; } #else assert( stateno<=YY_REDUCE_COUNT ); #endif i = yy_reduce_ofst[stateno]; assert( i!=YY_REDUCE_USE_DFLT ); assert( iLookAhead!=YYNOCODE ); i += iLookAhead; #ifdef YYERRORSYMBOL if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ return yy_default[stateno]; } #else assert( i>=0 && iyyidx--; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); } #endif while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); /* Here code is inserted which will execute if the parser ** stack every overflows */ #line 37 "parse.y" UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */ sqlite3ErrorMsg(pParse, "parser stack overflow"); #line 1681 "parse.c" sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */ } /* ** Perform a shift action. */ static void yy_shift( yyParser *yypParser, /* The parser to be shifted */ int yyNewState, /* The new state to shift in */ int yyMajor, /* The major token to shift in */ YYMINORTYPE *yypMinor /* Pointer to the minor token to shift in */ ){ yyStackEntry *yytos; yypParser->yyidx++; #ifdef YYTRACKMAXSTACKDEPTH if( yypParser->yyidx>yypParser->yyidxMax ){ yypParser->yyidxMax = yypParser->yyidx; } #endif #if YYSTACKDEPTH>0 if( yypParser->yyidx>=YYSTACKDEPTH ){ yyStackOverflow(yypParser, yypMinor); return; } #else if( yypParser->yyidx>=yypParser->yystksz ){ yyGrowStack(yypParser); if( yypParser->yyidx>=yypParser->yystksz ){ yyStackOverflow(yypParser, yypMinor); return; } } #endif yytos = &yypParser->yystack[yypParser->yyidx]; yytos->stateno = (YYACTIONTYPE)yyNewState; yytos->major = (YYCODETYPE)yyMajor; yytos->minor = *yypMinor; #ifndef NDEBUG if( yyTraceFILE && yypParser->yyidx>0 ){ int i; fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); fprintf(yyTraceFILE,"%sStack:",yyTracePrompt); for(i=1; i<=yypParser->yyidx; i++) fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]); fprintf(yyTraceFILE,"\n"); } #endif } /* The following table contains information about every rule that ** is used during the reduce. */ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ unsigned char nrhs; /* Number of right-hand side symbols in the rule */ } yyRuleInfo[] = { { 142, 1 }, { 143, 2 }, { 143, 1 }, { 144, 1 }, { 144, 3 }, { 145, 0 }, { 145, 1 }, { 145, 3 }, { 146, 1 }, { 147, 3 }, { 149, 0 }, { 149, 1 }, { 149, 2 }, { 148, 0 }, { 148, 1 }, { 148, 1 }, { 148, 1 }, { 147, 2 }, { 147, 2 }, { 147, 2 }, { 151, 1 }, { 151, 0 }, { 147, 2 }, { 147, 3 }, { 147, 5 }, { 147, 2 }, { 152, 6 }, { 154, 1 }, { 156, 0 }, { 156, 3 }, { 155, 1 }, { 155, 0 }, { 153, 4 }, { 153, 2 }, { 158, 3 }, { 158, 1 }, { 161, 3 }, { 162, 1 }, { 165, 1 }, { 165, 1 }, { 166, 1 }, { 150, 1 }, { 150, 1 }, { 150, 1 }, { 163, 0 }, { 163, 1 }, { 167, 1 }, { 167, 4 }, { 167, 6 }, { 168, 1 }, { 168, 2 }, { 169, 1 }, { 169, 1 }, { 164, 2 }, { 164, 0 }, { 172, 3 }, { 172, 1 }, { 173, 2 }, { 173, 4 }, { 173, 3 }, { 173, 3 }, { 173, 2 }, { 173, 2 }, { 173, 3 }, { 173, 5 }, { 173, 2 }, { 173, 4 }, { 173, 4 }, { 173, 1 }, { 173, 2 }, { 178, 0 }, { 178, 1 }, { 180, 0 }, { 180, 2 }, { 182, 2 }, { 182, 3 }, { 182, 3 }, { 182, 3 }, { 183, 2 }, { 183, 2 }, { 183, 1 }, { 183, 1 }, { 183, 2 }, { 181, 3 }, { 181, 2 }, { 184, 0 }, { 184, 2 }, { 184, 2 }, { 159, 0 }, { 159, 2 }, { 185, 3 }, { 185, 2 }, { 185, 1 }, { 186, 2 }, { 186, 7 }, { 186, 5 }, { 186, 5 }, { 186, 10 }, { 188, 0 }, { 188, 1 }, { 176, 0 }, { 176, 3 }, { 189, 0 }, { 189, 2 }, { 190, 1 }, { 190, 1 }, { 190, 1 }, { 147, 4 }, { 192, 2 }, { 192, 0 }, { 147, 8 }, { 147, 4 }, { 147, 1 }, { 160, 1 }, { 160, 3 }, { 195, 1 }, { 195, 2 }, { 195, 1 }, { 194, 9 }, { 196, 1 }, { 196, 1 }, { 196, 0 }, { 204, 2 }, { 204, 0 }, { 197, 3 }, { 197, 2 }, { 197, 4 }, { 205, 2 }, { 205, 1 }, { 205, 0 }, { 198, 0 }, { 198, 2 }, { 207, 2 }, { 207, 0 }, { 206, 7 }, { 206, 7 }, { 206, 7 }, { 157, 0 }, { 157, 2 }, { 193, 2 }, { 208, 1 }, { 208, 2 }, { 208, 3 }, { 208, 4 }, { 210, 2 }, { 210, 0 }, { 209, 0 }, { 209, 3 }, { 209, 2 }, { 211, 4 }, { 211, 0 }, { 202, 0 }, { 202, 3 }, { 214, 4 }, { 214, 2 }, { 177, 1 }, { 177, 1 }, { 177, 0 }, { 200, 0 }, { 200, 3 }, { 201, 0 }, { 201, 2 }, { 203, 0 }, { 203, 2 }, { 203, 4 }, { 203, 4 }, { 147, 5 }, { 199, 0 }, { 199, 2 }, { 147, 7 }, { 216, 5 }, { 216, 3 }, { 147, 5 }, { 147, 5 }, { 147, 6 }, { 217, 2 }, { 217, 1 }, { 219, 4 }, { 219, 5 }, { 218, 0 }, { 218, 3 }, { 213, 3 }, { 213, 1 }, { 175, 1 }, { 175, 3 }, { 174, 1 }, { 175, 1 }, { 175, 1 }, { 175, 3 }, { 175, 5 }, { 174, 1 }, { 174, 1 }, { 175, 1 }, { 175, 1 }, { 175, 3 }, { 175, 6 }, { 175, 5 }, { 175, 4 }, { 174, 1 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 175, 3 }, { 221, 1 }, { 221, 2 }, { 221, 1 }, { 221, 2 }, { 175, 3 }, { 175, 5 }, { 175, 2 }, { 175, 3 }, { 175, 3 }, { 175, 4 }, { 175, 2 }, { 175, 2 }, { 175, 2 }, { 175, 2 }, { 222, 1 }, { 222, 2 }, { 175, 5 }, { 223, 1 }, { 223, 2 }, { 175, 5 }, { 175, 3 }, { 175, 5 }, { 175, 4 }, { 175, 4 }, { 175, 5 }, { 225, 5 }, { 225, 4 }, { 226, 2 }, { 226, 0 }, { 224, 1 }, { 224, 0 }, { 220, 1 }, { 220, 0 }, { 215, 3 }, { 215, 1 }, { 147, 11 }, { 227, 1 }, { 227, 0 }, { 179, 0 }, { 179, 3 }, { 187, 5 }, { 187, 3 }, { 228, 0 }, { 228, 2 }, { 147, 4 }, { 147, 1 }, { 147, 2 }, { 147, 3 }, { 147, 5 }, { 147, 6 }, { 147, 5 }, { 147, 6 }, { 229, 1 }, { 229, 1 }, { 229, 1 }, { 229, 1 }, { 229, 1 }, { 170, 2 }, { 170, 1 }, { 171, 2 }, { 230, 1 }, { 147, 5 }, { 231, 11 }, { 233, 1 }, { 233, 1 }, { 233, 2 }, { 233, 0 }, { 234, 1 }, { 234, 1 }, { 234, 3 }, { 235, 0 }, { 235, 3 }, { 236, 0 }, { 236, 2 }, { 232, 3 }, { 232, 2 }, { 238, 1 }, { 238, 3 }, { 239, 0 }, { 239, 3 }, { 239, 2 }, { 237, 7 }, { 237, 5 }, { 237, 5 }, { 237, 5 }, { 237, 1 }, { 175, 4 }, { 175, 6 }, { 191, 1 }, { 191, 1 }, { 191, 1 }, { 147, 4 }, { 147, 6 }, { 147, 3 }, { 241, 0 }, { 241, 2 }, { 240, 1 }, { 240, 0 }, { 147, 1 }, { 147, 3 }, { 147, 1 }, { 147, 3 }, { 147, 6 }, { 147, 6 }, { 242, 1 }, { 243, 0 }, { 243, 1 }, { 147, 1 }, { 147, 4 }, { 244, 8 }, { 245, 1 }, { 245, 3 }, { 246, 0 }, { 246, 2 }, { 247, 1 }, { 247, 3 }, { 248, 1 }, { 249, 0 }, { 249, 4 }, { 249, 2 }, }; static void yy_accept(yyParser*); /* Forward Declaration */ /* ** Perform a reduce action and the shift that must immediately ** follow the reduce. */ static void yy_reduce( yyParser *yypParser, /* The parser */ int yyruleno /* Number of the rule by which to reduce */ ){ int yygoto; /* The next state */ int yyact; /* The next action */ YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ yyStackEntry *yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ sqlite3ParserARG_FETCH; yymsp = &yypParser->yystack[yypParser->yyidx]; #ifndef NDEBUG if( yyTraceFILE && yyruleno>=0 && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, yyRuleName[yyruleno]); } #endif /* NDEBUG */ /* Silence complaints from purify about yygotominor being uninitialized ** in some cases when it is copied into the stack after the following ** switch. yygotominor is uninitialized when a rule reduces that does ** not set the value of its left-hand side nonterminal. Leaving the ** value of the nonterminal uninitialized is utterly harmless as long ** as the value is never used. So really the only thing this code ** accomplishes is to quieten purify. ** ** 2007-01-16: The wireshark project (www.wireshark.org) reports that ** without this code, their parser segfaults. I'm not sure what there ** parser is doing to make this happen. This is the second bug report ** from wireshark this week. Clearly they are stressing Lemon in ways ** that it has not been previously stressed... (SQLite ticket #2172) */ /*memset(&yygotominor, 0, sizeof(yygotominor));*/ yygotominor = yyzerominor; switch( yyruleno ){ /* Beginning here are the reduction cases. A typical example ** follows: ** case 0: ** #line ** { ... } // User supplied code ** #line ** break; */ case 5: /* explain ::= */ #line 113 "parse.y" { sqlite3BeginParse(pParse, 0); } #line 2122 "parse.c" break; case 6: /* explain ::= EXPLAIN */ #line 115 "parse.y" { sqlite3BeginParse(pParse, 1); } #line 2127 "parse.c" break; case 7: /* explain ::= EXPLAIN QUERY PLAN */ #line 116 "parse.y" { sqlite3BeginParse(pParse, 2); } #line 2132 "parse.c" break; case 8: /* cmdx ::= cmd */ #line 118 "parse.y" { sqlite3FinishCoding(pParse); } #line 2137 "parse.c" break; case 9: /* cmd ::= BEGIN transtype trans_opt */ #line 123 "parse.y" {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy392);} #line 2142 "parse.c" break; case 13: /* transtype ::= */ #line 128 "parse.y" {yygotominor.yy392 = TK_DEFERRED;} #line 2147 "parse.c" break; case 14: /* transtype ::= DEFERRED */ case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117); #line 129 "parse.y" {yygotominor.yy392 = yymsp[0].major;} #line 2156 "parse.c" break; case 17: /* cmd ::= COMMIT trans_opt */ case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); #line 132 "parse.y" {sqlite3CommitTransaction(pParse);} #line 2162 "parse.c" break; case 19: /* cmd ::= ROLLBACK trans_opt */ #line 134 "parse.y" {sqlite3RollbackTransaction(pParse);} #line 2167 "parse.c" break; case 22: /* cmd ::= SAVEPOINT nm */ #line 138 "parse.y" { sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0); } #line 2174 "parse.c" break; case 23: /* cmd ::= RELEASE savepoint_opt nm */ #line 141 "parse.y" { sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0); } #line 2181 "parse.c" break; case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */ #line 144 "parse.y" { sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); } #line 2188 "parse.c" break; case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ #line 151 "parse.y" { sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy392,0,0,yymsp[-2].minor.yy392); } #line 2195 "parse.c" break; case 27: /* createkw ::= CREATE */ #line 154 "parse.y" { pParse->db->lookaside.bEnabled = 0; yygotominor.yy0 = yymsp[0].minor.yy0; } #line 2203 "parse.c" break; case 28: /* ifnotexists ::= */ case 31: /* temp ::= */ yytestcase(yyruleno==31); case 70: /* autoinc ::= */ yytestcase(yyruleno==70); case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83); case 85: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==85); case 87: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==87); case 98: /* defer_subclause_opt ::= */ yytestcase(yyruleno==98); case 109: /* ifexists ::= */ yytestcase(yyruleno==109); case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); case 121: /* distinct ::= */ yytestcase(yyruleno==121); case 221: /* between_op ::= BETWEEN */ yytestcase(yyruleno==221); case 224: /* in_op ::= IN */ yytestcase(yyruleno==224); #line 159 "parse.y" {yygotominor.yy392 = 0;} #line 2219 "parse.c" break; case 29: /* ifnotexists ::= IF NOT EXISTS */ case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86); case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); case 222: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==222); case 225: /* in_op ::= NOT IN */ yytestcase(yyruleno==225); #line 160 "parse.y" {yygotominor.yy392 = 1;} #line 2231 "parse.c" break; case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ #line 166 "parse.y" { sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); } #line 2238 "parse.c" break; case 33: /* create_table_args ::= AS select */ #line 169 "parse.y" { sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy159); sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159); } #line 2246 "parse.c" break; case 36: /* column ::= columnid type carglist */ #line 181 "parse.y" { yygotominor.yy0.z = yymsp[-2].minor.yy0.z; yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n; } #line 2254 "parse.c" break; case 37: /* columnid ::= nm */ #line 185 "parse.y" { sqlite3AddColumn(pParse,&yymsp[0].minor.yy0); yygotominor.yy0 = yymsp[0].minor.yy0; } #line 2262 "parse.c" break; case 38: /* id ::= ID */ case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39); case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40); case 41: /* nm ::= id */ yytestcase(yyruleno==41); case 42: /* nm ::= STRING */ yytestcase(yyruleno==42); case 43: /* nm ::= JOIN_KW */ yytestcase(yyruleno==43); case 46: /* typetoken ::= typename */ yytestcase(yyruleno==46); case 49: /* typename ::= ids */ yytestcase(yyruleno==49); case 127: /* as ::= AS nm */ yytestcase(yyruleno==127); case 128: /* as ::= ids */ yytestcase(yyruleno==128); case 138: /* dbnm ::= DOT nm */ yytestcase(yyruleno==138); case 147: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==147); case 250: /* collate ::= COLLATE ids */ yytestcase(yyruleno==250); case 259: /* nmnum ::= plus_num */ yytestcase(yyruleno==259); case 260: /* nmnum ::= nm */ yytestcase(yyruleno==260); case 261: /* nmnum ::= ON */ yytestcase(yyruleno==261); case 262: /* nmnum ::= DELETE */ yytestcase(yyruleno==262); case 263: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==263); case 264: /* plus_num ::= PLUS number */ yytestcase(yyruleno==264); case 265: /* plus_num ::= number */ yytestcase(yyruleno==265); case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266); case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267); case 283: /* trnm ::= nm */ yytestcase(yyruleno==283); #line 195 "parse.y" {yygotominor.yy0 = yymsp[0].minor.yy0;} #line 2289 "parse.c" break; case 45: /* type ::= typetoken */ #line 257 "parse.y" {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} #line 2294 "parse.c" break; case 47: /* typetoken ::= typename LP signed RP */ #line 259 "parse.y" { yygotominor.yy0.z = yymsp[-3].minor.yy0.z; yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z); } #line 2302 "parse.c" break; case 48: /* typetoken ::= typename LP signed COMMA signed RP */ #line 263 "parse.y" { yygotominor.yy0.z = yymsp[-5].minor.yy0.z; yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z); } #line 2310 "parse.c" break; case 50: /* typename ::= typename ids */ #line 269 "parse.y" {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);} #line 2315 "parse.c" break; case 57: /* ccons ::= DEFAULT term */ case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); #line 280 "parse.y" {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy342);} #line 2321 "parse.c" break; case 58: /* ccons ::= DEFAULT LP expr RP */ #line 281 "parse.y" {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy342);} #line 2326 "parse.c" break; case 60: /* ccons ::= DEFAULT MINUS term */ #line 283 "parse.y" { ExprSpan v; v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy342.pExpr, 0, 0); v.zStart = yymsp[-1].minor.yy0.z; v.zEnd = yymsp[0].minor.yy342.zEnd; sqlite3AddDefaultValue(pParse,&v); } #line 2337 "parse.c" break; case 61: /* ccons ::= DEFAULT id */ #line 290 "parse.y" { ExprSpan v; spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0); sqlite3AddDefaultValue(pParse,&v); } #line 2346 "parse.c" break; case 63: /* ccons ::= NOT NULL onconf */ #line 300 "parse.y" {sqlite3AddNotNull(pParse, yymsp[0].minor.yy392);} #line 2351 "parse.c" break; case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ #line 302 "parse.y" {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy392,yymsp[0].minor.yy392,yymsp[-2].minor.yy392);} #line 2356 "parse.c" break; case 65: /* ccons ::= UNIQUE onconf */ #line 303 "parse.y" {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy392,0,0,0,0);} #line 2361 "parse.c" break; case 66: /* ccons ::= CHECK LP expr RP */ #line 304 "parse.y" {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy342.pExpr);} #line 2366 "parse.c" break; case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ #line 306 "parse.y" {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy442,yymsp[0].minor.yy392);} #line 2371 "parse.c" break; case 68: /* ccons ::= defer_subclause */ #line 307 "parse.y" {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy392);} #line 2376 "parse.c" break; case 69: /* ccons ::= COLLATE ids */ #line 308 "parse.y" {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} #line 2381 "parse.c" break; case 72: /* refargs ::= */ #line 321 "parse.y" { yygotominor.yy392 = OE_None*0x0101; /* EV: R-19803-45884 */} #line 2386 "parse.c" break; case 73: /* refargs ::= refargs refarg */ #line 322 "parse.y" { yygotominor.yy392 = (yymsp[-1].minor.yy392 & ~yymsp[0].minor.yy207.mask) | yymsp[0].minor.yy207.value; } #line 2391 "parse.c" break; case 74: /* refarg ::= MATCH nm */ case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); #line 324 "parse.y" { yygotominor.yy207.value = 0; yygotominor.yy207.mask = 0x000000; } #line 2397 "parse.c" break; case 76: /* refarg ::= ON DELETE refact */ #line 326 "parse.y" { yygotominor.yy207.value = yymsp[0].minor.yy392; yygotominor.yy207.mask = 0x0000ff; } #line 2402 "parse.c" break; case 77: /* refarg ::= ON UPDATE refact */ #line 327 "parse.y" { yygotominor.yy207.value = yymsp[0].minor.yy392<<8; yygotominor.yy207.mask = 0x00ff00; } #line 2407 "parse.c" break; case 78: /* refact ::= SET NULL */ #line 329 "parse.y" { yygotominor.yy392 = OE_SetNull; /* EV: R-33326-45252 */} #line 2412 "parse.c" break; case 79: /* refact ::= SET DEFAULT */ #line 330 "parse.y" { yygotominor.yy392 = OE_SetDflt; /* EV: R-33326-45252 */} #line 2417 "parse.c" break; case 80: /* refact ::= CASCADE */ #line 331 "parse.y" { yygotominor.yy392 = OE_Cascade; /* EV: R-33326-45252 */} #line 2422 "parse.c" break; case 81: /* refact ::= RESTRICT */ #line 332 "parse.y" { yygotominor.yy392 = OE_Restrict; /* EV: R-33326-45252 */} #line 2427 "parse.c" break; case 82: /* refact ::= NO ACTION */ #line 333 "parse.y" { yygotominor.yy392 = OE_None; /* EV: R-33326-45252 */} #line 2432 "parse.c" break; case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99); case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101); case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); #line 336 "parse.y" {yygotominor.yy392 = yymsp[0].minor.yy392;} #line 2440 "parse.c" break; case 88: /* conslist_opt ::= */ #line 345 "parse.y" {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} #line 2445 "parse.c" break; case 89: /* conslist_opt ::= COMMA conslist */ #line 346 "parse.y" {yygotominor.yy0 = yymsp[-1].minor.yy0;} #line 2450 "parse.c" break; case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ #line 352 "parse.y" {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy442,yymsp[0].minor.yy392,yymsp[-2].minor.yy392,0);} #line 2455 "parse.c" break; case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ #line 354 "parse.y" {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy442,yymsp[0].minor.yy392,0,0,0,0);} #line 2460 "parse.c" break; case 96: /* tcons ::= CHECK LP expr RP onconf */ #line 356 "parse.y" {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy342.pExpr);} #line 2465 "parse.c" break; case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ #line 358 "parse.y" { sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy442, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy442, yymsp[-1].minor.yy392); sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy392); } #line 2473 "parse.c" break; case 100: /* onconf ::= */ #line 372 "parse.y" {yygotominor.yy392 = OE_Default;} #line 2478 "parse.c" break; case 102: /* orconf ::= */ #line 374 "parse.y" {yygotominor.yy258 = OE_Default;} #line 2483 "parse.c" break; case 103: /* orconf ::= OR resolvetype */ #line 375 "parse.y" {yygotominor.yy258 = (u8)yymsp[0].minor.yy392;} #line 2488 "parse.c" break; case 105: /* resolvetype ::= IGNORE */ #line 377 "parse.y" {yygotominor.yy392 = OE_Ignore;} #line 2493 "parse.c" break; case 106: /* resolvetype ::= REPLACE */ #line 378 "parse.y" {yygotominor.yy392 = OE_Replace;} #line 2498 "parse.c" break; case 107: /* cmd ::= DROP TABLE ifexists fullname */ #line 382 "parse.y" { sqlite3DropTable(pParse, yymsp[0].minor.yy347, 0, yymsp[-1].minor.yy392); } #line 2505 "parse.c" break; case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ #line 392 "parse.y" { sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy159, yymsp[-6].minor.yy392, yymsp[-4].minor.yy392); } #line 2512 "parse.c" break; case 111: /* cmd ::= DROP VIEW ifexists fullname */ #line 395 "parse.y" { sqlite3DropTable(pParse, yymsp[0].minor.yy347, 1, yymsp[-1].minor.yy392); } #line 2519 "parse.c" break; case 112: /* cmd ::= select */ #line 402 "parse.y" { SelectDest dest = {SRT_Output, 0, 0, 0, 0}; sqlite3Select(pParse, yymsp[0].minor.yy159, &dest); sqlite3ExplainBegin(pParse->pVdbe); sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy159); sqlite3ExplainFinish(pParse->pVdbe); sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159); } #line 2531 "parse.c" break; case 113: /* select ::= oneselect */ #line 416 "parse.y" {yygotominor.yy159 = yymsp[0].minor.yy159;} #line 2536 "parse.c" break; case 114: /* select ::= select multiselect_op oneselect */ #line 418 "parse.y" { if( yymsp[0].minor.yy159 ){ yymsp[0].minor.yy159->op = (u8)yymsp[-1].minor.yy392; yymsp[0].minor.yy159->pPrior = yymsp[-2].minor.yy159; }else{ sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy159); } yygotominor.yy159 = yymsp[0].minor.yy159; } #line 2549 "parse.c" break; case 116: /* multiselect_op ::= UNION ALL */ #line 429 "parse.y" {yygotominor.yy392 = TK_ALL;} #line 2554 "parse.c" break; case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ #line 433 "parse.y" { yygotominor.yy159 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy442,yymsp[-5].minor.yy347,yymsp[-4].minor.yy122,yymsp[-3].minor.yy442,yymsp[-2].minor.yy122,yymsp[-1].minor.yy442,yymsp[-7].minor.yy392,yymsp[0].minor.yy64.pLimit,yymsp[0].minor.yy64.pOffset); } #line 2561 "parse.c" break; case 122: /* sclp ::= selcollist COMMA */ case 246: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==246); #line 454 "parse.y" {yygotominor.yy442 = yymsp[-1].minor.yy442;} #line 2567 "parse.c" break; case 123: /* sclp ::= */ case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); case 158: /* groupby_opt ::= */ yytestcase(yyruleno==158); case 239: /* exprlist ::= */ yytestcase(yyruleno==239); case 245: /* idxlist_opt ::= */ yytestcase(yyruleno==245); #line 455 "parse.y" {yygotominor.yy442 = 0;} #line 2576 "parse.c" break; case 124: /* selcollist ::= sclp expr as */ #line 456 "parse.y" { yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy442, yymsp[-1].minor.yy342.pExpr); if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[0].minor.yy0, 1); sqlite3ExprListSetSpan(pParse,yygotominor.yy442,&yymsp[-1].minor.yy342); } #line 2585 "parse.c" break; case 125: /* selcollist ::= sclp STAR */ #line 461 "parse.y" { Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy442, p); } #line 2593 "parse.c" break; case 126: /* selcollist ::= sclp nm DOT STAR */ #line 465 "parse.y" { Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442, pDot); } #line 2603 "parse.c" break; case 129: /* as ::= */ #line 478 "parse.y" {yygotominor.yy0.n = 0;} #line 2608 "parse.c" break; case 130: /* from ::= */ #line 490 "parse.y" {yygotominor.yy347 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy347));} #line 2613 "parse.c" break; case 131: /* from ::= FROM seltablist */ #line 491 "parse.y" { yygotominor.yy347 = yymsp[0].minor.yy347; sqlite3SrcListShiftJoinType(yygotominor.yy347); } #line 2621 "parse.c" break; case 132: /* stl_prefix ::= seltablist joinop */ #line 499 "parse.y" { yygotominor.yy347 = yymsp[-1].minor.yy347; if( ALWAYS(yygotominor.yy347 && yygotominor.yy347->nSrc>0) ) yygotominor.yy347->a[yygotominor.yy347->nSrc-1].jointype = (u8)yymsp[0].minor.yy392; } #line 2629 "parse.c" break; case 133: /* stl_prefix ::= */ #line 503 "parse.y" {yygotominor.yy347 = 0;} #line 2634 "parse.c" break; case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ #line 504 "parse.y" { yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy122,yymsp[0].minor.yy180); sqlite3SrcListIndexedBy(pParse, yygotominor.yy347, &yymsp[-2].minor.yy0); } #line 2642 "parse.c" break; case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ #line 510 "parse.y" { yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy159,yymsp[-1].minor.yy122,yymsp[0].minor.yy180); } #line 2649 "parse.c" break; case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ #line 514 "parse.y" { if( yymsp[-6].minor.yy347==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy122==0 && yymsp[0].minor.yy180==0 ){ yygotominor.yy347 = yymsp[-4].minor.yy347; }else{ Select *pSubquery; sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy347); pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy347,0,0,0,0,0,0,0); yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy122,yymsp[0].minor.yy180); } } #line 2663 "parse.c" break; case 137: /* dbnm ::= */ case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); #line 539 "parse.y" {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} #line 2669 "parse.c" break; case 139: /* fullname ::= nm dbnm */ #line 544 "parse.y" {yygotominor.yy347 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} #line 2674 "parse.c" break; case 140: /* joinop ::= COMMA|JOIN */ #line 548 "parse.y" { yygotominor.yy392 = JT_INNER; } #line 2679 "parse.c" break; case 141: /* joinop ::= JOIN_KW JOIN */ #line 549 "parse.y" { yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } #line 2684 "parse.c" break; case 142: /* joinop ::= JOIN_KW nm JOIN */ #line 550 "parse.y" { yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } #line 2689 "parse.c" break; case 143: /* joinop ::= JOIN_KW nm nm JOIN */ #line 552 "parse.y" { yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } #line 2694 "parse.c" break; case 144: /* on_opt ::= ON expr */ case 161: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==161); case 168: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==168); case 234: /* case_else ::= ELSE expr */ yytestcase(yyruleno==234); case 236: /* case_operand ::= expr */ yytestcase(yyruleno==236); #line 556 "parse.y" {yygotominor.yy122 = yymsp[0].minor.yy342.pExpr;} #line 2703 "parse.c" break; case 145: /* on_opt ::= */ case 160: /* having_opt ::= */ yytestcase(yyruleno==160); case 167: /* where_opt ::= */ yytestcase(yyruleno==167); case 235: /* case_else ::= */ yytestcase(yyruleno==235); case 237: /* case_operand ::= */ yytestcase(yyruleno==237); #line 557 "parse.y" {yygotominor.yy122 = 0;} #line 2712 "parse.c" break; case 148: /* indexed_opt ::= NOT INDEXED */ #line 572 "parse.y" {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} #line 2717 "parse.c" break; case 149: /* using_opt ::= USING LP inscollist RP */ case 180: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==180); #line 576 "parse.y" {yygotominor.yy180 = yymsp[-1].minor.yy180;} #line 2723 "parse.c" break; case 150: /* using_opt ::= */ case 179: /* inscollist_opt ::= */ yytestcase(yyruleno==179); #line 577 "parse.y" {yygotominor.yy180 = 0;} #line 2729 "parse.c" break; case 152: /* orderby_opt ::= ORDER BY sortlist */ case 159: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==159); case 238: /* exprlist ::= nexprlist */ yytestcase(yyruleno==238); #line 586 "parse.y" {yygotominor.yy442 = yymsp[0].minor.yy442;} #line 2736 "parse.c" break; case 153: /* sortlist ::= sortlist COMMA expr sortorder */ #line 587 "parse.y" { yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442,yymsp[-1].minor.yy342.pExpr); if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392; } #line 2744 "parse.c" break; case 154: /* sortlist ::= expr sortorder */ #line 591 "parse.y" { yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy342.pExpr); if( yygotominor.yy442 && ALWAYS(yygotominor.yy442->a) ) yygotominor.yy442->a[0].sortOrder = (u8)yymsp[0].minor.yy392; } #line 2752 "parse.c" break; case 155: /* sortorder ::= ASC */ case 157: /* sortorder ::= */ yytestcase(yyruleno==157); #line 598 "parse.y" {yygotominor.yy392 = SQLITE_SO_ASC;} #line 2758 "parse.c" break; case 156: /* sortorder ::= DESC */ #line 599 "parse.y" {yygotominor.yy392 = SQLITE_SO_DESC;} #line 2763 "parse.c" break; case 162: /* limit_opt ::= */ #line 625 "parse.y" {yygotominor.yy64.pLimit = 0; yygotominor.yy64.pOffset = 0;} #line 2768 "parse.c" break; case 163: /* limit_opt ::= LIMIT expr */ #line 626 "parse.y" {yygotominor.yy64.pLimit = yymsp[0].minor.yy342.pExpr; yygotominor.yy64.pOffset = 0;} #line 2773 "parse.c" break; case 164: /* limit_opt ::= LIMIT expr OFFSET expr */ #line 628 "parse.y" {yygotominor.yy64.pLimit = yymsp[-2].minor.yy342.pExpr; yygotominor.yy64.pOffset = yymsp[0].minor.yy342.pExpr;} #line 2778 "parse.c" break; case 165: /* limit_opt ::= LIMIT expr COMMA expr */ #line 630 "parse.y" {yygotominor.yy64.pOffset = yymsp[-2].minor.yy342.pExpr; yygotominor.yy64.pLimit = yymsp[0].minor.yy342.pExpr;} #line 2783 "parse.c" break; case 166: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ #line 643 "parse.y" { sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy347, &yymsp[-1].minor.yy0); sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy347,yymsp[0].minor.yy122); } #line 2791 "parse.c" break; case 169: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ #line 666 "parse.y" { sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy347, &yymsp[-3].minor.yy0); sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy442,"set list"); sqlite3Update(pParse,yymsp[-4].minor.yy347,yymsp[-1].minor.yy442,yymsp[0].minor.yy122,yymsp[-5].minor.yy258); } #line 2800 "parse.c" break; case 170: /* setlist ::= setlist COMMA nm EQ expr */ #line 676 "parse.y" { yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy442, yymsp[0].minor.yy342.pExpr); sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); } #line 2808 "parse.c" break; case 171: /* setlist ::= nm EQ expr */ #line 680 "parse.y" { yygotominor.yy442 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy342.pExpr); sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); } #line 2816 "parse.c" break; case 172: /* cmd ::= insert_cmd INTO fullname inscollist_opt valuelist */ #line 688 "parse.y" {sqlite3Insert(pParse, yymsp[-2].minor.yy347, yymsp[0].minor.yy487.pList, yymsp[0].minor.yy487.pSelect, yymsp[-1].minor.yy180, yymsp[-4].minor.yy258);} #line 2821 "parse.c" break; case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ #line 690 "parse.y" {sqlite3Insert(pParse, yymsp[-2].minor.yy347, 0, yymsp[0].minor.yy159, yymsp[-1].minor.yy180, yymsp[-4].minor.yy258);} #line 2826 "parse.c" break; case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ #line 692 "parse.y" {sqlite3Insert(pParse, yymsp[-3].minor.yy347, 0, 0, yymsp[-2].minor.yy180, yymsp[-5].minor.yy258);} #line 2831 "parse.c" break; case 175: /* insert_cmd ::= INSERT orconf */ #line 695 "parse.y" {yygotominor.yy258 = yymsp[0].minor.yy258;} #line 2836 "parse.c" break; case 176: /* insert_cmd ::= REPLACE */ #line 696 "parse.y" {yygotominor.yy258 = OE_Replace;} #line 2841 "parse.c" break; case 177: /* valuelist ::= VALUES LP nexprlist RP */ #line 710 "parse.y" { yygotominor.yy487.pList = yymsp[-1].minor.yy442; yygotominor.yy487.pSelect = 0; } #line 2849 "parse.c" break; case 178: /* valuelist ::= valuelist COMMA LP exprlist RP */ #line 718 "parse.y" { Select *pRight = sqlite3SelectNew(pParse, yymsp[-1].minor.yy442, 0, 0, 0, 0, 0, 0, 0, 0); if( yymsp[-4].minor.yy487.pList ){ yymsp[-4].minor.yy487.pSelect = sqlite3SelectNew(pParse, yymsp[-4].minor.yy487.pList, 0, 0, 0, 0, 0, 0, 0, 0); yymsp[-4].minor.yy487.pList = 0; } yygotominor.yy487.pList = 0; if( yymsp[-4].minor.yy487.pSelect==0 || pRight==0 ){ sqlite3SelectDelete(pParse->db, pRight); sqlite3SelectDelete(pParse->db, yymsp[-4].minor.yy487.pSelect); yygotominor.yy487.pSelect = 0; }else{ pRight->op = TK_ALL; pRight->pPrior = yymsp[-4].minor.yy487.pSelect; pRight->selFlags |= SF_Values; pRight->pPrior->selFlags |= SF_Values; yygotominor.yy487.pSelect = pRight; } } #line 2872 "parse.c" break; case 181: /* inscollist ::= inscollist COMMA nm */ #line 747 "parse.y" {yygotominor.yy180 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy180,&yymsp[0].minor.yy0);} #line 2877 "parse.c" break; case 182: /* inscollist ::= nm */ #line 749 "parse.y" {yygotominor.yy180 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} #line 2882 "parse.c" break; case 183: /* expr ::= term */ #line 780 "parse.y" {yygotominor.yy342 = yymsp[0].minor.yy342;} #line 2887 "parse.c" break; case 184: /* expr ::= LP expr RP */ #line 781 "parse.y" {yygotominor.yy342.pExpr = yymsp[-1].minor.yy342.pExpr; spanSet(&yygotominor.yy342,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} #line 2892 "parse.c" break; case 185: /* term ::= NULL */ case 190: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==190); case 191: /* term ::= STRING */ yytestcase(yyruleno==191); #line 782 "parse.y" {spanExpr(&yygotominor.yy342, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} #line 2899 "parse.c" break; case 186: /* expr ::= id */ case 187: /* expr ::= JOIN_KW */ yytestcase(yyruleno==187); #line 783 "parse.y" {spanExpr(&yygotominor.yy342, pParse, TK_ID, &yymsp[0].minor.yy0);} #line 2905 "parse.c" break; case 188: /* expr ::= nm DOT nm */ #line 785 "parse.y" { Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); spanSet(&yygotominor.yy342,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } #line 2915 "parse.c" break; case 189: /* expr ::= nm DOT nm DOT nm */ #line 791 "parse.y" { Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); spanSet(&yygotominor.yy342,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); } #line 2927 "parse.c" break; case 192: /* expr ::= REGISTER */ #line 801 "parse.y" { /* When doing a nested parse, one can include terms in an expression ** that look like this: #1 #2 ... These terms refer to registers ** in the virtual machine. #N is the N-th register. */ if( pParse->nested==0 ){ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0); yygotominor.yy342.pExpr = 0; }else{ yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); if( yygotominor.yy342.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy342.pExpr->iTable); } spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } #line 2944 "parse.c" break; case 193: /* expr ::= VARIABLE */ #line 814 "parse.y" { spanExpr(&yygotominor.yy342, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); sqlite3ExprAssignVarNumber(pParse, yygotominor.yy342.pExpr); spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } #line 2953 "parse.c" break; case 194: /* expr ::= expr COLLATE ids */ #line 819 "parse.y" { yygotominor.yy342.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy342.pExpr, &yymsp[0].minor.yy0); yygotominor.yy342.zStart = yymsp[-2].minor.yy342.zStart; yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } #line 2962 "parse.c" break; case 195: /* expr ::= CAST LP expr AS typetoken RP */ #line 825 "parse.y" { yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy342.pExpr, 0, &yymsp[-1].minor.yy0); spanSet(&yygotominor.yy342,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); } #line 2970 "parse.c" break; case 196: /* expr ::= ID LP distinct exprlist RP */ #line 830 "parse.y" { if( yymsp[-1].minor.yy442 && yymsp[-1].minor.yy442->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); } yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy442, &yymsp[-4].minor.yy0); spanSet(&yygotominor.yy342,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); if( yymsp[-2].minor.yy392 && yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->flags |= EP_Distinct; } } #line 2984 "parse.c" break; case 197: /* expr ::= ID LP STAR RP */ #line 840 "parse.y" { yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); spanSet(&yygotominor.yy342,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); } #line 2992 "parse.c" break; case 198: /* term ::= CTIME_KW */ #line 844 "parse.y" { /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are ** treated as functions that return constants */ yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); if( yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->op = TK_CONST_FUNC; } spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } #line 3005 "parse.c" break; case 199: /* expr ::= expr AND expr */ case 200: /* expr ::= expr OR expr */ yytestcase(yyruleno==200); case 201: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==201); case 202: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==202); case 203: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==203); case 204: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==204); case 205: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==205); case 206: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==206); #line 871 "parse.y" {spanBinaryExpr(&yygotominor.yy342,pParse,yymsp[-1].major,&yymsp[-2].minor.yy342,&yymsp[0].minor.yy342);} #line 3017 "parse.c" break; case 207: /* likeop ::= LIKE_KW */ case 209: /* likeop ::= MATCH */ yytestcase(yyruleno==209); #line 884 "parse.y" {yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.not = 0;} #line 3023 "parse.c" break; case 208: /* likeop ::= NOT LIKE_KW */ case 210: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==210); #line 885 "parse.y" {yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.not = 1;} #line 3029 "parse.c" break; case 211: /* expr ::= expr likeop expr */ #line 888 "parse.y" { ExprList *pList; pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy342.pExpr); pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy342.pExpr); yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy318.eOperator); if( yymsp[-1].minor.yy318.not ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); yygotominor.yy342.zStart = yymsp[-2].minor.yy342.zStart; yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; if( yygotominor.yy342.pExpr ) yygotominor.yy342.pExpr->flags |= EP_InfixFunc; } #line 3043 "parse.c" break; case 212: /* expr ::= expr likeop expr ESCAPE expr */ #line 898 "parse.y" { ExprList *pList; pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExpr); pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy342.pExpr); pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy342.pExpr); yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy318.eOperator); if( yymsp[-3].minor.yy318.not ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; if( yygotominor.yy342.pExpr ) yygotominor.yy342.pExpr->flags |= EP_InfixFunc; } #line 3058 "parse.c" break; case 213: /* expr ::= expr ISNULL|NOTNULL */ #line 926 "parse.y" {spanUnaryPostfix(&yygotominor.yy342,pParse,yymsp[0].major,&yymsp[-1].minor.yy342,&yymsp[0].minor.yy0);} #line 3063 "parse.c" break; case 214: /* expr ::= expr NOT NULL */ #line 927 "parse.y" {spanUnaryPostfix(&yygotominor.yy342,pParse,TK_NOTNULL,&yymsp[-2].minor.yy342,&yymsp[0].minor.yy0);} #line 3068 "parse.c" break; case 215: /* expr ::= expr IS expr */ #line 948 "parse.y" { spanBinaryExpr(&yygotominor.yy342,pParse,TK_IS,&yymsp[-2].minor.yy342,&yymsp[0].minor.yy342); binaryToUnaryIfNull(pParse, yymsp[0].minor.yy342.pExpr, yygotominor.yy342.pExpr, TK_ISNULL); } #line 3076 "parse.c" break; case 216: /* expr ::= expr IS NOT expr */ #line 952 "parse.y" { spanBinaryExpr(&yygotominor.yy342,pParse,TK_ISNOT,&yymsp[-3].minor.yy342,&yymsp[0].minor.yy342); binaryToUnaryIfNull(pParse, yymsp[0].minor.yy342.pExpr, yygotominor.yy342.pExpr, TK_NOTNULL); } #line 3084 "parse.c" break; case 217: /* expr ::= NOT expr */ case 218: /* expr ::= BITNOT expr */ yytestcase(yyruleno==218); #line 975 "parse.y" {spanUnaryPrefix(&yygotominor.yy342,pParse,yymsp[-1].major,&yymsp[0].minor.yy342,&yymsp[-1].minor.yy0);} #line 3090 "parse.c" break; case 219: /* expr ::= MINUS expr */ #line 978 "parse.y" {spanUnaryPrefix(&yygotominor.yy342,pParse,TK_UMINUS,&yymsp[0].minor.yy342,&yymsp[-1].minor.yy0);} #line 3095 "parse.c" break; case 220: /* expr ::= PLUS expr */ #line 980 "parse.y" {spanUnaryPrefix(&yygotominor.yy342,pParse,TK_UPLUS,&yymsp[0].minor.yy342,&yymsp[-1].minor.yy0);} #line 3100 "parse.c" break; case 223: /* expr ::= expr between_op expr AND expr */ #line 985 "parse.y" { ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExpr); pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy342.pExpr); yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy342.pExpr, 0, 0); if( yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->x.pList = pList; }else{ sqlite3ExprListDelete(pParse->db, pList); } if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; } #line 3117 "parse.c" break; case 226: /* expr ::= expr in_op LP exprlist RP */ #line 1002 "parse.y" { if( yymsp[-1].minor.yy442==0 ){ /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** ** simplify to constants 0 (false) and 1 (true), respectively, ** regardless of the value of expr1. */ yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy392]); sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy342.pExpr); }else{ yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy342.pExpr, 0, 0); if( yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->x.pList = yymsp[-1].minor.yy442; sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); }else{ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy442); } if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); } yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } #line 3146 "parse.c" break; case 227: /* expr ::= LP select RP */ #line 1027 "parse.y" { yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); if( yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->x.pSelect = yymsp[-1].minor.yy159; ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); }else{ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); } yygotominor.yy342.zStart = yymsp[-2].minor.yy0.z; yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } #line 3162 "parse.c" break; case 228: /* expr ::= expr in_op LP select RP */ #line 1039 "parse.y" { yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy342.pExpr, 0, 0); if( yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->x.pSelect = yymsp[-1].minor.yy159; ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); }else{ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); } if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } #line 3179 "parse.c" break; case 229: /* expr ::= expr in_op nm dbnm */ #line 1052 "parse.y" { SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy342.pExpr, 0, 0); if( yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); }else{ sqlite3SrcListDelete(pParse->db, pSrc); } if( yymsp[-2].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); yygotominor.yy342.zStart = yymsp[-3].minor.yy342.zStart; yygotominor.yy342.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; } #line 3197 "parse.c" break; case 230: /* expr ::= EXISTS LP select RP */ #line 1066 "parse.y" { Expr *p = yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); if( p ){ p->x.pSelect = yymsp[-1].minor.yy159; ExprSetProperty(p, EP_xIsSelect); sqlite3ExprSetHeight(pParse, p); }else{ sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); } yygotominor.yy342.zStart = yymsp[-3].minor.yy0.z; yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } #line 3213 "parse.c" break; case 231: /* expr ::= CASE case_operand case_exprlist case_else END */ #line 1081 "parse.y" { yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy122, yymsp[-1].minor.yy122, 0); if( yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->x.pList = yymsp[-2].minor.yy442; sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); }else{ sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy442); } yygotominor.yy342.zStart = yymsp[-4].minor.yy0.z; yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } #line 3228 "parse.c" break; case 232: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ #line 1094 "parse.y" { yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, yymsp[-2].minor.yy342.pExpr); yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].minor.yy342.pExpr); } #line 3236 "parse.c" break; case 233: /* case_exprlist ::= WHEN expr THEN expr */ #line 1098 "parse.y" { yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExpr); yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].minor.yy342.pExpr); } #line 3244 "parse.c" break; case 240: /* nexprlist ::= nexprlist COMMA expr */ #line 1119 "parse.y" {yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy442,yymsp[0].minor.yy342.pExpr);} #line 3249 "parse.c" break; case 241: /* nexprlist ::= expr */ #line 1121 "parse.y" {yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy342.pExpr);} #line 3254 "parse.c" break; case 242: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ #line 1127 "parse.y" { sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy442, yymsp[-9].minor.yy392, &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy392); } #line 3263 "parse.c" break; case 243: /* uniqueflag ::= UNIQUE */ case 296: /* raisetype ::= ABORT */ yytestcase(yyruleno==296); #line 1134 "parse.y" {yygotominor.yy392 = OE_Abort;} #line 3269 "parse.c" break; case 244: /* uniqueflag ::= */ #line 1135 "parse.y" {yygotominor.yy392 = OE_None;} #line 3274 "parse.c" break; case 247: /* idxlist ::= idxlist COMMA nm collate sortorder */ #line 1144 "parse.y" { Expr *p = 0; if( yymsp[-1].minor.yy0.n>0 ){ p = sqlite3Expr(pParse->db, TK_COLUMN, 0); sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); } yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, p); sqlite3ExprListSetName(pParse,yygotominor.yy442,&yymsp[-2].minor.yy0,1); sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index"); if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392; } #line 3289 "parse.c" break; case 248: /* idxlist ::= nm collate sortorder */ #line 1155 "parse.y" { Expr *p = 0; if( yymsp[-1].minor.yy0.n>0 ){ p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); } yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, p); sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index"); if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392; } #line 3304 "parse.c" break; case 249: /* collate ::= */ #line 1168 "parse.y" {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} #line 3309 "parse.c" break; case 251: /* cmd ::= DROP INDEX ifexists fullname */ #line 1174 "parse.y" {sqlite3DropIndex(pParse, yymsp[0].minor.yy347, yymsp[-1].minor.yy392);} #line 3314 "parse.c" break; case 252: /* cmd ::= VACUUM */ case 253: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==253); #line 1180 "parse.y" {sqlite3Vacuum(pParse);} #line 3320 "parse.c" break; case 254: /* cmd ::= PRAGMA nm dbnm */ #line 1188 "parse.y" {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} #line 3325 "parse.c" break; case 255: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ #line 1189 "parse.y" {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} #line 3330 "parse.c" break; case 256: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ #line 1190 "parse.y" {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} #line 3335 "parse.c" break; case 257: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ #line 1192 "parse.y" {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} #line 3340 "parse.c" break; case 258: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ #line 1194 "parse.y" {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} #line 3345 "parse.c" break; case 268: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ #line 1211 "parse.y" { Token all; all.z = yymsp[-3].minor.yy0.z; all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy327, &all); } #line 3355 "parse.c" break; case 269: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ #line 1220 "parse.y" { sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy392, yymsp[-4].minor.yy410.a, yymsp[-4].minor.yy410.b, yymsp[-2].minor.yy347, yymsp[0].minor.yy122, yymsp[-10].minor.yy392, yymsp[-8].minor.yy392); yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); } #line 3363 "parse.c" break; case 270: /* trigger_time ::= BEFORE */ case 273: /* trigger_time ::= */ yytestcase(yyruleno==273); #line 1226 "parse.y" { yygotominor.yy392 = TK_BEFORE; } #line 3369 "parse.c" break; case 271: /* trigger_time ::= AFTER */ #line 1227 "parse.y" { yygotominor.yy392 = TK_AFTER; } #line 3374 "parse.c" break; case 272: /* trigger_time ::= INSTEAD OF */ #line 1228 "parse.y" { yygotominor.yy392 = TK_INSTEAD;} #line 3379 "parse.c" break; case 274: /* trigger_event ::= DELETE|INSERT */ case 275: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==275); #line 1233 "parse.y" {yygotominor.yy410.a = yymsp[0].major; yygotominor.yy410.b = 0;} #line 3385 "parse.c" break; case 276: /* trigger_event ::= UPDATE OF inscollist */ #line 1235 "parse.y" {yygotominor.yy410.a = TK_UPDATE; yygotominor.yy410.b = yymsp[0].minor.yy180;} #line 3390 "parse.c" break; case 279: /* when_clause ::= */ case 301: /* key_opt ::= */ yytestcase(yyruleno==301); #line 1242 "parse.y" { yygotominor.yy122 = 0; } #line 3396 "parse.c" break; case 280: /* when_clause ::= WHEN expr */ case 302: /* key_opt ::= KEY expr */ yytestcase(yyruleno==302); #line 1243 "parse.y" { yygotominor.yy122 = yymsp[0].minor.yy342.pExpr; } #line 3402 "parse.c" break; case 281: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ #line 1247 "parse.y" { assert( yymsp[-2].minor.yy327!=0 ); yymsp[-2].minor.yy327->pLast->pNext = yymsp[-1].minor.yy327; yymsp[-2].minor.yy327->pLast = yymsp[-1].minor.yy327; yygotominor.yy327 = yymsp[-2].minor.yy327; } #line 3412 "parse.c" break; case 282: /* trigger_cmd_list ::= trigger_cmd SEMI */ #line 1253 "parse.y" { assert( yymsp[-1].minor.yy327!=0 ); yymsp[-1].minor.yy327->pLast = yymsp[-1].minor.yy327; yygotominor.yy327 = yymsp[-1].minor.yy327; } #line 3421 "parse.c" break; case 284: /* trnm ::= nm DOT nm */ #line 1265 "parse.y" { yygotominor.yy0 = yymsp[0].minor.yy0; sqlite3ErrorMsg(pParse, "qualified table names are not allowed on INSERT, UPDATE, and DELETE " "statements within triggers"); } #line 3431 "parse.c" break; case 286: /* tridxby ::= INDEXED BY nm */ #line 1277 "parse.y" { sqlite3ErrorMsg(pParse, "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " "within triggers"); } #line 3440 "parse.c" break; case 287: /* tridxby ::= NOT INDEXED */ #line 1282 "parse.y" { sqlite3ErrorMsg(pParse, "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " "within triggers"); } #line 3449 "parse.c" break; case 288: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */ #line 1295 "parse.y" { yygotominor.yy327 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy442, yymsp[0].minor.yy122, yymsp[-5].minor.yy258); } #line 3454 "parse.c" break; case 289: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist */ #line 1300 "parse.y" {yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy180, yymsp[0].minor.yy487.pList, yymsp[0].minor.yy487.pSelect, yymsp[-4].minor.yy258);} #line 3459 "parse.c" break; case 290: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ #line 1303 "parse.y" {yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy180, 0, yymsp[0].minor.yy159, yymsp[-4].minor.yy258);} #line 3464 "parse.c" break; case 291: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ #line 1307 "parse.y" {yygotominor.yy327 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy122);} #line 3469 "parse.c" break; case 292: /* trigger_cmd ::= select */ #line 1310 "parse.y" {yygotominor.yy327 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy159); } #line 3474 "parse.c" break; case 293: /* expr ::= RAISE LP IGNORE RP */ #line 1313 "parse.y" { yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); if( yygotominor.yy342.pExpr ){ yygotominor.yy342.pExpr->affinity = OE_Ignore; } yygotominor.yy342.zStart = yymsp[-3].minor.yy0.z; yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } #line 3486 "parse.c" break; case 294: /* expr ::= RAISE LP raisetype COMMA nm RP */ #line 1321 "parse.y" { yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); if( yygotominor.yy342.pExpr ) { yygotominor.yy342.pExpr->affinity = (char)yymsp[-3].minor.yy392; } yygotominor.yy342.zStart = yymsp[-5].minor.yy0.z; yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } #line 3498 "parse.c" break; case 295: /* raisetype ::= ROLLBACK */ #line 1332 "parse.y" {yygotominor.yy392 = OE_Rollback;} #line 3503 "parse.c" break; case 297: /* raisetype ::= FAIL */ #line 1334 "parse.y" {yygotominor.yy392 = OE_Fail;} #line 3508 "parse.c" break; case 298: /* cmd ::= DROP TRIGGER ifexists fullname */ #line 1339 "parse.y" { sqlite3DropTrigger(pParse,yymsp[0].minor.yy347,yymsp[-1].minor.yy392); } #line 3515 "parse.c" break; case 299: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ #line 1346 "parse.y" { sqlite3Attach(pParse, yymsp[-3].minor.yy342.pExpr, yymsp[-1].minor.yy342.pExpr, yymsp[0].minor.yy122); } #line 3522 "parse.c" break; case 300: /* cmd ::= DETACH database_kw_opt expr */ #line 1349 "parse.y" { sqlite3Detach(pParse, yymsp[0].minor.yy342.pExpr); } #line 3529 "parse.c" break; case 305: /* cmd ::= REINDEX */ #line 1364 "parse.y" {sqlite3Reindex(pParse, 0, 0);} #line 3534 "parse.c" break; case 306: /* cmd ::= REINDEX nm dbnm */ #line 1365 "parse.y" {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} #line 3539 "parse.c" break; case 307: /* cmd ::= ANALYZE */ #line 1370 "parse.y" {sqlite3Analyze(pParse, 0, 0);} #line 3544 "parse.c" break; case 308: /* cmd ::= ANALYZE nm dbnm */ #line 1371 "parse.y" {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} #line 3549 "parse.c" break; case 309: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ #line 1376 "parse.y" { sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy347,&yymsp[0].minor.yy0); } #line 3556 "parse.c" break; case 310: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ #line 1379 "parse.y" { sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); } #line 3563 "parse.c" break; case 311: /* add_column_fullname ::= fullname */ #line 1382 "parse.y" { pParse->db->lookaside.bEnabled = 0; sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy347); } #line 3571 "parse.c" break; case 314: /* cmd ::= create_vtab */ #line 1392 "parse.y" {sqlite3VtabFinishParse(pParse,0);} #line 3576 "parse.c" break; case 315: /* cmd ::= create_vtab LP vtabarglist RP */ #line 1393 "parse.y" {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} #line 3581 "parse.c" break; case 316: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ #line 1395 "parse.y" { sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy392); } #line 3588 "parse.c" break; case 319: /* vtabarg ::= */ #line 1400 "parse.y" {sqlite3VtabArgInit(pParse);} #line 3593 "parse.c" break; case 321: /* vtabargtoken ::= ANY */ case 322: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==322); case 323: /* lp ::= LP */ yytestcase(yyruleno==323); #line 1402 "parse.y" {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} #line 3600 "parse.c" break; default: /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1); /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2); /* (3) ecmd ::= SEMI */ yytestcase(yyruleno==3); /* (4) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==4); /* (10) trans_opt ::= */ yytestcase(yyruleno==10); /* (11) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==11); /* (12) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==12); /* (20) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==20); /* (21) savepoint_opt ::= */ yytestcase(yyruleno==21); /* (25) cmd ::= create_table create_table_args */ yytestcase(yyruleno==25); /* (34) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==34); /* (35) columnlist ::= column */ yytestcase(yyruleno==35); /* (44) type ::= */ yytestcase(yyruleno==44); /* (51) signed ::= plus_num */ yytestcase(yyruleno==51); /* (52) signed ::= minus_num */ yytestcase(yyruleno==52); /* (53) carglist ::= carglist carg */ yytestcase(yyruleno==53); /* (54) carglist ::= */ yytestcase(yyruleno==54); /* (55) carg ::= CONSTRAINT nm ccons */ yytestcase(yyruleno==55); /* (56) carg ::= ccons */ yytestcase(yyruleno==56); /* (62) ccons ::= NULL onconf */ yytestcase(yyruleno==62); /* (90) conslist ::= conslist COMMA tcons */ yytestcase(yyruleno==90); /* (91) conslist ::= conslist tcons */ yytestcase(yyruleno==91); /* (92) conslist ::= tcons */ yytestcase(yyruleno==92); /* (93) tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==93); /* (277) foreach_clause ::= */ yytestcase(yyruleno==277); /* (278) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==278); /* (285) tridxby ::= */ yytestcase(yyruleno==285); /* (303) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==303); /* (304) database_kw_opt ::= */ yytestcase(yyruleno==304); /* (312) kwcolumn_opt ::= */ yytestcase(yyruleno==312); /* (313) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==313); /* (317) vtabarglist ::= vtabarg */ yytestcase(yyruleno==317); /* (318) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==318); /* (320) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==320); /* (324) anylist ::= */ yytestcase(yyruleno==324); /* (325) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==325); /* (326) anylist ::= anylist ANY */ yytestcase(yyruleno==326); break; }; yygoto = yyRuleInfo[yyruleno].lhs; yysize = yyRuleInfo[yyruleno].nrhs; yypParser->yyidx -= yysize; yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto); if( yyact < YYNSTATE ){ #ifdef NDEBUG /* If we are not debugging and the reduce action popped at least ** one element off the stack, then we can push the new element back ** onto the stack here, and skip the stack overflow test in yy_shift(). ** That gives a significant speed improvement. */ if( yysize ){ yypParser->yyidx++; yymsp -= yysize-1; yymsp->stateno = (YYACTIONTYPE)yyact; yymsp->major = (YYCODETYPE)yygoto; yymsp->minor = yygotominor; }else #endif { yy_shift(yypParser,yyact,yygoto,&yygotominor); } }else{ assert( yyact == YYNSTATE + YYNRULE + 1 ); yy_accept(yypParser); } } /* ** The following code executes when the parse fails */ #ifndef YYNOERRORRECOVERY static void yy_parse_failed( yyParser *yypParser /* The parser */ ){ sqlite3ParserARG_FETCH; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); } #endif while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); /* Here code is inserted which will be executed whenever the ** parser fails */ sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ } #endif /* YYNOERRORRECOVERY */ /* ** The following code executes when a syntax error first occurs. */ static void yy_syntax_error( yyParser *yypParser, /* The parser */ int yymajor, /* The major type of the error token */ YYMINORTYPE yyminor /* The minor type of the error token */ ){ sqlite3ParserARG_FETCH; #define TOKEN (yyminor.yy0) #line 32 "parse.y" UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */ assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); #line 3705 "parse.c" sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ } /* ** The following is executed when the parser accepts */ static void yy_accept( yyParser *yypParser /* The parser */ ){ sqlite3ParserARG_FETCH; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); } #endif while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); /* Here code is inserted which will be executed whenever the ** parser accepts */ sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ } /* The main parser program. ** The first argument is a pointer to a structure obtained from ** "sqlite3ParserAlloc" which describes the current state of the parser. ** The second argument is the major token number. The third is ** the minor token. The fourth optional argument is whatever the ** user wants (and specified in the grammar) and is available for ** use by the action routines. ** ** Inputs: **
    **
  • A pointer to the parser (an opaque structure.) **
  • The major token number. **
  • The minor token number. **
  • An option argument of a grammar-specified type. **
** ** Outputs: ** None. */ void sqlite3Parser( void *yyp, /* The parser */ int yymajor, /* The major token code number */ sqlite3ParserTOKENTYPE yyminor /* The value for the token */ sqlite3ParserARG_PDECL /* Optional %extra_argument parameter */ ){ YYMINORTYPE yyminorunion; int yyact; /* The parser action. */ #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) int yyendofinput; /* True if we are at the end of input */ #endif #ifdef YYERRORSYMBOL int yyerrorhit = 0; /* True if yymajor has invoked an error */ #endif yyParser *yypParser; /* The parser */ /* (re)initialize the parser, if necessary */ yypParser = (yyParser*)yyp; if( yypParser->yyidx<0 ){ #if YYSTACKDEPTH<=0 if( yypParser->yystksz <=0 ){ /*memset(&yyminorunion, 0, sizeof(yyminorunion));*/ yyminorunion = yyzerominor; yyStackOverflow(yypParser, &yyminorunion); return; } #endif yypParser->yyidx = 0; yypParser->yyerrcnt = -1; yypParser->yystack[0].stateno = 0; yypParser->yystack[0].major = 0; } yyminorunion.yy0 = yyminor; #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor==0); #endif sqlite3ParserARG_STORE; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); } #endif do{ yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); if( yyactyyerrcnt--; yymajor = YYNOCODE; }else if( yyact < YYNSTATE + YYNRULE ){ yy_reduce(yypParser,yyact-YYNSTATE); }else{ assert( yyact == YY_ERROR_ACTION ); #ifdef YYERRORSYMBOL int yymx; #endif #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); } #endif #ifdef YYERRORSYMBOL /* A syntax error has occurred. ** The response to an error depends upon whether or not the ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: ** ** * Call the %syntax_error function. ** ** * Begin popping the stack until we enter a state where ** it is legal to shift the error symbol, then shift ** the error symbol. ** ** * Set the error count to three. ** ** * Begin accepting and shifting new tokens. No new error ** processing will occur until three tokens have been ** shifted successfully. ** */ if( yypParser->yyerrcnt<0 ){ yy_syntax_error(yypParser,yymajor,yyminorunion); } yymx = yypParser->yystack[yypParser->yyidx].major; if( yymx==YYERRORSYMBOL || yyerrorhit ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sDiscard input token %s\n", yyTracePrompt,yyTokenName[yymajor]); } #endif yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion); yymajor = YYNOCODE; }else{ while( yypParser->yyidx >= 0 && yymx != YYERRORSYMBOL && (yyact = yy_find_reduce_action( yypParser->yystack[yypParser->yyidx].stateno, YYERRORSYMBOL)) >= YYNSTATE ){ yy_pop_parser_stack(yypParser); } if( yypParser->yyidx < 0 || yymajor==0 ){ yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_parse_failed(yypParser); yymajor = YYNOCODE; }else if( yymx!=YYERRORSYMBOL ){ YYMINORTYPE u2; u2.YYERRSYMDT = 0; yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); } } yypParser->yyerrcnt = 3; yyerrorhit = 1; #elif defined(YYNOERRORRECOVERY) /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to ** do any kind of error recovery. Instead, simply invoke the syntax ** error routine and continue going as if nothing had happened. ** ** Applications can set this macro (for example inside %include) if ** they intend to abandon the parse upon the first syntax error seen. */ yy_syntax_error(yypParser,yymajor,yyminorunion); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yymajor = YYNOCODE; #else /* YYERRORSYMBOL is not defined */ /* This is what we do if the grammar does not define ERROR: ** ** * Report an error message, and throw away the input token. ** ** * If the input token is $, then fail the parse. ** ** As before, subsequent error messages are suppressed until ** three input tokens have been successfully shifted. */ if( yypParser->yyerrcnt<=0 ){ yy_syntax_error(yypParser,yymajor,yyminorunion); } yypParser->yyerrcnt = 3; yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); if( yyendofinput ){ yy_parse_failed(yypParser); } yymajor = YYNOCODE; #endif } }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); return; }