1/* Driver template for the LEMON parser generator.
2** The author disclaims copyright to this source code.
3*/
4/* First off, code is included that follows the "include" declaration
5** in the input grammar file. */
6#include <stdio.h>
7#line 33 "ext/sqlite/libsqlite/src/parse.y"
8
9#include "sqliteInt.h"
10#include "parse.h"
11
12/*
13** An instance of this structure holds information about the
14** LIMIT clause of a SELECT statement.
15*/
16struct LimitVal {
17  int limit;    /* The LIMIT value.  -1 if there is no limit */
18  int offset;   /* The OFFSET.  0 if there is none */
19};
20
21/*
22** An instance of the following structure describes the event of a
23** TRIGGER.  "a" is the event type, one of TK_UPDATE, TK_INSERT,
24** TK_DELETE, or TK_INSTEAD.  If the event is of the form
25**
26**      UPDATE ON (a,b,c)
27**
28** Then the "b" IdList records the list "a,b,c".
29*/
30struct TrigEvent { int a; IdList * b; };
31
32#line 33 "ext/sqlite/libsqlite/src/parse.c"
33/* Next is all token values, in a form suitable for use by makeheaders.
34** This section will be null unless lemon is run with the -m switch.
35*/
36/*
37** These constants (all generated automatically by the parser generator)
38** specify the various kinds of tokens (terminals) that the parser
39** understands.
40**
41** Each symbol here is a terminal symbol in the grammar.
42*/
43/* Make sure the INTERFACE macro is defined.
44*/
45#ifndef INTERFACE
46# define INTERFACE 1
47#endif
48/* The next thing included is series of defines which control
49** various aspects of the generated parser.
50**    YYCODETYPE         is the data type used for storing terminal
51**                       and nonterminal numbers.  "unsigned char" is
52**                       used if there are fewer than 250 terminals
53**                       and nonterminals.  "int" is used otherwise.
54**    YYNOCODE           is a number of type YYCODETYPE which corresponds
55**                       to no legal terminal or nonterminal number.  This
56**                       number is used to fill in empty slots of the hash
57**                       table.
58**    YYFALLBACK         If defined, this indicates that one or more tokens
59**                       have fall-back values which should be used if the
60**                       original value of the token will not parse.
61**    YYACTIONTYPE       is the data type used for storing terminal
62**                       and nonterminal numbers.  "unsigned char" is
63**                       used if there are fewer than 250 rules and
64**                       states combined.  "int" is used otherwise.
65**    sqliteParserTOKENTYPE     is the data type used for minor tokens given
66**                       directly to the parser from the tokenizer.
67**    YYMINORTYPE        is the data type used for all minor tokens.
68**                       This is typically a union of many types, one of
69**                       which is sqliteParserTOKENTYPE.  The entry in the union
70**                       for base tokens is called "yy0".
71**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
72**                       zero the stack is dynamically sized using realloc()
73**    sqliteParserARG_SDECL     A static variable declaration for the %extra_argument
74**    sqliteParserARG_PDECL     A parameter declaration for the %extra_argument
75**    sqliteParserARG_STORE     Code to store %extra_argument into yypParser
76**    sqliteParserARG_FETCH     Code to extract %extra_argument from yypParser
77**    YYNSTATE           the combined number of states.
78**    YYNRULE            the number of rules in the grammar
79**    YYERRORSYMBOL      is the code number of the error symbol.  If not
80**                       defined, then do no error processing.
81*/
82#define YYCODETYPE unsigned char
83#define YYNOCODE 221
84#define YYACTIONTYPE unsigned short int
85#define sqliteParserTOKENTYPE Token
86typedef union {
87  int yyinit;
88  sqliteParserTOKENTYPE yy0;
89  TriggerStep * yy19;
90  struct LimitVal yy124;
91  Select* yy179;
92  Expr * yy182;
93  Expr* yy242;
94  struct TrigEvent yy290;
95  SrcList* yy307;
96  IdList* yy320;
97  ExprList* yy322;
98  int yy372;
99  struct {int value; int mask;} yy407;
100} YYMINORTYPE;
101#ifndef YYSTACKDEPTH
102#define YYSTACKDEPTH 100
103#endif
104#define sqliteParserARG_SDECL Parse *pParse;
105#define sqliteParserARG_PDECL ,Parse *pParse
106#define sqliteParserARG_FETCH Parse *pParse = yypParser->pParse
107#define sqliteParserARG_STORE yypParser->pParse = pParse
108#define YYNSTATE 563
109#define YYNRULE 293
110#define YYFALLBACK 1
111#define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
112#define YY_ACCEPT_ACTION  (YYNSTATE+YYNRULE+1)
113#define YY_ERROR_ACTION   (YYNSTATE+YYNRULE)
114
115/* The yyzerominor constant is used to initialize instances of
116** YYMINORTYPE objects to zero. */
117static const YYMINORTYPE yyzerominor = { 0 };
118
119/* Define the yytestcase() macro to be a no-op if is not already defined
120** otherwise.
121**
122** Applications can choose to define yytestcase() in the %include section
123** to a macro that can assist in verifying code coverage.  For production
124** code the yytestcase() macro should be turned off.  But it is useful
125** for testing.
126*/
127#ifndef yytestcase
128# define yytestcase(X)
129#endif
130
131
132/* Next are the tables used to determine what action to take based on the
133** current state and lookahead token.  These tables are used to implement
134** functions that take a state number and lookahead value and return an
135** action integer.
136**
137** Suppose the action integer is N.  Then the action is determined as
138** follows
139**
140**   0 <= N < YYNSTATE                  Shift N.  That is, push the lookahead
141**                                      token onto the stack and goto state N.
142**
143**   YYNSTATE <= N < YYNSTATE+YYNRULE   Reduce by rule N-YYNSTATE.
144**
145**   N == YYNSTATE+YYNRULE              A syntax error has occurred.
146**
147**   N == YYNSTATE+YYNRULE+1            The parser accepts its input.
148**
149**   N == YYNSTATE+YYNRULE+2            No such action.  Denotes unused
150**                                      slots in the yy_action[] table.
151**
152** The action table is constructed as a single large table named yy_action[].
153** Given state S and lookahead X, the action is computed as
154**
155**      yy_action[ yy_shift_ofst[S] + X ]
156**
157** If the index value yy_shift_ofst[S]+X is out of range or if the value
158** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
159** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
160** and that yy_default[S] should be used instead.
161**
162** The formula above is for computing the action when the lookahead is
163** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
164** a reduce action) then the yy_reduce_ofst[] array is used in place of
165** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
166** YY_SHIFT_USE_DFLT.
167**
168** The following are the tables generated in this section:
169**
170**  yy_action[]        A single table containing all actions.
171**  yy_lookahead[]     A table containing the lookahead for each entry in
172**                     yy_action.  Used to detect hash collisions.
173**  yy_shift_ofst[]    For each state, the offset into yy_action for
174**                     shifting terminals.
175**  yy_reduce_ofst[]   For each state, the offset into yy_action for
176**                     shifting non-terminals after a reduce.
177**  yy_default[]       Default action for each state.
178*/
179#define YY_ACTTAB_COUNT (1090)
180static const YYACTIONTYPE yy_action[] = {
181 /*     0 */   186,  561,  483,   69,   67,   70,   68,   64,   63,   62,
182 /*    10 */    61,   58,   57,   56,   55,   54,   53,  181,  180,  179,
183 /*    20 */   514,  421,  334,  420,  468,  515,   64,   63,   62,   61,
184 /*    30 */    58,   57,   56,   55,   54,   53,    9,  423,  422,   71,
185 /*    40 */    72,  129,   65,   66,  513,  510,  305,   52,  138,   69,
186 /*    50 */    67,   70,   68,   64,   63,   62,   61,   58,   57,   56,
187 /*    60 */    55,   54,   53,  448,  469,  175,  482,  514,  470,  344,
188 /*    70 */   342,   36,  515,   58,   57,   56,   55,   54,   53,    8,
189 /*    80 */   341,  281,  285,  307,  437,  178,   71,   72,  129,   65,
190 /*    90 */    66,  513,  510,  305,   52,  138,   69,   67,   70,   68,
191 /*   100 */    64,   63,   62,   61,   58,   57,   56,   55,   54,   53,
192 /*   110 */   130,  362,  360,  508,  507,  267,  551,  436,  298,  297,
193 /*   120 */   369,  368,   50,  128,  543,   29,  266,  449,  537,  447,
194 /*   130 */   591,  528,  442,  441,  187,  132,  514,  536,   47,   48,
195 /*   140 */   472,  515,  122,  427,  331,  409,   49,  371,  370,  518,
196 /*   150 */   328,  363,  517,  520,   45,   71,   72,  129,   65,   66,
197 /*   160 */   513,  510,  305,   52,  138,   69,   67,   70,   68,   64,
198 /*   170 */    63,   62,   61,   58,   57,   56,   55,   54,   53,  185,
199 /*   180 */   550,  549,  512,  175,  467,  516,   18,  344,  342,   36,
200 /*   190 */   544,  175,  320,  230,  231,  344,  342,   36,  341,   56,
201 /*   200 */    55,   54,   53,  212,  531,  514,  341,  551,    3,  213,
202 /*   210 */   515,    2,  551,   73,    7,  551,  184,  132,  551,  172,
203 /*   220 */   551,  309,  348,   42,   71,   72,  129,   65,   66,  513,
204 /*   230 */   510,  305,   52,  138,   69,   67,   70,   68,   64,   63,
205 /*   240 */    62,   61,   58,   57,   56,   55,   54,   53,  243,  197,
206 /*   250 */   282,  358,  268,  373,  264,  372,  183,  241,  436,  169,
207 /*   260 */   356,  171,  269,  240,  471,  426,   29,  446,  506,  514,
208 /*   270 */   445,  550,  549,  494,  515,  354,  550,  549,  359,  550,
209 /*   280 */   549,  144,  550,  549,  550,  549,  592,  309,   71,   72,
210 /*   290 */   129,   65,   66,  513,  510,  305,   52,  138,   69,   67,
211 /*   300 */    70,   68,   64,   63,   62,   61,   58,   57,   56,   55,
212 /*   310 */    54,   53,  514,  857,   82,  377,    1,  515,  268,  373,
213 /*   320 */   264,  372,  183,  241,  362,   12,  508,  507,  500,  240,
214 /*   330 */    17,   71,   72,  129,   65,   66,  513,  510,  305,   52,
215 /*   340 */   138,   69,   67,   70,   68,   64,   63,   62,   61,   58,
216 /*   350 */    57,   56,   55,   54,   53,  362,  182,  508,  507,  514,
217 /*   360 */   362,  527,  508,  507,  515,  563,  429,  463,  182,  444,
218 /*   370 */   375,  338,  443,  430,  379,  378,  593,  156,   71,   72,
219 /*   380 */   129,   65,   66,  513,  510,  305,   52,  138,   69,   67,
220 /*   390 */    70,   68,   64,   63,   62,   61,   58,   57,   56,   55,
221 /*   400 */    54,   53,  514,  526,  542,  450,  534,  515,  286,  493,
222 /*   410 */   453,   17,  478,  240,   80,   11,  533,  153,  194,  155,
223 /*   420 */   286,   71,   51,  129,   65,   66,  513,  510,  305,   52,
224 /*   430 */   138,   69,   67,   70,   68,   64,   63,   62,   61,   58,
225 /*   440 */    57,   56,   55,   54,   53,  514,  195,  466,  160,   17,
226 /*   450 */   515,  454,  490,   80,  459,  440,  460,  176,  239,  238,
227 /*   460 */    80,   80,  562,    1,   71,   40,  129,   65,   66,  513,
228 /*   470 */   510,  305,   52,  138,   69,   67,   70,   68,   64,   63,
229 /*   480 */    62,   61,   58,   57,   56,   55,   54,   53,  514,  365,
230 /*   490 */   154,   19,  339,  515,   80,  232,  405,   80,  165,  404,
231 /*   500 */   193,   32,  396,   13,   32,   86,  414,  108,   72,  129,
232 /*   510 */    65,   66,  513,  510,  305,   52,  138,   69,   67,   70,
233 /*   520 */    68,   64,   63,   62,   61,   58,   57,   56,   55,   54,
234 /*   530 */    53,  514,  551,  365,  483,  192,  515,  488,  323,  207,
235 /*   540 */   366,  249,  177,  186,   87,  483,  483,   46,   38,   44,
236 /*   550 */   458,  108,  129,   65,   66,  513,  510,  305,   52,  138,
237 /*   560 */    69,   67,   70,   68,   64,   63,   62,   61,   58,   57,
238 /*   570 */    56,   55,   54,   53,  274,  457,  272,  271,  270,   23,
239 /*   580 */     8,  551,  211,  412,  307,  257,  365,  385,  201,   31,
240 /*   590 */   217,  388,  141,  205,  387,  219,  550,  549,  482,  511,
241 /*   600 */   215,  376,  560,  134,   90,  477,  214,  514,  392,  482,
242 /*   610 */   482,  152,  515,  360,  203,  212,  409,  531,  800,  284,
243 /*   620 */   365,  145,  505,   50,  300,  365,  365,  173,  321,  212,
244 /*   630 */   487,  137,  135,    8,   41,  136,  531,  307,   93,   47,
245 /*   640 */    48,  346,  316,  106,  106,  550,  549,   49,  371,  370,
246 /*   650 */   518,  509,  531,  517,  520,  504,  531,  531,  162,  495,
247 /*   660 */   170,  317,  503,  319,  223,  231,  360,  551,  502,  283,
248 /*   670 */   162,  207,  557,  486,  212,  191,   50,   10,  289,  304,
249 /*   680 */   303,  556,  207,  531,    8,  531,  516,   18,  307,  498,
250 /*   690 */   498,  189,   47,   48,  393,  531,  555,   28,  302,  554,
251 /*   700 */    49,  371,  370,  518,  484,  480,  517,  520,  322,  299,
252 /*   710 */   553,  418,  365,  323,   17,  365,  365,  360,  416,  207,
253 /*   720 */   322,  417,  207,  418,  327,  212,  480,   50,  207,  326,
254 /*   730 */   106,  550,  549,  106,  105,  247,  407,  475,  332,  516,
255 /*   740 */    18,  326,  365,   47,   48,  207,  295,  365,  475,  294,
256 /*   750 */   158,   49,  371,  370,  518,  293,  473,  517,  520,  485,
257 /*   760 */   106,  391,  390,  202,  148,   93,  351,  480,  204,  301,
258 /*   770 */   333,  190,  291,  541,   60,  531,  498,  252,  453,  498,
259 /*   780 */   365,  365,  290,  365,  501,  475,  365,   79,  475,  531,
260 /*   790 */   516,   18,  379,  378,  475,  365,  465,  245,   89,  112,
261 /*   800 */   365,  109,  365,  131,  121,  288,  499,  365,  365,  439,
262 /*   810 */   365,  475,  365,  120,  365,  365,  343,  365,  119,  365,
263 /*   820 */   118,  365,  365,  365,  365,  117,  116,  365,  126,  365,
264 /*   830 */   125,  365,  124,  123,  365,  115,  365,  114,  431,  140,
265 /*   840 */   139,  255,  254,  365,  365,  253,  365,  280,  365,  107,
266 /*   850 */   365,  365,  113,  365,  111,   26,  365,  365,  365,  365,
267 /*   860 */   365,  279,  278,  365,  277,  365,   92,  365,  104,  103,
268 /*   870 */   365,   91,  365,  365,  102,  101,  110,  100,   99,  347,
269 /*   880 */    25,   98,  340,   30,   24,   97,  266,  174,   96,   85,
270 /*   890 */    95,   94,  166,  292,   78,  165,  415,   14,  163,   60,
271 /*   900 */   164,   22,    6,  408,    5,   77,   34,   33,  159,   16,
272 /*   910 */   157,  151,   75,  149,   15,  146,  313,  312,  395,  384,
273 /*   920 */   143,   20,   60,  206,   21,  273,  198,  559,  375,  548,
274 /*   930 */   547,  546,  374,    4,  540,  539,  538,  308,  535,  532,
275 /*   940 */   530,  212,  261,   38,  260,  352,  259,   39,  258,  367,
276 /*   950 */   529,  196,  210,  256,  521,  522,   53,   53,  209,   43,
277 /*   960 */   496,  188,  492,  208,  256,   81,  246,   37,  479,  349,
278 /*   970 */   244,   37,  474,  464,  276,   27,  452,  451,  433,  432,
279 /*   980 */   275,  235,  234,  335,  424,   35,  329,  413,  410,  127,
280 /*   990 */   161,   84,   76,  403,   38,  400,  188,  399,  224,  398,
281 /*  1000 */    38,  150,  318,  220,   83,  147,  315,  200,  381,  383,
282 /*  1010 */   199,  142,  545,  265,   88,  262,  523,  361,  491,  476,
283 /*  1020 */   463,  406,  397,  287,  389,  386,  310,  382,  552,   74,
284 /*  1030 */   306,  525,  524,  364,  519,  357,  355,  353,  497,  489,
285 /*  1040 */   481,  263,  242,  462,  461,  456,  455,  438,  296,  345,
286 /*  1050 */   434,  237,  425,  337,  168,  167,  336,  236,  419,  330,
287 /*  1060 */   233,  325,  324,  229,  228,  402,  401,  227,  226,  225,
288 /*  1070 */   222,  221,  218,  314,  394,  311,  216,  380,  251,  250,
289 /*  1080 */   133,  350,  248,  364,  558,   59,  435,  411,  428,  212,
290};
291static const YYCODETYPE yy_lookahead[] = {
292 /*     0 */    21,    9,   23,   70,   71,   72,   73,   74,   75,   76,
293 /*    10 */    77,   78,   79,   80,   81,   82,   83,  100,  101,  102,
294 /*    20 */    41,  100,  101,  102,   20,   46,   74,   75,   76,   77,
295 /*    30 */    78,   79,   80,   81,   82,   83,   19,   55,   56,   60,
296 /*    40 */    61,   62,   63,   64,   65,   66,   67,   68,   69,   70,
297 /*    50 */    71,   72,   73,   74,   75,   76,   77,   78,   79,   80,
298 /*    60 */    81,   82,   83,   23,  108,   90,   87,   41,  112,   94,
299 /*    70 */    95,   96,   46,   78,   79,   80,   81,   82,   83,   19,
300 /*    80 */   105,  149,  143,   23,  152,  153,   60,   61,   62,   63,
301 /*    90 */    64,   65,   66,   67,   68,   69,   70,   71,   72,   73,
302 /*   100 */    74,   75,   76,   77,   78,   79,   80,   81,   82,   83,
303 /*   110 */    31,  107,   52,  109,  110,   93,   23,  140,   78,   79,
304 /*   120 */    78,   79,   62,   22,  147,  148,  104,   87,   34,   89,
305 /*   130 */   113,   89,   92,   93,  183,  184,   41,   43,   78,   79,
306 /*   140 */    80,   46,  165,  166,  205,   53,   86,   87,   88,   89,
307 /*   150 */   211,   62,   92,   93,  128,   60,   61,   62,   63,   64,
308 /*   160 */    65,   66,   67,   68,   69,   70,   71,   72,   73,   74,
309 /*   170 */    75,   76,   77,   78,   79,   80,   81,   82,   83,  146,
310 /*   180 */    87,   88,   93,   90,   20,  125,  126,   94,   95,   96,
311 /*   190 */    20,   90,  100,  101,  102,   94,   95,   96,  105,   80,
312 /*   200 */    81,   82,   83,  111,  171,   41,  105,   23,   19,   48,
313 /*   210 */    46,   19,   23,   19,   19,   23,  183,  184,   23,   17,
314 /*   220 */    23,   62,  189,  128,   60,   61,   62,   63,   64,   65,
315 /*   230 */    66,   67,   68,   69,   70,   71,   72,   73,   74,   75,
316 /*   240 */    76,   77,   78,   79,   80,   81,   82,   83,   20,   90,
317 /*   250 */    91,   15,   93,   94,   95,   96,   97,   98,  140,   57,
318 /*   260 */    24,   59,  144,  104,   80,  147,  148,   89,   20,   41,
319 /*   270 */    92,   87,   88,   20,   46,   39,   87,   88,   42,   87,
320 /*   280 */    88,   19,   87,   88,   87,   88,  113,   62,   60,   61,
321 /*   290 */    62,   63,   64,   65,   66,   67,   68,   69,   70,   71,
322 /*   300 */    72,   73,   74,   75,   76,   77,   78,   79,   80,   81,
323 /*   310 */    82,   83,   41,  132,  133,  134,  135,   46,   93,   94,
324 /*   320 */    95,   96,   97,   98,  107,   63,  109,  110,   20,  104,
325 /*   330 */    22,   60,   61,   62,   63,   64,   65,   66,   67,   68,
326 /*   340 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,
327 /*   350 */    79,   80,   81,   82,   83,  107,   47,  109,  110,   41,
328 /*   360 */   107,   89,  109,  110,   46,    0,  161,  162,   47,   89,
329 /*   370 */    99,   62,   92,  168,    9,   10,  113,   17,   60,   61,
330 /*   380 */    62,   63,   64,   65,   66,   67,   68,   69,   70,   71,
331 /*   390 */    72,   73,   74,   75,   76,   77,   78,   79,   80,   81,
332 /*   400 */    82,   83,   41,   89,  155,  156,   26,   46,   99,   20,
333 /*   410 */   161,   22,   20,  104,   22,  118,   36,   57,   22,   59,
334 /*   420 */    99,   60,   61,   62,   63,   64,   65,   66,   67,   68,
335 /*   430 */    69,   70,   71,   72,   73,   74,   75,   76,   77,   78,
336 /*   440 */    79,   80,   81,   82,   83,   41,   50,   20,   22,   22,
337 /*   450 */    46,   20,   22,   22,   91,   20,   93,   22,   20,   20,
338 /*   460 */    22,   22,  134,  135,   60,   61,   62,   63,   64,   65,
339 /*   470 */    66,   67,   68,   69,   70,   71,   72,   73,   74,   75,
340 /*   480 */    76,   77,   78,   79,   80,   81,   82,   83,   41,  140,
341 /*   490 */   130,   22,   20,   46,   22,   20,   20,   22,   22,   20,
342 /*   500 */   113,   22,   20,   19,   22,   21,   18,  158,   61,   62,
343 /*   510 */    63,   64,   65,   66,   67,   68,   69,   70,   71,   72,
344 /*   520 */    73,   74,   75,   76,   77,   78,   79,   80,   81,   82,
345 /*   530 */    83,   41,   23,  140,   23,  113,   46,   22,  140,  140,
346 /*   540 */   191,  192,   19,   21,  114,   23,   23,  127,  122,  129,
347 /*   550 */    29,  158,   62,   63,   64,   65,   66,   67,   68,   69,
348 /*   560 */    70,   71,   72,   73,   74,   75,   76,   77,   78,   79,
349 /*   570 */    80,   81,   82,   83,   11,   54,   13,   14,   15,   16,
350 /*   580 */    19,   23,  174,   95,   23,  192,  140,   78,   79,  181,
351 /*   590 */    27,   89,  146,  195,   92,   32,   87,   88,   87,   93,
352 /*   600 */    37,  136,  137,   88,  158,  206,  141,   41,   99,   87,
353 /*   610 */    87,  146,   46,   52,   51,  111,   53,  171,  130,   19,
354 /*   620 */   140,   58,   14,   62,  103,  140,  140,  146,  124,  111,
355 /*   630 */   115,  146,  146,   19,   68,   69,  171,   23,  158,   78,
356 /*   640 */    79,   80,  124,  158,  158,   87,   88,   86,   87,   88,
357 /*   650 */    89,  108,  171,   92,   93,   20,  171,  171,  146,   93,
358 /*   660 */   146,  196,   20,  100,  101,  102,   52,   23,   20,  106,
359 /*   670 */   146,  140,   15,  115,  111,   22,   62,  118,  198,  194,
360 /*   680 */   194,   24,  140,  171,   19,  171,  125,  126,   23,  204,
361 /*   690 */   204,   22,   78,   79,  140,  171,   39,   19,  167,   42,
362 /*   700 */    86,   87,   88,   89,  115,  152,   92,   93,  196,  167,
363 /*   710 */    53,  140,  140,  140,   22,  140,  140,   52,   25,  140,
364 /*   720 */   196,   28,  140,  140,  212,  111,  152,   62,  140,  217,
365 /*   730 */   158,   87,   88,  158,  158,  182,  212,  206,   45,  125,
366 /*   740 */   126,  217,  140,   78,   79,  140,  167,  140,  206,  167,
367 /*   750 */   146,   86,   87,   88,   89,  167,  182,   92,   93,  115,
368 /*   760 */   158,  207,  208,  209,  146,  158,  194,  152,  195,  194,
369 /*   770 */   199,   22,  167,  156,  200,  171,  204,  201,  161,  204,
370 /*   780 */   140,  140,  199,  140,   20,  206,  140,   20,  206,  171,
371 /*   790 */   125,  126,    9,   10,  206,  140,   20,  182,  158,  158,
372 /*   800 */   140,  158,  140,  113,  158,  198,  204,  140,  140,   20,
373 /*   810 */   140,  206,  140,  158,  140,  140,   48,  140,  158,  140,
374 /*   820 */   158,  140,  140,  140,  140,  158,  158,  140,  158,  140,
375 /*   830 */   158,  140,  158,  158,  140,  158,  140,  158,  139,  158,
376 /*   840 */   158,  158,  158,  140,  140,  158,  140,  158,  140,  158,
377 /*   850 */   140,  140,  158,  140,  158,   19,  140,  140,  140,  140,
378 /*   860 */   140,  158,  158,  140,  158,  140,  158,  140,  158,  158,
379 /*   870 */   140,  158,  140,  140,  158,  158,  158,  158,  158,  140,
380 /*   880 */    19,  158,   48,  158,   19,  158,  104,   97,  158,   21,
381 /*   890 */   158,  158,   99,   38,   49,   22,   49,  158,   99,  200,
382 /*   900 */   130,   19,   11,   14,    9,  103,   63,   63,  123,   19,
383 /*   910 */   114,  114,  103,  123,   19,  114,  116,   35,   87,   20,
384 /*   920 */    21,  150,  200,  160,  160,  138,   12,  139,   99,  138,
385 /*   930 */   138,  138,  145,   22,  139,  139,  164,   44,  139,  139,
386 /*   940 */   171,  111,  176,  122,  177,  119,  178,  120,  179,  117,
387 /*   950 */   180,  121,  193,   98,  151,   23,   83,   83,  202,  127,
388 /*   960 */   186,  113,  186,  193,   98,  186,  187,   99,  188,  116,
389 /*   970 */   187,   99,  188,  139,  159,   19,  151,  164,  139,  139,
390 /*   980 */   159,  186,  215,   40,  216,  127,  186,  139,  169,   60,
391 /*   990 */   169,  197,   19,  176,  122,  186,  113,  186,  186,  176,
392 /*  1000 */   122,  169,  186,  186,  197,  169,  186,  218,   33,  219,
393 /*  1010 */   116,  218,  142,  157,  173,  175,  157,  203,  157,  157,
394 /*  1020 */   162,  176,  176,  152,  210,  210,  152,  152,  140,  140,
395 /*  1030 */   154,  154,  154,  140,  140,  140,  140,  140,  140,  185,
396 /*  1040 */   140,  172,  140,  140,  163,  163,  163,  152,  154,  154,
397 /*  1050 */   140,  140,  140,  140,  140,  213,  214,  140,  140,  140,
398 /*  1060 */   140,  140,  140,  140,  140,  140,  140,  140,  140,  140,
399 /*  1070 */   140,  140,  140,  140,  140,  140,  140,  140,  140,  140,
400 /*  1080 */   140,  140,  140,  140,  170,  200,  166,  170,  166,  111,
401};
402#define YY_SHIFT_USE_DFLT (-84)
403#define YY_SHIFT_COUNT (376)
404#define YY_SHIFT_MIN   (-83)
405#define YY_SHIFT_MAX   (978)
406static const short yy_shift_ofst[] = {
407 /*     0 */   783,  563,  614,  614,   93,   92,   92,  978,  614,  561,
408 /*    10 */   665,  665,  509,  197,  -21,  665,  665,  665,  665,  665,
409 /*    20 */   159,  309,  197,  488,  197,  197,  197,  197,  197,  511,
410 /*    30 */   271,   60,  665,  665,  665,  665,  665,  665,  665,  665,
411 /*    40 */   665,  665,  665,  665,  665,  665,  665,  665,  665,  665,
412 /*    50 */   665,  665,  665,  665,  665,  665,  665,  665,  665,  665,
413 /*    60 */   665,  665,  665,  665,  665,  665,  665,  665,  665,  665,
414 /*    70 */   665,  665,  665,  665,  225,  197,  197,  197,  197,  522,
415 /*    80 */   197,  522,  365,  518,  504,  978,  978,  -84,  -84,  228,
416 /*    90 */   164,   95,   26,  318,  318,  318,  318,  318,  318,  318,
417 /*   100 */   318,  404,  318,  318,  318,  318,  318,  361,  318,  447,
418 /*   110 */   490,  490,  490,  -67,  -67,  -67,  -67,  -67,  -48,  -48,
419 /*   120 */   -48,  -48,  101,   -5,   -5,   -5,   -5,  657,  -25,  566,
420 /*   130 */   657,  184,  195,  644,  558,  253,  192,  248,  189,  119,
421 /*   140 */   119,    4,  197,  197,  197,  197,  197,  197,  217,  197,
422 /*   150 */   197,  197,  217,  197,  197,  197,  197,  197,  217,  197,
423 /*   160 */   197,  197,  217,  197,  197,  197,  197,  -79,  693,  197,
424 /*   170 */   217,  197,  197,  217,  197,  197,   42,   42,  523,  521,
425 /*   180 */   521,  521,  197,  197,  515,  217,  197,  515,  197,  197,
426 /*   190 */   197,  197,  197,  197,   42,   42,   42,  197,  197,  511,
427 /*   200 */   511,  502,  502,  511,  426,  426,  321,  380,  380,  420,
428 /*   210 */   380,  430,  -44,  380,  484,  975,  894,  975,  883,  929,
429 /*   220 */   973,  883,  883,  929,  878,  883,  883,  883,  872,  973,
430 /*   230 */   929,  929,  829,  848,  858,  943,  848,  956,  829,  829,
431 /*   240 */   893,  932,  956,  829,  853,  872,  853,  868,  848,  866,
432 /*   250 */   848,  848,  832,  874,  874,  873,  932,  855,  830,  832,
433 /*   260 */   827,  826,  821,  830,  829,  829,  893,  829,  829,  911,
434 /*   270 */   914,  914,  914,  829,  914,  -84,  -84,  -84,  -84,  -84,
435 /*   280 */   -84,  -84,   40,  360,  236,  202,  -83,  262,  482,  479,
436 /*   290 */   476,  475,  -18,  472,  439,  438,  435,  280,  178,  431,
437 /*   300 */   363,  427,  392,  389,  308,   89,  396,   17,   94,   22,
438 /*   310 */   899,  899,  831,  882,  800,  801,  895,  790,  809,  797,
439 /*   320 */   796,  890,  785,  844,  843,  802,  895,  889,  891,  882,
440 /*   330 */   799,  770,  847,  873,  845,  855,  793,  868,  782,  790,
441 /*   340 */   865,  834,  861,  836,  768,  789,  776,  690,  767,  678,
442 /*   350 */   589,  692,  559,  764,  669,  648,  749,  642,  653,  635,
443 /*   360 */   600,  608,  543,  506,  422,  387,  469,  297,  314,  272,
444 /*   370 */   263,  173,  194,  161,  170,   79,   -8,
445};
446#define YY_REDUCE_USE_DFLT (-69)
447#define YY_REDUCE_COUNT (281)
448#define YY_REDUCE_MIN   (-68)
449#define YY_REDUCE_MAX   (943)
450static const short yy_reduce_ofst[] = {
451 /*     0 */   181,  465,  486,  485,  -23,  524,  512,   33,  446,  575,
452 /*    10 */   572,  349,  554,  118,  574,  607,  480,  602,  576,  393,
453 /*    20 */   249,  205,  605,  -61,  588,  582,  579,  542,  531,  -68,
454 /*    30 */   699,  739,  733,  732,  730,  727,  725,  723,  720,  719,
455 /*    40 */   718,  717,  716,  713,  711,  710,  708,  706,  704,  703,
456 /*    50 */   696,  694,  691,  689,  687,  684,  683,  682,  681,  679,
457 /*    60 */   677,  675,  674,  672,  670,  668,  667,  662,  660,  655,
458 /*    70 */   646,  643,  641,  640,  617,  573,  583,  398,  571,  615,
459 /*    80 */   399,  553,  328,  618,  604,  514,  481,  -49,  408,  722,
460 /*    90 */   722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
461 /*   100 */   722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
462 /*   110 */   722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
463 /*   120 */   722,  722,  922,  722,  722,  722,  722,  917,  920,  885,
464 /*   130 */   914,  943,  942,  941,  940,  869,  939,  869,  938,  722,
465 /*   140 */   722,  869,  937,  936,  935,  934,  933,  932,  869,  931,
466 /*   150 */   930,  929,  869,  928,  927,  926,  925,  924,  869,  923,
467 /*   160 */   922,  921,  869,  920,  919,  918,  917,  842,  842,  914,
468 /*   170 */   869,  913,  912,  869,  911,  910,  895,  894,  895,  883,
469 /*   180 */   882,  881,  903,  902,  854,  869,  900,  854,  898,  897,
470 /*   190 */   896,  895,  894,  893,  878,  877,  876,  889,  888,  875,
471 /*   200 */   874,  815,  814,  871,  846,  845,  858,  862,  861,  814,
472 /*   210 */   859,  840,  841,  856,  870,  793,  790,  789,  820,  836,
473 /*   220 */   807,  817,  816,  832,  823,  812,  811,  809,  817,  794,
474 /*   230 */   821,  819,  848,  800,  768,  767,  795,  821,  840,  839,
475 /*   240 */   813,  825,  815,  834,  784,  783,  780,  779,  779,  770,
476 /*   250 */   776,  774,  756,  722,  722,  722,  803,  759,  770,  769,
477 /*   260 */   768,  767,  766,  769,  800,  799,  772,  796,  795,  787,
478 /*   270 */   793,  792,  791,  788,  787,  764,  763,  722,  722,  722,
479 /*   280 */   722,  771,
480};
481static const YYACTIONTYPE yy_default[] = {
482 /*     0 */   570,  856,  797,  797,  856,  839,  839,  685,  856,  797,
483 /*    10 */   797,  856,  822,  856,  681,  856,  856,  797,  793,  856,
484 /*    20 */   586,  649,  856,  581,  856,  856,  856,  856,  856,  594,
485 /*    30 */   651,  856,  856,  856,  856,  856,  856,  856,  856,  856,
486 /*    40 */   856,  856,  856,  856,  856,  856,  856,  856,  856,  856,
487 /*    50 */   856,  856,  856,  856,  856,  856,  856,  856,  856,  856,
488 /*    60 */   856,  856,  856,  856,  856,  856,  856,  856,  856,  856,
489 /*    70 */   856,  856,  856,  856,  856,  856,  856,  856,  856,  681,
490 /*    80 */   856,  681,  570,  856,  856,  856,  856,  685,  675,  856,
491 /*    90 */   856,  856,  856,  730,  729,  724,  723,  837,  697,  721,
492 /*   100 */   714,  856,  789,  790,  788,  792,  796,  856,  705,  748,
493 /*   110 */   780,  774,  747,  779,  760,  759,  754,  753,  752,  751,
494 /*   120 */   750,  749,  640,  758,  757,  756,  755,  856,  856,  856,
495 /*   130 */   856,  856,  856,  856,  856,  856,  856,  856,  856,  764,
496 /*   140 */   763,  856,  856,  856,  856,  809,  856,  856,  726,  856,
497 /*   150 */   856,  856,  663,  856,  856,  856,  856,  856,  842,  856,
498 /*   160 */   856,  856,  844,  856,  856,  856,  856,  856,  828,  856,
499 /*   170 */   661,  856,  856,  583,  856,  856,  856,  856,  595,  856,
500 /*   180 */   856,  856,  856,  856,  689,  688,  856,  683,  856,  856,
501 /*   190 */   856,  856,  856,  856,  856,  856,  856,  856,  573,  856,
502 /*   200 */   856,  856,  856,  856,  720,  720,  621,  708,  708,  791,
503 /*   210 */   708,  682,  673,  708,  856,  854,  852,  854,  690,  653,
504 /*   220 */   731,  690,  690,  653,  720,  690,  690,  690,  720,  731,
505 /*   230 */   653,  653,  651,  690,  836,  833,  690,  801,  651,  651,
506 /*   240 */   636,  856,  801,  651,  700,  698,  700,  698,  690,  709,
507 /*   250 */   690,  690,  856,  767,  766,  765,  856,  709,  715,  701,
508 /*   260 */   713,  711,  720,  856,  651,  651,  636,  651,  651,  639,
509 /*   270 */   572,  572,  572,  651,  572,  624,  624,  777,  776,  775,
510 /*   280 */   768,  604,  856,  856,  856,  856,  856,  816,  856,  856,
511 /*   290 */   856,  856,  856,  856,  856,  856,  856,  856,  856,  856,
512 /*   300 */   856,  856,  856,  856,  856,  856,  716,  737,  856,  856,
513 /*   310 */   856,  856,  856,  856,  808,  856,  856,  856,  856,  856,
514 /*   320 */   856,  856,  856,  856,  856,  856,  856,  856,  856,  856,
515 /*   330 */   856,  856,  856,  832,  831,  856,  856,  856,  856,  856,
516 /*   340 */   856,  856,  856,  856,  856,  856,  856,  856,  856,  856,
517 /*   350 */   856,  712,  856,  856,  856,  856,  856,  856,  856,  856,
518 /*   360 */   856,  856,  666,  856,  739,  856,  702,  856,  856,  856,
519 /*   370 */   738,  743,  856,  856,  856,  856,  856,  565,  569,  567,
520 /*   380 */   855,  853,  851,  850,  815,  821,  818,  820,  819,  817,
521 /*   390 */   814,  813,  812,  811,  810,  807,  725,  722,  719,  849,
522 /*   400 */   806,  662,  660,  843,  841,  732,  840,  838,  823,  728,
523 /*   410 */   727,  654,  799,  798,  580,  827,  826,  825,  734,  733,
524 /*   420 */   830,  829,  835,  834,  824,  579,  585,  643,  642,  650,
525 /*   430 */   648,  647,  646,  645,  644,  641,  587,  598,  599,  597,
526 /*   440 */   596,  615,  612,  614,  611,  613,  610,  609,  608,  607,
527 /*   450 */   606,  635,  623,  622,  802,  629,  628,  633,  632,  631,
528 /*   460 */   630,  627,  626,  625,  620,  746,  745,  735,  778,  672,
529 /*   470 */   671,  678,  677,  676,  687,  804,  805,  803,  699,  686,
530 /*   480 */   680,  679,  590,  589,  696,  695,  694,  693,  692,  684,
531 /*   490 */   674,  704,  786,  783,  784,  772,  785,  691,  795,  794,
532 /*   500 */   781,  848,  847,  846,  845,  787,  782,  669,  668,  667,
533 /*   510 */   771,  773,  770,  769,  762,  761,  744,  742,  741,  740,
534 /*   520 */   736,  710,  588,  703,  718,  717,  602,  601,  600,  670,
535 /*   530 */   665,  664,  619,  707,  706,  618,  638,  637,  634,  617,
536 /*   540 */   616,  605,  603,  584,  582,  578,  577,  576,  575,  593,
537 /*   550 */   592,  591,  574,  659,  658,  657,  656,  655,  652,  571,
538 /*   560 */   568,  566,  564,
539};
540
541/* The next table maps tokens into fallback tokens.  If a construct
542** like the following:
543**
544**      %fallback ID X Y Z.
545**
546** appears in the grammar, then ID becomes a fallback token for X, Y,
547** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
548** but it does not parse, the type of the token is changed to ID and
549** the parse is retried before an error is thrown.
550*/
551#ifdef YYFALLBACK
552static const YYCODETYPE yyFallback[] = {
553    0,  /*          $ => nothing */
554    0,  /* END_OF_FILE => nothing */
555    0,  /*    ILLEGAL => nothing */
556    0,  /*      SPACE => nothing */
557    0,  /* UNCLOSED_STRING => nothing */
558    0,  /*    COMMENT => nothing */
559    0,  /*   FUNCTION => nothing */
560    0,  /*     COLUMN => nothing */
561    0,  /* AGG_FUNCTION => nothing */
562    0,  /*       SEMI => nothing */
563   23,  /*    EXPLAIN => ID */
564   23,  /*      BEGIN => ID */
565    0,  /* TRANSACTION => nothing */
566    0,  /*     COMMIT => nothing */
567   23,  /*        END => ID */
568    0,  /*   ROLLBACK => nothing */
569    0,  /*     CREATE => nothing */
570    0,  /*      TABLE => nothing */
571   23,  /*       TEMP => ID */
572    0,  /*         LP => nothing */
573    0,  /*         RP => nothing */
574    0,  /*         AS => nothing */
575    0,  /*      COMMA => nothing */
576    0,  /*         ID => nothing */
577   23,  /*      ABORT => ID */
578   23,  /*      AFTER => ID */
579   23,  /*        ASC => ID */
580   23,  /*     ATTACH => ID */
581   23,  /*     BEFORE => ID */
582   23,  /*    CASCADE => ID */
583   23,  /*    CLUSTER => ID */
584   23,  /*   CONFLICT => ID */
585   23,  /*       COPY => ID */
586   23,  /*   DATABASE => ID */
587   23,  /*   DEFERRED => ID */
588   23,  /* DELIMITERS => ID */
589   23,  /*       DESC => ID */
590   23,  /*     DETACH => ID */
591   23,  /*       EACH => ID */
592   23,  /*       FAIL => ID */
593   23,  /*        FOR => ID */
594   23,  /*       GLOB => ID */
595   23,  /*     IGNORE => ID */
596   23,  /*  IMMEDIATE => ID */
597   23,  /*  INITIALLY => ID */
598   23,  /*    INSTEAD => ID */
599   23,  /*       LIKE => ID */
600   23,  /*      MATCH => ID */
601   23,  /*        KEY => ID */
602   23,  /*         OF => ID */
603   23,  /*     OFFSET => ID */
604   23,  /*     PRAGMA => ID */
605   23,  /*      RAISE => ID */
606   23,  /*    REPLACE => ID */
607   23,  /*   RESTRICT => ID */
608   23,  /*        ROW => ID */
609   23,  /*  STATEMENT => ID */
610   23,  /*    TRIGGER => ID */
611   23,  /*     VACUUM => ID */
612   23,  /*       VIEW => ID */
613};
614#endif /* YYFALLBACK */
615
616/* The following structure represents a single element of the
617** parser's stack.  Information stored includes:
618**
619**   +  The state number for the parser at this level of the stack.
620**
621**   +  The value of the token stored at this level of the stack.
622**      (In other words, the "major" token.)
623**
624**   +  The semantic value stored at this level of the stack.  This is
625**      the information used by the action routines in the grammar.
626**      It is sometimes called the "minor" token.
627*/
628struct yyStackEntry {
629  YYACTIONTYPE stateno;  /* The state-number */
630  YYCODETYPE major;      /* The major token value.  This is the code
631                         ** number for the token at this stack level */
632  YYMINORTYPE minor;     /* The user-supplied minor token value.  This
633                         ** is the value of the token  */
634};
635typedef struct yyStackEntry yyStackEntry;
636
637/* The state of the parser is completely contained in an instance of
638** the following structure */
639struct yyParser {
640  int yyidx;                    /* Index of top element in stack */
641#ifdef YYTRACKMAXSTACKDEPTH
642  int yyidxMax;                 /* Maximum value of yyidx */
643#endif
644  int yyerrcnt;                 /* Shifts left before out of the error */
645  sqliteParserARG_SDECL                /* A place to hold %extra_argument */
646#if YYSTACKDEPTH<=0
647  int yystksz;                  /* Current side of the stack */
648  yyStackEntry *yystack;        /* The parser's stack */
649#else
650  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
651#endif
652};
653typedef struct yyParser yyParser;
654
655#ifndef NDEBUG
656#include <stdio.h>
657static FILE *yyTraceFILE = 0;
658static char *yyTracePrompt = 0;
659#endif /* NDEBUG */
660
661#ifndef NDEBUG
662/*
663** Turn parser tracing on by giving a stream to which to write the trace
664** and a prompt to preface each trace message.  Tracing is turned off
665** by making either argument NULL
666**
667** Inputs:
668** <ul>
669** <li> A FILE* to which trace output should be written.
670**      If NULL, then tracing is turned off.
671** <li> A prefix string written at the beginning of every
672**      line of trace output.  If NULL, then tracing is
673**      turned off.
674** </ul>
675**
676** Outputs:
677** None.
678*/
679void sqliteParserTrace(FILE *TraceFILE, char *zTracePrompt){
680  yyTraceFILE = TraceFILE;
681  yyTracePrompt = zTracePrompt;
682  if( yyTraceFILE==0 ) yyTracePrompt = 0;
683  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
684}
685#endif /* NDEBUG */
686
687#ifndef NDEBUG
688/* For tracing shifts, the names of all terminals and nonterminals
689** are required.  The following table supplies these names */
690static const char *const yyTokenName[] = {
691  "$",             "END_OF_FILE",   "ILLEGAL",       "SPACE",
692  "UNCLOSED_STRING",  "COMMENT",       "FUNCTION",      "COLUMN",
693  "AGG_FUNCTION",  "SEMI",          "EXPLAIN",       "BEGIN",
694  "TRANSACTION",   "COMMIT",        "END",           "ROLLBACK",
695  "CREATE",        "TABLE",         "TEMP",          "LP",
696  "RP",            "AS",            "COMMA",         "ID",
697  "ABORT",         "AFTER",         "ASC",           "ATTACH",
698  "BEFORE",        "CASCADE",       "CLUSTER",       "CONFLICT",
699  "COPY",          "DATABASE",      "DEFERRED",      "DELIMITERS",
700  "DESC",          "DETACH",        "EACH",          "FAIL",
701  "FOR",           "GLOB",          "IGNORE",        "IMMEDIATE",
702  "INITIALLY",     "INSTEAD",       "LIKE",          "MATCH",
703  "KEY",           "OF",            "OFFSET",        "PRAGMA",
704  "RAISE",         "REPLACE",       "RESTRICT",      "ROW",
705  "STATEMENT",     "TRIGGER",       "VACUUM",        "VIEW",
706  "OR",            "AND",           "NOT",           "EQ",
707  "NE",            "ISNULL",        "NOTNULL",       "IS",
708  "BETWEEN",       "IN",            "GT",            "GE",
709  "LT",            "LE",            "BITAND",        "BITOR",
710  "LSHIFT",        "RSHIFT",        "PLUS",          "MINUS",
711  "STAR",          "SLASH",         "REM",           "CONCAT",
712  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",
713  "JOIN_KW",       "INTEGER",       "CONSTRAINT",    "DEFAULT",
714  "FLOAT",         "NULL",          "PRIMARY",       "UNIQUE",
715  "CHECK",         "REFERENCES",    "COLLATE",       "ON",
716  "DELETE",        "UPDATE",        "INSERT",        "SET",
717  "DEFERRABLE",    "FOREIGN",       "DROP",          "UNION",
718  "ALL",           "INTERSECT",     "EXCEPT",        "SELECT",
719  "DISTINCT",      "DOT",           "FROM",          "JOIN",
720  "USING",         "ORDER",         "BY",            "GROUP",
721  "HAVING",        "LIMIT",         "WHERE",         "INTO",
722  "VALUES",        "VARIABLE",      "CASE",          "WHEN",
723  "THEN",          "ELSE",          "INDEX",         "error",
724  "input",         "cmdlist",       "ecmd",          "explain",
725  "cmdx",          "cmd",           "trans_opt",     "onconf",
726  "nm",            "create_table",  "create_table_args",  "temp",
727  "columnlist",    "conslist_opt",  "select",        "column",
728  "columnid",      "type",          "carglist",      "id",
729  "ids",           "typename",      "signed",        "carg",
730  "ccons",         "sortorder",     "expr",          "idxlist_opt",
731  "refargs",       "defer_subclause",  "refarg",        "refact",
732  "init_deferred_pred_opt",  "conslist",      "tcons",         "idxlist",
733  "defer_subclause_opt",  "orconf",        "resolvetype",   "oneselect",
734  "multiselect_op",  "distinct",      "selcollist",    "from",
735  "where_opt",     "groupby_opt",   "having_opt",    "orderby_opt",
736  "limit_opt",     "sclp",          "as",            "seltablist",
737  "stl_prefix",    "joinop",        "dbnm",          "on_opt",
738  "using_opt",     "seltablist_paren",  "joinop2",       "sortlist",
739  "sortitem",      "collate",       "exprlist",      "setlist",
740  "insert_cmd",    "inscollist_opt",  "itemlist",      "inscollist",
741  "likeop",        "case_operand",  "case_exprlist",  "case_else",
742  "expritem",      "uniqueflag",    "idxitem",       "plus_num",
743  "minus_num",     "plus_opt",      "number",        "trigger_decl",
744  "trigger_cmd_list",  "trigger_time",  "trigger_event",  "foreach_clause",
745  "when_clause",   "trigger_cmd",   "database_kw_opt",  "key_opt",
746};
747#endif /* NDEBUG */
748
749#ifndef NDEBUG
750/* For tracing reduce actions, the names of all rules are required.
751*/
752static const char *const yyRuleName[] = {
753 /*   0 */ "input ::= cmdlist",
754 /*   1 */ "cmdlist ::= cmdlist ecmd",
755 /*   2 */ "cmdlist ::= ecmd",
756 /*   3 */ "ecmd ::= explain cmdx SEMI",
757 /*   4 */ "ecmd ::= SEMI",
758 /*   5 */ "cmdx ::= cmd",
759 /*   6 */ "explain ::= EXPLAIN",
760 /*   7 */ "explain ::=",
761 /*   8 */ "cmd ::= BEGIN trans_opt onconf",
762 /*   9 */ "trans_opt ::=",
763 /*  10 */ "trans_opt ::= TRANSACTION",
764 /*  11 */ "trans_opt ::= TRANSACTION nm",
765 /*  12 */ "cmd ::= COMMIT trans_opt",
766 /*  13 */ "cmd ::= END trans_opt",
767 /*  14 */ "cmd ::= ROLLBACK trans_opt",
768 /*  15 */ "cmd ::= create_table create_table_args",
769 /*  16 */ "create_table ::= CREATE temp TABLE nm",
770 /*  17 */ "temp ::= TEMP",
771 /*  18 */ "temp ::=",
772 /*  19 */ "create_table_args ::= LP columnlist conslist_opt RP",
773 /*  20 */ "create_table_args ::= AS select",
774 /*  21 */ "columnlist ::= columnlist COMMA column",
775 /*  22 */ "columnlist ::= column",
776 /*  23 */ "column ::= columnid type carglist",
777 /*  24 */ "columnid ::= nm",
778 /*  25 */ "id ::= ID",
779 /*  26 */ "ids ::= ID",
780 /*  27 */ "ids ::= STRING",
781 /*  28 */ "nm ::= ID",
782 /*  29 */ "nm ::= STRING",
783 /*  30 */ "nm ::= JOIN_KW",
784 /*  31 */ "type ::=",
785 /*  32 */ "type ::= typename",
786 /*  33 */ "type ::= typename LP signed RP",
787 /*  34 */ "type ::= typename LP signed COMMA signed RP",
788 /*  35 */ "typename ::= ids",
789 /*  36 */ "typename ::= typename ids",
790 /*  37 */ "signed ::= INTEGER",
791 /*  38 */ "signed ::= PLUS INTEGER",
792 /*  39 */ "signed ::= MINUS INTEGER",
793 /*  40 */ "carglist ::= carglist carg",
794 /*  41 */ "carglist ::=",
795 /*  42 */ "carg ::= CONSTRAINT nm ccons",
796 /*  43 */ "carg ::= ccons",
797 /*  44 */ "carg ::= DEFAULT STRING",
798 /*  45 */ "carg ::= DEFAULT ID",
799 /*  46 */ "carg ::= DEFAULT INTEGER",
800 /*  47 */ "carg ::= DEFAULT PLUS INTEGER",
801 /*  48 */ "carg ::= DEFAULT MINUS INTEGER",
802 /*  49 */ "carg ::= DEFAULT FLOAT",
803 /*  50 */ "carg ::= DEFAULT PLUS FLOAT",
804 /*  51 */ "carg ::= DEFAULT MINUS FLOAT",
805 /*  52 */ "carg ::= DEFAULT NULL",
806 /*  53 */ "ccons ::= NULL onconf",
807 /*  54 */ "ccons ::= NOT NULL onconf",
808 /*  55 */ "ccons ::= PRIMARY KEY sortorder onconf",
809 /*  56 */ "ccons ::= UNIQUE onconf",
810 /*  57 */ "ccons ::= CHECK LP expr RP onconf",
811 /*  58 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
812 /*  59 */ "ccons ::= defer_subclause",
813 /*  60 */ "ccons ::= COLLATE id",
814 /*  61 */ "refargs ::=",
815 /*  62 */ "refargs ::= refargs refarg",
816 /*  63 */ "refarg ::= MATCH nm",
817 /*  64 */ "refarg ::= ON DELETE refact",
818 /*  65 */ "refarg ::= ON UPDATE refact",
819 /*  66 */ "refarg ::= ON INSERT refact",
820 /*  67 */ "refact ::= SET NULL",
821 /*  68 */ "refact ::= SET DEFAULT",
822 /*  69 */ "refact ::= CASCADE",
823 /*  70 */ "refact ::= RESTRICT",
824 /*  71 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
825 /*  72 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
826 /*  73 */ "init_deferred_pred_opt ::=",
827 /*  74 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
828 /*  75 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
829 /*  76 */ "conslist_opt ::=",
830 /*  77 */ "conslist_opt ::= COMMA conslist",
831 /*  78 */ "conslist ::= conslist COMMA tcons",
832 /*  79 */ "conslist ::= conslist tcons",
833 /*  80 */ "conslist ::= tcons",
834 /*  81 */ "tcons ::= CONSTRAINT nm",
835 /*  82 */ "tcons ::= PRIMARY KEY LP idxlist RP onconf",
836 /*  83 */ "tcons ::= UNIQUE LP idxlist RP onconf",
837 /*  84 */ "tcons ::= CHECK expr onconf",
838 /*  85 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
839 /*  86 */ "defer_subclause_opt ::=",
840 /*  87 */ "defer_subclause_opt ::= defer_subclause",
841 /*  88 */ "onconf ::=",
842 /*  89 */ "onconf ::= ON CONFLICT resolvetype",
843 /*  90 */ "orconf ::=",
844 /*  91 */ "orconf ::= OR resolvetype",
845 /*  92 */ "resolvetype ::= ROLLBACK",
846 /*  93 */ "resolvetype ::= ABORT",
847 /*  94 */ "resolvetype ::= FAIL",
848 /*  95 */ "resolvetype ::= IGNORE",
849 /*  96 */ "resolvetype ::= REPLACE",
850 /*  97 */ "cmd ::= DROP TABLE nm",
851 /*  98 */ "cmd ::= CREATE temp VIEW nm AS select",
852 /*  99 */ "cmd ::= DROP VIEW nm",
853 /* 100 */ "cmd ::= select",
854 /* 101 */ "select ::= oneselect",
855 /* 102 */ "select ::= select multiselect_op oneselect",
856 /* 103 */ "multiselect_op ::= UNION",
857 /* 104 */ "multiselect_op ::= UNION ALL",
858 /* 105 */ "multiselect_op ::= INTERSECT",
859 /* 106 */ "multiselect_op ::= EXCEPT",
860 /* 107 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
861 /* 108 */ "distinct ::= DISTINCT",
862 /* 109 */ "distinct ::= ALL",
863 /* 110 */ "distinct ::=",
864 /* 111 */ "sclp ::= selcollist COMMA",
865 /* 112 */ "sclp ::=",
866 /* 113 */ "selcollist ::= sclp expr as",
867 /* 114 */ "selcollist ::= sclp STAR",
868 /* 115 */ "selcollist ::= sclp nm DOT STAR",
869 /* 116 */ "as ::= AS nm",
870 /* 117 */ "as ::= ids",
871 /* 118 */ "as ::=",
872 /* 119 */ "from ::=",
873 /* 120 */ "from ::= FROM seltablist",
874 /* 121 */ "stl_prefix ::= seltablist joinop",
875 /* 122 */ "stl_prefix ::=",
876 /* 123 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt",
877 /* 124 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt",
878 /* 125 */ "seltablist_paren ::= select",
879 /* 126 */ "seltablist_paren ::= seltablist",
880 /* 127 */ "dbnm ::=",
881 /* 128 */ "dbnm ::= DOT nm",
882 /* 129 */ "joinop ::= COMMA",
883 /* 130 */ "joinop ::= JOIN",
884 /* 131 */ "joinop ::= JOIN_KW JOIN",
885 /* 132 */ "joinop ::= JOIN_KW nm JOIN",
886 /* 133 */ "joinop ::= JOIN_KW nm nm JOIN",
887 /* 134 */ "on_opt ::= ON expr",
888 /* 135 */ "on_opt ::=",
889 /* 136 */ "using_opt ::= USING LP idxlist RP",
890 /* 137 */ "using_opt ::=",
891 /* 138 */ "orderby_opt ::=",
892 /* 139 */ "orderby_opt ::= ORDER BY sortlist",
893 /* 140 */ "sortlist ::= sortlist COMMA sortitem collate sortorder",
894 /* 141 */ "sortlist ::= sortitem collate sortorder",
895 /* 142 */ "sortitem ::= expr",
896 /* 143 */ "sortorder ::= ASC",
897 /* 144 */ "sortorder ::= DESC",
898 /* 145 */ "sortorder ::=",
899 /* 146 */ "collate ::=",
900 /* 147 */ "collate ::= COLLATE id",
901 /* 148 */ "groupby_opt ::=",
902 /* 149 */ "groupby_opt ::= GROUP BY exprlist",
903 /* 150 */ "having_opt ::=",
904 /* 151 */ "having_opt ::= HAVING expr",
905 /* 152 */ "limit_opt ::=",
906 /* 153 */ "limit_opt ::= LIMIT signed",
907 /* 154 */ "limit_opt ::= LIMIT signed OFFSET signed",
908 /* 155 */ "limit_opt ::= LIMIT signed COMMA signed",
909 /* 156 */ "cmd ::= DELETE FROM nm dbnm where_opt",
910 /* 157 */ "where_opt ::=",
911 /* 158 */ "where_opt ::= WHERE expr",
912 /* 159 */ "cmd ::= UPDATE orconf nm dbnm SET setlist where_opt",
913 /* 160 */ "setlist ::= setlist COMMA nm EQ expr",
914 /* 161 */ "setlist ::= nm EQ expr",
915 /* 162 */ "cmd ::= insert_cmd INTO nm dbnm inscollist_opt VALUES LP itemlist RP",
916 /* 163 */ "cmd ::= insert_cmd INTO nm dbnm inscollist_opt select",
917 /* 164 */ "insert_cmd ::= INSERT orconf",
918 /* 165 */ "insert_cmd ::= REPLACE",
919 /* 166 */ "itemlist ::= itemlist COMMA expr",
920 /* 167 */ "itemlist ::= expr",
921 /* 168 */ "inscollist_opt ::=",
922 /* 169 */ "inscollist_opt ::= LP inscollist RP",
923 /* 170 */ "inscollist ::= inscollist COMMA nm",
924 /* 171 */ "inscollist ::= nm",
925 /* 172 */ "expr ::= LP expr RP",
926 /* 173 */ "expr ::= NULL",
927 /* 174 */ "expr ::= ID",
928 /* 175 */ "expr ::= JOIN_KW",
929 /* 176 */ "expr ::= nm DOT nm",
930 /* 177 */ "expr ::= nm DOT nm DOT nm",
931 /* 178 */ "expr ::= INTEGER",
932 /* 179 */ "expr ::= FLOAT",
933 /* 180 */ "expr ::= STRING",
934 /* 181 */ "expr ::= VARIABLE",
935 /* 182 */ "expr ::= ID LP exprlist RP",
936 /* 183 */ "expr ::= ID LP STAR RP",
937 /* 184 */ "expr ::= expr AND expr",
938 /* 185 */ "expr ::= expr OR expr",
939 /* 186 */ "expr ::= expr LT expr",
940 /* 187 */ "expr ::= expr GT expr",
941 /* 188 */ "expr ::= expr LE expr",
942 /* 189 */ "expr ::= expr GE expr",
943 /* 190 */ "expr ::= expr NE expr",
944 /* 191 */ "expr ::= expr EQ expr",
945 /* 192 */ "expr ::= expr BITAND expr",
946 /* 193 */ "expr ::= expr BITOR expr",
947 /* 194 */ "expr ::= expr LSHIFT expr",
948 /* 195 */ "expr ::= expr RSHIFT expr",
949 /* 196 */ "expr ::= expr likeop expr",
950 /* 197 */ "expr ::= expr NOT likeop expr",
951 /* 198 */ "likeop ::= LIKE",
952 /* 199 */ "likeop ::= GLOB",
953 /* 200 */ "expr ::= expr PLUS expr",
954 /* 201 */ "expr ::= expr MINUS expr",
955 /* 202 */ "expr ::= expr STAR expr",
956 /* 203 */ "expr ::= expr SLASH expr",
957 /* 204 */ "expr ::= expr REM expr",
958 /* 205 */ "expr ::= expr CONCAT expr",
959 /* 206 */ "expr ::= expr ISNULL",
960 /* 207 */ "expr ::= expr IS NULL",
961 /* 208 */ "expr ::= expr NOTNULL",
962 /* 209 */ "expr ::= expr NOT NULL",
963 /* 210 */ "expr ::= expr IS NOT NULL",
964 /* 211 */ "expr ::= NOT expr",
965 /* 212 */ "expr ::= BITNOT expr",
966 /* 213 */ "expr ::= MINUS expr",
967 /* 214 */ "expr ::= PLUS expr",
968 /* 215 */ "expr ::= LP select RP",
969 /* 216 */ "expr ::= expr BETWEEN expr AND expr",
970 /* 217 */ "expr ::= expr NOT BETWEEN expr AND expr",
971 /* 218 */ "expr ::= expr IN LP exprlist RP",
972 /* 219 */ "expr ::= expr IN LP select RP",
973 /* 220 */ "expr ::= expr NOT IN LP exprlist RP",
974 /* 221 */ "expr ::= expr NOT IN LP select RP",
975 /* 222 */ "expr ::= expr IN nm dbnm",
976 /* 223 */ "expr ::= expr NOT IN nm dbnm",
977 /* 224 */ "expr ::= CASE case_operand case_exprlist case_else END",
978 /* 225 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
979 /* 226 */ "case_exprlist ::= WHEN expr THEN expr",
980 /* 227 */ "case_else ::= ELSE expr",
981 /* 228 */ "case_else ::=",
982 /* 229 */ "case_operand ::= expr",
983 /* 230 */ "case_operand ::=",
984 /* 231 */ "exprlist ::= exprlist COMMA expritem",
985 /* 232 */ "exprlist ::= expritem",
986 /* 233 */ "expritem ::= expr",
987 /* 234 */ "expritem ::=",
988 /* 235 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf",
989 /* 236 */ "uniqueflag ::= UNIQUE",
990 /* 237 */ "uniqueflag ::=",
991 /* 238 */ "idxlist_opt ::=",
992 /* 239 */ "idxlist_opt ::= LP idxlist RP",
993 /* 240 */ "idxlist ::= idxlist COMMA idxitem",
994 /* 241 */ "idxlist ::= idxitem",
995 /* 242 */ "idxitem ::= nm sortorder",
996 /* 243 */ "cmd ::= DROP INDEX nm dbnm",
997 /* 244 */ "cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING",
998 /* 245 */ "cmd ::= COPY orconf nm dbnm FROM nm",
999 /* 246 */ "cmd ::= VACUUM",
1000 /* 247 */ "cmd ::= VACUUM nm",
1001 /* 248 */ "cmd ::= PRAGMA ids EQ nm",
1002 /* 249 */ "cmd ::= PRAGMA ids EQ ON",
1003 /* 250 */ "cmd ::= PRAGMA ids EQ plus_num",
1004 /* 251 */ "cmd ::= PRAGMA ids EQ minus_num",
1005 /* 252 */ "cmd ::= PRAGMA ids LP nm RP",
1006 /* 253 */ "cmd ::= PRAGMA ids",
1007 /* 254 */ "plus_num ::= plus_opt number",
1008 /* 255 */ "minus_num ::= MINUS number",
1009 /* 256 */ "number ::= INTEGER",
1010 /* 257 */ "number ::= FLOAT",
1011 /* 258 */ "plus_opt ::= PLUS",
1012 /* 259 */ "plus_opt ::=",
1013 /* 260 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END",
1014 /* 261 */ "trigger_decl ::= temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause",
1015 /* 262 */ "trigger_time ::= BEFORE",
1016 /* 263 */ "trigger_time ::= AFTER",
1017 /* 264 */ "trigger_time ::= INSTEAD OF",
1018 /* 265 */ "trigger_time ::=",
1019 /* 266 */ "trigger_event ::= DELETE",
1020 /* 267 */ "trigger_event ::= INSERT",
1021 /* 268 */ "trigger_event ::= UPDATE",
1022 /* 269 */ "trigger_event ::= UPDATE OF inscollist",
1023 /* 270 */ "foreach_clause ::=",
1024 /* 271 */ "foreach_clause ::= FOR EACH ROW",
1025 /* 272 */ "foreach_clause ::= FOR EACH STATEMENT",
1026 /* 273 */ "when_clause ::=",
1027 /* 274 */ "when_clause ::= WHEN expr",
1028 /* 275 */ "trigger_cmd_list ::= trigger_cmd SEMI trigger_cmd_list",
1029 /* 276 */ "trigger_cmd_list ::=",
1030 /* 277 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt",
1031 /* 278 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP",
1032 /* 279 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select",
1033 /* 280 */ "trigger_cmd ::= DELETE FROM nm where_opt",
1034 /* 281 */ "trigger_cmd ::= select",
1035 /* 282 */ "expr ::= RAISE LP IGNORE RP",
1036 /* 283 */ "expr ::= RAISE LP ROLLBACK COMMA nm RP",
1037 /* 284 */ "expr ::= RAISE LP ABORT COMMA nm RP",
1038 /* 285 */ "expr ::= RAISE LP FAIL COMMA nm RP",
1039 /* 286 */ "cmd ::= DROP TRIGGER nm dbnm",
1040 /* 287 */ "cmd ::= ATTACH database_kw_opt ids AS nm key_opt",
1041 /* 288 */ "key_opt ::= USING ids",
1042 /* 289 */ "key_opt ::=",
1043 /* 290 */ "database_kw_opt ::= DATABASE",
1044 /* 291 */ "database_kw_opt ::=",
1045 /* 292 */ "cmd ::= DETACH database_kw_opt nm",
1046};
1047#endif /* NDEBUG */
1048
1049
1050#if YYSTACKDEPTH<=0
1051/*
1052** Try to increase the size of the parser stack.
1053*/
1054static void yyGrowStack(yyParser *p){
1055  int newSize;
1056  yyStackEntry *pNew;
1057
1058  newSize = p->yystksz*2 + 100;
1059  pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1060  if( pNew ){
1061    p->yystack = pNew;
1062    p->yystksz = newSize;
1063#ifndef NDEBUG
1064    if( yyTraceFILE ){
1065      fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
1066              yyTracePrompt, p->yystksz);
1067    }
1068#endif
1069  }
1070}
1071#endif
1072
1073/*
1074** This function allocates a new parser.
1075** The only argument is a pointer to a function which works like
1076** malloc.
1077**
1078** Inputs:
1079** A pointer to the function used to allocate memory.
1080**
1081** Outputs:
1082** A pointer to a parser.  This pointer is used in subsequent calls
1083** to sqliteParser and sqliteParserFree.
1084*/
1085void *sqliteParserAlloc(void *(*mallocProc)(size_t)){
1086  yyParser *pParser;
1087  pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
1088  if( pParser ){
1089    pParser->yyidx = -1;
1090#ifdef YYTRACKMAXSTACKDEPTH
1091    pParser->yyidxMax = 0;
1092#endif
1093#if YYSTACKDEPTH<=0
1094    pParser->yystack = NULL;
1095    pParser->yystksz = 0;
1096    yyGrowStack(pParser);
1097#endif
1098  }
1099  return pParser;
1100}
1101
1102/* The following function deletes the value associated with a
1103** symbol.  The symbol can be either a terminal or nonterminal.
1104** "yymajor" is the symbol code, and "yypminor" is a pointer to
1105** the value.
1106*/
1107static void yy_destructor(
1108  yyParser *yypParser,    /* The parser */
1109  YYCODETYPE yymajor,     /* Type code for object to destroy */
1110  YYMINORTYPE *yypminor   /* The object to be destroyed */
1111){
1112  sqliteParserARG_FETCH;
1113  switch( yymajor ){
1114    /* Here is inserted the actions which take place when a
1115    ** terminal or non-terminal is destroyed.  This can happen
1116    ** when the symbol is popped from the stack during a
1117    ** reduce or during error processing or when a parser is
1118    ** being destroyed before it is finished parsing.
1119    **
1120    ** Note: during a reduce, the only symbols destroyed are those
1121    ** which appear on the RHS of the rule, but which are not used
1122    ** inside the C code.
1123    */
1124    case 146: /* select */
1125    case 171: /* oneselect */
1126    case 189: /* seltablist_paren */
1127{
1128#line 286 "ext/sqlite/libsqlite/src/parse.y"
1129sqliteSelectDelete((yypminor->yy179));
1130#line 1131 "ext/sqlite/libsqlite/src/parse.c"
1131}
1132      break;
1133    case 158: /* expr */
1134    case 176: /* where_opt */
1135    case 178: /* having_opt */
1136    case 187: /* on_opt */
1137    case 192: /* sortitem */
1138    case 204: /* expritem */
1139{
1140#line 533 "ext/sqlite/libsqlite/src/parse.y"
1141sqliteExprDelete((yypminor->yy242));
1142#line 1143 "ext/sqlite/libsqlite/src/parse.c"
1143}
1144      break;
1145    case 159: /* idxlist_opt */
1146    case 167: /* idxlist */
1147    case 188: /* using_opt */
1148    case 197: /* inscollist_opt */
1149    case 199: /* inscollist */
1150{
1151#line 746 "ext/sqlite/libsqlite/src/parse.y"
1152sqliteIdListDelete((yypminor->yy320));
1153#line 1154 "ext/sqlite/libsqlite/src/parse.c"
1154}
1155      break;
1156    case 174: /* selcollist */
1157    case 177: /* groupby_opt */
1158    case 179: /* orderby_opt */
1159    case 181: /* sclp */
1160    case 191: /* sortlist */
1161    case 194: /* exprlist */
1162    case 195: /* setlist */
1163    case 198: /* itemlist */
1164    case 202: /* case_exprlist */
1165{
1166#line 322 "ext/sqlite/libsqlite/src/parse.y"
1167sqliteExprListDelete((yypminor->yy322));
1168#line 1169 "ext/sqlite/libsqlite/src/parse.c"
1169}
1170      break;
1171    case 175: /* from */
1172    case 183: /* seltablist */
1173    case 184: /* stl_prefix */
1174{
1175#line 353 "ext/sqlite/libsqlite/src/parse.y"
1176sqliteSrcListDelete((yypminor->yy307));
1177#line 1178 "ext/sqlite/libsqlite/src/parse.c"
1178}
1179      break;
1180    case 212: /* trigger_cmd_list */
1181    case 217: /* trigger_cmd */
1182{
1183#line 828 "ext/sqlite/libsqlite/src/parse.y"
1184sqliteDeleteTriggerStep((yypminor->yy19));
1185#line 1186 "ext/sqlite/libsqlite/src/parse.c"
1186}
1187      break;
1188    case 214: /* trigger_event */
1189{
1190#line 812 "ext/sqlite/libsqlite/src/parse.y"
1191sqliteIdListDelete((yypminor->yy290).b);
1192#line 1193 "ext/sqlite/libsqlite/src/parse.c"
1193}
1194      break;
1195    default:  break;   /* If no destructor action specified: do nothing */
1196  }
1197}
1198
1199/*
1200** Pop the parser's stack once.
1201**
1202** If there is a destructor routine associated with the token which
1203** is popped from the stack, then call it.
1204**
1205** Return the major token number for the symbol popped.
1206*/
1207static int yy_pop_parser_stack(yyParser *pParser){
1208  YYCODETYPE yymajor;
1209  yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
1210
1211  if( pParser->yyidx<0 ) return 0;
1212#ifndef NDEBUG
1213  if( yyTraceFILE && pParser->yyidx>=0 ){
1214    fprintf(yyTraceFILE,"%sPopping %s\n",
1215      yyTracePrompt,
1216      yyTokenName[yytos->major]);
1217  }
1218#endif
1219  yymajor = yytos->major;
1220  yy_destructor(pParser, yymajor, &yytos->minor);
1221  pParser->yyidx--;
1222  return yymajor;
1223}
1224
1225/*
1226** Deallocate and destroy a parser.  Destructors are all called for
1227** all stack elements before shutting the parser down.
1228**
1229** Inputs:
1230** <ul>
1231** <li>  A pointer to the parser.  This should be a pointer
1232**       obtained from sqliteParserAlloc.
1233** <li>  A pointer to a function used to reclaim memory obtained
1234**       from malloc.
1235** </ul>
1236*/
1237void sqliteParserFree(
1238  void *p,                    /* The parser to be deleted */
1239  void (*freeProc)(void*)     /* Function used to reclaim memory */
1240){
1241  yyParser *pParser = (yyParser*)p;
1242  if( pParser==0 ) return;
1243  while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
1244#if YYSTACKDEPTH<=0
1245  free(pParser->yystack);
1246#endif
1247  (*freeProc)((void*)pParser);
1248}
1249
1250/*
1251** Return the peak depth of the stack for a parser.
1252*/
1253#ifdef YYTRACKMAXSTACKDEPTH
1254int sqliteParserStackPeak(void *p){
1255  yyParser *pParser = (yyParser*)p;
1256  return pParser->yyidxMax;
1257}
1258#endif
1259
1260/*
1261** Find the appropriate action for a parser given the terminal
1262** look-ahead token iLookAhead.
1263**
1264** If the look-ahead token is YYNOCODE, then check to see if the action is
1265** independent of the look-ahead.  If it is, return the action, otherwise
1266** return YY_NO_ACTION.
1267*/
1268static int yy_find_shift_action(
1269  yyParser *pParser,        /* The parser */
1270  YYCODETYPE iLookAhead     /* The look-ahead token */
1271){
1272  int i;
1273  int stateno = pParser->yystack[pParser->yyidx].stateno;
1274
1275  if( stateno>YY_SHIFT_COUNT
1276   || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
1277    return yy_default[stateno];
1278  }
1279  assert( iLookAhead!=YYNOCODE );
1280  i += iLookAhead;
1281  if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
1282    if( iLookAhead>0 ){
1283#ifdef YYFALLBACK
1284      YYCODETYPE iFallback;            /* Fallback token */
1285      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
1286             && (iFallback = yyFallback[iLookAhead])!=0 ){
1287#ifndef NDEBUG
1288        if( yyTraceFILE ){
1289          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
1290             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
1291        }
1292#endif
1293        return yy_find_shift_action(pParser, iFallback);
1294      }
1295#endif
1296#ifdef YYWILDCARD
1297      {
1298        int j = i - iLookAhead + YYWILDCARD;
1299        if(
1300#if YY_SHIFT_MIN+YYWILDCARD<0
1301          j>=0 &&
1302#endif
1303#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
1304          j<YY_ACTTAB_COUNT &&
1305#endif
1306          yy_lookahead[j]==YYWILDCARD
1307        ){
1308#ifndef NDEBUG
1309          if( yyTraceFILE ){
1310            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
1311               yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
1312          }
1313#endif /* NDEBUG */
1314          return yy_action[j];
1315        }
1316      }
1317#endif /* YYWILDCARD */
1318    }
1319    return yy_default[stateno];
1320  }else{
1321    return yy_action[i];
1322  }
1323}
1324
1325/*
1326** Find the appropriate action for a parser given the non-terminal
1327** look-ahead token iLookAhead.
1328**
1329** If the look-ahead token is YYNOCODE, then check to see if the action is
1330** independent of the look-ahead.  If it is, return the action, otherwise
1331** return YY_NO_ACTION.
1332*/
1333static int yy_find_reduce_action(
1334  int stateno,              /* Current state number */
1335  YYCODETYPE iLookAhead     /* The look-ahead token */
1336){
1337  int i;
1338#ifdef YYERRORSYMBOL
1339  if( stateno>YY_REDUCE_COUNT ){
1340    return yy_default[stateno];
1341  }
1342#else
1343  assert( stateno<=YY_REDUCE_COUNT );
1344#endif
1345  i = yy_reduce_ofst[stateno];
1346  assert( i!=YY_REDUCE_USE_DFLT );
1347  assert( iLookAhead!=YYNOCODE );
1348  i += iLookAhead;
1349#ifdef YYERRORSYMBOL
1350  if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
1351    return yy_default[stateno];
1352  }
1353#else
1354  assert( i>=0 && i<YY_ACTTAB_COUNT );
1355  assert( yy_lookahead[i]==iLookAhead );
1356#endif
1357  return yy_action[i];
1358}
1359
1360/*
1361** The following routine is called if the stack overflows.
1362*/
1363static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
1364   sqliteParserARG_FETCH;
1365   yypParser->yyidx--;
1366#ifndef NDEBUG
1367   if( yyTraceFILE ){
1368     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
1369   }
1370#endif
1371   while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
1372   /* Here code is inserted which will execute if the parser
1373   ** stack every overflows */
1374   sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument var */
1375}
1376
1377/*
1378** Perform a shift action.
1379*/
1380static void yy_shift(
1381  yyParser *yypParser,          /* The parser to be shifted */
1382  int yyNewState,               /* The new state to shift in */
1383  int yyMajor,                  /* The major token to shift in */
1384  YYMINORTYPE *yypMinor         /* Pointer to the minor token to shift in */
1385){
1386  yyStackEntry *yytos;
1387  yypParser->yyidx++;
1388#ifdef YYTRACKMAXSTACKDEPTH
1389  if( yypParser->yyidx>yypParser->yyidxMax ){
1390    yypParser->yyidxMax = yypParser->yyidx;
1391  }
1392#endif
1393#if YYSTACKDEPTH>0
1394  if( yypParser->yyidx>=YYSTACKDEPTH ){
1395    yyStackOverflow(yypParser, yypMinor);
1396    return;
1397  }
1398#else
1399  if( yypParser->yyidx>=yypParser->yystksz ){
1400    yyGrowStack(yypParser);
1401    if( yypParser->yyidx>=yypParser->yystksz ){
1402      yyStackOverflow(yypParser, yypMinor);
1403      return;
1404    }
1405  }
1406#endif
1407  yytos = &yypParser->yystack[yypParser->yyidx];
1408  yytos->stateno = (YYACTIONTYPE)yyNewState;
1409  yytos->major = (YYCODETYPE)yyMajor;
1410  yytos->minor = *yypMinor;
1411#ifndef NDEBUG
1412  if( yyTraceFILE && yypParser->yyidx>0 ){
1413    int i;
1414    fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
1415    fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
1416    for(i=1; i<=yypParser->yyidx; i++)
1417      fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
1418    fprintf(yyTraceFILE,"\n");
1419  }
1420#endif
1421}
1422
1423/* The following table contains information about every rule that
1424** is used during the reduce.
1425*/
1426static const struct {
1427  YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
1428  unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
1429} yyRuleInfo[] = {
1430  { 132, 1 },
1431  { 133, 2 },
1432  { 133, 1 },
1433  { 134, 3 },
1434  { 134, 1 },
1435  { 136, 1 },
1436  { 135, 1 },
1437  { 135, 0 },
1438  { 137, 3 },
1439  { 138, 0 },
1440  { 138, 1 },
1441  { 138, 2 },
1442  { 137, 2 },
1443  { 137, 2 },
1444  { 137, 2 },
1445  { 137, 2 },
1446  { 141, 4 },
1447  { 143, 1 },
1448  { 143, 0 },
1449  { 142, 4 },
1450  { 142, 2 },
1451  { 144, 3 },
1452  { 144, 1 },
1453  { 147, 3 },
1454  { 148, 1 },
1455  { 151, 1 },
1456  { 152, 1 },
1457  { 152, 1 },
1458  { 140, 1 },
1459  { 140, 1 },
1460  { 140, 1 },
1461  { 149, 0 },
1462  { 149, 1 },
1463  { 149, 4 },
1464  { 149, 6 },
1465  { 153, 1 },
1466  { 153, 2 },
1467  { 154, 1 },
1468  { 154, 2 },
1469  { 154, 2 },
1470  { 150, 2 },
1471  { 150, 0 },
1472  { 155, 3 },
1473  { 155, 1 },
1474  { 155, 2 },
1475  { 155, 2 },
1476  { 155, 2 },
1477  { 155, 3 },
1478  { 155, 3 },
1479  { 155, 2 },
1480  { 155, 3 },
1481  { 155, 3 },
1482  { 155, 2 },
1483  { 156, 2 },
1484  { 156, 3 },
1485  { 156, 4 },
1486  { 156, 2 },
1487  { 156, 5 },
1488  { 156, 4 },
1489  { 156, 1 },
1490  { 156, 2 },
1491  { 160, 0 },
1492  { 160, 2 },
1493  { 162, 2 },
1494  { 162, 3 },
1495  { 162, 3 },
1496  { 162, 3 },
1497  { 163, 2 },
1498  { 163, 2 },
1499  { 163, 1 },
1500  { 163, 1 },
1501  { 161, 3 },
1502  { 161, 2 },
1503  { 164, 0 },
1504  { 164, 2 },
1505  { 164, 2 },
1506  { 145, 0 },
1507  { 145, 2 },
1508  { 165, 3 },
1509  { 165, 2 },
1510  { 165, 1 },
1511  { 166, 2 },
1512  { 166, 6 },
1513  { 166, 5 },
1514  { 166, 3 },
1515  { 166, 10 },
1516  { 168, 0 },
1517  { 168, 1 },
1518  { 139, 0 },
1519  { 139, 3 },
1520  { 169, 0 },
1521  { 169, 2 },
1522  { 170, 1 },
1523  { 170, 1 },
1524  { 170, 1 },
1525  { 170, 1 },
1526  { 170, 1 },
1527  { 137, 3 },
1528  { 137, 6 },
1529  { 137, 3 },
1530  { 137, 1 },
1531  { 146, 1 },
1532  { 146, 3 },
1533  { 172, 1 },
1534  { 172, 2 },
1535  { 172, 1 },
1536  { 172, 1 },
1537  { 171, 9 },
1538  { 173, 1 },
1539  { 173, 1 },
1540  { 173, 0 },
1541  { 181, 2 },
1542  { 181, 0 },
1543  { 174, 3 },
1544  { 174, 2 },
1545  { 174, 4 },
1546  { 182, 2 },
1547  { 182, 1 },
1548  { 182, 0 },
1549  { 175, 0 },
1550  { 175, 2 },
1551  { 184, 2 },
1552  { 184, 0 },
1553  { 183, 6 },
1554  { 183, 7 },
1555  { 189, 1 },
1556  { 189, 1 },
1557  { 186, 0 },
1558  { 186, 2 },
1559  { 185, 1 },
1560  { 185, 1 },
1561  { 185, 2 },
1562  { 185, 3 },
1563  { 185, 4 },
1564  { 187, 2 },
1565  { 187, 0 },
1566  { 188, 4 },
1567  { 188, 0 },
1568  { 179, 0 },
1569  { 179, 3 },
1570  { 191, 5 },
1571  { 191, 3 },
1572  { 192, 1 },
1573  { 157, 1 },
1574  { 157, 1 },
1575  { 157, 0 },
1576  { 193, 0 },
1577  { 193, 2 },
1578  { 177, 0 },
1579  { 177, 3 },
1580  { 178, 0 },
1581  { 178, 2 },
1582  { 180, 0 },
1583  { 180, 2 },
1584  { 180, 4 },
1585  { 180, 4 },
1586  { 137, 5 },
1587  { 176, 0 },
1588  { 176, 2 },
1589  { 137, 7 },
1590  { 195, 5 },
1591  { 195, 3 },
1592  { 137, 9 },
1593  { 137, 6 },
1594  { 196, 2 },
1595  { 196, 1 },
1596  { 198, 3 },
1597  { 198, 1 },
1598  { 197, 0 },
1599  { 197, 3 },
1600  { 199, 3 },
1601  { 199, 1 },
1602  { 158, 3 },
1603  { 158, 1 },
1604  { 158, 1 },
1605  { 158, 1 },
1606  { 158, 3 },
1607  { 158, 5 },
1608  { 158, 1 },
1609  { 158, 1 },
1610  { 158, 1 },
1611  { 158, 1 },
1612  { 158, 4 },
1613  { 158, 4 },
1614  { 158, 3 },
1615  { 158, 3 },
1616  { 158, 3 },
1617  { 158, 3 },
1618  { 158, 3 },
1619  { 158, 3 },
1620  { 158, 3 },
1621  { 158, 3 },
1622  { 158, 3 },
1623  { 158, 3 },
1624  { 158, 3 },
1625  { 158, 3 },
1626  { 158, 3 },
1627  { 158, 4 },
1628  { 200, 1 },
1629  { 200, 1 },
1630  { 158, 3 },
1631  { 158, 3 },
1632  { 158, 3 },
1633  { 158, 3 },
1634  { 158, 3 },
1635  { 158, 3 },
1636  { 158, 2 },
1637  { 158, 3 },
1638  { 158, 2 },
1639  { 158, 3 },
1640  { 158, 4 },
1641  { 158, 2 },
1642  { 158, 2 },
1643  { 158, 2 },
1644  { 158, 2 },
1645  { 158, 3 },
1646  { 158, 5 },
1647  { 158, 6 },
1648  { 158, 5 },
1649  { 158, 5 },
1650  { 158, 6 },
1651  { 158, 6 },
1652  { 158, 4 },
1653  { 158, 5 },
1654  { 158, 5 },
1655  { 202, 5 },
1656  { 202, 4 },
1657  { 203, 2 },
1658  { 203, 0 },
1659  { 201, 1 },
1660  { 201, 0 },
1661  { 194, 3 },
1662  { 194, 1 },
1663  { 204, 1 },
1664  { 204, 0 },
1665  { 137, 11 },
1666  { 205, 1 },
1667  { 205, 0 },
1668  { 159, 0 },
1669  { 159, 3 },
1670  { 167, 3 },
1671  { 167, 1 },
1672  { 206, 2 },
1673  { 137, 4 },
1674  { 137, 9 },
1675  { 137, 6 },
1676  { 137, 1 },
1677  { 137, 2 },
1678  { 137, 4 },
1679  { 137, 4 },
1680  { 137, 4 },
1681  { 137, 4 },
1682  { 137, 5 },
1683  { 137, 2 },
1684  { 207, 2 },
1685  { 208, 2 },
1686  { 210, 1 },
1687  { 210, 1 },
1688  { 209, 1 },
1689  { 209, 0 },
1690  { 137, 5 },
1691  { 211, 10 },
1692  { 213, 1 },
1693  { 213, 1 },
1694  { 213, 2 },
1695  { 213, 0 },
1696  { 214, 1 },
1697  { 214, 1 },
1698  { 214, 1 },
1699  { 214, 3 },
1700  { 215, 0 },
1701  { 215, 3 },
1702  { 215, 3 },
1703  { 216, 0 },
1704  { 216, 2 },
1705  { 212, 3 },
1706  { 212, 0 },
1707  { 217, 6 },
1708  { 217, 8 },
1709  { 217, 5 },
1710  { 217, 4 },
1711  { 217, 1 },
1712  { 158, 4 },
1713  { 158, 6 },
1714  { 158, 6 },
1715  { 158, 6 },
1716  { 137, 4 },
1717  { 137, 6 },
1718  { 219, 2 },
1719  { 219, 0 },
1720  { 218, 1 },
1721  { 218, 0 },
1722  { 137, 3 },
1723};
1724
1725static void yy_accept(yyParser*);  /* Forward Declaration */
1726
1727/*
1728** Perform a reduce action and the shift that must immediately
1729** follow the reduce.
1730*/
1731static void yy_reduce(
1732  yyParser *yypParser,         /* The parser */
1733  int yyruleno                 /* Number of the rule by which to reduce */
1734){
1735  int yygoto;                     /* The next state */
1736  int yyact;                      /* The next action */
1737  YYMINORTYPE yygotominor;        /* The LHS of the rule reduced */
1738  yyStackEntry *yymsp;            /* The top of the parser's stack */
1739  int yysize;                     /* Amount to pop the stack */
1740  sqliteParserARG_FETCH;
1741  yymsp = &yypParser->yystack[yypParser->yyidx];
1742#ifndef NDEBUG
1743  if( yyTraceFILE && yyruleno>=0
1744        && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
1745    fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
1746      yyRuleName[yyruleno]);
1747  }
1748#endif /* NDEBUG */
1749
1750  /* Silence complaints from purify about yygotominor being uninitialized
1751  ** in some cases when it is copied into the stack after the following
1752  ** switch.  yygotominor is uninitialized when a rule reduces that does
1753  ** not set the value of its left-hand side nonterminal.  Leaving the
1754  ** value of the nonterminal uninitialized is utterly harmless as long
1755  ** as the value is never used.  So really the only thing this code
1756  ** accomplishes is to quieten purify.
1757  **
1758  ** 2007-01-16:  The wireshark project (www.wireshark.org) reports that
1759  ** without this code, their parser segfaults.  I'm not sure what there
1760  ** parser is doing to make this happen.  This is the second bug report
1761  ** from wireshark this week.  Clearly they are stressing Lemon in ways
1762  ** that it has not been previously stressed...  (SQLite ticket #2172)
1763  */
1764  /*memset(&yygotominor, 0, sizeof(yygotominor));*/
1765  yygotominor = yyzerominor;
1766
1767
1768  switch( yyruleno ){
1769  /* Beginning here are the reduction cases.  A typical example
1770  ** follows:
1771  **   case 0:
1772  **  #line <lineno> <grammarfile>
1773  **     { ... }           // User supplied code
1774  **  #line <lineno> <thisfile>
1775  **     break;
1776  */
1777      case 5: /* cmdx ::= cmd */
1778#line 72 "ext/sqlite/libsqlite/src/parse.y"
1779{ sqliteExec(pParse); }
1780#line 1781 "ext/sqlite/libsqlite/src/parse.c"
1781        break;
1782      case 6: /* explain ::= EXPLAIN */
1783#line 73 "ext/sqlite/libsqlite/src/parse.y"
1784{ sqliteBeginParse(pParse, 1); }
1785#line 1786 "ext/sqlite/libsqlite/src/parse.c"
1786        break;
1787      case 7: /* explain ::= */
1788#line 74 "ext/sqlite/libsqlite/src/parse.y"
1789{ sqliteBeginParse(pParse, 0); }
1790#line 1791 "ext/sqlite/libsqlite/src/parse.c"
1791        break;
1792      case 8: /* cmd ::= BEGIN trans_opt onconf */
1793#line 79 "ext/sqlite/libsqlite/src/parse.y"
1794{sqliteBeginTransaction(pParse,yymsp[0].minor.yy372);}
1795#line 1796 "ext/sqlite/libsqlite/src/parse.c"
1796        break;
1797      case 12: /* cmd ::= COMMIT trans_opt */
1798      case 13: /* cmd ::= END trans_opt */ yytestcase(yyruleno==13);
1799#line 83 "ext/sqlite/libsqlite/src/parse.y"
1800{sqliteCommitTransaction(pParse);}
1801#line 1802 "ext/sqlite/libsqlite/src/parse.c"
1802        break;
1803      case 14: /* cmd ::= ROLLBACK trans_opt */
1804#line 85 "ext/sqlite/libsqlite/src/parse.y"
1805{sqliteRollbackTransaction(pParse);}
1806#line 1807 "ext/sqlite/libsqlite/src/parse.c"
1807        break;
1808      case 16: /* create_table ::= CREATE temp TABLE nm */
1809#line 90 "ext/sqlite/libsqlite/src/parse.y"
1810{
1811   sqliteStartTable(pParse,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0,yymsp[-2].minor.yy372,0);
1812}
1813#line 1814 "ext/sqlite/libsqlite/src/parse.c"
1814        break;
1815      case 17: /* temp ::= TEMP */
1816      case 74: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==74);
1817      case 108: /* distinct ::= DISTINCT */ yytestcase(yyruleno==108);
1818#line 94 "ext/sqlite/libsqlite/src/parse.y"
1819{yygotominor.yy372 = 1;}
1820#line 1821 "ext/sqlite/libsqlite/src/parse.c"
1821        break;
1822      case 18: /* temp ::= */
1823      case 73: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==73);
1824      case 75: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==75);
1825      case 86: /* defer_subclause_opt ::= */ yytestcase(yyruleno==86);
1826      case 109: /* distinct ::= ALL */ yytestcase(yyruleno==109);
1827      case 110: /* distinct ::= */ yytestcase(yyruleno==110);
1828#line 95 "ext/sqlite/libsqlite/src/parse.y"
1829{yygotominor.yy372 = 0;}
1830#line 1831 "ext/sqlite/libsqlite/src/parse.c"
1831        break;
1832      case 19: /* create_table_args ::= LP columnlist conslist_opt RP */
1833#line 96 "ext/sqlite/libsqlite/src/parse.y"
1834{
1835  sqliteEndTable(pParse,&yymsp[0].minor.yy0,0);
1836}
1837#line 1838 "ext/sqlite/libsqlite/src/parse.c"
1838        break;
1839      case 20: /* create_table_args ::= AS select */
1840#line 99 "ext/sqlite/libsqlite/src/parse.y"
1841{
1842  sqliteEndTable(pParse,0,yymsp[0].minor.yy179);
1843  sqliteSelectDelete(yymsp[0].minor.yy179);
1844}
1845#line 1846 "ext/sqlite/libsqlite/src/parse.c"
1846        break;
1847      case 24: /* columnid ::= nm */
1848#line 111 "ext/sqlite/libsqlite/src/parse.y"
1849{sqliteAddColumn(pParse,&yymsp[0].minor.yy0);}
1850#line 1851 "ext/sqlite/libsqlite/src/parse.c"
1851        break;
1852      case 25: /* id ::= ID */
1853      case 26: /* ids ::= ID */ yytestcase(yyruleno==26);
1854      case 27: /* ids ::= STRING */ yytestcase(yyruleno==27);
1855      case 28: /* nm ::= ID */ yytestcase(yyruleno==28);
1856      case 29: /* nm ::= STRING */ yytestcase(yyruleno==29);
1857      case 30: /* nm ::= JOIN_KW */ yytestcase(yyruleno==30);
1858      case 35: /* typename ::= ids */ yytestcase(yyruleno==35);
1859      case 128: /* dbnm ::= DOT nm */ yytestcase(yyruleno==128);
1860      case 254: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==254);
1861      case 255: /* minus_num ::= MINUS number */ yytestcase(yyruleno==255);
1862      case 256: /* number ::= INTEGER */ yytestcase(yyruleno==256);
1863      case 257: /* number ::= FLOAT */ yytestcase(yyruleno==257);
1864#line 117 "ext/sqlite/libsqlite/src/parse.y"
1865{yygotominor.yy0 = yymsp[0].minor.yy0;}
1866#line 1867 "ext/sqlite/libsqlite/src/parse.c"
1867        break;
1868      case 32: /* type ::= typename */
1869#line 160 "ext/sqlite/libsqlite/src/parse.y"
1870{sqliteAddColumnType(pParse,&yymsp[0].minor.yy0,&yymsp[0].minor.yy0);}
1871#line 1872 "ext/sqlite/libsqlite/src/parse.c"
1872        break;
1873      case 33: /* type ::= typename LP signed RP */
1874#line 161 "ext/sqlite/libsqlite/src/parse.y"
1875{sqliteAddColumnType(pParse,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);}
1876#line 1877 "ext/sqlite/libsqlite/src/parse.c"
1877        break;
1878      case 34: /* type ::= typename LP signed COMMA signed RP */
1879#line 163 "ext/sqlite/libsqlite/src/parse.y"
1880{sqliteAddColumnType(pParse,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);}
1881#line 1882 "ext/sqlite/libsqlite/src/parse.c"
1882        break;
1883      case 36: /* typename ::= typename ids */
1884      case 242: /* idxitem ::= nm sortorder */ yytestcase(yyruleno==242);
1885#line 166 "ext/sqlite/libsqlite/src/parse.y"
1886{yygotominor.yy0 = yymsp[-1].minor.yy0;}
1887#line 1888 "ext/sqlite/libsqlite/src/parse.c"
1888        break;
1889      case 37: /* signed ::= INTEGER */
1890      case 38: /* signed ::= PLUS INTEGER */ yytestcase(yyruleno==38);
1891#line 168 "ext/sqlite/libsqlite/src/parse.y"
1892{ yygotominor.yy372 = atoi(yymsp[0].minor.yy0.z); }
1893#line 1894 "ext/sqlite/libsqlite/src/parse.c"
1894        break;
1895      case 39: /* signed ::= MINUS INTEGER */
1896#line 170 "ext/sqlite/libsqlite/src/parse.y"
1897{ yygotominor.yy372 = -atoi(yymsp[0].minor.yy0.z); }
1898#line 1899 "ext/sqlite/libsqlite/src/parse.c"
1899        break;
1900      case 44: /* carg ::= DEFAULT STRING */
1901      case 45: /* carg ::= DEFAULT ID */ yytestcase(yyruleno==45);
1902      case 46: /* carg ::= DEFAULT INTEGER */ yytestcase(yyruleno==46);
1903      case 47: /* carg ::= DEFAULT PLUS INTEGER */ yytestcase(yyruleno==47);
1904      case 49: /* carg ::= DEFAULT FLOAT */ yytestcase(yyruleno==49);
1905      case 50: /* carg ::= DEFAULT PLUS FLOAT */ yytestcase(yyruleno==50);
1906#line 175 "ext/sqlite/libsqlite/src/parse.y"
1907{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);}
1908#line 1909 "ext/sqlite/libsqlite/src/parse.c"
1909        break;
1910      case 48: /* carg ::= DEFAULT MINUS INTEGER */
1911      case 51: /* carg ::= DEFAULT MINUS FLOAT */ yytestcase(yyruleno==51);
1912#line 179 "ext/sqlite/libsqlite/src/parse.y"
1913{sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,1);}
1914#line 1915 "ext/sqlite/libsqlite/src/parse.c"
1915        break;
1916      case 54: /* ccons ::= NOT NULL onconf */
1917#line 189 "ext/sqlite/libsqlite/src/parse.y"
1918{sqliteAddNotNull(pParse, yymsp[0].minor.yy372);}
1919#line 1920 "ext/sqlite/libsqlite/src/parse.c"
1920        break;
1921      case 55: /* ccons ::= PRIMARY KEY sortorder onconf */
1922#line 190 "ext/sqlite/libsqlite/src/parse.y"
1923{sqliteAddPrimaryKey(pParse,0,yymsp[0].minor.yy372);}
1924#line 1925 "ext/sqlite/libsqlite/src/parse.c"
1925        break;
1926      case 56: /* ccons ::= UNIQUE onconf */
1927#line 191 "ext/sqlite/libsqlite/src/parse.y"
1928{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy372,0,0);}
1929#line 1930 "ext/sqlite/libsqlite/src/parse.c"
1930        break;
1931      case 57: /* ccons ::= CHECK LP expr RP onconf */
1932#line 192 "ext/sqlite/libsqlite/src/parse.y"
1933{
1934  yy_destructor(yypParser,158,&yymsp[-2].minor);
1935}
1936#line 1937 "ext/sqlite/libsqlite/src/parse.c"
1937        break;
1938      case 58: /* ccons ::= REFERENCES nm idxlist_opt refargs */
1939#line 194 "ext/sqlite/libsqlite/src/parse.y"
1940{sqliteCreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy320,yymsp[0].minor.yy372);}
1941#line 1942 "ext/sqlite/libsqlite/src/parse.c"
1942        break;
1943      case 59: /* ccons ::= defer_subclause */
1944#line 195 "ext/sqlite/libsqlite/src/parse.y"
1945{sqliteDeferForeignKey(pParse,yymsp[0].minor.yy372);}
1946#line 1947 "ext/sqlite/libsqlite/src/parse.c"
1947        break;
1948      case 60: /* ccons ::= COLLATE id */
1949#line 196 "ext/sqlite/libsqlite/src/parse.y"
1950{
1951   sqliteAddCollateType(pParse, sqliteCollateType(yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n));
1952}
1953#line 1954 "ext/sqlite/libsqlite/src/parse.c"
1954        break;
1955      case 61: /* refargs ::= */
1956#line 206 "ext/sqlite/libsqlite/src/parse.y"
1957{ yygotominor.yy372 = OE_Restrict * 0x010101; }
1958#line 1959 "ext/sqlite/libsqlite/src/parse.c"
1959        break;
1960      case 62: /* refargs ::= refargs refarg */
1961#line 207 "ext/sqlite/libsqlite/src/parse.y"
1962{ yygotominor.yy372 = (yymsp[-1].minor.yy372 & yymsp[0].minor.yy407.mask) | yymsp[0].minor.yy407.value; }
1963#line 1964 "ext/sqlite/libsqlite/src/parse.c"
1964        break;
1965      case 63: /* refarg ::= MATCH nm */
1966#line 209 "ext/sqlite/libsqlite/src/parse.y"
1967{ yygotominor.yy407.value = 0;     yygotominor.yy407.mask = 0x000000; }
1968#line 1969 "ext/sqlite/libsqlite/src/parse.c"
1969        break;
1970      case 64: /* refarg ::= ON DELETE refact */
1971#line 210 "ext/sqlite/libsqlite/src/parse.y"
1972{ yygotominor.yy407.value = yymsp[0].minor.yy372;     yygotominor.yy407.mask = 0x0000ff; }
1973#line 1974 "ext/sqlite/libsqlite/src/parse.c"
1974        break;
1975      case 65: /* refarg ::= ON UPDATE refact */
1976#line 211 "ext/sqlite/libsqlite/src/parse.y"
1977{ yygotominor.yy407.value = yymsp[0].minor.yy372<<8;  yygotominor.yy407.mask = 0x00ff00; }
1978#line 1979 "ext/sqlite/libsqlite/src/parse.c"
1979        break;
1980      case 66: /* refarg ::= ON INSERT refact */
1981#line 212 "ext/sqlite/libsqlite/src/parse.y"
1982{ yygotominor.yy407.value = yymsp[0].minor.yy372<<16; yygotominor.yy407.mask = 0xff0000; }
1983#line 1984 "ext/sqlite/libsqlite/src/parse.c"
1984        break;
1985      case 67: /* refact ::= SET NULL */
1986#line 214 "ext/sqlite/libsqlite/src/parse.y"
1987{ yygotominor.yy372 = OE_SetNull; }
1988#line 1989 "ext/sqlite/libsqlite/src/parse.c"
1989        break;
1990      case 68: /* refact ::= SET DEFAULT */
1991#line 215 "ext/sqlite/libsqlite/src/parse.y"
1992{ yygotominor.yy372 = OE_SetDflt; }
1993#line 1994 "ext/sqlite/libsqlite/src/parse.c"
1994        break;
1995      case 69: /* refact ::= CASCADE */
1996#line 216 "ext/sqlite/libsqlite/src/parse.y"
1997{ yygotominor.yy372 = OE_Cascade; }
1998#line 1999 "ext/sqlite/libsqlite/src/parse.c"
1999        break;
2000      case 70: /* refact ::= RESTRICT */
2001#line 217 "ext/sqlite/libsqlite/src/parse.y"
2002{ yygotominor.yy372 = OE_Restrict; }
2003#line 2004 "ext/sqlite/libsqlite/src/parse.c"
2004        break;
2005      case 71: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
2006      case 72: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==72);
2007      case 87: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==87);
2008      case 164: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==164);
2009#line 219 "ext/sqlite/libsqlite/src/parse.y"
2010{yygotominor.yy372 = yymsp[0].minor.yy372;}
2011#line 2012 "ext/sqlite/libsqlite/src/parse.c"
2012        break;
2013      case 82: /* tcons ::= PRIMARY KEY LP idxlist RP onconf */
2014#line 236 "ext/sqlite/libsqlite/src/parse.y"
2015{sqliteAddPrimaryKey(pParse,yymsp[-2].minor.yy320,yymsp[0].minor.yy372);}
2016#line 2017 "ext/sqlite/libsqlite/src/parse.c"
2017        break;
2018      case 83: /* tcons ::= UNIQUE LP idxlist RP onconf */
2019#line 238 "ext/sqlite/libsqlite/src/parse.y"
2020{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy320,yymsp[0].minor.yy372,0,0);}
2021#line 2022 "ext/sqlite/libsqlite/src/parse.c"
2022        break;
2023      case 84: /* tcons ::= CHECK expr onconf */
2024#line 239 "ext/sqlite/libsqlite/src/parse.y"
2025{
2026  yy_destructor(yypParser,158,&yymsp[-1].minor);
2027}
2028#line 2029 "ext/sqlite/libsqlite/src/parse.c"
2029        break;
2030      case 85: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
2031#line 241 "ext/sqlite/libsqlite/src/parse.y"
2032{
2033    sqliteCreateForeignKey(pParse, yymsp[-6].minor.yy320, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy320, yymsp[-1].minor.yy372);
2034    sqliteDeferForeignKey(pParse, yymsp[0].minor.yy372);
2035}
2036#line 2037 "ext/sqlite/libsqlite/src/parse.c"
2037        break;
2038      case 88: /* onconf ::= */
2039      case 90: /* orconf ::= */ yytestcase(yyruleno==90);
2040#line 255 "ext/sqlite/libsqlite/src/parse.y"
2041{ yygotominor.yy372 = OE_Default; }
2042#line 2043 "ext/sqlite/libsqlite/src/parse.c"
2043        break;
2044      case 89: /* onconf ::= ON CONFLICT resolvetype */
2045      case 91: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==91);
2046#line 256 "ext/sqlite/libsqlite/src/parse.y"
2047{ yygotominor.yy372 = yymsp[0].minor.yy372; }
2048#line 2049 "ext/sqlite/libsqlite/src/parse.c"
2049        break;
2050      case 92: /* resolvetype ::= ROLLBACK */
2051#line 259 "ext/sqlite/libsqlite/src/parse.y"
2052{ yygotominor.yy372 = OE_Rollback; }
2053#line 2054 "ext/sqlite/libsqlite/src/parse.c"
2054        break;
2055      case 93: /* resolvetype ::= ABORT */
2056      case 236: /* uniqueflag ::= UNIQUE */ yytestcase(yyruleno==236);
2057#line 260 "ext/sqlite/libsqlite/src/parse.y"
2058{ yygotominor.yy372 = OE_Abort; }
2059#line 2060 "ext/sqlite/libsqlite/src/parse.c"
2060        break;
2061      case 94: /* resolvetype ::= FAIL */
2062#line 261 "ext/sqlite/libsqlite/src/parse.y"
2063{ yygotominor.yy372 = OE_Fail; }
2064#line 2065 "ext/sqlite/libsqlite/src/parse.c"
2065        break;
2066      case 95: /* resolvetype ::= IGNORE */
2067#line 262 "ext/sqlite/libsqlite/src/parse.y"
2068{ yygotominor.yy372 = OE_Ignore; }
2069#line 2070 "ext/sqlite/libsqlite/src/parse.c"
2070        break;
2071      case 96: /* resolvetype ::= REPLACE */
2072#line 263 "ext/sqlite/libsqlite/src/parse.y"
2073{ yygotominor.yy372 = OE_Replace; }
2074#line 2075 "ext/sqlite/libsqlite/src/parse.c"
2075        break;
2076      case 97: /* cmd ::= DROP TABLE nm */
2077#line 267 "ext/sqlite/libsqlite/src/parse.y"
2078{sqliteDropTable(pParse,&yymsp[0].minor.yy0,0);}
2079#line 2080 "ext/sqlite/libsqlite/src/parse.c"
2080        break;
2081      case 98: /* cmd ::= CREATE temp VIEW nm AS select */
2082#line 271 "ext/sqlite/libsqlite/src/parse.y"
2083{
2084  sqliteCreateView(pParse, &yymsp[-5].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy179, yymsp[-4].minor.yy372);
2085}
2086#line 2087 "ext/sqlite/libsqlite/src/parse.c"
2087        break;
2088      case 99: /* cmd ::= DROP VIEW nm */
2089#line 274 "ext/sqlite/libsqlite/src/parse.y"
2090{
2091  sqliteDropTable(pParse, &yymsp[0].minor.yy0, 1);
2092}
2093#line 2094 "ext/sqlite/libsqlite/src/parse.c"
2094        break;
2095      case 100: /* cmd ::= select */
2096#line 280 "ext/sqlite/libsqlite/src/parse.y"
2097{
2098  sqliteSelect(pParse, yymsp[0].minor.yy179, SRT_Callback, 0, 0, 0, 0);
2099  sqliteSelectDelete(yymsp[0].minor.yy179);
2100}
2101#line 2102 "ext/sqlite/libsqlite/src/parse.c"
2102        break;
2103      case 101: /* select ::= oneselect */
2104      case 125: /* seltablist_paren ::= select */ yytestcase(yyruleno==125);
2105#line 290 "ext/sqlite/libsqlite/src/parse.y"
2106{yygotominor.yy179 = yymsp[0].minor.yy179;}
2107#line 2108 "ext/sqlite/libsqlite/src/parse.c"
2108        break;
2109      case 102: /* select ::= select multiselect_op oneselect */
2110#line 291 "ext/sqlite/libsqlite/src/parse.y"
2111{
2112  if( yymsp[0].minor.yy179 ){
2113    yymsp[0].minor.yy179->op = yymsp[-1].minor.yy372;
2114    yymsp[0].minor.yy179->pPrior = yymsp[-2].minor.yy179;
2115  }
2116  yygotominor.yy179 = yymsp[0].minor.yy179;
2117}
2118#line 2119 "ext/sqlite/libsqlite/src/parse.c"
2119        break;
2120      case 103: /* multiselect_op ::= UNION */
2121#line 299 "ext/sqlite/libsqlite/src/parse.y"
2122{yygotominor.yy372 = TK_UNION;}
2123#line 2124 "ext/sqlite/libsqlite/src/parse.c"
2124        break;
2125      case 104: /* multiselect_op ::= UNION ALL */
2126#line 300 "ext/sqlite/libsqlite/src/parse.y"
2127{yygotominor.yy372 = TK_ALL;}
2128#line 2129 "ext/sqlite/libsqlite/src/parse.c"
2129        break;
2130      case 105: /* multiselect_op ::= INTERSECT */
2131#line 301 "ext/sqlite/libsqlite/src/parse.y"
2132{yygotominor.yy372 = TK_INTERSECT;}
2133#line 2134 "ext/sqlite/libsqlite/src/parse.c"
2134        break;
2135      case 106: /* multiselect_op ::= EXCEPT */
2136#line 302 "ext/sqlite/libsqlite/src/parse.y"
2137{yygotominor.yy372 = TK_EXCEPT;}
2138#line 2139 "ext/sqlite/libsqlite/src/parse.c"
2139        break;
2140      case 107: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
2141#line 304 "ext/sqlite/libsqlite/src/parse.y"
2142{
2143  yygotominor.yy179 = sqliteSelectNew(yymsp[-6].minor.yy322,yymsp[-5].minor.yy307,yymsp[-4].minor.yy242,yymsp[-3].minor.yy322,yymsp[-2].minor.yy242,yymsp[-1].minor.yy322,yymsp[-7].minor.yy372,yymsp[0].minor.yy124.limit,yymsp[0].minor.yy124.offset);
2144}
2145#line 2146 "ext/sqlite/libsqlite/src/parse.c"
2146        break;
2147      case 111: /* sclp ::= selcollist COMMA */
2148#line 325 "ext/sqlite/libsqlite/src/parse.y"
2149{yygotominor.yy322 = yymsp[-1].minor.yy322;}
2150#line 2151 "ext/sqlite/libsqlite/src/parse.c"
2151        break;
2152      case 112: /* sclp ::= */
2153      case 138: /* orderby_opt ::= */ yytestcase(yyruleno==138);
2154      case 148: /* groupby_opt ::= */ yytestcase(yyruleno==148);
2155#line 326 "ext/sqlite/libsqlite/src/parse.y"
2156{yygotominor.yy322 = 0;}
2157#line 2158 "ext/sqlite/libsqlite/src/parse.c"
2158        break;
2159      case 113: /* selcollist ::= sclp expr as */
2160#line 327 "ext/sqlite/libsqlite/src/parse.y"
2161{
2162   yygotominor.yy322 = sqliteExprListAppend(yymsp[-2].minor.yy322,yymsp[-1].minor.yy242,yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
2163}
2164#line 2165 "ext/sqlite/libsqlite/src/parse.c"
2165        break;
2166      case 114: /* selcollist ::= sclp STAR */
2167#line 330 "ext/sqlite/libsqlite/src/parse.y"
2168{
2169  yygotominor.yy322 = sqliteExprListAppend(yymsp[-1].minor.yy322, sqliteExpr(TK_ALL, 0, 0, 0), 0);
2170}
2171#line 2172 "ext/sqlite/libsqlite/src/parse.c"
2172        break;
2173      case 115: /* selcollist ::= sclp nm DOT STAR */
2174#line 333 "ext/sqlite/libsqlite/src/parse.y"
2175{
2176  Expr *pRight = sqliteExpr(TK_ALL, 0, 0, 0);
2177  Expr *pLeft = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy0);
2178  yygotominor.yy322 = sqliteExprListAppend(yymsp[-3].minor.yy322, sqliteExpr(TK_DOT, pLeft, pRight, 0), 0);
2179}
2180#line 2181 "ext/sqlite/libsqlite/src/parse.c"
2181        break;
2182      case 116: /* as ::= AS nm */
2183      case 117: /* as ::= ids */ yytestcase(yyruleno==117);
2184      case 288: /* key_opt ::= USING ids */ yytestcase(yyruleno==288);
2185#line 343 "ext/sqlite/libsqlite/src/parse.y"
2186{ yygotominor.yy0 = yymsp[0].minor.yy0; }
2187#line 2188 "ext/sqlite/libsqlite/src/parse.c"
2188        break;
2189      case 118: /* as ::= */
2190#line 345 "ext/sqlite/libsqlite/src/parse.y"
2191{ yygotominor.yy0.n = 0; }
2192#line 2193 "ext/sqlite/libsqlite/src/parse.c"
2193        break;
2194      case 119: /* from ::= */
2195#line 357 "ext/sqlite/libsqlite/src/parse.y"
2196{yygotominor.yy307 = sqliteMalloc(sizeof(*yygotominor.yy307));}
2197#line 2198 "ext/sqlite/libsqlite/src/parse.c"
2198        break;
2199      case 120: /* from ::= FROM seltablist */
2200#line 358 "ext/sqlite/libsqlite/src/parse.y"
2201{yygotominor.yy307 = yymsp[0].minor.yy307;}
2202#line 2203 "ext/sqlite/libsqlite/src/parse.c"
2203        break;
2204      case 121: /* stl_prefix ::= seltablist joinop */
2205#line 363 "ext/sqlite/libsqlite/src/parse.y"
2206{
2207   yygotominor.yy307 = yymsp[-1].minor.yy307;
2208   if( yygotominor.yy307 && yygotominor.yy307->nSrc>0 ) yygotominor.yy307->a[yygotominor.yy307->nSrc-1].jointype = yymsp[0].minor.yy372;
2209}
2210#line 2211 "ext/sqlite/libsqlite/src/parse.c"
2211        break;
2212      case 122: /* stl_prefix ::= */
2213#line 367 "ext/sqlite/libsqlite/src/parse.y"
2214{yygotominor.yy307 = 0;}
2215#line 2216 "ext/sqlite/libsqlite/src/parse.c"
2216        break;
2217      case 123: /* seltablist ::= stl_prefix nm dbnm as on_opt using_opt */
2218#line 368 "ext/sqlite/libsqlite/src/parse.y"
2219{
2220  yygotominor.yy307 = sqliteSrcListAppend(yymsp[-5].minor.yy307,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0);
2221  if( yymsp[-2].minor.yy0.n ) sqliteSrcListAddAlias(yygotominor.yy307,&yymsp[-2].minor.yy0);
2222  if( yymsp[-1].minor.yy242 ){
2223    if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pOn = yymsp[-1].minor.yy242; }
2224    else { sqliteExprDelete(yymsp[-1].minor.yy242); }
2225  }
2226  if( yymsp[0].minor.yy320 ){
2227    if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pUsing = yymsp[0].minor.yy320; }
2228    else { sqliteIdListDelete(yymsp[0].minor.yy320); }
2229  }
2230}
2231#line 2232 "ext/sqlite/libsqlite/src/parse.c"
2232        break;
2233      case 124: /* seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt */
2234#line 381 "ext/sqlite/libsqlite/src/parse.y"
2235{
2236  yygotominor.yy307 = sqliteSrcListAppend(yymsp[-6].minor.yy307,0,0);
2237  yygotominor.yy307->a[yygotominor.yy307->nSrc-1].pSelect = yymsp[-4].minor.yy179;
2238  if( yymsp[-2].minor.yy0.n ) sqliteSrcListAddAlias(yygotominor.yy307,&yymsp[-2].minor.yy0);
2239  if( yymsp[-1].minor.yy242 ){
2240    if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pOn = yymsp[-1].minor.yy242; }
2241    else { sqliteExprDelete(yymsp[-1].minor.yy242); }
2242  }
2243  if( yymsp[0].minor.yy320 ){
2244    if( yygotominor.yy307 && yygotominor.yy307->nSrc>1 ){ yygotominor.yy307->a[yygotominor.yy307->nSrc-2].pUsing = yymsp[0].minor.yy320; }
2245    else { sqliteIdListDelete(yymsp[0].minor.yy320); }
2246  }
2247}
2248#line 2249 "ext/sqlite/libsqlite/src/parse.c"
2249        break;
2250      case 126: /* seltablist_paren ::= seltablist */
2251#line 402 "ext/sqlite/libsqlite/src/parse.y"
2252{
2253   yygotominor.yy179 = sqliteSelectNew(0,yymsp[0].minor.yy307,0,0,0,0,0,-1,0);
2254}
2255#line 2256 "ext/sqlite/libsqlite/src/parse.c"
2256        break;
2257      case 127: /* dbnm ::= */
2258#line 407 "ext/sqlite/libsqlite/src/parse.y"
2259{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
2260#line 2261 "ext/sqlite/libsqlite/src/parse.c"
2261        break;
2262      case 129: /* joinop ::= COMMA */
2263      case 130: /* joinop ::= JOIN */ yytestcase(yyruleno==130);
2264#line 412 "ext/sqlite/libsqlite/src/parse.y"
2265{ yygotominor.yy372 = JT_INNER; }
2266#line 2267 "ext/sqlite/libsqlite/src/parse.c"
2267        break;
2268      case 131: /* joinop ::= JOIN_KW JOIN */
2269#line 414 "ext/sqlite/libsqlite/src/parse.y"
2270{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
2271#line 2272 "ext/sqlite/libsqlite/src/parse.c"
2272        break;
2273      case 132: /* joinop ::= JOIN_KW nm JOIN */
2274#line 415 "ext/sqlite/libsqlite/src/parse.y"
2275{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
2276#line 2277 "ext/sqlite/libsqlite/src/parse.c"
2277        break;
2278      case 133: /* joinop ::= JOIN_KW nm nm JOIN */
2279#line 417 "ext/sqlite/libsqlite/src/parse.y"
2280{ yygotominor.yy372 = sqliteJoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
2281#line 2282 "ext/sqlite/libsqlite/src/parse.c"
2282        break;
2283      case 134: /* on_opt ::= ON expr */
2284      case 142: /* sortitem ::= expr */ yytestcase(yyruleno==142);
2285      case 151: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==151);
2286      case 158: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==158);
2287      case 227: /* case_else ::= ELSE expr */ yytestcase(yyruleno==227);
2288      case 229: /* case_operand ::= expr */ yytestcase(yyruleno==229);
2289      case 233: /* expritem ::= expr */ yytestcase(yyruleno==233);
2290#line 421 "ext/sqlite/libsqlite/src/parse.y"
2291{yygotominor.yy242 = yymsp[0].minor.yy242;}
2292#line 2293 "ext/sqlite/libsqlite/src/parse.c"
2293        break;
2294      case 135: /* on_opt ::= */
2295      case 150: /* having_opt ::= */ yytestcase(yyruleno==150);
2296      case 157: /* where_opt ::= */ yytestcase(yyruleno==157);
2297      case 228: /* case_else ::= */ yytestcase(yyruleno==228);
2298      case 230: /* case_operand ::= */ yytestcase(yyruleno==230);
2299      case 234: /* expritem ::= */ yytestcase(yyruleno==234);
2300#line 422 "ext/sqlite/libsqlite/src/parse.y"
2301{yygotominor.yy242 = 0;}
2302#line 2303 "ext/sqlite/libsqlite/src/parse.c"
2303        break;
2304      case 136: /* using_opt ::= USING LP idxlist RP */
2305      case 169: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==169);
2306      case 239: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==239);
2307#line 426 "ext/sqlite/libsqlite/src/parse.y"
2308{yygotominor.yy320 = yymsp[-1].minor.yy320;}
2309#line 2310 "ext/sqlite/libsqlite/src/parse.c"
2310        break;
2311      case 137: /* using_opt ::= */
2312      case 168: /* inscollist_opt ::= */ yytestcase(yyruleno==168);
2313      case 238: /* idxlist_opt ::= */ yytestcase(yyruleno==238);
2314#line 427 "ext/sqlite/libsqlite/src/parse.y"
2315{yygotominor.yy320 = 0;}
2316#line 2317 "ext/sqlite/libsqlite/src/parse.c"
2317        break;
2318      case 139: /* orderby_opt ::= ORDER BY sortlist */
2319      case 149: /* groupby_opt ::= GROUP BY exprlist */ yytestcase(yyruleno==149);
2320#line 438 "ext/sqlite/libsqlite/src/parse.y"
2321{yygotominor.yy322 = yymsp[0].minor.yy322;}
2322#line 2323 "ext/sqlite/libsqlite/src/parse.c"
2323        break;
2324      case 140: /* sortlist ::= sortlist COMMA sortitem collate sortorder */
2325#line 439 "ext/sqlite/libsqlite/src/parse.y"
2326{
2327  yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322,yymsp[-2].minor.yy242,0);
2328  if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = yymsp[-1].minor.yy372+yymsp[0].minor.yy372;
2329}
2330#line 2331 "ext/sqlite/libsqlite/src/parse.c"
2331        break;
2332      case 141: /* sortlist ::= sortitem collate sortorder */
2333#line 443 "ext/sqlite/libsqlite/src/parse.y"
2334{
2335  yygotominor.yy322 = sqliteExprListAppend(0,yymsp[-2].minor.yy242,0);
2336  if( yygotominor.yy322 ) yygotominor.yy322->a[0].sortOrder = yymsp[-1].minor.yy372+yymsp[0].minor.yy372;
2337}
2338#line 2339 "ext/sqlite/libsqlite/src/parse.c"
2339        break;
2340      case 143: /* sortorder ::= ASC */
2341      case 145: /* sortorder ::= */ yytestcase(yyruleno==145);
2342#line 452 "ext/sqlite/libsqlite/src/parse.y"
2343{yygotominor.yy372 = SQLITE_SO_ASC;}
2344#line 2345 "ext/sqlite/libsqlite/src/parse.c"
2345        break;
2346      case 144: /* sortorder ::= DESC */
2347#line 453 "ext/sqlite/libsqlite/src/parse.y"
2348{yygotominor.yy372 = SQLITE_SO_DESC;}
2349#line 2350 "ext/sqlite/libsqlite/src/parse.c"
2350        break;
2351      case 146: /* collate ::= */
2352#line 455 "ext/sqlite/libsqlite/src/parse.y"
2353{yygotominor.yy372 = SQLITE_SO_UNK;}
2354#line 2355 "ext/sqlite/libsqlite/src/parse.c"
2355        break;
2356      case 147: /* collate ::= COLLATE id */
2357#line 456 "ext/sqlite/libsqlite/src/parse.y"
2358{yygotominor.yy372 = sqliteCollateType(yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);}
2359#line 2360 "ext/sqlite/libsqlite/src/parse.c"
2360        break;
2361      case 152: /* limit_opt ::= */
2362#line 469 "ext/sqlite/libsqlite/src/parse.y"
2363{yygotominor.yy124.limit = -1; yygotominor.yy124.offset = 0;}
2364#line 2365 "ext/sqlite/libsqlite/src/parse.c"
2365        break;
2366      case 153: /* limit_opt ::= LIMIT signed */
2367#line 470 "ext/sqlite/libsqlite/src/parse.y"
2368{yygotominor.yy124.limit = yymsp[0].minor.yy372; yygotominor.yy124.offset = 0;}
2369#line 2370 "ext/sqlite/libsqlite/src/parse.c"
2370        break;
2371      case 154: /* limit_opt ::= LIMIT signed OFFSET signed */
2372#line 472 "ext/sqlite/libsqlite/src/parse.y"
2373{yygotominor.yy124.limit = yymsp[-2].minor.yy372; yygotominor.yy124.offset = yymsp[0].minor.yy372;}
2374#line 2375 "ext/sqlite/libsqlite/src/parse.c"
2375        break;
2376      case 155: /* limit_opt ::= LIMIT signed COMMA signed */
2377#line 474 "ext/sqlite/libsqlite/src/parse.y"
2378{yygotominor.yy124.limit = yymsp[0].minor.yy372; yygotominor.yy124.offset = yymsp[-2].minor.yy372;}
2379#line 2380 "ext/sqlite/libsqlite/src/parse.c"
2380        break;
2381      case 156: /* cmd ::= DELETE FROM nm dbnm where_opt */
2382#line 478 "ext/sqlite/libsqlite/src/parse.y"
2383{
2384   sqliteDeleteFrom(pParse, sqliteSrcListAppend(0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0), yymsp[0].minor.yy242);
2385}
2386#line 2387 "ext/sqlite/libsqlite/src/parse.c"
2387        break;
2388      case 159: /* cmd ::= UPDATE orconf nm dbnm SET setlist where_opt */
2389#line 494 "ext/sqlite/libsqlite/src/parse.y"
2390{sqliteUpdate(pParse,sqliteSrcListAppend(0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0),yymsp[-1].minor.yy322,yymsp[0].minor.yy242,yymsp[-5].minor.yy372);}
2391#line 2392 "ext/sqlite/libsqlite/src/parse.c"
2392        break;
2393      case 160: /* setlist ::= setlist COMMA nm EQ expr */
2394#line 497 "ext/sqlite/libsqlite/src/parse.y"
2395{yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322,yymsp[0].minor.yy242,&yymsp[-2].minor.yy0);}
2396#line 2397 "ext/sqlite/libsqlite/src/parse.c"
2397        break;
2398      case 161: /* setlist ::= nm EQ expr */
2399#line 498 "ext/sqlite/libsqlite/src/parse.y"
2400{yygotominor.yy322 = sqliteExprListAppend(0,yymsp[0].minor.yy242,&yymsp[-2].minor.yy0);}
2401#line 2402 "ext/sqlite/libsqlite/src/parse.c"
2402        break;
2403      case 162: /* cmd ::= insert_cmd INTO nm dbnm inscollist_opt VALUES LP itemlist RP */
2404#line 504 "ext/sqlite/libsqlite/src/parse.y"
2405{sqliteInsert(pParse, sqliteSrcListAppend(0,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0), yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy320, yymsp[-8].minor.yy372);}
2406#line 2407 "ext/sqlite/libsqlite/src/parse.c"
2407        break;
2408      case 163: /* cmd ::= insert_cmd INTO nm dbnm inscollist_opt select */
2409#line 506 "ext/sqlite/libsqlite/src/parse.y"
2410{sqliteInsert(pParse, sqliteSrcListAppend(0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0), 0, yymsp[0].minor.yy179, yymsp[-1].minor.yy320, yymsp[-5].minor.yy372);}
2411#line 2412 "ext/sqlite/libsqlite/src/parse.c"
2412        break;
2413      case 165: /* insert_cmd ::= REPLACE */
2414#line 510 "ext/sqlite/libsqlite/src/parse.y"
2415{yygotominor.yy372 = OE_Replace;}
2416#line 2417 "ext/sqlite/libsqlite/src/parse.c"
2417        break;
2418      case 166: /* itemlist ::= itemlist COMMA expr */
2419      case 231: /* exprlist ::= exprlist COMMA expritem */ yytestcase(yyruleno==231);
2420#line 516 "ext/sqlite/libsqlite/src/parse.y"
2421{yygotominor.yy322 = sqliteExprListAppend(yymsp[-2].minor.yy322,yymsp[0].minor.yy242,0);}
2422#line 2423 "ext/sqlite/libsqlite/src/parse.c"
2423        break;
2424      case 167: /* itemlist ::= expr */
2425      case 232: /* exprlist ::= expritem */ yytestcase(yyruleno==232);
2426#line 517 "ext/sqlite/libsqlite/src/parse.y"
2427{yygotominor.yy322 = sqliteExprListAppend(0,yymsp[0].minor.yy242,0);}
2428#line 2429 "ext/sqlite/libsqlite/src/parse.c"
2429        break;
2430      case 170: /* inscollist ::= inscollist COMMA nm */
2431      case 240: /* idxlist ::= idxlist COMMA idxitem */ yytestcase(yyruleno==240);
2432#line 526 "ext/sqlite/libsqlite/src/parse.y"
2433{yygotominor.yy320 = sqliteIdListAppend(yymsp[-2].minor.yy320,&yymsp[0].minor.yy0);}
2434#line 2435 "ext/sqlite/libsqlite/src/parse.c"
2435        break;
2436      case 171: /* inscollist ::= nm */
2437      case 241: /* idxlist ::= idxitem */ yytestcase(yyruleno==241);
2438#line 527 "ext/sqlite/libsqlite/src/parse.y"
2439{yygotominor.yy320 = sqliteIdListAppend(0,&yymsp[0].minor.yy0);}
2440#line 2441 "ext/sqlite/libsqlite/src/parse.c"
2441        break;
2442      case 172: /* expr ::= LP expr RP */
2443#line 535 "ext/sqlite/libsqlite/src/parse.y"
2444{yygotominor.yy242 = yymsp[-1].minor.yy242; sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); }
2445#line 2446 "ext/sqlite/libsqlite/src/parse.c"
2446        break;
2447      case 173: /* expr ::= NULL */
2448#line 536 "ext/sqlite/libsqlite/src/parse.y"
2449{yygotominor.yy242 = sqliteExpr(TK_NULL, 0, 0, &yymsp[0].minor.yy0);}
2450#line 2451 "ext/sqlite/libsqlite/src/parse.c"
2451        break;
2452      case 174: /* expr ::= ID */
2453      case 175: /* expr ::= JOIN_KW */ yytestcase(yyruleno==175);
2454#line 537 "ext/sqlite/libsqlite/src/parse.y"
2455{yygotominor.yy242 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0);}
2456#line 2457 "ext/sqlite/libsqlite/src/parse.c"
2457        break;
2458      case 176: /* expr ::= nm DOT nm */
2459#line 539 "ext/sqlite/libsqlite/src/parse.y"
2460{
2461  Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy0);
2462  Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0);
2463  yygotominor.yy242 = sqliteExpr(TK_DOT, temp1, temp2, 0);
2464}
2465#line 2466 "ext/sqlite/libsqlite/src/parse.c"
2466        break;
2467      case 177: /* expr ::= nm DOT nm DOT nm */
2468#line 544 "ext/sqlite/libsqlite/src/parse.y"
2469{
2470  Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &yymsp[-4].minor.yy0);
2471  Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy0);
2472  Expr *temp3 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0);
2473  Expr *temp4 = sqliteExpr(TK_DOT, temp2, temp3, 0);
2474  yygotominor.yy242 = sqliteExpr(TK_DOT, temp1, temp4, 0);
2475}
2476#line 2477 "ext/sqlite/libsqlite/src/parse.c"
2477        break;
2478      case 178: /* expr ::= INTEGER */
2479#line 551 "ext/sqlite/libsqlite/src/parse.y"
2480{yygotominor.yy242 = sqliteExpr(TK_INTEGER, 0, 0, &yymsp[0].minor.yy0);}
2481#line 2482 "ext/sqlite/libsqlite/src/parse.c"
2482        break;
2483      case 179: /* expr ::= FLOAT */
2484#line 552 "ext/sqlite/libsqlite/src/parse.y"
2485{yygotominor.yy242 = sqliteExpr(TK_FLOAT, 0, 0, &yymsp[0].minor.yy0);}
2486#line 2487 "ext/sqlite/libsqlite/src/parse.c"
2487        break;
2488      case 180: /* expr ::= STRING */
2489#line 553 "ext/sqlite/libsqlite/src/parse.y"
2490{yygotominor.yy242 = sqliteExpr(TK_STRING, 0, 0, &yymsp[0].minor.yy0);}
2491#line 2492 "ext/sqlite/libsqlite/src/parse.c"
2492        break;
2493      case 181: /* expr ::= VARIABLE */
2494#line 554 "ext/sqlite/libsqlite/src/parse.y"
2495{
2496  yygotominor.yy242 = sqliteExpr(TK_VARIABLE, 0, 0, &yymsp[0].minor.yy0);
2497  if( yygotominor.yy242 ) yygotominor.yy242->iTable = ++pParse->nVar;
2498}
2499#line 2500 "ext/sqlite/libsqlite/src/parse.c"
2500        break;
2501      case 182: /* expr ::= ID LP exprlist RP */
2502#line 558 "ext/sqlite/libsqlite/src/parse.y"
2503{
2504  yygotominor.yy242 = sqliteExprFunction(yymsp[-1].minor.yy322, &yymsp[-3].minor.yy0);
2505  sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
2506}
2507#line 2508 "ext/sqlite/libsqlite/src/parse.c"
2508        break;
2509      case 183: /* expr ::= ID LP STAR RP */
2510#line 562 "ext/sqlite/libsqlite/src/parse.y"
2511{
2512  yygotominor.yy242 = sqliteExprFunction(0, &yymsp[-3].minor.yy0);
2513  sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
2514}
2515#line 2516 "ext/sqlite/libsqlite/src/parse.c"
2516        break;
2517      case 184: /* expr ::= expr AND expr */
2518#line 566 "ext/sqlite/libsqlite/src/parse.y"
2519{yygotominor.yy242 = sqliteExpr(TK_AND, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2520#line 2521 "ext/sqlite/libsqlite/src/parse.c"
2521        break;
2522      case 185: /* expr ::= expr OR expr */
2523#line 567 "ext/sqlite/libsqlite/src/parse.y"
2524{yygotominor.yy242 = sqliteExpr(TK_OR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2525#line 2526 "ext/sqlite/libsqlite/src/parse.c"
2526        break;
2527      case 186: /* expr ::= expr LT expr */
2528#line 568 "ext/sqlite/libsqlite/src/parse.y"
2529{yygotominor.yy242 = sqliteExpr(TK_LT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2530#line 2531 "ext/sqlite/libsqlite/src/parse.c"
2531        break;
2532      case 187: /* expr ::= expr GT expr */
2533#line 569 "ext/sqlite/libsqlite/src/parse.y"
2534{yygotominor.yy242 = sqliteExpr(TK_GT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2535#line 2536 "ext/sqlite/libsqlite/src/parse.c"
2536        break;
2537      case 188: /* expr ::= expr LE expr */
2538#line 570 "ext/sqlite/libsqlite/src/parse.y"
2539{yygotominor.yy242 = sqliteExpr(TK_LE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2540#line 2541 "ext/sqlite/libsqlite/src/parse.c"
2541        break;
2542      case 189: /* expr ::= expr GE expr */
2543#line 571 "ext/sqlite/libsqlite/src/parse.y"
2544{yygotominor.yy242 = sqliteExpr(TK_GE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2545#line 2546 "ext/sqlite/libsqlite/src/parse.c"
2546        break;
2547      case 190: /* expr ::= expr NE expr */
2548#line 572 "ext/sqlite/libsqlite/src/parse.y"
2549{yygotominor.yy242 = sqliteExpr(TK_NE, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2550#line 2551 "ext/sqlite/libsqlite/src/parse.c"
2551        break;
2552      case 191: /* expr ::= expr EQ expr */
2553#line 573 "ext/sqlite/libsqlite/src/parse.y"
2554{yygotominor.yy242 = sqliteExpr(TK_EQ, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2555#line 2556 "ext/sqlite/libsqlite/src/parse.c"
2556        break;
2557      case 192: /* expr ::= expr BITAND expr */
2558#line 574 "ext/sqlite/libsqlite/src/parse.y"
2559{yygotominor.yy242 = sqliteExpr(TK_BITAND, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2560#line 2561 "ext/sqlite/libsqlite/src/parse.c"
2561        break;
2562      case 193: /* expr ::= expr BITOR expr */
2563#line 575 "ext/sqlite/libsqlite/src/parse.y"
2564{yygotominor.yy242 = sqliteExpr(TK_BITOR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2565#line 2566 "ext/sqlite/libsqlite/src/parse.c"
2566        break;
2567      case 194: /* expr ::= expr LSHIFT expr */
2568#line 576 "ext/sqlite/libsqlite/src/parse.y"
2569{yygotominor.yy242 = sqliteExpr(TK_LSHIFT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2570#line 2571 "ext/sqlite/libsqlite/src/parse.c"
2571        break;
2572      case 195: /* expr ::= expr RSHIFT expr */
2573#line 577 "ext/sqlite/libsqlite/src/parse.y"
2574{yygotominor.yy242 = sqliteExpr(TK_RSHIFT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2575#line 2576 "ext/sqlite/libsqlite/src/parse.c"
2576        break;
2577      case 196: /* expr ::= expr likeop expr */
2578#line 578 "ext/sqlite/libsqlite/src/parse.y"
2579{
2580  ExprList *pList = sqliteExprListAppend(0, yymsp[0].minor.yy242, 0);
2581  pList = sqliteExprListAppend(pList, yymsp[-2].minor.yy242, 0);
2582  yygotominor.yy242 = sqliteExprFunction(pList, 0);
2583  if( yygotominor.yy242 ) yygotominor.yy242->op = yymsp[-1].minor.yy372;
2584  sqliteExprSpan(yygotominor.yy242, &yymsp[-2].minor.yy242->span, &yymsp[0].minor.yy242->span);
2585}
2586#line 2587 "ext/sqlite/libsqlite/src/parse.c"
2587        break;
2588      case 197: /* expr ::= expr NOT likeop expr */
2589#line 585 "ext/sqlite/libsqlite/src/parse.y"
2590{
2591  ExprList *pList = sqliteExprListAppend(0, yymsp[0].minor.yy242, 0);
2592  pList = sqliteExprListAppend(pList, yymsp[-3].minor.yy242, 0);
2593  yygotominor.yy242 = sqliteExprFunction(pList, 0);
2594  if( yygotominor.yy242 ) yygotominor.yy242->op = yymsp[-1].minor.yy372;
2595  yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0);
2596  sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,&yymsp[0].minor.yy242->span);
2597}
2598#line 2599 "ext/sqlite/libsqlite/src/parse.c"
2599        break;
2600      case 198: /* likeop ::= LIKE */
2601#line 594 "ext/sqlite/libsqlite/src/parse.y"
2602{yygotominor.yy372 = TK_LIKE;}
2603#line 2604 "ext/sqlite/libsqlite/src/parse.c"
2604        break;
2605      case 199: /* likeop ::= GLOB */
2606#line 595 "ext/sqlite/libsqlite/src/parse.y"
2607{yygotominor.yy372 = TK_GLOB;}
2608#line 2609 "ext/sqlite/libsqlite/src/parse.c"
2609        break;
2610      case 200: /* expr ::= expr PLUS expr */
2611#line 596 "ext/sqlite/libsqlite/src/parse.y"
2612{yygotominor.yy242 = sqliteExpr(TK_PLUS, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2613#line 2614 "ext/sqlite/libsqlite/src/parse.c"
2614        break;
2615      case 201: /* expr ::= expr MINUS expr */
2616#line 597 "ext/sqlite/libsqlite/src/parse.y"
2617{yygotominor.yy242 = sqliteExpr(TK_MINUS, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2618#line 2619 "ext/sqlite/libsqlite/src/parse.c"
2619        break;
2620      case 202: /* expr ::= expr STAR expr */
2621#line 598 "ext/sqlite/libsqlite/src/parse.y"
2622{yygotominor.yy242 = sqliteExpr(TK_STAR, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2623#line 2624 "ext/sqlite/libsqlite/src/parse.c"
2624        break;
2625      case 203: /* expr ::= expr SLASH expr */
2626#line 599 "ext/sqlite/libsqlite/src/parse.y"
2627{yygotominor.yy242 = sqliteExpr(TK_SLASH, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2628#line 2629 "ext/sqlite/libsqlite/src/parse.c"
2629        break;
2630      case 204: /* expr ::= expr REM expr */
2631#line 600 "ext/sqlite/libsqlite/src/parse.y"
2632{yygotominor.yy242 = sqliteExpr(TK_REM, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2633#line 2634 "ext/sqlite/libsqlite/src/parse.c"
2634        break;
2635      case 205: /* expr ::= expr CONCAT expr */
2636#line 601 "ext/sqlite/libsqlite/src/parse.y"
2637{yygotominor.yy242 = sqliteExpr(TK_CONCAT, yymsp[-2].minor.yy242, yymsp[0].minor.yy242, 0);}
2638#line 2639 "ext/sqlite/libsqlite/src/parse.c"
2639        break;
2640      case 206: /* expr ::= expr ISNULL */
2641#line 602 "ext/sqlite/libsqlite/src/parse.y"
2642{
2643  yygotominor.yy242 = sqliteExpr(TK_ISNULL, yymsp[-1].minor.yy242, 0, 0);
2644  sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy242->span,&yymsp[0].minor.yy0);
2645}
2646#line 2647 "ext/sqlite/libsqlite/src/parse.c"
2647        break;
2648      case 207: /* expr ::= expr IS NULL */
2649#line 606 "ext/sqlite/libsqlite/src/parse.y"
2650{
2651  yygotominor.yy242 = sqliteExpr(TK_ISNULL, yymsp[-2].minor.yy242, 0, 0);
2652  sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy242->span,&yymsp[0].minor.yy0);
2653}
2654#line 2655 "ext/sqlite/libsqlite/src/parse.c"
2655        break;
2656      case 208: /* expr ::= expr NOTNULL */
2657#line 610 "ext/sqlite/libsqlite/src/parse.y"
2658{
2659  yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-1].minor.yy242, 0, 0);
2660  sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy242->span,&yymsp[0].minor.yy0);
2661}
2662#line 2663 "ext/sqlite/libsqlite/src/parse.c"
2663        break;
2664      case 209: /* expr ::= expr NOT NULL */
2665#line 614 "ext/sqlite/libsqlite/src/parse.y"
2666{
2667  yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-2].minor.yy242, 0, 0);
2668  sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy242->span,&yymsp[0].minor.yy0);
2669}
2670#line 2671 "ext/sqlite/libsqlite/src/parse.c"
2671        break;
2672      case 210: /* expr ::= expr IS NOT NULL */
2673#line 618 "ext/sqlite/libsqlite/src/parse.y"
2674{
2675  yygotominor.yy242 = sqliteExpr(TK_NOTNULL, yymsp[-3].minor.yy242, 0, 0);
2676  sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,&yymsp[0].minor.yy0);
2677}
2678#line 2679 "ext/sqlite/libsqlite/src/parse.c"
2679        break;
2680      case 211: /* expr ::= NOT expr */
2681#line 622 "ext/sqlite/libsqlite/src/parse.y"
2682{
2683  yygotominor.yy242 = sqliteExpr(TK_NOT, yymsp[0].minor.yy242, 0, 0);
2684  sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span);
2685}
2686#line 2687 "ext/sqlite/libsqlite/src/parse.c"
2687        break;
2688      case 212: /* expr ::= BITNOT expr */
2689#line 626 "ext/sqlite/libsqlite/src/parse.y"
2690{
2691  yygotominor.yy242 = sqliteExpr(TK_BITNOT, yymsp[0].minor.yy242, 0, 0);
2692  sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span);
2693}
2694#line 2695 "ext/sqlite/libsqlite/src/parse.c"
2695        break;
2696      case 213: /* expr ::= MINUS expr */
2697#line 630 "ext/sqlite/libsqlite/src/parse.y"
2698{
2699  yygotominor.yy242 = sqliteExpr(TK_UMINUS, yymsp[0].minor.yy242, 0, 0);
2700  sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span);
2701}
2702#line 2703 "ext/sqlite/libsqlite/src/parse.c"
2703        break;
2704      case 214: /* expr ::= PLUS expr */
2705#line 634 "ext/sqlite/libsqlite/src/parse.y"
2706{
2707  yygotominor.yy242 = sqliteExpr(TK_UPLUS, yymsp[0].minor.yy242, 0, 0);
2708  sqliteExprSpan(yygotominor.yy242,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy242->span);
2709}
2710#line 2711 "ext/sqlite/libsqlite/src/parse.c"
2711        break;
2712      case 215: /* expr ::= LP select RP */
2713#line 638 "ext/sqlite/libsqlite/src/parse.y"
2714{
2715  yygotominor.yy242 = sqliteExpr(TK_SELECT, 0, 0, 0);
2716  if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179;
2717  sqliteExprSpan(yygotominor.yy242,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
2718}
2719#line 2720 "ext/sqlite/libsqlite/src/parse.c"
2720        break;
2721      case 216: /* expr ::= expr BETWEEN expr AND expr */
2722#line 643 "ext/sqlite/libsqlite/src/parse.y"
2723{
2724  ExprList *pList = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0);
2725  pList = sqliteExprListAppend(pList, yymsp[0].minor.yy242, 0);
2726  yygotominor.yy242 = sqliteExpr(TK_BETWEEN, yymsp[-4].minor.yy242, 0, 0);
2727  if( yygotominor.yy242 ) yygotominor.yy242->pList = pList;
2728  sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy242->span);
2729}
2730#line 2731 "ext/sqlite/libsqlite/src/parse.c"
2731        break;
2732      case 217: /* expr ::= expr NOT BETWEEN expr AND expr */
2733#line 650 "ext/sqlite/libsqlite/src/parse.y"
2734{
2735  ExprList *pList = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0);
2736  pList = sqliteExprListAppend(pList, yymsp[0].minor.yy242, 0);
2737  yygotominor.yy242 = sqliteExpr(TK_BETWEEN, yymsp[-5].minor.yy242, 0, 0);
2738  if( yygotominor.yy242 ) yygotominor.yy242->pList = pList;
2739  yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0);
2740  sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy242->span);
2741}
2742#line 2743 "ext/sqlite/libsqlite/src/parse.c"
2743        break;
2744      case 218: /* expr ::= expr IN LP exprlist RP */
2745#line 658 "ext/sqlite/libsqlite/src/parse.y"
2746{
2747  yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0);
2748  if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-1].minor.yy322;
2749  sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy0);
2750}
2751#line 2752 "ext/sqlite/libsqlite/src/parse.c"
2752        break;
2753      case 219: /* expr ::= expr IN LP select RP */
2754#line 663 "ext/sqlite/libsqlite/src/parse.y"
2755{
2756  yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0);
2757  if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179;
2758  sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,&yymsp[0].minor.yy0);
2759}
2760#line 2761 "ext/sqlite/libsqlite/src/parse.c"
2761        break;
2762      case 220: /* expr ::= expr NOT IN LP exprlist RP */
2763#line 668 "ext/sqlite/libsqlite/src/parse.y"
2764{
2765  yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-5].minor.yy242, 0, 0);
2766  if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-1].minor.yy322;
2767  yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0);
2768  sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy0);
2769}
2770#line 2771 "ext/sqlite/libsqlite/src/parse.c"
2771        break;
2772      case 221: /* expr ::= expr NOT IN LP select RP */
2773#line 674 "ext/sqlite/libsqlite/src/parse.y"
2774{
2775  yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-5].minor.yy242, 0, 0);
2776  if( yygotominor.yy242 ) yygotominor.yy242->pSelect = yymsp[-1].minor.yy179;
2777  yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0);
2778  sqliteExprSpan(yygotominor.yy242,&yymsp[-5].minor.yy242->span,&yymsp[0].minor.yy0);
2779}
2780#line 2781 "ext/sqlite/libsqlite/src/parse.c"
2781        break;
2782      case 222: /* expr ::= expr IN nm dbnm */
2783#line 680 "ext/sqlite/libsqlite/src/parse.y"
2784{
2785  SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);
2786  yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-3].minor.yy242, 0, 0);
2787  if( yygotominor.yy242 ) yygotominor.yy242->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0);
2788  sqliteExprSpan(yygotominor.yy242,&yymsp[-3].minor.yy242->span,yymsp[0].minor.yy0.z?&yymsp[0].minor.yy0:&yymsp[-1].minor.yy0);
2789}
2790#line 2791 "ext/sqlite/libsqlite/src/parse.c"
2791        break;
2792      case 223: /* expr ::= expr NOT IN nm dbnm */
2793#line 686 "ext/sqlite/libsqlite/src/parse.y"
2794{
2795  SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);
2796  yygotominor.yy242 = sqliteExpr(TK_IN, yymsp[-4].minor.yy242, 0, 0);
2797  if( yygotominor.yy242 ) yygotominor.yy242->pSelect = sqliteSelectNew(0,pSrc,0,0,0,0,0,-1,0);
2798  yygotominor.yy242 = sqliteExpr(TK_NOT, yygotominor.yy242, 0, 0);
2799  sqliteExprSpan(yygotominor.yy242,&yymsp[-4].minor.yy242->span,yymsp[0].minor.yy0.z?&yymsp[0].minor.yy0:&yymsp[-1].minor.yy0);
2800}
2801#line 2802 "ext/sqlite/libsqlite/src/parse.c"
2802        break;
2803      case 224: /* expr ::= CASE case_operand case_exprlist case_else END */
2804#line 696 "ext/sqlite/libsqlite/src/parse.y"
2805{
2806  yygotominor.yy242 = sqliteExpr(TK_CASE, yymsp[-3].minor.yy242, yymsp[-1].minor.yy242, 0);
2807  if( yygotominor.yy242 ) yygotominor.yy242->pList = yymsp[-2].minor.yy322;
2808  sqliteExprSpan(yygotominor.yy242, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
2809}
2810#line 2811 "ext/sqlite/libsqlite/src/parse.c"
2811        break;
2812      case 225: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
2813#line 703 "ext/sqlite/libsqlite/src/parse.y"
2814{
2815  yygotominor.yy322 = sqliteExprListAppend(yymsp[-4].minor.yy322, yymsp[-2].minor.yy242, 0);
2816  yygotominor.yy322 = sqliteExprListAppend(yygotominor.yy322, yymsp[0].minor.yy242, 0);
2817}
2818#line 2819 "ext/sqlite/libsqlite/src/parse.c"
2819        break;
2820      case 226: /* case_exprlist ::= WHEN expr THEN expr */
2821#line 707 "ext/sqlite/libsqlite/src/parse.y"
2822{
2823  yygotominor.yy322 = sqliteExprListAppend(0, yymsp[-2].minor.yy242, 0);
2824  yygotominor.yy322 = sqliteExprListAppend(yygotominor.yy322, yymsp[0].minor.yy242, 0);
2825}
2826#line 2827 "ext/sqlite/libsqlite/src/parse.c"
2827        break;
2828      case 235: /* cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf */
2829#line 732 "ext/sqlite/libsqlite/src/parse.y"
2830{
2831  SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-5].minor.yy0, &yymsp[-4].minor.yy0);
2832  if( yymsp[-9].minor.yy372!=OE_None ) yymsp[-9].minor.yy372 = yymsp[0].minor.yy372;
2833  if( yymsp[-9].minor.yy372==OE_Default) yymsp[-9].minor.yy372 = OE_Abort;
2834  sqliteCreateIndex(pParse, &yymsp[-7].minor.yy0, pSrc, yymsp[-2].minor.yy320, yymsp[-9].minor.yy372, &yymsp[-10].minor.yy0, &yymsp[-1].minor.yy0);
2835}
2836#line 2837 "ext/sqlite/libsqlite/src/parse.c"
2837        break;
2838      case 237: /* uniqueflag ::= */
2839#line 741 "ext/sqlite/libsqlite/src/parse.y"
2840{ yygotominor.yy372 = OE_None; }
2841#line 2842 "ext/sqlite/libsqlite/src/parse.c"
2842        break;
2843      case 243: /* cmd ::= DROP INDEX nm dbnm */
2844#line 758 "ext/sqlite/libsqlite/src/parse.y"
2845{
2846  sqliteDropIndex(pParse, sqliteSrcListAppend(0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0));
2847}
2848#line 2849 "ext/sqlite/libsqlite/src/parse.c"
2849        break;
2850      case 244: /* cmd ::= COPY orconf nm dbnm FROM nm USING DELIMITERS STRING */
2851#line 766 "ext/sqlite/libsqlite/src/parse.y"
2852{sqliteCopy(pParse,sqliteSrcListAppend(0,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0),&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0,yymsp[-7].minor.yy372);}
2853#line 2854 "ext/sqlite/libsqlite/src/parse.c"
2854        break;
2855      case 245: /* cmd ::= COPY orconf nm dbnm FROM nm */
2856#line 768 "ext/sqlite/libsqlite/src/parse.y"
2857{sqliteCopy(pParse,sqliteSrcListAppend(0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0),&yymsp[0].minor.yy0,0,yymsp[-4].minor.yy372);}
2858#line 2859 "ext/sqlite/libsqlite/src/parse.c"
2859        break;
2860      case 246: /* cmd ::= VACUUM */
2861#line 772 "ext/sqlite/libsqlite/src/parse.y"
2862{sqliteVacuum(pParse,0);}
2863#line 2864 "ext/sqlite/libsqlite/src/parse.c"
2864        break;
2865      case 247: /* cmd ::= VACUUM nm */
2866#line 773 "ext/sqlite/libsqlite/src/parse.y"
2867{sqliteVacuum(pParse,&yymsp[0].minor.yy0);}
2868#line 2869 "ext/sqlite/libsqlite/src/parse.c"
2869        break;
2870      case 248: /* cmd ::= PRAGMA ids EQ nm */
2871      case 249: /* cmd ::= PRAGMA ids EQ ON */ yytestcase(yyruleno==249);
2872      case 250: /* cmd ::= PRAGMA ids EQ plus_num */ yytestcase(yyruleno==250);
2873#line 777 "ext/sqlite/libsqlite/src/parse.y"
2874{sqlitePragma(pParse,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
2875#line 2876 "ext/sqlite/libsqlite/src/parse.c"
2876        break;
2877      case 251: /* cmd ::= PRAGMA ids EQ minus_num */
2878#line 780 "ext/sqlite/libsqlite/src/parse.y"
2879{sqlitePragma(pParse,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
2880#line 2881 "ext/sqlite/libsqlite/src/parse.c"
2881        break;
2882      case 252: /* cmd ::= PRAGMA ids LP nm RP */
2883#line 781 "ext/sqlite/libsqlite/src/parse.y"
2884{sqlitePragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
2885#line 2886 "ext/sqlite/libsqlite/src/parse.c"
2886        break;
2887      case 253: /* cmd ::= PRAGMA ids */
2888#line 782 "ext/sqlite/libsqlite/src/parse.y"
2889{sqlitePragma(pParse,&yymsp[0].minor.yy0,&yymsp[0].minor.yy0,0);}
2890#line 2891 "ext/sqlite/libsqlite/src/parse.c"
2891        break;
2892      case 260: /* cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END */
2893#line 792 "ext/sqlite/libsqlite/src/parse.y"
2894{
2895  Token all;
2896  all.z = yymsp[-4].minor.yy0.z;
2897  all.n = (yymsp[0].minor.yy0.z - yymsp[-4].minor.yy0.z) + yymsp[0].minor.yy0.n;
2898  sqliteFinishTrigger(pParse, yymsp[-1].minor.yy19, &all);
2899}
2900#line 2901 "ext/sqlite/libsqlite/src/parse.c"
2901        break;
2902      case 261: /* trigger_decl ::= temp TRIGGER nm trigger_time trigger_event ON nm dbnm foreach_clause when_clause */
2903#line 800 "ext/sqlite/libsqlite/src/parse.y"
2904{
2905  SrcList *pTab = sqliteSrcListAppend(0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0);
2906  sqliteBeginTrigger(pParse, &yymsp[-7].minor.yy0, yymsp[-6].minor.yy372, yymsp[-5].minor.yy290.a, yymsp[-5].minor.yy290.b, pTab, yymsp[-1].minor.yy372, yymsp[0].minor.yy182, yymsp[-9].minor.yy372);
2907}
2908#line 2909 "ext/sqlite/libsqlite/src/parse.c"
2909        break;
2910      case 262: /* trigger_time ::= BEFORE */
2911      case 265: /* trigger_time ::= */ yytestcase(yyruleno==265);
2912#line 806 "ext/sqlite/libsqlite/src/parse.y"
2913{ yygotominor.yy372 = TK_BEFORE; }
2914#line 2915 "ext/sqlite/libsqlite/src/parse.c"
2915        break;
2916      case 263: /* trigger_time ::= AFTER */
2917#line 807 "ext/sqlite/libsqlite/src/parse.y"
2918{ yygotominor.yy372 = TK_AFTER;  }
2919#line 2920 "ext/sqlite/libsqlite/src/parse.c"
2920        break;
2921      case 264: /* trigger_time ::= INSTEAD OF */
2922#line 808 "ext/sqlite/libsqlite/src/parse.y"
2923{ yygotominor.yy372 = TK_INSTEAD;}
2924#line 2925 "ext/sqlite/libsqlite/src/parse.c"
2925        break;
2926      case 266: /* trigger_event ::= DELETE */
2927#line 813 "ext/sqlite/libsqlite/src/parse.y"
2928{ yygotominor.yy290.a = TK_DELETE; yygotominor.yy290.b = 0; }
2929#line 2930 "ext/sqlite/libsqlite/src/parse.c"
2930        break;
2931      case 267: /* trigger_event ::= INSERT */
2932#line 814 "ext/sqlite/libsqlite/src/parse.y"
2933{ yygotominor.yy290.a = TK_INSERT; yygotominor.yy290.b = 0; }
2934#line 2935 "ext/sqlite/libsqlite/src/parse.c"
2935        break;
2936      case 268: /* trigger_event ::= UPDATE */
2937#line 815 "ext/sqlite/libsqlite/src/parse.y"
2938{ yygotominor.yy290.a = TK_UPDATE; yygotominor.yy290.b = 0;}
2939#line 2940 "ext/sqlite/libsqlite/src/parse.c"
2940        break;
2941      case 269: /* trigger_event ::= UPDATE OF inscollist */
2942#line 816 "ext/sqlite/libsqlite/src/parse.y"
2943{yygotominor.yy290.a = TK_UPDATE; yygotominor.yy290.b = yymsp[0].minor.yy320; }
2944#line 2945 "ext/sqlite/libsqlite/src/parse.c"
2945        break;
2946      case 270: /* foreach_clause ::= */
2947      case 271: /* foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==271);
2948#line 819 "ext/sqlite/libsqlite/src/parse.y"
2949{ yygotominor.yy372 = TK_ROW; }
2950#line 2951 "ext/sqlite/libsqlite/src/parse.c"
2951        break;
2952      case 272: /* foreach_clause ::= FOR EACH STATEMENT */
2953#line 821 "ext/sqlite/libsqlite/src/parse.y"
2954{ yygotominor.yy372 = TK_STATEMENT; }
2955#line 2956 "ext/sqlite/libsqlite/src/parse.c"
2956        break;
2957      case 273: /* when_clause ::= */
2958#line 824 "ext/sqlite/libsqlite/src/parse.y"
2959{ yygotominor.yy182 = 0; }
2960#line 2961 "ext/sqlite/libsqlite/src/parse.c"
2961        break;
2962      case 274: /* when_clause ::= WHEN expr */
2963#line 825 "ext/sqlite/libsqlite/src/parse.y"
2964{ yygotominor.yy182 = yymsp[0].minor.yy242; }
2965#line 2966 "ext/sqlite/libsqlite/src/parse.c"
2966        break;
2967      case 275: /* trigger_cmd_list ::= trigger_cmd SEMI trigger_cmd_list */
2968#line 829 "ext/sqlite/libsqlite/src/parse.y"
2969{
2970  yymsp[-2].minor.yy19->pNext = yymsp[0].minor.yy19;
2971  yygotominor.yy19 = yymsp[-2].minor.yy19;
2972}
2973#line 2974 "ext/sqlite/libsqlite/src/parse.c"
2974        break;
2975      case 276: /* trigger_cmd_list ::= */
2976#line 833 "ext/sqlite/libsqlite/src/parse.y"
2977{ yygotominor.yy19 = 0; }
2978#line 2979 "ext/sqlite/libsqlite/src/parse.c"
2979        break;
2980      case 277: /* trigger_cmd ::= UPDATE orconf nm SET setlist where_opt */
2981#line 839 "ext/sqlite/libsqlite/src/parse.y"
2982{ yygotominor.yy19 = sqliteTriggerUpdateStep(&yymsp[-3].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy242, yymsp[-4].minor.yy372); }
2983#line 2984 "ext/sqlite/libsqlite/src/parse.c"
2984        break;
2985      case 278: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP */
2986#line 844 "ext/sqlite/libsqlite/src/parse.y"
2987{yygotominor.yy19 = sqliteTriggerInsertStep(&yymsp[-5].minor.yy0, yymsp[-4].minor.yy320, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy372);}
2988#line 2989 "ext/sqlite/libsqlite/src/parse.c"
2989        break;
2990      case 279: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt select */
2991#line 847 "ext/sqlite/libsqlite/src/parse.y"
2992{yygotominor.yy19 = sqliteTriggerInsertStep(&yymsp[-2].minor.yy0, yymsp[-1].minor.yy320, 0, yymsp[0].minor.yy179, yymsp[-4].minor.yy372);}
2993#line 2994 "ext/sqlite/libsqlite/src/parse.c"
2994        break;
2995      case 280: /* trigger_cmd ::= DELETE FROM nm where_opt */
2996#line 851 "ext/sqlite/libsqlite/src/parse.y"
2997{yygotominor.yy19 = sqliteTriggerDeleteStep(&yymsp[-1].minor.yy0, yymsp[0].minor.yy242);}
2998#line 2999 "ext/sqlite/libsqlite/src/parse.c"
2999        break;
3000      case 281: /* trigger_cmd ::= select */
3001#line 854 "ext/sqlite/libsqlite/src/parse.y"
3002{yygotominor.yy19 = sqliteTriggerSelectStep(yymsp[0].minor.yy179); }
3003#line 3004 "ext/sqlite/libsqlite/src/parse.c"
3004        break;
3005      case 282: /* expr ::= RAISE LP IGNORE RP */
3006#line 857 "ext/sqlite/libsqlite/src/parse.y"
3007{
3008  yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, 0);
3009  yygotominor.yy242->iColumn = OE_Ignore;
3010  sqliteExprSpan(yygotominor.yy242, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
3011}
3012#line 3013 "ext/sqlite/libsqlite/src/parse.c"
3013        break;
3014      case 283: /* expr ::= RAISE LP ROLLBACK COMMA nm RP */
3015#line 862 "ext/sqlite/libsqlite/src/parse.y"
3016{
3017  yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
3018  yygotominor.yy242->iColumn = OE_Rollback;
3019  sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
3020}
3021#line 3022 "ext/sqlite/libsqlite/src/parse.c"
3022        break;
3023      case 284: /* expr ::= RAISE LP ABORT COMMA nm RP */
3024#line 867 "ext/sqlite/libsqlite/src/parse.y"
3025{
3026  yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
3027  yygotominor.yy242->iColumn = OE_Abort;
3028  sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
3029}
3030#line 3031 "ext/sqlite/libsqlite/src/parse.c"
3031        break;
3032      case 285: /* expr ::= RAISE LP FAIL COMMA nm RP */
3033#line 872 "ext/sqlite/libsqlite/src/parse.y"
3034{
3035  yygotominor.yy242 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
3036  yygotominor.yy242->iColumn = OE_Fail;
3037  sqliteExprSpan(yygotominor.yy242, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
3038}
3039#line 3040 "ext/sqlite/libsqlite/src/parse.c"
3040        break;
3041      case 286: /* cmd ::= DROP TRIGGER nm dbnm */
3042#line 879 "ext/sqlite/libsqlite/src/parse.y"
3043{
3044  sqliteDropTrigger(pParse,sqliteSrcListAppend(0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0));
3045}
3046#line 3047 "ext/sqlite/libsqlite/src/parse.c"
3047        break;
3048      case 287: /* cmd ::= ATTACH database_kw_opt ids AS nm key_opt */
3049#line 884 "ext/sqlite/libsqlite/src/parse.y"
3050{
3051  sqliteAttach(pParse, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);
3052}
3053#line 3054 "ext/sqlite/libsqlite/src/parse.c"
3054        break;
3055      case 289: /* key_opt ::= */
3056#line 889 "ext/sqlite/libsqlite/src/parse.y"
3057{ yygotominor.yy0.z = 0; yygotominor.yy0.n = 0; }
3058#line 3059 "ext/sqlite/libsqlite/src/parse.c"
3059        break;
3060      case 292: /* cmd ::= DETACH database_kw_opt nm */
3061#line 895 "ext/sqlite/libsqlite/src/parse.y"
3062{
3063  sqliteDetach(pParse, &yymsp[0].minor.yy0);
3064}
3065#line 3066 "ext/sqlite/libsqlite/src/parse.c"
3066        break;
3067      default:
3068      /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
3069      /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
3070      /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
3071      /* (3) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==3);
3072      /* (4) ecmd ::= SEMI */ yytestcase(yyruleno==4);
3073      /* (9) trans_opt ::= */ yytestcase(yyruleno==9);
3074      /* (10) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==10);
3075      /* (11) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==11);
3076      /* (15) cmd ::= create_table create_table_args */ yytestcase(yyruleno==15);
3077      /* (21) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==21);
3078      /* (22) columnlist ::= column */ yytestcase(yyruleno==22);
3079      /* (23) column ::= columnid type carglist */ yytestcase(yyruleno==23);
3080      /* (31) type ::= */ yytestcase(yyruleno==31);
3081      /* (40) carglist ::= carglist carg */ yytestcase(yyruleno==40);
3082      /* (41) carglist ::= */ yytestcase(yyruleno==41);
3083      /* (42) carg ::= CONSTRAINT nm ccons */ yytestcase(yyruleno==42);
3084      /* (43) carg ::= ccons */ yytestcase(yyruleno==43);
3085      /* (52) carg ::= DEFAULT NULL */ yytestcase(yyruleno==52);
3086      /* (53) ccons ::= NULL onconf */ yytestcase(yyruleno==53);
3087      /* (76) conslist_opt ::= */ yytestcase(yyruleno==76);
3088      /* (77) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==77);
3089      /* (78) conslist ::= conslist COMMA tcons */ yytestcase(yyruleno==78);
3090      /* (79) conslist ::= conslist tcons */ yytestcase(yyruleno==79);
3091      /* (80) conslist ::= tcons */ yytestcase(yyruleno==80);
3092      /* (81) tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==81);
3093      /* (258) plus_opt ::= PLUS */ yytestcase(yyruleno==258);
3094      /* (259) plus_opt ::= */ yytestcase(yyruleno==259);
3095      /* (290) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==290);
3096      /* (291) database_kw_opt ::= */ yytestcase(yyruleno==291);
3097        break;
3098  };
3099  yygoto = yyRuleInfo[yyruleno].lhs;
3100  yysize = yyRuleInfo[yyruleno].nrhs;
3101  yypParser->yyidx -= yysize;
3102  yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
3103  if( yyact < YYNSTATE ){
3104#ifdef NDEBUG
3105    /* If we are not debugging and the reduce action popped at least
3106    ** one element off the stack, then we can push the new element back
3107    ** onto the stack here, and skip the stack overflow test in yy_shift().
3108    ** That gives a significant speed improvement. */
3109    if( yysize ){
3110      yypParser->yyidx++;
3111      yymsp -= yysize-1;
3112      yymsp->stateno = (YYACTIONTYPE)yyact;
3113      yymsp->major = (YYCODETYPE)yygoto;
3114      yymsp->minor = yygotominor;
3115    }else
3116#endif
3117    {
3118      yy_shift(yypParser,yyact,yygoto,&yygotominor);
3119    }
3120  }else{
3121    assert( yyact == YYNSTATE + YYNRULE + 1 );
3122    yy_accept(yypParser);
3123  }
3124}
3125
3126/*
3127** The following code executes when the parse fails
3128*/
3129#ifndef YYNOERRORRECOVERY
3130static void yy_parse_failed(
3131  yyParser *yypParser           /* The parser */
3132){
3133  sqliteParserARG_FETCH;
3134#ifndef NDEBUG
3135  if( yyTraceFILE ){
3136    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
3137  }
3138#endif
3139  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
3140  /* Here code is inserted which will be executed whenever the
3141  ** parser fails */
3142  sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3143}
3144#endif /* YYNOERRORRECOVERY */
3145
3146/*
3147** The following code executes when a syntax error first occurs.
3148*/
3149static void yy_syntax_error(
3150  yyParser *yypParser,           /* The parser */
3151  int yymajor,                   /* The major type of the error token */
3152  YYMINORTYPE yyminor            /* The minor type of the error token */
3153){
3154  sqliteParserARG_FETCH;
3155#define TOKEN (yyminor.yy0)
3156#line 23 "ext/sqlite/libsqlite/src/parse.y"
3157
3158  if( pParse->zErrMsg==0 ){
3159    if( TOKEN.z[0] ){
3160      sqliteErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
3161    }else{
3162      sqliteErrorMsg(pParse, "incomplete SQL statement");
3163    }
3164  }
3165#line 3166 "ext/sqlite/libsqlite/src/parse.c"
3166  sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3167}
3168
3169/*
3170** The following is executed when the parser accepts
3171*/
3172static void yy_accept(
3173  yyParser *yypParser           /* The parser */
3174){
3175  sqliteParserARG_FETCH;
3176#ifndef NDEBUG
3177  if( yyTraceFILE ){
3178    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
3179  }
3180#endif
3181  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
3182  /* Here code is inserted which will be executed whenever the
3183  ** parser accepts */
3184  sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3185}
3186
3187/* The main parser program.
3188** The first argument is a pointer to a structure obtained from
3189** "sqliteParserAlloc" which describes the current state of the parser.
3190** The second argument is the major token number.  The third is
3191** the minor token.  The fourth optional argument is whatever the
3192** user wants (and specified in the grammar) and is available for
3193** use by the action routines.
3194**
3195** Inputs:
3196** <ul>
3197** <li> A pointer to the parser (an opaque structure.)
3198** <li> The major token number.
3199** <li> The minor token number.
3200** <li> An option argument of a grammar-specified type.
3201** </ul>
3202**
3203** Outputs:
3204** None.
3205*/
3206void sqliteParser(
3207  void *yyp,                   /* The parser */
3208  int yymajor,                 /* The major token code number */
3209  sqliteParserTOKENTYPE yyminor       /* The value for the token */
3210  sqliteParserARG_PDECL               /* Optional %extra_argument parameter */
3211){
3212  YYMINORTYPE yyminorunion;
3213  int yyact;            /* The parser action. */
3214  int yyendofinput;     /* True if we are at the end of input */
3215#ifdef YYERRORSYMBOL
3216  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
3217#endif
3218  yyParser *yypParser;  /* The parser */
3219
3220  /* (re)initialize the parser, if necessary */
3221  yypParser = (yyParser*)yyp;
3222  if( yypParser->yyidx<0 ){
3223#if YYSTACKDEPTH<=0
3224    if( yypParser->yystksz <=0 ){
3225      /*memset(&yyminorunion, 0, sizeof(yyminorunion));*/
3226      yyminorunion = yyzerominor;
3227      yyStackOverflow(yypParser, &yyminorunion);
3228      return;
3229    }
3230#endif
3231    yypParser->yyidx = 0;
3232    yypParser->yyerrcnt = -1;
3233    yypParser->yystack[0].stateno = 0;
3234    yypParser->yystack[0].major = 0;
3235  }
3236  yyminorunion.yy0 = yyminor;
3237  yyendofinput = (yymajor==0);
3238  sqliteParserARG_STORE;
3239
3240#ifndef NDEBUG
3241  if( yyTraceFILE ){
3242    fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
3243  }
3244#endif
3245
3246  do{
3247    yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
3248    if( yyact<YYNSTATE ){
3249      assert( !yyendofinput );  /* Impossible to shift the $ token */
3250      yy_shift(yypParser,yyact,yymajor,&yyminorunion);
3251      yypParser->yyerrcnt--;
3252      yymajor = YYNOCODE;
3253    }else if( yyact < YYNSTATE + YYNRULE ){
3254      yy_reduce(yypParser,yyact-YYNSTATE);
3255    }else{
3256      assert( yyact == YY_ERROR_ACTION );
3257#ifdef YYERRORSYMBOL
3258      int yymx;
3259#endif
3260#ifndef NDEBUG
3261      if( yyTraceFILE ){
3262        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
3263      }
3264#endif
3265#ifdef YYERRORSYMBOL
3266      /* A syntax error has occurred.
3267      ** The response to an error depends upon whether or not the
3268      ** grammar defines an error token "ERROR".
3269      **
3270      ** This is what we do if the grammar does define ERROR:
3271      **
3272      **  * Call the %syntax_error function.
3273      **
3274      **  * Begin popping the stack until we enter a state where
3275      **    it is legal to shift the error symbol, then shift
3276      **    the error symbol.
3277      **
3278      **  * Set the error count to three.
3279      **
3280      **  * Begin accepting and shifting new tokens.  No new error
3281      **    processing will occur until three tokens have been
3282      **    shifted successfully.
3283      **
3284      */
3285      if( yypParser->yyerrcnt<0 ){
3286        yy_syntax_error(yypParser,yymajor,yyminorunion);
3287      }
3288      yymx = yypParser->yystack[yypParser->yyidx].major;
3289      if( yymx==YYERRORSYMBOL || yyerrorhit ){
3290#ifndef NDEBUG
3291        if( yyTraceFILE ){
3292          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
3293             yyTracePrompt,yyTokenName[yymajor]);
3294        }
3295#endif
3296        yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
3297        yymajor = YYNOCODE;
3298      }else{
3299         while(
3300          yypParser->yyidx >= 0 &&
3301          yymx != YYERRORSYMBOL &&
3302          (yyact = yy_find_reduce_action(
3303                        yypParser->yystack[yypParser->yyidx].stateno,
3304                        YYERRORSYMBOL)) >= YYNSTATE
3305        ){
3306          yy_pop_parser_stack(yypParser);
3307        }
3308        if( yypParser->yyidx < 0 || yymajor==0 ){
3309          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
3310          yy_parse_failed(yypParser);
3311          yymajor = YYNOCODE;
3312        }else if( yymx!=YYERRORSYMBOL ){
3313          YYMINORTYPE u2;
3314          u2.YYERRSYMDT = 0;
3315          yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
3316        }
3317      }
3318      yypParser->yyerrcnt = 3;
3319      yyerrorhit = 1;
3320#elif defined(YYNOERRORRECOVERY)
3321      /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
3322      ** do any kind of error recovery.  Instead, simply invoke the syntax
3323      ** error routine and continue going as if nothing had happened.
3324      **
3325      ** Applications can set this macro (for example inside %include) if
3326      ** they intend to abandon the parse upon the first syntax error seen.
3327      */
3328      yy_syntax_error(yypParser,yymajor,yyminorunion);
3329      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
3330      yymajor = YYNOCODE;
3331
3332#else  /* YYERRORSYMBOL is not defined */
3333      /* This is what we do if the grammar does not define ERROR:
3334      **
3335      **  * Report an error message, and throw away the input token.
3336      **
3337      **  * If the input token is $, then fail the parse.
3338      **
3339      ** As before, subsequent error messages are suppressed until
3340      ** three input tokens have been successfully shifted.
3341      */
3342      if( yypParser->yyerrcnt<=0 ){
3343        yy_syntax_error(yypParser,yymajor,yyminorunion);
3344      }
3345      yypParser->yyerrcnt = 3;
3346      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
3347      if( yyendofinput ){
3348        yy_parse_failed(yypParser);
3349      }
3350      yymajor = YYNOCODE;
3351#endif
3352    }
3353  }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
3354  return;
3355}
3356