sl@0: /* Driver template for the LEMON parser generator. sl@0: ** The author disclaims copyright to this source code. sl@0: */ sl@0: /* First off, code is included that follows the "include" declaration sl@0: ** in the input grammar file. */ sl@0: #include sl@0: #line 51 "parse.y" sl@0: sl@0: #include "sqliteInt.h" sl@0: sl@0: /* sl@0: ** An instance of this structure holds information about the sl@0: ** LIMIT clause of a SELECT statement. sl@0: */ sl@0: struct LimitVal { sl@0: Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */ sl@0: Expr *pOffset; /* The OFFSET expression. NULL if there is none */ sl@0: }; sl@0: sl@0: /* sl@0: ** An instance of this structure is used to store the LIKE, sl@0: ** GLOB, NOT LIKE, and NOT GLOB operators. sl@0: */ sl@0: struct LikeOp { sl@0: Token eOperator; /* "like" or "glob" or "regexp" */ sl@0: int not; /* True if the NOT keyword is present */ sl@0: }; sl@0: sl@0: /* sl@0: ** An instance of the following structure describes the event of a sl@0: ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, sl@0: ** TK_DELETE, or TK_INSTEAD. If the event is of the form sl@0: ** sl@0: ** UPDATE ON (a,b,c) sl@0: ** sl@0: ** Then the "b" IdList records the list "a,b,c". sl@0: */ sl@0: struct TrigEvent { int a; IdList * b; }; sl@0: sl@0: /* sl@0: ** An instance of this structure holds the ATTACH key and the key type. sl@0: */ sl@0: struct AttachKey { int type; Token key; }; sl@0: sl@0: #line 48 "parse.c" sl@0: /* Next is all token values, in a form suitable for use by makeheaders. sl@0: ** This section will be null unless lemon is run with the -m switch. sl@0: */ sl@0: /* sl@0: ** These constants (all generated automatically by the parser generator) sl@0: ** specify the various kinds of tokens (terminals) that the parser sl@0: ** understands. sl@0: ** sl@0: ** Each symbol here is a terminal symbol in the grammar. sl@0: */ sl@0: /* Make sure the INTERFACE macro is defined. sl@0: */ sl@0: #ifndef INTERFACE sl@0: # define INTERFACE 1 sl@0: #endif sl@0: /* The next thing included is series of defines which control sl@0: ** various aspects of the generated parser. sl@0: ** YYCODETYPE is the data type used for storing terminal sl@0: ** and nonterminal numbers. "unsigned char" is sl@0: ** used if there are fewer than 250 terminals sl@0: ** and nonterminals. "int" is used otherwise. sl@0: ** YYNOCODE is a number of type YYCODETYPE which corresponds sl@0: ** to no legal terminal or nonterminal number. This sl@0: ** number is used to fill in empty slots of the hash sl@0: ** table. sl@0: ** YYFALLBACK If defined, this indicates that one or more tokens sl@0: ** have fall-back values which should be used if the sl@0: ** original value of the token will not parse. sl@0: ** YYACTIONTYPE is the data type used for storing terminal sl@0: ** and nonterminal numbers. "unsigned char" is sl@0: ** used if there are fewer than 250 rules and sl@0: ** states combined. "int" is used otherwise. sl@0: ** sqlite3ParserTOKENTYPE is the data type used for minor tokens given sl@0: ** directly to the parser from the tokenizer. sl@0: ** YYMINORTYPE is the data type used for all minor tokens. sl@0: ** This is typically a union of many types, one of sl@0: ** which is sqlite3ParserTOKENTYPE. The entry in the union sl@0: ** for base tokens is called "yy0". sl@0: ** YYSTACKDEPTH is the maximum depth of the parser's stack. If sl@0: ** zero the stack is dynamically sized using realloc() sl@0: ** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument sl@0: ** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument sl@0: ** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser sl@0: ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser sl@0: ** YYNSTATE the combined number of states. sl@0: ** YYNRULE the number of rules in the grammar sl@0: ** YYERRORSYMBOL is the code number of the error symbol. If not sl@0: ** defined, then do no error processing. sl@0: */ sl@0: #define YYCODETYPE unsigned char sl@0: #define YYNOCODE 243 sl@0: #define YYACTIONTYPE unsigned short int sl@0: #define YYWILDCARD 59 sl@0: #define sqlite3ParserTOKENTYPE Token sl@0: typedef union { sl@0: sqlite3ParserTOKENTYPE yy0; sl@0: struct LikeOp yy30; sl@0: Select* yy91; sl@0: IdList* yy232; sl@0: struct {int value; int mask;} yy319; sl@0: ExprList* yy322; sl@0: int yy328; sl@0: struct TrigEvent yy378; sl@0: struct LimitVal yy388; sl@0: Expr* yy418; sl@0: SrcList* yy439; sl@0: TriggerStep* yy451; sl@0: } YYMINORTYPE; sl@0: #ifndef YYSTACKDEPTH sl@0: #define YYSTACKDEPTH 100 sl@0: #endif sl@0: #define sqlite3ParserARG_SDECL Parse *pParse; sl@0: #define sqlite3ParserARG_PDECL ,Parse *pParse sl@0: #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse sl@0: #define sqlite3ParserARG_STORE yypParser->pParse = pParse sl@0: #define YYNSTATE 578 sl@0: #define YYNRULE 303 sl@0: #define YYFALLBACK 1 sl@0: #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) sl@0: #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) sl@0: #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) sl@0: sl@0: /* The yyzerominor constant is used to initialize instances of sl@0: ** YYMINORTYPE objects to zero. */ sl@0: #ifdef __cplusplus sl@0: static YYMINORTYPE yyzerominor; sl@0: #else sl@0: static const YYMINORTYPE yyzerominor; sl@0: #endif sl@0: sl@0: /* Next are the tables used to determine what action to take based on the sl@0: ** current state and lookahead token. These tables are used to implement sl@0: ** functions that take a state number and lookahead value and return an sl@0: ** action integer. sl@0: ** sl@0: ** Suppose the action integer is N. Then the action is determined as sl@0: ** follows sl@0: ** sl@0: ** 0 <= N < YYNSTATE Shift N. That is, push the lookahead sl@0: ** token onto the stack and goto state N. sl@0: ** sl@0: ** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. sl@0: ** sl@0: ** N == YYNSTATE+YYNRULE A syntax error has occurred. sl@0: ** sl@0: ** N == YYNSTATE+YYNRULE+1 The parser accepts its input. sl@0: ** sl@0: ** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused sl@0: ** slots in the yy_action[] table. sl@0: ** sl@0: ** The action table is constructed as a single large table named yy_action[]. sl@0: ** Given state S and lookahead X, the action is computed as sl@0: ** sl@0: ** yy_action[ yy_shift_ofst[S] + X ] sl@0: ** sl@0: ** If the index value yy_shift_ofst[S]+X is out of range or if the value sl@0: ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] sl@0: ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table sl@0: ** and that yy_default[S] should be used instead. sl@0: ** sl@0: ** The formula above is for computing the action when the lookahead is sl@0: ** a terminal symbol. If the lookahead is a non-terminal (as occurs after sl@0: ** a reduce action) then the yy_reduce_ofst[] array is used in place of sl@0: ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of sl@0: ** YY_SHIFT_USE_DFLT. sl@0: ** sl@0: ** The following are the tables generated in this section: sl@0: ** sl@0: ** yy_action[] A single table containing all actions. sl@0: ** yy_lookahead[] A table containing the lookahead for each entry in sl@0: ** yy_action. Used to detect hash collisions. sl@0: ** yy_shift_ofst[] For each state, the offset into yy_action for sl@0: ** shifting terminals. sl@0: ** yy_reduce_ofst[] For each state, the offset into yy_action for sl@0: ** shifting non-terminals after a reduce. sl@0: ** yy_default[] Default action for each state. sl@0: */ sl@0: static const YYACTIONTYPE yy_action[] = { sl@0: /* 0 */ 288, 882, 118, 577, 2, 169, 412, 412, 62, 62, sl@0: /* 10 */ 62, 62, 205, 64, 64, 64, 64, 65, 65, 66, sl@0: /* 20 */ 66, 66, 67, 207, 385, 382, 419, 425, 69, 64, sl@0: /* 30 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 207, sl@0: /* 40 */ 445, 443, 317, 165, 61, 60, 293, 429, 430, 426, sl@0: /* 50 */ 426, 63, 63, 62, 62, 62, 62, 251, 64, 64, sl@0: /* 60 */ 64, 64, 65, 65, 66, 66, 66, 67, 207, 288, sl@0: /* 70 */ 485, 412, 412, 207, 414, 83, 68, 456, 70, 151, sl@0: /* 80 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, sl@0: /* 90 */ 207, 68, 299, 70, 151, 419, 425, 441, 209, 59, sl@0: /* 100 */ 65, 65, 66, 66, 66, 67, 207, 416, 416, 416, sl@0: /* 110 */ 484, 569, 288, 61, 60, 293, 429, 430, 426, 426, sl@0: /* 120 */ 63, 63, 62, 62, 62, 62, 311, 64, 64, 64, sl@0: /* 130 */ 64, 65, 65, 66, 66, 66, 67, 207, 419, 425, sl@0: /* 140 */ 95, 66, 66, 66, 67, 207, 390, 263, 408, 35, sl@0: /* 150 */ 57, 22, 472, 172, 404, 412, 61, 60, 293, 429, sl@0: /* 160 */ 430, 426, 426, 63, 63, 62, 62, 62, 62, 162, sl@0: /* 170 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, sl@0: /* 180 */ 207, 288, 578, 385, 382, 567, 109, 409, 264, 445, sl@0: /* 190 */ 403, 325, 307, 387, 486, 311, 336, 204, 514, 173, sl@0: /* 200 */ 157, 441, 209, 566, 197, 334, 230, 419, 425, 146, sl@0: /* 210 */ 147, 391, 392, 68, 295, 70, 151, 408, 42, 485, sl@0: /* 220 */ 412, 563, 564, 414, 288, 61, 60, 293, 429, 430, sl@0: /* 230 */ 426, 426, 63, 63, 62, 62, 62, 62, 409, 64, sl@0: /* 240 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 207, sl@0: /* 250 */ 419, 425, 402, 517, 527, 263, 416, 416, 416, 211, sl@0: /* 260 */ 545, 514, 612, 374, 520, 377, 208, 288, 61, 60, sl@0: /* 270 */ 293, 429, 430, 426, 426, 63, 63, 62, 62, 62, sl@0: /* 280 */ 62, 567, 64, 64, 64, 64, 65, 65, 66, 66, sl@0: /* 290 */ 66, 67, 207, 419, 425, 519, 379, 296, 544, 566, sl@0: /* 300 */ 565, 229, 468, 285, 529, 21, 443, 518, 165, 67, sl@0: /* 310 */ 207, 61, 60, 293, 429, 430, 426, 426, 63, 63, sl@0: /* 320 */ 62, 62, 62, 62, 468, 64, 64, 64, 64, 65, sl@0: /* 330 */ 65, 66, 66, 66, 67, 207, 526, 501, 237, 450, sl@0: /* 340 */ 78, 213, 288, 525, 296, 519, 480, 381, 369, 269, sl@0: /* 350 */ 268, 451, 390, 205, 401, 21, 322, 149, 311, 205, sl@0: /* 360 */ 463, 562, 208, 241, 452, 219, 321, 368, 419, 425, sl@0: /* 370 */ 156, 161, 114, 243, 339, 248, 340, 174, 148, 528, sl@0: /* 380 */ 408, 36, 330, 81, 252, 238, 61, 60, 293, 429, sl@0: /* 390 */ 430, 426, 426, 63, 63, 62, 62, 62, 62, 5, sl@0: /* 400 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, sl@0: /* 410 */ 207, 288, 219, 489, 490, 483, 390, 391, 392, 114, sl@0: /* 420 */ 243, 339, 248, 340, 174, 180, 311, 155, 341, 344, sl@0: /* 430 */ 345, 252, 519, 236, 152, 384, 2, 419, 425, 346, sl@0: /* 440 */ 180, 574, 21, 341, 344, 345, 206, 390, 408, 35, sl@0: /* 450 */ 225, 468, 463, 56, 346, 61, 60, 293, 429, 430, sl@0: /* 460 */ 426, 426, 63, 63, 62, 62, 62, 62, 409, 64, sl@0: /* 470 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 207, sl@0: /* 480 */ 288, 391, 392, 180, 500, 487, 341, 344, 345, 312, sl@0: /* 490 */ 476, 325, 337, 311, 405, 311, 324, 346, 542, 490, sl@0: /* 500 */ 420, 421, 441, 150, 168, 157, 419, 425, 68, 544, sl@0: /* 510 */ 70, 151, 391, 392, 389, 408, 42, 408, 28, 407, sl@0: /* 520 */ 198, 423, 424, 406, 61, 60, 293, 429, 430, 426, sl@0: /* 530 */ 426, 63, 63, 62, 62, 62, 62, 409, 64, 64, sl@0: /* 540 */ 64, 64, 65, 65, 66, 66, 66, 67, 207, 288, sl@0: /* 550 */ 422, 311, 450, 255, 409, 349, 327, 212, 311, 369, sl@0: /* 560 */ 269, 268, 115, 479, 451, 311, 393, 394, 395, 433, sl@0: /* 570 */ 205, 415, 191, 408, 50, 419, 425, 452, 472, 491, sl@0: /* 580 */ 408, 50, 175, 539, 535, 356, 535, 408, 35, 492, sl@0: /* 590 */ 294, 436, 437, 61, 60, 293, 429, 430, 426, 426, sl@0: /* 600 */ 63, 63, 62, 62, 62, 62, 409, 64, 64, 64, sl@0: /* 610 */ 64, 65, 65, 66, 66, 66, 67, 207, 288, 442, sl@0: /* 620 */ 304, 251, 1, 94, 10, 537, 390, 305, 390, 536, sl@0: /* 630 */ 329, 367, 316, 436, 437, 472, 169, 290, 412, 407, sl@0: /* 640 */ 357, 358, 252, 406, 419, 425, 439, 439, 18, 314, sl@0: /* 650 */ 323, 432, 432, 370, 208, 314, 220, 432, 432, 541, sl@0: /* 660 */ 272, 288, 61, 60, 293, 429, 430, 426, 426, 63, sl@0: /* 670 */ 63, 62, 62, 62, 62, 390, 64, 64, 64, 64, sl@0: /* 680 */ 65, 65, 66, 66, 66, 67, 207, 419, 425, 446, sl@0: /* 690 */ 454, 391, 392, 391, 392, 462, 208, 303, 275, 817, sl@0: /* 700 */ 273, 291, 191, 412, 288, 61, 60, 293, 429, 430, sl@0: /* 710 */ 426, 426, 63, 63, 62, 62, 62, 62, 366, 64, sl@0: /* 720 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 207, sl@0: /* 730 */ 419, 425, 478, 175, 333, 314, 409, 432, 432, 458, sl@0: /* 740 */ 391, 392, 176, 177, 178, 195, 459, 288, 61, 71, sl@0: /* 750 */ 293, 429, 430, 426, 426, 63, 63, 62, 62, 62, sl@0: /* 760 */ 62, 367, 64, 64, 64, 64, 65, 65, 66, 66, sl@0: /* 770 */ 66, 67, 207, 419, 425, 314, 359, 432, 432, 409, sl@0: /* 780 */ 274, 362, 467, 363, 221, 257, 251, 251, 290, 251, sl@0: /* 790 */ 288, 503, 60, 293, 429, 430, 426, 426, 63, 63, sl@0: /* 800 */ 62, 62, 62, 62, 335, 64, 64, 64, 64, 65, sl@0: /* 810 */ 65, 66, 66, 66, 67, 207, 419, 425, 390, 471, sl@0: /* 820 */ 390, 300, 301, 261, 302, 259, 408, 3, 77, 153, sl@0: /* 830 */ 79, 263, 366, 332, 182, 473, 293, 429, 430, 426, sl@0: /* 840 */ 426, 63, 63, 62, 62, 62, 62, 311, 64, 64, sl@0: /* 850 */ 64, 64, 65, 65, 66, 66, 66, 67, 207, 73, sl@0: /* 860 */ 318, 179, 4, 409, 263, 311, 292, 263, 409, 408, sl@0: /* 870 */ 29, 311, 552, 311, 315, 73, 318, 311, 4, 508, sl@0: /* 880 */ 311, 509, 292, 391, 392, 391, 392, 408, 24, 185, sl@0: /* 890 */ 315, 320, 263, 408, 33, 408, 54, 311, 224, 408, sl@0: /* 900 */ 53, 445, 408, 99, 311, 554, 311, 320, 555, 464, sl@0: /* 910 */ 20, 465, 142, 249, 263, 193, 502, 445, 311, 408, sl@0: /* 920 */ 97, 76, 75, 409, 263, 506, 408, 102, 408, 103, sl@0: /* 930 */ 74, 309, 310, 556, 313, 414, 498, 76, 75, 477, sl@0: /* 940 */ 408, 108, 376, 188, 311, 507, 74, 309, 310, 73, sl@0: /* 950 */ 318, 414, 4, 205, 311, 222, 292, 311, 495, 496, sl@0: /* 960 */ 311, 205, 263, 244, 315, 223, 408, 110, 416, 416, sl@0: /* 970 */ 416, 417, 418, 12, 245, 375, 408, 17, 250, 408, sl@0: /* 980 */ 100, 320, 408, 34, 416, 416, 416, 417, 418, 12, sl@0: /* 990 */ 461, 445, 434, 159, 23, 311, 521, 298, 226, 227, sl@0: /* 1000 */ 228, 105, 256, 278, 311, 470, 311, 170, 311, 258, sl@0: /* 1010 */ 427, 76, 75, 260, 202, 85, 280, 408, 98, 353, sl@0: /* 1020 */ 74, 309, 310, 281, 311, 414, 408, 25, 408, 55, sl@0: /* 1030 */ 408, 111, 311, 262, 311, 200, 510, 544, 179, 505, sl@0: /* 1040 */ 504, 199, 311, 231, 201, 311, 408, 112, 311, 254, sl@0: /* 1050 */ 311, 179, 311, 267, 408, 113, 408, 26, 416, 416, sl@0: /* 1060 */ 416, 417, 418, 12, 408, 37, 399, 408, 38, 311, sl@0: /* 1070 */ 408, 27, 408, 39, 408, 40, 348, 311, 179, 311, sl@0: /* 1080 */ 540, 145, 179, 548, 311, 170, 311, 372, 277, 268, sl@0: /* 1090 */ 311, 408, 41, 289, 549, 311, 92, 311, 205, 408, sl@0: /* 1100 */ 43, 408, 44, 311, 361, 311, 408, 45, 408, 30, sl@0: /* 1110 */ 19, 364, 408, 31, 559, 311, 92, 408, 46, 408, sl@0: /* 1120 */ 47, 311, 365, 378, 270, 408, 48, 408, 49, 311, sl@0: /* 1130 */ 271, 311, 561, 144, 279, 282, 438, 408, 32, 283, sl@0: /* 1140 */ 573, 413, 440, 408, 11, 319, 160, 501, 457, 239, sl@0: /* 1150 */ 460, 408, 51, 408, 52, 512, 547, 515, 276, 8, sl@0: /* 1160 */ 558, 388, 246, 511, 373, 396, 397, 513, 398, 7, sl@0: /* 1170 */ 343, 85, 308, 232, 328, 58, 233, 84, 80, 326, sl@0: /* 1180 */ 167, 455, 210, 119, 86, 338, 331, 410, 297, 494, sl@0: /* 1190 */ 498, 122, 488, 217, 493, 234, 247, 235, 286, 411, sl@0: /* 1200 */ 497, 350, 287, 499, 522, 516, 523, 240, 524, 469, sl@0: /* 1210 */ 242, 183, 475, 354, 89, 530, 184, 117, 352, 186, sl@0: /* 1220 */ 543, 130, 192, 187, 532, 189, 140, 371, 360, 131, sl@0: /* 1230 */ 216, 132, 133, 218, 550, 557, 134, 136, 306, 570, sl@0: /* 1240 */ 575, 571, 265, 572, 533, 386, 400, 613, 215, 139, sl@0: /* 1250 */ 93, 96, 107, 104, 614, 101, 163, 164, 428, 431, sl@0: /* 1260 */ 72, 447, 435, 444, 141, 154, 6, 448, 466, 449, sl@0: /* 1270 */ 166, 453, 14, 120, 82, 13, 171, 474, 121, 158, sl@0: /* 1280 */ 481, 482, 214, 87, 342, 123, 124, 116, 253, 88, sl@0: /* 1290 */ 125, 181, 245, 351, 143, 531, 126, 170, 355, 266, sl@0: /* 1300 */ 347, 190, 128, 9, 127, 546, 129, 90, 534, 15, sl@0: /* 1310 */ 538, 194, 196, 551, 553, 137, 138, 106, 135, 16, sl@0: /* 1320 */ 560, 568, 284, 203, 383, 883, 380, 576, 883, 883, sl@0: /* 1330 */ 883, 91, sl@0: }; sl@0: static const YYCODETYPE yy_lookahead[] = { sl@0: /* 0 */ 16, 140, 141, 142, 143, 21, 23, 23, 69, 70, sl@0: /* 10 */ 71, 72, 110, 74, 75, 76, 77, 78, 79, 80, sl@0: /* 20 */ 81, 82, 83, 84, 1, 2, 42, 43, 73, 74, sl@0: /* 30 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, sl@0: /* 40 */ 58, 162, 163, 164, 60, 61, 62, 63, 64, 65, sl@0: /* 50 */ 66, 67, 68, 69, 70, 71, 72, 148, 74, 75, sl@0: /* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16, sl@0: /* 70 */ 88, 88, 88, 84, 92, 22, 219, 220, 221, 222, sl@0: /* 80 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, sl@0: /* 90 */ 84, 219, 183, 221, 222, 42, 43, 78, 79, 46, sl@0: /* 100 */ 78, 79, 80, 81, 82, 83, 84, 125, 126, 127, sl@0: /* 110 */ 170, 239, 16, 60, 61, 62, 63, 64, 65, 66, sl@0: /* 120 */ 67, 68, 69, 70, 71, 72, 148, 74, 75, 76, sl@0: /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43, sl@0: /* 140 */ 44, 80, 81, 82, 83, 84, 23, 148, 170, 171, sl@0: /* 150 */ 19, 19, 148, 156, 23, 23, 60, 61, 62, 63, sl@0: /* 160 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 19, sl@0: /* 170 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, sl@0: /* 180 */ 84, 16, 0, 1, 2, 148, 21, 190, 189, 58, sl@0: /* 190 */ 169, 213, 144, 145, 170, 148, 218, 149, 177, 202, sl@0: /* 200 */ 203, 78, 79, 166, 156, 208, 191, 42, 43, 78, sl@0: /* 210 */ 79, 88, 89, 219, 210, 221, 222, 170, 171, 88, sl@0: /* 220 */ 88, 98, 99, 92, 16, 60, 61, 62, 63, 64, sl@0: /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 190, 74, sl@0: /* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, sl@0: /* 250 */ 42, 43, 168, 169, 182, 148, 125, 126, 127, 212, sl@0: /* 260 */ 11, 177, 112, 215, 182, 228, 229, 16, 60, 61, sl@0: /* 270 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, sl@0: /* 280 */ 72, 148, 74, 75, 76, 77, 78, 79, 80, 81, sl@0: /* 290 */ 82, 83, 84, 42, 43, 148, 189, 16, 49, 166, sl@0: /* 300 */ 167, 154, 162, 159, 157, 158, 162, 163, 164, 83, sl@0: /* 310 */ 84, 60, 61, 62, 63, 64, 65, 66, 67, 68, sl@0: /* 320 */ 69, 70, 71, 72, 162, 74, 75, 76, 77, 78, sl@0: /* 330 */ 79, 80, 81, 82, 83, 84, 177, 178, 148, 12, sl@0: /* 340 */ 132, 201, 16, 184, 16, 148, 20, 240, 99, 100, sl@0: /* 350 */ 101, 24, 23, 110, 157, 158, 187, 22, 148, 110, sl@0: /* 360 */ 22, 228, 229, 201, 37, 84, 39, 124, 42, 43, sl@0: /* 370 */ 148, 90, 91, 92, 93, 94, 95, 96, 181, 182, sl@0: /* 380 */ 170, 171, 148, 132, 103, 148, 60, 61, 62, 63, sl@0: /* 390 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 192, sl@0: /* 400 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, sl@0: /* 410 */ 84, 16, 84, 186, 187, 20, 23, 88, 89, 91, sl@0: /* 420 */ 92, 93, 94, 95, 96, 90, 148, 89, 93, 94, sl@0: /* 430 */ 95, 103, 148, 223, 156, 142, 143, 42, 43, 104, sl@0: /* 440 */ 90, 157, 158, 93, 94, 95, 193, 23, 170, 171, sl@0: /* 450 */ 146, 162, 114, 200, 104, 60, 61, 62, 63, 64, sl@0: /* 460 */ 65, 66, 67, 68, 69, 70, 71, 72, 190, 74, sl@0: /* 470 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, sl@0: /* 480 */ 16, 88, 89, 90, 20, 161, 93, 94, 95, 148, sl@0: /* 490 */ 201, 213, 80, 148, 170, 148, 218, 104, 186, 187, sl@0: /* 500 */ 42, 43, 78, 156, 202, 203, 42, 43, 219, 49, sl@0: /* 510 */ 221, 222, 88, 89, 148, 170, 171, 170, 171, 107, sl@0: /* 520 */ 156, 63, 64, 111, 60, 61, 62, 63, 64, 65, sl@0: /* 530 */ 66, 67, 68, 69, 70, 71, 72, 190, 74, 75, sl@0: /* 540 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16, sl@0: /* 550 */ 92, 148, 12, 20, 190, 16, 211, 212, 148, 99, sl@0: /* 560 */ 100, 101, 148, 20, 24, 148, 7, 8, 9, 20, sl@0: /* 570 */ 110, 148, 156, 170, 171, 42, 43, 37, 148, 39, sl@0: /* 580 */ 170, 171, 43, 18, 99, 100, 101, 170, 171, 49, sl@0: /* 590 */ 165, 166, 167, 60, 61, 62, 63, 64, 65, 66, sl@0: /* 600 */ 67, 68, 69, 70, 71, 72, 190, 74, 75, 76, sl@0: /* 610 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 162, sl@0: /* 620 */ 217, 148, 19, 21, 19, 25, 23, 217, 23, 29, sl@0: /* 630 */ 213, 215, 165, 166, 167, 148, 21, 98, 23, 107, sl@0: /* 640 */ 210, 41, 103, 111, 42, 43, 125, 126, 232, 106, sl@0: /* 650 */ 148, 108, 109, 237, 229, 106, 183, 108, 109, 94, sl@0: /* 660 */ 14, 16, 60, 61, 62, 63, 64, 65, 66, 67, sl@0: /* 670 */ 68, 69, 70, 71, 72, 23, 74, 75, 76, 77, sl@0: /* 680 */ 78, 79, 80, 81, 82, 83, 84, 42, 43, 20, sl@0: /* 690 */ 148, 88, 89, 88, 89, 204, 229, 210, 52, 134, sl@0: /* 700 */ 54, 151, 156, 88, 16, 60, 61, 62, 63, 64, sl@0: /* 710 */ 65, 66, 67, 68, 69, 70, 71, 72, 148, 74, sl@0: /* 720 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, sl@0: /* 730 */ 42, 43, 80, 43, 16, 106, 190, 108, 109, 27, sl@0: /* 740 */ 88, 89, 99, 100, 101, 156, 34, 16, 60, 61, sl@0: /* 750 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, sl@0: /* 760 */ 72, 215, 74, 75, 76, 77, 78, 79, 80, 81, sl@0: /* 770 */ 82, 83, 84, 42, 43, 106, 226, 108, 109, 190, sl@0: /* 780 */ 134, 231, 148, 237, 214, 14, 148, 148, 98, 148, sl@0: /* 790 */ 16, 179, 61, 62, 63, 64, 65, 66, 67, 68, sl@0: /* 800 */ 69, 70, 71, 72, 148, 74, 75, 76, 77, 78, sl@0: /* 810 */ 79, 80, 81, 82, 83, 84, 42, 43, 23, 148, sl@0: /* 820 */ 23, 183, 183, 52, 183, 54, 170, 171, 131, 156, sl@0: /* 830 */ 133, 148, 148, 115, 156, 148, 62, 63, 64, 65, sl@0: /* 840 */ 66, 67, 68, 69, 70, 71, 72, 148, 74, 75, sl@0: /* 850 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16, sl@0: /* 860 */ 17, 22, 19, 190, 148, 148, 23, 148, 190, 170, sl@0: /* 870 */ 171, 148, 189, 148, 31, 16, 17, 148, 19, 179, sl@0: /* 880 */ 148, 179, 23, 88, 89, 88, 89, 170, 171, 156, sl@0: /* 890 */ 31, 48, 148, 170, 171, 170, 171, 148, 214, 170, sl@0: /* 900 */ 171, 58, 170, 171, 148, 189, 148, 48, 189, 114, sl@0: /* 910 */ 19, 114, 21, 148, 148, 22, 148, 58, 148, 170, sl@0: /* 920 */ 171, 78, 79, 190, 148, 30, 170, 171, 170, 171, sl@0: /* 930 */ 87, 88, 89, 189, 16, 92, 97, 78, 79, 80, sl@0: /* 940 */ 170, 171, 91, 233, 148, 50, 87, 88, 89, 16, sl@0: /* 950 */ 17, 92, 19, 110, 148, 189, 23, 148, 7, 8, sl@0: /* 960 */ 148, 110, 148, 92, 31, 189, 170, 171, 125, 126, sl@0: /* 970 */ 127, 128, 129, 130, 103, 124, 170, 171, 148, 170, sl@0: /* 980 */ 171, 48, 170, 171, 125, 126, 127, 128, 129, 130, sl@0: /* 990 */ 22, 58, 20, 5, 22, 148, 148, 102, 10, 11, sl@0: /* 1000 */ 12, 13, 148, 189, 148, 20, 148, 22, 148, 148, sl@0: /* 1010 */ 92, 78, 79, 148, 26, 122, 28, 170, 171, 234, sl@0: /* 1020 */ 87, 88, 89, 35, 148, 92, 170, 171, 170, 171, sl@0: /* 1030 */ 170, 171, 148, 148, 148, 47, 20, 49, 22, 91, sl@0: /* 1040 */ 92, 53, 148, 194, 56, 148, 170, 171, 148, 20, sl@0: /* 1050 */ 148, 22, 148, 148, 170, 171, 170, 171, 125, 126, sl@0: /* 1060 */ 127, 128, 129, 130, 170, 171, 150, 170, 171, 148, sl@0: /* 1070 */ 170, 171, 170, 171, 170, 171, 20, 148, 22, 148, sl@0: /* 1080 */ 20, 113, 22, 20, 148, 22, 148, 99, 100, 101, sl@0: /* 1090 */ 148, 170, 171, 105, 20, 148, 22, 148, 110, 170, sl@0: /* 1100 */ 171, 170, 171, 148, 148, 148, 170, 171, 170, 171, sl@0: /* 1110 */ 19, 148, 170, 171, 20, 148, 22, 170, 171, 170, sl@0: /* 1120 */ 171, 148, 148, 135, 148, 170, 171, 170, 171, 148, sl@0: /* 1130 */ 148, 148, 148, 192, 148, 148, 230, 170, 171, 148, sl@0: /* 1140 */ 148, 162, 230, 170, 171, 225, 6, 178, 173, 205, sl@0: /* 1150 */ 173, 170, 171, 170, 171, 162, 195, 162, 205, 68, sl@0: /* 1160 */ 195, 147, 173, 173, 205, 147, 147, 173, 147, 22, sl@0: /* 1170 */ 174, 122, 155, 195, 119, 121, 196, 120, 131, 118, sl@0: /* 1180 */ 112, 153, 224, 153, 98, 98, 117, 190, 40, 180, sl@0: /* 1190 */ 97, 19, 172, 84, 172, 197, 172, 198, 175, 199, sl@0: /* 1200 */ 174, 15, 175, 172, 172, 180, 172, 206, 172, 207, sl@0: /* 1210 */ 206, 152, 207, 38, 131, 153, 152, 60, 153, 152, sl@0: /* 1220 */ 185, 19, 185, 153, 153, 152, 216, 15, 153, 188, sl@0: /* 1230 */ 227, 188, 188, 227, 195, 195, 188, 185, 153, 33, sl@0: /* 1240 */ 138, 153, 235, 153, 236, 1, 20, 112, 176, 216, sl@0: /* 1250 */ 238, 238, 241, 176, 112, 160, 112, 112, 92, 107, sl@0: /* 1260 */ 19, 11, 20, 20, 19, 19, 116, 20, 114, 20, sl@0: /* 1270 */ 22, 20, 116, 19, 22, 22, 116, 115, 20, 112, sl@0: /* 1280 */ 20, 20, 44, 19, 44, 19, 19, 32, 20, 19, sl@0: /* 1290 */ 19, 96, 103, 16, 21, 17, 98, 22, 36, 134, sl@0: /* 1300 */ 44, 98, 19, 5, 45, 1, 102, 68, 51, 19, sl@0: /* 1310 */ 45, 123, 113, 1, 17, 102, 123, 14, 113, 19, sl@0: /* 1320 */ 124, 20, 137, 136, 3, 242, 57, 4, 242, 242, sl@0: /* 1330 */ 242, 68, sl@0: }; sl@0: #define YY_SHIFT_USE_DFLT (-99) sl@0: #define YY_SHIFT_MAX 383 sl@0: static const short yy_shift_ofst[] = { sl@0: /* 0 */ 23, 843, 988, -16, 843, 933, 933, 393, 123, 460, sl@0: /* 10 */ -98, 96, 933, 933, 933, 933, 933, -45, 249, 424, sl@0: /* 20 */ 329, -17, 19, 19, 53, 165, 208, 251, 326, 395, sl@0: /* 30 */ 464, 533, 602, 645, 688, 645, 645, 645, 645, 645, sl@0: /* 40 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, sl@0: /* 50 */ 645, 645, 645, 731, 774, 774, 859, 933, 933, 933, sl@0: /* 60 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, sl@0: /* 70 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, sl@0: /* 80 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, sl@0: /* 90 */ 933, 933, 933, 933, 933, 933, 933, -61, -61, 6, sl@0: /* 100 */ 6, 281, 22, 61, 539, 565, 329, 329, 226, -17, sl@0: /* 110 */ -11, -99, -99, -99, 131, 328, 540, 540, 182, 615, sl@0: /* 120 */ 329, 615, 329, 329, 329, 329, 329, 329, 329, 329, sl@0: /* 130 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 851, sl@0: /* 140 */ 243, -98, -98, -98, -99, -99, -18, -18, 335, 350, sl@0: /* 150 */ 543, 603, 549, 669, 327, 795, 797, 605, 652, 559, sl@0: /* 160 */ 329, 329, 412, 329, 329, 132, 329, 329, 338, 329, sl@0: /* 170 */ 329, 329, 629, 338, 329, 329, 895, 895, 895, 329, sl@0: /* 180 */ 329, 329, 629, 329, 329, 629, 329, 600, 485, 329, sl@0: /* 190 */ 329, 629, 329, 329, 329, 629, 329, 629, 629, 329, sl@0: /* 200 */ 329, 329, 329, 329, 891, 532, 968, -17, 521, 521, sl@0: /* 210 */ 697, 712, 712, 718, 712, 690, 712, -17, 712, -17, sl@0: /* 220 */ 839, 893, 718, 718, 893, 1140, 1140, 1140, 1140, 1147, sl@0: /* 230 */ -98, 1049, 1055, 1057, 1061, 1054, 1047, 1068, 1068, 1086, sl@0: /* 240 */ 1069, 1086, 1069, 1087, 1087, 1148, 1087, 1093, 1087, 1172, sl@0: /* 250 */ 1109, 1109, 1148, 1087, 1087, 1087, 1172, 1186, 1068, 1186, sl@0: /* 260 */ 1068, 1186, 1068, 1068, 1175, 1083, 1186, 1068, 1157, 1157, sl@0: /* 270 */ 1202, 1049, 1212, 1212, 1212, 1212, 1049, 1157, 1202, 1068, sl@0: /* 280 */ 1206, 1206, 1068, 1068, 1102, -99, -99, -99, 458, 646, sl@0: /* 290 */ 643, 771, 150, 918, 972, 985, 871, 951, 948, 1016, sl@0: /* 300 */ 1029, 1056, 1060, 1063, 1074, 1094, 1091, 1244, 1226, 1135, sl@0: /* 310 */ 1142, 1144, 1145, 1166, 1152, 1241, 1242, 1243, 1245, 1250, sl@0: /* 320 */ 1246, 1247, 1248, 1249, 1251, 1252, 1150, 1253, 1156, 1252, sl@0: /* 330 */ 1154, 1254, 1160, 1162, 1258, 1167, 1260, 1261, 1255, 1238, sl@0: /* 340 */ 1264, 1240, 1266, 1268, 1267, 1270, 1256, 1271, 1195, 1189, sl@0: /* 350 */ 1277, 1278, 1273, 1198, 1262, 1257, 1259, 1275, 1265, 1165, sl@0: /* 360 */ 1203, 1283, 1298, 1304, 1204, 1239, 1263, 1188, 1290, 1199, sl@0: /* 370 */ 1312, 1297, 1205, 1213, 1193, 1300, 1196, 1301, 1303, 1269, sl@0: /* 380 */ 1187, 1185, 1321, 1323, sl@0: }; sl@0: #define YY_REDUCE_USE_DFLT (-144) sl@0: #define YY_REDUCE_MAX 287 sl@0: static const short yy_reduce_ofst[] = { sl@0: /* 0 */ -139, 278, 48, 289, 347, -22, 345, 197, 133, 416, sl@0: /* 10 */ -3, -128, 210, 47, 417, 403, 410, -143, 546, 37, sl@0: /* 20 */ 147, 144, 425, 467, -6, -6, -6, -6, -6, -6, sl@0: /* 30 */ -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, sl@0: /* 40 */ -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, sl@0: /* 50 */ -6, -6, -6, -6, -6, -6, 656, 699, 717, 723, sl@0: /* 60 */ 725, 729, 732, 749, 756, 758, 770, 796, 806, 809, sl@0: /* 70 */ 812, 847, 856, 858, 860, 876, 884, 886, 894, 897, sl@0: /* 80 */ 900, 902, 904, 921, 929, 931, 936, 938, 942, 947, sl@0: /* 90 */ 949, 955, 957, 967, 973, 981, 983, -6, -6, -6, sl@0: /* 100 */ -6, 84, -6, -6, 159, 550, 107, 284, -6, -121, sl@0: /* 110 */ -6, -6, -6, -6, 324, 21, 227, 312, 293, 140, sl@0: /* 120 */ 4, 162, -91, 473, 638, 639, -1, 430, 641, 570, sl@0: /* 130 */ 487, 683, 716, 719, 744, 766, 776, 684, 814, 364, sl@0: /* 140 */ 589, 673, 678, 733, 253, 302, -60, 24, 72, 82, sl@0: /* 150 */ 15, 190, 15, 15, 169, 222, 234, 237, 341, 304, sl@0: /* 160 */ 366, 414, 207, 341, 423, 457, 502, 542, 491, 634, sl@0: /* 170 */ 671, 687, 15, 491, 765, 768, 612, 700, 702, 830, sl@0: /* 180 */ 848, 854, 15, 861, 865, 15, 885, 710, 785, 905, sl@0: /* 190 */ 956, 15, 963, 974, 976, 15, 982, 15, 15, 984, sl@0: /* 200 */ 986, 987, 991, 992, 916, 941, 849, 979, 906, 912, sl@0: /* 210 */ 920, 975, 977, 944, 989, 969, 990, 993, 994, 995, sl@0: /* 220 */ 996, 961, 953, 959, 965, 1014, 1018, 1019, 1021, 1017, sl@0: /* 230 */ 997, 978, 980, 998, 999, 1000, 958, 1028, 1030, 1001, sl@0: /* 240 */ 1002, 1004, 1005, 1020, 1022, 1009, 1024, 1026, 1031, 1023, sl@0: /* 250 */ 1003, 1006, 1025, 1032, 1034, 1036, 1027, 1059, 1062, 1064, sl@0: /* 260 */ 1065, 1067, 1070, 1071, 1007, 1008, 1073, 1075, 1035, 1037, sl@0: /* 270 */ 1010, 1039, 1041, 1043, 1044, 1048, 1040, 1052, 1033, 1085, sl@0: /* 280 */ 1012, 1013, 1088, 1090, 1011, 1095, 1072, 1077, sl@0: }; sl@0: static const YYACTIONTYPE yy_default[] = { sl@0: /* 0 */ 583, 812, 881, 699, 881, 812, 881, 881, 839, 881, sl@0: /* 10 */ 703, 868, 810, 881, 881, 881, 881, 784, 881, 839, sl@0: /* 20 */ 881, 615, 839, 839, 735, 881, 881, 881, 881, 881, sl@0: /* 30 */ 881, 881, 881, 736, 881, 814, 809, 805, 807, 806, sl@0: /* 40 */ 813, 737, 726, 733, 740, 715, 852, 742, 743, 749, sl@0: /* 50 */ 750, 869, 867, 772, 771, 790, 881, 881, 881, 881, sl@0: /* 60 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 70 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 80 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 90 */ 881, 881, 881, 881, 881, 881, 881, 774, 796, 773, sl@0: /* 100 */ 783, 608, 775, 776, 668, 603, 881, 881, 777, 881, sl@0: /* 110 */ 778, 791, 792, 793, 881, 881, 881, 881, 583, 699, sl@0: /* 120 */ 881, 699, 881, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 130 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 140 */ 881, 881, 881, 881, 693, 703, 881, 881, 659, 881, sl@0: /* 150 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 591, sl@0: /* 160 */ 589, 881, 691, 881, 881, 617, 881, 881, 701, 881, sl@0: /* 170 */ 881, 881, 706, 707, 881, 881, 881, 881, 881, 881, sl@0: /* 180 */ 881, 881, 605, 881, 881, 680, 881, 845, 881, 881, sl@0: /* 190 */ 881, 859, 881, 881, 881, 857, 881, 682, 745, 825, sl@0: /* 200 */ 881, 872, 874, 881, 881, 691, 700, 881, 881, 881, sl@0: /* 210 */ 808, 729, 729, 717, 729, 638, 729, 881, 729, 881, sl@0: /* 220 */ 641, 739, 717, 717, 739, 588, 588, 588, 588, 658, sl@0: /* 230 */ 881, 739, 730, 732, 722, 734, 881, 708, 708, 716, sl@0: /* 240 */ 721, 716, 721, 670, 670, 655, 670, 641, 670, 818, sl@0: /* 250 */ 822, 822, 655, 670, 670, 670, 818, 600, 708, 600, sl@0: /* 260 */ 708, 600, 708, 708, 849, 851, 600, 708, 672, 672, sl@0: /* 270 */ 751, 739, 679, 679, 679, 679, 739, 672, 751, 708, sl@0: /* 280 */ 871, 871, 708, 708, 879, 625, 643, 643, 881, 881, sl@0: /* 290 */ 881, 881, 758, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 300 */ 881, 881, 881, 881, 881, 881, 832, 881, 881, 763, sl@0: /* 310 */ 759, 881, 760, 881, 685, 881, 881, 881, 881, 881, sl@0: /* 320 */ 881, 881, 881, 881, 881, 811, 881, 723, 881, 731, sl@0: /* 330 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 340 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 350 */ 881, 881, 881, 881, 881, 881, 847, 848, 881, 881, sl@0: /* 360 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, sl@0: /* 370 */ 881, 881, 881, 881, 881, 881, 881, 881, 881, 878, sl@0: /* 380 */ 881, 881, 584, 881, 579, 581, 582, 586, 587, 590, sl@0: /* 390 */ 612, 613, 614, 592, 593, 594, 595, 596, 597, 598, sl@0: /* 400 */ 604, 606, 624, 626, 610, 628, 689, 690, 755, 683, sl@0: /* 410 */ 684, 688, 611, 766, 757, 761, 762, 764, 765, 779, sl@0: /* 420 */ 780, 782, 788, 795, 798, 781, 786, 787, 789, 794, sl@0: /* 430 */ 797, 686, 687, 801, 618, 619, 622, 623, 835, 837, sl@0: /* 440 */ 836, 838, 621, 620, 767, 770, 803, 804, 860, 861, sl@0: /* 450 */ 862, 863, 864, 799, 709, 802, 785, 724, 727, 728, sl@0: /* 460 */ 725, 692, 702, 711, 712, 713, 714, 697, 698, 704, sl@0: /* 470 */ 720, 753, 754, 718, 719, 705, 694, 695, 696, 800, sl@0: /* 480 */ 756, 768, 769, 629, 630, 763, 631, 632, 633, 671, sl@0: /* 490 */ 674, 675, 676, 634, 653, 656, 657, 635, 642, 636, sl@0: /* 500 */ 637, 644, 645, 646, 649, 650, 651, 652, 647, 648, sl@0: /* 510 */ 819, 820, 823, 821, 639, 640, 654, 627, 616, 609, sl@0: /* 520 */ 660, 663, 664, 665, 666, 667, 669, 661, 662, 607, sl@0: /* 530 */ 599, 601, 710, 841, 850, 846, 842, 843, 844, 602, sl@0: /* 540 */ 815, 816, 673, 747, 748, 840, 853, 855, 752, 856, sl@0: /* 550 */ 858, 854, 677, 678, 681, 824, 865, 738, 741, 744, sl@0: /* 560 */ 746, 826, 827, 828, 829, 830, 833, 834, 831, 866, sl@0: /* 570 */ 870, 873, 875, 876, 877, 880, 585, 580, sl@0: }; sl@0: #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0])) sl@0: sl@0: /* The next table maps tokens into fallback tokens. If a construct sl@0: ** like the following: sl@0: ** sl@0: ** %fallback ID X Y Z. sl@0: ** sl@0: ** appears in the grammar, then ID becomes a fallback token for X, Y, sl@0: ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser sl@0: ** but it does not parse, the type of the token is changed to ID and sl@0: ** the parse is retried before an error is thrown. sl@0: */ sl@0: #ifdef YYFALLBACK sl@0: static const YYCODETYPE yyFallback[] = { sl@0: 0, /* $ => nothing */ sl@0: 0, /* SEMI => nothing */ sl@0: 23, /* EXPLAIN => ID */ sl@0: 23, /* QUERY => ID */ sl@0: 23, /* PLAN => ID */ sl@0: 23, /* BEGIN => ID */ sl@0: 0, /* TRANSACTION => nothing */ sl@0: 23, /* DEFERRED => ID */ sl@0: 23, /* IMMEDIATE => ID */ sl@0: 23, /* EXCLUSIVE => ID */ sl@0: 0, /* COMMIT => nothing */ sl@0: 23, /* END => ID */ sl@0: 0, /* ROLLBACK => nothing */ sl@0: 0, /* CREATE => nothing */ sl@0: 0, /* TABLE => nothing */ sl@0: 23, /* IF => ID */ sl@0: 0, /* NOT => nothing */ sl@0: 0, /* EXISTS => nothing */ sl@0: 23, /* TEMP => ID */ sl@0: 0, /* LP => nothing */ sl@0: 0, /* RP => nothing */ sl@0: 0, /* AS => nothing */ sl@0: 0, /* COMMA => nothing */ sl@0: 0, /* ID => nothing */ sl@0: 23, /* ABORT => ID */ sl@0: 23, /* AFTER => ID */ sl@0: 23, /* ANALYZE => ID */ sl@0: 23, /* ASC => ID */ sl@0: 23, /* ATTACH => ID */ sl@0: 23, /* BEFORE => ID */ sl@0: 23, /* CASCADE => ID */ sl@0: 23, /* CAST => ID */ sl@0: 23, /* CONFLICT => ID */ sl@0: 23, /* DATABASE => ID */ sl@0: 23, /* DESC => ID */ sl@0: 23, /* DETACH => ID */ sl@0: 23, /* EACH => ID */ sl@0: 23, /* FAIL => ID */ sl@0: 23, /* FOR => ID */ sl@0: 23, /* IGNORE => ID */ sl@0: 23, /* INITIALLY => ID */ sl@0: 23, /* INSTEAD => ID */ sl@0: 23, /* LIKE_KW => ID */ sl@0: 23, /* MATCH => ID */ sl@0: 23, /* KEY => ID */ sl@0: 23, /* OF => ID */ sl@0: 23, /* OFFSET => ID */ sl@0: 23, /* PRAGMA => ID */ sl@0: 23, /* RAISE => ID */ sl@0: 23, /* REPLACE => ID */ sl@0: 23, /* RESTRICT => ID */ sl@0: 23, /* ROW => ID */ sl@0: 23, /* TRIGGER => ID */ sl@0: 23, /* VACUUM => ID */ sl@0: 23, /* VIEW => ID */ sl@0: 23, /* VIRTUAL => ID */ sl@0: 23, /* REINDEX => ID */ sl@0: 23, /* RENAME => ID */ sl@0: 23, /* CTIME_KW => ID */ sl@0: 0, /* ANY => nothing */ sl@0: 0, /* OR => nothing */ sl@0: 0, /* AND => nothing */ sl@0: 0, /* IS => nothing */ sl@0: 0, /* BETWEEN => nothing */ sl@0: 0, /* IN => nothing */ sl@0: 0, /* ISNULL => nothing */ sl@0: 0, /* NOTNULL => nothing */ sl@0: 0, /* NE => nothing */ sl@0: 0, /* EQ => nothing */ sl@0: 0, /* GT => nothing */ sl@0: 0, /* LE => nothing */ sl@0: 0, /* LT => nothing */ sl@0: 0, /* GE => nothing */ sl@0: 0, /* ESCAPE => nothing */ sl@0: 0, /* BITAND => nothing */ sl@0: 0, /* BITOR => nothing */ sl@0: 0, /* LSHIFT => nothing */ sl@0: 0, /* RSHIFT => nothing */ sl@0: 0, /* PLUS => nothing */ sl@0: 0, /* MINUS => nothing */ sl@0: 0, /* STAR => nothing */ sl@0: 0, /* SLASH => nothing */ sl@0: 0, /* REM => nothing */ sl@0: 0, /* CONCAT => nothing */ sl@0: 0, /* COLLATE => nothing */ sl@0: 0, /* UMINUS => nothing */ sl@0: 0, /* UPLUS => nothing */ sl@0: 0, /* BITNOT => nothing */ sl@0: 0, /* STRING => nothing */ sl@0: 0, /* JOIN_KW => nothing */ sl@0: 0, /* CONSTRAINT => nothing */ sl@0: 0, /* DEFAULT => nothing */ sl@0: 0, /* NULL => nothing */ sl@0: 0, /* PRIMARY => nothing */ sl@0: 0, /* UNIQUE => nothing */ sl@0: 0, /* CHECK => nothing */ sl@0: 0, /* REFERENCES => nothing */ sl@0: 0, /* AUTOINCR => nothing */ sl@0: 0, /* ON => nothing */ sl@0: 0, /* DELETE => nothing */ sl@0: 0, /* UPDATE => nothing */ sl@0: 0, /* INSERT => nothing */ sl@0: 0, /* SET => nothing */ sl@0: 0, /* DEFERRABLE => nothing */ sl@0: 0, /* FOREIGN => nothing */ sl@0: 0, /* DROP => nothing */ sl@0: 0, /* UNION => nothing */ sl@0: 0, /* ALL => nothing */ sl@0: 0, /* EXCEPT => nothing */ sl@0: 0, /* INTERSECT => nothing */ sl@0: 0, /* SELECT => nothing */ sl@0: 0, /* DISTINCT => nothing */ sl@0: 0, /* DOT => nothing */ sl@0: 0, /* FROM => nothing */ sl@0: 0, /* JOIN => nothing */ sl@0: 0, /* INDEXED => nothing */ sl@0: 0, /* BY => nothing */ sl@0: 0, /* USING => nothing */ sl@0: 0, /* ORDER => nothing */ sl@0: 0, /* GROUP => nothing */ sl@0: 0, /* HAVING => nothing */ sl@0: 0, /* LIMIT => nothing */ sl@0: 0, /* WHERE => nothing */ sl@0: 0, /* INTO => nothing */ sl@0: 0, /* VALUES => nothing */ sl@0: 0, /* INTEGER => nothing */ sl@0: 0, /* FLOAT => nothing */ sl@0: 0, /* BLOB => nothing */ sl@0: 0, /* REGISTER => nothing */ sl@0: 0, /* VARIABLE => nothing */ sl@0: 0, /* CASE => nothing */ sl@0: 0, /* WHEN => nothing */ sl@0: 0, /* THEN => nothing */ sl@0: 0, /* ELSE => nothing */ sl@0: 0, /* INDEX => nothing */ sl@0: 0, /* ALTER => nothing */ sl@0: 0, /* TO => nothing */ sl@0: 0, /* ADD => nothing */ sl@0: 0, /* COLUMNKW => nothing */ sl@0: }; sl@0: #endif /* YYFALLBACK */ sl@0: sl@0: /* The following structure represents a single element of the sl@0: ** parser's stack. Information stored includes: sl@0: ** sl@0: ** + The state number for the parser at this level of the stack. sl@0: ** sl@0: ** + The value of the token stored at this level of the stack. sl@0: ** (In other words, the "major" token.) sl@0: ** sl@0: ** + The semantic value stored at this level of the stack. This is sl@0: ** the information used by the action routines in the grammar. sl@0: ** It is sometimes called the "minor" token. sl@0: */ sl@0: struct yyStackEntry { sl@0: YYACTIONTYPE stateno; /* The state-number */ sl@0: YYCODETYPE major; /* The major token value. This is the code sl@0: ** number for the token at this stack level */ sl@0: YYMINORTYPE minor; /* The user-supplied minor token value. This sl@0: ** is the value of the token */ sl@0: }; sl@0: typedef struct yyStackEntry yyStackEntry; sl@0: sl@0: /* The state of the parser is completely contained in an instance of sl@0: ** the following structure */ sl@0: struct yyParser { sl@0: int yyidx; /* Index of top element in stack */ sl@0: #ifdef YYTRACKMAXSTACKDEPTH sl@0: int yyidxMax; /* Maximum value of yyidx */ sl@0: #endif sl@0: int yyerrcnt; /* Shifts left before out of the error */ sl@0: sqlite3ParserARG_SDECL /* A place to hold %extra_argument */ sl@0: #if YYSTACKDEPTH<=0 sl@0: int yystksz; /* Current side of the stack */ sl@0: yyStackEntry *yystack; /* The parser's stack */ sl@0: #else sl@0: yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ sl@0: #endif sl@0: }; sl@0: typedef struct yyParser yyParser; sl@0: sl@0: #ifndef NDEBUG sl@0: #include sl@0: static FILE *yyTraceFILE = 0; sl@0: static char *yyTracePrompt = 0; sl@0: #endif /* NDEBUG */ sl@0: sl@0: #ifndef NDEBUG sl@0: /* sl@0: ** Turn parser tracing on by giving a stream to which to write the trace sl@0: ** and a prompt to preface each trace message. Tracing is turned off sl@0: ** by making either argument NULL sl@0: ** sl@0: ** Inputs: sl@0: ** sl@0: ** sl@0: ** Outputs: sl@0: ** None. sl@0: */ sl@0: void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){ sl@0: yyTraceFILE = TraceFILE; sl@0: yyTracePrompt = zTracePrompt; sl@0: if( yyTraceFILE==0 ) yyTracePrompt = 0; sl@0: else if( yyTracePrompt==0 ) yyTraceFILE = 0; sl@0: } sl@0: #endif /* NDEBUG */ sl@0: sl@0: #ifndef NDEBUG sl@0: /* For tracing shifts, the names of all terminals and nonterminals sl@0: ** are required. The following table supplies these names */ sl@0: static const char *const yyTokenName[] = { sl@0: "$", "SEMI", "EXPLAIN", "QUERY", sl@0: "PLAN", "BEGIN", "TRANSACTION", "DEFERRED", sl@0: "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END", sl@0: "ROLLBACK", "CREATE", "TABLE", "IF", sl@0: "NOT", "EXISTS", "TEMP", "LP", sl@0: "RP", "AS", "COMMA", "ID", sl@0: "ABORT", "AFTER", "ANALYZE", "ASC", sl@0: "ATTACH", "BEFORE", "CASCADE", "CAST", sl@0: "CONFLICT", "DATABASE", "DESC", "DETACH", sl@0: "EACH", "FAIL", "FOR", "IGNORE", sl@0: "INITIALLY", "INSTEAD", "LIKE_KW", "MATCH", sl@0: "KEY", "OF", "OFFSET", "PRAGMA", sl@0: "RAISE", "REPLACE", "RESTRICT", "ROW", sl@0: "TRIGGER", "VACUUM", "VIEW", "VIRTUAL", sl@0: "REINDEX", "RENAME", "CTIME_KW", "ANY", sl@0: "OR", "AND", "IS", "BETWEEN", sl@0: "IN", "ISNULL", "NOTNULL", "NE", sl@0: "EQ", "GT", "LE", "LT", sl@0: "GE", "ESCAPE", "BITAND", "BITOR", sl@0: "LSHIFT", "RSHIFT", "PLUS", "MINUS", sl@0: "STAR", "SLASH", "REM", "CONCAT", sl@0: "COLLATE", "UMINUS", "UPLUS", "BITNOT", sl@0: "STRING", "JOIN_KW", "CONSTRAINT", "DEFAULT", sl@0: "NULL", "PRIMARY", "UNIQUE", "CHECK", sl@0: "REFERENCES", "AUTOINCR", "ON", "DELETE", sl@0: "UPDATE", "INSERT", "SET", "DEFERRABLE", sl@0: "FOREIGN", "DROP", "UNION", "ALL", sl@0: "EXCEPT", "INTERSECT", "SELECT", "DISTINCT", sl@0: "DOT", "FROM", "JOIN", "INDEXED", sl@0: "BY", "USING", "ORDER", "GROUP", sl@0: "HAVING", "LIMIT", "WHERE", "INTO", sl@0: "VALUES", "INTEGER", "FLOAT", "BLOB", sl@0: "REGISTER", "VARIABLE", "CASE", "WHEN", sl@0: "THEN", "ELSE", "INDEX", "ALTER", sl@0: "TO", "ADD", "COLUMNKW", "error", sl@0: "input", "cmdlist", "ecmd", "explain", sl@0: "cmdx", "cmd", "transtype", "trans_opt", sl@0: "nm", "create_table", "create_table_args", "temp", sl@0: "ifnotexists", "dbnm", "columnlist", "conslist_opt", sl@0: "select", "column", "columnid", "type", sl@0: "carglist", "id", "ids", "typetoken", sl@0: "typename", "signed", "plus_num", "minus_num", sl@0: "carg", "ccons", "term", "expr", sl@0: "onconf", "sortorder", "autoinc", "idxlist_opt", sl@0: "refargs", "defer_subclause", "refarg", "refact", sl@0: "init_deferred_pred_opt", "conslist", "tcons", "idxlist", sl@0: "defer_subclause_opt", "orconf", "resolvetype", "raisetype", sl@0: "ifexists", "fullname", "oneselect", "multiselect_op", sl@0: "distinct", "selcollist", "from", "where_opt", sl@0: "groupby_opt", "having_opt", "orderby_opt", "limit_opt", sl@0: "sclp", "as", "seltablist", "stl_prefix", sl@0: "joinop", "indexed_opt", "on_opt", "using_opt", sl@0: "seltablist_paren", "joinop2", "inscollist", "sortlist", sl@0: "sortitem", "nexprlist", "setlist", "insert_cmd", sl@0: "inscollist_opt", "itemlist", "exprlist", "likeop", sl@0: "escape", "between_op", "in_op", "case_operand", sl@0: "case_exprlist", "case_else", "uniqueflag", "collate", sl@0: "nmnum", "plus_opt", "number", "trigger_decl", sl@0: "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", sl@0: "when_clause", "trigger_cmd", "database_kw_opt", "key_opt", sl@0: "add_column_fullname", "kwcolumn_opt", sl@0: }; sl@0: #endif /* NDEBUG */ sl@0: sl@0: #ifndef NDEBUG sl@0: /* For tracing reduce actions, the names of all rules are required. sl@0: */ sl@0: static const char *const yyRuleName[] = { sl@0: /* 0 */ "input ::= cmdlist", sl@0: /* 1 */ "cmdlist ::= cmdlist ecmd", sl@0: /* 2 */ "cmdlist ::= ecmd", sl@0: /* 3 */ "ecmd ::= SEMI", sl@0: /* 4 */ "ecmd ::= explain cmdx SEMI", sl@0: /* 5 */ "explain ::=", sl@0: /* 6 */ "explain ::= EXPLAIN", sl@0: /* 7 */ "explain ::= EXPLAIN QUERY PLAN", sl@0: /* 8 */ "cmdx ::= cmd", sl@0: /* 9 */ "cmd ::= BEGIN transtype trans_opt", sl@0: /* 10 */ "trans_opt ::=", sl@0: /* 11 */ "trans_opt ::= TRANSACTION", sl@0: /* 12 */ "trans_opt ::= TRANSACTION nm", sl@0: /* 13 */ "transtype ::=", sl@0: /* 14 */ "transtype ::= DEFERRED", sl@0: /* 15 */ "transtype ::= IMMEDIATE", sl@0: /* 16 */ "transtype ::= EXCLUSIVE", sl@0: /* 17 */ "cmd ::= COMMIT trans_opt", sl@0: /* 18 */ "cmd ::= END trans_opt", sl@0: /* 19 */ "cmd ::= ROLLBACK trans_opt", sl@0: /* 20 */ "cmd ::= create_table create_table_args", sl@0: /* 21 */ "create_table ::= CREATE temp TABLE ifnotexists nm dbnm", sl@0: /* 22 */ "ifnotexists ::=", sl@0: /* 23 */ "ifnotexists ::= IF NOT EXISTS", sl@0: /* 24 */ "temp ::= TEMP", sl@0: /* 25 */ "temp ::=", sl@0: /* 26 */ "create_table_args ::= LP columnlist conslist_opt RP", sl@0: /* 27 */ "create_table_args ::= AS select", sl@0: /* 28 */ "columnlist ::= columnlist COMMA column", sl@0: /* 29 */ "columnlist ::= column", sl@0: /* 30 */ "column ::= columnid type carglist", sl@0: /* 31 */ "columnid ::= nm", sl@0: /* 32 */ "id ::= ID", sl@0: /* 33 */ "ids ::= ID|STRING", sl@0: /* 34 */ "nm ::= ID", sl@0: /* 35 */ "nm ::= STRING", sl@0: /* 36 */ "nm ::= JOIN_KW", sl@0: /* 37 */ "type ::=", sl@0: /* 38 */ "type ::= typetoken", sl@0: /* 39 */ "typetoken ::= typename", sl@0: /* 40 */ "typetoken ::= typename LP signed RP", sl@0: /* 41 */ "typetoken ::= typename LP signed COMMA signed RP", sl@0: /* 42 */ "typename ::= ids", sl@0: /* 43 */ "typename ::= typename ids", sl@0: /* 44 */ "signed ::= plus_num", sl@0: /* 45 */ "signed ::= minus_num", sl@0: /* 46 */ "carglist ::= carglist carg", sl@0: /* 47 */ "carglist ::=", sl@0: /* 48 */ "carg ::= CONSTRAINT nm ccons", sl@0: /* 49 */ "carg ::= ccons", sl@0: /* 50 */ "ccons ::= DEFAULT term", sl@0: /* 51 */ "ccons ::= DEFAULT LP expr RP", sl@0: /* 52 */ "ccons ::= DEFAULT PLUS term", sl@0: /* 53 */ "ccons ::= DEFAULT MINUS term", sl@0: /* 54 */ "ccons ::= DEFAULT id", sl@0: /* 55 */ "ccons ::= NULL onconf", sl@0: /* 56 */ "ccons ::= NOT NULL onconf", sl@0: /* 57 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc", sl@0: /* 58 */ "ccons ::= UNIQUE onconf", sl@0: /* 59 */ "ccons ::= CHECK LP expr RP", sl@0: /* 60 */ "ccons ::= REFERENCES nm idxlist_opt refargs", sl@0: /* 61 */ "ccons ::= defer_subclause", sl@0: /* 62 */ "ccons ::= COLLATE ids", sl@0: /* 63 */ "autoinc ::=", sl@0: /* 64 */ "autoinc ::= AUTOINCR", sl@0: /* 65 */ "refargs ::=", sl@0: /* 66 */ "refargs ::= refargs refarg", sl@0: /* 67 */ "refarg ::= MATCH nm", sl@0: /* 68 */ "refarg ::= ON DELETE refact", sl@0: /* 69 */ "refarg ::= ON UPDATE refact", sl@0: /* 70 */ "refarg ::= ON INSERT refact", sl@0: /* 71 */ "refact ::= SET NULL", sl@0: /* 72 */ "refact ::= SET DEFAULT", sl@0: /* 73 */ "refact ::= CASCADE", sl@0: /* 74 */ "refact ::= RESTRICT", sl@0: /* 75 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", sl@0: /* 76 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", sl@0: /* 77 */ "init_deferred_pred_opt ::=", sl@0: /* 78 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", sl@0: /* 79 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", sl@0: /* 80 */ "conslist_opt ::=", sl@0: /* 81 */ "conslist_opt ::= COMMA conslist", sl@0: /* 82 */ "conslist ::= conslist COMMA tcons", sl@0: /* 83 */ "conslist ::= conslist tcons", sl@0: /* 84 */ "conslist ::= tcons", sl@0: /* 85 */ "tcons ::= CONSTRAINT nm", sl@0: /* 86 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf", sl@0: /* 87 */ "tcons ::= UNIQUE LP idxlist RP onconf", sl@0: /* 88 */ "tcons ::= CHECK LP expr RP onconf", sl@0: /* 89 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", sl@0: /* 90 */ "defer_subclause_opt ::=", sl@0: /* 91 */ "defer_subclause_opt ::= defer_subclause", sl@0: /* 92 */ "onconf ::=", sl@0: /* 93 */ "onconf ::= ON CONFLICT resolvetype", sl@0: /* 94 */ "orconf ::=", sl@0: /* 95 */ "orconf ::= OR resolvetype", sl@0: /* 96 */ "resolvetype ::= raisetype", sl@0: /* 97 */ "resolvetype ::= IGNORE", sl@0: /* 98 */ "resolvetype ::= REPLACE", sl@0: /* 99 */ "cmd ::= DROP TABLE ifexists fullname", sl@0: /* 100 */ "ifexists ::= IF EXISTS", sl@0: /* 101 */ "ifexists ::=", sl@0: /* 102 */ "cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select", sl@0: /* 103 */ "cmd ::= DROP VIEW ifexists fullname", sl@0: /* 104 */ "cmd ::= select", sl@0: /* 105 */ "select ::= oneselect", sl@0: /* 106 */ "select ::= select multiselect_op oneselect", sl@0: /* 107 */ "multiselect_op ::= UNION", sl@0: /* 108 */ "multiselect_op ::= UNION ALL", sl@0: /* 109 */ "multiselect_op ::= EXCEPT|INTERSECT", sl@0: /* 110 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", sl@0: /* 111 */ "distinct ::= DISTINCT", sl@0: /* 112 */ "distinct ::= ALL", sl@0: /* 113 */ "distinct ::=", sl@0: /* 114 */ "sclp ::= selcollist COMMA", sl@0: /* 115 */ "sclp ::=", sl@0: /* 116 */ "selcollist ::= sclp expr as", sl@0: /* 117 */ "selcollist ::= sclp STAR", sl@0: /* 118 */ "selcollist ::= sclp nm DOT STAR", sl@0: /* 119 */ "as ::= AS nm", sl@0: /* 120 */ "as ::= ids", sl@0: /* 121 */ "as ::=", sl@0: /* 122 */ "from ::=", sl@0: /* 123 */ "from ::= FROM seltablist", sl@0: /* 124 */ "stl_prefix ::= seltablist joinop", sl@0: /* 125 */ "stl_prefix ::=", sl@0: /* 126 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", sl@0: /* 127 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt", sl@0: /* 128 */ "seltablist_paren ::= select", sl@0: /* 129 */ "seltablist_paren ::= seltablist", sl@0: /* 130 */ "dbnm ::=", sl@0: /* 131 */ "dbnm ::= DOT nm", sl@0: /* 132 */ "fullname ::= nm dbnm", sl@0: /* 133 */ "joinop ::= COMMA|JOIN", sl@0: /* 134 */ "joinop ::= JOIN_KW JOIN", sl@0: /* 135 */ "joinop ::= JOIN_KW nm JOIN", sl@0: /* 136 */ "joinop ::= JOIN_KW nm nm JOIN", sl@0: /* 137 */ "on_opt ::= ON expr", sl@0: /* 138 */ "on_opt ::=", sl@0: /* 139 */ "indexed_opt ::=", sl@0: /* 140 */ "indexed_opt ::= INDEXED BY nm", sl@0: /* 141 */ "indexed_opt ::= NOT INDEXED", sl@0: /* 142 */ "using_opt ::= USING LP inscollist RP", sl@0: /* 143 */ "using_opt ::=", sl@0: /* 144 */ "orderby_opt ::=", sl@0: /* 145 */ "orderby_opt ::= ORDER BY sortlist", sl@0: /* 146 */ "sortlist ::= sortlist COMMA sortitem sortorder", sl@0: /* 147 */ "sortlist ::= sortitem sortorder", sl@0: /* 148 */ "sortitem ::= expr", sl@0: /* 149 */ "sortorder ::= ASC", sl@0: /* 150 */ "sortorder ::= DESC", sl@0: /* 151 */ "sortorder ::=", sl@0: /* 152 */ "groupby_opt ::=", sl@0: /* 153 */ "groupby_opt ::= GROUP BY nexprlist", sl@0: /* 154 */ "having_opt ::=", sl@0: /* 155 */ "having_opt ::= HAVING expr", sl@0: /* 156 */ "limit_opt ::=", sl@0: /* 157 */ "limit_opt ::= LIMIT expr", sl@0: /* 158 */ "limit_opt ::= LIMIT expr OFFSET expr", sl@0: /* 159 */ "limit_opt ::= LIMIT expr COMMA expr", sl@0: /* 160 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", sl@0: /* 161 */ "where_opt ::=", sl@0: /* 162 */ "where_opt ::= WHERE expr", sl@0: /* 163 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", sl@0: /* 164 */ "setlist ::= setlist COMMA nm EQ expr", sl@0: /* 165 */ "setlist ::= nm EQ expr", sl@0: /* 166 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP", sl@0: /* 167 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", sl@0: /* 168 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", sl@0: /* 169 */ "insert_cmd ::= INSERT orconf", sl@0: /* 170 */ "insert_cmd ::= REPLACE", sl@0: /* 171 */ "itemlist ::= itemlist COMMA expr", sl@0: /* 172 */ "itemlist ::= expr", sl@0: /* 173 */ "inscollist_opt ::=", sl@0: /* 174 */ "inscollist_opt ::= LP inscollist RP", sl@0: /* 175 */ "inscollist ::= inscollist COMMA nm", sl@0: /* 176 */ "inscollist ::= nm", sl@0: /* 177 */ "expr ::= term", sl@0: /* 178 */ "expr ::= LP expr RP", sl@0: /* 179 */ "term ::= NULL", sl@0: /* 180 */ "expr ::= ID", sl@0: /* 181 */ "expr ::= JOIN_KW", sl@0: /* 182 */ "expr ::= nm DOT nm", sl@0: /* 183 */ "expr ::= nm DOT nm DOT nm", sl@0: /* 184 */ "term ::= INTEGER|FLOAT|BLOB", sl@0: /* 185 */ "term ::= STRING", sl@0: /* 186 */ "expr ::= REGISTER", sl@0: /* 187 */ "expr ::= VARIABLE", sl@0: /* 188 */ "expr ::= expr COLLATE ids", sl@0: /* 189 */ "expr ::= CAST LP expr AS typetoken RP", sl@0: /* 190 */ "expr ::= ID LP distinct exprlist RP", sl@0: /* 191 */ "expr ::= ID LP STAR RP", sl@0: /* 192 */ "term ::= CTIME_KW", sl@0: /* 193 */ "expr ::= expr AND expr", sl@0: /* 194 */ "expr ::= expr OR expr", sl@0: /* 195 */ "expr ::= expr LT|GT|GE|LE expr", sl@0: /* 196 */ "expr ::= expr EQ|NE expr", sl@0: /* 197 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", sl@0: /* 198 */ "expr ::= expr PLUS|MINUS expr", sl@0: /* 199 */ "expr ::= expr STAR|SLASH|REM expr", sl@0: /* 200 */ "expr ::= expr CONCAT expr", sl@0: /* 201 */ "likeop ::= LIKE_KW", sl@0: /* 202 */ "likeop ::= NOT LIKE_KW", sl@0: /* 203 */ "likeop ::= MATCH", sl@0: /* 204 */ "likeop ::= NOT MATCH", sl@0: /* 205 */ "escape ::= ESCAPE expr", sl@0: /* 206 */ "escape ::=", sl@0: /* 207 */ "expr ::= expr likeop expr escape", sl@0: /* 208 */ "expr ::= expr ISNULL|NOTNULL", sl@0: /* 209 */ "expr ::= expr IS NULL", sl@0: /* 210 */ "expr ::= expr NOT NULL", sl@0: /* 211 */ "expr ::= expr IS NOT NULL", sl@0: /* 212 */ "expr ::= NOT expr", sl@0: /* 213 */ "expr ::= BITNOT expr", sl@0: /* 214 */ "expr ::= MINUS expr", sl@0: /* 215 */ "expr ::= PLUS expr", sl@0: /* 216 */ "between_op ::= BETWEEN", sl@0: /* 217 */ "between_op ::= NOT BETWEEN", sl@0: /* 218 */ "expr ::= expr between_op expr AND expr", sl@0: /* 219 */ "in_op ::= IN", sl@0: /* 220 */ "in_op ::= NOT IN", sl@0: /* 221 */ "expr ::= expr in_op LP exprlist RP", sl@0: /* 222 */ "expr ::= LP select RP", sl@0: /* 223 */ "expr ::= expr in_op LP select RP", sl@0: /* 224 */ "expr ::= expr in_op nm dbnm", sl@0: /* 225 */ "expr ::= EXISTS LP select RP", sl@0: /* 226 */ "expr ::= CASE case_operand case_exprlist case_else END", sl@0: /* 227 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", sl@0: /* 228 */ "case_exprlist ::= WHEN expr THEN expr", sl@0: /* 229 */ "case_else ::= ELSE expr", sl@0: /* 230 */ "case_else ::=", sl@0: /* 231 */ "case_operand ::= expr", sl@0: /* 232 */ "case_operand ::=", sl@0: /* 233 */ "exprlist ::= nexprlist", sl@0: /* 234 */ "exprlist ::=", sl@0: /* 235 */ "nexprlist ::= nexprlist COMMA expr", sl@0: /* 236 */ "nexprlist ::= expr", sl@0: /* 237 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP", sl@0: /* 238 */ "uniqueflag ::= UNIQUE", sl@0: /* 239 */ "uniqueflag ::=", sl@0: /* 240 */ "idxlist_opt ::=", sl@0: /* 241 */ "idxlist_opt ::= LP idxlist RP", sl@0: /* 242 */ "idxlist ::= idxlist COMMA nm collate sortorder", sl@0: /* 243 */ "idxlist ::= nm collate sortorder", sl@0: /* 244 */ "collate ::=", sl@0: /* 245 */ "collate ::= COLLATE ids", sl@0: /* 246 */ "cmd ::= DROP INDEX ifexists fullname", sl@0: /* 247 */ "cmd ::= VACUUM", sl@0: /* 248 */ "cmd ::= VACUUM nm", sl@0: /* 249 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", sl@0: /* 250 */ "cmd ::= PRAGMA nm dbnm EQ ON", sl@0: /* 251 */ "cmd ::= PRAGMA nm dbnm EQ DELETE", sl@0: /* 252 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", sl@0: /* 253 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", sl@0: /* 254 */ "cmd ::= PRAGMA nm dbnm", sl@0: /* 255 */ "nmnum ::= plus_num", sl@0: /* 256 */ "nmnum ::= nm", sl@0: /* 257 */ "plus_num ::= plus_opt number", sl@0: /* 258 */ "minus_num ::= MINUS number", sl@0: /* 259 */ "number ::= INTEGER|FLOAT", sl@0: /* 260 */ "plus_opt ::= PLUS", sl@0: /* 261 */ "plus_opt ::=", sl@0: /* 262 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END", sl@0: /* 263 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", sl@0: /* 264 */ "trigger_time ::= BEFORE", sl@0: /* 265 */ "trigger_time ::= AFTER", sl@0: /* 266 */ "trigger_time ::= INSTEAD OF", sl@0: /* 267 */ "trigger_time ::=", sl@0: /* 268 */ "trigger_event ::= DELETE|INSERT", sl@0: /* 269 */ "trigger_event ::= UPDATE", sl@0: /* 270 */ "trigger_event ::= UPDATE OF inscollist", sl@0: /* 271 */ "foreach_clause ::=", sl@0: /* 272 */ "foreach_clause ::= FOR EACH ROW", sl@0: /* 273 */ "when_clause ::=", sl@0: /* 274 */ "when_clause ::= WHEN expr", sl@0: /* 275 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", sl@0: /* 276 */ "trigger_cmd_list ::= trigger_cmd SEMI", sl@0: /* 277 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt", sl@0: /* 278 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP", sl@0: /* 279 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select", sl@0: /* 280 */ "trigger_cmd ::= DELETE FROM nm where_opt", sl@0: /* 281 */ "trigger_cmd ::= select", sl@0: /* 282 */ "expr ::= RAISE LP IGNORE RP", sl@0: /* 283 */ "expr ::= RAISE LP raisetype COMMA nm RP", sl@0: /* 284 */ "raisetype ::= ROLLBACK", sl@0: /* 285 */ "raisetype ::= ABORT", sl@0: /* 286 */ "raisetype ::= FAIL", sl@0: /* 287 */ "cmd ::= DROP TRIGGER ifexists fullname", sl@0: /* 288 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", sl@0: /* 289 */ "cmd ::= DETACH database_kw_opt expr", sl@0: /* 290 */ "key_opt ::=", sl@0: /* 291 */ "key_opt ::= KEY expr", sl@0: /* 292 */ "database_kw_opt ::= DATABASE", sl@0: /* 293 */ "database_kw_opt ::=", sl@0: /* 294 */ "cmd ::= REINDEX", sl@0: /* 295 */ "cmd ::= REINDEX nm dbnm", sl@0: /* 296 */ "cmd ::= ANALYZE", sl@0: /* 297 */ "cmd ::= ANALYZE nm dbnm", sl@0: /* 298 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", sl@0: /* 299 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", sl@0: /* 300 */ "add_column_fullname ::= fullname", sl@0: /* 301 */ "kwcolumn_opt ::=", sl@0: /* 302 */ "kwcolumn_opt ::= COLUMNKW", sl@0: }; sl@0: #endif /* NDEBUG */ sl@0: sl@0: sl@0: #if YYSTACKDEPTH<=0 sl@0: /* sl@0: ** Try to increase the size of the parser stack. sl@0: */ sl@0: static void yyGrowStack(yyParser *p){ sl@0: int newSize; sl@0: yyStackEntry *pNew; sl@0: sl@0: newSize = p->yystksz*2 + 100; sl@0: pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); sl@0: if( pNew ){ sl@0: p->yystack = pNew; sl@0: p->yystksz = newSize; sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE ){ sl@0: fprintf(yyTraceFILE,"%sStack grows to %d entries!\n", sl@0: yyTracePrompt, p->yystksz); sl@0: } sl@0: #endif sl@0: } sl@0: } sl@0: #endif sl@0: sl@0: /* sl@0: ** This function allocates a new parser. sl@0: ** The only argument is a pointer to a function which works like sl@0: ** malloc. sl@0: ** sl@0: ** Inputs: sl@0: ** A pointer to the function used to allocate memory. sl@0: ** sl@0: ** Outputs: sl@0: ** A pointer to a parser. This pointer is used in subsequent calls sl@0: ** to sqlite3Parser and sqlite3ParserFree. sl@0: */ sl@0: void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){ sl@0: yyParser *pParser; sl@0: pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); sl@0: if( pParser ){ sl@0: pParser->yyidx = -1; sl@0: #ifdef YYTRACKMAXSTACKDEPTH sl@0: pParser->yyidxMax = 0; sl@0: #endif sl@0: #if YYSTACKDEPTH<=0 sl@0: yyGrowStack(pParser); sl@0: #endif sl@0: } sl@0: return pParser; sl@0: } sl@0: sl@0: /* The following function deletes the value associated with a sl@0: ** symbol. The symbol can be either a terminal or nonterminal. sl@0: ** "yymajor" is the symbol code, and "yypminor" is a pointer to sl@0: ** the value. sl@0: */ sl@0: static void yy_destructor( sl@0: yyParser *yypParser, /* The parser */ sl@0: YYCODETYPE yymajor, /* Type code for object to destroy */ sl@0: YYMINORTYPE *yypminor /* The object to be destroyed */ sl@0: ){ sl@0: sqlite3ParserARG_FETCH; sl@0: switch( yymajor ){ sl@0: /* Here is inserted the actions which take place when a sl@0: ** terminal or non-terminal is destroyed. This can happen sl@0: ** when the symbol is popped from the stack during a sl@0: ** reduce or during error processing or when a parser is sl@0: ** being destroyed before it is finished parsing. sl@0: ** sl@0: ** Note: during a reduce, the only symbols destroyed are those sl@0: ** which appear on the RHS of the rule, but which are not used sl@0: ** inside the C code. sl@0: */ sl@0: case 156: /* select */ sl@0: case 190: /* oneselect */ sl@0: case 208: /* seltablist_paren */ sl@0: { sl@0: #line 369 "parse.y" sl@0: sqlite3SelectDelete(pParse->db, (yypminor->yy91)); sl@0: #line 1279 "parse.c" sl@0: } sl@0: break; sl@0: case 170: /* term */ sl@0: case 171: /* expr */ sl@0: case 195: /* where_opt */ sl@0: case 197: /* having_opt */ sl@0: case 206: /* on_opt */ sl@0: case 212: /* sortitem */ sl@0: case 220: /* escape */ sl@0: case 223: /* case_operand */ sl@0: case 225: /* case_else */ sl@0: case 236: /* when_clause */ sl@0: case 239: /* key_opt */ sl@0: { sl@0: #line 669 "parse.y" sl@0: sqlite3ExprDelete(pParse->db, (yypminor->yy418)); sl@0: #line 1296 "parse.c" sl@0: } sl@0: break; sl@0: case 175: /* idxlist_opt */ sl@0: case 183: /* idxlist */ sl@0: case 193: /* selcollist */ sl@0: case 196: /* groupby_opt */ sl@0: case 198: /* orderby_opt */ sl@0: case 200: /* sclp */ sl@0: case 211: /* sortlist */ sl@0: case 213: /* nexprlist */ sl@0: case 214: /* setlist */ sl@0: case 217: /* itemlist */ sl@0: case 218: /* exprlist */ sl@0: case 224: /* case_exprlist */ sl@0: { sl@0: #line 927 "parse.y" sl@0: sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); sl@0: #line 1314 "parse.c" sl@0: } sl@0: break; sl@0: case 189: /* fullname */ sl@0: case 194: /* from */ sl@0: case 202: /* seltablist */ sl@0: case 203: /* stl_prefix */ sl@0: { sl@0: #line 487 "parse.y" sl@0: sqlite3SrcListDelete(pParse->db, (yypminor->yy439)); sl@0: #line 1324 "parse.c" sl@0: } sl@0: break; sl@0: case 207: /* using_opt */ sl@0: case 210: /* inscollist */ sl@0: case 216: /* inscollist_opt */ sl@0: { sl@0: #line 519 "parse.y" sl@0: sqlite3IdListDelete(pParse->db, (yypminor->yy232)); sl@0: #line 1333 "parse.c" sl@0: } sl@0: break; sl@0: case 232: /* trigger_cmd_list */ sl@0: case 237: /* trigger_cmd */ sl@0: { sl@0: #line 1031 "parse.y" sl@0: sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy451)); sl@0: #line 1341 "parse.c" sl@0: } sl@0: break; sl@0: case 234: /* trigger_event */ sl@0: { sl@0: #line 1017 "parse.y" sl@0: sqlite3IdListDelete(pParse->db, (yypminor->yy378).b); sl@0: #line 1348 "parse.c" sl@0: } sl@0: break; sl@0: default: break; /* If no destructor action specified: do nothing */ sl@0: } sl@0: } sl@0: sl@0: /* sl@0: ** Pop the parser's stack once. sl@0: ** sl@0: ** If there is a destructor routine associated with the token which sl@0: ** is popped from the stack, then call it. sl@0: ** sl@0: ** Return the major token number for the symbol popped. sl@0: */ sl@0: static int yy_pop_parser_stack(yyParser *pParser){ sl@0: YYCODETYPE yymajor; sl@0: yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; sl@0: sl@0: if( pParser->yyidx<0 ) return 0; sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE && pParser->yyidx>=0 ){ sl@0: fprintf(yyTraceFILE,"%sPopping %s\n", sl@0: yyTracePrompt, sl@0: yyTokenName[yytos->major]); sl@0: } sl@0: #endif sl@0: yymajor = yytos->major; sl@0: yy_destructor(pParser, yymajor, &yytos->minor); sl@0: pParser->yyidx--; sl@0: return yymajor; sl@0: } sl@0: sl@0: /* sl@0: ** Deallocate and destroy a parser. Destructors are all called for sl@0: ** all stack elements before shutting the parser down. sl@0: ** sl@0: ** Inputs: sl@0: ** sl@0: */ sl@0: void sqlite3ParserFree( sl@0: void *p, /* The parser to be deleted */ sl@0: void (*freeProc)(void*) /* Function used to reclaim memory */ sl@0: ){ sl@0: yyParser *pParser = (yyParser*)p; sl@0: if( pParser==0 ) return; sl@0: while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser); sl@0: #if YYSTACKDEPTH<=0 sl@0: free(pParser->yystack); sl@0: #endif sl@0: (*freeProc)((void*)pParser); sl@0: } sl@0: sl@0: /* sl@0: ** Return the peak depth of the stack for a parser. sl@0: */ sl@0: #ifdef YYTRACKMAXSTACKDEPTH sl@0: int sqlite3ParserStackPeak(void *p){ sl@0: yyParser *pParser = (yyParser*)p; sl@0: return pParser->yyidxMax; sl@0: } sl@0: #endif sl@0: sl@0: /* sl@0: ** Find the appropriate action for a parser given the terminal sl@0: ** look-ahead token iLookAhead. sl@0: ** sl@0: ** If the look-ahead token is YYNOCODE, then check to see if the action is sl@0: ** independent of the look-ahead. If it is, return the action, otherwise sl@0: ** return YY_NO_ACTION. sl@0: */ sl@0: static int yy_find_shift_action( sl@0: yyParser *pParser, /* The parser */ sl@0: YYCODETYPE iLookAhead /* The look-ahead token */ sl@0: ){ sl@0: int i; sl@0: int stateno = pParser->yystack[pParser->yyidx].stateno; sl@0: sl@0: if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){ sl@0: return yy_default[stateno]; sl@0: } sl@0: assert( iLookAhead!=YYNOCODE ); sl@0: i += iLookAhead; sl@0: if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ sl@0: if( iLookAhead>0 ){ sl@0: #ifdef YYFALLBACK sl@0: int iFallback; /* Fallback token */ sl@0: if( iLookAhead %s\n", sl@0: yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); sl@0: } sl@0: #endif sl@0: return yy_find_shift_action(pParser, iFallback); sl@0: } sl@0: #endif sl@0: #ifdef YYWILDCARD sl@0: { sl@0: int j = i - iLookAhead + YYWILDCARD; sl@0: if( j>=0 && j %s\n", sl@0: yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]); sl@0: } sl@0: #endif /* NDEBUG */ sl@0: return yy_action[j]; sl@0: } sl@0: } sl@0: #endif /* YYWILDCARD */ sl@0: } sl@0: return yy_default[stateno]; sl@0: }else{ sl@0: return yy_action[i]; sl@0: } sl@0: } sl@0: sl@0: /* sl@0: ** Find the appropriate action for a parser given the non-terminal sl@0: ** look-ahead token iLookAhead. sl@0: ** sl@0: ** If the look-ahead token is YYNOCODE, then check to see if the action is sl@0: ** independent of the look-ahead. If it is, return the action, otherwise sl@0: ** return YY_NO_ACTION. sl@0: */ sl@0: static int yy_find_reduce_action( sl@0: int stateno, /* Current state number */ sl@0: YYCODETYPE iLookAhead /* The look-ahead token */ sl@0: ){ sl@0: int i; sl@0: #ifdef YYERRORSYMBOL sl@0: if( stateno>YY_REDUCE_MAX ){ sl@0: return yy_default[stateno]; sl@0: } sl@0: #else sl@0: assert( stateno<=YY_REDUCE_MAX ); sl@0: #endif sl@0: i = yy_reduce_ofst[stateno]; sl@0: assert( i!=YY_REDUCE_USE_DFLT ); sl@0: assert( iLookAhead!=YYNOCODE ); sl@0: i += iLookAhead; sl@0: #ifdef YYERRORSYMBOL sl@0: if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ sl@0: return yy_default[stateno]; sl@0: } sl@0: #else sl@0: assert( i>=0 && iyyidx--; sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE ){ sl@0: fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); sl@0: } sl@0: #endif sl@0: while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); sl@0: /* Here code is inserted which will execute if the parser sl@0: ** stack every overflows */ sl@0: #line 39 "parse.y" sl@0: sl@0: sqlite3ErrorMsg(pParse, "parser stack overflow"); sl@0: pParse->parseError = 1; sl@0: #line 1526 "parse.c" sl@0: sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */ sl@0: } sl@0: sl@0: /* sl@0: ** Perform a shift action. sl@0: */ sl@0: static void yy_shift( sl@0: yyParser *yypParser, /* The parser to be shifted */ sl@0: int yyNewState, /* The new state to shift in */ sl@0: int yyMajor, /* The major token to shift in */ sl@0: YYMINORTYPE *yypMinor /* Pointer to the minor token to shift in */ sl@0: ){ sl@0: yyStackEntry *yytos; sl@0: yypParser->yyidx++; sl@0: #ifdef YYTRACKMAXSTACKDEPTH sl@0: if( yypParser->yyidx>yypParser->yyidxMax ){ sl@0: yypParser->yyidxMax = yypParser->yyidx; sl@0: } sl@0: #endif sl@0: #if YYSTACKDEPTH>0 sl@0: if( yypParser->yyidx>=YYSTACKDEPTH ){ sl@0: yyStackOverflow(yypParser, yypMinor); sl@0: return; sl@0: } sl@0: #else sl@0: if( yypParser->yyidx>=yypParser->yystksz ){ sl@0: yyGrowStack(yypParser); sl@0: if( yypParser->yyidx>=yypParser->yystksz ){ sl@0: yyStackOverflow(yypParser, yypMinor); sl@0: return; sl@0: } sl@0: } sl@0: #endif sl@0: yytos = &yypParser->yystack[yypParser->yyidx]; sl@0: yytos->stateno = yyNewState; sl@0: yytos->major = yyMajor; sl@0: yytos->minor = *yypMinor; sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE && yypParser->yyidx>0 ){ sl@0: int i; sl@0: fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); sl@0: fprintf(yyTraceFILE,"%sStack:",yyTracePrompt); sl@0: for(i=1; i<=yypParser->yyidx; i++) sl@0: fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]); sl@0: fprintf(yyTraceFILE,"\n"); sl@0: } sl@0: #endif sl@0: } sl@0: sl@0: /* The following table contains information about every rule that sl@0: ** is used during the reduce. sl@0: */ sl@0: static const struct { sl@0: YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ sl@0: unsigned char nrhs; /* Number of right-hand side symbols in the rule */ sl@0: } yyRuleInfo[] = { sl@0: { 140, 1 }, sl@0: { 141, 2 }, sl@0: { 141, 1 }, sl@0: { 142, 1 }, sl@0: { 142, 3 }, sl@0: { 143, 0 }, sl@0: { 143, 1 }, sl@0: { 143, 3 }, sl@0: { 144, 1 }, sl@0: { 145, 3 }, sl@0: { 147, 0 }, sl@0: { 147, 1 }, sl@0: { 147, 2 }, sl@0: { 146, 0 }, sl@0: { 146, 1 }, sl@0: { 146, 1 }, sl@0: { 146, 1 }, sl@0: { 145, 2 }, sl@0: { 145, 2 }, sl@0: { 145, 2 }, sl@0: { 145, 2 }, sl@0: { 149, 6 }, sl@0: { 152, 0 }, sl@0: { 152, 3 }, sl@0: { 151, 1 }, sl@0: { 151, 0 }, sl@0: { 150, 4 }, sl@0: { 150, 2 }, sl@0: { 154, 3 }, sl@0: { 154, 1 }, sl@0: { 157, 3 }, sl@0: { 158, 1 }, sl@0: { 161, 1 }, sl@0: { 162, 1 }, sl@0: { 148, 1 }, sl@0: { 148, 1 }, sl@0: { 148, 1 }, sl@0: { 159, 0 }, sl@0: { 159, 1 }, sl@0: { 163, 1 }, sl@0: { 163, 4 }, sl@0: { 163, 6 }, sl@0: { 164, 1 }, sl@0: { 164, 2 }, sl@0: { 165, 1 }, sl@0: { 165, 1 }, sl@0: { 160, 2 }, sl@0: { 160, 0 }, sl@0: { 168, 3 }, sl@0: { 168, 1 }, sl@0: { 169, 2 }, sl@0: { 169, 4 }, sl@0: { 169, 3 }, sl@0: { 169, 3 }, sl@0: { 169, 2 }, sl@0: { 169, 2 }, sl@0: { 169, 3 }, sl@0: { 169, 5 }, sl@0: { 169, 2 }, sl@0: { 169, 4 }, sl@0: { 169, 4 }, sl@0: { 169, 1 }, sl@0: { 169, 2 }, sl@0: { 174, 0 }, sl@0: { 174, 1 }, sl@0: { 176, 0 }, sl@0: { 176, 2 }, sl@0: { 178, 2 }, sl@0: { 178, 3 }, sl@0: { 178, 3 }, sl@0: { 178, 3 }, sl@0: { 179, 2 }, sl@0: { 179, 2 }, sl@0: { 179, 1 }, sl@0: { 179, 1 }, sl@0: { 177, 3 }, sl@0: { 177, 2 }, sl@0: { 180, 0 }, sl@0: { 180, 2 }, sl@0: { 180, 2 }, sl@0: { 155, 0 }, sl@0: { 155, 2 }, sl@0: { 181, 3 }, sl@0: { 181, 2 }, sl@0: { 181, 1 }, sl@0: { 182, 2 }, sl@0: { 182, 7 }, sl@0: { 182, 5 }, sl@0: { 182, 5 }, sl@0: { 182, 10 }, sl@0: { 184, 0 }, sl@0: { 184, 1 }, sl@0: { 172, 0 }, sl@0: { 172, 3 }, sl@0: { 185, 0 }, sl@0: { 185, 2 }, sl@0: { 186, 1 }, sl@0: { 186, 1 }, sl@0: { 186, 1 }, sl@0: { 145, 4 }, sl@0: { 188, 2 }, sl@0: { 188, 0 }, sl@0: { 145, 8 }, sl@0: { 145, 4 }, sl@0: { 145, 1 }, sl@0: { 156, 1 }, sl@0: { 156, 3 }, sl@0: { 191, 1 }, sl@0: { 191, 2 }, sl@0: { 191, 1 }, sl@0: { 190, 9 }, sl@0: { 192, 1 }, sl@0: { 192, 1 }, sl@0: { 192, 0 }, sl@0: { 200, 2 }, sl@0: { 200, 0 }, sl@0: { 193, 3 }, sl@0: { 193, 2 }, sl@0: { 193, 4 }, sl@0: { 201, 2 }, sl@0: { 201, 1 }, sl@0: { 201, 0 }, sl@0: { 194, 0 }, sl@0: { 194, 2 }, sl@0: { 203, 2 }, sl@0: { 203, 0 }, sl@0: { 202, 7 }, sl@0: { 202, 7 }, sl@0: { 208, 1 }, sl@0: { 208, 1 }, sl@0: { 153, 0 }, sl@0: { 153, 2 }, sl@0: { 189, 2 }, sl@0: { 204, 1 }, sl@0: { 204, 2 }, sl@0: { 204, 3 }, sl@0: { 204, 4 }, sl@0: { 206, 2 }, sl@0: { 206, 0 }, sl@0: { 205, 0 }, sl@0: { 205, 3 }, sl@0: { 205, 2 }, sl@0: { 207, 4 }, sl@0: { 207, 0 }, sl@0: { 198, 0 }, sl@0: { 198, 3 }, sl@0: { 211, 4 }, sl@0: { 211, 2 }, sl@0: { 212, 1 }, sl@0: { 173, 1 }, sl@0: { 173, 1 }, sl@0: { 173, 0 }, sl@0: { 196, 0 }, sl@0: { 196, 3 }, sl@0: { 197, 0 }, sl@0: { 197, 2 }, sl@0: { 199, 0 }, sl@0: { 199, 2 }, sl@0: { 199, 4 }, sl@0: { 199, 4 }, sl@0: { 145, 5 }, sl@0: { 195, 0 }, sl@0: { 195, 2 }, sl@0: { 145, 7 }, sl@0: { 214, 5 }, sl@0: { 214, 3 }, sl@0: { 145, 8 }, sl@0: { 145, 5 }, sl@0: { 145, 6 }, sl@0: { 215, 2 }, sl@0: { 215, 1 }, sl@0: { 217, 3 }, sl@0: { 217, 1 }, sl@0: { 216, 0 }, sl@0: { 216, 3 }, sl@0: { 210, 3 }, sl@0: { 210, 1 }, sl@0: { 171, 1 }, sl@0: { 171, 3 }, sl@0: { 170, 1 }, sl@0: { 171, 1 }, sl@0: { 171, 1 }, sl@0: { 171, 3 }, sl@0: { 171, 5 }, sl@0: { 170, 1 }, sl@0: { 170, 1 }, sl@0: { 171, 1 }, sl@0: { 171, 1 }, sl@0: { 171, 3 }, sl@0: { 171, 6 }, sl@0: { 171, 5 }, sl@0: { 171, 4 }, sl@0: { 170, 1 }, sl@0: { 171, 3 }, sl@0: { 171, 3 }, sl@0: { 171, 3 }, sl@0: { 171, 3 }, sl@0: { 171, 3 }, sl@0: { 171, 3 }, sl@0: { 171, 3 }, sl@0: { 171, 3 }, sl@0: { 219, 1 }, sl@0: { 219, 2 }, sl@0: { 219, 1 }, sl@0: { 219, 2 }, sl@0: { 220, 2 }, sl@0: { 220, 0 }, sl@0: { 171, 4 }, sl@0: { 171, 2 }, sl@0: { 171, 3 }, sl@0: { 171, 3 }, sl@0: { 171, 4 }, sl@0: { 171, 2 }, sl@0: { 171, 2 }, sl@0: { 171, 2 }, sl@0: { 171, 2 }, sl@0: { 221, 1 }, sl@0: { 221, 2 }, sl@0: { 171, 5 }, sl@0: { 222, 1 }, sl@0: { 222, 2 }, sl@0: { 171, 5 }, sl@0: { 171, 3 }, sl@0: { 171, 5 }, sl@0: { 171, 4 }, sl@0: { 171, 4 }, sl@0: { 171, 5 }, sl@0: { 224, 5 }, sl@0: { 224, 4 }, sl@0: { 225, 2 }, sl@0: { 225, 0 }, sl@0: { 223, 1 }, sl@0: { 223, 0 }, sl@0: { 218, 1 }, sl@0: { 218, 0 }, sl@0: { 213, 3 }, sl@0: { 213, 1 }, sl@0: { 145, 11 }, sl@0: { 226, 1 }, sl@0: { 226, 0 }, sl@0: { 175, 0 }, sl@0: { 175, 3 }, sl@0: { 183, 5 }, sl@0: { 183, 3 }, sl@0: { 227, 0 }, sl@0: { 227, 2 }, sl@0: { 145, 4 }, sl@0: { 145, 1 }, sl@0: { 145, 2 }, sl@0: { 145, 5 }, sl@0: { 145, 5 }, sl@0: { 145, 5 }, sl@0: { 145, 5 }, sl@0: { 145, 6 }, sl@0: { 145, 3 }, sl@0: { 228, 1 }, sl@0: { 228, 1 }, sl@0: { 166, 2 }, sl@0: { 167, 2 }, sl@0: { 230, 1 }, sl@0: { 229, 1 }, sl@0: { 229, 0 }, sl@0: { 145, 5 }, sl@0: { 231, 11 }, sl@0: { 233, 1 }, sl@0: { 233, 1 }, sl@0: { 233, 2 }, sl@0: { 233, 0 }, sl@0: { 234, 1 }, sl@0: { 234, 1 }, sl@0: { 234, 3 }, sl@0: { 235, 0 }, sl@0: { 235, 3 }, sl@0: { 236, 0 }, sl@0: { 236, 2 }, sl@0: { 232, 3 }, sl@0: { 232, 2 }, sl@0: { 237, 6 }, sl@0: { 237, 8 }, sl@0: { 237, 5 }, sl@0: { 237, 4 }, sl@0: { 237, 1 }, sl@0: { 171, 4 }, sl@0: { 171, 6 }, sl@0: { 187, 1 }, sl@0: { 187, 1 }, sl@0: { 187, 1 }, sl@0: { 145, 4 }, sl@0: { 145, 6 }, sl@0: { 145, 3 }, sl@0: { 239, 0 }, sl@0: { 239, 2 }, sl@0: { 238, 1 }, sl@0: { 238, 0 }, sl@0: { 145, 1 }, sl@0: { 145, 3 }, sl@0: { 145, 1 }, sl@0: { 145, 3 }, sl@0: { 145, 6 }, sl@0: { 145, 6 }, sl@0: { 240, 1 }, sl@0: { 241, 0 }, sl@0: { 241, 1 }, sl@0: }; sl@0: sl@0: static void yy_accept(yyParser*); /* Forward Declaration */ sl@0: sl@0: /* sl@0: ** Perform a reduce action and the shift that must immediately sl@0: ** follow the reduce. sl@0: */ sl@0: static void yy_reduce( sl@0: yyParser *yypParser, /* The parser */ sl@0: int yyruleno /* Number of the rule by which to reduce */ sl@0: ){ sl@0: int yygoto; /* The next state */ sl@0: int yyact; /* The next action */ sl@0: YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ sl@0: yyStackEntry *yymsp; /* The top of the parser's stack */ sl@0: int yysize; /* Amount to pop the stack */ sl@0: sqlite3ParserARG_FETCH; sl@0: yymsp = &yypParser->yystack[yypParser->yyidx]; sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE && yyruleno>=0 sl@0: && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ sl@0: fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, sl@0: yyRuleName[yyruleno]); sl@0: } sl@0: #endif /* NDEBUG */ sl@0: sl@0: /* Silence complaints from purify about yygotominor being uninitialized sl@0: ** in some cases when it is copied into the stack after the following sl@0: ** switch. yygotominor is uninitialized when a rule reduces that does sl@0: ** not set the value of its left-hand side nonterminal. Leaving the sl@0: ** value of the nonterminal uninitialized is utterly harmless as long sl@0: ** as the value is never used. So really the only thing this code sl@0: ** accomplishes is to quieten purify. sl@0: ** sl@0: ** 2007-01-16: The wireshark project (www.wireshark.org) reports that sl@0: ** without this code, their parser segfaults. I'm not sure what there sl@0: ** parser is doing to make this happen. This is the second bug report sl@0: ** from wireshark this week. Clearly they are stressing Lemon in ways sl@0: ** that it has not been previously stressed... (SQLite ticket #2172) sl@0: */ sl@0: /*memset(&yygotominor, 0, sizeof(yygotominor));*/ sl@0: yygotominor = yyzerominor; sl@0: sl@0: sl@0: switch( yyruleno ){ sl@0: /* Beginning here are the reduction cases. A typical example sl@0: ** follows: sl@0: ** case 0: sl@0: ** #line sl@0: ** { ... } // User supplied code sl@0: ** #line sl@0: ** break; sl@0: */ sl@0: case 0: /* input ::= cmdlist */ sl@0: case 1: /* cmdlist ::= cmdlist ecmd */ sl@0: case 2: /* cmdlist ::= ecmd */ sl@0: case 3: /* ecmd ::= SEMI */ sl@0: case 4: /* ecmd ::= explain cmdx SEMI */ sl@0: case 10: /* trans_opt ::= */ sl@0: case 11: /* trans_opt ::= TRANSACTION */ sl@0: case 12: /* trans_opt ::= TRANSACTION nm */ sl@0: case 20: /* cmd ::= create_table create_table_args */ sl@0: case 28: /* columnlist ::= columnlist COMMA column */ sl@0: case 29: /* columnlist ::= column */ sl@0: case 37: /* type ::= */ sl@0: case 44: /* signed ::= plus_num */ sl@0: case 45: /* signed ::= minus_num */ sl@0: case 46: /* carglist ::= carglist carg */ sl@0: case 47: /* carglist ::= */ sl@0: case 48: /* carg ::= CONSTRAINT nm ccons */ sl@0: case 49: /* carg ::= ccons */ sl@0: case 55: /* ccons ::= NULL onconf */ sl@0: case 82: /* conslist ::= conslist COMMA tcons */ sl@0: case 83: /* conslist ::= conslist tcons */ sl@0: case 84: /* conslist ::= tcons */ sl@0: case 85: /* tcons ::= CONSTRAINT nm */ sl@0: case 260: /* plus_opt ::= PLUS */ sl@0: case 261: /* plus_opt ::= */ sl@0: case 271: /* foreach_clause ::= */ sl@0: case 272: /* foreach_clause ::= FOR EACH ROW */ sl@0: case 292: /* database_kw_opt ::= DATABASE */ sl@0: case 293: /* database_kw_opt ::= */ sl@0: case 301: /* kwcolumn_opt ::= */ sl@0: case 302: /* kwcolumn_opt ::= COLUMNKW */ sl@0: #line 91 "parse.y" sl@0: { sl@0: } sl@0: #line 1974 "parse.c" sl@0: break; sl@0: case 5: /* explain ::= */ sl@0: #line 96 "parse.y" sl@0: { sqlite3BeginParse(pParse, 0); } sl@0: #line 1979 "parse.c" sl@0: break; sl@0: case 6: /* explain ::= EXPLAIN */ sl@0: #line 98 "parse.y" sl@0: { sqlite3BeginParse(pParse, 1); } sl@0: #line 1984 "parse.c" sl@0: break; sl@0: case 7: /* explain ::= EXPLAIN QUERY PLAN */ sl@0: #line 99 "parse.y" sl@0: { sqlite3BeginParse(pParse, 2); } sl@0: #line 1989 "parse.c" sl@0: break; sl@0: case 8: /* cmdx ::= cmd */ sl@0: #line 101 "parse.y" sl@0: { sqlite3FinishCoding(pParse); } sl@0: #line 1994 "parse.c" sl@0: break; sl@0: case 9: /* cmd ::= BEGIN transtype trans_opt */ sl@0: #line 106 "parse.y" sl@0: {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy328);} sl@0: #line 1999 "parse.c" sl@0: break; sl@0: case 13: /* transtype ::= */ sl@0: #line 111 "parse.y" sl@0: {yygotominor.yy328 = TK_DEFERRED;} sl@0: #line 2004 "parse.c" sl@0: break; sl@0: case 14: /* transtype ::= DEFERRED */ sl@0: case 15: /* transtype ::= IMMEDIATE */ sl@0: case 16: /* transtype ::= EXCLUSIVE */ sl@0: case 107: /* multiselect_op ::= UNION */ sl@0: case 109: /* multiselect_op ::= EXCEPT|INTERSECT */ sl@0: #line 112 "parse.y" sl@0: {yygotominor.yy328 = yymsp[0].major;} sl@0: #line 2013 "parse.c" sl@0: break; sl@0: case 17: /* cmd ::= COMMIT trans_opt */ sl@0: case 18: /* cmd ::= END trans_opt */ sl@0: #line 115 "parse.y" sl@0: {sqlite3CommitTransaction(pParse);} sl@0: #line 2019 "parse.c" sl@0: break; sl@0: case 19: /* cmd ::= ROLLBACK trans_opt */ sl@0: #line 117 "parse.y" sl@0: {sqlite3RollbackTransaction(pParse);} sl@0: #line 2024 "parse.c" sl@0: break; sl@0: case 21: /* create_table ::= CREATE temp TABLE ifnotexists nm dbnm */ sl@0: #line 122 "parse.y" sl@0: { sl@0: sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy328,0,0,yymsp[-2].minor.yy328); sl@0: } sl@0: #line 2031 "parse.c" sl@0: break; sl@0: case 22: /* ifnotexists ::= */ sl@0: case 25: /* temp ::= */ sl@0: case 63: /* autoinc ::= */ sl@0: case 77: /* init_deferred_pred_opt ::= */ sl@0: case 79: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ sl@0: case 90: /* defer_subclause_opt ::= */ sl@0: case 101: /* ifexists ::= */ sl@0: case 112: /* distinct ::= ALL */ sl@0: case 113: /* distinct ::= */ sl@0: case 216: /* between_op ::= BETWEEN */ sl@0: case 219: /* in_op ::= IN */ sl@0: #line 126 "parse.y" sl@0: {yygotominor.yy328 = 0;} sl@0: #line 2046 "parse.c" sl@0: break; sl@0: case 23: /* ifnotexists ::= IF NOT EXISTS */ sl@0: case 24: /* temp ::= TEMP */ sl@0: case 64: /* autoinc ::= AUTOINCR */ sl@0: case 78: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ sl@0: case 100: /* ifexists ::= IF EXISTS */ sl@0: case 111: /* distinct ::= DISTINCT */ sl@0: case 217: /* between_op ::= NOT BETWEEN */ sl@0: case 220: /* in_op ::= NOT IN */ sl@0: #line 127 "parse.y" sl@0: {yygotominor.yy328 = 1;} sl@0: #line 2058 "parse.c" sl@0: break; sl@0: case 26: /* create_table_args ::= LP columnlist conslist_opt RP */ sl@0: #line 133 "parse.y" sl@0: { sl@0: sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); sl@0: } sl@0: #line 2065 "parse.c" sl@0: break; sl@0: case 27: /* create_table_args ::= AS select */ sl@0: #line 136 "parse.y" sl@0: { sl@0: sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy91); sl@0: sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy91); sl@0: } sl@0: #line 2073 "parse.c" sl@0: break; sl@0: case 30: /* column ::= columnid type carglist */ sl@0: #line 148 "parse.y" sl@0: { sl@0: yygotominor.yy0.z = yymsp[-2].minor.yy0.z; sl@0: yygotominor.yy0.n = (pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n; sl@0: } sl@0: #line 2081 "parse.c" sl@0: break; sl@0: case 31: /* columnid ::= nm */ sl@0: #line 152 "parse.y" sl@0: { sl@0: sqlite3AddColumn(pParse,&yymsp[0].minor.yy0); sl@0: yygotominor.yy0 = yymsp[0].minor.yy0; sl@0: } sl@0: #line 2089 "parse.c" sl@0: break; sl@0: case 32: /* id ::= ID */ sl@0: case 33: /* ids ::= ID|STRING */ sl@0: case 34: /* nm ::= ID */ sl@0: case 35: /* nm ::= STRING */ sl@0: case 36: /* nm ::= JOIN_KW */ sl@0: case 39: /* typetoken ::= typename */ sl@0: case 42: /* typename ::= ids */ sl@0: case 119: /* as ::= AS nm */ sl@0: case 120: /* as ::= ids */ sl@0: case 131: /* dbnm ::= DOT nm */ sl@0: case 140: /* indexed_opt ::= INDEXED BY nm */ sl@0: case 245: /* collate ::= COLLATE ids */ sl@0: case 255: /* nmnum ::= plus_num */ sl@0: case 256: /* nmnum ::= nm */ sl@0: case 257: /* plus_num ::= plus_opt number */ sl@0: case 258: /* minus_num ::= MINUS number */ sl@0: case 259: /* number ::= INTEGER|FLOAT */ sl@0: #line 162 "parse.y" sl@0: {yygotominor.yy0 = yymsp[0].minor.yy0;} sl@0: #line 2110 "parse.c" sl@0: break; sl@0: case 38: /* type ::= typetoken */ sl@0: #line 223 "parse.y" sl@0: {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} sl@0: #line 2115 "parse.c" sl@0: break; sl@0: case 40: /* typetoken ::= typename LP signed RP */ sl@0: #line 225 "parse.y" sl@0: { sl@0: yygotominor.yy0.z = yymsp[-3].minor.yy0.z; sl@0: yygotominor.yy0.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z; sl@0: } sl@0: #line 2123 "parse.c" sl@0: break; sl@0: case 41: /* typetoken ::= typename LP signed COMMA signed RP */ sl@0: #line 229 "parse.y" sl@0: { sl@0: yygotominor.yy0.z = yymsp[-5].minor.yy0.z; sl@0: yygotominor.yy0.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z; sl@0: } sl@0: #line 2131 "parse.c" sl@0: break; sl@0: case 43: /* typename ::= typename ids */ sl@0: #line 235 "parse.y" sl@0: {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);} sl@0: #line 2136 "parse.c" sl@0: break; sl@0: case 50: /* ccons ::= DEFAULT term */ sl@0: case 52: /* ccons ::= DEFAULT PLUS term */ sl@0: #line 246 "parse.y" sl@0: {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy418);} sl@0: #line 2142 "parse.c" sl@0: break; sl@0: case 51: /* ccons ::= DEFAULT LP expr RP */ sl@0: #line 247 "parse.y" sl@0: {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy418);} sl@0: #line 2147 "parse.c" sl@0: break; sl@0: case 53: /* ccons ::= DEFAULT MINUS term */ sl@0: #line 249 "parse.y" sl@0: { sl@0: Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy418, 0, 0); sl@0: sqlite3AddDefaultValue(pParse,p); sl@0: } sl@0: #line 2155 "parse.c" sl@0: break; sl@0: case 54: /* ccons ::= DEFAULT id */ sl@0: #line 253 "parse.y" sl@0: { sl@0: Expr *p = sqlite3PExpr(pParse, TK_STRING, 0, 0, &yymsp[0].minor.yy0); sl@0: sqlite3AddDefaultValue(pParse,p); sl@0: } sl@0: #line 2163 "parse.c" sl@0: break; sl@0: case 56: /* ccons ::= NOT NULL onconf */ sl@0: #line 262 "parse.y" sl@0: {sqlite3AddNotNull(pParse, yymsp[0].minor.yy328);} sl@0: #line 2168 "parse.c" sl@0: break; sl@0: case 57: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ sl@0: #line 264 "parse.y" sl@0: {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy328,yymsp[0].minor.yy328,yymsp[-2].minor.yy328);} sl@0: #line 2173 "parse.c" sl@0: break; sl@0: case 58: /* ccons ::= UNIQUE onconf */ sl@0: #line 265 "parse.y" sl@0: {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy328,0,0,0,0);} sl@0: #line 2178 "parse.c" sl@0: break; sl@0: case 59: /* ccons ::= CHECK LP expr RP */ sl@0: #line 266 "parse.y" sl@0: {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy418);} sl@0: #line 2183 "parse.c" sl@0: break; sl@0: case 60: /* ccons ::= REFERENCES nm idxlist_opt refargs */ sl@0: #line 268 "parse.y" sl@0: {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy328);} sl@0: #line 2188 "parse.c" sl@0: break; sl@0: case 61: /* ccons ::= defer_subclause */ sl@0: #line 269 "parse.y" sl@0: {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy328);} sl@0: #line 2193 "parse.c" sl@0: break; sl@0: case 62: /* ccons ::= COLLATE ids */ sl@0: #line 270 "parse.y" sl@0: {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} sl@0: #line 2198 "parse.c" sl@0: break; sl@0: case 65: /* refargs ::= */ sl@0: #line 283 "parse.y" sl@0: { yygotominor.yy328 = OE_Restrict * 0x010101; } sl@0: #line 2203 "parse.c" sl@0: break; sl@0: case 66: /* refargs ::= refargs refarg */ sl@0: #line 284 "parse.y" sl@0: { yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy319.mask) | yymsp[0].minor.yy319.value; } sl@0: #line 2208 "parse.c" sl@0: break; sl@0: case 67: /* refarg ::= MATCH nm */ sl@0: #line 286 "parse.y" sl@0: { yygotominor.yy319.value = 0; yygotominor.yy319.mask = 0x000000; } sl@0: #line 2213 "parse.c" sl@0: break; sl@0: case 68: /* refarg ::= ON DELETE refact */ sl@0: #line 287 "parse.y" sl@0: { yygotominor.yy319.value = yymsp[0].minor.yy328; yygotominor.yy319.mask = 0x0000ff; } sl@0: #line 2218 "parse.c" sl@0: break; sl@0: case 69: /* refarg ::= ON UPDATE refact */ sl@0: #line 288 "parse.y" sl@0: { yygotominor.yy319.value = yymsp[0].minor.yy328<<8; yygotominor.yy319.mask = 0x00ff00; } sl@0: #line 2223 "parse.c" sl@0: break; sl@0: case 70: /* refarg ::= ON INSERT refact */ sl@0: #line 289 "parse.y" sl@0: { yygotominor.yy319.value = yymsp[0].minor.yy328<<16; yygotominor.yy319.mask = 0xff0000; } sl@0: #line 2228 "parse.c" sl@0: break; sl@0: case 71: /* refact ::= SET NULL */ sl@0: #line 291 "parse.y" sl@0: { yygotominor.yy328 = OE_SetNull; } sl@0: #line 2233 "parse.c" sl@0: break; sl@0: case 72: /* refact ::= SET DEFAULT */ sl@0: #line 292 "parse.y" sl@0: { yygotominor.yy328 = OE_SetDflt; } sl@0: #line 2238 "parse.c" sl@0: break; sl@0: case 73: /* refact ::= CASCADE */ sl@0: #line 293 "parse.y" sl@0: { yygotominor.yy328 = OE_Cascade; } sl@0: #line 2243 "parse.c" sl@0: break; sl@0: case 74: /* refact ::= RESTRICT */ sl@0: #line 294 "parse.y" sl@0: { yygotominor.yy328 = OE_Restrict; } sl@0: #line 2248 "parse.c" sl@0: break; sl@0: case 75: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ sl@0: case 76: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ sl@0: case 91: /* defer_subclause_opt ::= defer_subclause */ sl@0: case 93: /* onconf ::= ON CONFLICT resolvetype */ sl@0: case 95: /* orconf ::= OR resolvetype */ sl@0: case 96: /* resolvetype ::= raisetype */ sl@0: case 169: /* insert_cmd ::= INSERT orconf */ sl@0: #line 296 "parse.y" sl@0: {yygotominor.yy328 = yymsp[0].minor.yy328;} sl@0: #line 2259 "parse.c" sl@0: break; sl@0: case 80: /* conslist_opt ::= */ sl@0: #line 306 "parse.y" sl@0: {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} sl@0: #line 2264 "parse.c" sl@0: break; sl@0: case 81: /* conslist_opt ::= COMMA conslist */ sl@0: #line 307 "parse.y" sl@0: {yygotominor.yy0 = yymsp[-1].minor.yy0;} sl@0: #line 2269 "parse.c" sl@0: break; sl@0: case 86: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ sl@0: #line 313 "parse.y" sl@0: {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy328,yymsp[-2].minor.yy328,0);} sl@0: #line 2274 "parse.c" sl@0: break; sl@0: case 87: /* tcons ::= UNIQUE LP idxlist RP onconf */ sl@0: #line 315 "parse.y" sl@0: {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy328,0,0,0,0);} sl@0: #line 2279 "parse.c" sl@0: break; sl@0: case 88: /* tcons ::= CHECK LP expr RP onconf */ sl@0: #line 316 "parse.y" sl@0: {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy418);} sl@0: #line 2284 "parse.c" sl@0: break; sl@0: case 89: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ sl@0: #line 318 "parse.y" sl@0: { sl@0: sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy328); sl@0: sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy328); sl@0: } sl@0: #line 2292 "parse.c" sl@0: break; sl@0: case 92: /* onconf ::= */ sl@0: case 94: /* orconf ::= */ sl@0: #line 332 "parse.y" sl@0: {yygotominor.yy328 = OE_Default;} sl@0: #line 2298 "parse.c" sl@0: break; sl@0: case 97: /* resolvetype ::= IGNORE */ sl@0: #line 337 "parse.y" sl@0: {yygotominor.yy328 = OE_Ignore;} sl@0: #line 2303 "parse.c" sl@0: break; sl@0: case 98: /* resolvetype ::= REPLACE */ sl@0: case 170: /* insert_cmd ::= REPLACE */ sl@0: #line 338 "parse.y" sl@0: {yygotominor.yy328 = OE_Replace;} sl@0: #line 2309 "parse.c" sl@0: break; sl@0: case 99: /* cmd ::= DROP TABLE ifexists fullname */ sl@0: #line 342 "parse.y" sl@0: { sl@0: sqlite3DropTable(pParse, yymsp[0].minor.yy439, 0, yymsp[-1].minor.yy328); sl@0: } sl@0: #line 2316 "parse.c" sl@0: break; sl@0: case 102: /* cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select */ sl@0: #line 352 "parse.y" sl@0: { sl@0: sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy91, yymsp[-6].minor.yy328, yymsp[-4].minor.yy328); sl@0: } sl@0: #line 2323 "parse.c" sl@0: break; sl@0: case 103: /* cmd ::= DROP VIEW ifexists fullname */ sl@0: #line 355 "parse.y" sl@0: { sl@0: sqlite3DropTable(pParse, yymsp[0].minor.yy439, 1, yymsp[-1].minor.yy328); sl@0: } sl@0: #line 2330 "parse.c" sl@0: break; sl@0: case 104: /* cmd ::= select */ sl@0: #line 362 "parse.y" sl@0: { sl@0: SelectDest dest = {SRT_Output, 0, 0, 0, 0}; sl@0: sqlite3Select(pParse, yymsp[0].minor.yy91, &dest); sl@0: sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy91); sl@0: } sl@0: #line 2339 "parse.c" sl@0: break; sl@0: case 105: /* select ::= oneselect */ sl@0: case 128: /* seltablist_paren ::= select */ sl@0: #line 373 "parse.y" sl@0: {yygotominor.yy91 = yymsp[0].minor.yy91;} sl@0: #line 2345 "parse.c" sl@0: break; sl@0: case 106: /* select ::= select multiselect_op oneselect */ sl@0: #line 375 "parse.y" sl@0: { sl@0: if( yymsp[0].minor.yy91 ){ sl@0: yymsp[0].minor.yy91->op = yymsp[-1].minor.yy328; sl@0: yymsp[0].minor.yy91->pPrior = yymsp[-2].minor.yy91; sl@0: }else{ sl@0: sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy91); sl@0: } sl@0: yygotominor.yy91 = yymsp[0].minor.yy91; sl@0: } sl@0: #line 2358 "parse.c" sl@0: break; sl@0: case 108: /* multiselect_op ::= UNION ALL */ sl@0: #line 386 "parse.y" sl@0: {yygotominor.yy328 = TK_ALL;} sl@0: #line 2363 "parse.c" sl@0: break; sl@0: case 110: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ sl@0: #line 390 "parse.y" sl@0: { sl@0: yygotominor.yy91 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy439,yymsp[-4].minor.yy418,yymsp[-3].minor.yy322,yymsp[-2].minor.yy418,yymsp[-1].minor.yy322,yymsp[-7].minor.yy328,yymsp[0].minor.yy388.pLimit,yymsp[0].minor.yy388.pOffset); sl@0: } sl@0: #line 2370 "parse.c" sl@0: break; sl@0: case 114: /* sclp ::= selcollist COMMA */ sl@0: case 241: /* idxlist_opt ::= LP idxlist RP */ sl@0: #line 411 "parse.y" sl@0: {yygotominor.yy322 = yymsp[-1].minor.yy322;} sl@0: #line 2376 "parse.c" sl@0: break; sl@0: case 115: /* sclp ::= */ sl@0: case 144: /* orderby_opt ::= */ sl@0: case 152: /* groupby_opt ::= */ sl@0: case 234: /* exprlist ::= */ sl@0: case 240: /* idxlist_opt ::= */ sl@0: #line 412 "parse.y" sl@0: {yygotominor.yy322 = 0;} sl@0: #line 2385 "parse.c" sl@0: break; sl@0: case 116: /* selcollist ::= sclp expr as */ sl@0: #line 413 "parse.y" sl@0: { sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy418,yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); sl@0: } sl@0: #line 2392 "parse.c" sl@0: break; sl@0: case 117: /* selcollist ::= sclp STAR */ sl@0: #line 416 "parse.y" sl@0: { sl@0: Expr *p = sqlite3PExpr(pParse, TK_ALL, 0, 0, 0); sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p, 0); sl@0: } sl@0: #line 2400 "parse.c" sl@0: break; sl@0: case 118: /* selcollist ::= sclp nm DOT STAR */ sl@0: #line 420 "parse.y" sl@0: { sl@0: Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); sl@0: Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); sl@0: Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot, 0); sl@0: } sl@0: #line 2410 "parse.c" sl@0: break; sl@0: case 121: /* as ::= */ sl@0: #line 433 "parse.y" sl@0: {yygotominor.yy0.n = 0;} sl@0: #line 2415 "parse.c" sl@0: break; sl@0: case 122: /* from ::= */ sl@0: #line 445 "parse.y" sl@0: {yygotominor.yy439 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy439));} sl@0: #line 2420 "parse.c" sl@0: break; sl@0: case 123: /* from ::= FROM seltablist */ sl@0: #line 446 "parse.y" sl@0: { sl@0: yygotominor.yy439 = yymsp[0].minor.yy439; sl@0: sqlite3SrcListShiftJoinType(yygotominor.yy439); sl@0: } sl@0: #line 2428 "parse.c" sl@0: break; sl@0: case 124: /* stl_prefix ::= seltablist joinop */ sl@0: #line 454 "parse.y" sl@0: { sl@0: yygotominor.yy439 = yymsp[-1].minor.yy439; sl@0: if( yygotominor.yy439 && yygotominor.yy439->nSrc>0 ) yygotominor.yy439->a[yygotominor.yy439->nSrc-1].jointype = yymsp[0].minor.yy328; sl@0: } sl@0: #line 2436 "parse.c" sl@0: break; sl@0: case 125: /* stl_prefix ::= */ sl@0: #line 458 "parse.y" sl@0: {yygotominor.yy439 = 0;} sl@0: #line 2441 "parse.c" sl@0: break; sl@0: case 126: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ sl@0: #line 459 "parse.y" sl@0: { sl@0: yygotominor.yy439 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy439,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy418,yymsp[0].minor.yy232); sl@0: sqlite3SrcListIndexedBy(pParse, yygotominor.yy439, &yymsp[-2].minor.yy0); sl@0: } sl@0: #line 2449 "parse.c" sl@0: break; sl@0: case 127: /* seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt */ sl@0: #line 465 "parse.y" sl@0: { sl@0: yygotominor.yy439 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy439,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy91,yymsp[-1].minor.yy418,yymsp[0].minor.yy232); sl@0: } sl@0: #line 2456 "parse.c" sl@0: break; sl@0: case 129: /* seltablist_paren ::= seltablist */ sl@0: #line 476 "parse.y" sl@0: { sl@0: sqlite3SrcListShiftJoinType(yymsp[0].minor.yy439); sl@0: yygotominor.yy91 = sqlite3SelectNew(pParse,0,yymsp[0].minor.yy439,0,0,0,0,0,0,0); sl@0: } sl@0: #line 2464 "parse.c" sl@0: break; sl@0: case 130: /* dbnm ::= */ sl@0: case 139: /* indexed_opt ::= */ sl@0: #line 483 "parse.y" sl@0: {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} sl@0: #line 2470 "parse.c" sl@0: break; sl@0: case 132: /* fullname ::= nm dbnm */ sl@0: #line 488 "parse.y" sl@0: {yygotominor.yy439 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} sl@0: #line 2475 "parse.c" sl@0: break; sl@0: case 133: /* joinop ::= COMMA|JOIN */ sl@0: #line 492 "parse.y" sl@0: { yygotominor.yy328 = JT_INNER; } sl@0: #line 2480 "parse.c" sl@0: break; sl@0: case 134: /* joinop ::= JOIN_KW JOIN */ sl@0: #line 493 "parse.y" sl@0: { yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } sl@0: #line 2485 "parse.c" sl@0: break; sl@0: case 135: /* joinop ::= JOIN_KW nm JOIN */ sl@0: #line 494 "parse.y" sl@0: { yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } sl@0: #line 2490 "parse.c" sl@0: break; sl@0: case 136: /* joinop ::= JOIN_KW nm nm JOIN */ sl@0: #line 496 "parse.y" sl@0: { yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } sl@0: #line 2495 "parse.c" sl@0: break; sl@0: case 137: /* on_opt ::= ON expr */ sl@0: case 148: /* sortitem ::= expr */ sl@0: case 155: /* having_opt ::= HAVING expr */ sl@0: case 162: /* where_opt ::= WHERE expr */ sl@0: case 177: /* expr ::= term */ sl@0: case 205: /* escape ::= ESCAPE expr */ sl@0: case 229: /* case_else ::= ELSE expr */ sl@0: case 231: /* case_operand ::= expr */ sl@0: #line 500 "parse.y" sl@0: {yygotominor.yy418 = yymsp[0].minor.yy418;} sl@0: #line 2507 "parse.c" sl@0: break; sl@0: case 138: /* on_opt ::= */ sl@0: case 154: /* having_opt ::= */ sl@0: case 161: /* where_opt ::= */ sl@0: case 206: /* escape ::= */ sl@0: case 230: /* case_else ::= */ sl@0: case 232: /* case_operand ::= */ sl@0: #line 501 "parse.y" sl@0: {yygotominor.yy418 = 0;} sl@0: #line 2517 "parse.c" sl@0: break; sl@0: case 141: /* indexed_opt ::= NOT INDEXED */ sl@0: #line 516 "parse.y" sl@0: {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} sl@0: #line 2522 "parse.c" sl@0: break; sl@0: case 142: /* using_opt ::= USING LP inscollist RP */ sl@0: case 174: /* inscollist_opt ::= LP inscollist RP */ sl@0: #line 520 "parse.y" sl@0: {yygotominor.yy232 = yymsp[-1].minor.yy232;} sl@0: #line 2528 "parse.c" sl@0: break; sl@0: case 143: /* using_opt ::= */ sl@0: case 173: /* inscollist_opt ::= */ sl@0: #line 521 "parse.y" sl@0: {yygotominor.yy232 = 0;} sl@0: #line 2534 "parse.c" sl@0: break; sl@0: case 145: /* orderby_opt ::= ORDER BY sortlist */ sl@0: case 153: /* groupby_opt ::= GROUP BY nexprlist */ sl@0: case 233: /* exprlist ::= nexprlist */ sl@0: #line 532 "parse.y" sl@0: {yygotominor.yy322 = yymsp[0].minor.yy322;} sl@0: #line 2541 "parse.c" sl@0: break; sl@0: case 146: /* sortlist ::= sortlist COMMA sortitem sortorder */ sl@0: #line 533 "parse.y" sl@0: { sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy418,0); sl@0: if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = yymsp[0].minor.yy328; sl@0: } sl@0: #line 2549 "parse.c" sl@0: break; sl@0: case 147: /* sortlist ::= sortitem sortorder */ sl@0: #line 537 "parse.y" sl@0: { sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy418,0); sl@0: if( yygotominor.yy322 && yygotominor.yy322->a ) yygotominor.yy322->a[0].sortOrder = yymsp[0].minor.yy328; sl@0: } sl@0: #line 2557 "parse.c" sl@0: break; sl@0: case 149: /* sortorder ::= ASC */ sl@0: case 151: /* sortorder ::= */ sl@0: #line 545 "parse.y" sl@0: {yygotominor.yy328 = SQLITE_SO_ASC;} sl@0: #line 2563 "parse.c" sl@0: break; sl@0: case 150: /* sortorder ::= DESC */ sl@0: #line 546 "parse.y" sl@0: {yygotominor.yy328 = SQLITE_SO_DESC;} sl@0: #line 2568 "parse.c" sl@0: break; sl@0: case 156: /* limit_opt ::= */ sl@0: #line 572 "parse.y" sl@0: {yygotominor.yy388.pLimit = 0; yygotominor.yy388.pOffset = 0;} sl@0: #line 2573 "parse.c" sl@0: break; sl@0: case 157: /* limit_opt ::= LIMIT expr */ sl@0: #line 573 "parse.y" sl@0: {yygotominor.yy388.pLimit = yymsp[0].minor.yy418; yygotominor.yy388.pOffset = 0;} sl@0: #line 2578 "parse.c" sl@0: break; sl@0: case 158: /* limit_opt ::= LIMIT expr OFFSET expr */ sl@0: #line 575 "parse.y" sl@0: {yygotominor.yy388.pLimit = yymsp[-2].minor.yy418; yygotominor.yy388.pOffset = yymsp[0].minor.yy418;} sl@0: #line 2583 "parse.c" sl@0: break; sl@0: case 159: /* limit_opt ::= LIMIT expr COMMA expr */ sl@0: #line 577 "parse.y" sl@0: {yygotominor.yy388.pOffset = yymsp[-2].minor.yy418; yygotominor.yy388.pLimit = yymsp[0].minor.yy418;} sl@0: #line 2588 "parse.c" sl@0: break; sl@0: case 160: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ sl@0: #line 590 "parse.y" sl@0: { sl@0: sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy439, &yymsp[-1].minor.yy0); sl@0: sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy439,yymsp[0].minor.yy418); sl@0: } sl@0: #line 2596 "parse.c" sl@0: break; sl@0: case 163: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ sl@0: #line 613 "parse.y" sl@0: { sl@0: sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy439, &yymsp[-3].minor.yy0); sl@0: sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); sl@0: sqlite3Update(pParse,yymsp[-4].minor.yy439,yymsp[-1].minor.yy322,yymsp[0].minor.yy418,yymsp[-5].minor.yy328); sl@0: } sl@0: #line 2605 "parse.c" sl@0: break; sl@0: case 164: /* setlist ::= setlist COMMA nm EQ expr */ sl@0: #line 624 "parse.y" sl@0: {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322,yymsp[0].minor.yy418,&yymsp[-2].minor.yy0);} sl@0: #line 2610 "parse.c" sl@0: break; sl@0: case 165: /* setlist ::= nm EQ expr */ sl@0: #line 626 "parse.y" sl@0: {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy418,&yymsp[-2].minor.yy0);} sl@0: #line 2615 "parse.c" sl@0: break; sl@0: case 166: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ sl@0: #line 632 "parse.y" sl@0: {sqlite3Insert(pParse, yymsp[-5].minor.yy439, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy232, yymsp[-7].minor.yy328);} sl@0: #line 2620 "parse.c" sl@0: break; sl@0: case 167: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ sl@0: #line 634 "parse.y" sl@0: {sqlite3Insert(pParse, yymsp[-2].minor.yy439, 0, yymsp[0].minor.yy91, yymsp[-1].minor.yy232, yymsp[-4].minor.yy328);} sl@0: #line 2625 "parse.c" sl@0: break; sl@0: case 168: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ sl@0: #line 636 "parse.y" sl@0: {sqlite3Insert(pParse, yymsp[-3].minor.yy439, 0, 0, yymsp[-2].minor.yy232, yymsp[-5].minor.yy328);} sl@0: #line 2630 "parse.c" sl@0: break; sl@0: case 171: /* itemlist ::= itemlist COMMA expr */ sl@0: case 235: /* nexprlist ::= nexprlist COMMA expr */ sl@0: #line 647 "parse.y" sl@0: {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy418,0);} sl@0: #line 2636 "parse.c" sl@0: break; sl@0: case 172: /* itemlist ::= expr */ sl@0: case 236: /* nexprlist ::= expr */ sl@0: #line 649 "parse.y" sl@0: {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy418,0);} sl@0: #line 2642 "parse.c" sl@0: break; sl@0: case 175: /* inscollist ::= inscollist COMMA nm */ sl@0: #line 659 "parse.y" sl@0: {yygotominor.yy232 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy232,&yymsp[0].minor.yy0);} sl@0: #line 2647 "parse.c" sl@0: break; sl@0: case 176: /* inscollist ::= nm */ sl@0: #line 661 "parse.y" sl@0: {yygotominor.yy232 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} sl@0: #line 2652 "parse.c" sl@0: break; sl@0: case 178: /* expr ::= LP expr RP */ sl@0: #line 672 "parse.y" sl@0: {yygotominor.yy418 = yymsp[-1].minor.yy418; sqlite3ExprSpan(yygotominor.yy418,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } sl@0: #line 2657 "parse.c" sl@0: break; sl@0: case 179: /* term ::= NULL */ sl@0: case 184: /* term ::= INTEGER|FLOAT|BLOB */ sl@0: case 185: /* term ::= STRING */ sl@0: #line 673 "parse.y" sl@0: {yygotominor.yy418 = sqlite3PExpr(pParse, yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);} sl@0: #line 2664 "parse.c" sl@0: break; sl@0: case 180: /* expr ::= ID */ sl@0: case 181: /* expr ::= JOIN_KW */ sl@0: #line 674 "parse.y" sl@0: {yygotominor.yy418 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);} sl@0: #line 2670 "parse.c" sl@0: break; sl@0: case 182: /* expr ::= nm DOT nm */ sl@0: #line 676 "parse.y" sl@0: { sl@0: Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); sl@0: Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); sl@0: } sl@0: #line 2679 "parse.c" sl@0: break; sl@0: case 183: /* expr ::= nm DOT nm DOT nm */ sl@0: #line 681 "parse.y" sl@0: { sl@0: Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); sl@0: Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); sl@0: Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); sl@0: Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); sl@0: } sl@0: #line 2690 "parse.c" sl@0: break; sl@0: case 186: /* expr ::= REGISTER */ sl@0: #line 690 "parse.y" sl@0: {yygotominor.yy418 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);} sl@0: #line 2695 "parse.c" sl@0: break; sl@0: case 187: /* expr ::= VARIABLE */ sl@0: #line 691 "parse.y" sl@0: { sl@0: Token *pToken = &yymsp[0].minor.yy0; sl@0: Expr *pExpr = yygotominor.yy418 = sqlite3PExpr(pParse, TK_VARIABLE, 0, 0, pToken); sl@0: sqlite3ExprAssignVarNumber(pParse, pExpr); sl@0: } sl@0: #line 2704 "parse.c" sl@0: break; sl@0: case 188: /* expr ::= expr COLLATE ids */ sl@0: #line 696 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3ExprSetColl(pParse, yymsp[-2].minor.yy418, &yymsp[0].minor.yy0); sl@0: } sl@0: #line 2711 "parse.c" sl@0: break; sl@0: case 189: /* expr ::= CAST LP expr AS typetoken RP */ sl@0: #line 700 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy418, 0, &yymsp[-1].minor.yy0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2719 "parse.c" sl@0: break; sl@0: case 190: /* expr ::= ID LP distinct exprlist RP */ sl@0: #line 705 "parse.y" sl@0: { sl@0: if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>SQLITE_MAX_FUNCTION_ARG ){ sl@0: sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); sl@0: } sl@0: yygotominor.yy418 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); sl@0: if( yymsp[-2].minor.yy328 && yygotominor.yy418 ){ sl@0: yygotominor.yy418->flags |= EP_Distinct; sl@0: } sl@0: } sl@0: #line 2733 "parse.c" sl@0: break; sl@0: case 191: /* expr ::= ID LP STAR RP */ sl@0: #line 715 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2741 "parse.c" sl@0: break; sl@0: case 192: /* term ::= CTIME_KW */ sl@0: #line 719 "parse.y" sl@0: { sl@0: /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are sl@0: ** treated as functions that return constants */ sl@0: yygotominor.yy418 = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); sl@0: if( yygotominor.yy418 ){ sl@0: yygotominor.yy418->op = TK_CONST_FUNC; sl@0: yygotominor.yy418->span = yymsp[0].minor.yy0; sl@0: } sl@0: } sl@0: #line 2754 "parse.c" sl@0: break; sl@0: case 193: /* expr ::= expr AND expr */ sl@0: case 194: /* expr ::= expr OR expr */ sl@0: case 195: /* expr ::= expr LT|GT|GE|LE expr */ sl@0: case 196: /* expr ::= expr EQ|NE expr */ sl@0: case 197: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ sl@0: case 198: /* expr ::= expr PLUS|MINUS expr */ sl@0: case 199: /* expr ::= expr STAR|SLASH|REM expr */ sl@0: case 200: /* expr ::= expr CONCAT expr */ sl@0: #line 728 "parse.y" sl@0: {yygotominor.yy418 = sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy418,yymsp[0].minor.yy418,0);} sl@0: #line 2766 "parse.c" sl@0: break; sl@0: case 201: /* likeop ::= LIKE_KW */ sl@0: case 203: /* likeop ::= MATCH */ sl@0: #line 740 "parse.y" sl@0: {yygotominor.yy30.eOperator = yymsp[0].minor.yy0; yygotominor.yy30.not = 0;} sl@0: #line 2772 "parse.c" sl@0: break; sl@0: case 202: /* likeop ::= NOT LIKE_KW */ sl@0: case 204: /* likeop ::= NOT MATCH */ sl@0: #line 741 "parse.y" sl@0: {yygotominor.yy30.eOperator = yymsp[0].minor.yy0; yygotominor.yy30.not = 1;} sl@0: #line 2778 "parse.c" sl@0: break; sl@0: case 207: /* expr ::= expr likeop expr escape */ sl@0: #line 748 "parse.y" sl@0: { sl@0: ExprList *pList; sl@0: pList = sqlite3ExprListAppend(pParse,0, yymsp[-1].minor.yy418, 0); sl@0: pList = sqlite3ExprListAppend(pParse,pList, yymsp[-3].minor.yy418, 0); sl@0: if( yymsp[0].minor.yy418 ){ sl@0: pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy418, 0); sl@0: } sl@0: yygotominor.yy418 = sqlite3ExprFunction(pParse, pList, &yymsp[-2].minor.yy30.eOperator); sl@0: if( yymsp[-2].minor.yy30.not ) yygotominor.yy418 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418, &yymsp[-3].minor.yy418->span, &yymsp[-1].minor.yy418->span); sl@0: if( yygotominor.yy418 ) yygotominor.yy418->flags |= EP_InfixFunc; sl@0: } sl@0: #line 2794 "parse.c" sl@0: break; sl@0: case 208: /* expr ::= expr ISNULL|NOTNULL */ sl@0: #line 761 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, yymsp[0].major, yymsp[-1].minor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-1].minor.yy418->span,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2802 "parse.c" sl@0: break; sl@0: case 209: /* expr ::= expr IS NULL */ sl@0: #line 765 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_ISNULL, yymsp[-2].minor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-2].minor.yy418->span,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2810 "parse.c" sl@0: break; sl@0: case 210: /* expr ::= expr NOT NULL */ sl@0: #line 769 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-2].minor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-2].minor.yy418->span,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2818 "parse.c" sl@0: break; sl@0: case 211: /* expr ::= expr IS NOT NULL */ sl@0: #line 773 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-3].minor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-3].minor.yy418->span,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2826 "parse.c" sl@0: break; sl@0: case 212: /* expr ::= NOT expr */ sl@0: case 213: /* expr ::= BITNOT expr */ sl@0: #line 777 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy418->span); sl@0: } sl@0: #line 2835 "parse.c" sl@0: break; sl@0: case 214: /* expr ::= MINUS expr */ sl@0: #line 785 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy418->span); sl@0: } sl@0: #line 2843 "parse.c" sl@0: break; sl@0: case 215: /* expr ::= PLUS expr */ sl@0: #line 789 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy418->span); sl@0: } sl@0: #line 2851 "parse.c" sl@0: break; sl@0: case 218: /* expr ::= expr between_op expr AND expr */ sl@0: #line 796 "parse.y" sl@0: { sl@0: ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy418, 0); sl@0: pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy418, 0); sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy418, 0, 0); sl@0: if( yygotominor.yy418 ){ sl@0: yygotominor.yy418->pList = pList; sl@0: }else{ sl@0: sqlite3ExprListDelete(pParse->db, pList); sl@0: } sl@0: if( yymsp[-3].minor.yy328 ) yygotominor.yy418 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-4].minor.yy418->span,&yymsp[0].minor.yy418->span); sl@0: } sl@0: #line 2867 "parse.c" sl@0: break; sl@0: case 221: /* expr ::= expr in_op LP exprlist RP */ sl@0: #line 812 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy418, 0, 0); sl@0: if( yygotominor.yy418 ){ sl@0: yygotominor.yy418->pList = yymsp[-1].minor.yy322; sl@0: sqlite3ExprSetHeight(pParse, yygotominor.yy418); sl@0: }else{ sl@0: sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322); sl@0: } sl@0: if( yymsp[-3].minor.yy328 ) yygotominor.yy418 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-4].minor.yy418->span,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2882 "parse.c" sl@0: break; sl@0: case 222: /* expr ::= LP select RP */ sl@0: #line 823 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); sl@0: if( yygotominor.yy418 ){ sl@0: yygotominor.yy418->pSelect = yymsp[-1].minor.yy91; sl@0: sqlite3ExprSetHeight(pParse, yygotominor.yy418); sl@0: }else{ sl@0: sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy91); sl@0: } sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2896 "parse.c" sl@0: break; sl@0: case 223: /* expr ::= expr in_op LP select RP */ sl@0: #line 833 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy418, 0, 0); sl@0: if( yygotominor.yy418 ){ sl@0: yygotominor.yy418->pSelect = yymsp[-1].minor.yy91; sl@0: sqlite3ExprSetHeight(pParse, yygotominor.yy418); sl@0: }else{ sl@0: sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy91); sl@0: } sl@0: if( yymsp[-3].minor.yy328 ) yygotominor.yy418 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-4].minor.yy418->span,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 2911 "parse.c" sl@0: break; sl@0: case 224: /* expr ::= expr in_op nm dbnm */ sl@0: #line 844 "parse.y" sl@0: { sl@0: SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy418, 0, 0); sl@0: if( yygotominor.yy418 ){ sl@0: yygotominor.yy418->pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); sl@0: sqlite3ExprSetHeight(pParse, yygotominor.yy418); sl@0: }else{ sl@0: sqlite3SrcListDelete(pParse->db, pSrc); sl@0: } sl@0: if( yymsp[-2].minor.yy328 ) yygotominor.yy418 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy418, 0, 0); sl@0: sqlite3ExprSpan(yygotominor.yy418,&yymsp[-3].minor.yy418->span,yymsp[0].minor.yy0.z?&yymsp[0].minor.yy0:&yymsp[-1].minor.yy0); sl@0: } sl@0: #line 2927 "parse.c" sl@0: break; sl@0: case 225: /* expr ::= EXISTS LP select RP */ sl@0: #line 856 "parse.y" sl@0: { sl@0: Expr *p = yygotominor.yy418 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); sl@0: if( p ){ sl@0: p->pSelect = yymsp[-1].minor.yy91; sl@0: sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); sl@0: sqlite3ExprSetHeight(pParse, yygotominor.yy418); sl@0: }else{ sl@0: sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy91); sl@0: } sl@0: } sl@0: #line 2941 "parse.c" sl@0: break; sl@0: case 226: /* expr ::= CASE case_operand case_exprlist case_else END */ sl@0: #line 869 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy418, yymsp[-1].minor.yy418, 0); sl@0: if( yygotominor.yy418 ){ sl@0: yygotominor.yy418->pList = yymsp[-2].minor.yy322; sl@0: sqlite3ExprSetHeight(pParse, yygotominor.yy418); sl@0: }else{ sl@0: sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); sl@0: } sl@0: sqlite3ExprSpan(yygotominor.yy418, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0); sl@0: } sl@0: #line 2955 "parse.c" sl@0: break; sl@0: case 227: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ sl@0: #line 881 "parse.y" sl@0: { sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy418, 0); sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy418, 0); sl@0: } sl@0: #line 2963 "parse.c" sl@0: break; sl@0: case 228: /* case_exprlist ::= WHEN expr THEN expr */ sl@0: #line 885 "parse.y" sl@0: { sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy418, 0); sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy418, 0); sl@0: } sl@0: #line 2971 "parse.c" sl@0: break; sl@0: case 237: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ sl@0: #line 914 "parse.y" sl@0: { sl@0: sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, sl@0: sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy328, sl@0: &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy328); sl@0: } sl@0: #line 2980 "parse.c" sl@0: break; sl@0: case 238: /* uniqueflag ::= UNIQUE */ sl@0: case 285: /* raisetype ::= ABORT */ sl@0: #line 921 "parse.y" sl@0: {yygotominor.yy328 = OE_Abort;} sl@0: #line 2986 "parse.c" sl@0: break; sl@0: case 239: /* uniqueflag ::= */ sl@0: #line 922 "parse.y" sl@0: {yygotominor.yy328 = OE_None;} sl@0: #line 2991 "parse.c" sl@0: break; sl@0: case 242: /* idxlist ::= idxlist COMMA nm collate sortorder */ sl@0: #line 931 "parse.y" sl@0: { sl@0: Expr *p = 0; sl@0: if( yymsp[-1].minor.yy0.n>0 ){ sl@0: p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sl@0: sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0); sl@0: } sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p, &yymsp[-2].minor.yy0); sl@0: sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); sl@0: if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = yymsp[0].minor.yy328; sl@0: } sl@0: #line 3005 "parse.c" sl@0: break; sl@0: case 243: /* idxlist ::= nm collate sortorder */ sl@0: #line 941 "parse.y" sl@0: { sl@0: Expr *p = 0; sl@0: if( yymsp[-1].minor.yy0.n>0 ){ sl@0: p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sl@0: sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0); sl@0: } sl@0: yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p, &yymsp[-2].minor.yy0); sl@0: sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); sl@0: if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = yymsp[0].minor.yy328; sl@0: } sl@0: #line 3019 "parse.c" sl@0: break; sl@0: case 244: /* collate ::= */ sl@0: #line 953 "parse.y" sl@0: {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} sl@0: #line 3024 "parse.c" sl@0: break; sl@0: case 246: /* cmd ::= DROP INDEX ifexists fullname */ sl@0: #line 959 "parse.y" sl@0: {sqlite3DropIndex(pParse, yymsp[0].minor.yy439, yymsp[-1].minor.yy328);} sl@0: #line 3029 "parse.c" sl@0: break; sl@0: case 247: /* cmd ::= VACUUM */ sl@0: case 248: /* cmd ::= VACUUM nm */ sl@0: #line 965 "parse.y" sl@0: {sqlite3Vacuum(pParse);} sl@0: #line 3035 "parse.c" sl@0: break; sl@0: case 249: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ sl@0: case 250: /* cmd ::= PRAGMA nm dbnm EQ ON */ sl@0: case 251: /* cmd ::= PRAGMA nm dbnm EQ DELETE */ sl@0: #line 974 "parse.y" sl@0: {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} sl@0: #line 3042 "parse.c" sl@0: break; sl@0: case 252: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ sl@0: #line 977 "parse.y" sl@0: { sl@0: sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1); sl@0: } sl@0: #line 3049 "parse.c" sl@0: break; sl@0: case 253: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ sl@0: #line 980 "parse.y" sl@0: {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} sl@0: #line 3054 "parse.c" sl@0: break; sl@0: case 254: /* cmd ::= PRAGMA nm dbnm */ sl@0: #line 981 "parse.y" sl@0: {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} sl@0: #line 3059 "parse.c" sl@0: break; sl@0: case 262: /* cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END */ sl@0: #line 996 "parse.y" sl@0: { sl@0: Token all; sl@0: all.z = yymsp[-3].minor.yy0.z; sl@0: all.n = (yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; sl@0: sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy451, &all); sl@0: } sl@0: #line 3069 "parse.c" sl@0: break; sl@0: case 263: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ sl@0: #line 1005 "parse.y" sl@0: { sl@0: sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy328, yymsp[-4].minor.yy378.a, yymsp[-4].minor.yy378.b, yymsp[-2].minor.yy439, yymsp[0].minor.yy418, yymsp[-10].minor.yy328, yymsp[-8].minor.yy328); sl@0: yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); sl@0: } sl@0: #line 3077 "parse.c" sl@0: break; sl@0: case 264: /* trigger_time ::= BEFORE */ sl@0: case 267: /* trigger_time ::= */ sl@0: #line 1011 "parse.y" sl@0: { yygotominor.yy328 = TK_BEFORE; } sl@0: #line 3083 "parse.c" sl@0: break; sl@0: case 265: /* trigger_time ::= AFTER */ sl@0: #line 1012 "parse.y" sl@0: { yygotominor.yy328 = TK_AFTER; } sl@0: #line 3088 "parse.c" sl@0: break; sl@0: case 266: /* trigger_time ::= INSTEAD OF */ sl@0: #line 1013 "parse.y" sl@0: { yygotominor.yy328 = TK_INSTEAD;} sl@0: #line 3093 "parse.c" sl@0: break; sl@0: case 268: /* trigger_event ::= DELETE|INSERT */ sl@0: case 269: /* trigger_event ::= UPDATE */ sl@0: #line 1018 "parse.y" sl@0: {yygotominor.yy378.a = yymsp[0].major; yygotominor.yy378.b = 0;} sl@0: #line 3099 "parse.c" sl@0: break; sl@0: case 270: /* trigger_event ::= UPDATE OF inscollist */ sl@0: #line 1020 "parse.y" sl@0: {yygotominor.yy378.a = TK_UPDATE; yygotominor.yy378.b = yymsp[0].minor.yy232;} sl@0: #line 3104 "parse.c" sl@0: break; sl@0: case 273: /* when_clause ::= */ sl@0: case 290: /* key_opt ::= */ sl@0: #line 1027 "parse.y" sl@0: { yygotominor.yy418 = 0; } sl@0: #line 3110 "parse.c" sl@0: break; sl@0: case 274: /* when_clause ::= WHEN expr */ sl@0: case 291: /* key_opt ::= KEY expr */ sl@0: #line 1028 "parse.y" sl@0: { yygotominor.yy418 = yymsp[0].minor.yy418; } sl@0: #line 3116 "parse.c" sl@0: break; sl@0: case 275: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ sl@0: #line 1032 "parse.y" sl@0: { sl@0: /* sl@0: if( yymsp[-2].minor.yy451 ){ sl@0: yymsp[-2].minor.yy451->pLast->pNext = yymsp[-1].minor.yy451; sl@0: }else{ sl@0: yymsp[-2].minor.yy451 = yymsp[-1].minor.yy451; sl@0: } sl@0: */ sl@0: assert( yymsp[-2].minor.yy451!=0 ); sl@0: yymsp[-2].minor.yy451->pLast->pNext = yymsp[-1].minor.yy451; sl@0: yymsp[-2].minor.yy451->pLast = yymsp[-1].minor.yy451; sl@0: yygotominor.yy451 = yymsp[-2].minor.yy451; sl@0: } sl@0: #line 3133 "parse.c" sl@0: break; sl@0: case 276: /* trigger_cmd_list ::= trigger_cmd SEMI */ sl@0: #line 1045 "parse.y" sl@0: { sl@0: /* if( yymsp[-1].minor.yy451 ) */ sl@0: assert( yymsp[-1].minor.yy451!=0 ); sl@0: yymsp[-1].minor.yy451->pLast = yymsp[-1].minor.yy451; sl@0: yygotominor.yy451 = yymsp[-1].minor.yy451; sl@0: } sl@0: #line 3143 "parse.c" sl@0: break; sl@0: case 277: /* trigger_cmd ::= UPDATE orconf nm SET setlist where_opt */ sl@0: #line 1056 "parse.y" sl@0: { yygotominor.yy451 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy418, yymsp[-4].minor.yy328); } sl@0: #line 3148 "parse.c" sl@0: break; sl@0: case 278: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP */ sl@0: #line 1061 "parse.y" sl@0: {yygotominor.yy451 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy232, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy328);} sl@0: #line 3153 "parse.c" sl@0: break; sl@0: case 279: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt select */ sl@0: #line 1064 "parse.y" sl@0: {yygotominor.yy451 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy232, 0, yymsp[0].minor.yy91, yymsp[-4].minor.yy328);} sl@0: #line 3158 "parse.c" sl@0: break; sl@0: case 280: /* trigger_cmd ::= DELETE FROM nm where_opt */ sl@0: #line 1068 "parse.y" sl@0: {yygotominor.yy451 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-1].minor.yy0, yymsp[0].minor.yy418);} sl@0: #line 3163 "parse.c" sl@0: break; sl@0: case 281: /* trigger_cmd ::= select */ sl@0: #line 1071 "parse.y" sl@0: {yygotominor.yy451 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy91); } sl@0: #line 3168 "parse.c" sl@0: break; sl@0: case 282: /* expr ::= RAISE LP IGNORE RP */ sl@0: #line 1074 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); sl@0: if( yygotominor.yy418 ){ sl@0: yygotominor.yy418->iColumn = OE_Ignore; sl@0: sqlite3ExprSpan(yygotominor.yy418, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); sl@0: } sl@0: } sl@0: #line 3179 "parse.c" sl@0: break; sl@0: case 283: /* expr ::= RAISE LP raisetype COMMA nm RP */ sl@0: #line 1081 "parse.y" sl@0: { sl@0: yygotominor.yy418 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); sl@0: if( yygotominor.yy418 ) { sl@0: yygotominor.yy418->iColumn = yymsp[-3].minor.yy328; sl@0: sqlite3ExprSpan(yygotominor.yy418, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); sl@0: } sl@0: } sl@0: #line 3190 "parse.c" sl@0: break; sl@0: case 284: /* raisetype ::= ROLLBACK */ sl@0: #line 1091 "parse.y" sl@0: {yygotominor.yy328 = OE_Rollback;} sl@0: #line 3195 "parse.c" sl@0: break; sl@0: case 286: /* raisetype ::= FAIL */ sl@0: #line 1093 "parse.y" sl@0: {yygotominor.yy328 = OE_Fail;} sl@0: #line 3200 "parse.c" sl@0: break; sl@0: case 287: /* cmd ::= DROP TRIGGER ifexists fullname */ sl@0: #line 1098 "parse.y" sl@0: { sl@0: sqlite3DropTrigger(pParse,yymsp[0].minor.yy439,yymsp[-1].minor.yy328); sl@0: } sl@0: #line 3207 "parse.c" sl@0: break; sl@0: case 288: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ sl@0: #line 1105 "parse.y" sl@0: { sl@0: sqlite3Attach(pParse, yymsp[-3].minor.yy418, yymsp[-1].minor.yy418, yymsp[0].minor.yy418); sl@0: } sl@0: #line 3214 "parse.c" sl@0: break; sl@0: case 289: /* cmd ::= DETACH database_kw_opt expr */ sl@0: #line 1108 "parse.y" sl@0: { sl@0: sqlite3Detach(pParse, yymsp[0].minor.yy418); sl@0: } sl@0: #line 3221 "parse.c" sl@0: break; sl@0: case 294: /* cmd ::= REINDEX */ sl@0: #line 1123 "parse.y" sl@0: {sqlite3Reindex(pParse, 0, 0);} sl@0: #line 3226 "parse.c" sl@0: break; sl@0: case 295: /* cmd ::= REINDEX nm dbnm */ sl@0: #line 1124 "parse.y" sl@0: {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} sl@0: #line 3231 "parse.c" sl@0: break; sl@0: case 296: /* cmd ::= ANALYZE */ sl@0: #line 1129 "parse.y" sl@0: {sqlite3Analyze(pParse, 0, 0);} sl@0: #line 3236 "parse.c" sl@0: break; sl@0: case 297: /* cmd ::= ANALYZE nm dbnm */ sl@0: #line 1130 "parse.y" sl@0: {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} sl@0: #line 3241 "parse.c" sl@0: break; sl@0: case 298: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ sl@0: #line 1135 "parse.y" sl@0: { sl@0: sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy439,&yymsp[0].minor.yy0); sl@0: } sl@0: #line 3248 "parse.c" sl@0: break; sl@0: case 299: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ sl@0: #line 1138 "parse.y" sl@0: { sl@0: sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); sl@0: } sl@0: #line 3255 "parse.c" sl@0: break; sl@0: case 300: /* add_column_fullname ::= fullname */ sl@0: #line 1141 "parse.y" sl@0: { sl@0: sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy439); sl@0: } sl@0: #line 3262 "parse.c" sl@0: break; sl@0: }; sl@0: yygoto = yyRuleInfo[yyruleno].lhs; sl@0: yysize = yyRuleInfo[yyruleno].nrhs; sl@0: yypParser->yyidx -= yysize; sl@0: yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto); sl@0: if( yyact < YYNSTATE ){ sl@0: #ifdef NDEBUG sl@0: /* If we are not debugging and the reduce action popped at least sl@0: ** one element off the stack, then we can push the new element back sl@0: ** onto the stack here, and skip the stack overflow test in yy_shift(). sl@0: ** That gives a significant speed improvement. */ sl@0: if( yysize ){ sl@0: yypParser->yyidx++; sl@0: yymsp -= yysize-1; sl@0: yymsp->stateno = yyact; sl@0: yymsp->major = yygoto; sl@0: yymsp->minor = yygotominor; sl@0: }else sl@0: #endif sl@0: { sl@0: yy_shift(yypParser,yyact,yygoto,&yygotominor); sl@0: } sl@0: }else{ sl@0: assert( yyact == YYNSTATE + YYNRULE + 1 ); sl@0: yy_accept(yypParser); sl@0: } sl@0: } sl@0: sl@0: /* sl@0: ** The following code executes when the parse fails sl@0: */ sl@0: static void yy_parse_failed( sl@0: yyParser *yypParser /* The parser */ sl@0: ){ sl@0: sqlite3ParserARG_FETCH; sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE ){ sl@0: fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); sl@0: } sl@0: #endif sl@0: while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); sl@0: /* Here code is inserted which will be executed whenever the sl@0: ** parser fails */ sl@0: sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ sl@0: } sl@0: sl@0: /* sl@0: ** The following code executes when a syntax error first occurs. sl@0: */ sl@0: static void yy_syntax_error( sl@0: yyParser *yypParser, /* The parser */ sl@0: int yymajor, /* The major type of the error token */ sl@0: YYMINORTYPE yyminor /* The minor type of the error token */ sl@0: ){ sl@0: sqlite3ParserARG_FETCH; sl@0: #define TOKEN (yyminor.yy0) sl@0: #line 34 "parse.y" sl@0: sl@0: assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */ sl@0: sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); sl@0: pParse->parseError = 1; sl@0: #line 3327 "parse.c" sl@0: sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ sl@0: } sl@0: sl@0: /* sl@0: ** The following is executed when the parser accepts sl@0: */ sl@0: static void yy_accept( sl@0: yyParser *yypParser /* The parser */ sl@0: ){ sl@0: sqlite3ParserARG_FETCH; sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE ){ sl@0: fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); sl@0: } sl@0: #endif sl@0: while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); sl@0: /* Here code is inserted which will be executed whenever the sl@0: ** parser accepts */ sl@0: sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ sl@0: } sl@0: sl@0: /* The main parser program. sl@0: ** The first argument is a pointer to a structure obtained from sl@0: ** "sqlite3ParserAlloc" which describes the current state of the parser. sl@0: ** The second argument is the major token number. The third is sl@0: ** the minor token. The fourth optional argument is whatever the sl@0: ** user wants (and specified in the grammar) and is available for sl@0: ** use by the action routines. sl@0: ** sl@0: ** Inputs: sl@0: **
    sl@0: **
  • A pointer to the parser (an opaque structure.) sl@0: **
  • The major token number. sl@0: **
  • The minor token number. sl@0: **
  • An option argument of a grammar-specified type. sl@0: **
sl@0: ** sl@0: ** Outputs: sl@0: ** None. sl@0: */ sl@0: void sqlite3Parser( sl@0: void *yyp, /* The parser */ sl@0: int yymajor, /* The major token code number */ sl@0: sqlite3ParserTOKENTYPE yyminor /* The value for the token */ sl@0: sqlite3ParserARG_PDECL /* Optional %extra_argument parameter */ sl@0: ){ sl@0: YYMINORTYPE yyminorunion; sl@0: int yyact; /* The parser action. */ sl@0: int yyendofinput; /* True if we are at the end of input */ sl@0: #ifdef YYERRORSYMBOL sl@0: int yyerrorhit = 0; /* True if yymajor has invoked an error */ sl@0: #endif sl@0: yyParser *yypParser; /* The parser */ sl@0: sl@0: /* (re)initialize the parser, if necessary */ sl@0: yypParser = (yyParser*)yyp; sl@0: if( yypParser->yyidx<0 ){ sl@0: #if YYSTACKDEPTH<=0 sl@0: if( yypParser->yystksz <=0 ){ sl@0: /*memset(&yyminorunion, 0, sizeof(yyminorunion));*/ sl@0: yyminorunion = yyzerominor; sl@0: yyStackOverflow(yypParser, &yyminorunion); sl@0: return; sl@0: } sl@0: #endif sl@0: yypParser->yyidx = 0; sl@0: yypParser->yyerrcnt = -1; sl@0: yypParser->yystack[0].stateno = 0; sl@0: yypParser->yystack[0].major = 0; sl@0: } sl@0: yyminorunion.yy0 = yyminor; sl@0: yyendofinput = (yymajor==0); sl@0: sqlite3ParserARG_STORE; sl@0: sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE ){ sl@0: fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); sl@0: } sl@0: #endif sl@0: sl@0: do{ sl@0: yyact = yy_find_shift_action(yypParser,yymajor); sl@0: if( yyactyyerrcnt--; sl@0: yymajor = YYNOCODE; sl@0: }else if( yyact < YYNSTATE + YYNRULE ){ sl@0: yy_reduce(yypParser,yyact-YYNSTATE); sl@0: }else{ sl@0: assert( yyact == YY_ERROR_ACTION ); sl@0: #ifdef YYERRORSYMBOL sl@0: int yymx; sl@0: #endif sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE ){ sl@0: fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); sl@0: } sl@0: #endif sl@0: #ifdef YYERRORSYMBOL sl@0: /* A syntax error has occurred. sl@0: ** The response to an error depends upon whether or not the sl@0: ** grammar defines an error token "ERROR". sl@0: ** sl@0: ** This is what we do if the grammar does define ERROR: sl@0: ** sl@0: ** * Call the %syntax_error function. sl@0: ** sl@0: ** * Begin popping the stack until we enter a state where sl@0: ** it is legal to shift the error symbol, then shift sl@0: ** the error symbol. sl@0: ** sl@0: ** * Set the error count to three. sl@0: ** sl@0: ** * Begin accepting and shifting new tokens. No new error sl@0: ** processing will occur until three tokens have been sl@0: ** shifted successfully. sl@0: ** sl@0: */ sl@0: if( yypParser->yyerrcnt<0 ){ sl@0: yy_syntax_error(yypParser,yymajor,yyminorunion); sl@0: } sl@0: yymx = yypParser->yystack[yypParser->yyidx].major; sl@0: if( yymx==YYERRORSYMBOL || yyerrorhit ){ sl@0: #ifndef NDEBUG sl@0: if( yyTraceFILE ){ sl@0: fprintf(yyTraceFILE,"%sDiscard input token %s\n", sl@0: yyTracePrompt,yyTokenName[yymajor]); sl@0: } sl@0: #endif sl@0: yy_destructor(yypParser, yymajor,&yyminorunion); sl@0: yymajor = YYNOCODE; sl@0: }else{ sl@0: while( sl@0: yypParser->yyidx >= 0 && sl@0: yymx != YYERRORSYMBOL && sl@0: (yyact = yy_find_reduce_action( sl@0: yypParser->yystack[yypParser->yyidx].stateno, sl@0: YYERRORSYMBOL)) >= YYNSTATE sl@0: ){ sl@0: yy_pop_parser_stack(yypParser); sl@0: } sl@0: if( yypParser->yyidx < 0 || yymajor==0 ){ sl@0: yy_destructor(yypParser,yymajor,&yyminorunion); sl@0: yy_parse_failed(yypParser); sl@0: yymajor = YYNOCODE; sl@0: }else if( yymx!=YYERRORSYMBOL ){ sl@0: YYMINORTYPE u2; sl@0: u2.YYERRSYMDT = 0; sl@0: yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); sl@0: } sl@0: } sl@0: yypParser->yyerrcnt = 3; sl@0: yyerrorhit = 1; sl@0: #else /* YYERRORSYMBOL is not defined */ sl@0: /* This is what we do if the grammar does not define ERROR: sl@0: ** sl@0: ** * Report an error message, and throw away the input token. sl@0: ** sl@0: ** * If the input token is $, then fail the parse. sl@0: ** sl@0: ** As before, subsequent error messages are suppressed until sl@0: ** three input tokens have been successfully shifted. sl@0: */ sl@0: if( yypParser->yyerrcnt<=0 ){ sl@0: yy_syntax_error(yypParser,yymajor,yyminorunion); sl@0: } sl@0: yypParser->yyerrcnt = 3; sl@0: yy_destructor(yypParser,yymajor,&yyminorunion); sl@0: if( yyendofinput ){ sl@0: yy_parse_failed(yypParser); sl@0: } sl@0: yymajor = YYNOCODE; sl@0: #endif sl@0: } sl@0: }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); sl@0: return; sl@0: }