00001 /* Driver template for the LEMON parser generator. 00002 ** The author disclaims copyright to this source code. 00003 */ 00004 /* First off, code is included that follows the "include" declaration 00005 ** in the input grammar file. */ 00006 #include <stdio.h> 00007 #line 51 "parse.y" 00008 00009 #include "sqliteInt.h" 00010 00011 /* 00012 ** An instance of this structure holds information about the 00013 ** LIMIT clause of a SELECT statement. 00014 */ 00015 struct LimitVal { 00016 Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */ 00017 Expr *pOffset; /* The OFFSET expression. NULL if there is none */ 00018 }; 00019 00020 /* 00021 ** An instance of this structure is used to store the LIKE, 00022 ** GLOB, NOT LIKE, and NOT GLOB operators. 00023 */ 00024 struct LikeOp { 00025 Token eOperator; /* "like" or "glob" or "regexp" */ 00026 int not; /* True if the NOT keyword is present */ 00027 }; 00028 00029 /* 00030 ** An instance of the following structure describes the event of a 00031 ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, 00032 ** TK_DELETE, or TK_INSTEAD. If the event is of the form 00033 ** 00034 ** UPDATE ON (a,b,c) 00035 ** 00036 ** Then the "b" IdList records the list "a,b,c". 00037 */ 00038 struct TrigEvent { int a; IdList * b; }; 00039 00040 /* 00041 ** An instance of this structure holds the ATTACH key and the key type. 00042 */ 00043 struct AttachKey { int type; Token key; }; 00044 00045 #line 48 "parse.c" 00046 /* Next is all token values, in a form suitable for use by makeheaders. 00047 ** This section will be null unless lemon is run with the -m switch. 00048 */ 00049 /* 00050 ** These constants (all generated automatically by the parser generator) 00051 ** specify the various kinds of tokens (terminals) that the parser 00052 ** understands. 00053 ** 00054 ** Each symbol here is a terminal symbol in the grammar. 00055 */ 00056 /* Make sure the INTERFACE macro is defined. 00057 */ 00058 #ifndef INTERFACE 00059 # define INTERFACE 1 00060 #endif 00061 /* The next thing included is series of defines which control 00062 ** various aspects of the generated parser. 00063 ** YYCODETYPE is the data type used for storing terminal 00064 ** and nonterminal numbers. "unsigned char" is 00065 ** used if there are fewer than 250 terminals 00066 ** and nonterminals. "int" is used otherwise. 00067 ** YYNOCODE is a number of type YYCODETYPE which corresponds 00068 ** to no legal terminal or nonterminal number. This 00069 ** number is used to fill in empty slots of the hash 00070 ** table. 00071 ** YYFALLBACK If defined, this indicates that one or more tokens 00072 ** have fall-back values which should be used if the 00073 ** original value of the token will not parse. 00074 ** YYACTIONTYPE is the data type used for storing terminal 00075 ** and nonterminal numbers. "unsigned char" is 00076 ** used if there are fewer than 250 rules and 00077 ** states combined. "int" is used otherwise. 00078 ** sqlite3ParserTOKENTYPE is the data type used for minor tokens given 00079 ** directly to the parser from the tokenizer. 00080 ** YYMINORTYPE is the data type used for all minor tokens. 00081 ** This is typically a union of many types, one of 00082 ** which is sqlite3ParserTOKENTYPE. The entry in the union 00083 ** for base tokens is called "yy0". 00084 ** YYSTACKDEPTH is the maximum depth of the parser's stack. If 00085 ** zero the stack is dynamically sized using realloc() 00086 ** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument 00087 ** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument 00088 ** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser 00089 ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser 00090 ** YYNSTATE the combined number of states. 00091 ** YYNRULE the number of rules in the grammar 00092 ** YYERRORSYMBOL is the code number of the error symbol. If not 00093 ** defined, then do no error processing. 00094 */ 00095 #define YYCODETYPE unsigned char 00096 #define YYNOCODE 249 00097 #define YYACTIONTYPE unsigned short int 00098 #define YYWILDCARD 59 00099 #define sqlite3ParserTOKENTYPE Token 00100 typedef union { 00101 sqlite3ParserTOKENTYPE yy0; 00102 Select* yy43; 00103 TriggerStep* yy75; 00104 struct LimitVal yy84; 00105 struct LikeOp yy86; 00106 struct {int value; int mask;} yy207; 00107 ExprList* yy242; 00108 int yy316; 00109 IdList* yy352; 00110 struct TrigEvent yy354; 00111 SrcList* yy419; 00112 Expr* yy450; 00113 } YYMINORTYPE; 00114 #ifndef YYSTACKDEPTH 00115 #define YYSTACKDEPTH 100 00116 #endif 00117 #define sqlite3ParserARG_SDECL Parse *pParse; 00118 #define sqlite3ParserARG_PDECL ,Parse *pParse 00119 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse 00120 #define sqlite3ParserARG_STORE yypParser->pParse = pParse 00121 #define YYNSTATE 598 00122 #define YYNRULE 315 00123 #define YYFALLBACK 1 00124 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) 00125 #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) 00126 #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) 00127 00128 /* The yyzerominor constant is used to initialize instances of 00129 ** YYMINORTYPE objects to zero. */ 00130 #ifdef __cplusplus 00131 static YYMINORTYPE yyzerominor; 00132 #else 00133 static const YYMINORTYPE yyzerominor; 00134 #endif 00135 00136 /* Next are the tables used to determine what action to take based on the 00137 ** current state and lookahead token. These tables are used to implement 00138 ** functions that take a state number and lookahead value and return an 00139 ** action integer. 00140 ** 00141 ** Suppose the action integer is N. Then the action is determined as 00142 ** follows 00143 ** 00144 ** 0 <= N < YYNSTATE Shift N. That is, push the lookahead 00145 ** token onto the stack and goto state N. 00146 ** 00147 ** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. 00148 ** 00149 ** N == YYNSTATE+YYNRULE A syntax error has occurred. 00150 ** 00151 ** N == YYNSTATE+YYNRULE+1 The parser accepts its input. 00152 ** 00153 ** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused 00154 ** slots in the yy_action[] table. 00155 ** 00156 ** The action table is constructed as a single large table named yy_action[]. 00157 ** Given state S and lookahead X, the action is computed as 00158 ** 00159 ** yy_action[ yy_shift_ofst[S] + X ] 00160 ** 00161 ** If the index value yy_shift_ofst[S]+X is out of range or if the value 00162 ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] 00163 ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table 00164 ** and that yy_default[S] should be used instead. 00165 ** 00166 ** The formula above is for computing the action when the lookahead is 00167 ** a terminal symbol. If the lookahead is a non-terminal (as occurs after 00168 ** a reduce action) then the yy_reduce_ofst[] array is used in place of 00169 ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of 00170 ** YY_SHIFT_USE_DFLT. 00171 ** 00172 ** The following are the tables generated in this section: 00173 ** 00174 ** yy_action[] A single table containing all actions. 00175 ** yy_lookahead[] A table containing the lookahead for each entry in 00176 ** yy_action. Used to detect hash collisions. 00177 ** yy_shift_ofst[] For each state, the offset into yy_action for 00178 ** shifting terminals. 00179 ** yy_reduce_ofst[] For each state, the offset into yy_action for 00180 ** shifting non-terminals after a reduce. 00181 ** yy_default[] Default action for each state. 00182 */ 00183 static const YYACTIONTYPE yy_action[] = { 00184 /* 0 */ 296, 914, 120, 597, 2, 172, 425, 425, 62, 62, 00185 /* 10 */ 62, 62, 210, 64, 64, 64, 64, 65, 65, 66, 00186 /* 20 */ 66, 66, 67, 212, 398, 395, 432, 438, 69, 64, 00187 /* 30 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212, 00188 /* 40 */ 458, 456, 327, 168, 61, 60, 301, 442, 443, 439, 00189 /* 50 */ 439, 63, 63, 62, 62, 62, 62, 256, 64, 64, 00190 /* 60 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 296, 00191 /* 70 */ 498, 425, 425, 212, 427, 83, 68, 469, 70, 154, 00192 /* 80 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, 00193 /* 90 */ 212, 68, 307, 70, 154, 432, 438, 454, 214, 59, 00194 /* 100 */ 65, 65, 66, 66, 66, 67, 212, 429, 429, 429, 00195 /* 110 */ 497, 583, 296, 61, 60, 301, 442, 443, 439, 439, 00196 /* 120 */ 63, 63, 62, 62, 62, 62, 321, 64, 64, 64, 00197 /* 130 */ 64, 65, 65, 66, 66, 66, 67, 212, 432, 438, 00198 /* 140 */ 95, 66, 66, 66, 67, 212, 403, 256, 421, 35, 00199 /* 150 */ 57, 67, 212, 175, 417, 499, 61, 60, 301, 442, 00200 /* 160 */ 443, 439, 439, 63, 63, 62, 62, 62, 62, 19, 00201 /* 170 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, 00202 /* 180 */ 212, 296, 225, 532, 299, 581, 109, 422, 242, 458, 00203 /* 190 */ 416, 335, 414, 21, 502, 503, 346, 403, 527, 176, 00204 /* 200 */ 160, 454, 214, 580, 579, 344, 500, 432, 438, 149, 00205 /* 210 */ 150, 404, 405, 539, 514, 418, 151, 541, 8, 498, 00206 /* 220 */ 538, 577, 578, 427, 296, 61, 60, 301, 442, 443, 00207 /* 230 */ 439, 439, 63, 63, 62, 62, 62, 62, 196, 64, 00208 /* 240 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212, 00209 /* 250 */ 432, 438, 454, 598, 398, 395, 429, 429, 429, 369, 00210 /* 260 */ 558, 481, 404, 405, 372, 576, 213, 296, 61, 60, 00211 /* 270 */ 301, 442, 443, 439, 439, 63, 63, 62, 62, 62, 00212 /* 280 */ 62, 321, 64, 64, 64, 64, 65, 65, 66, 66, 00213 /* 290 */ 66, 67, 212, 432, 438, 555, 503, 304, 557, 532, 00214 /* 300 */ 218, 557, 552, 421, 36, 234, 397, 2, 542, 21, 00215 /* 310 */ 540, 61, 60, 301, 442, 443, 439, 439, 63, 63, 00216 /* 320 */ 62, 62, 62, 62, 388, 64, 64, 64, 64, 65, 00217 /* 330 */ 65, 66, 66, 66, 67, 212, 415, 530, 85, 381, 00218 /* 340 */ 78, 323, 296, 210, 304, 527, 493, 492, 379, 274, 00219 /* 350 */ 273, 379, 274, 273, 347, 463, 241, 387, 268, 210, 00220 /* 360 */ 533, 581, 210, 403, 20, 224, 144, 464, 432, 438, 00221 /* 370 */ 485, 164, 114, 248, 349, 253, 350, 177, 554, 580, 00222 /* 380 */ 465, 420, 331, 81, 257, 419, 61, 60, 301, 442, 00223 /* 390 */ 443, 439, 439, 63, 63, 62, 62, 62, 62, 391, 00224 /* 400 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, 00225 /* 410 */ 212, 296, 224, 203, 249, 496, 403, 440, 837, 114, 00226 /* 420 */ 248, 349, 253, 350, 177, 250, 321, 152, 404, 405, 00227 /* 430 */ 321, 257, 303, 324, 155, 445, 445, 432, 438, 317, 00228 /* 440 */ 400, 389, 213, 68, 209, 70, 154, 422, 421, 35, 00229 /* 450 */ 393, 202, 421, 42, 481, 61, 60, 301, 442, 443, 00230 /* 460 */ 439, 439, 63, 63, 62, 62, 62, 62, 422, 64, 00231 /* 470 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212, 00232 /* 480 */ 296, 404, 405, 183, 513, 422, 351, 354, 355, 403, 00233 /* 490 */ 77, 335, 79, 489, 216, 183, 334, 356, 351, 354, 00234 /* 500 */ 355, 433, 434, 406, 407, 408, 432, 438, 235, 356, 00235 /* 510 */ 386, 68, 291, 70, 154, 456, 531, 168, 198, 302, 00236 /* 520 */ 449, 450, 436, 437, 61, 60, 301, 442, 443, 439, 00237 /* 530 */ 439, 63, 63, 62, 62, 62, 62, 394, 64, 64, 00238 /* 540 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 296, 00239 /* 550 */ 321, 435, 422, 260, 404, 405, 321, 183, 153, 321, 00240 /* 560 */ 351, 354, 355, 446, 332, 321, 595, 905, 321, 905, 00241 /* 570 */ 1, 356, 421, 28, 403, 432, 438, 376, 421, 42, 00242 /* 580 */ 477, 421, 35, 213, 548, 366, 548, 421, 50, 159, 00243 /* 590 */ 421, 50, 422, 61, 60, 301, 442, 443, 439, 439, 00244 /* 600 */ 63, 63, 62, 62, 62, 62, 592, 64, 64, 64, 00245 /* 610 */ 64, 65, 65, 66, 66, 66, 67, 212, 296, 337, 00246 /* 620 */ 217, 463, 256, 94, 339, 326, 449, 450, 172, 340, 00247 /* 630 */ 425, 345, 532, 464, 312, 595, 904, 313, 904, 404, 00248 /* 640 */ 405, 588, 21, 226, 432, 438, 465, 243, 504, 324, 00249 /* 650 */ 322, 445, 445, 421, 3, 459, 230, 308, 505, 194, 00250 /* 660 */ 278, 296, 61, 60, 301, 442, 443, 439, 439, 63, 00251 /* 670 */ 63, 62, 62, 62, 62, 592, 64, 64, 64, 64, 00252 /* 680 */ 65, 65, 66, 66, 66, 67, 212, 432, 438, 213, 00253 /* 690 */ 179, 180, 181, 422, 324, 425, 445, 445, 281, 262, 00254 /* 700 */ 279, 402, 194, 481, 296, 61, 60, 301, 442, 443, 00255 /* 710 */ 439, 439, 63, 63, 62, 62, 62, 62, 377, 64, 00256 /* 720 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212, 00257 /* 730 */ 432, 438, 591, 295, 115, 268, 422, 266, 211, 264, 00258 /* 740 */ 373, 324, 246, 445, 445, 56, 256, 296, 61, 71, 00259 /* 750 */ 301, 442, 443, 439, 439, 63, 63, 62, 62, 62, 00260 /* 760 */ 62, 377, 64, 64, 64, 64, 65, 65, 66, 66, 00261 /* 770 */ 66, 67, 212, 432, 438, 550, 269, 474, 18, 549, 00262 /* 780 */ 280, 309, 343, 380, 171, 160, 256, 268, 5, 268, 00263 /* 790 */ 296, 368, 60, 301, 442, 443, 439, 439, 63, 63, 00264 /* 800 */ 62, 62, 62, 62, 321, 64, 64, 64, 64, 65, 00265 /* 810 */ 65, 66, 66, 66, 67, 212, 432, 438, 403, 10, 00266 /* 820 */ 403, 310, 268, 403, 268, 485, 421, 29, 566, 22, 00267 /* 830 */ 568, 420, 428, 425, 376, 419, 301, 442, 443, 439, 00268 /* 840 */ 439, 63, 63, 62, 62, 62, 62, 321, 64, 64, 00269 /* 850 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 73, 00270 /* 860 */ 328, 485, 4, 569, 268, 570, 300, 268, 147, 421, 00271 /* 870 */ 24, 321, 359, 321, 325, 73, 328, 491, 4, 455, 00272 /* 880 */ 321, 342, 300, 404, 405, 404, 405, 367, 404, 405, 00273 /* 890 */ 325, 330, 321, 421, 33, 421, 54, 321, 425, 178, 00274 /* 900 */ 229, 458, 421, 53, 321, 227, 321, 330, 228, 478, 00275 /* 910 */ 165, 321, 315, 119, 421, 99, 333, 458, 321, 421, 00276 /* 920 */ 97, 76, 75, 311, 268, 519, 421, 102, 421, 103, 00277 /* 930 */ 74, 319, 320, 421, 108, 427, 467, 76, 75, 490, 00278 /* 940 */ 421, 110, 452, 452, 321, 520, 74, 319, 320, 73, 00279 /* 950 */ 328, 427, 4, 210, 298, 321, 300, 321, 156, 257, 00280 /* 960 */ 321, 210, 185, 182, 325, 284, 421, 17, 429, 429, 00281 /* 970 */ 429, 430, 431, 12, 593, 378, 188, 421, 100, 421, 00282 /* 980 */ 34, 330, 421, 98, 429, 429, 429, 430, 431, 12, 00283 /* 990 */ 475, 458, 422, 162, 480, 321, 422, 306, 231, 232, 00284 /* 1000 */ 233, 105, 484, 632, 476, 321, 486, 447, 321, 23, 00285 /* 1010 */ 422, 76, 75, 594, 207, 178, 286, 421, 25, 254, 00286 /* 1020 */ 74, 319, 320, 287, 321, 427, 321, 421, 55, 321, 00287 /* 1030 */ 421, 111, 321, 471, 321, 205, 515, 557, 511, 363, 00288 /* 1040 */ 472, 204, 321, 516, 206, 321, 421, 112, 421, 113, 00289 /* 1050 */ 321, 421, 26, 321, 421, 37, 421, 38, 429, 429, 00290 /* 1060 */ 429, 430, 431, 12, 421, 27, 521, 421, 39, 321, 00291 /* 1070 */ 298, 158, 421, 40, 255, 421, 41, 321, 483, 321, 00292 /* 1080 */ 173, 523, 321, 182, 321, 522, 321, 384, 283, 273, 00293 /* 1090 */ 321, 421, 43, 297, 534, 321, 476, 321, 210, 421, 00294 /* 1100 */ 44, 421, 45, 321, 421, 30, 421, 31, 421, 46, 00295 /* 1110 */ 508, 509, 421, 47, 259, 321, 182, 421, 48, 421, 00296 /* 1120 */ 49, 321, 358, 390, 182, 421, 32, 321, 261, 518, 00297 /* 1130 */ 517, 553, 561, 182, 173, 412, 191, 421, 11, 562, 00298 /* 1140 */ 573, 92, 92, 421, 51, 590, 263, 294, 265, 421, 00299 /* 1150 */ 52, 267, 272, 371, 146, 374, 375, 275, 276, 277, 00300 /* 1160 */ 565, 575, 285, 288, 289, 587, 470, 451, 236, 453, 00301 /* 1170 */ 329, 244, 473, 514, 251, 524, 560, 163, 401, 572, 00302 /* 1180 */ 426, 525, 282, 528, 409, 7, 410, 411, 385, 318, 00303 /* 1190 */ 85, 237, 338, 526, 84, 336, 353, 58, 80, 215, 00304 /* 1200 */ 170, 468, 121, 86, 341, 348, 305, 501, 506, 124, 00305 /* 1210 */ 511, 222, 360, 423, 252, 186, 512, 510, 221, 223, 00306 /* 1220 */ 238, 507, 239, 535, 240, 292, 424, 529, 536, 537, 00307 /* 1230 */ 293, 543, 187, 189, 245, 362, 482, 488, 247, 190, 00308 /* 1240 */ 364, 89, 545, 192, 117, 370, 132, 556, 563, 195, 00309 /* 1250 */ 382, 383, 314, 133, 134, 571, 138, 135, 136, 584, 00310 /* 1260 */ 589, 585, 142, 399, 101, 413, 220, 586, 270, 104, 00311 /* 1270 */ 141, 633, 634, 166, 167, 441, 444, 72, 460, 448, 00312 /* 1280 */ 457, 546, 143, 157, 6, 461, 14, 479, 169, 462, 00313 /* 1290 */ 93, 466, 82, 122, 13, 174, 487, 96, 123, 161, 00314 /* 1300 */ 494, 495, 87, 125, 126, 116, 258, 88, 127, 184, 00315 /* 1310 */ 250, 361, 219, 107, 544, 145, 128, 193, 365, 118, 00316 /* 1320 */ 352, 357, 173, 271, 130, 9, 316, 559, 197, 90, 00317 /* 1330 */ 547, 131, 129, 15, 199, 551, 564, 200, 567, 201, 00318 /* 1340 */ 139, 137, 582, 91, 16, 106, 140, 208, 574, 392, 00319 /* 1350 */ 396, 290, 148, 596, 00320 }; 00321 static const YYCODETYPE yy_lookahead[] = { 00322 /* 0 */ 16, 140, 141, 142, 143, 21, 23, 23, 69, 70, 00323 /* 10 */ 71, 72, 110, 74, 75, 76, 77, 78, 79, 80, 00324 /* 20 */ 81, 82, 83, 84, 1, 2, 42, 43, 73, 74, 00325 /* 30 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 00326 /* 40 */ 58, 162, 163, 164, 60, 61, 62, 63, 64, 65, 00327 /* 50 */ 66, 67, 68, 69, 70, 71, 72, 148, 74, 75, 00328 /* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16, 00329 /* 70 */ 88, 88, 88, 84, 92, 22, 219, 220, 221, 222, 00330 /* 80 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 00331 /* 90 */ 84, 219, 183, 221, 222, 42, 43, 78, 79, 46, 00332 /* 100 */ 78, 79, 80, 81, 82, 83, 84, 125, 126, 127, 00333 /* 110 */ 170, 239, 16, 60, 61, 62, 63, 64, 65, 66, 00334 /* 120 */ 67, 68, 69, 70, 71, 72, 148, 74, 75, 76, 00335 /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43, 00336 /* 140 */ 44, 80, 81, 82, 83, 84, 23, 148, 170, 171, 00337 /* 150 */ 19, 83, 84, 156, 23, 170, 60, 61, 62, 63, 00338 /* 160 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 19, 00339 /* 170 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 00340 /* 180 */ 84, 16, 183, 148, 151, 148, 21, 190, 148, 58, 00341 /* 190 */ 169, 213, 157, 158, 186, 187, 218, 23, 177, 202, 00342 /* 200 */ 203, 78, 79, 166, 167, 208, 161, 42, 43, 78, 00343 /* 210 */ 79, 88, 89, 177, 178, 170, 181, 182, 68, 88, 00344 /* 220 */ 184, 98, 99, 92, 16, 60, 61, 62, 63, 64, 00345 /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 22, 74, 00346 /* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 00347 /* 250 */ 42, 43, 78, 0, 1, 2, 125, 126, 127, 226, 00348 /* 260 */ 11, 162, 88, 89, 231, 228, 229, 16, 60, 61, 00349 /* 270 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 00350 /* 280 */ 72, 148, 74, 75, 76, 77, 78, 79, 80, 81, 00351 /* 290 */ 82, 83, 84, 42, 43, 186, 187, 16, 49, 148, 00352 /* 300 */ 201, 49, 18, 170, 171, 154, 142, 143, 157, 158, 00353 /* 310 */ 182, 60, 61, 62, 63, 64, 65, 66, 67, 68, 00354 /* 320 */ 69, 70, 71, 72, 91, 74, 75, 76, 77, 78, 00355 /* 330 */ 79, 80, 81, 82, 83, 84, 168, 169, 122, 55, 00356 /* 340 */ 132, 16, 16, 110, 16, 177, 20, 20, 99, 100, 00357 /* 350 */ 101, 99, 100, 101, 80, 12, 223, 124, 148, 110, 00358 /* 360 */ 182, 148, 110, 23, 19, 84, 21, 24, 42, 43, 00359 /* 370 */ 148, 90, 91, 92, 93, 94, 95, 96, 94, 166, 00360 /* 380 */ 37, 107, 39, 132, 103, 111, 60, 61, 62, 63, 00361 /* 390 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 189, 00362 /* 400 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 00363 /* 410 */ 84, 16, 84, 156, 92, 20, 23, 92, 134, 91, 00364 /* 420 */ 92, 93, 94, 95, 96, 103, 148, 22, 88, 89, 00365 /* 430 */ 148, 103, 210, 106, 156, 108, 109, 42, 43, 144, 00366 /* 440 */ 145, 228, 229, 219, 149, 221, 222, 190, 170, 171, 00367 /* 450 */ 240, 156, 170, 171, 162, 60, 61, 62, 63, 64, 00368 /* 460 */ 65, 66, 67, 68, 69, 70, 71, 72, 190, 74, 00369 /* 470 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 00370 /* 480 */ 16, 88, 89, 90, 20, 190, 93, 94, 95, 23, 00371 /* 490 */ 131, 213, 133, 201, 212, 90, 218, 104, 93, 94, 00372 /* 500 */ 95, 42, 43, 7, 8, 9, 42, 43, 191, 104, 00373 /* 510 */ 215, 219, 159, 221, 222, 162, 163, 164, 156, 165, 00374 /* 520 */ 166, 167, 63, 64, 60, 61, 62, 63, 64, 65, 00375 /* 530 */ 66, 67, 68, 69, 70, 71, 72, 242, 74, 75, 00376 /* 540 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16, 00377 /* 550 */ 148, 92, 190, 20, 88, 89, 148, 90, 156, 148, 00378 /* 560 */ 93, 94, 95, 20, 187, 148, 19, 20, 148, 22, 00379 /* 570 */ 19, 104, 170, 171, 23, 42, 43, 148, 170, 171, 00380 /* 580 */ 114, 170, 171, 229, 99, 100, 101, 170, 171, 148, 00381 /* 590 */ 170, 171, 190, 60, 61, 62, 63, 64, 65, 66, 00382 /* 600 */ 67, 68, 69, 70, 71, 72, 59, 74, 75, 76, 00383 /* 610 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 211, 00384 /* 620 */ 212, 12, 148, 21, 213, 165, 166, 167, 21, 148, 00385 /* 630 */ 23, 148, 148, 24, 217, 19, 20, 217, 22, 88, 00386 /* 640 */ 89, 157, 158, 214, 42, 43, 37, 148, 39, 106, 00387 /* 650 */ 148, 108, 109, 170, 171, 20, 146, 183, 49, 156, 00388 /* 660 */ 14, 16, 60, 61, 62, 63, 64, 65, 66, 67, 00389 /* 670 */ 68, 69, 70, 71, 72, 59, 74, 75, 76, 77, 00390 /* 680 */ 78, 79, 80, 81, 82, 83, 84, 42, 43, 229, 00391 /* 690 */ 99, 100, 101, 190, 106, 88, 108, 109, 52, 14, 00392 /* 700 */ 54, 148, 156, 162, 16, 60, 61, 62, 63, 64, 00393 /* 710 */ 65, 66, 67, 68, 69, 70, 71, 72, 215, 74, 00394 /* 720 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 00395 /* 730 */ 42, 43, 245, 246, 148, 148, 190, 52, 193, 54, 00396 /* 740 */ 237, 106, 201, 108, 109, 200, 148, 16, 60, 61, 00397 /* 750 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 00398 /* 760 */ 72, 215, 74, 75, 76, 77, 78, 79, 80, 81, 00399 /* 770 */ 82, 83, 84, 42, 43, 25, 189, 22, 232, 29, 00400 /* 780 */ 134, 183, 16, 237, 202, 203, 148, 148, 192, 148, 00401 /* 790 */ 16, 41, 61, 62, 63, 64, 65, 66, 67, 68, 00402 /* 800 */ 69, 70, 71, 72, 148, 74, 75, 76, 77, 78, 00403 /* 810 */ 79, 80, 81, 82, 83, 84, 42, 43, 23, 19, 00404 /* 820 */ 23, 183, 148, 23, 148, 148, 170, 171, 189, 19, 00405 /* 830 */ 189, 107, 148, 23, 148, 111, 62, 63, 64, 65, 00406 /* 840 */ 66, 67, 68, 69, 70, 71, 72, 148, 74, 75, 00407 /* 850 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16, 00408 /* 860 */ 17, 148, 19, 189, 148, 189, 23, 148, 113, 170, 00409 /* 870 */ 171, 148, 16, 148, 31, 16, 17, 80, 19, 162, 00410 /* 880 */ 148, 115, 23, 88, 89, 88, 89, 210, 88, 89, 00411 /* 890 */ 31, 48, 148, 170, 171, 170, 171, 148, 88, 43, 00412 /* 900 */ 214, 58, 170, 171, 148, 189, 148, 48, 189, 114, 00413 /* 910 */ 19, 148, 243, 244, 170, 171, 148, 58, 148, 170, 00414 /* 920 */ 171, 78, 79, 210, 148, 30, 170, 171, 170, 171, 00415 /* 930 */ 87, 88, 89, 170, 171, 92, 148, 78, 79, 80, 00416 /* 940 */ 170, 171, 125, 126, 148, 50, 87, 88, 89, 16, 00417 /* 950 */ 17, 92, 19, 110, 98, 148, 23, 148, 156, 103, 00418 /* 960 */ 148, 110, 156, 22, 31, 189, 170, 171, 125, 126, 00419 /* 970 */ 127, 128, 129, 130, 20, 124, 156, 170, 171, 170, 00420 /* 980 */ 171, 48, 170, 171, 125, 126, 127, 128, 129, 130, 00421 /* 990 */ 204, 58, 190, 5, 148, 148, 190, 102, 10, 11, 00422 /* 1000 */ 12, 13, 148, 112, 22, 148, 148, 20, 148, 22, 00423 /* 1010 */ 190, 78, 79, 59, 26, 43, 28, 170, 171, 148, 00424 /* 1020 */ 87, 88, 89, 35, 148, 92, 148, 170, 171, 148, 00425 /* 1030 */ 170, 171, 148, 27, 148, 47, 148, 49, 97, 234, 00426 /* 1040 */ 34, 53, 148, 179, 56, 148, 170, 171, 170, 171, 00427 /* 1050 */ 148, 170, 171, 148, 170, 171, 170, 171, 125, 126, 00428 /* 1060 */ 127, 128, 129, 130, 170, 171, 179, 170, 171, 148, 00429 /* 1070 */ 98, 89, 170, 171, 148, 170, 171, 148, 20, 148, 00430 /* 1080 */ 22, 20, 148, 22, 148, 179, 148, 99, 100, 101, 00431 /* 1090 */ 148, 170, 171, 105, 148, 148, 114, 148, 110, 170, 00432 /* 1100 */ 171, 170, 171, 148, 170, 171, 170, 171, 170, 171, 00433 /* 1110 */ 7, 8, 170, 171, 20, 148, 22, 170, 171, 170, 00434 /* 1120 */ 171, 148, 20, 135, 22, 170, 171, 148, 148, 91, 00435 /* 1130 */ 92, 20, 20, 22, 22, 150, 233, 170, 171, 20, 00436 /* 1140 */ 20, 22, 22, 170, 171, 20, 148, 22, 148, 170, 00437 /* 1150 */ 171, 148, 148, 148, 192, 148, 148, 148, 148, 148, 00438 /* 1160 */ 148, 148, 148, 148, 148, 148, 173, 230, 194, 230, 00439 /* 1170 */ 225, 205, 173, 178, 173, 173, 195, 6, 147, 195, 00440 /* 1180 */ 162, 162, 205, 162, 147, 22, 147, 147, 205, 155, 00441 /* 1190 */ 122, 195, 119, 173, 120, 118, 174, 121, 131, 224, 00442 /* 1200 */ 112, 153, 153, 98, 117, 98, 40, 172, 172, 19, 00443 /* 1210 */ 97, 84, 15, 190, 172, 152, 172, 174, 227, 227, 00444 /* 1220 */ 196, 180, 197, 172, 198, 175, 199, 180, 172, 172, 00445 /* 1230 */ 175, 153, 152, 152, 206, 153, 207, 207, 206, 153, 00446 /* 1240 */ 38, 131, 153, 152, 60, 153, 19, 185, 195, 185, 00447 /* 1250 */ 153, 15, 153, 188, 188, 195, 185, 188, 188, 33, 00448 /* 1260 */ 138, 153, 216, 1, 160, 20, 176, 153, 235, 176, 00449 /* 1270 */ 216, 112, 112, 112, 112, 92, 107, 19, 11, 20, 00450 /* 1280 */ 20, 236, 19, 19, 116, 20, 116, 114, 22, 20, 00451 /* 1290 */ 238, 20, 22, 19, 22, 116, 115, 238, 20, 112, 00452 /* 1300 */ 20, 20, 19, 19, 19, 32, 20, 19, 19, 96, 00453 /* 1310 */ 103, 16, 44, 241, 17, 21, 98, 98, 36, 244, 00454 /* 1320 */ 44, 44, 22, 134, 19, 5, 247, 1, 123, 68, 00455 /* 1330 */ 51, 102, 45, 19, 113, 45, 1, 14, 17, 117, 00456 /* 1340 */ 102, 113, 20, 68, 19, 14, 123, 136, 124, 57, 00457 /* 1350 */ 3, 137, 19, 4, 00458 }; 00459 #define YY_SHIFT_USE_DFLT (-99) 00460 #define YY_SHIFT_MAX 396 00461 static const short yy_shift_ofst[] = { 00462 /* 0 */ 23, 843, 988, -16, 843, 933, 933, 393, 123, 252, 00463 /* 10 */ -98, 96, 933, 933, 933, 933, 933, -45, 249, 174, 00464 /* 20 */ 340, -17, 19, 19, 53, 165, 208, 251, 326, 395, 00465 /* 30 */ 464, 533, 602, 645, 688, 645, 645, 645, 645, 645, 00466 /* 40 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 00467 /* 50 */ 645, 645, 645, 731, 774, 774, 859, 933, 933, 933, 00468 /* 60 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 00469 /* 70 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 00470 /* 80 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 00471 /* 90 */ 933, 933, 933, 933, 933, 933, 933, -61, -61, 6, 00472 /* 100 */ 6, 281, 22, 61, 856, 284, 340, 340, 68, -17, 00473 /* 110 */ -11, -99, -99, -99, 131, 328, 609, 609, 547, 616, 00474 /* 120 */ 253, 607, 340, 607, 340, 340, 340, 340, 340, 340, 00475 /* 130 */ 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 00476 /* 140 */ 340, 233, 851, -98, -98, -98, -99, -99, -99, -18, 00477 /* 150 */ -18, 405, 467, 327, 551, 543, 635, 343, 466, 795, 00478 /* 160 */ 800, 797, 496, 340, 340, 274, 340, 340, 810, 340, 00479 /* 170 */ 340, 982, 340, 340, 340, 588, 982, 340, 340, 895, 00480 /* 180 */ 895, 895, 340, 340, 340, 588, 340, 340, 588, 340, 00481 /* 190 */ 750, 485, 340, 340, 588, 340, 340, 340, 588, 340, 00482 /* 200 */ 340, 340, 588, 588, 340, 340, 340, 340, 340, 345, 00483 /* 210 */ 724, 755, -17, 817, 817, 359, 1006, 1006, 766, 1006, 00484 /* 220 */ 972, 1006, -17, 1006, -17, 941, 216, 766, 766, 216, 00485 /* 230 */ 1171, 1171, 1171, 1171, 1163, -98, 1068, 1073, 1074, 1077, 00486 /* 240 */ 1076, 1067, 1088, 1088, 1105, 1087, 1105, 1087, 1107, 1107, 00487 /* 250 */ 1166, 1107, 1113, 1107, 1190, 1127, 1127, 1166, 1107, 1107, 00488 /* 260 */ 1107, 1190, 1197, 1088, 1197, 1088, 1197, 1088, 1088, 1202, 00489 /* 270 */ 1110, 1197, 1088, 1184, 1184, 1227, 1068, 1088, 1236, 1236, 00490 /* 280 */ 1236, 1236, 1068, 1184, 1227, 1088, 1226, 1226, 1088, 1088, 00491 /* 290 */ 1122, -99, -99, -99, -99, -99, 459, 646, 591, 685, 00492 /* 300 */ 891, 325, 987, 1058, 322, 1103, 1038, 1061, 1094, 1102, 00493 /* 310 */ 1111, 1112, 1119, 1120, 150, 1125, 954, 1262, 1245, 1159, 00494 /* 320 */ 1160, 1161, 1162, 1183, 1169, 1258, 1259, 1260, 1263, 1267, 00495 /* 330 */ 1264, 1265, 1266, 1269, 1271, 1270, 1168, 1272, 1170, 1270, 00496 /* 340 */ 1173, 1274, 1179, 1181, 1278, 1187, 1280, 1281, 1273, 1268, 00497 /* 350 */ 1283, 1276, 1284, 1286, 1285, 1288, 1277, 1289, 1213, 1207, 00498 /* 360 */ 1295, 1297, 1294, 1218, 1282, 1279, 1287, 1300, 1290, 1189, 00499 /* 370 */ 1219, 1305, 1320, 1326, 1229, 1261, 1275, 1205, 1314, 1221, 00500 /* 380 */ 1335, 1323, 1222, 1321, 1228, 1238, 1223, 1325, 1224, 1322, 00501 /* 390 */ 1331, 1292, 1211, 1214, 1333, 1347, 1349, 00502 }; 00503 #define YY_REDUCE_USE_DFLT (-144) 00504 #define YY_REDUCE_MAX 295 00505 static const short yy_reduce_ofst[] = { 00506 /* 0 */ -139, 278, 295, 292, 402, -22, 408, 35, 37, 546, 00507 /* 10 */ -3, -128, 133, 282, 411, 417, 420, -143, 503, 213, 00508 /* 20 */ 151, 353, 354, 460, 224, 224, 224, 224, 224, 224, 00509 /* 30 */ 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 00510 /* 40 */ 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 00511 /* 50 */ 224, 224, 224, 224, 224, 224, 483, 656, 699, 723, 00512 /* 60 */ 725, 732, 744, 749, 756, 758, 763, 770, 796, 807, 00513 /* 70 */ 809, 812, 847, 857, 860, 876, 878, 881, 884, 886, 00514 /* 80 */ 894, 897, 902, 905, 921, 929, 931, 934, 936, 938, 00515 /* 90 */ 942, 947, 949, 955, 967, 973, 979, 224, 224, 224, 00516 /* 100 */ 224, 168, 224, 224, 36, 33, 210, 484, 224, -121, 00517 /* 110 */ 224, 224, 224, 224, 45, 21, 8, 109, 487, 487, 00518 /* 120 */ 164, 99, 222, 541, -91, -1, 474, 598, 587, 677, 00519 /* 130 */ 638, 429, 713, 639, 641, 674, 676, 716, 719, 686, 00520 /* 140 */ 776, 257, 362, 802, 806, 820, 545, 582, 669, -60, 00521 /* 150 */ -15, 128, 178, 317, 40, 317, 317, 377, 441, 481, 00522 /* 160 */ 499, 502, 510, 553, 586, 596, 502, 684, 717, 768, 00523 /* 170 */ 788, 786, 846, 854, 858, 317, 786, 871, 888, 864, 00524 /* 180 */ 887, 906, 926, 946, 980, 317, 998, 1000, 317, 1003, 00525 /* 190 */ 903, 805, 1004, 1005, 317, 1007, 1008, 1009, 317, 1010, 00526 /* 200 */ 1011, 1012, 317, 317, 1013, 1014, 1015, 1016, 1017, 985, 00527 /* 210 */ 962, 974, 1018, 937, 939, 945, 993, 999, 966, 1001, 00528 /* 220 */ 995, 1002, 1019, 1020, 1021, 1022, 981, 977, 983, 984, 00529 /* 230 */ 1031, 1037, 1039, 1040, 1034, 1023, 996, 1024, 1025, 1026, 00530 /* 240 */ 1027, 975, 1048, 1049, 1028, 1029, 1032, 1030, 1035, 1036, 00531 /* 250 */ 1041, 1042, 1043, 1044, 1050, 991, 992, 1047, 1051, 1056, 00532 /* 260 */ 1057, 1055, 1063, 1078, 1080, 1082, 1081, 1086, 1089, 1033, 00533 /* 270 */ 1045, 1091, 1092, 1062, 1064, 1046, 1053, 1097, 1065, 1066, 00534 /* 280 */ 1069, 1070, 1060, 1071, 1054, 1099, 1052, 1059, 1108, 1114, 00535 /* 290 */ 1072, 1104, 1090, 1093, 1075, 1079, 00536 }; 00537 static const YYACTIONTYPE yy_default[] = { 00538 /* 0 */ 603, 832, 913, 719, 913, 832, 913, 913, 859, 913, 00539 /* 10 */ 723, 888, 830, 913, 913, 913, 913, 804, 913, 859, 00540 /* 20 */ 913, 635, 859, 859, 755, 913, 913, 913, 913, 913, 00541 /* 30 */ 913, 913, 913, 756, 913, 834, 829, 825, 827, 826, 00542 /* 40 */ 833, 757, 746, 753, 760, 735, 872, 762, 763, 769, 00543 /* 50 */ 770, 889, 887, 792, 791, 810, 913, 913, 913, 913, 00544 /* 60 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00545 /* 70 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00546 /* 80 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00547 /* 90 */ 913, 913, 913, 913, 913, 913, 913, 794, 816, 793, 00548 /* 100 */ 803, 628, 795, 796, 688, 623, 913, 913, 797, 913, 00549 /* 110 */ 798, 811, 812, 813, 913, 913, 913, 913, 913, 913, 00550 /* 120 */ 603, 719, 913, 719, 913, 913, 913, 913, 913, 913, 00551 /* 130 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00552 /* 140 */ 913, 913, 913, 913, 913, 913, 713, 723, 906, 913, 00553 /* 150 */ 913, 679, 913, 913, 913, 913, 913, 913, 913, 913, 00554 /* 160 */ 913, 913, 611, 609, 913, 711, 913, 913, 637, 913, 00555 /* 170 */ 913, 721, 913, 913, 913, 726, 727, 913, 913, 913, 00556 /* 180 */ 913, 913, 913, 913, 913, 625, 913, 913, 700, 913, 00557 /* 190 */ 865, 913, 913, 913, 879, 913, 913, 913, 877, 913, 00558 /* 200 */ 913, 913, 702, 765, 845, 913, 892, 894, 913, 913, 00559 /* 210 */ 711, 720, 913, 913, 913, 828, 749, 749, 737, 749, 00560 /* 220 */ 658, 749, 913, 749, 913, 661, 759, 737, 737, 759, 00561 /* 230 */ 608, 608, 608, 608, 678, 913, 759, 750, 752, 742, 00562 /* 240 */ 754, 913, 728, 728, 736, 741, 736, 741, 690, 690, 00563 /* 250 */ 675, 690, 661, 690, 838, 842, 842, 675, 690, 690, 00564 /* 260 */ 690, 838, 620, 728, 620, 728, 620, 728, 728, 869, 00565 /* 270 */ 871, 620, 728, 692, 692, 771, 759, 728, 699, 699, 00566 /* 280 */ 699, 699, 759, 692, 771, 728, 891, 891, 728, 728, 00567 /* 290 */ 899, 645, 663, 663, 906, 911, 913, 913, 913, 913, 00568 /* 300 */ 778, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00569 /* 310 */ 913, 913, 913, 913, 852, 913, 913, 913, 913, 783, 00570 /* 320 */ 779, 913, 780, 913, 705, 913, 913, 913, 913, 913, 00571 /* 330 */ 913, 913, 913, 913, 913, 831, 913, 743, 913, 751, 00572 /* 340 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00573 /* 350 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00574 /* 360 */ 913, 913, 913, 913, 913, 913, 867, 868, 913, 913, 00575 /* 370 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00576 /* 380 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, 00577 /* 390 */ 913, 898, 913, 913, 901, 604, 913, 599, 601, 602, 00578 /* 400 */ 606, 607, 610, 632, 633, 634, 612, 613, 614, 615, 00579 /* 410 */ 616, 617, 618, 624, 626, 644, 646, 630, 648, 709, 00580 /* 420 */ 710, 775, 703, 704, 708, 631, 786, 777, 781, 782, 00581 /* 430 */ 784, 785, 799, 800, 802, 808, 815, 818, 801, 806, 00582 /* 440 */ 807, 809, 814, 817, 706, 707, 821, 638, 639, 642, 00583 /* 450 */ 643, 855, 857, 856, 858, 641, 640, 787, 790, 823, 00584 /* 460 */ 824, 880, 881, 882, 883, 884, 819, 729, 822, 805, 00585 /* 470 */ 744, 747, 748, 745, 712, 722, 731, 732, 733, 734, 00586 /* 480 */ 717, 718, 724, 740, 773, 774, 738, 739, 725, 714, 00587 /* 490 */ 715, 716, 820, 776, 788, 789, 649, 650, 783, 651, 00588 /* 500 */ 652, 653, 691, 694, 695, 696, 654, 673, 676, 677, 00589 /* 510 */ 655, 662, 656, 657, 664, 665, 666, 669, 670, 671, 00590 /* 520 */ 672, 667, 668, 839, 840, 843, 841, 659, 660, 674, 00591 /* 530 */ 647, 636, 629, 680, 683, 684, 685, 686, 687, 689, 00592 /* 540 */ 681, 682, 627, 619, 621, 730, 861, 870, 866, 862, 00593 /* 550 */ 863, 864, 622, 835, 836, 693, 767, 768, 860, 873, 00594 /* 560 */ 875, 772, 876, 878, 874, 903, 697, 698, 701, 844, 00595 /* 570 */ 885, 758, 761, 764, 766, 846, 847, 848, 849, 850, 00596 /* 580 */ 853, 854, 851, 886, 890, 893, 895, 896, 897, 900, 00597 /* 590 */ 902, 907, 908, 909, 912, 910, 605, 600, 00598 }; 00599 #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0])) 00600 00601 /* The next table maps tokens into fallback tokens. If a construct 00602 ** like the following: 00603 ** 00604 ** %fallback ID X Y Z. 00605 ** 00606 ** appears in the grammar, then ID becomes a fallback token for X, Y, 00607 ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser 00608 ** but it does not parse, the type of the token is changed to ID and 00609 ** the parse is retried before an error is thrown. 00610 */ 00611 #ifdef YYFALLBACK 00612 static const YYCODETYPE yyFallback[] = { 00613 0, /* $ => nothing */ 00614 0, /* SEMI => nothing */ 00615 23, /* EXPLAIN => ID */ 00616 23, /* QUERY => ID */ 00617 23, /* PLAN => ID */ 00618 23, /* BEGIN => ID */ 00619 0, /* TRANSACTION => nothing */ 00620 23, /* DEFERRED => ID */ 00621 23, /* IMMEDIATE => ID */ 00622 23, /* EXCLUSIVE => ID */ 00623 0, /* COMMIT => nothing */ 00624 23, /* END => ID */ 00625 0, /* ROLLBACK => nothing */ 00626 0, /* CREATE => nothing */ 00627 0, /* TABLE => nothing */ 00628 23, /* IF => ID */ 00629 0, /* NOT => nothing */ 00630 0, /* EXISTS => nothing */ 00631 23, /* TEMP => ID */ 00632 0, /* LP => nothing */ 00633 0, /* RP => nothing */ 00634 0, /* AS => nothing */ 00635 0, /* COMMA => nothing */ 00636 0, /* ID => nothing */ 00637 23, /* ABORT => ID */ 00638 23, /* AFTER => ID */ 00639 23, /* ANALYZE => ID */ 00640 23, /* ASC => ID */ 00641 23, /* ATTACH => ID */ 00642 23, /* BEFORE => ID */ 00643 23, /* CASCADE => ID */ 00644 23, /* CAST => ID */ 00645 23, /* CONFLICT => ID */ 00646 23, /* DATABASE => ID */ 00647 23, /* DESC => ID */ 00648 23, /* DETACH => ID */ 00649 23, /* EACH => ID */ 00650 23, /* FAIL => ID */ 00651 23, /* FOR => ID */ 00652 23, /* IGNORE => ID */ 00653 23, /* INITIALLY => ID */ 00654 23, /* INSTEAD => ID */ 00655 23, /* LIKE_KW => ID */ 00656 23, /* MATCH => ID */ 00657 23, /* KEY => ID */ 00658 23, /* OF => ID */ 00659 23, /* OFFSET => ID */ 00660 23, /* PRAGMA => ID */ 00661 23, /* RAISE => ID */ 00662 23, /* REPLACE => ID */ 00663 23, /* RESTRICT => ID */ 00664 23, /* ROW => ID */ 00665 23, /* TRIGGER => ID */ 00666 23, /* VACUUM => ID */ 00667 23, /* VIEW => ID */ 00668 23, /* VIRTUAL => ID */ 00669 23, /* REINDEX => ID */ 00670 23, /* RENAME => ID */ 00671 23, /* CTIME_KW => ID */ 00672 0, /* ANY => nothing */ 00673 0, /* OR => nothing */ 00674 0, /* AND => nothing */ 00675 0, /* IS => nothing */ 00676 0, /* BETWEEN => nothing */ 00677 0, /* IN => nothing */ 00678 0, /* ISNULL => nothing */ 00679 0, /* NOTNULL => nothing */ 00680 0, /* NE => nothing */ 00681 0, /* EQ => nothing */ 00682 0, /* GT => nothing */ 00683 0, /* LE => nothing */ 00684 0, /* LT => nothing */ 00685 0, /* GE => nothing */ 00686 0, /* ESCAPE => nothing */ 00687 0, /* BITAND => nothing */ 00688 0, /* BITOR => nothing */ 00689 0, /* LSHIFT => nothing */ 00690 0, /* RSHIFT => nothing */ 00691 0, /* PLUS => nothing */ 00692 0, /* MINUS => nothing */ 00693 0, /* STAR => nothing */ 00694 0, /* SLASH => nothing */ 00695 0, /* REM => nothing */ 00696 0, /* CONCAT => nothing */ 00697 0, /* COLLATE => nothing */ 00698 0, /* UMINUS => nothing */ 00699 0, /* UPLUS => nothing */ 00700 0, /* BITNOT => nothing */ 00701 0, /* STRING => nothing */ 00702 0, /* JOIN_KW => nothing */ 00703 0, /* CONSTRAINT => nothing */ 00704 0, /* DEFAULT => nothing */ 00705 0, /* NULL => nothing */ 00706 0, /* PRIMARY => nothing */ 00707 0, /* UNIQUE => nothing */ 00708 0, /* CHECK => nothing */ 00709 0, /* REFERENCES => nothing */ 00710 0, /* AUTOINCR => nothing */ 00711 0, /* ON => nothing */ 00712 0, /* DELETE => nothing */ 00713 0, /* UPDATE => nothing */ 00714 0, /* INSERT => nothing */ 00715 0, /* SET => nothing */ 00716 0, /* DEFERRABLE => nothing */ 00717 0, /* FOREIGN => nothing */ 00718 0, /* DROP => nothing */ 00719 0, /* UNION => nothing */ 00720 0, /* ALL => nothing */ 00721 0, /* EXCEPT => nothing */ 00722 0, /* INTERSECT => nothing */ 00723 0, /* SELECT => nothing */ 00724 0, /* DISTINCT => nothing */ 00725 0, /* DOT => nothing */ 00726 0, /* FROM => nothing */ 00727 0, /* JOIN => nothing */ 00728 0, /* INDEXED => nothing */ 00729 0, /* BY => nothing */ 00730 0, /* USING => nothing */ 00731 0, /* ORDER => nothing */ 00732 0, /* GROUP => nothing */ 00733 0, /* HAVING => nothing */ 00734 0, /* LIMIT => nothing */ 00735 0, /* WHERE => nothing */ 00736 0, /* INTO => nothing */ 00737 0, /* VALUES => nothing */ 00738 0, /* INTEGER => nothing */ 00739 0, /* FLOAT => nothing */ 00740 0, /* BLOB => nothing */ 00741 0, /* REGISTER => nothing */ 00742 0, /* VARIABLE => nothing */ 00743 0, /* CASE => nothing */ 00744 0, /* WHEN => nothing */ 00745 0, /* THEN => nothing */ 00746 0, /* ELSE => nothing */ 00747 0, /* INDEX => nothing */ 00748 0, /* ALTER => nothing */ 00749 0, /* TO => nothing */ 00750 0, /* ADD => nothing */ 00751 0, /* COLUMNKW => nothing */ 00752 }; 00753 #endif /* YYFALLBACK */ 00754 00755 /* The following structure represents a single element of the 00756 ** parser's stack. Information stored includes: 00757 ** 00758 ** + The state number for the parser at this level of the stack. 00759 ** 00760 ** + The value of the token stored at this level of the stack. 00761 ** (In other words, the "major" token.) 00762 ** 00763 ** + The semantic value stored at this level of the stack. This is 00764 ** the information used by the action routines in the grammar. 00765 ** It is sometimes called the "minor" token. 00766 */ 00767 struct yyStackEntry { 00768 YYACTIONTYPE stateno; /* The state-number */ 00769 YYCODETYPE major; /* The major token value. This is the code 00770 ** number for the token at this stack level */ 00771 YYMINORTYPE minor; /* The user-supplied minor token value. This 00772 ** is the value of the token */ 00773 }; 00774 typedef struct yyStackEntry yyStackEntry; 00775 00776 /* The state of the parser is completely contained in an instance of 00777 ** the following structure */ 00778 struct yyParser { 00779 int yyidx; /* Index of top element in stack */ 00780 #ifdef YYTRACKMAXSTACKDEPTH 00781 int yyidxMax; /* Maximum value of yyidx */ 00782 #endif 00783 int yyerrcnt; /* Shifts left before out of the error */ 00784 sqlite3ParserARG_SDECL /* A place to hold %extra_argument */ 00785 #if YYSTACKDEPTH<=0 00786 int yystksz; /* Current side of the stack */ 00787 yyStackEntry *yystack; /* The parser's stack */ 00788 #else 00789 yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ 00790 #endif 00791 }; 00792 typedef struct yyParser yyParser; 00793 00794 #ifndef NDEBUG 00795 #include <stdio.h> 00796 static FILE *yyTraceFILE = 0; 00797 static char *yyTracePrompt = 0; 00798 #endif /* NDEBUG */ 00799 00800 #ifndef NDEBUG 00801 /* 00802 ** Turn parser tracing on by giving a stream to which to write the trace 00803 ** and a prompt to preface each trace message. Tracing is turned off 00804 ** by making either argument NULL 00805 ** 00806 ** Inputs: 00807 ** <ul> 00808 ** <li> A FILE* to which trace output should be written. 00809 ** If NULL, then tracing is turned off. 00810 ** <li> A prefix string written at the beginning of every 00811 ** line of trace output. If NULL, then tracing is 00812 ** turned off. 00813 ** </ul> 00814 ** 00815 ** Outputs: 00816 ** None. 00817 */ 00818 void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){ 00819 yyTraceFILE = TraceFILE; 00820 yyTracePrompt = zTracePrompt; 00821 if( yyTraceFILE==0 ) yyTracePrompt = 0; 00822 else if( yyTracePrompt==0 ) yyTraceFILE = 0; 00823 } 00824 #endif /* NDEBUG */ 00825 00826 #ifndef NDEBUG 00827 /* For tracing shifts, the names of all terminals and nonterminals 00828 ** are required. The following table supplies these names */ 00829 static const char *const yyTokenName[] = { 00830 "$", "SEMI", "EXPLAIN", "QUERY", 00831 "PLAN", "BEGIN", "TRANSACTION", "DEFERRED", 00832 "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END", 00833 "ROLLBACK", "CREATE", "TABLE", "IF", 00834 "NOT", "EXISTS", "TEMP", "LP", 00835 "RP", "AS", "COMMA", "ID", 00836 "ABORT", "AFTER", "ANALYZE", "ASC", 00837 "ATTACH", "BEFORE", "CASCADE", "CAST", 00838 "CONFLICT", "DATABASE", "DESC", "DETACH", 00839 "EACH", "FAIL", "FOR", "IGNORE", 00840 "INITIALLY", "INSTEAD", "LIKE_KW", "MATCH", 00841 "KEY", "OF", "OFFSET", "PRAGMA", 00842 "RAISE", "REPLACE", "RESTRICT", "ROW", 00843 "TRIGGER", "VACUUM", "VIEW", "VIRTUAL", 00844 "REINDEX", "RENAME", "CTIME_KW", "ANY", 00845 "OR", "AND", "IS", "BETWEEN", 00846 "IN", "ISNULL", "NOTNULL", "NE", 00847 "EQ", "GT", "LE", "LT", 00848 "GE", "ESCAPE", "BITAND", "BITOR", 00849 "LSHIFT", "RSHIFT", "PLUS", "MINUS", 00850 "STAR", "SLASH", "REM", "CONCAT", 00851 "COLLATE", "UMINUS", "UPLUS", "BITNOT", 00852 "STRING", "JOIN_KW", "CONSTRAINT", "DEFAULT", 00853 "NULL", "PRIMARY", "UNIQUE", "CHECK", 00854 "REFERENCES", "AUTOINCR", "ON", "DELETE", 00855 "UPDATE", "INSERT", "SET", "DEFERRABLE", 00856 "FOREIGN", "DROP", "UNION", "ALL", 00857 "EXCEPT", "INTERSECT", "SELECT", "DISTINCT", 00858 "DOT", "FROM", "JOIN", "INDEXED", 00859 "BY", "USING", "ORDER", "GROUP", 00860 "HAVING", "LIMIT", "WHERE", "INTO", 00861 "VALUES", "INTEGER", "FLOAT", "BLOB", 00862 "REGISTER", "VARIABLE", "CASE", "WHEN", 00863 "THEN", "ELSE", "INDEX", "ALTER", 00864 "TO", "ADD", "COLUMNKW", "error", 00865 "input", "cmdlist", "ecmd", "explain", 00866 "cmdx", "cmd", "transtype", "trans_opt", 00867 "nm", "create_table", "create_table_args", "temp", 00868 "ifnotexists", "dbnm", "columnlist", "conslist_opt", 00869 "select", "column", "columnid", "type", 00870 "carglist", "id", "ids", "typetoken", 00871 "typename", "signed", "plus_num", "minus_num", 00872 "carg", "ccons", "term", "expr", 00873 "onconf", "sortorder", "autoinc", "idxlist_opt", 00874 "refargs", "defer_subclause", "refarg", "refact", 00875 "init_deferred_pred_opt", "conslist", "tcons", "idxlist", 00876 "defer_subclause_opt", "orconf", "resolvetype", "raisetype", 00877 "ifexists", "fullname", "oneselect", "multiselect_op", 00878 "distinct", "selcollist", "from", "where_opt", 00879 "groupby_opt", "having_opt", "orderby_opt", "limit_opt", 00880 "sclp", "as", "seltablist", "stl_prefix", 00881 "joinop", "indexed_opt", "on_opt", "using_opt", 00882 "seltablist_paren", "joinop2", "inscollist", "sortlist", 00883 "sortitem", "nexprlist", "setlist", "insert_cmd", 00884 "inscollist_opt", "itemlist", "exprlist", "likeop", 00885 "escape", "between_op", "in_op", "case_operand", 00886 "case_exprlist", "case_else", "uniqueflag", "collate", 00887 "nmnum", "plus_opt", "number", "trigger_decl", 00888 "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", 00889 "when_clause", "trigger_cmd", "database_kw_opt", "key_opt", 00890 "add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist", 00891 "vtabarg", "vtabargtoken", "lp", "anylist", 00892 }; 00893 #endif /* NDEBUG */ 00894 00895 #ifndef NDEBUG 00896 /* For tracing reduce actions, the names of all rules are required. 00897 */ 00898 static const char *const yyRuleName[] = { 00899 /* 0 */ "input ::= cmdlist", 00900 /* 1 */ "cmdlist ::= cmdlist ecmd", 00901 /* 2 */ "cmdlist ::= ecmd", 00902 /* 3 */ "ecmd ::= SEMI", 00903 /* 4 */ "ecmd ::= explain cmdx SEMI", 00904 /* 5 */ "explain ::=", 00905 /* 6 */ "explain ::= EXPLAIN", 00906 /* 7 */ "explain ::= EXPLAIN QUERY PLAN", 00907 /* 8 */ "cmdx ::= cmd", 00908 /* 9 */ "cmd ::= BEGIN transtype trans_opt", 00909 /* 10 */ "trans_opt ::=", 00910 /* 11 */ "trans_opt ::= TRANSACTION", 00911 /* 12 */ "trans_opt ::= TRANSACTION nm", 00912 /* 13 */ "transtype ::=", 00913 /* 14 */ "transtype ::= DEFERRED", 00914 /* 15 */ "transtype ::= IMMEDIATE", 00915 /* 16 */ "transtype ::= EXCLUSIVE", 00916 /* 17 */ "cmd ::= COMMIT trans_opt", 00917 /* 18 */ "cmd ::= END trans_opt", 00918 /* 19 */ "cmd ::= ROLLBACK trans_opt", 00919 /* 20 */ "cmd ::= create_table create_table_args", 00920 /* 21 */ "create_table ::= CREATE temp TABLE ifnotexists nm dbnm", 00921 /* 22 */ "ifnotexists ::=", 00922 /* 23 */ "ifnotexists ::= IF NOT EXISTS", 00923 /* 24 */ "temp ::= TEMP", 00924 /* 25 */ "temp ::=", 00925 /* 26 */ "create_table_args ::= LP columnlist conslist_opt RP", 00926 /* 27 */ "create_table_args ::= AS select", 00927 /* 28 */ "columnlist ::= columnlist COMMA column", 00928 /* 29 */ "columnlist ::= column", 00929 /* 30 */ "column ::= columnid type carglist", 00930 /* 31 */ "columnid ::= nm", 00931 /* 32 */ "id ::= ID", 00932 /* 33 */ "ids ::= ID|STRING", 00933 /* 34 */ "nm ::= ID", 00934 /* 35 */ "nm ::= STRING", 00935 /* 36 */ "nm ::= JOIN_KW", 00936 /* 37 */ "type ::=", 00937 /* 38 */ "type ::= typetoken", 00938 /* 39 */ "typetoken ::= typename", 00939 /* 40 */ "typetoken ::= typename LP signed RP", 00940 /* 41 */ "typetoken ::= typename LP signed COMMA signed RP", 00941 /* 42 */ "typename ::= ids", 00942 /* 43 */ "typename ::= typename ids", 00943 /* 44 */ "signed ::= plus_num", 00944 /* 45 */ "signed ::= minus_num", 00945 /* 46 */ "carglist ::= carglist carg", 00946 /* 47 */ "carglist ::=", 00947 /* 48 */ "carg ::= CONSTRAINT nm ccons", 00948 /* 49 */ "carg ::= ccons", 00949 /* 50 */ "ccons ::= DEFAULT term", 00950 /* 51 */ "ccons ::= DEFAULT LP expr RP", 00951 /* 52 */ "ccons ::= DEFAULT PLUS term", 00952 /* 53 */ "ccons ::= DEFAULT MINUS term", 00953 /* 54 */ "ccons ::= DEFAULT id", 00954 /* 55 */ "ccons ::= NULL onconf", 00955 /* 56 */ "ccons ::= NOT NULL onconf", 00956 /* 57 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc", 00957 /* 58 */ "ccons ::= UNIQUE onconf", 00958 /* 59 */ "ccons ::= CHECK LP expr RP", 00959 /* 60 */ "ccons ::= REFERENCES nm idxlist_opt refargs", 00960 /* 61 */ "ccons ::= defer_subclause", 00961 /* 62 */ "ccons ::= COLLATE ids", 00962 /* 63 */ "autoinc ::=", 00963 /* 64 */ "autoinc ::= AUTOINCR", 00964 /* 65 */ "refargs ::=", 00965 /* 66 */ "refargs ::= refargs refarg", 00966 /* 67 */ "refarg ::= MATCH nm", 00967 /* 68 */ "refarg ::= ON DELETE refact", 00968 /* 69 */ "refarg ::= ON UPDATE refact", 00969 /* 70 */ "refarg ::= ON INSERT refact", 00970 /* 71 */ "refact ::= SET NULL", 00971 /* 72 */ "refact ::= SET DEFAULT", 00972 /* 73 */ "refact ::= CASCADE", 00973 /* 74 */ "refact ::= RESTRICT", 00974 /* 75 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", 00975 /* 76 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", 00976 /* 77 */ "init_deferred_pred_opt ::=", 00977 /* 78 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", 00978 /* 79 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", 00979 /* 80 */ "conslist_opt ::=", 00980 /* 81 */ "conslist_opt ::= COMMA conslist", 00981 /* 82 */ "conslist ::= conslist COMMA tcons", 00982 /* 83 */ "conslist ::= conslist tcons", 00983 /* 84 */ "conslist ::= tcons", 00984 /* 85 */ "tcons ::= CONSTRAINT nm", 00985 /* 86 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf", 00986 /* 87 */ "tcons ::= UNIQUE LP idxlist RP onconf", 00987 /* 88 */ "tcons ::= CHECK LP expr RP onconf", 00988 /* 89 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", 00989 /* 90 */ "defer_subclause_opt ::=", 00990 /* 91 */ "defer_subclause_opt ::= defer_subclause", 00991 /* 92 */ "onconf ::=", 00992 /* 93 */ "onconf ::= ON CONFLICT resolvetype", 00993 /* 94 */ "orconf ::=", 00994 /* 95 */ "orconf ::= OR resolvetype", 00995 /* 96 */ "resolvetype ::= raisetype", 00996 /* 97 */ "resolvetype ::= IGNORE", 00997 /* 98 */ "resolvetype ::= REPLACE", 00998 /* 99 */ "cmd ::= DROP TABLE ifexists fullname", 00999 /* 100 */ "ifexists ::= IF EXISTS", 01000 /* 101 */ "ifexists ::=", 01001 /* 102 */ "cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select", 01002 /* 103 */ "cmd ::= DROP VIEW ifexists fullname", 01003 /* 104 */ "cmd ::= select", 01004 /* 105 */ "select ::= oneselect", 01005 /* 106 */ "select ::= select multiselect_op oneselect", 01006 /* 107 */ "multiselect_op ::= UNION", 01007 /* 108 */ "multiselect_op ::= UNION ALL", 01008 /* 109 */ "multiselect_op ::= EXCEPT|INTERSECT", 01009 /* 110 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", 01010 /* 111 */ "distinct ::= DISTINCT", 01011 /* 112 */ "distinct ::= ALL", 01012 /* 113 */ "distinct ::=", 01013 /* 114 */ "sclp ::= selcollist COMMA", 01014 /* 115 */ "sclp ::=", 01015 /* 116 */ "selcollist ::= sclp expr as", 01016 /* 117 */ "selcollist ::= sclp STAR", 01017 /* 118 */ "selcollist ::= sclp nm DOT STAR", 01018 /* 119 */ "as ::= AS nm", 01019 /* 120 */ "as ::= ids", 01020 /* 121 */ "as ::=", 01021 /* 122 */ "from ::=", 01022 /* 123 */ "from ::= FROM seltablist", 01023 /* 124 */ "stl_prefix ::= seltablist joinop", 01024 /* 125 */ "stl_prefix ::=", 01025 /* 126 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", 01026 /* 127 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt", 01027 /* 128 */ "seltablist_paren ::= select", 01028 /* 129 */ "seltablist_paren ::= seltablist", 01029 /* 130 */ "dbnm ::=", 01030 /* 131 */ "dbnm ::= DOT nm", 01031 /* 132 */ "fullname ::= nm dbnm", 01032 /* 133 */ "joinop ::= COMMA|JOIN", 01033 /* 134 */ "joinop ::= JOIN_KW JOIN", 01034 /* 135 */ "joinop ::= JOIN_KW nm JOIN", 01035 /* 136 */ "joinop ::= JOIN_KW nm nm JOIN", 01036 /* 137 */ "on_opt ::= ON expr", 01037 /* 138 */ "on_opt ::=", 01038 /* 139 */ "indexed_opt ::=", 01039 /* 140 */ "indexed_opt ::= INDEXED BY nm", 01040 /* 141 */ "indexed_opt ::= NOT INDEXED", 01041 /* 142 */ "using_opt ::= USING LP inscollist RP", 01042 /* 143 */ "using_opt ::=", 01043 /* 144 */ "orderby_opt ::=", 01044 /* 145 */ "orderby_opt ::= ORDER BY sortlist", 01045 /* 146 */ "sortlist ::= sortlist COMMA sortitem sortorder", 01046 /* 147 */ "sortlist ::= sortitem sortorder", 01047 /* 148 */ "sortitem ::= expr", 01048 /* 149 */ "sortorder ::= ASC", 01049 /* 150 */ "sortorder ::= DESC", 01050 /* 151 */ "sortorder ::=", 01051 /* 152 */ "groupby_opt ::=", 01052 /* 153 */ "groupby_opt ::= GROUP BY nexprlist", 01053 /* 154 */ "having_opt ::=", 01054 /* 155 */ "having_opt ::= HAVING expr", 01055 /* 156 */ "limit_opt ::=", 01056 /* 157 */ "limit_opt ::= LIMIT expr", 01057 /* 158 */ "limit_opt ::= LIMIT expr OFFSET expr", 01058 /* 159 */ "limit_opt ::= LIMIT expr COMMA expr", 01059 /* 160 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", 01060 /* 161 */ "where_opt ::=", 01061 /* 162 */ "where_opt ::= WHERE expr", 01062 /* 163 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", 01063 /* 164 */ "setlist ::= setlist COMMA nm EQ expr", 01064 /* 165 */ "setlist ::= nm EQ expr", 01065 /* 166 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP", 01066 /* 167 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", 01067 /* 168 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", 01068 /* 169 */ "insert_cmd ::= INSERT orconf", 01069 /* 170 */ "insert_cmd ::= REPLACE", 01070 /* 171 */ "itemlist ::= itemlist COMMA expr", 01071 /* 172 */ "itemlist ::= expr", 01072 /* 173 */ "inscollist_opt ::=", 01073 /* 174 */ "inscollist_opt ::= LP inscollist RP", 01074 /* 175 */ "inscollist ::= inscollist COMMA nm", 01075 /* 176 */ "inscollist ::= nm", 01076 /* 177 */ "expr ::= term", 01077 /* 178 */ "expr ::= LP expr RP", 01078 /* 179 */ "term ::= NULL", 01079 /* 180 */ "expr ::= ID", 01080 /* 181 */ "expr ::= JOIN_KW", 01081 /* 182 */ "expr ::= nm DOT nm", 01082 /* 183 */ "expr ::= nm DOT nm DOT nm", 01083 /* 184 */ "term ::= INTEGER|FLOAT|BLOB", 01084 /* 185 */ "term ::= STRING", 01085 /* 186 */ "expr ::= REGISTER", 01086 /* 187 */ "expr ::= VARIABLE", 01087 /* 188 */ "expr ::= expr COLLATE ids", 01088 /* 189 */ "expr ::= CAST LP expr AS typetoken RP", 01089 /* 190 */ "expr ::= ID LP distinct exprlist RP", 01090 /* 191 */ "expr ::= ID LP STAR RP", 01091 /* 192 */ "term ::= CTIME_KW", 01092 /* 193 */ "expr ::= expr AND expr", 01093 /* 194 */ "expr ::= expr OR expr", 01094 /* 195 */ "expr ::= expr LT|GT|GE|LE expr", 01095 /* 196 */ "expr ::= expr EQ|NE expr", 01096 /* 197 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", 01097 /* 198 */ "expr ::= expr PLUS|MINUS expr", 01098 /* 199 */ "expr ::= expr STAR|SLASH|REM expr", 01099 /* 200 */ "expr ::= expr CONCAT expr", 01100 /* 201 */ "likeop ::= LIKE_KW", 01101 /* 202 */ "likeop ::= NOT LIKE_KW", 01102 /* 203 */ "likeop ::= MATCH", 01103 /* 204 */ "likeop ::= NOT MATCH", 01104 /* 205 */ "escape ::= ESCAPE expr", 01105 /* 206 */ "escape ::=", 01106 /* 207 */ "expr ::= expr likeop expr escape", 01107 /* 208 */ "expr ::= expr ISNULL|NOTNULL", 01108 /* 209 */ "expr ::= expr IS NULL", 01109 /* 210 */ "expr ::= expr NOT NULL", 01110 /* 211 */ "expr ::= expr IS NOT NULL", 01111 /* 212 */ "expr ::= NOT expr", 01112 /* 213 */ "expr ::= BITNOT expr", 01113 /* 214 */ "expr ::= MINUS expr", 01114 /* 215 */ "expr ::= PLUS expr", 01115 /* 216 */ "between_op ::= BETWEEN", 01116 /* 217 */ "between_op ::= NOT BETWEEN", 01117 /* 218 */ "expr ::= expr between_op expr AND expr", 01118 /* 219 */ "in_op ::= IN", 01119 /* 220 */ "in_op ::= NOT IN", 01120 /* 221 */ "expr ::= expr in_op LP exprlist RP", 01121 /* 222 */ "expr ::= LP select RP", 01122 /* 223 */ "expr ::= expr in_op LP select RP", 01123 /* 224 */ "expr ::= expr in_op nm dbnm", 01124 /* 225 */ "expr ::= EXISTS LP select RP", 01125 /* 226 */ "expr ::= CASE case_operand case_exprlist case_else END", 01126 /* 227 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", 01127 /* 228 */ "case_exprlist ::= WHEN expr THEN expr", 01128 /* 229 */ "case_else ::= ELSE expr", 01129 /* 230 */ "case_else ::=", 01130 /* 231 */ "case_operand ::= expr", 01131 /* 232 */ "case_operand ::=", 01132 /* 233 */ "exprlist ::= nexprlist", 01133 /* 234 */ "exprlist ::=", 01134 /* 235 */ "nexprlist ::= nexprlist COMMA expr", 01135 /* 236 */ "nexprlist ::= expr", 01136 /* 237 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP", 01137 /* 238 */ "uniqueflag ::= UNIQUE", 01138 /* 239 */ "uniqueflag ::=", 01139 /* 240 */ "idxlist_opt ::=", 01140 /* 241 */ "idxlist_opt ::= LP idxlist RP", 01141 /* 242 */ "idxlist ::= idxlist COMMA nm collate sortorder", 01142 /* 243 */ "idxlist ::= nm collate sortorder", 01143 /* 244 */ "collate ::=", 01144 /* 245 */ "collate ::= COLLATE ids", 01145 /* 246 */ "cmd ::= DROP INDEX ifexists fullname", 01146 /* 247 */ "cmd ::= VACUUM", 01147 /* 248 */ "cmd ::= VACUUM nm", 01148 /* 249 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", 01149 /* 250 */ "cmd ::= PRAGMA nm dbnm EQ ON", 01150 /* 251 */ "cmd ::= PRAGMA nm dbnm EQ DELETE", 01151 /* 252 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", 01152 /* 253 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", 01153 /* 254 */ "cmd ::= PRAGMA nm dbnm", 01154 /* 255 */ "nmnum ::= plus_num", 01155 /* 256 */ "nmnum ::= nm", 01156 /* 257 */ "plus_num ::= plus_opt number", 01157 /* 258 */ "minus_num ::= MINUS number", 01158 /* 259 */ "number ::= INTEGER|FLOAT", 01159 /* 260 */ "plus_opt ::= PLUS", 01160 /* 261 */ "plus_opt ::=", 01161 /* 262 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END", 01162 /* 263 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", 01163 /* 264 */ "trigger_time ::= BEFORE", 01164 /* 265 */ "trigger_time ::= AFTER", 01165 /* 266 */ "trigger_time ::= INSTEAD OF", 01166 /* 267 */ "trigger_time ::=", 01167 /* 268 */ "trigger_event ::= DELETE|INSERT", 01168 /* 269 */ "trigger_event ::= UPDATE", 01169 /* 270 */ "trigger_event ::= UPDATE OF inscollist", 01170 /* 271 */ "foreach_clause ::=", 01171 /* 272 */ "foreach_clause ::= FOR EACH ROW", 01172 /* 273 */ "when_clause ::=", 01173 /* 274 */ "when_clause ::= WHEN expr", 01174 /* 275 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", 01175 /* 276 */ "trigger_cmd_list ::= trigger_cmd SEMI", 01176 /* 277 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt", 01177 /* 278 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP", 01178 /* 279 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select", 01179 /* 280 */ "trigger_cmd ::= DELETE FROM nm where_opt", 01180 /* 281 */ "trigger_cmd ::= select", 01181 /* 282 */ "expr ::= RAISE LP IGNORE RP", 01182 /* 283 */ "expr ::= RAISE LP raisetype COMMA nm RP", 01183 /* 284 */ "raisetype ::= ROLLBACK", 01184 /* 285 */ "raisetype ::= ABORT", 01185 /* 286 */ "raisetype ::= FAIL", 01186 /* 287 */ "cmd ::= DROP TRIGGER ifexists fullname", 01187 /* 288 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", 01188 /* 289 */ "cmd ::= DETACH database_kw_opt expr", 01189 /* 290 */ "key_opt ::=", 01190 /* 291 */ "key_opt ::= KEY expr", 01191 /* 292 */ "database_kw_opt ::= DATABASE", 01192 /* 293 */ "database_kw_opt ::=", 01193 /* 294 */ "cmd ::= REINDEX", 01194 /* 295 */ "cmd ::= REINDEX nm dbnm", 01195 /* 296 */ "cmd ::= ANALYZE", 01196 /* 297 */ "cmd ::= ANALYZE nm dbnm", 01197 /* 298 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", 01198 /* 299 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", 01199 /* 300 */ "add_column_fullname ::= fullname", 01200 /* 301 */ "kwcolumn_opt ::=", 01201 /* 302 */ "kwcolumn_opt ::= COLUMNKW", 01202 /* 303 */ "cmd ::= create_vtab", 01203 /* 304 */ "cmd ::= create_vtab LP vtabarglist RP", 01204 /* 305 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm", 01205 /* 306 */ "vtabarglist ::= vtabarg", 01206 /* 307 */ "vtabarglist ::= vtabarglist COMMA vtabarg", 01207 /* 308 */ "vtabarg ::=", 01208 /* 309 */ "vtabarg ::= vtabarg vtabargtoken", 01209 /* 310 */ "vtabargtoken ::= ANY", 01210 /* 311 */ "vtabargtoken ::= lp anylist RP", 01211 /* 312 */ "lp ::= LP", 01212 /* 313 */ "anylist ::=", 01213 /* 314 */ "anylist ::= anylist ANY", 01214 }; 01215 #endif /* NDEBUG */ 01216 01217 01218 #if YYSTACKDEPTH<=0 01219 /* 01220 ** Try to increase the size of the parser stack. 01221 */ 01222 static void yyGrowStack(yyParser *p){ 01223 int newSize; 01224 yyStackEntry *pNew; 01225 01226 newSize = p->yystksz*2 + 100; 01227 pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); 01228 if( pNew ){ 01229 p->yystack = pNew; 01230 p->yystksz = newSize; 01231 #ifndef NDEBUG 01232 if( yyTraceFILE ){ 01233 fprintf(yyTraceFILE,"%sStack grows to %d entries!\n", 01234 yyTracePrompt, p->yystksz); 01235 } 01236 #endif 01237 } 01238 } 01239 #endif 01240 01241 /* 01242 ** This function allocates a new parser. 01243 ** The only argument is a pointer to a function which works like 01244 ** malloc. 01245 ** 01246 ** Inputs: 01247 ** A pointer to the function used to allocate memory. 01248 ** 01249 ** Outputs: 01250 ** A pointer to a parser. This pointer is used in subsequent calls 01251 ** to sqlite3Parser and sqlite3ParserFree. 01252 */ 01253 void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){ 01254 yyParser *pParser; 01255 pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) ); 01256 if( pParser ){ 01257 pParser->yyidx = -1; 01258 #ifdef YYTRACKMAXSTACKDEPTH 01259 pParser->yyidxMax = 0; 01260 #endif 01261 #if YYSTACKDEPTH<=0 01262 yyGrowStack(pParser); 01263 #endif 01264 } 01265 return pParser; 01266 } 01267 01268 /* The following function deletes the value associated with a 01269 ** symbol. The symbol can be either a terminal or nonterminal. 01270 ** "yymajor" is the symbol code, and "yypminor" is a pointer to 01271 ** the value. 01272 */ 01273 static void yy_destructor( 01274 yyParser *yypParser, /* The parser */ 01275 YYCODETYPE yymajor, /* Type code for object to destroy */ 01276 YYMINORTYPE *yypminor /* The object to be destroyed */ 01277 ){ 01278 sqlite3ParserARG_FETCH; 01279 switch( yymajor ){ 01280 /* Here is inserted the actions which take place when a 01281 ** terminal or non-terminal is destroyed. This can happen 01282 ** when the symbol is popped from the stack during a 01283 ** reduce or during error processing or when a parser is 01284 ** being destroyed before it is finished parsing. 01285 ** 01286 ** Note: during a reduce, the only symbols destroyed are those 01287 ** which appear on the RHS of the rule, but which are not used 01288 ** inside the C code. 01289 */ 01290 case 156: /* select */ 01291 case 190: /* oneselect */ 01292 case 208: /* seltablist_paren */ 01293 { 01294 #line 370 "parse.y" 01295 sqlite3SelectDelete(pParse->db, (yypminor->yy43)); 01296 #line 1300 "parse.c" 01297 } 01298 break; 01299 case 170: /* term */ 01300 case 171: /* expr */ 01301 case 195: /* where_opt */ 01302 case 197: /* having_opt */ 01303 case 206: /* on_opt */ 01304 case 212: /* sortitem */ 01305 case 220: /* escape */ 01306 case 223: /* case_operand */ 01307 case 225: /* case_else */ 01308 case 236: /* when_clause */ 01309 case 239: /* key_opt */ 01310 { 01311 #line 670 "parse.y" 01312 sqlite3ExprDelete(pParse->db, (yypminor->yy450)); 01313 #line 1317 "parse.c" 01314 } 01315 break; 01316 case 175: /* idxlist_opt */ 01317 case 183: /* idxlist */ 01318 case 193: /* selcollist */ 01319 case 196: /* groupby_opt */ 01320 case 198: /* orderby_opt */ 01321 case 200: /* sclp */ 01322 case 211: /* sortlist */ 01323 case 213: /* nexprlist */ 01324 case 214: /* setlist */ 01325 case 217: /* itemlist */ 01326 case 218: /* exprlist */ 01327 case 224: /* case_exprlist */ 01328 { 01329 #line 928 "parse.y" 01330 sqlite3ExprListDelete(pParse->db, (yypminor->yy242)); 01331 #line 1335 "parse.c" 01332 } 01333 break; 01334 case 189: /* fullname */ 01335 case 194: /* from */ 01336 case 202: /* seltablist */ 01337 case 203: /* stl_prefix */ 01338 { 01339 #line 488 "parse.y" 01340 sqlite3SrcListDelete(pParse->db, (yypminor->yy419)); 01341 #line 1345 "parse.c" 01342 } 01343 break; 01344 case 207: /* using_opt */ 01345 case 210: /* inscollist */ 01346 case 216: /* inscollist_opt */ 01347 { 01348 #line 520 "parse.y" 01349 sqlite3IdListDelete(pParse->db, (yypminor->yy352)); 01350 #line 1354 "parse.c" 01351 } 01352 break; 01353 case 232: /* trigger_cmd_list */ 01354 case 237: /* trigger_cmd */ 01355 { 01356 #line 1032 "parse.y" 01357 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy75)); 01358 #line 1362 "parse.c" 01359 } 01360 break; 01361 case 234: /* trigger_event */ 01362 { 01363 #line 1018 "parse.y" 01364 sqlite3IdListDelete(pParse->db, (yypminor->yy354).b); 01365 #line 1369 "parse.c" 01366 } 01367 break; 01368 default: break; /* If no destructor action specified: do nothing */ 01369 } 01370 } 01371 01372 /* 01373 ** Pop the parser's stack once. 01374 ** 01375 ** If there is a destructor routine associated with the token which 01376 ** is popped from the stack, then call it. 01377 ** 01378 ** Return the major token number for the symbol popped. 01379 */ 01380 static int yy_pop_parser_stack(yyParser *pParser){ 01381 YYCODETYPE yymajor; 01382 yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; 01383 01384 if( pParser->yyidx<0 ) return 0; 01385 #ifndef NDEBUG 01386 if( yyTraceFILE && pParser->yyidx>=0 ){ 01387 fprintf(yyTraceFILE,"%sPopping %s\n", 01388 yyTracePrompt, 01389 yyTokenName[yytos->major]); 01390 } 01391 #endif 01392 yymajor = yytos->major; 01393 yy_destructor(pParser, yymajor, &yytos->minor); 01394 pParser->yyidx--; 01395 return yymajor; 01396 } 01397 01398 /* 01399 ** Deallocate and destroy a parser. Destructors are all called for 01400 ** all stack elements before shutting the parser down. 01401 ** 01402 ** Inputs: 01403 ** <ul> 01404 ** <li> A pointer to the parser. This should be a pointer 01405 ** obtained from sqlite3ParserAlloc. 01406 ** <li> A pointer to a function used to reclaim memory obtained 01407 ** from malloc. 01408 ** </ul> 01409 */ 01410 void sqlite3ParserFree( 01411 void *p, /* The parser to be deleted */ 01412 void (*freeProc)(void*) /* Function used to reclaim memory */ 01413 ){ 01414 yyParser *pParser = (yyParser*)p; 01415 if( pParser==0 ) return; 01416 while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser); 01417 #if YYSTACKDEPTH<=0 01418 free(pParser->yystack); 01419 #endif 01420 (*freeProc)((void*)pParser); 01421 } 01422 01423 /* 01424 ** Return the peak depth of the stack for a parser. 01425 */ 01426 #ifdef YYTRACKMAXSTACKDEPTH 01427 int sqlite3ParserStackPeak(void *p){ 01428 yyParser *pParser = (yyParser*)p; 01429 return pParser->yyidxMax; 01430 } 01431 #endif 01432 01433 /* 01434 ** Find the appropriate action for a parser given the terminal 01435 ** look-ahead token iLookAhead. 01436 ** 01437 ** If the look-ahead token is YYNOCODE, then check to see if the action is 01438 ** independent of the look-ahead. If it is, return the action, otherwise 01439 ** return YY_NO_ACTION. 01440 */ 01441 static int yy_find_shift_action( 01442 yyParser *pParser, /* The parser */ 01443 YYCODETYPE iLookAhead /* The look-ahead token */ 01444 ){ 01445 int i; 01446 int stateno = pParser->yystack[pParser->yyidx].stateno; 01447 01448 if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){ 01449 return yy_default[stateno]; 01450 } 01451 assert( iLookAhead!=YYNOCODE ); 01452 i += iLookAhead; 01453 if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 01454 if( iLookAhead>0 ){ 01455 #ifdef YYFALLBACK 01456 int iFallback; /* Fallback token */ 01457 if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) 01458 && (iFallback = yyFallback[iLookAhead])!=0 ){ 01459 #ifndef NDEBUG 01460 if( yyTraceFILE ){ 01461 fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", 01462 yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); 01463 } 01464 #endif 01465 return yy_find_shift_action(pParser, iFallback); 01466 } 01467 #endif 01468 #ifdef YYWILDCARD 01469 { 01470 int j = i - iLookAhead + YYWILDCARD; 01471 if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){ 01472 #ifndef NDEBUG 01473 if( yyTraceFILE ){ 01474 fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", 01475 yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]); 01476 } 01477 #endif /* NDEBUG */ 01478 return yy_action[j]; 01479 } 01480 } 01481 #endif /* YYWILDCARD */ 01482 } 01483 return yy_default[stateno]; 01484 }else{ 01485 return yy_action[i]; 01486 } 01487 } 01488 01489 /* 01490 ** Find the appropriate action for a parser given the non-terminal 01491 ** look-ahead token iLookAhead. 01492 ** 01493 ** If the look-ahead token is YYNOCODE, then check to see if the action is 01494 ** independent of the look-ahead. If it is, return the action, otherwise 01495 ** return YY_NO_ACTION. 01496 */ 01497 static int yy_find_reduce_action( 01498 int stateno, /* Current state number */ 01499 YYCODETYPE iLookAhead /* The look-ahead token */ 01500 ){ 01501 int i; 01502 #ifdef YYERRORSYMBOL 01503 if( stateno>YY_REDUCE_MAX ){ 01504 return yy_default[stateno]; 01505 } 01506 #else 01507 assert( stateno<=YY_REDUCE_MAX ); 01508 #endif 01509 i = yy_reduce_ofst[stateno]; 01510 assert( i!=YY_REDUCE_USE_DFLT ); 01511 assert( iLookAhead!=YYNOCODE ); 01512 i += iLookAhead; 01513 #ifdef YYERRORSYMBOL 01514 if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 01515 return yy_default[stateno]; 01516 } 01517 #else 01518 assert( i>=0 && i<YY_SZ_ACTTAB ); 01519 assert( yy_lookahead[i]==iLookAhead ); 01520 #endif 01521 return yy_action[i]; 01522 } 01523 01524 /* 01525 ** The following routine is called if the stack overflows. 01526 */ 01527 static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){ 01528 sqlite3ParserARG_FETCH; 01529 yypParser->yyidx--; 01530 #ifndef NDEBUG 01531 if( yyTraceFILE ){ 01532 fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); 01533 } 01534 #endif 01535 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); 01536 /* Here code is inserted which will execute if the parser 01537 ** stack every overflows */ 01538 #line 39 "parse.y" 01539 01540 sqlite3ErrorMsg(pParse, "parser stack overflow"); 01541 pParse->parseError = 1; 01542 #line 1547 "parse.c" 01543 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */ 01544 } 01545 01546 /* 01547 ** Perform a shift action. 01548 */ 01549 static void yy_shift( 01550 yyParser *yypParser, /* The parser to be shifted */ 01551 int yyNewState, /* The new state to shift in */ 01552 int yyMajor, /* The major token to shift in */ 01553 YYMINORTYPE *yypMinor /* Pointer to the minor token to shift in */ 01554 ){ 01555 yyStackEntry *yytos; 01556 yypParser->yyidx++; 01557 #ifdef YYTRACKMAXSTACKDEPTH 01558 if( yypParser->yyidx>yypParser->yyidxMax ){ 01559 yypParser->yyidxMax = yypParser->yyidx; 01560 } 01561 #endif 01562 #if YYSTACKDEPTH>0 01563 if( yypParser->yyidx>=YYSTACKDEPTH ){ 01564 yyStackOverflow(yypParser, yypMinor); 01565 return; 01566 } 01567 #else 01568 if( yypParser->yyidx>=yypParser->yystksz ){ 01569 yyGrowStack(yypParser); 01570 if( yypParser->yyidx>=yypParser->yystksz ){ 01571 yyStackOverflow(yypParser, yypMinor); 01572 return; 01573 } 01574 } 01575 #endif 01576 yytos = &yypParser->yystack[yypParser->yyidx]; 01577 yytos->stateno = yyNewState; 01578 yytos->major = yyMajor; 01579 yytos->minor = *yypMinor; 01580 #ifndef NDEBUG 01581 if( yyTraceFILE && yypParser->yyidx>0 ){ 01582 int i; 01583 fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); 01584 fprintf(yyTraceFILE,"%sStack:",yyTracePrompt); 01585 for(i=1; i<=yypParser->yyidx; i++) 01586 fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]); 01587 fprintf(yyTraceFILE,"\n"); 01588 } 01589 #endif 01590 } 01591 01592 /* The following table contains information about every rule that 01593 ** is used during the reduce. 01594 */ 01595 static const struct { 01596 YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ 01597 unsigned char nrhs; /* Number of right-hand side symbols in the rule */ 01598 } yyRuleInfo[] = { 01599 { 140, 1 }, 01600 { 141, 2 }, 01601 { 141, 1 }, 01602 { 142, 1 }, 01603 { 142, 3 }, 01604 { 143, 0 }, 01605 { 143, 1 }, 01606 { 143, 3 }, 01607 { 144, 1 }, 01608 { 145, 3 }, 01609 { 147, 0 }, 01610 { 147, 1 }, 01611 { 147, 2 }, 01612 { 146, 0 }, 01613 { 146, 1 }, 01614 { 146, 1 }, 01615 { 146, 1 }, 01616 { 145, 2 }, 01617 { 145, 2 }, 01618 { 145, 2 }, 01619 { 145, 2 }, 01620 { 149, 6 }, 01621 { 152, 0 }, 01622 { 152, 3 }, 01623 { 151, 1 }, 01624 { 151, 0 }, 01625 { 150, 4 }, 01626 { 150, 2 }, 01627 { 154, 3 }, 01628 { 154, 1 }, 01629 { 157, 3 }, 01630 { 158, 1 }, 01631 { 161, 1 }, 01632 { 162, 1 }, 01633 { 148, 1 }, 01634 { 148, 1 }, 01635 { 148, 1 }, 01636 { 159, 0 }, 01637 { 159, 1 }, 01638 { 163, 1 }, 01639 { 163, 4 }, 01640 { 163, 6 }, 01641 { 164, 1 }, 01642 { 164, 2 }, 01643 { 165, 1 }, 01644 { 165, 1 }, 01645 { 160, 2 }, 01646 { 160, 0 }, 01647 { 168, 3 }, 01648 { 168, 1 }, 01649 { 169, 2 }, 01650 { 169, 4 }, 01651 { 169, 3 }, 01652 { 169, 3 }, 01653 { 169, 2 }, 01654 { 169, 2 }, 01655 { 169, 3 }, 01656 { 169, 5 }, 01657 { 169, 2 }, 01658 { 169, 4 }, 01659 { 169, 4 }, 01660 { 169, 1 }, 01661 { 169, 2 }, 01662 { 174, 0 }, 01663 { 174, 1 }, 01664 { 176, 0 }, 01665 { 176, 2 }, 01666 { 178, 2 }, 01667 { 178, 3 }, 01668 { 178, 3 }, 01669 { 178, 3 }, 01670 { 179, 2 }, 01671 { 179, 2 }, 01672 { 179, 1 }, 01673 { 179, 1 }, 01674 { 177, 3 }, 01675 { 177, 2 }, 01676 { 180, 0 }, 01677 { 180, 2 }, 01678 { 180, 2 }, 01679 { 155, 0 }, 01680 { 155, 2 }, 01681 { 181, 3 }, 01682 { 181, 2 }, 01683 { 181, 1 }, 01684 { 182, 2 }, 01685 { 182, 7 }, 01686 { 182, 5 }, 01687 { 182, 5 }, 01688 { 182, 10 }, 01689 { 184, 0 }, 01690 { 184, 1 }, 01691 { 172, 0 }, 01692 { 172, 3 }, 01693 { 185, 0 }, 01694 { 185, 2 }, 01695 { 186, 1 }, 01696 { 186, 1 }, 01697 { 186, 1 }, 01698 { 145, 4 }, 01699 { 188, 2 }, 01700 { 188, 0 }, 01701 { 145, 8 }, 01702 { 145, 4 }, 01703 { 145, 1 }, 01704 { 156, 1 }, 01705 { 156, 3 }, 01706 { 191, 1 }, 01707 { 191, 2 }, 01708 { 191, 1 }, 01709 { 190, 9 }, 01710 { 192, 1 }, 01711 { 192, 1 }, 01712 { 192, 0 }, 01713 { 200, 2 }, 01714 { 200, 0 }, 01715 { 193, 3 }, 01716 { 193, 2 }, 01717 { 193, 4 }, 01718 { 201, 2 }, 01719 { 201, 1 }, 01720 { 201, 0 }, 01721 { 194, 0 }, 01722 { 194, 2 }, 01723 { 203, 2 }, 01724 { 203, 0 }, 01725 { 202, 7 }, 01726 { 202, 7 }, 01727 { 208, 1 }, 01728 { 208, 1 }, 01729 { 153, 0 }, 01730 { 153, 2 }, 01731 { 189, 2 }, 01732 { 204, 1 }, 01733 { 204, 2 }, 01734 { 204, 3 }, 01735 { 204, 4 }, 01736 { 206, 2 }, 01737 { 206, 0 }, 01738 { 205, 0 }, 01739 { 205, 3 }, 01740 { 205, 2 }, 01741 { 207, 4 }, 01742 { 207, 0 }, 01743 { 198, 0 }, 01744 { 198, 3 }, 01745 { 211, 4 }, 01746 { 211, 2 }, 01747 { 212, 1 }, 01748 { 173, 1 }, 01749 { 173, 1 }, 01750 { 173, 0 }, 01751 { 196, 0 }, 01752 { 196, 3 }, 01753 { 197, 0 }, 01754 { 197, 2 }, 01755 { 199, 0 }, 01756 { 199, 2 }, 01757 { 199, 4 }, 01758 { 199, 4 }, 01759 { 145, 5 }, 01760 { 195, 0 }, 01761 { 195, 2 }, 01762 { 145, 7 }, 01763 { 214, 5 }, 01764 { 214, 3 }, 01765 { 145, 8 }, 01766 { 145, 5 }, 01767 { 145, 6 }, 01768 { 215, 2 }, 01769 { 215, 1 }, 01770 { 217, 3 }, 01771 { 217, 1 }, 01772 { 216, 0 }, 01773 { 216, 3 }, 01774 { 210, 3 }, 01775 { 210, 1 }, 01776 { 171, 1 }, 01777 { 171, 3 }, 01778 { 170, 1 }, 01779 { 171, 1 }, 01780 { 171, 1 }, 01781 { 171, 3 }, 01782 { 171, 5 }, 01783 { 170, 1 }, 01784 { 170, 1 }, 01785 { 171, 1 }, 01786 { 171, 1 }, 01787 { 171, 3 }, 01788 { 171, 6 }, 01789 { 171, 5 }, 01790 { 171, 4 }, 01791 { 170, 1 }, 01792 { 171, 3 }, 01793 { 171, 3 }, 01794 { 171, 3 }, 01795 { 171, 3 }, 01796 { 171, 3 }, 01797 { 171, 3 }, 01798 { 171, 3 }, 01799 { 171, 3 }, 01800 { 219, 1 }, 01801 { 219, 2 }, 01802 { 219, 1 }, 01803 { 219, 2 }, 01804 { 220, 2 }, 01805 { 220, 0 }, 01806 { 171, 4 }, 01807 { 171, 2 }, 01808 { 171, 3 }, 01809 { 171, 3 }, 01810 { 171, 4 }, 01811 { 171, 2 }, 01812 { 171, 2 }, 01813 { 171, 2 }, 01814 { 171, 2 }, 01815 { 221, 1 }, 01816 { 221, 2 }, 01817 { 171, 5 }, 01818 { 222, 1 }, 01819 { 222, 2 }, 01820 { 171, 5 }, 01821 { 171, 3 }, 01822 { 171, 5 }, 01823 { 171, 4 }, 01824 { 171, 4 }, 01825 { 171, 5 }, 01826 { 224, 5 }, 01827 { 224, 4 }, 01828 { 225, 2 }, 01829 { 225, 0 }, 01830 { 223, 1 }, 01831 { 223, 0 }, 01832 { 218, 1 }, 01833 { 218, 0 }, 01834 { 213, 3 }, 01835 { 213, 1 }, 01836 { 145, 11 }, 01837 { 226, 1 }, 01838 { 226, 0 }, 01839 { 175, 0 }, 01840 { 175, 3 }, 01841 { 183, 5 }, 01842 { 183, 3 }, 01843 { 227, 0 }, 01844 { 227, 2 }, 01845 { 145, 4 }, 01846 { 145, 1 }, 01847 { 145, 2 }, 01848 { 145, 5 }, 01849 { 145, 5 }, 01850 { 145, 5 }, 01851 { 145, 5 }, 01852 { 145, 6 }, 01853 { 145, 3 }, 01854 { 228, 1 }, 01855 { 228, 1 }, 01856 { 166, 2 }, 01857 { 167, 2 }, 01858 { 230, 1 }, 01859 { 229, 1 }, 01860 { 229, 0 }, 01861 { 145, 5 }, 01862 { 231, 11 }, 01863 { 233, 1 }, 01864 { 233, 1 }, 01865 { 233, 2 }, 01866 { 233, 0 }, 01867 { 234, 1 }, 01868 { 234, 1 }, 01869 { 234, 3 }, 01870 { 235, 0 }, 01871 { 235, 3 }, 01872 { 236, 0 }, 01873 { 236, 2 }, 01874 { 232, 3 }, 01875 { 232, 2 }, 01876 { 237, 6 }, 01877 { 237, 8 }, 01878 { 237, 5 }, 01879 { 237, 4 }, 01880 { 237, 1 }, 01881 { 171, 4 }, 01882 { 171, 6 }, 01883 { 187, 1 }, 01884 { 187, 1 }, 01885 { 187, 1 }, 01886 { 145, 4 }, 01887 { 145, 6 }, 01888 { 145, 3 }, 01889 { 239, 0 }, 01890 { 239, 2 }, 01891 { 238, 1 }, 01892 { 238, 0 }, 01893 { 145, 1 }, 01894 { 145, 3 }, 01895 { 145, 1 }, 01896 { 145, 3 }, 01897 { 145, 6 }, 01898 { 145, 6 }, 01899 { 240, 1 }, 01900 { 241, 0 }, 01901 { 241, 1 }, 01902 { 145, 1 }, 01903 { 145, 4 }, 01904 { 242, 7 }, 01905 { 243, 1 }, 01906 { 243, 3 }, 01907 { 244, 0 }, 01908 { 244, 2 }, 01909 { 245, 1 }, 01910 { 245, 3 }, 01911 { 246, 1 }, 01912 { 247, 0 }, 01913 { 247, 2 }, 01914 }; 01915 01916 static void yy_accept(yyParser*); /* Forward Declaration */ 01917 01918 /* 01919 ** Perform a reduce action and the shift that must immediately 01920 ** follow the reduce. 01921 */ 01922 static void yy_reduce( 01923 yyParser *yypParser, /* The parser */ 01924 int yyruleno /* Number of the rule by which to reduce */ 01925 ){ 01926 int yygoto; /* The next state */ 01927 int yyact; /* The next action */ 01928 YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ 01929 yyStackEntry *yymsp; /* The top of the parser's stack */ 01930 int yysize; /* Amount to pop the stack */ 01931 sqlite3ParserARG_FETCH; 01932 yymsp = &yypParser->yystack[yypParser->yyidx]; 01933 #ifndef NDEBUG 01934 if( yyTraceFILE && yyruleno>=0 01935 && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ 01936 fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, 01937 yyRuleName[yyruleno]); 01938 } 01939 #endif /* NDEBUG */ 01940 01941 /* Silence complaints from purify about yygotominor being uninitialized 01942 ** in some cases when it is copied into the stack after the following 01943 ** switch. yygotominor is uninitialized when a rule reduces that does 01944 ** not set the value of its left-hand side nonterminal. Leaving the 01945 ** value of the nonterminal uninitialized is utterly harmless as long 01946 ** as the value is never used. So really the only thing this code 01947 ** accomplishes is to quieten purify. 01948 ** 01949 ** 2007-01-16: The wireshark project (www.wireshark.org) reports that 01950 ** without this code, their parser segfaults. I'm not sure what there 01951 ** parser is doing to make this happen. This is the second bug report 01952 ** from wireshark this week. Clearly they are stressing Lemon in ways 01953 ** that it has not been previously stressed... (SQLite ticket #2172) 01954 */ 01955 /*memset(&yygotominor, 0, sizeof(yygotominor));*/ 01956 yygotominor = yyzerominor; 01957 01958 01959 switch( yyruleno ){ 01960 /* Beginning here are the reduction cases. A typical example 01961 ** follows: 01962 ** case 0: 01963 ** #line <lineno> <grammarfile> 01964 ** { ... } // User supplied code 01965 ** #line <lineno> <thisfile> 01966 ** break; 01967 */ 01968 case 0: /* input ::= cmdlist */ 01969 case 1: /* cmdlist ::= cmdlist ecmd */ 01970 case 2: /* cmdlist ::= ecmd */ 01971 case 3: /* ecmd ::= SEMI */ 01972 case 4: /* ecmd ::= explain cmdx SEMI */ 01973 case 10: /* trans_opt ::= */ 01974 case 11: /* trans_opt ::= TRANSACTION */ 01975 case 12: /* trans_opt ::= TRANSACTION nm */ 01976 case 20: /* cmd ::= create_table create_table_args */ 01977 case 28: /* columnlist ::= columnlist COMMA column */ 01978 case 29: /* columnlist ::= column */ 01979 case 37: /* type ::= */ 01980 case 44: /* signed ::= plus_num */ 01981 case 45: /* signed ::= minus_num */ 01982 case 46: /* carglist ::= carglist carg */ 01983 case 47: /* carglist ::= */ 01984 case 48: /* carg ::= CONSTRAINT nm ccons */ 01985 case 49: /* carg ::= ccons */ 01986 case 55: /* ccons ::= NULL onconf */ 01987 case 82: /* conslist ::= conslist COMMA tcons */ 01988 case 83: /* conslist ::= conslist tcons */ 01989 case 84: /* conslist ::= tcons */ 01990 case 85: /* tcons ::= CONSTRAINT nm */ 01991 case 260: /* plus_opt ::= PLUS */ 01992 case 261: /* plus_opt ::= */ 01993 case 271: /* foreach_clause ::= */ 01994 case 272: /* foreach_clause ::= FOR EACH ROW */ 01995 case 292: /* database_kw_opt ::= DATABASE */ 01996 case 293: /* database_kw_opt ::= */ 01997 case 301: /* kwcolumn_opt ::= */ 01998 case 302: /* kwcolumn_opt ::= COLUMNKW */ 01999 case 306: /* vtabarglist ::= vtabarg */ 02000 case 307: /* vtabarglist ::= vtabarglist COMMA vtabarg */ 02001 case 309: /* vtabarg ::= vtabarg vtabargtoken */ 02002 case 313: /* anylist ::= */ 02003 #line 91 "parse.y" 02004 { 02005 } 02006 #line 2011 "parse.c" 02007 break; 02008 case 5: /* explain ::= */ 02009 #line 96 "parse.y" 02010 { sqlite3BeginParse(pParse, 0); } 02011 #line 2016 "parse.c" 02012 break; 02013 case 6: /* explain ::= EXPLAIN */ 02014 #line 98 "parse.y" 02015 { sqlite3BeginParse(pParse, 1); } 02016 #line 2021 "parse.c" 02017 break; 02018 case 7: /* explain ::= EXPLAIN QUERY PLAN */ 02019 #line 99 "parse.y" 02020 { sqlite3BeginParse(pParse, 2); } 02021 #line 2026 "parse.c" 02022 break; 02023 case 8: /* cmdx ::= cmd */ 02024 #line 101 "parse.y" 02025 { sqlite3FinishCoding(pParse); } 02026 #line 2031 "parse.c" 02027 break; 02028 case 9: /* cmd ::= BEGIN transtype trans_opt */ 02029 #line 106 "parse.y" 02030 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy316);} 02031 #line 2036 "parse.c" 02032 break; 02033 case 13: /* transtype ::= */ 02034 #line 111 "parse.y" 02035 {yygotominor.yy316 = TK_DEFERRED;} 02036 #line 2041 "parse.c" 02037 break; 02038 case 14: /* transtype ::= DEFERRED */ 02039 case 15: /* transtype ::= IMMEDIATE */ 02040 case 16: /* transtype ::= EXCLUSIVE */ 02041 case 107: /* multiselect_op ::= UNION */ 02042 case 109: /* multiselect_op ::= EXCEPT|INTERSECT */ 02043 #line 112 "parse.y" 02044 {yygotominor.yy316 = yymsp[0].major;} 02045 #line 2050 "parse.c" 02046 break; 02047 case 17: /* cmd ::= COMMIT trans_opt */ 02048 case 18: /* cmd ::= END trans_opt */ 02049 #line 115 "parse.y" 02050 {sqlite3CommitTransaction(pParse);} 02051 #line 2056 "parse.c" 02052 break; 02053 case 19: /* cmd ::= ROLLBACK trans_opt */ 02054 #line 117 "parse.y" 02055 {sqlite3RollbackTransaction(pParse);} 02056 #line 2061 "parse.c" 02057 break; 02058 case 21: /* create_table ::= CREATE temp TABLE ifnotexists nm dbnm */ 02059 #line 122 "parse.y" 02060 { 02061 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy316,0,0,yymsp[-2].minor.yy316); 02062 } 02063 #line 2068 "parse.c" 02064 break; 02065 case 22: /* ifnotexists ::= */ 02066 case 25: /* temp ::= */ 02067 case 63: /* autoinc ::= */ 02068 case 77: /* init_deferred_pred_opt ::= */ 02069 case 79: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ 02070 case 90: /* defer_subclause_opt ::= */ 02071 case 101: /* ifexists ::= */ 02072 case 112: /* distinct ::= ALL */ 02073 case 113: /* distinct ::= */ 02074 case 216: /* between_op ::= BETWEEN */ 02075 case 219: /* in_op ::= IN */ 02076 #line 126 "parse.y" 02077 {yygotominor.yy316 = 0;} 02078 #line 2083 "parse.c" 02079 break; 02080 case 23: /* ifnotexists ::= IF NOT EXISTS */ 02081 case 24: /* temp ::= TEMP */ 02082 case 64: /* autoinc ::= AUTOINCR */ 02083 case 78: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ 02084 case 100: /* ifexists ::= IF EXISTS */ 02085 case 111: /* distinct ::= DISTINCT */ 02086 case 217: /* between_op ::= NOT BETWEEN */ 02087 case 220: /* in_op ::= NOT IN */ 02088 #line 127 "parse.y" 02089 {yygotominor.yy316 = 1;} 02090 #line 2095 "parse.c" 02091 break; 02092 case 26: /* create_table_args ::= LP columnlist conslist_opt RP */ 02093 #line 133 "parse.y" 02094 { 02095 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); 02096 } 02097 #line 2102 "parse.c" 02098 break; 02099 case 27: /* create_table_args ::= AS select */ 02100 #line 136 "parse.y" 02101 { 02102 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy43); 02103 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy43); 02104 } 02105 #line 2110 "parse.c" 02106 break; 02107 case 30: /* column ::= columnid type carglist */ 02108 #line 148 "parse.y" 02109 { 02110 yygotominor.yy0.z = yymsp[-2].minor.yy0.z; 02111 yygotominor.yy0.n = (pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n; 02112 } 02113 #line 2118 "parse.c" 02114 break; 02115 case 31: /* columnid ::= nm */ 02116 #line 152 "parse.y" 02117 { 02118 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0); 02119 yygotominor.yy0 = yymsp[0].minor.yy0; 02120 } 02121 #line 2126 "parse.c" 02122 break; 02123 case 32: /* id ::= ID */ 02124 case 33: /* ids ::= ID|STRING */ 02125 case 34: /* nm ::= ID */ 02126 case 35: /* nm ::= STRING */ 02127 case 36: /* nm ::= JOIN_KW */ 02128 case 39: /* typetoken ::= typename */ 02129 case 42: /* typename ::= ids */ 02130 case 119: /* as ::= AS nm */ 02131 case 120: /* as ::= ids */ 02132 case 131: /* dbnm ::= DOT nm */ 02133 case 140: /* indexed_opt ::= INDEXED BY nm */ 02134 case 245: /* collate ::= COLLATE ids */ 02135 case 255: /* nmnum ::= plus_num */ 02136 case 256: /* nmnum ::= nm */ 02137 case 257: /* plus_num ::= plus_opt number */ 02138 case 258: /* minus_num ::= MINUS number */ 02139 case 259: /* number ::= INTEGER|FLOAT */ 02140 #line 162 "parse.y" 02141 {yygotominor.yy0 = yymsp[0].minor.yy0;} 02142 #line 2147 "parse.c" 02143 break; 02144 case 38: /* type ::= typetoken */ 02145 #line 223 "parse.y" 02146 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} 02147 #line 2152 "parse.c" 02148 break; 02149 case 40: /* typetoken ::= typename LP signed RP */ 02150 #line 225 "parse.y" 02151 { 02152 yygotominor.yy0.z = yymsp[-3].minor.yy0.z; 02153 yygotominor.yy0.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z; 02154 } 02155 #line 2160 "parse.c" 02156 break; 02157 case 41: /* typetoken ::= typename LP signed COMMA signed RP */ 02158 #line 229 "parse.y" 02159 { 02160 yygotominor.yy0.z = yymsp[-5].minor.yy0.z; 02161 yygotominor.yy0.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z; 02162 } 02163 #line 2168 "parse.c" 02164 break; 02165 case 43: /* typename ::= typename ids */ 02166 #line 235 "parse.y" 02167 {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);} 02168 #line 2173 "parse.c" 02169 break; 02170 case 50: /* ccons ::= DEFAULT term */ 02171 case 52: /* ccons ::= DEFAULT PLUS term */ 02172 #line 246 "parse.y" 02173 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy450);} 02174 #line 2179 "parse.c" 02175 break; 02176 case 51: /* ccons ::= DEFAULT LP expr RP */ 02177 #line 247 "parse.y" 02178 {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy450);} 02179 #line 2184 "parse.c" 02180 break; 02181 case 53: /* ccons ::= DEFAULT MINUS term */ 02182 #line 249 "parse.y" 02183 { 02184 Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy450, 0, 0); 02185 sqlite3ExprSpan(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy450->span); 02186 sqlite3AddDefaultValue(pParse,p); 02187 } 02188 #line 2193 "parse.c" 02189 break; 02190 case 54: /* ccons ::= DEFAULT id */ 02191 #line 254 "parse.y" 02192 { 02193 Expr *p = sqlite3PExpr(pParse, TK_STRING, 0, 0, &yymsp[0].minor.yy0); 02194 sqlite3AddDefaultValue(pParse,p); 02195 } 02196 #line 2201 "parse.c" 02197 break; 02198 case 56: /* ccons ::= NOT NULL onconf */ 02199 #line 263 "parse.y" 02200 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy316);} 02201 #line 2206 "parse.c" 02202 break; 02203 case 57: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ 02204 #line 265 "parse.y" 02205 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy316,yymsp[0].minor.yy316,yymsp[-2].minor.yy316);} 02206 #line 2211 "parse.c" 02207 break; 02208 case 58: /* ccons ::= UNIQUE onconf */ 02209 #line 266 "parse.y" 02210 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy316,0,0,0,0);} 02211 #line 2216 "parse.c" 02212 break; 02213 case 59: /* ccons ::= CHECK LP expr RP */ 02214 #line 267 "parse.y" 02215 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy450);} 02216 #line 2221 "parse.c" 02217 break; 02218 case 60: /* ccons ::= REFERENCES nm idxlist_opt refargs */ 02219 #line 269 "parse.y" 02220 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy242,yymsp[0].minor.yy316);} 02221 #line 2226 "parse.c" 02222 break; 02223 case 61: /* ccons ::= defer_subclause */ 02224 #line 270 "parse.y" 02225 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy316);} 02226 #line 2231 "parse.c" 02227 break; 02228 case 62: /* ccons ::= COLLATE ids */ 02229 #line 271 "parse.y" 02230 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} 02231 #line 2236 "parse.c" 02232 break; 02233 case 65: /* refargs ::= */ 02234 #line 284 "parse.y" 02235 { yygotominor.yy316 = OE_Restrict * 0x010101; } 02236 #line 2241 "parse.c" 02237 break; 02238 case 66: /* refargs ::= refargs refarg */ 02239 #line 285 "parse.y" 02240 { yygotominor.yy316 = (yymsp[-1].minor.yy316 & ~yymsp[0].minor.yy207.mask) | yymsp[0].minor.yy207.value; } 02241 #line 2246 "parse.c" 02242 break; 02243 case 67: /* refarg ::= MATCH nm */ 02244 #line 287 "parse.y" 02245 { yygotominor.yy207.value = 0; yygotominor.yy207.mask = 0x000000; } 02246 #line 2251 "parse.c" 02247 break; 02248 case 68: /* refarg ::= ON DELETE refact */ 02249 #line 288 "parse.y" 02250 { yygotominor.yy207.value = yymsp[0].minor.yy316; yygotominor.yy207.mask = 0x0000ff; } 02251 #line 2256 "parse.c" 02252 break; 02253 case 69: /* refarg ::= ON UPDATE refact */ 02254 #line 289 "parse.y" 02255 { yygotominor.yy207.value = yymsp[0].minor.yy316<<8; yygotominor.yy207.mask = 0x00ff00; } 02256 #line 2261 "parse.c" 02257 break; 02258 case 70: /* refarg ::= ON INSERT refact */ 02259 #line 290 "parse.y" 02260 { yygotominor.yy207.value = yymsp[0].minor.yy316<<16; yygotominor.yy207.mask = 0xff0000; } 02261 #line 2266 "parse.c" 02262 break; 02263 case 71: /* refact ::= SET NULL */ 02264 #line 292 "parse.y" 02265 { yygotominor.yy316 = OE_SetNull; } 02266 #line 2271 "parse.c" 02267 break; 02268 case 72: /* refact ::= SET DEFAULT */ 02269 #line 293 "parse.y" 02270 { yygotominor.yy316 = OE_SetDflt; } 02271 #line 2276 "parse.c" 02272 break; 02273 case 73: /* refact ::= CASCADE */ 02274 #line 294 "parse.y" 02275 { yygotominor.yy316 = OE_Cascade; } 02276 #line 2281 "parse.c" 02277 break; 02278 case 74: /* refact ::= RESTRICT */ 02279 #line 295 "parse.y" 02280 { yygotominor.yy316 = OE_Restrict; } 02281 #line 2286 "parse.c" 02282 break; 02283 case 75: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ 02284 case 76: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ 02285 case 91: /* defer_subclause_opt ::= defer_subclause */ 02286 case 93: /* onconf ::= ON CONFLICT resolvetype */ 02287 case 95: /* orconf ::= OR resolvetype */ 02288 case 96: /* resolvetype ::= raisetype */ 02289 case 169: /* insert_cmd ::= INSERT orconf */ 02290 #line 297 "parse.y" 02291 {yygotominor.yy316 = yymsp[0].minor.yy316;} 02292 #line 2297 "parse.c" 02293 break; 02294 case 80: /* conslist_opt ::= */ 02295 #line 307 "parse.y" 02296 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} 02297 #line 2302 "parse.c" 02298 break; 02299 case 81: /* conslist_opt ::= COMMA conslist */ 02300 #line 308 "parse.y" 02301 {yygotominor.yy0 = yymsp[-1].minor.yy0;} 02302 #line 2307 "parse.c" 02303 break; 02304 case 86: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ 02305 #line 314 "parse.y" 02306 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy242,yymsp[0].minor.yy316,yymsp[-2].minor.yy316,0);} 02307 #line 2312 "parse.c" 02308 break; 02309 case 87: /* tcons ::= UNIQUE LP idxlist RP onconf */ 02310 #line 316 "parse.y" 02311 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy242,yymsp[0].minor.yy316,0,0,0,0);} 02312 #line 2317 "parse.c" 02313 break; 02314 case 88: /* tcons ::= CHECK LP expr RP onconf */ 02315 #line 317 "parse.y" 02316 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy450);} 02317 #line 2322 "parse.c" 02318 break; 02319 case 89: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ 02320 #line 319 "parse.y" 02321 { 02322 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy242, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy242, yymsp[-1].minor.yy316); 02323 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy316); 02324 } 02325 #line 2330 "parse.c" 02326 break; 02327 case 92: /* onconf ::= */ 02328 case 94: /* orconf ::= */ 02329 #line 333 "parse.y" 02330 {yygotominor.yy316 = OE_Default;} 02331 #line 2336 "parse.c" 02332 break; 02333 case 97: /* resolvetype ::= IGNORE */ 02334 #line 338 "parse.y" 02335 {yygotominor.yy316 = OE_Ignore;} 02336 #line 2341 "parse.c" 02337 break; 02338 case 98: /* resolvetype ::= REPLACE */ 02339 case 170: /* insert_cmd ::= REPLACE */ 02340 #line 339 "parse.y" 02341 {yygotominor.yy316 = OE_Replace;} 02342 #line 2347 "parse.c" 02343 break; 02344 case 99: /* cmd ::= DROP TABLE ifexists fullname */ 02345 #line 343 "parse.y" 02346 { 02347 sqlite3DropTable(pParse, yymsp[0].minor.yy419, 0, yymsp[-1].minor.yy316); 02348 } 02349 #line 2354 "parse.c" 02350 break; 02351 case 102: /* cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select */ 02352 #line 353 "parse.y" 02353 { 02354 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy43, yymsp[-6].minor.yy316, yymsp[-4].minor.yy316); 02355 } 02356 #line 2361 "parse.c" 02357 break; 02358 case 103: /* cmd ::= DROP VIEW ifexists fullname */ 02359 #line 356 "parse.y" 02360 { 02361 sqlite3DropTable(pParse, yymsp[0].minor.yy419, 1, yymsp[-1].minor.yy316); 02362 } 02363 #line 2368 "parse.c" 02364 break; 02365 case 104: /* cmd ::= select */ 02366 #line 363 "parse.y" 02367 { 02368 SelectDest dest = {SRT_Output, 0, 0, 0, 0}; 02369 sqlite3Select(pParse, yymsp[0].minor.yy43, &dest); 02370 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy43); 02371 } 02372 #line 2377 "parse.c" 02373 break; 02374 case 105: /* select ::= oneselect */ 02375 case 128: /* seltablist_paren ::= select */ 02376 #line 374 "parse.y" 02377 {yygotominor.yy43 = yymsp[0].minor.yy43;} 02378 #line 2383 "parse.c" 02379 break; 02380 case 106: /* select ::= select multiselect_op oneselect */ 02381 #line 376 "parse.y" 02382 { 02383 if( yymsp[0].minor.yy43 ){ 02384 yymsp[0].minor.yy43->op = yymsp[-1].minor.yy316; 02385 yymsp[0].minor.yy43->pPrior = yymsp[-2].minor.yy43; 02386 }else{ 02387 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy43); 02388 } 02389 yygotominor.yy43 = yymsp[0].minor.yy43; 02390 } 02391 #line 2396 "parse.c" 02392 break; 02393 case 108: /* multiselect_op ::= UNION ALL */ 02394 #line 387 "parse.y" 02395 {yygotominor.yy316 = TK_ALL;} 02396 #line 2401 "parse.c" 02397 break; 02398 case 110: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ 02399 #line 391 "parse.y" 02400 { 02401 yygotominor.yy43 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy242,yymsp[-5].minor.yy419,yymsp[-4].minor.yy450,yymsp[-3].minor.yy242,yymsp[-2].minor.yy450,yymsp[-1].minor.yy242,yymsp[-7].minor.yy316,yymsp[0].minor.yy84.pLimit,yymsp[0].minor.yy84.pOffset); 02402 } 02403 #line 2408 "parse.c" 02404 break; 02405 case 114: /* sclp ::= selcollist COMMA */ 02406 case 241: /* idxlist_opt ::= LP idxlist RP */ 02407 #line 412 "parse.y" 02408 {yygotominor.yy242 = yymsp[-1].minor.yy242;} 02409 #line 2414 "parse.c" 02410 break; 02411 case 115: /* sclp ::= */ 02412 case 144: /* orderby_opt ::= */ 02413 case 152: /* groupby_opt ::= */ 02414 case 234: /* exprlist ::= */ 02415 case 240: /* idxlist_opt ::= */ 02416 #line 413 "parse.y" 02417 {yygotominor.yy242 = 0;} 02418 #line 2423 "parse.c" 02419 break; 02420 case 116: /* selcollist ::= sclp expr as */ 02421 #line 414 "parse.y" 02422 { 02423 yygotominor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy242,yymsp[-1].minor.yy450,yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); 02424 } 02425 #line 2430 "parse.c" 02426 break; 02427 case 117: /* selcollist ::= sclp STAR */ 02428 #line 417 "parse.y" 02429 { 02430 Expr *p = sqlite3PExpr(pParse, TK_ALL, 0, 0, 0); 02431 yygotominor.yy242 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy242, p, 0); 02432 } 02433 #line 2438 "parse.c" 02434 break; 02435 case 118: /* selcollist ::= sclp nm DOT STAR */ 02436 #line 421 "parse.y" 02437 { 02438 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); 02439 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 02440 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); 02441 yygotominor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy242, pDot, 0); 02442 } 02443 #line 2448 "parse.c" 02444 break; 02445 case 121: /* as ::= */ 02446 #line 434 "parse.y" 02447 {yygotominor.yy0.n = 0;} 02448 #line 2453 "parse.c" 02449 break; 02450 case 122: /* from ::= */ 02451 #line 446 "parse.y" 02452 {yygotominor.yy419 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy419));} 02453 #line 2458 "parse.c" 02454 break; 02455 case 123: /* from ::= FROM seltablist */ 02456 #line 447 "parse.y" 02457 { 02458 yygotominor.yy419 = yymsp[0].minor.yy419; 02459 sqlite3SrcListShiftJoinType(yygotominor.yy419); 02460 } 02461 #line 2466 "parse.c" 02462 break; 02463 case 124: /* stl_prefix ::= seltablist joinop */ 02464 #line 455 "parse.y" 02465 { 02466 yygotominor.yy419 = yymsp[-1].minor.yy419; 02467 if( yygotominor.yy419 && yygotominor.yy419->nSrc>0 ) yygotominor.yy419->a[yygotominor.yy419->nSrc-1].jointype = yymsp[0].minor.yy316; 02468 } 02469 #line 2474 "parse.c" 02470 break; 02471 case 125: /* stl_prefix ::= */ 02472 #line 459 "parse.y" 02473 {yygotominor.yy419 = 0;} 02474 #line 2479 "parse.c" 02475 break; 02476 case 126: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ 02477 #line 460 "parse.y" 02478 { 02479 yygotominor.yy419 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy419,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy450,yymsp[0].minor.yy352); 02480 sqlite3SrcListIndexedBy(pParse, yygotominor.yy419, &yymsp[-2].minor.yy0); 02481 } 02482 #line 2487 "parse.c" 02483 break; 02484 case 127: /* seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt */ 02485 #line 466 "parse.y" 02486 { 02487 yygotominor.yy419 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy419,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy43,yymsp[-1].minor.yy450,yymsp[0].minor.yy352); 02488 } 02489 #line 2494 "parse.c" 02490 break; 02491 case 129: /* seltablist_paren ::= seltablist */ 02492 #line 477 "parse.y" 02493 { 02494 sqlite3SrcListShiftJoinType(yymsp[0].minor.yy419); 02495 yygotominor.yy43 = sqlite3SelectNew(pParse,0,yymsp[0].minor.yy419,0,0,0,0,0,0,0); 02496 } 02497 #line 2502 "parse.c" 02498 break; 02499 case 130: /* dbnm ::= */ 02500 case 139: /* indexed_opt ::= */ 02501 #line 484 "parse.y" 02502 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} 02503 #line 2508 "parse.c" 02504 break; 02505 case 132: /* fullname ::= nm dbnm */ 02506 #line 489 "parse.y" 02507 {yygotominor.yy419 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} 02508 #line 2513 "parse.c" 02509 break; 02510 case 133: /* joinop ::= COMMA|JOIN */ 02511 #line 493 "parse.y" 02512 { yygotominor.yy316 = JT_INNER; } 02513 #line 2518 "parse.c" 02514 break; 02515 case 134: /* joinop ::= JOIN_KW JOIN */ 02516 #line 494 "parse.y" 02517 { yygotominor.yy316 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } 02518 #line 2523 "parse.c" 02519 break; 02520 case 135: /* joinop ::= JOIN_KW nm JOIN */ 02521 #line 495 "parse.y" 02522 { yygotominor.yy316 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } 02523 #line 2528 "parse.c" 02524 break; 02525 case 136: /* joinop ::= JOIN_KW nm nm JOIN */ 02526 #line 497 "parse.y" 02527 { yygotominor.yy316 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } 02528 #line 2533 "parse.c" 02529 break; 02530 case 137: /* on_opt ::= ON expr */ 02531 case 148: /* sortitem ::= expr */ 02532 case 155: /* having_opt ::= HAVING expr */ 02533 case 162: /* where_opt ::= WHERE expr */ 02534 case 177: /* expr ::= term */ 02535 case 205: /* escape ::= ESCAPE expr */ 02536 case 229: /* case_else ::= ELSE expr */ 02537 case 231: /* case_operand ::= expr */ 02538 #line 501 "parse.y" 02539 {yygotominor.yy450 = yymsp[0].minor.yy450;} 02540 #line 2545 "parse.c" 02541 break; 02542 case 138: /* on_opt ::= */ 02543 case 154: /* having_opt ::= */ 02544 case 161: /* where_opt ::= */ 02545 case 206: /* escape ::= */ 02546 case 230: /* case_else ::= */ 02547 case 232: /* case_operand ::= */ 02548 #line 502 "parse.y" 02549 {yygotominor.yy450 = 0;} 02550 #line 2555 "parse.c" 02551 break; 02552 case 141: /* indexed_opt ::= NOT INDEXED */ 02553 #line 517 "parse.y" 02554 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} 02555 #line 2560 "parse.c" 02556 break; 02557 case 142: /* using_opt ::= USING LP inscollist RP */ 02558 case 174: /* inscollist_opt ::= LP inscollist RP */ 02559 #line 521 "parse.y" 02560 {yygotominor.yy352 = yymsp[-1].minor.yy352;} 02561 #line 2566 "parse.c" 02562 break; 02563 case 143: /* using_opt ::= */ 02564 case 173: /* inscollist_opt ::= */ 02565 #line 522 "parse.y" 02566 {yygotominor.yy352 = 0;} 02567 #line 2572 "parse.c" 02568 break; 02569 case 145: /* orderby_opt ::= ORDER BY sortlist */ 02570 case 153: /* groupby_opt ::= GROUP BY nexprlist */ 02571 case 233: /* exprlist ::= nexprlist */ 02572 #line 533 "parse.y" 02573 {yygotominor.yy242 = yymsp[0].minor.yy242;} 02574 #line 2579 "parse.c" 02575 break; 02576 case 146: /* sortlist ::= sortlist COMMA sortitem sortorder */ 02577 #line 534 "parse.y" 02578 { 02579 yygotominor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy242,yymsp[-1].minor.yy450,0); 02580 if( yygotominor.yy242 ) yygotominor.yy242->a[yygotominor.yy242->nExpr-1].sortOrder = yymsp[0].minor.yy316; 02581 } 02582 #line 2587 "parse.c" 02583 break; 02584 case 147: /* sortlist ::= sortitem sortorder */ 02585 #line 538 "parse.y" 02586 { 02587 yygotominor.yy242 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy450,0); 02588 if( yygotominor.yy242 && yygotominor.yy242->a ) yygotominor.yy242->a[0].sortOrder = yymsp[0].minor.yy316; 02589 } 02590 #line 2595 "parse.c" 02591 break; 02592 case 149: /* sortorder ::= ASC */ 02593 case 151: /* sortorder ::= */ 02594 #line 546 "parse.y" 02595 {yygotominor.yy316 = SQLITE_SO_ASC;} 02596 #line 2601 "parse.c" 02597 break; 02598 case 150: /* sortorder ::= DESC */ 02599 #line 547 "parse.y" 02600 {yygotominor.yy316 = SQLITE_SO_DESC;} 02601 #line 2606 "parse.c" 02602 break; 02603 case 156: /* limit_opt ::= */ 02604 #line 573 "parse.y" 02605 {yygotominor.yy84.pLimit = 0; yygotominor.yy84.pOffset = 0;} 02606 #line 2611 "parse.c" 02607 break; 02608 case 157: /* limit_opt ::= LIMIT expr */ 02609 #line 574 "parse.y" 02610 {yygotominor.yy84.pLimit = yymsp[0].minor.yy450; yygotominor.yy84.pOffset = 0;} 02611 #line 2616 "parse.c" 02612 break; 02613 case 158: /* limit_opt ::= LIMIT expr OFFSET expr */ 02614 #line 576 "parse.y" 02615 {yygotominor.yy84.pLimit = yymsp[-2].minor.yy450; yygotominor.yy84.pOffset = yymsp[0].minor.yy450;} 02616 #line 2621 "parse.c" 02617 break; 02618 case 159: /* limit_opt ::= LIMIT expr COMMA expr */ 02619 #line 578 "parse.y" 02620 {yygotominor.yy84.pOffset = yymsp[-2].minor.yy450; yygotominor.yy84.pLimit = yymsp[0].minor.yy450;} 02621 #line 2626 "parse.c" 02622 break; 02623 case 160: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ 02624 #line 591 "parse.y" 02625 { 02626 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy419, &yymsp[-1].minor.yy0); 02627 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy419,yymsp[0].minor.yy450); 02628 } 02629 #line 2634 "parse.c" 02630 break; 02631 case 163: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ 02632 #line 614 "parse.y" 02633 { 02634 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy419, &yymsp[-3].minor.yy0); 02635 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy242,"set list"); 02636 sqlite3Update(pParse,yymsp[-4].minor.yy419,yymsp[-1].minor.yy242,yymsp[0].minor.yy450,yymsp[-5].minor.yy316); 02637 } 02638 #line 2643 "parse.c" 02639 break; 02640 case 164: /* setlist ::= setlist COMMA nm EQ expr */ 02641 #line 625 "parse.y" 02642 {yygotominor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242,yymsp[0].minor.yy450,&yymsp[-2].minor.yy0);} 02643 #line 2648 "parse.c" 02644 break; 02645 case 165: /* setlist ::= nm EQ expr */ 02646 #line 627 "parse.y" 02647 {yygotominor.yy242 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy450,&yymsp[-2].minor.yy0);} 02648 #line 2653 "parse.c" 02649 break; 02650 case 166: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ 02651 #line 633 "parse.y" 02652 {sqlite3Insert(pParse, yymsp[-5].minor.yy419, yymsp[-1].minor.yy242, 0, yymsp[-4].minor.yy352, yymsp[-7].minor.yy316);} 02653 #line 2658 "parse.c" 02654 break; 02655 case 167: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ 02656 #line 635 "parse.y" 02657 {sqlite3Insert(pParse, yymsp[-2].minor.yy419, 0, yymsp[0].minor.yy43, yymsp[-1].minor.yy352, yymsp[-4].minor.yy316);} 02658 #line 2663 "parse.c" 02659 break; 02660 case 168: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ 02661 #line 637 "parse.y" 02662 {sqlite3Insert(pParse, yymsp[-3].minor.yy419, 0, 0, yymsp[-2].minor.yy352, yymsp[-5].minor.yy316);} 02663 #line 2668 "parse.c" 02664 break; 02665 case 171: /* itemlist ::= itemlist COMMA expr */ 02666 case 235: /* nexprlist ::= nexprlist COMMA expr */ 02667 #line 648 "parse.y" 02668 {yygotominor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy242,yymsp[0].minor.yy450,0);} 02669 #line 2674 "parse.c" 02670 break; 02671 case 172: /* itemlist ::= expr */ 02672 case 236: /* nexprlist ::= expr */ 02673 #line 650 "parse.y" 02674 {yygotominor.yy242 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy450,0);} 02675 #line 2680 "parse.c" 02676 break; 02677 case 175: /* inscollist ::= inscollist COMMA nm */ 02678 #line 660 "parse.y" 02679 {yygotominor.yy352 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy352,&yymsp[0].minor.yy0);} 02680 #line 2685 "parse.c" 02681 break; 02682 case 176: /* inscollist ::= nm */ 02683 #line 662 "parse.y" 02684 {yygotominor.yy352 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} 02685 #line 2690 "parse.c" 02686 break; 02687 case 178: /* expr ::= LP expr RP */ 02688 #line 673 "parse.y" 02689 {yygotominor.yy450 = yymsp[-1].minor.yy450; sqlite3ExprSpan(yygotominor.yy450,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } 02690 #line 2695 "parse.c" 02691 break; 02692 case 179: /* term ::= NULL */ 02693 case 184: /* term ::= INTEGER|FLOAT|BLOB */ 02694 case 185: /* term ::= STRING */ 02695 #line 674 "parse.y" 02696 {yygotominor.yy450 = sqlite3PExpr(pParse, yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);} 02697 #line 2702 "parse.c" 02698 break; 02699 case 180: /* expr ::= ID */ 02700 case 181: /* expr ::= JOIN_KW */ 02701 #line 675 "parse.y" 02702 {yygotominor.yy450 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);} 02703 #line 2708 "parse.c" 02704 break; 02705 case 182: /* expr ::= nm DOT nm */ 02706 #line 677 "parse.y" 02707 { 02708 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 02709 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); 02710 yygotominor.yy450 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); 02711 } 02712 #line 2717 "parse.c" 02713 break; 02714 case 183: /* expr ::= nm DOT nm DOT nm */ 02715 #line 682 "parse.y" 02716 { 02717 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); 02718 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); 02719 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); 02720 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); 02721 yygotominor.yy450 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); 02722 } 02723 #line 2728 "parse.c" 02724 break; 02725 case 186: /* expr ::= REGISTER */ 02726 #line 691 "parse.y" 02727 {yygotominor.yy450 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);} 02728 #line 2733 "parse.c" 02729 break; 02730 case 187: /* expr ::= VARIABLE */ 02731 #line 692 "parse.y" 02732 { 02733 Token *pToken = &yymsp[0].minor.yy0; 02734 Expr *pExpr = yygotominor.yy450 = sqlite3PExpr(pParse, TK_VARIABLE, 0, 0, pToken); 02735 sqlite3ExprAssignVarNumber(pParse, pExpr); 02736 } 02737 #line 2742 "parse.c" 02738 break; 02739 case 188: /* expr ::= expr COLLATE ids */ 02740 #line 697 "parse.y" 02741 { 02742 yygotominor.yy450 = sqlite3ExprSetColl(pParse, yymsp[-2].minor.yy450, &yymsp[0].minor.yy0); 02743 } 02744 #line 2749 "parse.c" 02745 break; 02746 case 189: /* expr ::= CAST LP expr AS typetoken RP */ 02747 #line 701 "parse.y" 02748 { 02749 yygotominor.yy450 = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy450, 0, &yymsp[-1].minor.yy0); 02750 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); 02751 } 02752 #line 2757 "parse.c" 02753 break; 02754 case 190: /* expr ::= ID LP distinct exprlist RP */ 02755 #line 706 "parse.y" 02756 { 02757 if( yymsp[-1].minor.yy242 && yymsp[-1].minor.yy242->nExpr>SQLITE_MAX_FUNCTION_ARG ){ 02758 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); 02759 } 02760 yygotominor.yy450 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy242, &yymsp[-4].minor.yy0); 02761 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); 02762 if( yymsp[-2].minor.yy316 && yygotominor.yy450 ){ 02763 yygotominor.yy450->flags |= EP_Distinct; 02764 } 02765 } 02766 #line 2771 "parse.c" 02767 break; 02768 case 191: /* expr ::= ID LP STAR RP */ 02769 #line 716 "parse.y" 02770 { 02771 yygotominor.yy450 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); 02772 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); 02773 } 02774 #line 2779 "parse.c" 02775 break; 02776 case 192: /* term ::= CTIME_KW */ 02777 #line 720 "parse.y" 02778 { 02779 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are 02780 ** treated as functions that return constants */ 02781 yygotominor.yy450 = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); 02782 if( yygotominor.yy450 ){ 02783 yygotominor.yy450->op = TK_CONST_FUNC; 02784 yygotominor.yy450->span = yymsp[0].minor.yy0; 02785 } 02786 } 02787 #line 2792 "parse.c" 02788 break; 02789 case 193: /* expr ::= expr AND expr */ 02790 case 194: /* expr ::= expr OR expr */ 02791 case 195: /* expr ::= expr LT|GT|GE|LE expr */ 02792 case 196: /* expr ::= expr EQ|NE expr */ 02793 case 197: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ 02794 case 198: /* expr ::= expr PLUS|MINUS expr */ 02795 case 199: /* expr ::= expr STAR|SLASH|REM expr */ 02796 case 200: /* expr ::= expr CONCAT expr */ 02797 #line 729 "parse.y" 02798 {yygotominor.yy450 = sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy450,yymsp[0].minor.yy450,0);} 02799 #line 2804 "parse.c" 02800 break; 02801 case 201: /* likeop ::= LIKE_KW */ 02802 case 203: /* likeop ::= MATCH */ 02803 #line 741 "parse.y" 02804 {yygotominor.yy86.eOperator = yymsp[0].minor.yy0; yygotominor.yy86.not = 0;} 02805 #line 2810 "parse.c" 02806 break; 02807 case 202: /* likeop ::= NOT LIKE_KW */ 02808 case 204: /* likeop ::= NOT MATCH */ 02809 #line 742 "parse.y" 02810 {yygotominor.yy86.eOperator = yymsp[0].minor.yy0; yygotominor.yy86.not = 1;} 02811 #line 2816 "parse.c" 02812 break; 02813 case 207: /* expr ::= expr likeop expr escape */ 02814 #line 749 "parse.y" 02815 { 02816 ExprList *pList; 02817 pList = sqlite3ExprListAppend(pParse,0, yymsp[-1].minor.yy450, 0); 02818 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-3].minor.yy450, 0); 02819 if( yymsp[0].minor.yy450 ){ 02820 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy450, 0); 02821 } 02822 yygotominor.yy450 = sqlite3ExprFunction(pParse, pList, &yymsp[-2].minor.yy86.eOperator); 02823 if( yymsp[-2].minor.yy86.not ) yygotominor.yy450 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy450, 0, 0); 02824 sqlite3ExprSpan(yygotominor.yy450, &yymsp[-3].minor.yy450->span, &yymsp[-1].minor.yy450->span); 02825 if( yygotominor.yy450 ) yygotominor.yy450->flags |= EP_InfixFunc; 02826 } 02827 #line 2832 "parse.c" 02828 break; 02829 case 208: /* expr ::= expr ISNULL|NOTNULL */ 02830 #line 762 "parse.y" 02831 { 02832 yygotominor.yy450 = sqlite3PExpr(pParse, yymsp[0].major, yymsp[-1].minor.yy450, 0, 0); 02833 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-1].minor.yy450->span,&yymsp[0].minor.yy0); 02834 } 02835 #line 2840 "parse.c" 02836 break; 02837 case 209: /* expr ::= expr IS NULL */ 02838 #line 766 "parse.y" 02839 { 02840 yygotominor.yy450 = sqlite3PExpr(pParse, TK_ISNULL, yymsp[-2].minor.yy450, 0, 0); 02841 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-2].minor.yy450->span,&yymsp[0].minor.yy0); 02842 } 02843 #line 2848 "parse.c" 02844 break; 02845 case 210: /* expr ::= expr NOT NULL */ 02846 #line 770 "parse.y" 02847 { 02848 yygotominor.yy450 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-2].minor.yy450, 0, 0); 02849 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-2].minor.yy450->span,&yymsp[0].minor.yy0); 02850 } 02851 #line 2856 "parse.c" 02852 break; 02853 case 211: /* expr ::= expr IS NOT NULL */ 02854 #line 774 "parse.y" 02855 { 02856 yygotominor.yy450 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-3].minor.yy450, 0, 0); 02857 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-3].minor.yy450->span,&yymsp[0].minor.yy0); 02858 } 02859 #line 2864 "parse.c" 02860 break; 02861 case 212: /* expr ::= NOT expr */ 02862 case 213: /* expr ::= BITNOT expr */ 02863 #line 778 "parse.y" 02864 { 02865 yygotominor.yy450 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy450, 0, 0); 02866 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy450->span); 02867 } 02868 #line 2873 "parse.c" 02869 break; 02870 case 214: /* expr ::= MINUS expr */ 02871 #line 786 "parse.y" 02872 { 02873 yygotominor.yy450 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy450, 0, 0); 02874 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy450->span); 02875 } 02876 #line 2881 "parse.c" 02877 break; 02878 case 215: /* expr ::= PLUS expr */ 02879 #line 790 "parse.y" 02880 { 02881 yygotominor.yy450 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy450, 0, 0); 02882 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy450->span); 02883 } 02884 #line 2889 "parse.c" 02885 break; 02886 case 218: /* expr ::= expr between_op expr AND expr */ 02887 #line 797 "parse.y" 02888 { 02889 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy450, 0); 02890 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy450, 0); 02891 yygotominor.yy450 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy450, 0, 0); 02892 if( yygotominor.yy450 ){ 02893 yygotominor.yy450->pList = pList; 02894 }else{ 02895 sqlite3ExprListDelete(pParse->db, pList); 02896 } 02897 if( yymsp[-3].minor.yy316 ) yygotominor.yy450 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy450, 0, 0); 02898 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-4].minor.yy450->span,&yymsp[0].minor.yy450->span); 02899 } 02900 #line 2905 "parse.c" 02901 break; 02902 case 221: /* expr ::= expr in_op LP exprlist RP */ 02903 #line 813 "parse.y" 02904 { 02905 yygotominor.yy450 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy450, 0, 0); 02906 if( yygotominor.yy450 ){ 02907 yygotominor.yy450->pList = yymsp[-1].minor.yy242; 02908 sqlite3ExprSetHeight(pParse, yygotominor.yy450); 02909 }else{ 02910 sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy242); 02911 } 02912 if( yymsp[-3].minor.yy316 ) yygotominor.yy450 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy450, 0, 0); 02913 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-4].minor.yy450->span,&yymsp[0].minor.yy0); 02914 } 02915 #line 2920 "parse.c" 02916 break; 02917 case 222: /* expr ::= LP select RP */ 02918 #line 824 "parse.y" 02919 { 02920 yygotominor.yy450 = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); 02921 if( yygotominor.yy450 ){ 02922 yygotominor.yy450->pSelect = yymsp[-1].minor.yy43; 02923 sqlite3ExprSetHeight(pParse, yygotominor.yy450); 02924 }else{ 02925 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy43); 02926 } 02927 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); 02928 } 02929 #line 2934 "parse.c" 02930 break; 02931 case 223: /* expr ::= expr in_op LP select RP */ 02932 #line 834 "parse.y" 02933 { 02934 yygotominor.yy450 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy450, 0, 0); 02935 if( yygotominor.yy450 ){ 02936 yygotominor.yy450->pSelect = yymsp[-1].minor.yy43; 02937 sqlite3ExprSetHeight(pParse, yygotominor.yy450); 02938 }else{ 02939 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy43); 02940 } 02941 if( yymsp[-3].minor.yy316 ) yygotominor.yy450 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy450, 0, 0); 02942 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-4].minor.yy450->span,&yymsp[0].minor.yy0); 02943 } 02944 #line 2949 "parse.c" 02945 break; 02946 case 224: /* expr ::= expr in_op nm dbnm */ 02947 #line 845 "parse.y" 02948 { 02949 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); 02950 yygotominor.yy450 = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy450, 0, 0); 02951 if( yygotominor.yy450 ){ 02952 yygotominor.yy450->pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); 02953 sqlite3ExprSetHeight(pParse, yygotominor.yy450); 02954 }else{ 02955 sqlite3SrcListDelete(pParse->db, pSrc); 02956 } 02957 if( yymsp[-2].minor.yy316 ) yygotominor.yy450 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy450, 0, 0); 02958 sqlite3ExprSpan(yygotominor.yy450,&yymsp[-3].minor.yy450->span,yymsp[0].minor.yy0.z?&yymsp[0].minor.yy0:&yymsp[-1].minor.yy0); 02959 } 02960 #line 2965 "parse.c" 02961 break; 02962 case 225: /* expr ::= EXISTS LP select RP */ 02963 #line 857 "parse.y" 02964 { 02965 Expr *p = yygotominor.yy450 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); 02966 if( p ){ 02967 p->pSelect = yymsp[-1].minor.yy43; 02968 sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); 02969 sqlite3ExprSetHeight(pParse, yygotominor.yy450); 02970 }else{ 02971 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy43); 02972 } 02973 } 02974 #line 2979 "parse.c" 02975 break; 02976 case 226: /* expr ::= CASE case_operand case_exprlist case_else END */ 02977 #line 870 "parse.y" 02978 { 02979 yygotominor.yy450 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy450, yymsp[-1].minor.yy450, 0); 02980 if( yygotominor.yy450 ){ 02981 yygotominor.yy450->pList = yymsp[-2].minor.yy242; 02982 sqlite3ExprSetHeight(pParse, yygotominor.yy450); 02983 }else{ 02984 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy242); 02985 } 02986 sqlite3ExprSpan(yygotominor.yy450, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0); 02987 } 02988 #line 2993 "parse.c" 02989 break; 02990 case 227: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ 02991 #line 882 "parse.y" 02992 { 02993 yygotominor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, yymsp[-2].minor.yy450, 0); 02994 yygotominor.yy242 = sqlite3ExprListAppend(pParse,yygotominor.yy242, yymsp[0].minor.yy450, 0); 02995 } 02996 #line 3001 "parse.c" 02997 break; 02998 case 228: /* case_exprlist ::= WHEN expr THEN expr */ 02999 #line 886 "parse.y" 03000 { 03001 yygotominor.yy242 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy450, 0); 03002 yygotominor.yy242 = sqlite3ExprListAppend(pParse,yygotominor.yy242, yymsp[0].minor.yy450, 0); 03003 } 03004 #line 3009 "parse.c" 03005 break; 03006 case 237: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ 03007 #line 915 "parse.y" 03008 { 03009 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, 03010 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy242, yymsp[-9].minor.yy316, 03011 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy316); 03012 } 03013 #line 3018 "parse.c" 03014 break; 03015 case 238: /* uniqueflag ::= UNIQUE */ 03016 case 285: /* raisetype ::= ABORT */ 03017 #line 922 "parse.y" 03018 {yygotominor.yy316 = OE_Abort;} 03019 #line 3024 "parse.c" 03020 break; 03021 case 239: /* uniqueflag ::= */ 03022 #line 923 "parse.y" 03023 {yygotominor.yy316 = OE_None;} 03024 #line 3029 "parse.c" 03025 break; 03026 case 242: /* idxlist ::= idxlist COMMA nm collate sortorder */ 03027 #line 932 "parse.y" 03028 { 03029 Expr *p = 0; 03030 if( yymsp[-1].minor.yy0.n>0 ){ 03031 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); 03032 sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0); 03033 } 03034 yygotominor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, p, &yymsp[-2].minor.yy0); 03035 sqlite3ExprListCheckLength(pParse, yygotominor.yy242, "index"); 03036 if( yygotominor.yy242 ) yygotominor.yy242->a[yygotominor.yy242->nExpr-1].sortOrder = yymsp[0].minor.yy316; 03037 } 03038 #line 3043 "parse.c" 03039 break; 03040 case 243: /* idxlist ::= nm collate sortorder */ 03041 #line 942 "parse.y" 03042 { 03043 Expr *p = 0; 03044 if( yymsp[-1].minor.yy0.n>0 ){ 03045 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); 03046 sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0); 03047 } 03048 yygotominor.yy242 = sqlite3ExprListAppend(pParse,0, p, &yymsp[-2].minor.yy0); 03049 sqlite3ExprListCheckLength(pParse, yygotominor.yy242, "index"); 03050 if( yygotominor.yy242 ) yygotominor.yy242->a[yygotominor.yy242->nExpr-1].sortOrder = yymsp[0].minor.yy316; 03051 } 03052 #line 3057 "parse.c" 03053 break; 03054 case 244: /* collate ::= */ 03055 #line 954 "parse.y" 03056 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} 03057 #line 3062 "parse.c" 03058 break; 03059 case 246: /* cmd ::= DROP INDEX ifexists fullname */ 03060 #line 960 "parse.y" 03061 {sqlite3DropIndex(pParse, yymsp[0].minor.yy419, yymsp[-1].minor.yy316);} 03062 #line 3067 "parse.c" 03063 break; 03064 case 247: /* cmd ::= VACUUM */ 03065 case 248: /* cmd ::= VACUUM nm */ 03066 #line 966 "parse.y" 03067 {sqlite3Vacuum(pParse);} 03068 #line 3073 "parse.c" 03069 break; 03070 case 249: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ 03071 case 250: /* cmd ::= PRAGMA nm dbnm EQ ON */ 03072 case 251: /* cmd ::= PRAGMA nm dbnm EQ DELETE */ 03073 #line 975 "parse.y" 03074 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} 03075 #line 3080 "parse.c" 03076 break; 03077 case 252: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ 03078 #line 978 "parse.y" 03079 { 03080 sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1); 03081 } 03082 #line 3087 "parse.c" 03083 break; 03084 case 253: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ 03085 #line 981 "parse.y" 03086 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} 03087 #line 3092 "parse.c" 03088 break; 03089 case 254: /* cmd ::= PRAGMA nm dbnm */ 03090 #line 982 "parse.y" 03091 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} 03092 #line 3097 "parse.c" 03093 break; 03094 case 262: /* cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END */ 03095 #line 997 "parse.y" 03096 { 03097 Token all; 03098 all.z = yymsp[-3].minor.yy0.z; 03099 all.n = (yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; 03100 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy75, &all); 03101 } 03102 #line 3107 "parse.c" 03103 break; 03104 case 263: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ 03105 #line 1006 "parse.y" 03106 { 03107 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy316, yymsp[-4].minor.yy354.a, yymsp[-4].minor.yy354.b, yymsp[-2].minor.yy419, yymsp[0].minor.yy450, yymsp[-10].minor.yy316, yymsp[-8].minor.yy316); 03108 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); 03109 } 03110 #line 3115 "parse.c" 03111 break; 03112 case 264: /* trigger_time ::= BEFORE */ 03113 case 267: /* trigger_time ::= */ 03114 #line 1012 "parse.y" 03115 { yygotominor.yy316 = TK_BEFORE; } 03116 #line 3121 "parse.c" 03117 break; 03118 case 265: /* trigger_time ::= AFTER */ 03119 #line 1013 "parse.y" 03120 { yygotominor.yy316 = TK_AFTER; } 03121 #line 3126 "parse.c" 03122 break; 03123 case 266: /* trigger_time ::= INSTEAD OF */ 03124 #line 1014 "parse.y" 03125 { yygotominor.yy316 = TK_INSTEAD;} 03126 #line 3131 "parse.c" 03127 break; 03128 case 268: /* trigger_event ::= DELETE|INSERT */ 03129 case 269: /* trigger_event ::= UPDATE */ 03130 #line 1019 "parse.y" 03131 {yygotominor.yy354.a = yymsp[0].major; yygotominor.yy354.b = 0;} 03132 #line 3137 "parse.c" 03133 break; 03134 case 270: /* trigger_event ::= UPDATE OF inscollist */ 03135 #line 1021 "parse.y" 03136 {yygotominor.yy354.a = TK_UPDATE; yygotominor.yy354.b = yymsp[0].minor.yy352;} 03137 #line 3142 "parse.c" 03138 break; 03139 case 273: /* when_clause ::= */ 03140 case 290: /* key_opt ::= */ 03141 #line 1028 "parse.y" 03142 { yygotominor.yy450 = 0; } 03143 #line 3148 "parse.c" 03144 break; 03145 case 274: /* when_clause ::= WHEN expr */ 03146 case 291: /* key_opt ::= KEY expr */ 03147 #line 1029 "parse.y" 03148 { yygotominor.yy450 = yymsp[0].minor.yy450; } 03149 #line 3154 "parse.c" 03150 break; 03151 case 275: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ 03152 #line 1033 "parse.y" 03153 { 03154 /* 03155 if( yymsp[-2].minor.yy75 ){ 03156 yymsp[-2].minor.yy75->pLast->pNext = yymsp[-1].minor.yy75; 03157 }else{ 03158 yymsp[-2].minor.yy75 = yymsp[-1].minor.yy75; 03159 } 03160 */ 03161 assert( yymsp[-2].minor.yy75!=0 ); 03162 yymsp[-2].minor.yy75->pLast->pNext = yymsp[-1].minor.yy75; 03163 yymsp[-2].minor.yy75->pLast = yymsp[-1].minor.yy75; 03164 yygotominor.yy75 = yymsp[-2].minor.yy75; 03165 } 03166 #line 3171 "parse.c" 03167 break; 03168 case 276: /* trigger_cmd_list ::= trigger_cmd SEMI */ 03169 #line 1046 "parse.y" 03170 { 03171 /* if( yymsp[-1].minor.yy75 ) */ 03172 assert( yymsp[-1].minor.yy75!=0 ); 03173 yymsp[-1].minor.yy75->pLast = yymsp[-1].minor.yy75; 03174 yygotominor.yy75 = yymsp[-1].minor.yy75; 03175 } 03176 #line 3181 "parse.c" 03177 break; 03178 case 277: /* trigger_cmd ::= UPDATE orconf nm SET setlist where_opt */ 03179 #line 1057 "parse.y" 03180 { yygotominor.yy75 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy242, yymsp[0].minor.yy450, yymsp[-4].minor.yy316); } 03181 #line 3186 "parse.c" 03182 break; 03183 case 278: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP */ 03184 #line 1062 "parse.y" 03185 {yygotominor.yy75 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy352, yymsp[-1].minor.yy242, 0, yymsp[-7].minor.yy316);} 03186 #line 3191 "parse.c" 03187 break; 03188 case 279: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt select */ 03189 #line 1065 "parse.y" 03190 {yygotominor.yy75 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy352, 0, yymsp[0].minor.yy43, yymsp[-4].minor.yy316);} 03191 #line 3196 "parse.c" 03192 break; 03193 case 280: /* trigger_cmd ::= DELETE FROM nm where_opt */ 03194 #line 1069 "parse.y" 03195 {yygotominor.yy75 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-1].minor.yy0, yymsp[0].minor.yy450);} 03196 #line 3201 "parse.c" 03197 break; 03198 case 281: /* trigger_cmd ::= select */ 03199 #line 1072 "parse.y" 03200 {yygotominor.yy75 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy43); } 03201 #line 3206 "parse.c" 03202 break; 03203 case 282: /* expr ::= RAISE LP IGNORE RP */ 03204 #line 1075 "parse.y" 03205 { 03206 yygotominor.yy450 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); 03207 if( yygotominor.yy450 ){ 03208 yygotominor.yy450->iColumn = OE_Ignore; 03209 sqlite3ExprSpan(yygotominor.yy450, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); 03210 } 03211 } 03212 #line 3217 "parse.c" 03213 break; 03214 case 283: /* expr ::= RAISE LP raisetype COMMA nm RP */ 03215 #line 1082 "parse.y" 03216 { 03217 yygotominor.yy450 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); 03218 if( yygotominor.yy450 ) { 03219 yygotominor.yy450->iColumn = yymsp[-3].minor.yy316; 03220 sqlite3ExprSpan(yygotominor.yy450, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); 03221 } 03222 } 03223 #line 3228 "parse.c" 03224 break; 03225 case 284: /* raisetype ::= ROLLBACK */ 03226 #line 1092 "parse.y" 03227 {yygotominor.yy316 = OE_Rollback;} 03228 #line 3233 "parse.c" 03229 break; 03230 case 286: /* raisetype ::= FAIL */ 03231 #line 1094 "parse.y" 03232 {yygotominor.yy316 = OE_Fail;} 03233 #line 3238 "parse.c" 03234 break; 03235 case 287: /* cmd ::= DROP TRIGGER ifexists fullname */ 03236 #line 1099 "parse.y" 03237 { 03238 sqlite3DropTrigger(pParse,yymsp[0].minor.yy419,yymsp[-1].minor.yy316); 03239 } 03240 #line 3245 "parse.c" 03241 break; 03242 case 288: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ 03243 #line 1106 "parse.y" 03244 { 03245 sqlite3Attach(pParse, yymsp[-3].minor.yy450, yymsp[-1].minor.yy450, yymsp[0].minor.yy450); 03246 } 03247 #line 3252 "parse.c" 03248 break; 03249 case 289: /* cmd ::= DETACH database_kw_opt expr */ 03250 #line 1109 "parse.y" 03251 { 03252 sqlite3Detach(pParse, yymsp[0].minor.yy450); 03253 } 03254 #line 3259 "parse.c" 03255 break; 03256 case 294: /* cmd ::= REINDEX */ 03257 #line 1124 "parse.y" 03258 {sqlite3Reindex(pParse, 0, 0);} 03259 #line 3264 "parse.c" 03260 break; 03261 case 295: /* cmd ::= REINDEX nm dbnm */ 03262 #line 1125 "parse.y" 03263 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} 03264 #line 3269 "parse.c" 03265 break; 03266 case 296: /* cmd ::= ANALYZE */ 03267 #line 1130 "parse.y" 03268 {sqlite3Analyze(pParse, 0, 0);} 03269 #line 3274 "parse.c" 03270 break; 03271 case 297: /* cmd ::= ANALYZE nm dbnm */ 03272 #line 1131 "parse.y" 03273 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} 03274 #line 3279 "parse.c" 03275 break; 03276 case 298: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ 03277 #line 1136 "parse.y" 03278 { 03279 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy419,&yymsp[0].minor.yy0); 03280 } 03281 #line 3286 "parse.c" 03282 break; 03283 case 299: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ 03284 #line 1139 "parse.y" 03285 { 03286 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); 03287 } 03288 #line 3293 "parse.c" 03289 break; 03290 case 300: /* add_column_fullname ::= fullname */ 03291 #line 1142 "parse.y" 03292 { 03293 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy419); 03294 } 03295 #line 3300 "parse.c" 03296 break; 03297 case 303: /* cmd ::= create_vtab */ 03298 #line 1151 "parse.y" 03299 {sqlite3VtabFinishParse(pParse,0);} 03300 #line 3305 "parse.c" 03301 break; 03302 case 304: /* cmd ::= create_vtab LP vtabarglist RP */ 03303 #line 1152 "parse.y" 03304 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} 03305 #line 3310 "parse.c" 03306 break; 03307 case 305: /* create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm */ 03308 #line 1153 "parse.y" 03309 { 03310 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); 03311 } 03312 #line 3317 "parse.c" 03313 break; 03314 case 308: /* vtabarg ::= */ 03315 #line 1158 "parse.y" 03316 {sqlite3VtabArgInit(pParse);} 03317 #line 3322 "parse.c" 03318 break; 03319 case 310: /* vtabargtoken ::= ANY */ 03320 case 311: /* vtabargtoken ::= lp anylist RP */ 03321 case 312: /* lp ::= LP */ 03322 case 314: /* anylist ::= anylist ANY */ 03323 #line 1160 "parse.y" 03324 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} 03325 #line 3330 "parse.c" 03326 break; 03327 }; 03328 yygoto = yyRuleInfo[yyruleno].lhs; 03329 yysize = yyRuleInfo[yyruleno].nrhs; 03330 yypParser->yyidx -= yysize; 03331 yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto); 03332 if( yyact < YYNSTATE ){ 03333 #ifdef NDEBUG 03334 /* If we are not debugging and the reduce action popped at least 03335 ** one element off the stack, then we can push the new element back 03336 ** onto the stack here, and skip the stack overflow test in yy_shift(). 03337 ** That gives a significant speed improvement. */ 03338 if( yysize ){ 03339 yypParser->yyidx++; 03340 yymsp -= yysize-1; 03341 yymsp->stateno = yyact; 03342 yymsp->major = yygoto; 03343 yymsp->minor = yygotominor; 03344 }else 03345 #endif 03346 { 03347 yy_shift(yypParser,yyact,yygoto,&yygotominor); 03348 } 03349 }else{ 03350 assert( yyact == YYNSTATE + YYNRULE + 1 ); 03351 yy_accept(yypParser); 03352 } 03353 } 03354 03355 /* 03356 ** The following code executes when the parse fails 03357 */ 03358 static void yy_parse_failed( 03359 yyParser *yypParser /* The parser */ 03360 ){ 03361 sqlite3ParserARG_FETCH; 03362 #ifndef NDEBUG 03363 if( yyTraceFILE ){ 03364 fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); 03365 } 03366 #endif 03367 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); 03368 /* Here code is inserted which will be executed whenever the 03369 ** parser fails */ 03370 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ 03371 } 03372 03373 /* 03374 ** The following code executes when a syntax error first occurs. 03375 */ 03376 static void yy_syntax_error( 03377 yyParser *yypParser, /* The parser */ 03378 int yymajor, /* The major type of the error token */ 03379 YYMINORTYPE yyminor /* The minor type of the error token */ 03380 ){ 03381 sqlite3ParserARG_FETCH; 03382 #define TOKEN (yyminor.yy0) 03383 #line 34 "parse.y" 03384 03385 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */ 03386 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); 03387 pParse->parseError = 1; 03388 #line 3395 "parse.c" 03389 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ 03390 } 03391 03392 /* 03393 ** The following is executed when the parser accepts 03394 */ 03395 static void yy_accept( 03396 yyParser *yypParser /* The parser */ 03397 ){ 03398 sqlite3ParserARG_FETCH; 03399 #ifndef NDEBUG 03400 if( yyTraceFILE ){ 03401 fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); 03402 } 03403 #endif 03404 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); 03405 /* Here code is inserted which will be executed whenever the 03406 ** parser accepts */ 03407 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ 03408 } 03409 03410 /* The main parser program. 03411 ** The first argument is a pointer to a structure obtained from 03412 ** "sqlite3ParserAlloc" which describes the current state of the parser. 03413 ** The second argument is the major token number. The third is 03414 ** the minor token. The fourth optional argument is whatever the 03415 ** user wants (and specified in the grammar) and is available for 03416 ** use by the action routines. 03417 ** 03418 ** Inputs: 03419 ** <ul> 03420 ** <li> A pointer to the parser (an opaque structure.) 03421 ** <li> The major token number. 03422 ** <li> The minor token number. 03423 ** <li> An option argument of a grammar-specified type. 03424 ** </ul> 03425 ** 03426 ** Outputs: 03427 ** None. 03428 */ 03429 void sqlite3Parser( 03430 void *yyp, /* The parser */ 03431 int yymajor, /* The major token code number */ 03432 sqlite3ParserTOKENTYPE yyminor /* The value for the token */ 03433 sqlite3ParserARG_PDECL /* Optional %extra_argument parameter */ 03434 ){ 03435 YYMINORTYPE yyminorunion; 03436 int yyact; /* The parser action. */ 03437 int yyendofinput; /* True if we are at the end of input */ 03438 #ifdef YYERRORSYMBOL 03439 int yyerrorhit = 0; /* True if yymajor has invoked an error */ 03440 #endif 03441 yyParser *yypParser; /* The parser */ 03442 03443 /* (re)initialize the parser, if necessary */ 03444 yypParser = (yyParser*)yyp; 03445 if( yypParser->yyidx<0 ){ 03446 #if YYSTACKDEPTH<=0 03447 if( yypParser->yystksz <=0 ){ 03448 /*memset(&yyminorunion, 0, sizeof(yyminorunion));*/ 03449 yyminorunion = yyzerominor; 03450 yyStackOverflow(yypParser, &yyminorunion); 03451 return; 03452 } 03453 #endif 03454 yypParser->yyidx = 0; 03455 yypParser->yyerrcnt = -1; 03456 yypParser->yystack[0].stateno = 0; 03457 yypParser->yystack[0].major = 0; 03458 } 03459 yyminorunion.yy0 = yyminor; 03460 yyendofinput = (yymajor==0); 03461 sqlite3ParserARG_STORE; 03462 03463 #ifndef NDEBUG 03464 if( yyTraceFILE ){ 03465 fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); 03466 } 03467 #endif 03468 03469 do{ 03470 yyact = yy_find_shift_action(yypParser,yymajor); 03471 if( yyact<YYNSTATE ){ 03472 assert( !yyendofinput ); /* Impossible to shift the $ token */ 03473 yy_shift(yypParser,yyact,yymajor,&yyminorunion); 03474 yypParser->yyerrcnt--; 03475 yymajor = YYNOCODE; 03476 }else if( yyact < YYNSTATE + YYNRULE ){ 03477 yy_reduce(yypParser,yyact-YYNSTATE); 03478 }else{ 03479 assert( yyact == YY_ERROR_ACTION ); 03480 #ifdef YYERRORSYMBOL 03481 int yymx; 03482 #endif 03483 #ifndef NDEBUG 03484 if( yyTraceFILE ){ 03485 fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); 03486 } 03487 #endif 03488 #ifdef YYERRORSYMBOL 03489 /* A syntax error has occurred. 03490 ** The response to an error depends upon whether or not the 03491 ** grammar defines an error token "ERROR". 03492 ** 03493 ** This is what we do if the grammar does define ERROR: 03494 ** 03495 ** * Call the %syntax_error function. 03496 ** 03497 ** * Begin popping the stack until we enter a state where 03498 ** it is legal to shift the error symbol, then shift 03499 ** the error symbol. 03500 ** 03501 ** * Set the error count to three. 03502 ** 03503 ** * Begin accepting and shifting new tokens. No new error 03504 ** processing will occur until three tokens have been 03505 ** shifted successfully. 03506 ** 03507 */ 03508 if( yypParser->yyerrcnt<0 ){ 03509 yy_syntax_error(yypParser,yymajor,yyminorunion); 03510 } 03511 yymx = yypParser->yystack[yypParser->yyidx].major; 03512 if( yymx==YYERRORSYMBOL || yyerrorhit ){ 03513 #ifndef NDEBUG 03514 if( yyTraceFILE ){ 03515 fprintf(yyTraceFILE,"%sDiscard input token %s\n", 03516 yyTracePrompt,yyTokenName[yymajor]); 03517 } 03518 #endif 03519 yy_destructor(yypParser, yymajor,&yyminorunion); 03520 yymajor = YYNOCODE; 03521 }else{ 03522 while( 03523 yypParser->yyidx >= 0 && 03524 yymx != YYERRORSYMBOL && 03525 (yyact = yy_find_reduce_action( 03526 yypParser->yystack[yypParser->yyidx].stateno, 03527 YYERRORSYMBOL)) >= YYNSTATE 03528 ){ 03529 yy_pop_parser_stack(yypParser); 03530 } 03531 if( yypParser->yyidx < 0 || yymajor==0 ){ 03532 yy_destructor(yypParser,yymajor,&yyminorunion); 03533 yy_parse_failed(yypParser); 03534 yymajor = YYNOCODE; 03535 }else if( yymx!=YYERRORSYMBOL ){ 03536 YYMINORTYPE u2; 03537 u2.YYERRSYMDT = 0; 03538 yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); 03539 } 03540 } 03541 yypParser->yyerrcnt = 3; 03542 yyerrorhit = 1; 03543 #else /* YYERRORSYMBOL is not defined */ 03544 /* This is what we do if the grammar does not define ERROR: 03545 ** 03546 ** * Report an error message, and throw away the input token. 03547 ** 03548 ** * If the input token is $, then fail the parse. 03549 ** 03550 ** As before, subsequent error messages are suppressed until 03551 ** three input tokens have been successfully shifted. 03552 */ 03553 if( yypParser->yyerrcnt<=0 ){ 03554 yy_syntax_error(yypParser,yymajor,yyminorunion); 03555 } 03556 yypParser->yyerrcnt = 3; 03557 yy_destructor(yypParser,yymajor,&yyminorunion); 03558 if( yyendofinput ){ 03559 yy_parse_failed(yypParser); 03560 } 03561 yymajor = YYNOCODE; 03562 #endif 03563 } 03564 }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); 03565 return; 03566 }
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:55 2011 by Doxygen 1.6.1