/* Driver template for the LEMON parser generator.
** The author disclaims copyright to this source code.
*/
/* First off, code is included that follows the "include" declaration
** in the input grammar file. */
#include <stdio.h>
#line 53 "parse.y"

#include "sqliteInt.h"

/*
** An instance of this structure holds information about the
** LIMIT clause of a SELECT statement.
*/
struct LimitVal {
  Expr *pLimit;    /* The LIMIT expression.  NULL if there is no limit */
  Expr *pOffset;   /* The OFFSET expression.  NULL if there is none */
};

/*
** An instance of this structure is used to store the LIKE,
** GLOB, NOT LIKE, and NOT GLOB operators.
*/
struct LikeOp {
  Token eOperator;  /* "like" or "glob" or "regexp" */
  int not;         /* True if the NOT keyword is present */
};

/*
** An instance of the following structure describes the event of a
** TRIGGER.  "a" is the event type, one of TK_UPDATE, TK_INSERT,
** TK_DELETE, or TK_INSTEAD.  If the event is of the form
**
**      UPDATE ON (a,b,c)
**
** Then the "b" IdList records the list "a,b,c".
*/
struct TrigEvent { int a; IdList * b; };

/*
** An instance of this structure holds the ATTACH key and the key type.
*/
struct AttachKey { int type;  Token key; };

#line 46 "parse.c"
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
*/
/* 
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
** understands. 
**
** Each symbol here is a terminal symbol in the grammar.
*/
/* Make sure the INTERFACE macro is defined.
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/* The next thing included is series of defines which control
** various aspects of the generated parser.
**    YYCODETYPE         is the data type used for storing terminal
**                       and nonterminal numbers.  "unsigned char" is
**                       used if there are fewer than 250 terminals
**                       and nonterminals.  "int" is used otherwise.
**    YYNOCODE           is a number of type YYCODETYPE which corresponds
**                       to no legal terminal or nonterminal number.  This
**                       number is used to fill in empty slots of the hash 
**                       table.
**    YYFALLBACK         If defined, this indicates that one or more tokens
**                       have fall-back values which should be used if the
**                       original value of the token will not parse.
**    YYACTIONTYPE       is the data type used for storing terminal
**                       and nonterminal numbers.  "unsigned char" is
**                       used if there are fewer than 250 rules and
**                       states combined.  "int" is used otherwise.
**    sqlite3ParserTOKENTYPE     is the data type used for minor tokens given 
**                       directly to the parser from the tokenizer.
**    YYMINORTYPE        is the data type used for all minor tokens.
**                       This is typically a union of many types, one of
**                       which is sqlite3ParserTOKENTYPE.  The entry in the union
**                       for base tokens is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
**                       zero the stack is dynamically sized using realloc()
**    sqlite3ParserARG_SDECL     A static variable declaration for the %extra_argument
**    sqlite3ParserARG_PDECL     A parameter declaration for the %extra_argument
**    sqlite3ParserARG_STORE     Code to store %extra_argument into yypParser
**    sqlite3ParserARG_FETCH     Code to extract %extra_argument from yypParser
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
*/
#define YYCODETYPE unsigned char
#define YYNOCODE 251
#define YYACTIONTYPE unsigned short int
#define YYWILDCARD 62
#define sqlite3ParserTOKENTYPE Token
typedef union {
  int yyinit;
  sqlite3ParserTOKENTYPE yy0;
  struct LimitVal yy64;
  Expr* yy122;
  Select* yy159;
  IdList* yy180;
  struct {int value; int mask;} yy207;
  struct LikeOp yy318;
  TriggerStep* yy327;
  SrcList* yy347;
  int yy392;
  struct TrigEvent yy410;
  ExprList* yy442;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define sqlite3ParserARG_SDECL Parse *pParse;
#define sqlite3ParserARG_PDECL ,Parse *pParse
#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
#define sqlite3ParserARG_STORE yypParser->pParse = pParse
#define YYNSTATE 610
#define YYNRULE 319
#define YYFALLBACK 1
#define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION  (YYNSTATE+YYNRULE+1)
#define YY_ERROR_ACTION   (YYNSTATE+YYNRULE)

/* The yyzerominor constant is used to initialize instances of
** YYMINORTYPE objects to zero. */
static const YYMINORTYPE yyzerominor = { 0 };


/* Next are the tables used to determine what action to take based on the
** current state and lookahead token.  These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.  
**
** Suppose the action integer is N.  Then the action is determined as
** follows
**
**   0 <= N < YYNSTATE                  Shift N.  That is, push the lookahead
**                                      token onto the stack and goto state N.
**
**   YYNSTATE <= N < YYNSTATE+YYNRULE   Reduce by rule N-YYNSTATE.
**
**   N == YYNSTATE+YYNRULE              A syntax error has occurred.
**
**   N == YYNSTATE+YYNRULE+1            The parser accepts its input.
**
**   N == YYNSTATE+YYNRULE+2            No such action.  Denotes unused
**                                      slots in the yy_action[] table.
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as
**
**      yy_action[ yy_shift_ofst[S] + X ]
**
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
** and that yy_default[S] should be used instead.  
**
** The formula above is for computing the action when the lookahead is
** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
** YY_SHIFT_USE_DFLT.
**
** The following are the tables generated in this section:
**
**  yy_action[]        A single table containing all actions.
**  yy_lookahead[]     A table containing the lookahead for each entry in
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
*/
static const YYACTIONTYPE yy_action[] = {
 /*     0 */   304,   74,  581,   83,  164,  205,  587,  543,   86,   86,
 /*    10 */    86,   86,  350,   96,   96,   96,   96,   93,   93,   94,
 /*    20 */    94,   94,   91,  227,  188,  158,  532,  524,   88,   96,
 /*    30 */    96,   96,   96,   93,   93,   94,   94,   94,   91,  227,
 /*    40 */   489,  315,  505,  504,   92,   82,  309,  518,  516,  522,
 /*    50 */   522,   95,   95,   86,   86,   86,   86,  434,   96,   96,
 /*    60 */    96,   96,   93,   93,   94,   94,   94,   91,  227,  304,
 /*    70 */   450,  308,  543,  525,  540,   63,   96,   96,   96,   96,
 /*    80 */    93,   93,   94,   94,   94,   91,  227,   93,   93,   94,
 /*    90 */    94,   94,   91,  227,  586,  532,  524,  332,  596,   77,
 /*   100 */   239,   59,   20,  233,  226,  563,  543,  538,  538,  538,
 /*   110 */   182,  345,  269,   92,   82,  309,  518,  516,  522,  522,
 /*   120 */    95,   95,   86,   86,   86,   86,  592,   96,   96,   96,
 /*   130 */    96,   93,   93,   94,   94,   94,   91,  227,  304,  230,
 /*   140 */   489,  481,  308,  229,  550,  176,  114,  289,  340,  290,
 /*   150 */   325,  170,  451,  447,  480,  191,  607,  394,  262,  264,
 /*   160 */   152,  150,  406,   22,  532,  524,  416,  295,  379,  589,
 /*   170 */   450,  543,  604,  920,  540,  920,  301,  589,  293,  492,
 /*   180 */   453,  206,   92,   82,  309,  518,  516,  522,  522,   95,
 /*   190 */    95,   86,   86,   86,   86,  373,   96,   96,   96,   96,
 /*   200 */    93,   93,   94,   94,   94,   91,  227,  538,  538,  538,
 /*   210 */   230,  304,  599,   74,  153,   83,  164,  114,  289,  340,
 /*   220 */   290,  325,  170,   94,   94,   94,   91,  227,  278,  262,
 /*   230 */   474,  446,  494,  219,  588,  585,  171,  532,  524,  371,
 /*   240 */   378,  383,  588,  585,  281,  339,  505,  504,  546,  606,
 /*   250 */   388,  445,  555,  556,   90,   92,   82,  309,  518,  516,
 /*   260 */   522,  522,   95,   95,   86,   86,   86,   86,  466,   96,
 /*   270 */    96,   96,   96,   93,   93,   94,   94,   94,   91,  227,
 /*   280 */   322,  357,  171,  488,  304,  371,  378,  383,  171,   61,
 /*   290 */   154,  371,  378,  383,  231,  559,  388,   74,  357,   83,
 /*   300 */   164,   56,  388,  321,  551,   28,  240,  163,  226,  464,
 /*   310 */   532,  524,  324,  119,  558,  557,  346,  568,  511,  511,
 /*   320 */   490,  551,   49,  346,  550,  511,  511,   76,   92,   82,
 /*   330 */   309,  518,  516,  522,  522,   95,   95,   86,   86,   86,
 /*   340 */    86,  550,   96,   96,   96,   96,   93,   93,   94,   94,
 /*   350 */    94,   91,  227,  304,  349,  423,  451,  307,  109,  402,
 /*   360 */   234,  238,  357,  331,  560,  357,  566,   22,  341,  346,
 /*   370 */   229,  511,  511,  531,  530,  554,  226,  559,  284,  532,
 /*   380 */   524,  374,  387,  464,  490,  551,   49,  472,  551,   40,
 /*   390 */   151,  410,  159,  573,  527,  526,  558,   92,   82,  309,
 /*   400 */   518,  516,  522,  522,   95,   95,   86,   86,   86,   86,
 /*   410 */   165,   96,   96,   96,   96,   93,   93,   94,   94,   94,
 /*   420 */    91,  227,  304,  528,   91,  227,  550,  331,  353,  222,
 /*   430 */   521,  385,  348,  402,  234,  238,  400,  357,  157,  158,
 /*   440 */   357,  589,  565,  473,  229,  204,  318,  225,  532,  524,
 /*   450 */    60,  436,  205,  525,  543,  413,  424,  403,  226,  296,
 /*   460 */   551,   49,  420,  551,   40,  306,   92,   82,  309,  518,
 /*   470 */   516,  522,  522,   95,   95,   86,   86,   86,   86,  550,
 /*   480 */    96,   96,   96,   96,   93,   93,   94,   94,   94,   91,
 /*   490 */   227,  304,  479,  564,  461,  286,  494,  288,  357,  297,
 /*   500 */   357,  436,  334,  376,  217,  141,  588,  585,  374,   74,
 /*   510 */   357,   83,  164,  930,  130,  609,    2,  532,  524,  543,
 /*   520 */    17,  551,   43,  551,   50,  391,  525,   23,  272,  604,
 /*   530 */   921,  589,  921,  551,   43,   92,   82,  309,  518,  516,
 /*   540 */   522,  522,   95,   95,   86,   86,   86,   86,  592,   96,
 /*   550 */    96,   96,   96,   93,   93,   94,   94,   94,   91,  227,
 /*   560 */   304,  510,  281,  481,  429,  274,  249,  319,  242,  599,
 /*   570 */   142,  589,  459,  459,  218,  263,  480,  589,  338,  311,
 /*   580 */   589,  439,  440,  204,    1,  149,  532,  524,  589,  451,
 /*   590 */   392,  346,  169,  511,  511,  589,  588,  585,  221,  590,
 /*   600 */    22,  492,  359,  206,   92,   82,  309,  518,  516,  522,
 /*   610 */   522,   95,   95,   86,   86,   86,   86,  550,   96,   96,
 /*   620 */    96,   96,   93,   93,   94,   94,   94,   91,  227,  304,
 /*   630 */   397,  470,  208,  454,  475,  357,  588,  585,  469,  161,
 /*   640 */   161,  376,  588,  585,  256,  588,  585,  346,  277,  511,
 /*   650 */   511,  236,  196,  588,  585,  532,  524,  165,  551,   31,
 /*   660 */   588,  585,  458,  396,  459,  459,  550,  437,  401,  437,
 /*   670 */   595,  542,  303,   92,   82,  309,  518,  516,  522,  522,
 /*   680 */    95,   95,   86,   86,   86,   86,  550,   96,   96,   96,
 /*   690 */    96,   93,   93,   94,   94,   94,   91,  227,  304,  357,
 /*   700 */   442,  227,  421,  355,  441,  357,  543,  357,  179,  357,
 /*   710 */   506,  357,  306,  471,  357,  169,  386,  262,  610,  600,
 /*   720 */   360,  490,  551,   16,  532,  524,  551,    3,  551,  111,
 /*   730 */   551,   33,  551,   24,  551,   34,  190,  551,   51,  582,
 /*   740 */   579,  578,   92,   82,  309,  518,  516,  522,  522,   95,
 /*   750 */    95,   86,   86,   86,   86,  357,   96,   96,   96,   96,
 /*   760 */    93,   93,   94,   94,   94,   91,  227,  304,  357,  552,
 /*   770 */   550,  543,  357,  553,  357,  326,  357,  169,  551,   42,
 /*   780 */   357,  605,  606,  320,  357,  282,  357,  201,  211,  166,
 /*   790 */   287,  551,  112,  532,  524,  551,   37,  551,   98,  551,
 /*   800 */    54,  649,  552,  551,   52,  167,  553,  551,  113,  551,
 /*   810 */    35,   92,   82,  309,  518,  516,  522,  522,   95,   95,
 /*   820 */    86,   86,   86,   86,  357,   96,   96,   96,   96,   93,
 /*   830 */    93,   94,   94,   94,   91,  227,  304,  276,  399,  550,
 /*   840 */   155,  357,  509,  357,   21,  357,  343,  551,   55,  357,
 /*   850 */   598,  302,  412,  357,  601,    2,  426,  229,  494,  219,
 /*   860 */   600,  360,  532,  524,  551,   25,  551,   29,  551,   41,
 /*   870 */   525,  381,  551,   39,  550,  281,  551,   10,  276,  223,
 /*   880 */    92,   81,  309,  518,  516,  522,  522,   95,   95,   86,
 /*   890 */    86,   86,   86,  357,   96,   96,   96,   96,   93,   93,
 /*   900 */    94,   94,   94,   91,  227,  304,  357,  281,  281,  228,
 /*   910 */   357,  323,  357,  285,  357,  169,  551,   26,  357,  487,
 /*   920 */   512,  191,  495,  357,   70,  357,  409,  407,  460,  551,
 /*   930 */    46,  532,  524,  551,   30,  551,   32,  551,   48,   18,
 /*   940 */   276,  551,   47,  314,  310,  602,  551,  103,  551,  108,
 /*   950 */    82,  309,  518,  516,  522,  522,   95,   95,   86,   86,
 /*   960 */    86,   86,  357,   96,   96,   96,   96,   93,   93,   94,
 /*   970 */    94,   94,   91,  227,  304,  513,  276,  276,   19,  357,
 /*   980 */   146,  357,  517,  357,  603,  551,   97,  357,    8,  455,
 /*   990 */   356,  169,  357,  498,  498,  199,  545,   62,   70,   80,
 /*  1000 */   532,  524,  551,  102,  551,  100,  551,   99,  266,  452,
 /*  1010 */   551,   38,  368,  414,  336,  551,   45,  276,  362,  214,
 /*  1020 */   309,  518,  516,  522,  522,   95,   95,   86,   86,   86,
 /*  1030 */    86,  357,   96,   96,   96,   96,   93,   93,   94,   94,
 /*  1040 */    94,   91,  227,   71,  352,  237,    4,  357,  276,  369,
 /*  1050 */   316,  456,  276,  357,  551,  110,  357,  276,  344,  523,
 /*  1060 */   449,  572,  539,  357,  570,  294,   71,  352,  404,    4,
 /*  1070 */   551,   44,  351,  316,  260,  330,  551,   36,  370,  551,
 /*  1080 */    27,  344,  162,  435,  247,  489,  551,   53,  496,  478,
 /*  1090 */   520,  853,  462,  279,  246,   78,  583,  243,  330,  271,
 /*  1100 */   375,  292,  395,  438,  499,   84,   73,  476,  489,  465,
 /*  1110 */   533,  501,  258,  541,   72,  354,  358,  337,  493,  540,
 /*  1120 */   424,  298,  483,  497,  536,  147,  259,  549,   84,   73,
 /*  1130 */   116,  569,  203,  571,   57,  195,  580,   72,  354,  358,
 /*  1140 */    78,  367,  540,  500,  267,  363,  463,  115,  229,  425,
 /*  1150 */   432,  508,  538,  538,  538,  535,  534,   12,  172,    5,
 /*  1160 */   229,  187,  241,  245,  248,  251,  183,  273,  576,  104,
 /*  1170 */   128,  575,  364,  123,  390,  538,  538,  538,  535,  534,
 /*  1180 */    12,  125,  168,  327,  235,  448,  329,   71,  352,  574,
 /*  1190 */     4,  261,  193,  591,  316,  126,  393,  200,  342,  143,
 /*  1200 */   313,  268,  344,  185,  529,  464,  257,  312,  107,  175,
 /*  1210 */   561,   87,  202,  213,   58,    7,  333,   67,  594,  330,
 /*  1220 */    69,  431,  250,   79,  482,  244,  270,  366,  265,  489,
 /*  1230 */   135,  174,  275,  548,  428,  577,  427,  122,  133,  299,
 /*  1240 */   224,  215,  347,  467,  181,  415,  433,  216,  194,   84,
 /*  1250 */    73,  300,  412,  105,  398,  384,  254,  238,   72,  354,
 /*  1260 */   358,  305,  417,  540,  411,  408,  229,  418,  207,  291,
 /*  1270 */   405,  173,  101,  422,  584,   75,  280,  544,  232,  317,
 /*  1280 */   210,  132,  118,  129,  335,  593,  485,  184,  253,  380,
 /*  1290 */   562,  377,  136,  209,  160,  145,  538,  538,  538,  535,
 /*  1300 */   534,   12,  547,  650,  468,  127,   13,  382,   15,  514,
 /*  1310 */   502,  389,  144,  444,  443,  486,  191,  255,   66,  430,
 /*  1320 */   131,  121,  137,  106,  519,   65,  608,   89,  192,   85,
 /*  1330 */   283,  419,  134,  252,  457,  156,  140,   64,  148,  372,
 /*  1340 */   597,  120,  567,    6,  537,  212,  186,  503,  189,  177,
 /*  1350 */   328,  491,  651,  507,  365,  477,  197,    9,   14,  293,
 /*  1360 */   484,  178,   68,  138,  220,  180,  139,  515,  117,  198,
 /*  1370 */    11,  124,  931,  931,  931,  931,  931,  931,  931,  931,
 /*  1380 */   361,
};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */    19,  221,  222,  223,  224,   24,  150,   26,   72,   73,
 /*    10 */    74,   75,   19,   77,   78,   79,   80,   81,   82,   83,
 /*    20 */    84,   85,   86,   87,  205,  206,   45,   46,   76,   77,
 /*    30 */    78,   79,   80,   81,   82,   83,   84,   85,   86,   87,
 /*    40 */    61,  168,  169,  170,   63,   64,   65,   66,   67,   68,
 /*    50 */    69,   70,   71,   72,   73,   74,   75,  150,   77,   78,
 /*    60 */    79,   80,   81,   82,   83,   84,   85,   86,   87,   19,
 /*    70 */    91,   19,   91,  165,   95,   25,   77,   78,   79,   80,
 /*    80 */    81,   82,   83,   84,   85,   86,   87,   81,   82,   83,
 /*    90 */    84,   85,   86,   87,  150,   45,   46,  146,  147,   49,
 /*   100 */   150,   22,   22,  152,  231,   26,   26,  128,  129,  130,
 /*   110 */   159,  118,  204,   63,   64,   65,   66,   67,   68,   69,
 /*   120 */    70,   71,   72,   73,   74,   75,   12,   77,   78,   79,
 /*   130 */    80,   81,   82,   83,   84,   85,   86,   87,   19,   87,
 /*   140 */    61,   27,   19,  113,  193,   93,   94,   95,   96,   97,
 /*   150 */    98,   99,  150,   23,   40,   25,   42,  127,  106,  157,
 /*   160 */    81,   82,  160,  161,   45,   46,   52,   95,  217,   26,
 /*   170 */    91,   91,   22,   23,   95,   25,  162,   26,  106,  165,
 /*   180 */   166,  167,   63,   64,   65,   66,   67,   68,   69,   70,
 /*   190 */    71,   72,   73,   74,   75,  244,   77,   78,   79,   80,
 /*   200 */    81,   82,   83,   84,   85,   86,   87,  128,  129,  130,
 /*   210 */    87,   19,   62,  221,   25,  223,  224,   94,   95,   96,
 /*   220 */    97,   98,   99,   83,   84,   85,   86,   87,  194,  106,
 /*   230 */    23,   33,   81,   82,   91,   92,   93,   45,   46,   96,
 /*   240 */    97,   98,   91,   92,  150,  168,  169,  170,  189,  190,
 /*   250 */   107,   53,  101,  102,  135,   63,   64,   65,   66,   67,
 /*   260 */    68,   69,   70,   71,   72,   73,   74,   75,   11,   77,
 /*   270 */    78,   79,   80,   81,   82,   83,   84,   85,   86,   87,
 /*   280 */   186,  150,   93,   23,   19,   96,   97,   98,   93,   24,
 /*   290 */   159,   96,   97,   98,  196,  150,  107,  221,  150,  223,
 /*   300 */   224,  203,  107,  105,  173,  174,  150,  159,  231,   52,
 /*   310 */    45,   46,  245,  246,  169,  170,  109,  241,  111,  112,
 /*   320 */   150,  173,  174,  109,  193,  111,  112,  135,   63,   64,
 /*   330 */    65,   66,   67,   68,   69,   70,   71,   72,   73,   74,
 /*   340 */    75,  193,   77,   78,   79,   80,   81,   82,   83,   84,
 /*   350 */    85,   86,   87,   19,   19,  164,  150,  154,   24,  102,
 /*   360 */   103,  104,  150,  215,  173,  150,  160,  161,  220,  109,
 /*   370 */   113,  111,  112,   45,   46,  230,  231,  150,  150,   45,
 /*   380 */    46,  150,  212,   52,  150,  173,  174,  182,  173,  174,
 /*   390 */   184,  185,  159,  150,   66,   67,  169,   63,   64,   65,
 /*   400 */    66,   67,   68,   69,   70,   71,   72,   73,   74,   75,
 /*   410 */    46,   77,   78,   79,   80,   81,   82,   83,   84,   85,
 /*   420 */    86,   87,   19,   95,   86,   87,  193,  215,  213,  214,
 /*   430 */    95,  228,  220,  102,  103,  104,  233,  150,  205,  206,
 /*   440 */   150,   26,  171,  172,  113,  159,  212,  216,   45,   46,
 /*   450 */    47,  180,   24,  165,   26,  180,  181,  230,  231,   17,
 /*   460 */   173,  174,  187,  173,  174,  101,   63,   64,   65,   66,
 /*   470 */    67,   68,   69,   70,   71,   72,   73,   74,   75,  193,
 /*   480 */    77,   78,   79,   80,   81,   82,   83,   84,   85,   86,
 /*   490 */    87,   19,  204,  172,   25,   23,   81,   55,  150,   57,
 /*   500 */   150,  180,  215,  217,  214,   23,   91,   92,  150,  221,
 /*   510 */   150,  223,  224,  142,  143,  144,  145,   45,   46,   91,
 /*   520 */   234,  173,  174,  173,  174,  239,  165,   22,   17,   22,
 /*   530 */    23,   26,   25,  173,  174,   63,   64,   65,   66,   67,
 /*   540 */    68,   69,   70,   71,   72,   73,   74,   75,   12,   77,
 /*   550 */    78,   79,   80,   81,   82,   83,   84,   85,   86,   87,
 /*   560 */    19,   23,  150,   27,   23,  204,   55,  219,   57,   62,
 /*   570 */    23,   26,   25,   25,  216,  225,   40,   26,   42,  219,
 /*   580 */    26,   94,   95,  159,   22,  116,   45,   46,   26,  150,
 /*   590 */    23,  109,   25,  111,  112,   26,   91,   92,  186,  160,
 /*   600 */   161,  165,  166,  167,   63,   64,   65,   66,   67,   68,
 /*   610 */    69,   70,   71,   72,   73,   74,   75,  193,   77,   78,
 /*   620 */    79,   80,   81,   82,   83,   84,   85,   86,   87,   19,
 /*   630 */    19,   30,  159,   23,   83,  150,   91,   92,   37,   92,
 /*   640 */    92,  217,   91,   92,  150,   91,   92,  109,  137,  111,
 /*   650 */   112,  150,  159,   91,   92,   45,   46,   46,  173,  174,
 /*   660 */    91,   92,  117,  239,  117,  117,  193,  102,  103,  104,
 /*   670 */    23,  117,   25,   63,   64,   65,   66,   67,   68,   69,
 /*   680 */    70,   71,   72,   73,   74,   75,  193,   77,   78,   79,
 /*   690 */    80,   81,   82,   83,   84,   85,   86,   87,   19,  150,
 /*   700 */    28,   87,   23,  150,   32,  150,   26,  150,   22,  150,
 /*   710 */   150,  150,  101,   23,  150,   25,   44,  106,    0,    1,
 /*   720 */     2,  150,  173,  174,   45,   46,  173,  174,  173,  174,
 /*   730 */   173,  174,  173,  174,  173,  174,  159,  173,  174,    7,
 /*   740 */     8,    9,   63,   64,   65,   66,   67,   68,   69,   70,
 /*   750 */    71,   72,   73,   74,   75,  150,   77,   78,   79,   80,
 /*   760 */    81,   82,   83,   84,   85,   86,   87,   19,  150,  110,
 /*   770 */   193,   91,  150,  114,  150,   83,  150,   25,  173,  174,
 /*   780 */   150,  189,  190,  212,  150,  150,  150,  102,  103,  104,
 /*   790 */   150,  173,  174,   45,   46,  173,  174,  173,  174,  173,
 /*   800 */   174,  115,  110,  173,  174,  159,  114,  173,  174,  173,
 /*   810 */   174,   63,   64,   65,   66,   67,   68,   69,   70,   71,
 /*   820 */    72,   73,   74,   75,  150,   77,   78,   79,   80,   81,
 /*   830 */    82,   83,   84,   85,   86,   87,   19,  150,   94,  193,
 /*   840 */   159,  150,   23,  150,   25,  150,  150,  173,  174,  150,
 /*   850 */   247,  248,  100,  150,  144,  145,  150,  113,   81,   82,
 /*   860 */     1,    2,   45,   46,  173,  174,  173,  174,  173,  174,
 /*   870 */   165,  127,  173,  174,  193,  150,  173,  174,  150,  192,
 /*   880 */    63,   64,   65,   66,   67,   68,   69,   70,   71,   72,
 /*   890 */    73,   74,   75,  150,   77,   78,   79,   80,   81,   82,
 /*   900 */    83,   84,   85,   86,   87,   19,  150,  150,  150,  204,
 /*   910 */   150,  186,  150,   23,  150,   25,  173,  174,  150,   23,
 /*   920 */   192,   25,   23,  150,   25,  150,    7,    8,  207,  173,
 /*   930 */   174,   45,   46,  173,  174,  173,  174,  173,  174,   22,
 /*   940 */   150,  173,  174,  186,  186,   23,  173,  174,  173,  174,
 /*   950 */    64,   65,   66,   67,   68,   69,   70,   71,   72,   73,
 /*   960 */    74,   75,  150,   77,   78,   79,   80,   81,   82,   83,
 /*   970 */    84,   85,   86,   87,   19,   21,  150,  150,   22,  150,
 /*   980 */    24,  150,  192,  150,   62,  173,  174,  150,   71,   23,
 /*   990 */   150,   25,  150,  128,  129,   25,   23,  134,   25,  136,
 /*  1000 */    45,   46,  173,  174,  173,  174,  173,  174,  148,  173,
 /*  1010 */   173,  174,   58,  185,  150,  173,  174,  150,  192,  192,
 /*  1020 */    65,   66,   67,   68,   69,   70,   71,   72,   73,   74,
 /*  1030 */    75,  150,   77,   78,   79,   80,   81,   82,   83,   84,
 /*  1040 */    85,   86,   87,   19,   20,  150,   22,  150,  150,  236,
 /*  1050 */    26,   97,  150,  150,  173,  174,  150,  150,   34,  192,
 /*  1060 */   173,  150,  150,  150,  150,  150,   19,   20,  242,   22,
 /*  1070 */   173,  174,  227,   26,  150,   51,  173,  174,  150,  173,
 /*  1080 */   174,   34,  150,  165,  150,   61,  173,  174,  232,  198,
 /*  1090 */   192,  137,  176,  150,  192,  125,  176,  150,   51,  192,
 /*  1100 */   177,  176,  150,  182,  232,   81,   82,   83,   61,  176,
 /*  1110 */   150,  176,  208,  165,   90,   91,   92,  190,  165,   95,
 /*  1120 */   181,  150,  165,  185,  198,  195,  197,  150,   81,   82,
 /*  1130 */    63,  153,  188,   36,  240,  115,  156,   90,   91,   92,
 /*  1140 */   125,  156,   95,  198,  208,  150,  188,  150,  113,  182,
 /*  1150 */   150,  150,  128,  129,  130,  131,  132,  133,    5,  195,
 /*  1160 */   113,    6,  201,   10,   11,   12,   13,   14,  149,   16,
 /*  1170 */    22,  149,  156,  191,   18,  128,  129,  130,  131,  132,
 /*  1180 */   133,  218,   29,  120,   31,  210,  149,   19,   20,   13,
 /*  1190 */    22,   38,  151,  140,   26,  188,   18,  155,  122,  218,
 /*  1200 */   156,  199,   34,   50,  198,   52,  198,   43,  243,   56,
 /*  1210 */   183,  134,   59,  226,  240,   25,  158,  134,  149,   51,
 /*  1220 */   101,  238,  209,  123,  210,  200,  209,   41,  237,   61,
 /*  1230 */   191,  151,  209,  193,  156,  156,  210,  191,   22,  178,
 /*  1240 */   229,   87,  101,  175,  156,  175,  175,  229,  155,   81,
 /*  1250 */    82,  178,  100,  179,  156,  102,  103,  104,   90,   91,
 /*  1260 */    92,  108,  175,   95,  175,  183,  113,  177,  155,  175,
 /*  1270 */   175,  155,  163,  156,  156,  124,  150,  202,  179,  249,
 /*  1280 */   235,  156,  246,  191,  121,  150,   23,  115,  139,  208,
 /*  1290 */    23,  138,   48,  116,  115,   24,  128,  129,  130,  131,
 /*  1300 */   132,  133,  127,  115,    1,  105,   22,   19,   25,   20,
 /*  1310 */     1,   47,   22,   48,   20,   11,   25,  137,   22,  118,
 /*  1320 */   105,  126,   22,   17,   95,   71,    4,   22,  126,   71,
 /*  1330 */    23,   23,   22,   15,   23,   22,   22,   25,   22,   47,
 /*  1340 */     1,  101,   23,  119,  117,  120,   17,   54,   25,  101,
 /*  1350 */     3,   23,  115,   23,   39,   23,  115,    5,  119,  106,
 /*  1360 */    23,   99,   22,   22,   47,  119,  116,  110,   35,   15,
 /*  1370 */    22,   22,  250,  250,  250,  250,  250,  250,  250,  250,
 /*  1380 */    60,
};
#define YY_SHIFT_USE_DFLT (-65)
#define YY_SHIFT_MAX 404
static const short yy_shift_ofst[] = {
 /*     0 */   859, 1047, 1153,  -19, 1047, 1168, 1168,  143,  151,  331,
 /*    10 */   403, 1168, 1168, 1168, 1168, 1168,  -48,  257,  415,  569,
 /*    20 */   777,  777,  680, 1035,   50,  610,  541,  472,  679,  192,
 /*    30 */   119,  265,  334,  748,  748,  748,  748,  748,  748,  748,
 /*    40 */   748,  748,  748,  748,  748,  748,  748,  748,  748,  748,
 /*    50 */   748,  748,  817,  886,  955,  955, 1024, 1168, 1168, 1168,
 /*    60 */  1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168,
 /*    70 */  1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168,
 /*    80 */  1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168,
 /*    90 */  1168, 1168, 1168, 1168, 1168, 1168, 1168,  -64,  -64,   -1,
 /*   100 */    -1,   52,    6,  140,  954,  611,  569,  569,  338,  680,
 /*   110 */   614,  -65,  -65,  -65,   79,  123,  114,  114,  507,  150,
 /*   120 */   569,  569,  569,  569,  569,  744,  569,  569,  569,  569,
 /*   130 */   718,  569,  428,  569,  569,  569,  569,  569,  569,  569,
 /*   140 */   569,  428,  428,   30, 1035, 1035, 1035,  -65,  -65,  -65,
 /*   150 */   -21,  189,  -21,  195,  207,  260,  536,  547,  505,  482,
 /*   160 */   551,  545,  554,  538,  562,  569,  198,  214,  569,  569,
 /*   170 */   569,  569,  732,  569,  569,  569,  569,  569,  569,  692,
 /*   180 */   569,  672,  214,  569,  569,  569,  569,  569,  548,  569,
 /*   190 */   214,  569,  569,  569,  569,  569,  214,  569,  569,  569,
 /*   200 */   569,  198,  569,  569,  214,  569,   80,  569,  214,  569,
 /*   210 */   565,  198,  569,  863,   -7,  680,  601,  601,  970,  865,
 /*   220 */   601,  752,  601,   -7,  601,  970,  865,  680,   -7,  659,
 /*   230 */   680,  469,  364,  956, 1067, 1097, 1020, 1015, 1067, 1020,
 /*   240 */  1020, 1151, 1156, 1020, 1163, 1155, 1148, 1020, 1155, 1156,
 /*   250 */  1063, 1155, 1176, 1053, 1067, 1178, 1148, 1076, 1015, 1015,
 /*   260 */  1020, 1097, 1164, 1077, 1190, 1083, 1155, 1119, 1100, 1119,
 /*   270 */  1063, 1186, 1156, 1176, 1119, 1063, 1020, 1156, 1035, 1020,
 /*   280 */  1216, 1154, 1154, 1141, 1020, 1141, 1141, 1216, 1178, 1141,
 /*   290 */  1141, 1152, 1141, 1164, 1020, 1141, 1178, 1178, 1020,  -65,
 /*   300 */   -65,  -65,  -65,  -65,  328,  511,  685,  442,   72,  335,
 /*   310 */   966,  973,  919,  917,  890,  819,  686,  922,  896,  899,
 /*   320 */   130,  487,  690,  567,  647, 1305, 1308, 1310, 1322, 1318,
 /*   330 */  1313, 1312, 1339, 1319, 1312, 1224, 1227, 1323, 1263, 1330,
 /*   340 */  1317, 1332, 1239, 1337, 1340, 1246, 1257, 1333, 1311, 1229,
 /*   350 */  1201, 1304, 1290, 1283, 1188, 1179, 1172, 1241, 1237, 1328,
 /*   360 */  1347, 1354, 1320, 1349, 1248, 1293, 1315, 1225, 1329, 1240,
 /*   370 */  1258, 1292, 1314, 1316, 1254, 1307, 1202, 1306, 1300, 1195,
 /*   380 */  1215, 1348, 1294, 1296, 1250, 1180, 1265, 1291, 1264, 1341,
 /*   390 */  1289, 1309, 1262, 1288, 1284, 1200, 1303, 1253, 1271, 1175,
 /*   400 */  1352, 1244, 1177, 1267, 1149,
};
#define YY_REDUCE_USE_DFLT (-221)
#define YY_REDUCE_MAX 303
static const short yy_reduce_ofst[] = {
 /*     0 */   371,  148,  -49,  288,  131,  212,  215,  206,  145,  286,
 /*    10 */    76,  360,  350,  348,  287,  290, -220,  424,  227,    2,
 /*    20 */  -127,   77,   14,  233,   -8,   -8,   -8,   -8,   -8,   -8,
 /*    30 */    -8,   -8,   -8,   -8,   -8,   -8,   -8,   -8,   -8,   -8,
 /*    40 */    -8,   -8,   -8,   -8,   -8,   -8,   -8,   -8,   -8,   -8,
 /*    50 */    -8,   -8,   -8,   -8,   -8,   -8,  553,  485,  557,  691,
 /*    60 */   622,  703,  760,  768,  903,  837,  906,  897,  762,  756,
 /*    70 */   699,  674,  618,  555,  549,  559,  561,  564,  605,  695,
 /*    80 */   764,  624,  626,  630,  634,  636,  831,  693,  833,  743,
 /*    90 */   842,  881,  913,  773,  775,  812,  829,   -8,   -8,   -8,
 /*   100 */    -8,  271,   -8,   -8,  203,  275,  826,  439,   -8,  436,
 /*   110 */    -8,   -8,   -8,   -8,  191,  321,   59,  592,  603,  603,
 /*   120 */   907,  902,  898,  867,  758,  473,  827,  358,  234,  790,
 /*   130 */   710,  231,  705,   94,  571,  728,  170,  757,  725,  687,
 /*   140 */   412,  -92,  361,  646,  681,  493,  577,   98,   67, -181,
 /*   150 */   887,  828,  836,  938,   34,   34,  927,  721,  947,   34,
 /*   160 */   840,  932,  864,   34,  156,  -93,  205,   34,  501,  635,
 /*   170 */   640,  706,  860,  915,  914,  977,  997,  995, 1126,  964,
 /*   180 */  1000, 1045,   34,  911,  912,  924,  -50, 1135,  721,  696,
 /*   190 */    34,  560,  494,  243,  228, -144,   34,  840,  -56,  928,
 /*   200 */   934,  921,  943,  952,   34,  960,  953,  971,   34,  895,
 /*   210 */   813,  967, 1001,  845, 1081,  918,  916,  920,  891,  856,
 /*   220 */   925,  923,  933,  904,  935,  926,  872,  948,  936,  930,
 /*   230 */   957,  929,  939,  978,  944,  894,  980,  945,  958,  985,
 /*   240 */  1118, 1075, 1092, 1125,  961, 1019,  963, 1016, 1022,  982,
 /*   250 */   975, 1037, 1041,  965, 1007, 1042,  981, 1002, 1006, 1008,
 /*   260 */  1044,  974, 1027,  987, 1058,  983, 1069, 1013, 1025, 1017,
 /*   270 */  1014,  991, 1039, 1080, 1023, 1026, 1078, 1046, 1040, 1079,
 /*   280 */  1061, 1011, 1018, 1068, 1088, 1070, 1071, 1073, 1093, 1087,
 /*   290 */  1089, 1090, 1094, 1082, 1098, 1095, 1113, 1116, 1117, 1074,
 /*   300 */  1099, 1109, 1030, 1036,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */   615,  848,  929,  736,  929,  848,  929,  929,  875,  929,
 /*    10 */   904,  929,  846,  929,  929,  929,  820,  929,  875,  929,
 /*    20 */   875,  875,  652,  740,  771,  929,  929,  929,  929,  929,
 /*    30 */   929,  929,  929,  903,  842,  778,  849,  905,  779,  785,
 /*    40 */   762,  769,  776,  786,  888,  841,  751,  773,  843,  850,
 /*    50 */   845,  772,  929,  808,  807,  826,  929,  929,  929,  929,
 /*    60 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*    70 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*    80 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*    90 */   929,  929,  929,  929,  929,  929,  929,  810,  832,  819,
 /*   100 */   809,  645,  811,  812,  640,  705,  929,  929,  813,  929,
 /*   110 */   814,  828,  827,  829,  929,  929,  929,  929,  929,  929,
 /*   120 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*   130 */   615,  929,  736,  929,  929,  929,  929,  929,  929,  929,
 /*   140 */   929,  736,  736,  929,  929,  929,  929,  730,  922,  740,
 /*   150 */   929,  696,  929,  929,  929,  929,  929,  929,  929,  929,
 /*   160 */   929,  929,  929,  929,  929,  929,  929,  893,  910,  929,
 /*   170 */   929,  929,  623,  929,  929,  861,  929,  929,  929,  728,
 /*   180 */   929,  881,  719,  929,  929,  929,  929,  621,  738,  929,
 /*   190 */   642,  929,  929,  929,  929,  929,  717,  929,  929,  929,
 /*   200 */   929,  929,  908,  929,  895,  929,  654,  929,  781,  929,
 /*   210 */   929,  929,  929,  844,  753,  929,  765,  765,  775,  929,
 /*   220 */   765,  678,  765,  753,  765,  775,  929,  929,  753,  728,
 /*   230 */   929,  737,  675,  929,  709,  907,  744,  775,  709,  744,
 /*   240 */   744,  770,  716,  744,  758,  620,  787,  744,  620,  716,
 /*   250 */   757,  620,  631,  915,  709,  637,  787,  766,  775,  775,
 /*   260 */   744,  907,  692,  929,  695,  887,  620,  752,  768,  752,
 /*   270 */   757,  885,  716,  631,  752,  757,  744,  716,  929,  744,
 /*   280 */   854,  858,  858,  707,  744,  707,  707,  854,  637,  707,
 /*   290 */   707,  678,  707,  692,  744,  707,  637,  637,  744,  680,
 /*   300 */   680,  662,  927,  922,  929,  929,  929,  929,  929,  929,
 /*   310 */   929,  929,  929,  868,  929,  929,  794,  929,  929,  929,
 /*   320 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  629,
 /*   330 */   929,  847,  929,  929,  767,  929,  929,  929,  929,  929,
 /*   340 */   929,  929,  929,  929,  929,  929,  722,  929,  929,  929,
 /*   350 */   929,  929,  929,  759,  799,  929,  796,  929,  795,  929,
 /*   360 */   616,  929,  914,  929,  929,  929,  929,  929,  929,  929,
 /*   370 */   929,  929,  929,  917,  929,  929,  929,  929,  929,  929,
 /*   380 */   929,  929,  929,  929,  929,  929,  929,  884,  929,  929,
 /*   390 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*   400 */   929,  883,  929,  929,  929,  671,  644,  694,  690,  693,
 /*   410 */   699,  673,  679,  706,  698,  702,  713,  670,  672,  805,
 /*   420 */   704,  792,  636,  669,  681,  684,  700,  743,  746,  674,
 /*   430 */   755,  877,  754,  703,  682,  859,  676,  882,  683,  687,
 /*   440 */   686,  878,  879,  638,  880,  689,  688,  756,  741,  668,
 /*   450 */   799,  646,  667,  653,  666,  851,  852,  804,  748,  747,
 /*   460 */   739,  729,  856,  783,  784,  761,  876,  701,  889,  764,
 /*   470 */   763,  855,  685,  664,  836,  733,  732,  835,  891,  731,
 /*   480 */   900,  899,  742,  677,  897,  896,  840,  788,  839,  806,
 /*   490 */   790,  803,  657,  658,  874,  892,  872,  697,  873,  871,
 /*   500 */   894,  857,  890,  886,  660,  659,  789,  656,  919,  655,
 /*   510 */   837,  724,  714,  639,  715,  723,  833,  718,  830,  825,
 /*   520 */   860,  823,  822,  901,  817,  735,  834,  831,  824,  774,
 /*   530 */   818,  816,  815,  734,  801,  800,  777,  750,  798,  797,
 /*   540 */   793,  802,  749,  648,  725,  780,  710,  782,  721,  862,
 /*   550 */   720,  791,  727,  726,  863,  864,  865,  866,  869,  870,
 /*   560 */   665,  691,  867,  647,  663,  661,  643,  641,  902,  635,
 /*   570 */   633,  906,  632,  634,  630,  628,  627,  909,  626,  625,
 /*   580 */   911,  821,  624,  760,  838,  651,  912,  745,  650,  649,
 /*   590 */   913,  916,  898,  622,  619,  918,  618,  614,  923,  924,
 /*   600 */   613,  611,  925,  928,  926,  708,  711,  712,  617,  612,
};
#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))

/* The next table maps tokens into fallback tokens.  If a construct
** like the following:
** 
**      %fallback ID X Y Z.
**
** appears in the grammar, then ID becomes a fallback token for X, Y,
** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
** but it does not parse, the type of the token is changed to ID and
** the parse is retried before an error is thrown.
*/
#ifdef YYFALLBACK
static const YYCODETYPE yyFallback[] = {
    0,  /*          $ => nothing */
    0,  /*       SEMI => nothing */
   26,  /*    EXPLAIN => ID */
   26,  /*      QUERY => ID */
   26,  /*       PLAN => ID */
   26,  /*      BEGIN => ID */
    0,  /* TRANSACTION => nothing */
   26,  /*   DEFERRED => ID */
   26,  /*  IMMEDIATE => ID */
   26,  /*  EXCLUSIVE => ID */
    0,  /*     COMMIT => nothing */
   26,  /*        END => ID */
    0,  /*   ROLLBACK => nothing */
    0,  /*  SAVEPOINT => nothing */
    0,  /*    RELEASE => nothing */
    0,  /*         TO => nothing */
    0,  /*     CREATE => nothing */
    0,  /*      TABLE => nothing */
   26,  /*         IF => ID */
    0,  /*        NOT => nothing */
    0,  /*     EXISTS => nothing */
   26,  /*       TEMP => ID */
    0,  /*         LP => nothing */
    0,  /*         RP => nothing */
    0,  /*         AS => nothing */
    0,  /*      COMMA => nothing */
    0,  /*         ID => nothing */
   26,  /*      ABORT => ID */
   26,  /*      AFTER => ID */
   26,  /*    ANALYZE => ID */
   26,  /*        ASC => ID */
   26,  /*     ATTACH => ID */
   26,  /*     BEFORE => ID */
   26,  /*    CASCADE => ID */
   26,  /*       CAST => ID */
   26,  /*   CONFLICT => ID */
   26,  /*   DATABASE => ID */
   26,  /*       DESC => ID */
   26,  /*     DETACH => ID */
   26,  /*       EACH => ID */
   26,  /*       FAIL => ID */
   26,  /*        FOR => ID */
   26,  /*     IGNORE => ID */
   26,  /*  INITIALLY => ID */
   26,  /*    INSTEAD => ID */
   26,  /*    LIKE_KW => ID */
   26,  /*      MATCH => ID */
   26,  /*        KEY => ID */
   26,  /*         OF => ID */
   26,  /*     OFFSET => ID */
   26,  /*     PRAGMA => ID */
   26,  /*      RAISE => ID */
   26,  /*    REPLACE => ID */
   26,  /*   RESTRICT => ID */
   26,  /*        ROW => ID */
   26,  /*    TRIGGER => ID */
   26,  /*     VACUUM => ID */
   26,  /*       VIEW => ID */
   26,  /*    VIRTUAL => ID */
   26,  /*    REINDEX => ID */
   26,  /*     RENAME => ID */
   26,  /*   CTIME_KW => ID */
    0,  /*        ANY => nothing */
    0,  /*         OR => nothing */
    0,  /*        AND => nothing */
    0,  /*         IS => nothing */
    0,  /*    BETWEEN => nothing */
    0,  /*         IN => nothing */
    0,  /*     ISNULL => nothing */
    0,  /*    NOTNULL => nothing */
    0,  /*         NE => nothing */
    0,  /*         EQ => nothing */
    0,  /*         GT => nothing */
    0,  /*         LE => nothing */
    0,  /*         LT => nothing */
    0,  /*         GE => nothing */
    0,  /*     ESCAPE => nothing */
    0,  /*     BITAND => nothing */
    0,  /*      BITOR => nothing */
    0,  /*     LSHIFT => nothing */
    0,  /*     RSHIFT => nothing */
    0,  /*       PLUS => nothing */
    0,  /*      MINUS => nothing */
    0,  /*       STAR => nothing */
    0,  /*      SLASH => nothing */
    0,  /*        REM => nothing */
    0,  /*     CONCAT => nothing */
    0,  /*    COLLATE => nothing */
    0,  /*     UMINUS => nothing */
    0,  /*      UPLUS => nothing */
    0,  /*     BITNOT => nothing */
    0,  /*     STRING => nothing */
    0,  /*    JOIN_KW => nothing */
    0,  /* CONSTRAINT => nothing */
    0,  /*    DEFAULT => nothing */
    0,  /*       NULL => nothing */
    0,  /*    PRIMARY => nothing */
    0,  /*     UNIQUE => nothing */
    0,  /*      CHECK => nothing */
    0,  /* REFERENCES => nothing */
    0,  /*   AUTOINCR => nothing */
    0,  /*         ON => nothing */
    0,  /*     DELETE => nothing */
    0,  /*     UPDATE => nothing */
    0,  /*     INSERT => nothing */
    0,  /*        SET => nothing */
    0,  /* DEFERRABLE => nothing */
    0,  /*    FOREIGN => nothing */
    0,  /*       DROP => nothing */
    0,  /*      UNION => nothing */
    0,  /*        ALL => nothing */
    0,  /*     EXCEPT => nothing */
    0,  /*  INTERSECT => nothing */
    0,  /*     SELECT => nothing */
    0,  /*   DISTINCT => nothing */
    0,  /*        DOT => nothing */
    0,  /*       FROM => nothing */
    0,  /*       JOIN => nothing */
    0,  /*    INDEXED => nothing */
    0,  /*         BY => nothing */
    0,  /*      USING => nothing */
    0,  /*      ORDER => nothing */
    0,  /*      GROUP => nothing */
    0,  /*     HAVING => nothing */
    0,  /*      LIMIT => nothing */
    0,  /*      WHERE => nothing */
    0,  /*       INTO => nothing */
    0,  /*     VALUES => nothing */
    0,  /*    INTEGER => nothing */
    0,  /*      FLOAT => nothing */
    0,  /*       BLOB => nothing */
    0,  /*   REGISTER => nothing */
    0,  /*   VARIABLE => nothing */
    0,  /*       CASE => nothing */
    0,  /*       WHEN => nothing */
    0,  /*       THEN => nothing */
    0,  /*       ELSE => nothing */
    0,  /*      INDEX => nothing */
    0,  /*      ALTER => nothing */
    0,  /*        ADD => nothing */
    0,  /*   COLUMNKW => nothing */
};
#endif /* YYFALLBACK */

/* The following structure represents a single element of the
** parser's stack.  Information stored includes:
**
**   +  The state number for the parser at this level of the stack.
**
**   +  The value of the token stored at this level of the stack.
**      (In other words, the "major" token.)
**
**   +  The semantic value stored at this level of the stack.  This is
**      the information used by the action routines in the grammar.
**      It is sometimes called the "minor" token.
*/
struct yyStackEntry {
  YYACTIONTYPE stateno;  /* The state-number */
  YYCODETYPE major;      /* The major token value.  This is the code
                         ** number for the token at this stack level */
  YYMINORTYPE minor;     /* The user-supplied minor token value.  This
                         ** is the value of the token  */
};
typedef struct yyStackEntry yyStackEntry;

/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
  int yyidx;                    /* Index of top element in stack */
#ifdef YYTRACKMAXSTACKDEPTH
  int yyidxMax;                 /* Maximum value of yyidx */
#endif
  int yyerrcnt;                 /* Shifts left before out of the error */
  sqlite3ParserARG_SDECL                /* A place to hold %extra_argument */
#if YYSTACKDEPTH<=0
  int yystksz;                  /* Current side of the stack */
  yyStackEntry *yystack;        /* The parser's stack */
#else
  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
#endif
};
typedef struct yyParser yyParser;

#ifndef NDEBUG
#include <stdio.h>
static FILE *yyTraceFILE = 0;
static char *yyTracePrompt = 0;
#endif /* NDEBUG */

#ifndef NDEBUG
/* 
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message.  Tracing is turned off
** by making either argument NULL 
**
** Inputs:
** <ul>
** <li> A FILE* to which trace output should be written.
**      If NULL, then tracing is turned off.
** <li> A prefix string written at the beginning of every
**      line of trace output.  If NULL, then tracing is
**      turned off.
** </ul>
**
** Outputs:
** None.
*/
void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
  yyTraceFILE = TraceFILE;
  yyTracePrompt = zTracePrompt;
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
#endif /* NDEBUG */

#ifndef NDEBUG
/* For tracing shifts, the names of all terminals and nonterminals
** are required.  The following table supplies these names */
static const char *const yyTokenName[] = { 
  "$",             "SEMI",          "EXPLAIN",       "QUERY",       
  "PLAN",          "BEGIN",         "TRANSACTION",   "DEFERRED",    
  "IMMEDIATE",     "EXCLUSIVE",     "COMMIT",        "END",         
  "ROLLBACK",      "SAVEPOINT",     "RELEASE",       "TO",          
  "CREATE",        "TABLE",         "IF",            "NOT",         
  "EXISTS",        "TEMP",          "LP",            "RP",          
  "AS",            "COMMA",         "ID",            "ABORT",       
  "AFTER",         "ANALYZE",       "ASC",           "ATTACH",      
  "BEFORE",        "CASCADE",       "CAST",          "CONFLICT",    
  "DATABASE",      "DESC",          "DETACH",        "EACH",        
  "FAIL",          "FOR",           "IGNORE",        "INITIALLY",   
  "INSTEAD",       "LIKE_KW",       "MATCH",         "KEY",         
  "OF",            "OFFSET",        "PRAGMA",        "RAISE",       
  "REPLACE",       "RESTRICT",      "ROW",           "TRIGGER",     
  "VACUUM",        "VIEW",          "VIRTUAL",       "REINDEX",     
  "RENAME",        "CTIME_KW",      "ANY",           "OR",          
  "AND",           "IS",            "BETWEEN",       "IN",          
  "ISNULL",        "NOTNULL",       "NE",            "EQ",          
  "GT",            "LE",            "LT",            "GE",          
  "ESCAPE",        "BITAND",        "BITOR",         "LSHIFT",      
  "RSHIFT",        "PLUS",          "MINUS",         "STAR",        
  "SLASH",         "REM",           "CONCAT",        "COLLATE",     
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
  "JOIN_KW",       "CONSTRAINT",    "DEFAULT",       "NULL",        
  "PRIMARY",       "UNIQUE",        "CHECK",         "REFERENCES",  
  "AUTOINCR",      "ON",            "DELETE",        "UPDATE",      
  "INSERT",        "SET",           "DEFERRABLE",    "FOREIGN",     
  "DROP",          "UNION",         "ALL",           "EXCEPT",      
  "INTERSECT",     "SELECT",        "DISTINCT",      "DOT",         
  "FROM",          "JOIN",          "INDEXED",       "BY",          
  "USING",         "ORDER",         "GROUP",         "HAVING",      
  "LIMIT",         "WHERE",         "INTO",          "VALUES",      
  "INTEGER",       "FLOAT",         "BLOB",          "REGISTER",    
  "VARIABLE",      "CASE",          "WHEN",          "THEN",        
  "ELSE",          "INDEX",         "ALTER",         "ADD",         
  "COLUMNKW",      "error",         "input",         "cmdlist",     
  "ecmd",          "explain",       "cmdx",          "cmd",         
  "transtype",     "trans_opt",     "nm",            "savepoint_opt",
  "create_table",  "create_table_args",  "temp",          "ifnotexists", 
  "dbnm",          "columnlist",    "conslist_opt",  "select",      
  "column",        "columnid",      "type",          "carglist",    
  "id",            "ids",           "typetoken",     "typename",    
  "signed",        "plus_num",      "minus_num",     "carg",        
  "ccons",         "term",          "expr",          "onconf",      
  "sortorder",     "autoinc",       "idxlist_opt",   "refargs",     
  "defer_subclause",  "refarg",        "refact",        "init_deferred_pred_opt",
  "conslist",      "tcons",         "idxlist",       "defer_subclause_opt",
  "orconf",        "resolvetype",   "raisetype",     "ifexists",    
  "fullname",      "oneselect",     "multiselect_op",  "distinct",    
  "selcollist",    "from",          "where_opt",     "groupby_opt", 
  "having_opt",    "orderby_opt",   "limit_opt",     "sclp",        
  "as",            "seltablist",    "stl_prefix",    "joinop",      
  "indexed_opt",   "on_opt",        "using_opt",     "joinop2",     
  "inscollist",    "sortlist",      "sortitem",      "nexprlist",   
  "setlist",       "insert_cmd",    "inscollist_opt",  "itemlist",    
  "exprlist",      "likeop",        "escape",        "between_op",  
  "in_op",         "case_operand",  "case_exprlist",  "case_else",   
  "uniqueflag",    "collate",       "nmnum",         "plus_opt",    
  "number",        "trigger_decl",  "trigger_cmd_list",  "trigger_time",
  "trigger_event",  "foreach_clause",  "when_clause",   "trigger_cmd", 
  "database_kw_opt",  "key_opt",       "add_column_fullname",  "kwcolumn_opt",
  "create_vtab",   "vtabarglist",   "vtabarg",       "vtabargtoken",
  "lp",            "anylist",     
};
#endif /* NDEBUG */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
 /*   0 */ "input ::= cmdlist",
 /*   1 */ "cmdlist ::= cmdlist ecmd",
 /*   2 */ "cmdlist ::= ecmd",
 /*   3 */ "ecmd ::= SEMI",
 /*   4 */ "ecmd ::= explain cmdx SEMI",
 /*   5 */ "explain ::=",
 /*   6 */ "explain ::= EXPLAIN",
 /*   7 */ "explain ::= EXPLAIN QUERY PLAN",
 /*   8 */ "cmdx ::= cmd",
 /*   9 */ "cmd ::= BEGIN transtype trans_opt",
 /*  10 */ "trans_opt ::=",
 /*  11 */ "trans_opt ::= TRANSACTION",
 /*  12 */ "trans_opt ::= TRANSACTION nm",
 /*  13 */ "transtype ::=",
 /*  14 */ "transtype ::= DEFERRED",
 /*  15 */ "transtype ::= IMMEDIATE",
 /*  16 */ "transtype ::= EXCLUSIVE",
 /*  17 */ "cmd ::= COMMIT trans_opt",
 /*  18 */ "cmd ::= END trans_opt",
 /*  19 */ "cmd ::= ROLLBACK trans_opt",
 /*  20 */ "savepoint_opt ::= SAVEPOINT",
 /*  21 */ "savepoint_opt ::=",
 /*  22 */ "cmd ::= SAVEPOINT nm",
 /*  23 */ "cmd ::= RELEASE savepoint_opt nm",
 /*  24 */ "cmd ::= ROLLBACK trans_opt TO savepoint_opt nm",
 /*  25 */ "cmd ::= create_table create_table_args",
 /*  26 */ "create_table ::= CREATE temp TABLE ifnotexists nm dbnm",
 /*  27 */ "ifnotexists ::=",
 /*  28 */ "ifnotexists ::= IF NOT EXISTS",
 /*  29 */ "temp ::= TEMP",
 /*  30 */ "temp ::=",
 /*  31 */ "create_table_args ::= LP columnlist conslist_opt RP",
 /*  32 */ "create_table_args ::= AS select",
 /*  33 */ "columnlist ::= columnlist COMMA column",
 /*  34 */ "columnlist ::= column",
 /*  35 */ "column ::= columnid type carglist",
 /*  36 */ "columnid ::= nm",
 /*  37 */ "id ::= ID",
 /*  38 */ "ids ::= ID|STRING",
 /*  39 */ "nm ::= ID",
 /*  40 */ "nm ::= STRING",
 /*  41 */ "nm ::= JOIN_KW",
 /*  42 */ "type ::=",
 /*  43 */ "type ::= typetoken",
 /*  44 */ "typetoken ::= typename",
 /*  45 */ "typetoken ::= typename LP signed RP",
 /*  46 */ "typetoken ::= typename LP signed COMMA signed RP",
 /*  47 */ "typename ::= ids",
 /*  48 */ "typename ::= typename ids",
 /*  49 */ "signed ::= plus_num",
 /*  50 */ "signed ::= minus_num",
 /*  51 */ "carglist ::= carglist carg",
 /*  52 */ "carglist ::=",
 /*  53 */ "carg ::= CONSTRAINT nm ccons",
 /*  54 */ "carg ::= ccons",
 /*  55 */ "ccons ::= DEFAULT term",
 /*  56 */ "ccons ::= DEFAULT LP expr RP",
 /*  57 */ "ccons ::= DEFAULT PLUS term",
 /*  58 */ "ccons ::= DEFAULT MINUS term",
 /*  59 */ "ccons ::= DEFAULT id",
 /*  60 */ "ccons ::= NULL onconf",
 /*  61 */ "ccons ::= NOT NULL onconf",
 /*  62 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
 /*  63 */ "ccons ::= UNIQUE onconf",
 /*  64 */ "ccons ::= CHECK LP expr RP",
 /*  65 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
 /*  66 */ "ccons ::= defer_subclause",
 /*  67 */ "ccons ::= COLLATE ids",
 /*  68 */ "autoinc ::=",
 /*  69 */ "autoinc ::= AUTOINCR",
 /*  70 */ "refargs ::=",
 /*  71 */ "refargs ::= refargs refarg",
 /*  72 */ "refarg ::= MATCH nm",
 /*  73 */ "refarg ::= ON DELETE refact",
 /*  74 */ "refarg ::= ON UPDATE refact",
 /*  75 */ "refarg ::= ON INSERT refact",
 /*  76 */ "refact ::= SET NULL",
 /*  77 */ "refact ::= SET DEFAULT",
 /*  78 */ "refact ::= CASCADE",
 /*  79 */ "refact ::= RESTRICT",
 /*  80 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
 /*  81 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
 /*  82 */ "init_deferred_pred_opt ::=",
 /*  83 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
 /*  84 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
 /*  85 */ "conslist_opt ::=",
 /*  86 */ "conslist_opt ::= COMMA conslist",
 /*  87 */ "conslist ::= conslist COMMA tcons",
 /*  88 */ "conslist ::= conslist tcons",
 /*  89 */ "conslist ::= tcons",
 /*  90 */ "tcons ::= CONSTRAINT nm",
 /*  91 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
 /*  92 */ "tcons ::= UNIQUE LP idxlist RP onconf",
 /*  93 */ "tcons ::= CHECK LP expr RP onconf",
 /*  94 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
 /*  95 */ "defer_subclause_opt ::=",
 /*  96 */ "defer_subclause_opt ::= defer_subclause",
 /*  97 */ "onconf ::=",
 /*  98 */ "onconf ::= ON CONFLICT resolvetype",
 /*  99 */ "orconf ::=",
 /* 100 */ "orconf ::= OR resolvetype",
 /* 101 */ "resolvetype ::= raisetype",
 /* 102 */ "resolvetype ::= IGNORE",
 /* 103 */ "resolvetype ::= REPLACE",
 /* 104 */ "cmd ::= DROP TABLE ifexists fullname",
 /* 105 */ "ifexists ::= IF EXISTS",
 /* 106 */ "ifexists ::=",
 /* 107 */ "cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select",
 /* 108 */ "cmd ::= DROP VIEW ifexists fullname",
 /* 109 */ "cmd ::= select",
 /* 110 */ "select ::= oneselect",
 /* 111 */ "select ::= select multiselect_op oneselect",
 /* 112 */ "multiselect_op ::= UNION",
 /* 113 */ "multiselect_op ::= UNION ALL",
 /* 114 */ "multiselect_op ::= EXCEPT|INTERSECT",
 /* 115 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
 /* 116 */ "distinct ::= DISTINCT",
 /* 117 */ "distinct ::= ALL",
 /* 118 */ "distinct ::=",
 /* 119 */ "sclp ::= selcollist COMMA",
 /* 120 */ "sclp ::=",
 /* 121 */ "selcollist ::= sclp expr as",
 /* 122 */ "selcollist ::= sclp STAR",
 /* 123 */ "selcollist ::= sclp nm DOT STAR",
 /* 124 */ "as ::= AS nm",
 /* 125 */ "as ::= ids",
 /* 126 */ "as ::=",
 /* 127 */ "from ::=",
 /* 128 */ "from ::= FROM seltablist",
 /* 129 */ "stl_prefix ::= seltablist joinop",
 /* 130 */ "stl_prefix ::=",
 /* 131 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
 /* 132 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
 /* 133 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
 /* 134 */ "dbnm ::=",
 /* 135 */ "dbnm ::= DOT nm",
 /* 136 */ "fullname ::= nm dbnm",
 /* 137 */ "joinop ::= COMMA|JOIN",
 /* 138 */ "joinop ::= JOIN_KW JOIN",
 /* 139 */ "joinop ::= JOIN_KW nm JOIN",
 /* 140 */ "joinop ::= JOIN_KW nm nm JOIN",
 /* 141 */ "on_opt ::= ON expr",
 /* 142 */ "on_opt ::=",
 /* 143 */ "indexed_opt ::=",
 /* 144 */ "indexed_opt ::= INDEXED BY nm",
 /* 145 */ "indexed_opt ::= NOT INDEXED",
 /* 146 */ "using_opt ::= USING LP inscollist RP",
 /* 147 */ "using_opt ::=",
 /* 148 */ "orderby_opt ::=",
 /* 149 */ "orderby_opt ::= ORDER BY sortlist",
 /* 150 */ "sortlist ::= sortlist COMMA sortitem sortorder",
 /* 151 */ "sortlist ::= sortitem sortorder",
 /* 152 */ "sortitem ::= expr",
 /* 153 */ "sortorder ::= ASC",
 /* 154 */ "sortorder ::= DESC",
 /* 155 */ "sortorder ::=",
 /* 156 */ "groupby_opt ::=",
 /* 157 */ "groupby_opt ::= GROUP BY nexprlist",
 /* 158 */ "having_opt ::=",
 /* 159 */ "having_opt ::= HAVING expr",
 /* 160 */ "limit_opt ::=",
 /* 161 */ "limit_opt ::= LIMIT expr",
 /* 162 */ "limit_opt ::= LIMIT expr OFFSET expr",
 /* 163 */ "limit_opt ::= LIMIT expr COMMA expr",
 /* 164 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt",
 /* 165 */ "where_opt ::=",
 /* 166 */ "where_opt ::= WHERE expr",
 /* 167 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt",
 /* 168 */ "setlist ::= setlist COMMA nm EQ expr",
 /* 169 */ "setlist ::= nm EQ expr",
 /* 170 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP",
 /* 171 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
 /* 172 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
 /* 173 */ "insert_cmd ::= INSERT orconf",
 /* 174 */ "insert_cmd ::= REPLACE",
 /* 175 */ "itemlist ::= itemlist COMMA expr",
 /* 176 */ "itemlist ::= expr",
 /* 177 */ "inscollist_opt ::=",
 /* 178 */ "inscollist_opt ::= LP inscollist RP",
 /* 179 */ "inscollist ::= inscollist COMMA nm",
 /* 180 */ "inscollist ::= nm",
 /* 181 */ "expr ::= term",
 /* 182 */ "expr ::= LP expr RP",
 /* 183 */ "term ::= NULL",
 /* 184 */ "expr ::= ID",
 /* 185 */ "expr ::= JOIN_KW",
 /* 186 */ "expr ::= nm DOT nm",
 /* 187 */ "expr ::= nm DOT nm DOT nm",
 /* 188 */ "term ::= INTEGER|FLOAT|BLOB",
 /* 189 */ "term ::= STRING",
 /* 190 */ "expr ::= REGISTER",
 /* 191 */ "expr ::= VARIABLE",
 /* 192 */ "expr ::= expr COLLATE ids",
 /* 193 */ "expr ::= CAST LP expr AS typetoken RP",
 /* 194 */ "expr ::= ID LP distinct exprlist RP",
 /* 195 */ "expr ::= ID LP STAR RP",
 /* 196 */ "term ::= CTIME_KW",
 /* 197 */ "expr ::= expr AND expr",
 /* 198 */ "expr ::= expr OR expr",
 /* 199 */ "expr ::= expr LT|GT|GE|LE expr",
 /* 200 */ "expr ::= expr EQ|NE expr",
 /* 201 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
 /* 202 */ "expr ::= expr PLUS|MINUS expr",
 /* 203 */ "expr ::= expr STAR|SLASH|REM expr",
 /* 204 */ "expr ::= expr CONCAT expr",
 /* 205 */ "likeop ::= LIKE_KW",
 /* 206 */ "likeop ::= NOT LIKE_KW",
 /* 207 */ "likeop ::= MATCH",
 /* 208 */ "likeop ::= NOT MATCH",
 /* 209 */ "escape ::= ESCAPE expr",
 /* 210 */ "escape ::=",
 /* 211 */ "expr ::= expr likeop expr escape",
 /* 212 */ "expr ::= expr ISNULL|NOTNULL",
 /* 213 */ "expr ::= expr IS NULL",
 /* 214 */ "expr ::= expr NOT NULL",
 /* 215 */ "expr ::= expr IS NOT NULL",
 /* 216 */ "expr ::= NOT expr",
 /* 217 */ "expr ::= BITNOT expr",
 /* 218 */ "expr ::= MINUS expr",
 /* 219 */ "expr ::= PLUS expr",
 /* 220 */ "between_op ::= BETWEEN",
 /* 221 */ "between_op ::= NOT BETWEEN",
 /* 222 */ "expr ::= expr between_op expr AND expr",
 /* 223 */ "in_op ::= IN",
 /* 224 */ "in_op ::= NOT IN",
 /* 225 */ "expr ::= expr in_op LP exprlist RP",
 /* 226 */ "expr ::= LP select RP",
 /* 227 */ "expr ::= expr in_op LP select RP",
 /* 228 */ "expr ::= expr in_op nm dbnm",
 /* 229 */ "expr ::= EXISTS LP select RP",
 /* 230 */ "expr ::= CASE case_operand case_exprlist case_else END",
 /* 231 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
 /* 232 */ "case_exprlist ::= WHEN expr THEN expr",
 /* 233 */ "case_else ::= ELSE expr",
 /* 234 */ "case_else ::=",
 /* 235 */ "case_operand ::= expr",
 /* 236 */ "case_operand ::=",
 /* 237 */ "exprlist ::= nexprlist",
 /* 238 */ "exprlist ::=",
 /* 239 */ "nexprlist ::= nexprlist COMMA expr",
 /* 240 */ "nexprlist ::= expr",
 /* 241 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
 /* 242 */ "uniqueflag ::= UNIQUE",
 /* 243 */ "uniqueflag ::=",
 /* 244 */ "idxlist_opt ::=",
 /* 245 */ "idxlist_opt ::= LP idxlist RP",
 /* 246 */ "idxlist ::= idxlist COMMA nm collate sortorder",
 /* 247 */ "idxlist ::= nm collate sortorder",
 /* 248 */ "collate ::=",
 /* 249 */ "collate ::= COLLATE ids",
 /* 250 */ "cmd ::= DROP INDEX ifexists fullname",
 /* 251 */ "cmd ::= VACUUM",
 /* 252 */ "cmd ::= VACUUM nm",
 /* 253 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
 /* 254 */ "cmd ::= PRAGMA nm dbnm EQ ON",
 /* 255 */ "cmd ::= PRAGMA nm dbnm EQ DELETE",
 /* 256 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
 /* 257 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
 /* 258 */ "cmd ::= PRAGMA nm dbnm",
 /* 259 */ "nmnum ::= plus_num",
 /* 260 */ "nmnum ::= nm",
 /* 261 */ "plus_num ::= plus_opt number",
 /* 262 */ "minus_num ::= MINUS number",
 /* 263 */ "number ::= INTEGER|FLOAT",
 /* 264 */ "plus_opt ::= PLUS",
 /* 265 */ "plus_opt ::=",
 /* 266 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END",
 /* 267 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
 /* 268 */ "trigger_time ::= BEFORE",
 /* 269 */ "trigger_time ::= AFTER",
 /* 270 */ "trigger_time ::= INSTEAD OF",
 /* 271 */ "trigger_time ::=",
 /* 272 */ "trigger_event ::= DELETE|INSERT",
 /* 273 */ "trigger_event ::= UPDATE",
 /* 274 */ "trigger_event ::= UPDATE OF inscollist",
 /* 275 */ "foreach_clause ::=",
 /* 276 */ "foreach_clause ::= FOR EACH ROW",
 /* 277 */ "when_clause ::=",
 /* 278 */ "when_clause ::= WHEN expr",
 /* 279 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
 /* 280 */ "trigger_cmd_list ::= trigger_cmd SEMI",
 /* 281 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt",
 /* 282 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP",
 /* 283 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select",
 /* 284 */ "trigger_cmd ::= DELETE FROM nm where_opt",
 /* 285 */ "trigger_cmd ::= select",
 /* 286 */ "expr ::= RAISE LP IGNORE RP",
 /* 287 */ "expr ::= RAISE LP raisetype COMMA nm RP",
 /* 288 */ "raisetype ::= ROLLBACK",
 /* 289 */ "raisetype ::= ABORT",
 /* 290 */ "raisetype ::= FAIL",
 /* 291 */ "cmd ::= DROP TRIGGER ifexists fullname",
 /* 292 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
 /* 293 */ "cmd ::= DETACH database_kw_opt expr",
 /* 294 */ "key_opt ::=",
 /* 295 */ "key_opt ::= KEY expr",
 /* 296 */ "database_kw_opt ::= DATABASE",
 /* 297 */ "database_kw_opt ::=",
 /* 298 */ "cmd ::= REINDEX",
 /* 299 */ "cmd ::= REINDEX nm dbnm",
 /* 300 */ "cmd ::= ANALYZE",
 /* 301 */ "cmd ::= ANALYZE nm dbnm",
 /* 302 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
 /* 303 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
 /* 304 */ "add_column_fullname ::= fullname",
 /* 305 */ "kwcolumn_opt ::=",
 /* 306 */ "kwcolumn_opt ::= COLUMNKW",
 /* 307 */ "cmd ::= create_vtab",
 /* 308 */ "cmd ::= create_vtab LP vtabarglist RP",
 /* 309 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm",
 /* 310 */ "vtabarglist ::= vtabarg",
 /* 311 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
 /* 312 */ "vtabarg ::=",
 /* 313 */ "vtabarg ::= vtabarg vtabargtoken",
 /* 314 */ "vtabargtoken ::= ANY",
 /* 315 */ "vtabargtoken ::= lp anylist RP",
 /* 316 */ "lp ::= LP",
 /* 317 */ "anylist ::=",
 /* 318 */ "anylist ::= anylist ANY",
};
#endif /* NDEBUG */


#if YYSTACKDEPTH<=0
/*
** Try to increase the size of the parser stack.
*/
static void yyGrowStack(yyParser *p){
  int newSize;
  yyStackEntry *pNew;

  newSize = p->yystksz*2 + 100;
  pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
  if( pNew ){
    p->yystack = pNew;
    p->yystksz = newSize;
#ifndef NDEBUG
    if( yyTraceFILE ){
      fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
              yyTracePrompt, p->yystksz);
    }
#endif
  }
}
#endif

/* 
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
**
** Inputs:
** A pointer to the function used to allocate memory.
**
** Outputs:
** A pointer to a parser.  This pointer is used in subsequent calls
** to sqlite3Parser and sqlite3ParserFree.
*/
void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
  yyParser *pParser;
  pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
  if( pParser ){
    pParser->yyidx = -1;
#ifdef YYTRACKMAXSTACKDEPTH
    pParser->yyidxMax = 0;
#endif
#if YYSTACKDEPTH<=0
    pParser->yystack = NULL;
    pParser->yystksz = 0;
    yyGrowStack(pParser);
#endif
  }
  return pParser;
}

/* The following function deletes the value associated with a
** symbol.  The symbol can be either a terminal or nonterminal.
** "yymajor" is the symbol code, and "yypminor" is a pointer to
** the value.
*/
static void yy_destructor(
  yyParser *yypParser,    /* The parser */
  YYCODETYPE yymajor,     /* Type code for object to destroy */
  YYMINORTYPE *yypminor   /* The object to be destroyed */
){
  sqlite3ParserARG_FETCH;
  switch( yymajor ){
    /* Here is inserted the actions which take place when a
    ** terminal or non-terminal is destroyed.  This can happen
    ** when the symbol is popped from the stack during a
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are not used
    ** inside the C code.
    */
    case 159: /* select */
    case 193: /* oneselect */
{
#line 384 "parse.y"
sqlite3SelectDelete(pParse->db, (yypminor->yy159));
#line 1312 "parse.c"
}
      break;
    case 173: /* term */
    case 174: /* expr */
    case 198: /* where_opt */
    case 200: /* having_opt */
    case 209: /* on_opt */
    case 214: /* sortitem */
    case 222: /* escape */
    case 225: /* case_operand */
    case 227: /* case_else */
    case 238: /* when_clause */
    case 241: /* key_opt */
{
#line 695 "parse.y"
sqlite3ExprDelete(pParse->db, (yypminor->yy122));
#line 1329 "parse.c"
}
      break;
    case 178: /* idxlist_opt */
    case 186: /* idxlist */
    case 196: /* selcollist */
    case 199: /* groupby_opt */
    case 201: /* orderby_opt */
    case 203: /* sclp */
    case 213: /* sortlist */
    case 215: /* nexprlist */
    case 216: /* setlist */
    case 219: /* itemlist */
    case 220: /* exprlist */
    case 226: /* case_exprlist */
{
#line 953 "parse.y"
sqlite3ExprListDelete(pParse->db, (yypminor->yy442));
#line 1347 "parse.c"
}
      break;
    case 192: /* fullname */
    case 197: /* from */
    case 205: /* seltablist */
    case 206: /* stl_prefix */
{
#line 513 "parse.y"
sqlite3SrcListDelete(pParse->db, (yypminor->yy347));
#line 1357 "parse.c"
}
      break;
    case 210: /* using_opt */
    case 212: /* inscollist */
    case 218: /* inscollist_opt */
{
#line 545 "parse.y"
sqlite3IdListDelete(pParse->db, (yypminor->yy180));
#line 1366 "parse.c"
}
      break;
    case 234: /* trigger_cmd_list */
    case 239: /* trigger_cmd */
{
#line 1057 "parse.y"
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy327));
#line 1374 "parse.c"
}
      break;
    case 236: /* trigger_event */
{
#line 1043 "parse.y"
sqlite3IdListDelete(pParse->db, (yypminor->yy410).b);
#line 1381 "parse.c"
}
      break;
    default:  break;   /* If no destructor action specified: do nothing */
  }
}

/*
** Pop the parser's stack once.
**
** If there is a destructor routine associated with the token which
** is popped from the stack, then call it.
**
** Return the major token number for the symbol popped.
*/
static int yy_pop_parser_stack(yyParser *pParser){
  YYCODETYPE yymajor;
  yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];

  if( pParser->yyidx<0 ) return 0;
#ifndef NDEBUG
  if( yyTraceFILE && pParser->yyidx>=0 ){
    fprintf(yyTraceFILE,"%sPopping %s\n",
      yyTracePrompt,
      yyTokenName[yytos->major]);
  }
#endif
  yymajor = yytos->major;
  yy_destructor(pParser, yymajor, &yytos->minor);
  pParser->yyidx--;
  return yymajor;
}

/* 
** Deallocate and destroy a parser.  Destructors are all called for
** all stack elements before shutting the parser down.
**
** Inputs:
** <ul>
** <li>  A pointer to the parser.  This should be a pointer
**       obtained from sqlite3ParserAlloc.
** <li>  A pointer to a function used to reclaim memory obtained
**       from malloc.
** </ul>
*/
void sqlite3ParserFree(
  void *p,                    /* The parser to be deleted */
  void (*freeProc)(void*)     /* Function used to reclaim memory */
){
  yyParser *pParser = (yyParser*)p;
  if( pParser==0 ) return;
  while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
  free(pParser->yystack);
#endif
  (*freeProc)((void*)pParser);
}

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
int sqlite3ParserStackPeak(void *p){
  yyParser *pParser = (yyParser*)p;
  return pParser->yyidxMax;
}
#endif

/*
** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead.  If it is, return the action, otherwise
** return YY_NO_ACTION.
*/
static int yy_find_shift_action(
  yyParser *pParser,        /* The parser */
  YYCODETYPE iLookAhead     /* The look-ahead token */
){
  int i;
  int stateno = pParser->yystack[pParser->yyidx].stateno;
 
  if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
    return yy_default[stateno];
  }
  assert( iLookAhead!=YYNOCODE );
  i += iLookAhead;
  if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
    if( iLookAhead>0 ){
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
        }
#endif
        return yy_find_shift_action(pParser, iFallback);
      }
#endif
#ifdef YYWILDCARD
      {
        int j = i - iLookAhead + YYWILDCARD;
        if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){
#ifndef NDEBUG
          if( yyTraceFILE ){
            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
               yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
          }
#endif /* NDEBUG */
          return yy_action[j];
        }
      }
#endif /* YYWILDCARD */
    }
    return yy_default[stateno];
  }else{
    return yy_action[i];
  }
}

/*
** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead.  If it is, return the action, otherwise
** return YY_NO_ACTION.
*/
static int yy_find_reduce_action(
  int stateno,              /* Current state number */
  YYCODETYPE iLookAhead     /* The look-ahead token */
){
  int i;
#ifdef YYERRORSYMBOL
  if( stateno>YY_REDUCE_MAX ){
    return yy_default[stateno];
  }
#else
  assert( stateno<=YY_REDUCE_MAX );
#endif
  i = yy_reduce_ofst[stateno];
  assert( i!=YY_REDUCE_USE_DFLT );
  assert( iLookAhead!=YYNOCODE );
  i += iLookAhead;
#ifdef YYERRORSYMBOL
  if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
    return yy_default[stateno];
  }
#else
  assert( i>=0 && i<YY_SZ_ACTTAB );
  assert( yy_lookahead[i]==iLookAhead );
#endif
  return yy_action[i];
}

/*
** The following routine is called if the stack overflows.
*/
static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
   sqlite3ParserARG_FETCH;
   yypParser->yyidx--;
#ifndef NDEBUG
   if( yyTraceFILE ){
     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
   }
#endif
   while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
   /* Here code is inserted which will execute if the parser
   ** stack every overflows */
#line 40 "parse.y"

  UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
  sqlite3ErrorMsg(pParse, "parser stack overflow");
  pParse->parseError = 1;
#line 1559 "parse.c"
   sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
}

/*
** Perform a shift action.
*/
static void yy_shift(
  yyParser *yypParser,          /* The parser to be shifted */
  int yyNewState,               /* The new state to shift in */
  int yyMajor,                  /* The major token to shift in */
  YYMINORTYPE *yypMinor         /* Pointer to the minor token to shift in */
){
  yyStackEntry *yytos;
  yypParser->yyidx++;
#ifdef YYTRACKMAXSTACKDEPTH
  if( yypParser->yyidx>yypParser->yyidxMax ){
    yypParser->yyidxMax = yypParser->yyidx;
  }
#endif
#if YYSTACKDEPTH>0 
  if( yypParser->yyidx>=YYSTACKDEPTH ){
    yyStackOverflow(yypParser, yypMinor);
    return;
  }
#else
  if( yypParser->yyidx>=yypParser->yystksz ){
    yyGrowStack(yypParser);
    if( yypParser->yyidx>=yypParser->yystksz ){
      yyStackOverflow(yypParser, yypMinor);
      return;
    }
  }
#endif
  yytos = &yypParser->yystack[yypParser->yyidx];
  yytos->stateno = (YYACTIONTYPE)yyNewState;
  yytos->major = (YYCODETYPE)yyMajor;
  yytos->minor = *yypMinor;
#ifndef NDEBUG
  if( yyTraceFILE && yypParser->yyidx>0 ){
    int i;
    fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
    fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
    for(i=1; i<=yypParser->yyidx; i++)
      fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
    fprintf(yyTraceFILE,"\n");
  }
#endif
}

/* The following table contains information about every rule that
** is used during the reduce.
*/
static const struct {
  YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
  unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
} yyRuleInfo[] = {
  { 142, 1 },
  { 143, 2 },
  { 143, 1 },
  { 144, 1 },
  { 144, 3 },
  { 145, 0 },
  { 145, 1 },
  { 145, 3 },
  { 146, 1 },
  { 147, 3 },
  { 149, 0 },
  { 149, 1 },
  { 149, 2 },
  { 148, 0 },
  { 148, 1 },
  { 148, 1 },
  { 148, 1 },
  { 147, 2 },
  { 147, 2 },
  { 147, 2 },
  { 151, 1 },
  { 151, 0 },
  { 147, 2 },
  { 147, 3 },
  { 147, 5 },
  { 147, 2 },
  { 152, 6 },
  { 155, 0 },
  { 155, 3 },
  { 154, 1 },
  { 154, 0 },
  { 153, 4 },
  { 153, 2 },
  { 157, 3 },
  { 157, 1 },
  { 160, 3 },
  { 161, 1 },
  { 164, 1 },
  { 165, 1 },
  { 150, 1 },
  { 150, 1 },
  { 150, 1 },
  { 162, 0 },
  { 162, 1 },
  { 166, 1 },
  { 166, 4 },
  { 166, 6 },
  { 167, 1 },
  { 167, 2 },
  { 168, 1 },
  { 168, 1 },
  { 163, 2 },
  { 163, 0 },
  { 171, 3 },
  { 171, 1 },
  { 172, 2 },
  { 172, 4 },
  { 172, 3 },
  { 172, 3 },
  { 172, 2 },
  { 172, 2 },
  { 172, 3 },
  { 172, 5 },
  { 172, 2 },
  { 172, 4 },
  { 172, 4 },
  { 172, 1 },
  { 172, 2 },
  { 177, 0 },
  { 177, 1 },
  { 179, 0 },
  { 179, 2 },
  { 181, 2 },
  { 181, 3 },
  { 181, 3 },
  { 181, 3 },
  { 182, 2 },
  { 182, 2 },
  { 182, 1 },
  { 182, 1 },
  { 180, 3 },
  { 180, 2 },
  { 183, 0 },
  { 183, 2 },
  { 183, 2 },
  { 158, 0 },
  { 158, 2 },
  { 184, 3 },
  { 184, 2 },
  { 184, 1 },
  { 185, 2 },
  { 185, 7 },
  { 185, 5 },
  { 185, 5 },
  { 185, 10 },
  { 187, 0 },
  { 187, 1 },
  { 175, 0 },
  { 175, 3 },
  { 188, 0 },
  { 188, 2 },
  { 189, 1 },
  { 189, 1 },
  { 189, 1 },
  { 147, 4 },
  { 191, 2 },
  { 191, 0 },
  { 147, 8 },
  { 147, 4 },
  { 147, 1 },
  { 159, 1 },
  { 159, 3 },
  { 194, 1 },
  { 194, 2 },
  { 194, 1 },
  { 193, 9 },
  { 195, 1 },
  { 195, 1 },
  { 195, 0 },
  { 203, 2 },
  { 203, 0 },
  { 196, 3 },
  { 196, 2 },
  { 196, 4 },
  { 204, 2 },
  { 204, 1 },
  { 204, 0 },
  { 197, 0 },
  { 197, 2 },
  { 206, 2 },
  { 206, 0 },
  { 205, 7 },
  { 205, 7 },
  { 205, 7 },
  { 156, 0 },
  { 156, 2 },
  { 192, 2 },
  { 207, 1 },
  { 207, 2 },
  { 207, 3 },
  { 207, 4 },
  { 209, 2 },
  { 209, 0 },
  { 208, 0 },
  { 208, 3 },
  { 208, 2 },
  { 210, 4 },
  { 210, 0 },
  { 201, 0 },
  { 201, 3 },
  { 213, 4 },
  { 213, 2 },
  { 214, 1 },
  { 176, 1 },
  { 176, 1 },
  { 176, 0 },
  { 199, 0 },
  { 199, 3 },
  { 200, 0 },
  { 200, 2 },
  { 202, 0 },
  { 202, 2 },
  { 202, 4 },
  { 202, 4 },
  { 147, 5 },
  { 198, 0 },
  { 198, 2 },
  { 147, 7 },
  { 216, 5 },
  { 216, 3 },
  { 147, 8 },
  { 147, 5 },
  { 147, 6 },
  { 217, 2 },
  { 217, 1 },
  { 219, 3 },
  { 219, 1 },
  { 218, 0 },
  { 218, 3 },
  { 212, 3 },
  { 212, 1 },
  { 174, 1 },
  { 174, 3 },
  { 173, 1 },
  { 174, 1 },
  { 174, 1 },
  { 174, 3 },
  { 174, 5 },
  { 173, 1 },
  { 173, 1 },
  { 174, 1 },
  { 174, 1 },
  { 174, 3 },
  { 174, 6 },
  { 174, 5 },
  { 174, 4 },
  { 173, 1 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 221, 1 },
  { 221, 2 },
  { 221, 1 },
  { 221, 2 },
  { 222, 2 },
  { 222, 0 },
  { 174, 4 },
  { 174, 2 },
  { 174, 3 },
  { 174, 3 },
  { 174, 4 },
  { 174, 2 },
  { 174, 2 },
  { 174, 2 },
  { 174, 2 },
  { 223, 1 },
  { 223, 2 },
  { 174, 5 },
  { 224, 1 },
  { 224, 2 },
  { 174, 5 },
  { 174, 3 },
  { 174, 5 },
  { 174, 4 },
  { 174, 4 },
  { 174, 5 },
  { 226, 5 },
  { 226, 4 },
  { 227, 2 },
  { 227, 0 },
  { 225, 1 },
  { 225, 0 },
  { 220, 1 },
  { 220, 0 },
  { 215, 3 },
  { 215, 1 },
  { 147, 11 },
  { 228, 1 },
  { 228, 0 },
  { 178, 0 },
  { 178, 3 },
  { 186, 5 },
  { 186, 3 },
  { 229, 0 },
  { 229, 2 },
  { 147, 4 },
  { 147, 1 },
  { 147, 2 },
  { 147, 5 },
  { 147, 5 },
  { 147, 5 },
  { 147, 5 },
  { 147, 6 },
  { 147, 3 },
  { 230, 1 },
  { 230, 1 },
  { 169, 2 },
  { 170, 2 },
  { 232, 1 },
  { 231, 1 },
  { 231, 0 },
  { 147, 5 },
  { 233, 11 },
  { 235, 1 },
  { 235, 1 },
  { 235, 2 },
  { 235, 0 },
  { 236, 1 },
  { 236, 1 },
  { 236, 3 },
  { 237, 0 },
  { 237, 3 },
  { 238, 0 },
  { 238, 2 },
  { 234, 3 },
  { 234, 2 },
  { 239, 6 },
  { 239, 8 },
  { 239, 5 },
  { 239, 4 },
  { 239, 1 },
  { 174, 4 },
  { 174, 6 },
  { 190, 1 },
  { 190, 1 },
  { 190, 1 },
  { 147, 4 },
  { 147, 6 },
  { 147, 3 },
  { 241, 0 },
  { 241, 2 },
  { 240, 1 },
  { 240, 0 },
  { 147, 1 },
  { 147, 3 },
  { 147, 1 },
  { 147, 3 },
  { 147, 6 },
  { 147, 6 },
  { 242, 1 },
  { 243, 0 },
  { 243, 1 },
  { 147, 1 },
  { 147, 4 },
  { 244, 7 },
  { 245, 1 },
  { 245, 3 },
  { 246, 0 },
  { 246, 2 },
  { 247, 1 },
  { 247, 3 },
  { 248, 1 },
  { 249, 0 },
  { 249, 2 },
};

static void yy_accept(yyParser*);  /* Forward Declaration */

/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
*/
static void yy_reduce(
  yyParser *yypParser,         /* The parser */
  int yyruleno                 /* Number of the rule by which to reduce */
){
  int yygoto;                     /* The next state */
  int yyact;                      /* The next action */
  YYMINORTYPE yygotominor;        /* The LHS of the rule reduced */
  yyStackEntry *yymsp;            /* The top of the parser's stack */
  int yysize;                     /* Amount to pop the stack */
  sqlite3ParserARG_FETCH;
  yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno>=0 
        && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
    fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
      yyRuleName[yyruleno]);
  }
#endif /* NDEBUG */

  /* Silence complaints from purify about yygotominor being uninitialized
  ** in some cases when it is copied into the stack after the following
  ** switch.  yygotominor is uninitialized when a rule reduces that does
  ** not set the value of its left-hand side nonterminal.  Leaving the
  ** value of the nonterminal uninitialized is utterly harmless as long
  ** as the value is never used.  So really the only thing this code
  ** accomplishes is to quieten purify.  
  **
  ** 2007-01-16:  The wireshark project (www.wireshark.org) reports that
  ** without this code, their parser segfaults.  I'm not sure what there
  ** parser is doing to make this happen.  This is the second bug report
  ** from wireshark this week.  Clearly they are stressing Lemon in ways
  ** that it has not been previously stressed...  (SQLite ticket #2172)
  */
  /*memset(&yygotominor, 0, sizeof(yygotominor));*/
  yygotominor = yyzerominor;


  switch( yyruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  #line <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  #line <lineno> <thisfile>
  **     break;
  */
      case 0: /* input ::= cmdlist */
      case 1: /* cmdlist ::= cmdlist ecmd */
      case 2: /* cmdlist ::= ecmd */
      case 3: /* ecmd ::= SEMI */
      case 4: /* ecmd ::= explain cmdx SEMI */
      case 10: /* trans_opt ::= */
      case 11: /* trans_opt ::= TRANSACTION */
      case 12: /* trans_opt ::= TRANSACTION nm */
      case 20: /* savepoint_opt ::= SAVEPOINT */
      case 21: /* savepoint_opt ::= */
      case 25: /* cmd ::= create_table create_table_args */
      case 33: /* columnlist ::= columnlist COMMA column */
      case 34: /* columnlist ::= column */
      case 42: /* type ::= */
      case 49: /* signed ::= plus_num */
      case 50: /* signed ::= minus_num */
      case 51: /* carglist ::= carglist carg */
      case 52: /* carglist ::= */
      case 53: /* carg ::= CONSTRAINT nm ccons */
      case 54: /* carg ::= ccons */
      case 60: /* ccons ::= NULL onconf */
      case 87: /* conslist ::= conslist COMMA tcons */
      case 88: /* conslist ::= conslist tcons */
      case 89: /* conslist ::= tcons */
      case 90: /* tcons ::= CONSTRAINT nm */
      case 264: /* plus_opt ::= PLUS */
      case 265: /* plus_opt ::= */
      case 275: /* foreach_clause ::= */
      case 276: /* foreach_clause ::= FOR EACH ROW */
      case 296: /* database_kw_opt ::= DATABASE */
      case 297: /* database_kw_opt ::= */
      case 305: /* kwcolumn_opt ::= */
      case 306: /* kwcolumn_opt ::= COLUMNKW */
      case 310: /* vtabarglist ::= vtabarg */
      case 311: /* vtabarglist ::= vtabarglist COMMA vtabarg */
      case 313: /* vtabarg ::= vtabarg vtabargtoken */
      case 317: /* anylist ::= */
#line 93 "parse.y"
{
}
#line 2029 "parse.c"
        break;
      case 5: /* explain ::= */
#line 98 "parse.y"
{ sqlite3BeginParse(pParse, 0); }
#line 2034 "parse.c"
        break;
      case 6: /* explain ::= EXPLAIN */
#line 100 "parse.y"
{ sqlite3BeginParse(pParse, 1); }
#line 2039 "parse.c"
        break;
      case 7: /* explain ::= EXPLAIN QUERY PLAN */
#line 101 "parse.y"
{ sqlite3BeginParse(pParse, 2); }
#line 2044 "parse.c"
        break;
      case 8: /* cmdx ::= cmd */
#line 103 "parse.y"
{ sqlite3FinishCoding(pParse); }
#line 2049 "parse.c"
        break;
      case 9: /* cmd ::= BEGIN transtype trans_opt */
#line 108 "parse.y"
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy392);}
#line 2054 "parse.c"
        break;
      case 13: /* transtype ::= */
#line 113 "parse.y"
{yygotominor.yy392 = TK_DEFERRED;}
#line 2059 "parse.c"
        break;
      case 14: /* transtype ::= DEFERRED */
      case 15: /* transtype ::= IMMEDIATE */
      case 16: /* transtype ::= EXCLUSIVE */
      case 112: /* multiselect_op ::= UNION */
      case 114: /* multiselect_op ::= EXCEPT|INTERSECT */
#line 114 "parse.y"
{yygotominor.yy392 = yymsp[0].major;}
#line 2068 "parse.c"
        break;
      case 17: /* cmd ::= COMMIT trans_opt */
      case 18: /* cmd ::= END trans_opt */
#line 117 "parse.y"
{sqlite3CommitTransaction(pParse);}
#line 2074 "parse.c"
        break;
      case 19: /* cmd ::= ROLLBACK trans_opt */
#line 119 "parse.y"
{sqlite3RollbackTransaction(pParse);}
#line 2079 "parse.c"
        break;
      case 22: /* cmd ::= SAVEPOINT nm */
#line 123 "parse.y"
{
  sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
}
#line 2086 "parse.c"
        break;
      case 23: /* cmd ::= RELEASE savepoint_opt nm */
#line 126 "parse.y"
{
  sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
}
#line 2093 "parse.c"
        break;
      case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
#line 129 "parse.y"
{
  sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
}
#line 2100 "parse.c"
        break;
      case 26: /* create_table ::= CREATE temp TABLE ifnotexists nm dbnm */
#line 136 "parse.y"
{
   sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy392,0,0,yymsp[-2].minor.yy392);
}
#line 2107 "parse.c"
        break;
      case 27: /* ifnotexists ::= */
      case 30: /* temp ::= */
      case 68: /* autoinc ::= */
      case 82: /* init_deferred_pred_opt ::= */
      case 84: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
      case 95: /* defer_subclause_opt ::= */
      case 106: /* ifexists ::= */
      case 117: /* distinct ::= ALL */
      case 118: /* distinct ::= */
      case 220: /* between_op ::= BETWEEN */
      case 223: /* in_op ::= IN */
#line 140 "parse.y"
{yygotominor.yy392 = 0;}
#line 2122 "parse.c"
        break;
      case 28: /* ifnotexists ::= IF NOT EXISTS */
      case 29: /* temp ::= TEMP */
      case 69: /* autoinc ::= AUTOINCR */
      case 83: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
      case 105: /* ifexists ::= IF EXISTS */
      case 116: /* distinct ::= DISTINCT */
      case 221: /* between_op ::= NOT BETWEEN */
      case 224: /* in_op ::= NOT IN */
#line 141 "parse.y"
{yygotominor.yy392 = 1;}
#line 2134 "parse.c"
        break;
      case 31: /* create_table_args ::= LP columnlist conslist_opt RP */
#line 147 "parse.y"
{
  sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
}
#line 2141 "parse.c"
        break;
      case 32: /* create_table_args ::= AS select */
#line 150 "parse.y"
{
  sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy159);
  sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159);
}
#line 2149 "parse.c"
        break;
      case 35: /* column ::= columnid type carglist */
#line 162 "parse.y"
{
  yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
  yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
}
#line 2157 "parse.c"
        break;
      case 36: /* columnid ::= nm */
#line 166 "parse.y"
{
  sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
  yygotominor.yy0 = yymsp[0].minor.yy0;
}
#line 2165 "parse.c"
        break;
      case 37: /* id ::= ID */
      case 38: /* ids ::= ID|STRING */
      case 39: /* nm ::= ID */
      case 40: /* nm ::= STRING */
      case 41: /* nm ::= JOIN_KW */
      case 44: /* typetoken ::= typename */
      case 47: /* typename ::= ids */
      case 124: /* as ::= AS nm */
      case 125: /* as ::= ids */
      case 135: /* dbnm ::= DOT nm */
      case 144: /* indexed_opt ::= INDEXED BY nm */
      case 249: /* collate ::= COLLATE ids */
      case 259: /* nmnum ::= plus_num */
      case 260: /* nmnum ::= nm */
      case 261: /* plus_num ::= plus_opt number */
      case 262: /* minus_num ::= MINUS number */
      case 263: /* number ::= INTEGER|FLOAT */
#line 176 "parse.y"
{yygotominor.yy0 = yymsp[0].minor.yy0;}
#line 2186 "parse.c"
        break;
      case 43: /* type ::= typetoken */
#line 237 "parse.y"
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
#line 2191 "parse.c"
        break;
      case 45: /* typetoken ::= typename LP signed RP */
#line 239 "parse.y"
{
  yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
  yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
}
#line 2199 "parse.c"
        break;
      case 46: /* typetoken ::= typename LP signed COMMA signed RP */
#line 243 "parse.y"
{
  yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
  yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
}
#line 2207 "parse.c"
        break;
      case 48: /* typename ::= typename ids */
#line 249 "parse.y"
{yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
#line 2212 "parse.c"
        break;
      case 55: /* ccons ::= DEFAULT term */
      case 57: /* ccons ::= DEFAULT PLUS term */
#line 260 "parse.y"
{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy122);}
#line 2218 "parse.c"
        break;
      case 56: /* ccons ::= DEFAULT LP expr RP */
#line 261 "parse.y"
{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy122);}
#line 2223 "parse.c"
        break;
      case 58: /* ccons ::= DEFAULT MINUS term */
#line 263 "parse.y"
{
  Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy122, 0, 0);
  sqlite3ExprSpan(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy122->span);
  sqlite3AddDefaultValue(pParse,p);
}
#line 2232 "parse.c"
        break;
      case 59: /* ccons ::= DEFAULT id */
#line 268 "parse.y"
{
  Expr *p = sqlite3PExpr(pParse, TK_STRING, 0, 0, &yymsp[0].minor.yy0);
  sqlite3AddDefaultValue(pParse,p);
}
#line 2240 "parse.c"
        break;
      case 61: /* ccons ::= NOT NULL onconf */
#line 277 "parse.y"
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy392);}
#line 2245 "parse.c"
        break;
      case 62: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
#line 279 "parse.y"
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy392,yymsp[0].minor.yy392,yymsp[-2].minor.yy392);}
#line 2250 "parse.c"
        break;
      case 63: /* ccons ::= UNIQUE onconf */
#line 280 "parse.y"
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy392,0,0,0,0);}
#line 2255 "parse.c"
        break;
      case 64: /* ccons ::= CHECK LP expr RP */
#line 281 "parse.y"
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy122);}
#line 2260 "parse.c"
        break;
      case 65: /* ccons ::= REFERENCES nm idxlist_opt refargs */
#line 283 "parse.y"
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy442,yymsp[0].minor.yy392);}
#line 2265 "parse.c"
        break;
      case 66: /* ccons ::= defer_subclause */
#line 284 "parse.y"
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy392);}
#line 2270 "parse.c"
        break;
      case 67: /* ccons ::= COLLATE ids */
#line 285 "parse.y"
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
#line 2275 "parse.c"
        break;
      case 70: /* refargs ::= */
#line 298 "parse.y"
{ yygotominor.yy392 = OE_Restrict * 0x010101; }
#line 2280 "parse.c"
        break;
      case 71: /* refargs ::= refargs refarg */
#line 299 "parse.y"
{ yygotominor.yy392 = (yymsp[-1].minor.yy392 & ~yymsp[0].minor.yy207.mask) | yymsp[0].minor.yy207.value; }
#line 2285 "parse.c"
        break;
      case 72: /* refarg ::= MATCH nm */
#line 301 "parse.y"
{ yygotominor.yy207.value = 0;     yygotominor.yy207.mask = 0x000000; }
#line 2290 "parse.c"
        break;
      case 73: /* refarg ::= ON DELETE refact */
#line 302 "parse.y"
{ yygotominor.yy207.value = yymsp[0].minor.yy392;     yygotominor.yy207.mask = 0x0000ff; }
#line 2295 "parse.c"
        break;
      case 74: /* refarg ::= ON UPDATE refact */
#line 303 "parse.y"
{ yygotominor.yy207.value = yymsp[0].minor.yy392<<8;  yygotominor.yy207.mask = 0x00ff00; }
#line 2300 "parse.c"
        break;
      case 75: /* refarg ::= ON INSERT refact */
#line 304 "parse.y"
{ yygotominor.yy207.value = yymsp[0].minor.yy392<<16; yygotominor.yy207.mask = 0xff0000; }
#line 2305 "parse.c"
        break;
      case 76: /* refact ::= SET NULL */
#line 306 "parse.y"
{ yygotominor.yy392 = OE_SetNull; }
#line 2310 "parse.c"
        break;
      case 77: /* refact ::= SET DEFAULT */
#line 307 "parse.y"
{ yygotominor.yy392 = OE_SetDflt; }
#line 2315 "parse.c"
        break;
      case 78: /* refact ::= CASCADE */
#line 308 "parse.y"
{ yygotominor.yy392 = OE_Cascade; }
#line 2320 "parse.c"
        break;
      case 79: /* refact ::= RESTRICT */
#line 309 "parse.y"
{ yygotominor.yy392 = OE_Restrict; }
#line 2325 "parse.c"
        break;
      case 80: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
      case 81: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
      case 96: /* defer_subclause_opt ::= defer_subclause */
      case 98: /* onconf ::= ON CONFLICT resolvetype */
      case 100: /* orconf ::= OR resolvetype */
      case 101: /* resolvetype ::= raisetype */
      case 173: /* insert_cmd ::= INSERT orconf */
#line 311 "parse.y"
{yygotominor.yy392 = yymsp[0].minor.yy392;}
#line 2336 "parse.c"
        break;
      case 85: /* conslist_opt ::= */
#line 321 "parse.y"
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
#line 2341 "parse.c"
        break;
      case 86: /* conslist_opt ::= COMMA conslist */
#line 322 "parse.y"
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
#line 2346 "parse.c"
        break;
      case 91: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
#line 328 "parse.y"
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy442,yymsp[0].minor.yy392,yymsp[-2].minor.yy392,0);}
#line 2351 "parse.c"
        break;
      case 92: /* tcons ::= UNIQUE LP idxlist RP onconf */
#line 330 "parse.y"
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy442,yymsp[0].minor.yy392,0,0,0,0);}
#line 2356 "parse.c"
        break;
      case 93: /* tcons ::= CHECK LP expr RP onconf */
#line 331 "parse.y"
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy122);}
#line 2361 "parse.c"
        break;
      case 94: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
#line 333 "parse.y"
{
    sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy442, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy442, yymsp[-1].minor.yy392);
    sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy392);
}
#line 2369 "parse.c"
        break;
      case 97: /* onconf ::= */
      case 99: /* orconf ::= */
#line 347 "parse.y"
{yygotominor.yy392 = OE_Default;}
#line 2375 "parse.c"
        break;
      case 102: /* resolvetype ::= IGNORE */
#line 352 "parse.y"
{yygotominor.yy392 = OE_Ignore;}
#line 2380 "parse.c"
        break;
      case 103: /* resolvetype ::= REPLACE */
      case 174: /* insert_cmd ::= REPLACE */
#line 353 "parse.y"
{yygotominor.yy392 = OE_Replace;}
#line 2386 "parse.c"
        break;
      case 104: /* cmd ::= DROP TABLE ifexists fullname */
#line 357 "parse.y"
{
  sqlite3DropTable(pParse, yymsp[0].minor.yy347, 0, yymsp[-1].minor.yy392);
}
#line 2393 "parse.c"
        break;
      case 107: /* cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select */
#line 367 "parse.y"
{
  sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy159, yymsp[-6].minor.yy392, yymsp[-4].minor.yy392);
}
#line 2400 "parse.c"
        break;
      case 108: /* cmd ::= DROP VIEW ifexists fullname */
#line 370 "parse.y"
{
  sqlite3DropTable(pParse, yymsp[0].minor.yy347, 1, yymsp[-1].minor.yy392);
}
#line 2407 "parse.c"
        break;
      case 109: /* cmd ::= select */
#line 377 "parse.y"
{
  SelectDest dest = {SRT_Output, 0, 0, 0, 0};
  sqlite3Select(pParse, yymsp[0].minor.yy159, &dest);
  sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159);
}
#line 2416 "parse.c"
        break;
      case 110: /* select ::= oneselect */
#line 388 "parse.y"
{yygotominor.yy159 = yymsp[0].minor.yy159;}
#line 2421 "parse.c"
        break;
      case 111: /* select ::= select multiselect_op oneselect */
#line 390 "parse.y"
{
  if( yymsp[0].minor.yy159 ){
    yymsp[0].minor.yy159->op = (u8)yymsp[-1].minor.yy392;
    yymsp[0].minor.yy159->pPrior = yymsp[-2].minor.yy159;
  }else{
    sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy159);
  }
  yygotominor.yy159 = yymsp[0].minor.yy159;
}
#line 2434 "parse.c"
        break;
      case 113: /* multiselect_op ::= UNION ALL */
#line 401 "parse.y"
{yygotominor.yy392 = TK_ALL;}
#line 2439 "parse.c"
        break;
      case 115: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
#line 405 "parse.y"
{
  yygotominor.yy159 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy442,yymsp[-5].minor.yy347,yymsp[-4].minor.yy122,yymsp[-3].minor.yy442,yymsp[-2].minor.yy122,yymsp[-1].minor.yy442,yymsp[-7].minor.yy392,yymsp[0].minor.yy64.pLimit,yymsp[0].minor.yy64.pOffset);
}
#line 2446 "parse.c"
        break;
      case 119: /* sclp ::= selcollist COMMA */
      case 245: /* idxlist_opt ::= LP idxlist RP */
#line 426 "parse.y"
{yygotominor.yy442 = yymsp[-1].minor.yy442;}
#line 2452 "parse.c"
        break;
      case 120: /* sclp ::= */
      case 148: /* orderby_opt ::= */
      case 156: /* groupby_opt ::= */
      case 238: /* exprlist ::= */
      case 244: /* idxlist_opt ::= */
#line 427 "parse.y"
{yygotominor.yy442 = 0;}
#line 2461 "parse.c"
        break;
      case 121: /* selcollist ::= sclp expr as */
#line 428 "parse.y"
{
   yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy442,yymsp[-1].minor.yy122,yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
}
#line 2468 "parse.c"
        break;
      case 122: /* selcollist ::= sclp STAR */
#line 431 "parse.y"
{
  Expr *p = sqlite3PExpr(pParse, TK_ALL, 0, 0, 0);
  yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy442, p, 0);
}
#line 2476 "parse.c"
        break;
      case 123: /* selcollist ::= sclp nm DOT STAR */
#line 435 "parse.y"
{
  Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
  Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442, pDot, 0);
}
#line 2486 "parse.c"
        break;
      case 126: /* as ::= */
#line 448 "parse.y"
{yygotominor.yy0.n = 0;}
#line 2491 "parse.c"
        break;
      case 127: /* from ::= */
#line 460 "parse.y"
{yygotominor.yy347 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy347));}
#line 2496 "parse.c"
        break;
      case 128: /* from ::= FROM seltablist */
#line 461 "parse.y"
{
  yygotominor.yy347 = yymsp[0].minor.yy347;
  sqlite3SrcListShiftJoinType(yygotominor.yy347);
}
#line 2504 "parse.c"
        break;
      case 129: /* stl_prefix ::= seltablist joinop */
#line 469 "parse.y"
{
   yygotominor.yy347 = yymsp[-1].minor.yy347;
   if( yygotominor.yy347 && yygotominor.yy347->nSrc>0 ) yygotominor.yy347->a[yygotominor.yy347->nSrc-1].jointype = (u8)yymsp[0].minor.yy392;
}
#line 2512 "parse.c"
        break;
      case 130: /* stl_prefix ::= */
#line 473 "parse.y"
{yygotominor.yy347 = 0;}
#line 2517 "parse.c"
        break;
      case 131: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
#line 474 "parse.y"
{
  yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy122,yymsp[0].minor.yy180);
  sqlite3SrcListIndexedBy(pParse, yygotominor.yy347, &yymsp[-2].minor.yy0);
}
#line 2525 "parse.c"
        break;
      case 132: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
#line 480 "parse.y"
{
    yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy159,yymsp[-1].minor.yy122,yymsp[0].minor.yy180);
  }
#line 2532 "parse.c"
        break;
      case 133: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
#line 484 "parse.y"
{
    if( yymsp[-6].minor.yy347==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy122==0 && yymsp[0].minor.yy180==0 ){
      yygotominor.yy347 = yymsp[-4].minor.yy347;
    }else{
      Select *pSubquery;
      sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy347);
      pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy347,0,0,0,0,0,0,0);
      yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy122,yymsp[0].minor.yy180);
    }
  }
#line 2546 "parse.c"
        break;
      case 134: /* dbnm ::= */
      case 143: /* indexed_opt ::= */
#line 509 "parse.y"
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
#line 2552 "parse.c"
        break;
      case 136: /* fullname ::= nm dbnm */
#line 514 "parse.y"
{yygotominor.yy347 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
#line 2557 "parse.c"
        break;
      case 137: /* joinop ::= COMMA|JOIN */
#line 518 "parse.y"
{ yygotominor.yy392 = JT_INNER; }
#line 2562 "parse.c"
        break;
      case 138: /* joinop ::= JOIN_KW JOIN */
#line 519 "parse.y"
{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
#line 2567 "parse.c"
        break;
      case 139: /* joinop ::= JOIN_KW nm JOIN */
#line 520 "parse.y"
{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
#line 2572 "parse.c"
        break;
      case 140: /* joinop ::= JOIN_KW nm nm JOIN */
#line 522 "parse.y"
{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
#line 2577 "parse.c"
        break;
      case 141: /* on_opt ::= ON expr */
      case 152: /* sortitem ::= expr */
      case 159: /* having_opt ::= HAVING expr */
      case 166: /* where_opt ::= WHERE expr */
      case 181: /* expr ::= term */
      case 209: /* escape ::= ESCAPE expr */
      case 233: /* case_else ::= ELSE expr */
      case 235: /* case_operand ::= expr */
#line 526 "parse.y"
{yygotominor.yy122 = yymsp[0].minor.yy122;}
#line 2589 "parse.c"
        break;
      case 142: /* on_opt ::= */
      case 158: /* having_opt ::= */
      case 165: /* where_opt ::= */
      case 210: /* escape ::= */
      case 234: /* case_else ::= */
      case 236: /* case_operand ::= */
#line 527 "parse.y"
{yygotominor.yy122 = 0;}
#line 2599 "parse.c"
        break;
      case 145: /* indexed_opt ::= NOT INDEXED */
#line 542 "parse.y"
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
#line 2604 "parse.c"
        break;
      case 146: /* using_opt ::= USING LP inscollist RP */
      case 178: /* inscollist_opt ::= LP inscollist RP */
#line 546 "parse.y"
{yygotominor.yy180 = yymsp[-1].minor.yy180;}
#line 2610 "parse.c"
        break;
      case 147: /* using_opt ::= */
      case 177: /* inscollist_opt ::= */
#line 547 "parse.y"
{yygotominor.yy180 = 0;}
#line 2616 "parse.c"
        break;
      case 149: /* orderby_opt ::= ORDER BY sortlist */
      case 157: /* groupby_opt ::= GROUP BY nexprlist */
      case 237: /* exprlist ::= nexprlist */
#line 558 "parse.y"
{yygotominor.yy442 = yymsp[0].minor.yy442;}
#line 2623 "parse.c"
        break;
      case 150: /* sortlist ::= sortlist COMMA sortitem sortorder */
#line 559 "parse.y"
{
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442,yymsp[-1].minor.yy122,0);
  if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392;
}
#line 2631 "parse.c"
        break;
      case 151: /* sortlist ::= sortitem sortorder */
#line 563 "parse.y"
{
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy122,0);
  if( yygotominor.yy442 && yygotominor.yy442->a ) yygotominor.yy442->a[0].sortOrder = (u8)yymsp[0].minor.yy392;
}
#line 2639 "parse.c"
        break;
      case 153: /* sortorder ::= ASC */
      case 155: /* sortorder ::= */
#line 571 "parse.y"
{yygotominor.yy392 = SQLITE_SO_ASC;}
#line 2645 "parse.c"
        break;
      case 154: /* sortorder ::= DESC */
#line 572 "parse.y"
{yygotominor.yy392 = SQLITE_SO_DESC;}
#line 2650 "parse.c"
        break;
      case 160: /* limit_opt ::= */
#line 598 "parse.y"
{yygotominor.yy64.pLimit = 0; yygotominor.yy64.pOffset = 0;}
#line 2655 "parse.c"
        break;
      case 161: /* limit_opt ::= LIMIT expr */
#line 599 "parse.y"
{yygotominor.yy64.pLimit = yymsp[0].minor.yy122; yygotominor.yy64.pOffset = 0;}
#line 2660 "parse.c"
        break;
      case 162: /* limit_opt ::= LIMIT expr OFFSET expr */
#line 601 "parse.y"
{yygotominor.yy64.pLimit = yymsp[-2].minor.yy122; yygotominor.yy64.pOffset = yymsp[0].minor.yy122;}
#line 2665 "parse.c"
        break;
      case 163: /* limit_opt ::= LIMIT expr COMMA expr */
#line 603 "parse.y"
{yygotominor.yy64.pOffset = yymsp[-2].minor.yy122; yygotominor.yy64.pLimit = yymsp[0].minor.yy122;}
#line 2670 "parse.c"
        break;
      case 164: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
#line 616 "parse.y"
{
  sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy347, &yymsp[-1].minor.yy0);
  sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy347,yymsp[0].minor.yy122);
}
#line 2678 "parse.c"
        break;
      case 167: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
#line 639 "parse.y"
{
  sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy347, &yymsp[-3].minor.yy0);
  sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy442,"set list"); 
  sqlite3Update(pParse,yymsp[-4].minor.yy347,yymsp[-1].minor.yy442,yymsp[0].minor.yy122,yymsp[-5].minor.yy392);
}
#line 2687 "parse.c"
        break;
      case 168: /* setlist ::= setlist COMMA nm EQ expr */
#line 650 "parse.y"
{yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442,yymsp[0].minor.yy122,&yymsp[-2].minor.yy0);}
#line 2692 "parse.c"
        break;
      case 169: /* setlist ::= nm EQ expr */
#line 652 "parse.y"
{yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy122,&yymsp[-2].minor.yy0);}
#line 2697 "parse.c"
        break;
      case 170: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
#line 658 "parse.y"
{sqlite3Insert(pParse, yymsp[-5].minor.yy347, yymsp[-1].minor.yy442, 0, yymsp[-4].minor.yy180, yymsp[-7].minor.yy392);}
#line 2702 "parse.c"
        break;
      case 171: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
#line 660 "parse.y"
{sqlite3Insert(pParse, yymsp[-2].minor.yy347, 0, yymsp[0].minor.yy159, yymsp[-1].minor.yy180, yymsp[-4].minor.yy392);}
#line 2707 "parse.c"
        break;
      case 172: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
#line 662 "parse.y"
{sqlite3Insert(pParse, yymsp[-3].minor.yy347, 0, 0, yymsp[-2].minor.yy180, yymsp[-5].minor.yy392);}
#line 2712 "parse.c"
        break;
      case 175: /* itemlist ::= itemlist COMMA expr */
      case 239: /* nexprlist ::= nexprlist COMMA expr */
#line 673 "parse.y"
{yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy442,yymsp[0].minor.yy122,0);}
#line 2718 "parse.c"
        break;
      case 176: /* itemlist ::= expr */
      case 240: /* nexprlist ::= expr */
#line 675 "parse.y"
{yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy122,0);}
#line 2724 "parse.c"
        break;
      case 179: /* inscollist ::= inscollist COMMA nm */
#line 685 "parse.y"
{yygotominor.yy180 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy180,&yymsp[0].minor.yy0);}
#line 2729 "parse.c"
        break;
      case 180: /* inscollist ::= nm */
#line 687 "parse.y"
{yygotominor.yy180 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
#line 2734 "parse.c"
        break;
      case 182: /* expr ::= LP expr RP */
#line 698 "parse.y"
{yygotominor.yy122 = yymsp[-1].minor.yy122; sqlite3ExprSpan(yygotominor.yy122,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); }
#line 2739 "parse.c"
        break;
      case 183: /* term ::= NULL */
      case 188: /* term ::= INTEGER|FLOAT|BLOB */
      case 189: /* term ::= STRING */
#line 699 "parse.y"
{yygotominor.yy122 = sqlite3PExpr(pParse, yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);}
#line 2746 "parse.c"
        break;
      case 184: /* expr ::= ID */
      case 185: /* expr ::= JOIN_KW */
#line 700 "parse.y"
{yygotominor.yy122 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);}
#line 2752 "parse.c"
        break;
      case 186: /* expr ::= nm DOT nm */
#line 702 "parse.y"
{
  Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
}
#line 2761 "parse.c"
        break;
      case 187: /* expr ::= nm DOT nm DOT nm */
#line 707 "parse.y"
{
  Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
  Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
  Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
}
#line 2772 "parse.c"
        break;
      case 190: /* expr ::= REGISTER */
#line 716 "parse.y"
{yygotominor.yy122 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);}
#line 2777 "parse.c"
        break;
      case 191: /* expr ::= VARIABLE */
#line 717 "parse.y"
{
  Token *pToken = &yymsp[0].minor.yy0;
  Expr *pExpr = yygotominor.yy122 = sqlite3PExpr(pParse, TK_VARIABLE, 0, 0, pToken);
  sqlite3ExprAssignVarNumber(pParse, pExpr);
}
#line 2786 "parse.c"
        break;
      case 192: /* expr ::= expr COLLATE ids */
#line 722 "parse.y"
{
  yygotominor.yy122 = sqlite3ExprSetColl(pParse, yymsp[-2].minor.yy122, &yymsp[0].minor.yy0);
}
#line 2793 "parse.c"
        break;
      case 193: /* expr ::= CAST LP expr AS typetoken RP */
#line 726 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy122, 0, &yymsp[-1].minor.yy0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
}
#line 2801 "parse.c"
        break;
      case 194: /* expr ::= ID LP distinct exprlist RP */
#line 731 "parse.y"
{
  if( yymsp[-1].minor.yy442 && yymsp[-1].minor.yy442->nExpr>SQLITE_MAX_FUNCTION_ARG ){
    sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
  }
  yygotominor.yy122 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy442, &yymsp[-4].minor.yy0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
  if( yymsp[-2].minor.yy392 && yygotominor.yy122 ){
    yygotominor.yy122->flags |= EP_Distinct;
  }
}
#line 2815 "parse.c"
        break;
      case 195: /* expr ::= ID LP STAR RP */
#line 741 "parse.y"
{
  yygotominor.yy122 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
}
#line 2823 "parse.c"
        break;
      case 196: /* term ::= CTIME_KW */
#line 745 "parse.y"
{
  /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
  ** treated as functions that return constants */
  yygotominor.yy122 = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
  if( yygotominor.yy122 ){
    yygotominor.yy122->op = TK_CONST_FUNC;  
    yygotominor.yy122->span = yymsp[0].minor.yy0;
  }
}
#line 2836 "parse.c"
        break;
      case 197: /* expr ::= expr AND expr */
      case 198: /* expr ::= expr OR expr */
      case 199: /* expr ::= expr LT|GT|GE|LE expr */
      case 200: /* expr ::= expr EQ|NE expr */
      case 201: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
      case 202: /* expr ::= expr PLUS|MINUS expr */
      case 203: /* expr ::= expr STAR|SLASH|REM expr */
      case 204: /* expr ::= expr CONCAT expr */
#line 754 "parse.y"
{yygotominor.yy122 = sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy122,yymsp[0].minor.yy122,0);}
#line 2848 "parse.c"
        break;
      case 205: /* likeop ::= LIKE_KW */
      case 207: /* likeop ::= MATCH */
#line 766 "parse.y"
{yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.not = 0;}
#line 2854 "parse.c"
        break;
      case 206: /* likeop ::= NOT LIKE_KW */
      case 208: /* likeop ::= NOT MATCH */
#line 767 "parse.y"
{yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.not = 1;}
#line 2860 "parse.c"
        break;
      case 211: /* expr ::= expr likeop expr escape */
#line 774 "parse.y"
{
  ExprList *pList;
  pList = sqlite3ExprListAppend(pParse,0, yymsp[-1].minor.yy122, 0);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[-3].minor.yy122, 0);
  if( yymsp[0].minor.yy122 ){
    pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy122, 0);
  }
  yygotominor.yy122 = sqlite3ExprFunction(pParse, pList, &yymsp[-2].minor.yy318.eOperator);
  if( yymsp[-2].minor.yy318.not ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122, &yymsp[-3].minor.yy122->span, &yymsp[-1].minor.yy122->span);
  if( yygotominor.yy122 ) yygotominor.yy122->flags |= EP_InfixFunc;
}
#line 2876 "parse.c"
        break;
      case 212: /* expr ::= expr ISNULL|NOTNULL */
#line 787 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, yymsp[0].major, yymsp[-1].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-1].minor.yy122->span,&yymsp[0].minor.yy0);
}
#line 2884 "parse.c"
        break;
      case 213: /* expr ::= expr IS NULL */
#line 791 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_ISNULL, yymsp[-2].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-2].minor.yy122->span,&yymsp[0].minor.yy0);
}
#line 2892 "parse.c"
        break;
      case 214: /* expr ::= expr NOT NULL */
#line 795 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-2].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-2].minor.yy122->span,&yymsp[0].minor.yy0);
}
#line 2900 "parse.c"
        break;
      case 215: /* expr ::= expr IS NOT NULL */
#line 799 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-3].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-3].minor.yy122->span,&yymsp[0].minor.yy0);
}
#line 2908 "parse.c"
        break;
      case 216: /* expr ::= NOT expr */
      case 217: /* expr ::= BITNOT expr */
#line 803 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy122->span);
}
#line 2917 "parse.c"
        break;
      case 218: /* expr ::= MINUS expr */
#line 811 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy122->span);
}
#line 2925 "parse.c"
        break;
      case 219: /* expr ::= PLUS expr */
#line 815 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy122->span);
}
#line 2933 "parse.c"
        break;
      case 222: /* expr ::= expr between_op expr AND expr */
#line 822 "parse.y"
{
  ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy122, 0);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy122, 0);
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy122, 0, 0);
  if( yygotominor.yy122 ){
    yygotominor.yy122->pList = pList;
  }else{
    sqlite3ExprListDelete(pParse->db, pList);
  } 
  if( yymsp[-3].minor.yy392 ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-4].minor.yy122->span,&yymsp[0].minor.yy122->span);
}
#line 2949 "parse.c"
        break;
      case 225: /* expr ::= expr in_op LP exprlist RP */
#line 838 "parse.y"
{
    yygotominor.yy122 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy122, 0, 0);
    if( yygotominor.yy122 ){
      yygotominor.yy122->pList = yymsp[-1].minor.yy442;
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy442);
    }
    if( yymsp[-3].minor.yy392 ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
    sqlite3ExprSpan(yygotominor.yy122,&yymsp[-4].minor.yy122->span,&yymsp[0].minor.yy0);
  }
#line 2964 "parse.c"
        break;
      case 226: /* expr ::= LP select RP */
#line 849 "parse.y"
{
    yygotominor.yy122 = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
    if( yygotominor.yy122 ){
      yygotominor.yy122->pSelect = yymsp[-1].minor.yy159;
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159);
    }
    sqlite3ExprSpan(yygotominor.yy122,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
  }
#line 2978 "parse.c"
        break;
      case 227: /* expr ::= expr in_op LP select RP */
#line 859 "parse.y"
{
    yygotominor.yy122 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy122, 0, 0);
    if( yygotominor.yy122 ){
      yygotominor.yy122->pSelect = yymsp[-1].minor.yy159;
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159);
    }
    if( yymsp[-3].minor.yy392 ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
    sqlite3ExprSpan(yygotominor.yy122,&yymsp[-4].minor.yy122->span,&yymsp[0].minor.yy0);
  }
#line 2993 "parse.c"
        break;
      case 228: /* expr ::= expr in_op nm dbnm */
#line 870 "parse.y"
{
    SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
    yygotominor.yy122 = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy122, 0, 0);
    if( yygotominor.yy122 ){
      yygotominor.yy122->pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3SrcListDelete(pParse->db, pSrc);
    }
    if( yymsp[-2].minor.yy392 ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
    sqlite3ExprSpan(yygotominor.yy122,&yymsp[-3].minor.yy122->span,yymsp[0].minor.yy0.z?&yymsp[0].minor.yy0:&yymsp[-1].minor.yy0);
  }
#line 3009 "parse.c"
        break;
      case 229: /* expr ::= EXISTS LP select RP */
#line 882 "parse.y"
{
    Expr *p = yygotominor.yy122 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
    if( p ){
      p->pSelect = yymsp[-1].minor.yy159;
      sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159);
    }
  }
#line 3023 "parse.c"
        break;
      case 230: /* expr ::= CASE case_operand case_exprlist case_else END */
#line 895 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy122, yymsp[-1].minor.yy122, 0);
  if( yygotominor.yy122 ){
    yygotominor.yy122->pList = yymsp[-2].minor.yy442;
    sqlite3ExprSetHeight(pParse, yygotominor.yy122);
  }else{
    sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy442);
  }
  sqlite3ExprSpan(yygotominor.yy122, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
}
#line 3037 "parse.c"
        break;
      case 231: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
#line 907 "parse.y"
{
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, yymsp[-2].minor.yy122, 0);
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].minor.yy122, 0);
}
#line 3045 "parse.c"
        break;
      case 232: /* case_exprlist ::= WHEN expr THEN expr */
#line 911 "parse.y"
{
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy122, 0);
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].minor.yy122, 0);
}
#line 3053 "parse.c"
        break;
      case 241: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
#line 940 "parse.y"
{
  sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, 
                     sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy442, yymsp[-9].minor.yy392,
                      &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy392);
}
#line 3062 "parse.c"
        break;
      case 242: /* uniqueflag ::= UNIQUE */
      case 289: /* raisetype ::= ABORT */
#line 947 "parse.y"
{yygotominor.yy392 = OE_Abort;}
#line 3068 "parse.c"
        break;
      case 243: /* uniqueflag ::= */
#line 948 "parse.y"
{yygotominor.yy392 = OE_None;}
#line 3073 "parse.c"
        break;
      case 246: /* idxlist ::= idxlist COMMA nm collate sortorder */
#line 957 "parse.y"
{
  Expr *p = 0;
  if( yymsp[-1].minor.yy0.n>0 ){
    p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
    sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0);
  }
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, p, &yymsp[-2].minor.yy0);
  sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index");
  if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392;
}
#line 3087 "parse.c"
        break;
      case 247: /* idxlist ::= nm collate sortorder */
#line 967 "parse.y"
{
  Expr *p = 0;
  if( yymsp[-1].minor.yy0.n>0 ){
    p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
    sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0);
  }
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, p, &yymsp[-2].minor.yy0);
  sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index");
  if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392;
}
#line 3101 "parse.c"
        break;
      case 248: /* collate ::= */
#line 979 "parse.y"
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
#line 3106 "parse.c"
        break;
      case 250: /* cmd ::= DROP INDEX ifexists fullname */
#line 985 "parse.y"
{sqlite3DropIndex(pParse, yymsp[0].minor.yy347, yymsp[-1].minor.yy392);}
#line 3111 "parse.c"
        break;
      case 251: /* cmd ::= VACUUM */
      case 252: /* cmd ::= VACUUM nm */
#line 991 "parse.y"
{sqlite3Vacuum(pParse);}
#line 3117 "parse.c"
        break;
      case 253: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
      case 254: /* cmd ::= PRAGMA nm dbnm EQ ON */
      case 255: /* cmd ::= PRAGMA nm dbnm EQ DELETE */
#line 1000 "parse.y"
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
#line 3124 "parse.c"
        break;
      case 256: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
#line 1003 "parse.y"
{
  sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);
}
#line 3131 "parse.c"
        break;
      case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
#line 1006 "parse.y"
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
#line 3136 "parse.c"
        break;
      case 258: /* cmd ::= PRAGMA nm dbnm */
#line 1007 "parse.y"
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
#line 3141 "parse.c"
        break;
      case 266: /* cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END */
#line 1022 "parse.y"
{
  Token all;
  all.z = yymsp[-3].minor.yy0.z;
  all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
  sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy327, &all);
}
#line 3151 "parse.c"
        break;
      case 267: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
#line 1031 "parse.y"
{
  sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy392, yymsp[-4].minor.yy410.a, yymsp[-4].minor.yy410.b, yymsp[-2].minor.yy347, yymsp[0].minor.yy122, yymsp[-10].minor.yy392, yymsp[-8].minor.yy392);
  yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
}
#line 3159 "parse.c"
        break;
      case 268: /* trigger_time ::= BEFORE */
      case 271: /* trigger_time ::= */
#line 1037 "parse.y"
{ yygotominor.yy392 = TK_BEFORE; }
#line 3165 "parse.c"
        break;
      case 269: /* trigger_time ::= AFTER */
#line 1038 "parse.y"
{ yygotominor.yy392 = TK_AFTER;  }
#line 3170 "parse.c"
        break;
      case 270: /* trigger_time ::= INSTEAD OF */
#line 1039 "parse.y"
{ yygotominor.yy392 = TK_INSTEAD;}
#line 3175 "parse.c"
        break;
      case 272: /* trigger_event ::= DELETE|INSERT */
      case 273: /* trigger_event ::= UPDATE */
#line 1044 "parse.y"
{yygotominor.yy410.a = yymsp[0].major; yygotominor.yy410.b = 0;}
#line 3181 "parse.c"
        break;
      case 274: /* trigger_event ::= UPDATE OF inscollist */
#line 1046 "parse.y"
{yygotominor.yy410.a = TK_UPDATE; yygotominor.yy410.b = yymsp[0].minor.yy180;}
#line 3186 "parse.c"
        break;
      case 277: /* when_clause ::= */
      case 294: /* key_opt ::= */
#line 1053 "parse.y"
{ yygotominor.yy122 = 0; }
#line 3192 "parse.c"
        break;
      case 278: /* when_clause ::= WHEN expr */
      case 295: /* key_opt ::= KEY expr */
#line 1054 "parse.y"
{ yygotominor.yy122 = yymsp[0].minor.yy122; }
#line 3198 "parse.c"
        break;
      case 279: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
#line 1058 "parse.y"
{
/*
  if( yymsp[-2].minor.yy327 ){
    yymsp[-2].minor.yy327->pLast->pNext = yymsp[-1].minor.yy327;
  }else{
    yymsp[-2].minor.yy327 = yymsp[-1].minor.yy327;
  }
*/
  assert( yymsp[-2].minor.yy327!=0 );
  yymsp[-2].minor.yy327->pLast->pNext = yymsp[-1].minor.yy327;
  yymsp[-2].minor.yy327->pLast = yymsp[-1].minor.yy327;
  yygotominor.yy327 = yymsp[-2].minor.yy327;
}
#line 3215 "parse.c"
        break;
      case 280: /* trigger_cmd_list ::= trigger_cmd SEMI */
#line 1071 "parse.y"
{ 
  /* if( yymsp[-1].minor.yy327 ) */
  assert( yymsp[-1].minor.yy327!=0 );
  yymsp[-1].minor.yy327->pLast = yymsp[-1].minor.yy327;
  yygotominor.yy327 = yymsp[-1].minor.yy327;
}
#line 3225 "parse.c"
        break;
      case 281: /* trigger_cmd ::= UPDATE orconf nm SET setlist where_opt */
#line 1082 "parse.y"
{ yygotominor.yy327 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy442, yymsp[0].minor.yy122, yymsp[-4].minor.yy392); }
#line 3230 "parse.c"
        break;
      case 282: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP */
#line 1087 "parse.y"
{yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy180, yymsp[-1].minor.yy442, 0, yymsp[-7].minor.yy392);}
#line 3235 "parse.c"
        break;
      case 283: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt select */
#line 1090 "parse.y"
{yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy180, 0, yymsp[0].minor.yy159, yymsp[-4].minor.yy392);}
#line 3240 "parse.c"
        break;
      case 284: /* trigger_cmd ::= DELETE FROM nm where_opt */
#line 1094 "parse.y"
{yygotominor.yy327 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-1].minor.yy0, yymsp[0].minor.yy122);}
#line 3245 "parse.c"
        break;
      case 285: /* trigger_cmd ::= select */
#line 1097 "parse.y"
{yygotominor.yy327 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy159); }
#line 3250 "parse.c"
        break;
      case 286: /* expr ::= RAISE LP IGNORE RP */
#line 1100 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); 
  if( yygotominor.yy122 ){
    yygotominor.yy122->iColumn = OE_Ignore;
    sqlite3ExprSpan(yygotominor.yy122, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
  }
}
#line 3261 "parse.c"
        break;
      case 287: /* expr ::= RAISE LP raisetype COMMA nm RP */
#line 1107 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); 
  if( yygotominor.yy122 ) {
    yygotominor.yy122->iColumn = yymsp[-3].minor.yy392;
    sqlite3ExprSpan(yygotominor.yy122, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
  }
}
#line 3272 "parse.c"
        break;
      case 288: /* raisetype ::= ROLLBACK */
#line 1117 "parse.y"
{yygotominor.yy392 = OE_Rollback;}
#line 3277 "parse.c"
        break;
      case 290: /* raisetype ::= FAIL */
#line 1119 "parse.y"
{yygotominor.yy392 = OE_Fail;}
#line 3282 "parse.c"
        break;
      case 291: /* cmd ::= DROP TRIGGER ifexists fullname */
#line 1124 "parse.y"
{
  sqlite3DropTrigger(pParse,yymsp[0].minor.yy347,yymsp[-1].minor.yy392);
}
#line 3289 "parse.c"
        break;
      case 292: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
#line 1131 "parse.y"
{
  sqlite3Attach(pParse, yymsp[-3].minor.yy122, yymsp[-1].minor.yy122, yymsp[0].minor.yy122);
}
#line 3296 "parse.c"
        break;
      case 293: /* cmd ::= DETACH database_kw_opt expr */
#line 1134 "parse.y"
{
  sqlite3Detach(pParse, yymsp[0].minor.yy122);
}
#line 3303 "parse.c"
        break;
      case 298: /* cmd ::= REINDEX */
#line 1149 "parse.y"
{sqlite3Reindex(pParse, 0, 0);}
#line 3308 "parse.c"
        break;
      case 299: /* cmd ::= REINDEX nm dbnm */
#line 1150 "parse.y"
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
#line 3313 "parse.c"
        break;
      case 300: /* cmd ::= ANALYZE */
#line 1155 "parse.y"
{sqlite3Analyze(pParse, 0, 0);}
#line 3318 "parse.c"
        break;
      case 301: /* cmd ::= ANALYZE nm dbnm */
#line 1156 "parse.y"
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
#line 3323 "parse.c"
        break;
      case 302: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
#line 1161 "parse.y"
{
  sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy347,&yymsp[0].minor.yy0);
}
#line 3330 "parse.c"
        break;
      case 303: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
#line 1164 "parse.y"
{
  sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
}
#line 3337 "parse.c"
        break;
      case 304: /* add_column_fullname ::= fullname */
#line 1167 "parse.y"
{
  sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy347);
}
#line 3344 "parse.c"
        break;
      case 307: /* cmd ::= create_vtab */
#line 1176 "parse.y"
{sqlite3VtabFinishParse(pParse,0);}
#line 3349 "parse.c"
        break;
      case 308: /* cmd ::= create_vtab LP vtabarglist RP */
#line 1177 "parse.y"
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
#line 3354 "parse.c"
        break;
      case 309: /* create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm */
#line 1178 "parse.y"
{
    sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
#line 3361 "parse.c"
        break;
      case 312: /* vtabarg ::= */
#line 1183 "parse.y"
{sqlite3VtabArgInit(pParse);}
#line 3366 "parse.c"
        break;
      case 314: /* vtabargtoken ::= ANY */
      case 315: /* vtabargtoken ::= lp anylist RP */
      case 316: /* lp ::= LP */
      case 318: /* anylist ::= anylist ANY */
#line 1185 "parse.y"
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
#line 3374 "parse.c"
        break;
  };
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
  yypParser->yyidx -= yysize;
  yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
  if( yyact < YYNSTATE ){
#ifdef NDEBUG
    /* If we are not debugging and the reduce action popped at least
    ** one element off the stack, then we can push the new element back
    ** onto the stack here, and skip the stack overflow test in yy_shift().
    ** That gives a significant speed improvement. */
    if( yysize ){
      yypParser->yyidx++;
      yymsp -= yysize-1;
      yymsp->stateno = yyact;
      yymsp->major = yygoto;
      yymsp->minor = yygotominor;
    }else
#endif
    {
      yy_shift(yypParser,yyact,yygoto,&yygotominor);
    }
  }else{
    assert( yyact == YYNSTATE + YYNRULE + 1 );
    yy_accept(yypParser);
  }
}

/*
** The following code executes when the parse fails
*/
static void yy_parse_failed(
  yyParser *yypParser           /* The parser */
){
  sqlite3ParserARG_FETCH;
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
  }
#endif
  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will be executed whenever the
  ** parser fails */
  sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}

/*
** The following code executes when a syntax error first occurs.
*/
static void yy_syntax_error(
  yyParser *yypParser,           /* The parser */
  int yymajor,                   /* The major type of the error token */
  YYMINORTYPE yyminor            /* The minor type of the error token */
){
  sqlite3ParserARG_FETCH;
#define TOKEN (yyminor.yy0)
#line 34 "parse.y"

  UNUSED_PARAMETER(yymajor);  /* Silence some compiler warnings */
  assert( TOKEN.z[0] );  /* The tokenizer always gives us a token */
  sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
  pParse->parseError = 1;
#line 3438 "parse.c"
  sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
  sqlite3ParserARG_FETCH;
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
  }
#endif
  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will be executed whenever the
  ** parser accepts */
  sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
** "sqlite3ParserAlloc" which describes the current state of the parser.
** The second argument is the major token number.  The third is
** the minor token.  The fourth optional argument is whatever the
** user wants (and specified in the grammar) and is available for
** use by the action routines.
**
** Inputs:
** <ul>
** <li> A pointer to the parser (an opaque structure.)
** <li> The major token number.
** <li> The minor token number.
** <li> An option argument of a grammar-specified type.
** </ul>
**
** Outputs:
** None.
*/
void sqlite3Parser(
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
  sqlite3ParserTOKENTYPE yyminor       /* The value for the token */
  sqlite3ParserARG_PDECL               /* Optional %extra_argument parameter */
){
  YYMINORTYPE yyminorunion;
  int yyact;            /* The parser action. */
  int yyendofinput;     /* True if we are at the end of input */
#ifdef YYERRORSYMBOL
  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
#endif
  yyParser *yypParser;  /* The parser */

  /* (re)initialize the parser, if necessary */
  yypParser = (yyParser*)yyp;
  if( yypParser->yyidx<0 ){
#if YYSTACKDEPTH<=0
    if( yypParser->yystksz <=0 ){
      /*memset(&yyminorunion, 0, sizeof(yyminorunion));*/
      yyminorunion = yyzerominor;
      yyStackOverflow(yypParser, &yyminorunion);
      return;
    }
#endif
    yypParser->yyidx = 0;
    yypParser->yyerrcnt = -1;
    yypParser->yystack[0].stateno = 0;
    yypParser->yystack[0].major = 0;
  }
  yyminorunion.yy0 = yyminor;
  yyendofinput = (yymajor==0);
  sqlite3ParserARG_STORE;

#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
  }
#endif

  do{
    yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
    if( yyact<YYNSTATE ){
      assert( !yyendofinput );  /* Impossible to shift the $ token */
      yy_shift(yypParser,yyact,yymajor,&yyminorunion);
      yypParser->yyerrcnt--;
      yymajor = YYNOCODE;
    }else if( yyact < YYNSTATE + YYNRULE ){
      yy_reduce(yypParser,yyact-YYNSTATE);
    }else{
      assert( yyact == YY_ERROR_ACTION );
#ifdef YYERRORSYMBOL
      int yymx;
#endif
#ifndef NDEBUG
      if( yyTraceFILE ){
        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
      }
#endif
#ifdef YYERRORSYMBOL
      /* A syntax error has occurred.
      ** The response to an error depends upon whether or not the
      ** grammar defines an error token "ERROR".  
      **
      ** This is what we do if the grammar does define ERROR:
      **
      **  * Call the %syntax_error function.
      **
      **  * Begin popping the stack until we enter a state where
      **    it is legal to shift the error symbol, then shift
      **    the error symbol.
      **
      **  * Set the error count to three.
      **
      **  * Begin accepting and shifting new tokens.  No new error
      **    processing will occur until three tokens have been
      **    shifted successfully.
      **
      */
      if( yypParser->yyerrcnt<0 ){
        yy_syntax_error(yypParser,yymajor,yyminorunion);
      }
      yymx = yypParser->yystack[yypParser->yyidx].major;
      if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
             yyTracePrompt,yyTokenName[yymajor]);
        }
#endif
        yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
        yymajor = YYNOCODE;
      }else{
         while(
          yypParser->yyidx >= 0 &&
          yymx != YYERRORSYMBOL &&
          (yyact = yy_find_reduce_action(
                        yypParser->yystack[yypParser->yyidx].stateno,
                        YYERRORSYMBOL)) >= YYNSTATE
        ){
          yy_pop_parser_stack(yypParser);
        }
        if( yypParser->yyidx < 0 || yymajor==0 ){
          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
          yy_parse_failed(yypParser);
          yymajor = YYNOCODE;
        }else if( yymx!=YYERRORSYMBOL ){
          YYMINORTYPE u2;
          u2.YYERRSYMDT = 0;
          yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
        }
      }
      yypParser->yyerrcnt = 3;
      yyerrorhit = 1;
#else  /* YYERRORSYMBOL is not defined */
      /* This is what we do if the grammar does not define ERROR:
      **
      **  * Report an error message, and throw away the input token.
      **
      **  * If the input token is $, then fail the parse.
      **
      ** As before, subsequent error messages are suppressed until
      ** three input tokens have been successfully shifted.
      */
      if( yypParser->yyerrcnt<=0 ){
        yy_syntax_error(yypParser,yymajor,yyminorunion);
      }
      yypParser->yyerrcnt = 3;
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      if( yyendofinput ){
        yy_parse_failed(yypParser);
      }
      yymajor = YYNOCODE;
#endif
    }
  }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
  return;
}
