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