sql.c 208.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/*
** 2000-05-29
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Driver template for the LEMON parser generator.
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser.  The "lemon" program inserts text
** at each "%%" line.  Also, any "P-a-r-s-e" identifer prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar.  Otherwise, the content
** of this template is copied straight through into the generate parser
** source file.
**
** The following is the concatenation of all %include directives from the
** input grammar file:
*/
#include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>

35
#include "functionMgt.h"
36
#include "nodes.h"
X
Xiaoyu Wang 已提交
37
#include "parToken.h"
38
#include "ttokendef.h"
X
Xiaoyu Wang 已提交
39
#include "parAst.h"
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
/**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols
** in a format understandable to "makeheaders".  This section is blank unless
** "lemon" is run with the "-m" command-line option.
***************** Begin makeheaders token definitions *************************/
/**************** End makeheaders token definitions ***************************/

/* The next sections is a series of control #defines.
** various aspects of the generated parser.
**    YYCODETYPE         is the data type used to store the integer codes
**                       that represent terminal and non-terminal symbols.
**                       "unsigned char" is used if there are fewer than
**                       256 symbols.  Larger types otherwise.
**    YYNOCODE           is a number of type YYCODETYPE that is not used for
**                       any terminal or nonterminal symbol.
**    YYFALLBACK         If defined, this indicates that one or more tokens
**                       (also known as: "terminal symbols") have fall-back
**                       values which should be used if the original symbol
**                       would not parse.  This permits keywords to sometimes
**                       be used as identifiers, for example.
**    YYACTIONTYPE       is the data type used for "action codes" - numbers
**                       that indicate what to do in response to the next
**                       token.
X
Xiaoyu Wang 已提交
63
**    ParseTOKENTYPE     is the data type used for minor type for terminal
64 65 66 67 68 69 70 71 72 73
**                       symbols.  Background: A "minor type" is a semantic
**                       value associated with a terminal or non-terminal
**                       symbols.  For example, for an "ID" terminal symbol,
**                       the minor type might be the name of the identifier.
**                       Each non-terminal can have a different minor type.
**                       Terminal symbols all have the same minor type, though.
**                       This macros defines the minor type for terminal 
**                       symbols.
**    YYMINORTYPE        is the data type used for all minor types.
**                       This is typically a union of many types, one of
X
Xiaoyu Wang 已提交
74
**                       which is ParseTOKENTYPE.  The entry in the union
75 76
**                       for terminal symbols is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
X
Xiaoyu Wang 已提交
77
**                       zero the stack is dynamically sized using realloc()
X
Xiaoyu Wang 已提交
78 79 80 81 82 83
**    ParseARG_SDECL     A static variable declaration for the %extra_argument
**    ParseARG_PDECL     A parameter declaration for the %extra_argument
**    ParseARG_PARAM     Code to pass %extra_argument as a subroutine parameter
**    ParseARG_STORE     Code to store %extra_argument into yypParser
**    ParseARG_FETCH     Code to extract %extra_argument from yypParser
**    ParseCTX_*         As ParseARG_ except for %extra_context
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYNTOKEN           Number of terminal symbols
**    YY_MAX_SHIFT       Maximum value for shift actions
**    YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
**    YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
**    YY_ERROR_ACTION    The yy_action[] code for syntax error
**    YY_ACCEPT_ACTION   The yy_action[] code for accept
**    YY_NO_ACTION       The yy_action[] code for no-op
**    YY_MIN_REDUCE      Minimum value for reduce actions
**    YY_MAX_REDUCE      Maximum value for reduce actions
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
X
Xiaoyu Wang 已提交
102
#define YYCODETYPE unsigned short int
103
#define YYNOCODE 315
104
#define YYACTIONTYPE unsigned short int
X
Xiaoyu Wang 已提交
105
#define ParseTOKENTYPE  SToken 
106 107
typedef union {
  int yyinit;
X
Xiaoyu Wang 已提交
108
  ParseTOKENTYPE yy0;
109 110 111 112 113 114 115 116 117 118 119 120
  SToken yy29;
  bool yy47;
  EFillMode yy144;
  EJoinType yy162;
  SNode* yy182;
  EOrder yy218;
  SNodeList* yy334;
  EOperatorType yy380;
  ENullOrder yy487;
  SAlterOption yy515;
  int32_t yy550;
  SDataType yy574;
121 122 123 124
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
X
Xiaoyu Wang 已提交
125 126 127 128 129 130 131 132 133 134
#define ParseARG_SDECL  SAstCreateContext* pCxt ;
#define ParseARG_PDECL , SAstCreateContext* pCxt 
#define ParseARG_PARAM ,pCxt 
#define ParseARG_FETCH  SAstCreateContext* pCxt =yypParser->pCxt ;
#define ParseARG_STORE yypParser->pCxt =pCxt ;
#define ParseCTX_SDECL
#define ParseCTX_PDECL
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
135
#define YYNSTATE             550
136
#define YYNRULE              410
137 138 139 140 141 142 143 144 145
#define YYNTOKEN             209
#define YY_MAX_SHIFT         549
#define YY_MIN_SHIFTREDUCE   809
#define YY_MAX_SHIFTREDUCE   1218
#define YY_ERROR_ACTION      1219
#define YY_ACCEPT_ACTION     1220
#define YY_NO_ACTION         1221
#define YY_MIN_REDUCE        1222
#define YY_MAX_REDUCE        1631
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))

/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
**
** Applications can choose to define yytestcase() in the %include section
** to a macro that can assist in verifying code coverage.  For production
** code the yytestcase() macro should be turned off.  But it is useful
** for testing.
*/
#ifndef yytestcase
# define yytestcase(X)
#endif


/* Next are the tables used to determine what action to take based on the
** current state and lookahead token.  These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.  
**
** Suppose the action integer is N.  Then the action is determined as
** follows
**
**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
**                                      token onto the stack and goto state N.
**
**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
**
**   N == YY_ERROR_ACTION               A syntax error has occurred.
**
**   N == YY_ACCEPT_ACTION              The parser accepts its input.
**
**   N == YY_NO_ACTION                  No such action.  Denotes unused
**                                      slots in the yy_action[] table.
**
**   N between YY_MIN_REDUCE            Reduce by rule N-YY_MIN_REDUCE
**     and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either:
**
**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
**    (B)   N = yy_default[S]
**
** The (A) formula is preferred.  The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
**
** The formulas above are for computing the action when the lookahead is
** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array.
**
** The following are the tables generated in this section:
**
**  yy_action[]        A single table containing all actions.
**  yy_lookahead[]     A table containing the lookahead for each entry in
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
**
*********** Begin parsing tables **********************************************/
212
#define YY_ACTTAB_COUNT (1550)
213
static const YYACTIONTYPE yy_action[] = {
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
 /*     0 */   452,  258, 1483,  270,   25,  195, 1432,  118,  123, 1234,
 /*    10 */   313, 1331,   30,   28, 1479, 1486,  307, 1499, 1483, 1382,
 /*    20 */   267,  464, 1054,   21, 1076,   32,   31,   29,   27,   26,
 /*    30 */  1479, 1485,   23,   32,   31,   29,   27,   26, 1052,  275,
 /*    40 */   239, 1516,   32,   31,   29,   27,   26, 1610,  447, 1074,
 /*    50 */    11,   30,   28, 1161,  349,  407, 1483, 1059,  451,  267,
 /*    60 */   132, 1054, 1470, 1320, 1608,   30,   28,  435, 1479, 1485,
 /*    70 */   431,    9,    8,  267,    1, 1054,  465, 1052,   69, 1500,
 /*    80 */  1501, 1505, 1549,  542,  541,   73,  241, 1545, 1175,   11,
 /*    90 */  1499, 1052,  370,  425,  452,  101, 1059,  546, 1610,  408,
 /*   100 */  1433, 1342, 1261,   11,   32,   31,   29,   27,   26, 1053,
 /*   110 */  1059,  132,  349,    1, 1516, 1608,   32,   31,   29,   27,
 /*   120 */    26,  434,  119, 1389,  385,  278, 1300,    1,   99,  257,
 /*   130 */  1610,  451, 1423, 1425, 1387, 1470,  546,  433,  128, 1556,
 /*   140 */  1557,  271, 1561,  132,  500, 1137, 1055, 1608, 1053,  116,
 /*   150 */   546,   70, 1500, 1501, 1505, 1549,  846, 1344,  845,  260,
 /*   160 */  1545,  127, 1053, 1058, 1078, 1079,  449, 1105, 1106, 1107,
 /*   170 */  1108, 1109, 1110, 1111, 1112,  165,  847,  382,  381,  373,
 /*   180 */  1577,  464, 1563, 1220,   85, 1055,  133,   84,   83,   82,
 /*   190 */    81,   80,   79,   78,   77,   76,   29,   27,   26, 1055,
 /*   200 */  1560,  375, 1058, 1078, 1079,  449, 1105, 1106, 1107, 1108,
 /*   210 */  1109, 1110, 1111, 1112, 1319,  133, 1058, 1078, 1079,  449,
 /*   220 */  1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1318,   30,
 /*   230 */    28,  549,  306, 1563,  305,   12,  283,  267,  384, 1054,
 /*   240 */   378,  897,  133, 1215,  383,  214,  464,   98,   96,  379,
 /*   250 */   377, 1559,  380,  116,  538, 1052,  534,  530,  526,  213,
 /*   260 */   899, 1345,   32,   31,   29,   27,   26, 1610,   30,   28,
 /*   270 */   450, 1499,  465,  133, 1059,  210,  267,  500, 1054,  496,
 /*   280 */   132,  311,   30,   28, 1608,   67,   53, 1077,  207, 1075,
 /*   290 */   267,    7, 1054, 1333, 1052, 1516,   66, 1342, 1516,   97,
 /*   300 */    12,  498,  434, 1245,  335,  447,  465, 1337, 1052,  491,
 /*   310 */   102, 1214,  451, 1059,  546,  312, 1470, 1334,  461,  439,
 /*   320 */   495,  494,  493, 1185,  492, 1093, 1053, 1059,  515,  513,
 /*   330 */     7, 1342,   70, 1500, 1501, 1505, 1549,  424, 1470,  396,
 /*   340 */   260, 1545,  127, 1274,    7, 1222,  413,  133, 1470,  172,
 /*   350 */   142,  141,  394,  546,  191,  418, 1183, 1184, 1186, 1187,
 /*   360 */   414, 1576,  502, 1055, 1038, 1053,  169,  546, 1244,   94,
 /*   370 */    93,   92,   91,   90,   89,   88,   87,   86, 1327, 1053,
 /*   380 */  1058, 1078, 1079,  449, 1105, 1106, 1107, 1108, 1109, 1110,
 /*   390 */  1111, 1112, 1080,  431, 1389,  384,   53,  378, 1610, 1329,
 /*   400 */   272,  383, 1055,  133,   98, 1387,  379,  377, 1243,  380,
 /*   410 */  1242, 1609,  406, 1470, 1241, 1608, 1055, 1338,  101, 1058,
 /*   420 */  1078, 1079,  449, 1105, 1106, 1107, 1108, 1109, 1110, 1111,
 /*   430 */  1112, 1078, 1079, 1058, 1078, 1079,  449, 1105, 1106, 1107,
 /*   440 */  1108, 1109, 1110, 1111, 1112,  431,   30,   28,  238,  421,
 /*   450 */  1074,   99,  440, 1470,  267, 1470, 1054,  328,   60, 1470,
 /*   460 */   340,  129, 1556, 1557, 1420, 1561, 1081, 1160,  398,  341,
 /*   470 */   101,  140, 1052,   32,   31,   29,   27,   26,  438, 1335,
 /*   480 */   935,  488,  487,  486,  939,  485,  941,  942,  484,  944,
 /*   490 */   481, 1059,  950,  478,  952,  953,  475,  472, 1223, 1610,
 /*   500 */  1568, 1156, 1563,   99,  426,  422,    9,    8,    1,  465,
 /*   510 */   190,  242,  132,  130, 1556, 1557, 1608, 1561,  320,   85,
 /*   520 */  1558, 1240,   84,   83,   82,   81,   80,   79,   78,   77,
 /*   530 */    76,  546,  217, 1325, 1342, 1372, 1093,   32,   31,   29,
 /*   540 */    27,   26,  339, 1053, 1124,  334,  333,  332,  331,  330,
 /*   550 */  1239,  327,  326,  325,  324,  323,  319,  318,  317,  316,
 /*   560 */   315,  314, 1271,  138,  117,  465, 1470, 1238,  503,  223,
 /*   570 */  1314, 1389, 1389,    6,  321,   32,   31,   29,   27,   26,
 /*   580 */  1055,  221, 1424, 1388,  176, 1168,  170,  448, 1237,   51,
 /*   590 */  1342, 1076,   50, 1125,  143, 1470,  490, 1058, 1078, 1079,
 /*   600 */   449, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1235,
 /*   610 */  1236, 1129, 1470,  242,  522,  521,  520,  519,  282, 1233,
 /*   620 */   518,  517,  516,  103,  511,  510,  509,  508,  507,  506,
 /*   630 */   505,  504,  109, 1470, 1232, 1499,   24,  265, 1119, 1120,
 /*   640 */  1121, 1122, 1123, 1127, 1128,  465, 1124,  465, 1231,  465,
 /*   650 */  1159,  845,  277,  465,   73, 1470,  348,   68, 1339, 1516,
 /*   660 */   116,  376,  462,  115, 1470,  280,  447,  368, 1344, 1256,
 /*   670 */  1342,  871, 1342,  116, 1342,  465,  451,  437, 1342, 1470,
 /*   680 */  1470, 1344, 1230, 1229,  463,   49,   48,  310, 1499,  137,
 /*   690 */   872,  387,  465, 1470,  304, 1125,  120, 1500, 1501, 1505,
 /*   700 */  1342,  209,  247,  298,  296, 1389,  292,  288,  134, 1301,
 /*   710 */   514,  279, 1516, 1129,  301, 1156, 1387, 1342,  300,  447,
 /*   720 */   158, 1054,  465,  156, 1499, 1228, 1227, 1470, 1470,  451,
 /*   730 */   446,  281,  133, 1470,  436, 1623, 1126, 1052,   24,  265,
 /*   740 */  1119, 1120, 1121, 1122, 1123, 1127, 1128, 1342, 1516,   70,
 /*   750 */  1500, 1501, 1505, 1549, 1130,  447, 1059,  260, 1545, 1622,
 /*   760 */  1499, 1459, 1226,  153, 1225,  451,  126,  192, 1583, 1470,
 /*   770 */  1470, 1470,  366,  344,  362,  358,  354,  152,  160,   22,
 /*   780 */   162,  159,  419,  161, 1516,   70, 1500, 1501, 1505, 1549,
 /*   790 */  1254,  447,  442,  260, 1545, 1622,  546,  290, 1217, 1218,
 /*   800 */  1383,  451,  251,   54, 1606, 1470,  150, 1470, 1053, 1470,
 /*   810 */  1499,  164,  390,  107,  163,   45,  179,  410,  405, 1182,
 /*   820 */   181,   70, 1500, 1501, 1505, 1549, 1490,  185,  165,  260,
 /*   830 */  1545, 1622,  373,  367, 1516,   34, 1579, 1499, 1488, 1131,
 /*   840 */  1567,  447,  432, 1116,  252, 1055,  250,  249, 1062,  372,
 /*   850 */  1517,  451, 1499,   34,  375, 1470,  194, 1089, 1074, 1061,
 /*   860 */   435, 1516, 1058,  149,    2,  122,   34,  146,  447,  285,
 /*   870 */  1021,  229, 1500, 1501, 1505,  289, 1516,  198,  451, 1499,
 /*   880 */   246,  200, 1470,  447,  144,   95,  274,  273,  105,  457,
 /*   890 */   897, 1610,  206,  451,  248, 1030, 1067, 1470,   71, 1500,
 /*   900 */  1501, 1505, 1549, 1516,  132,  322, 1548, 1545, 1608,  215,
 /*   910 */   447, 1422, 1060,   71, 1500, 1501, 1505, 1549,   65, 1065,
 /*   920 */   451,  445, 1545,  431, 1470,  107,  329,  443,   62,  928,
 /*   930 */  1064, 1059,   45,  470,  105,  139,  923,  956,  960,  337,
 /*   940 */    71, 1500, 1501, 1505, 1549,  336,  106,  338,  101, 1546,
 /*   950 */   966, 1085,  342,  107,  105, 1499,  343,  965,  108, 1084,
 /*   960 */   145,  346,  345, 1083,  347,  350,  148,  435,   52,  151,
 /*   970 */  1082,  466,  369,  371, 1332,  155,  374, 1328,   75, 1516,
 /*   980 */   400,   99, 1499, 1063,  401,  402,  447,  256,  409,  157,
 /*   990 */  1499,  188, 1556,  430,  171,  429,  451,  174, 1610,  110,
 /*  1000 */  1470,  111, 1330,  266, 1326,  112, 1516,  113, 1081,  412,
 /*  1010 */   420,  132, 1590,  447, 1516, 1608,  234, 1500, 1501, 1505,
 /*  1020 */  1068,  447,  399,  451,  411,  455, 1059, 1470, 1580,  417,
 /*  1030 */   415,  451,  177,  180, 1499, 1470,    5, 1071, 1589,  416,
 /*  1040 */   259,  423,  428,  234, 1500, 1501, 1505,    4,  100, 1080,
 /*  1050 */  1570,  233, 1500, 1501, 1505,  186,  184, 1156, 1516,  125,
 /*  1060 */  1564,   35,  444,  261,   17,  447, 1431, 1531, 1499,  187,
 /*  1070 */   441, 1430,  458,  459,   61,  451, 1499,  453,  460, 1470,
 /*  1080 */   454, 1499,  269,  427,  202,  204, 1343,  468,   59,  222,
 /*  1090 */  1625, 1315, 1516,  212,  193,  120, 1500, 1501, 1505,  447,
 /*  1100 */  1516, 1607,  216,  497,  218, 1516,  545,  447,  224,  451,
 /*  1110 */    41, 1464,  447, 1470,  225,  220,  264,  451, 1463,  284,
 /*  1120 */  1460, 1470,  451, 1499,  268,  286, 1470, 1048, 1499,  234,
 /*  1130 */  1500, 1501, 1505,  389, 1624,  287, 1499,  234, 1500, 1501,
 /*  1140 */  1505, 1049,  226, 1500, 1501, 1505,  291, 1516,  397, 1458,
 /*  1150 */   135,  295, 1516,  293,  447,  294, 1457,  297, 1456,  447,
 /*  1160 */  1516,  299,  167, 1447,  451,  392,  136,  447, 1470,  451,
 /*  1170 */   386,  302,  303, 1470, 1317, 1441,  166,  451, 1033, 1032,
 /*  1180 */  1499, 1470, 1440,  308,  232, 1500, 1501, 1505,  309,  235,
 /*  1190 */  1500, 1501, 1505, 1439, 1438, 1499, 1004,  227, 1500, 1501,
 /*  1200 */  1505, 1415,   43, 1414, 1516,   42, 1499, 1413, 1412, 1411,
 /*  1210 */  1410,  447, 1409, 1408, 1407, 1406, 1405, 1404, 1403, 1516,
 /*  1220 */  1402,  451, 1401, 1400,  104, 1470,  447, 1399, 1398, 1397,
 /*  1230 */  1516, 1499, 1396, 1395, 1394,  210,  451,  447, 1393,  496,
 /*  1240 */  1470,  236, 1500, 1501, 1505, 1392, 1006,  451, 1391, 1390,
 /*  1250 */  1273, 1470, 1455, 1449, 1437, 1516,  228, 1500, 1501, 1505,
 /*  1260 */  1428,  498,  447, 1321,  147, 1499, 1272,  237, 1500, 1501,
 /*  1270 */  1505, 1270,  451,  351,  353,  352, 1470,  864, 1499, 1268,
 /*  1280 */   495,  494,  493,  357,  492,  355, 1266,  356, 1264, 1516,
 /*  1290 */  1253,  360, 1513, 1500, 1501, 1505,  447,  359, 1252,  361,
 /*  1300 */   363,  364, 1516, 1249,  365, 1323,  451,  973,   74,  447,
 /*  1310 */  1470,  154, 1499,  514,  971, 1322,  896,  512,  895,  451,
 /*  1320 */  1499,  894,  893, 1470, 1262, 1499, 1512, 1500, 1501, 1505,
 /*  1330 */   253,  890,  889, 1257,  254,  388, 1516, 1255,  255,  244,
 /*  1340 */  1500, 1501, 1505,  447, 1516,  391, 1248,  393, 1247, 1516,
 /*  1350 */   395,  447,   72,  451, 1454,  168,  447, 1470, 1040, 1448,
 /*  1360 */   403,  451,  114, 1436, 1435, 1470,  451, 1499, 1427,   55,
 /*  1370 */  1470,  124, 1499, 1511, 1500, 1501, 1505,  173,   14,   44,
 /*  1380 */  1499,  245, 1500, 1501, 1505,    3,  243, 1500, 1501, 1505,
 /*  1390 */    34, 1516,  178,   39,   15,  404, 1516,  121,  447, 1488,
 /*  1400 */   175, 1181,   38,  447, 1516,  182,   57,  183,  451,   19,
 /*  1410 */  1203,  447, 1470,  451, 1174,   56,   20, 1470, 1153, 1152,
 /*  1420 */    37,  451, 1208,   16, 1202, 1470,  189,   36,  240, 1500,
 /*  1430 */  1501, 1505,  262,  230, 1500, 1501, 1505,  131, 1207, 1206,
 /*  1440 */     8,  231, 1500, 1501, 1505,  263,  196,   33,   10, 1091,
 /*  1450 */  1117, 1090,   13,   18,  456,  197, 1179,  199,  201,   46,
 /*  1460 */  1426,  203,  205,   58, 1069,   40,   62,  957,  469,  276,
 /*  1470 */   471,  473,  954, 1487,  208,  467,  949,  474,  476,  951,
 /*  1480 */   477,  479,  482,  945,  480,  934,  943,  483,   63,  968,
 /*  1490 */    47,   64,  948,  964,  947,  962,  489,  946,  862,  499,
 /*  1500 */   501,  878,  903,  211,  885,  884,  883,  882,  967,  881,
 /*  1510 */   880,  900,  879,  898,  875,  874,  873, 1269,  870,  869,
 /*  1520 */   868,  867,  523,  524, 1267,  528,  527, 1265,  525,  529,
 /*  1530 */   531,  532, 1263,  533,  535,  536,  537, 1251,  539,  540,
 /*  1540 */  1250, 1246,  543,  544, 1221, 1056,  548,  219, 1221,  547,
369 370
};
static const YYCODETYPE yy_lookahead[] = {
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
 /*     0 */   253,  240,  257,  256,  278,  279,  259,  211,  235,  213,
 /*    10 */   218,  237,   12,   13,  269,  270,  262,  212,  257,  246,
 /*    20 */    20,   20,   22,    2,   20,   12,   13,   14,   15,   16,
 /*    30 */   269,  270,    2,   12,   13,   14,   15,   16,   38,  240,
 /*    40 */   248,  236,   12,   13,   14,   15,   16,  293,  243,   20,
 /*    50 */    50,   12,   13,   14,   49,  218,  257,   57,  253,   20,
 /*    60 */   306,   22,  257,    0,  310,   12,   13,  262,  269,  270,
 /*    70 */   218,    1,    2,   20,   74,   22,  218,   38,  273,  274,
 /*    80 */   275,  276,  277,  215,  216,  227,  281,  282,   75,   50,
 /*    90 */   212,   38,  234,   20,  253,  243,   57,   97,  293,  262,
 /*   100 */   259,  243,    0,   50,   12,   13,   14,   15,   16,  109,
 /*   110 */    57,  306,   49,   74,  236,  310,   12,   13,   14,   15,
 /*   120 */    16,  243,  221,  236,   22,  245,  225,   74,  276,  242,
 /*   130 */   293,  253,  252,  253,  247,  257,   97,  285,  286,  287,
 /*   140 */   288,  228,  290,  306,   49,   75,  146,  310,  109,  236,
 /*   150 */    97,  273,  274,  275,  276,  277,   20,  244,   22,  281,
 /*   160 */   282,  283,  109,  163,  164,  165,  166,  167,  168,  169,
 /*   170 */   170,  171,  172,  173,  174,   61,   40,  222,  223,   65,
 /*   180 */   302,   20,  271,  209,   21,  146,  186,   24,   25,   26,
 /*   190 */    27,   28,   29,   30,   31,   32,   14,   15,   16,  146,
 /*   200 */   289,   87,  163,  164,  165,  166,  167,  168,  169,  170,
 /*   210 */   171,  172,  173,  174,    0,  186,  163,  164,  165,  166,
 /*   220 */   167,  168,  169,  170,  171,  172,  173,  174,    0,   12,
 /*   230 */    13,   19,  145,  271,  147,   74,  262,   20,   52,   22,
 /*   240 */    54,   38,  186,  139,   58,   33,   20,   61,   36,   63,
 /*   250 */    64,  289,   66,  236,   42,   38,   44,   45,   46,   47,
 /*   260 */    57,  244,   12,   13,   14,   15,   16,  293,   12,   13,
 /*   270 */    14,  212,  218,  186,   57,   61,   20,   49,   22,   65,
 /*   280 */   306,  227,   12,   13,  310,   73,  220,   20,   76,   20,
 /*   290 */    20,   74,   22,  212,   38,  236,  217,  243,  236,  233,
 /*   300 */    74,   87,  243,  212,   67,  243,  218,  241,   38,   85,
 /*   310 */   231,  207,  253,   57,   97,  227,  257,  238,  106,   71,
 /*   320 */   106,  107,  108,  163,  110,   75,  109,   57,  222,  223,
 /*   330 */    74,  243,  273,  274,  275,  276,  277,  275,  257,   21,
 /*   340 */   281,  282,  283,    0,   74,    0,  134,  186,  257,  137,
 /*   350 */   113,  114,   34,   97,  295,  195,  196,  197,  198,  199,
 /*   360 */   301,  302,   57,  146,  152,  109,  154,   97,  212,   24,
 /*   370 */    25,   26,   27,   28,   29,   30,   31,   32,  237,  109,
 /*   380 */   163,  164,  165,  166,  167,  168,  169,  170,  171,  172,
 /*   390 */   173,  174,   20,  218,  236,   52,  220,   54,  293,  237,
 /*   400 */   242,   58,  146,  186,   61,  247,   63,   64,  212,   66,
 /*   410 */   212,  306,  265,  257,  212,  310,  146,  241,  243,  163,
 /*   420 */   164,  165,  166,  167,  168,  169,  170,  171,  172,  173,
 /*   430 */   174,  164,  165,  163,  164,  165,  166,  167,  168,  169,
 /*   440 */   170,  171,  172,  173,  174,  218,   12,   13,   18,  136,
 /*   450 */    20,  276,  204,  257,   20,  257,   22,   27,  217,  257,
 /*   460 */    30,  286,  287,  288,  243,  290,   20,    4,  262,   39,
 /*   470 */   243,  250,   38,   12,   13,   14,   15,   16,    3,  238,
 /*   480 */    88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
 /*   490 */    98,   57,  100,  101,  102,  103,  104,  105,    0,  293,
 /*   500 */   184,  185,  271,  276,  191,  192,    1,    2,   74,  218,
 /*   510 */   138,   50,  306,  286,  287,  288,  310,  290,  227,   21,
 /*   520 */   289,  212,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   530 */    32,   97,  229,  237,  243,  232,   75,   12,   13,   14,
 /*   540 */    15,   16,  112,  109,   83,  115,  116,  117,  118,  119,
 /*   550 */   212,  121,  122,  123,  124,  125,  126,  127,  128,  129,
 /*   560 */   130,  131,    0,   47,   18,  218,  257,  212,  224,   23,
 /*   570 */   226,  236,  236,   43,  227,   12,   13,   14,   15,   16,
 /*   580 */   146,   35,  247,  247,  138,   14,  237,  237,  212,   73,
 /*   590 */   243,   20,   76,  132,   48,  257,  237,  163,  164,  165,
 /*   600 */   166,  167,  168,  169,  170,  171,  172,  173,  174,  213,
 /*   610 */   212,  150,  257,   50,   52,   53,   54,   55,   56,  212,
 /*   620 */    58,   59,   60,   61,   62,   63,   64,   65,   66,   67,
 /*   630 */    68,   69,   70,  257,  212,  212,  175,  176,  177,  178,
 /*   640 */   179,  180,  181,  182,  183,  218,   83,  218,  212,  218,
 /*   650 */   187,   22,  228,  218,  227,  257,  227,  111,  227,  236,
 /*   660 */   236,  234,  227,  138,  257,  228,  243,   38,  244,    0,
 /*   670 */   243,   38,  243,  236,  243,  218,  253,  202,  243,  257,
 /*   680 */   257,  244,  212,  212,  227,  139,  140,  141,  212,  143,
 /*   690 */    57,   22,  218,  257,  148,  132,  273,  274,  275,  276,
 /*   700 */   243,  227,  156,  142,  158,  236,  160,  161,  162,  225,
 /*   710 */    71,  242,  236,  150,   75,  185,  247,  243,  157,  243,
 /*   720 */    78,   22,  218,   81,  212,  212,  212,  257,  257,  253,
 /*   730 */    50,  227,  186,  257,  311,  312,  132,   38,  175,  176,
 /*   740 */   177,  178,  179,  180,  181,  182,  183,  243,  236,  273,
 /*   750 */   274,  275,  276,  277,  150,  243,   57,  281,  282,  283,
 /*   760 */   212,    0,  212,   33,  212,  253,   36,  313,  292,  257,
 /*   770 */   257,  257,   42,  253,   44,   45,   46,   47,   78,  175,
 /*   780 */    78,   81,  304,   81,  236,  273,  274,  275,  276,  277,
 /*   790 */     0,  243,   71,  281,  282,  283,   97,   36,  164,  165,
 /*   800 */   246,  253,   35,   73,  292,  257,   76,  257,  109,  257,
 /*   810 */   212,   78,   22,   71,   81,   71,   71,   75,  253,   75,
 /*   820 */    75,  273,  274,  275,  276,  277,   74,  298,   61,  281,
 /*   830 */   282,  283,   65,  215,  236,   71,  272,  212,   86,   75,
 /*   840 */   292,  243,  291,  163,   77,  146,   79,   80,   38,   82,
 /*   850 */   236,  253,  212,   71,   87,  257,  307,   75,   20,   38,
 /*   860 */   262,  236,  163,  133,  294,  135,   71,  137,  243,  218,
 /*   870 */    75,  273,  274,  275,  276,   36,  236,   71,  253,  212,
 /*   880 */   268,   75,  257,  243,  154,   71,   12,   13,   71,   75,
 /*   890 */    38,  293,   75,  253,  222,  144,   22,  257,  273,  274,
 /*   900 */   275,  276,  277,  236,  306,  218,  281,  282,  310,  263,
 /*   910 */   243,  218,   38,  273,  274,  275,  276,  277,   74,  109,
 /*   920 */   253,  281,  282,  218,  257,   71,  251,  206,   84,   75,
 /*   930 */   109,   57,   71,   71,   71,  120,   75,   75,   75,  132,
 /*   940 */   273,  274,  275,  276,  277,  249,   71,  249,  243,  282,
 /*   950 */    75,   20,  218,   71,   71,  212,  267,   75,   75,   20,
 /*   960 */   220,  243,  261,   20,  254,  218,  220,  262,  220,  220,
 /*   970 */    20,   97,  214,  236,  236,  236,  222,  236,  218,  236,
 /*   980 */   267,  276,  212,  109,  153,  266,  243,  214,  261,  236,
 /*   990 */   212,  286,  287,  288,  217,  290,  253,  217,  293,  236,
 /*  1000 */   257,  236,  236,  260,  236,  236,  236,  236,   20,  254,
 /*  1010 */   194,  306,  303,  243,  236,  310,  273,  274,  275,  276,
 /*  1020 */   146,  243,  243,  253,  243,  193,   57,  257,  272,  257,
 /*  1030 */   260,  253,  258,  258,  212,  257,  201,  163,  303,  189,
 /*  1040 */   257,  257,  200,  273,  274,  275,  276,  188,  243,   20,
 /*  1050 */   300,  273,  274,  275,  276,  296,  299,  185,  236,  297,
 /*  1060 */   271,  120,  205,  208,   74,  243,  258,  280,  212,  284,
 /*  1070 */   203,  258,  135,  255,   74,  253,  212,  257,  254,  257,
 /*  1080 */   257,  212,  257,  305,  243,  217,  243,  239,  217,  210,
 /*  1090 */   314,  226,  236,  217,  308,  273,  274,  275,  276,  243,
 /*  1100 */   236,  309,  232,  222,  218,  236,  214,  243,  230,  253,
 /*  1110 */   264,    0,  243,  257,  230,  219,  260,  253,    0,   64,
 /*  1120 */     0,  257,  253,  212,  260,   38,  257,   38,  212,  273,
 /*  1130 */   274,  275,  276,    4,  312,  159,  212,  273,  274,  275,
 /*  1140 */   276,   38,  273,  274,  275,  276,  159,  236,   19,    0,
 /*  1150 */    38,  159,  236,   38,  243,   38,    0,   38,    0,  243,
 /*  1160 */   236,   38,   33,    0,  253,   36,   74,  243,  257,  253,
 /*  1170 */    41,  150,  149,  257,    0,    0,   47,  253,  109,  146,
 /*  1180 */   212,  257,    0,   53,  273,  274,  275,  276,  142,  273,
 /*  1190 */   274,  275,  276,    0,    0,  212,   86,  273,  274,  275,
 /*  1200 */   276,    0,   73,    0,  236,   76,  212,    0,    0,    0,
 /*  1210 */     0,  243,    0,    0,    0,    0,    0,    0,    0,  236,
 /*  1220 */     0,  253,    0,    0,  120,  257,  243,    0,    0,    0,
 /*  1230 */   236,  212,    0,    0,    0,   61,  253,  243,    0,   65,
 /*  1240 */   257,  273,  274,  275,  276,    0,   22,  253,    0,    0,
 /*  1250 */     0,  257,    0,    0,    0,  236,  273,  274,  275,  276,
 /*  1260 */     0,   87,  243,    0,   43,  212,    0,  273,  274,  275,
 /*  1270 */   276,    0,  253,   38,   43,   36,  257,   51,  212,    0,
 /*  1280 */   106,  107,  108,   43,  110,   38,    0,   36,    0,  236,
 /*  1290 */     0,   36,  273,  274,  275,  276,  243,   38,    0,   43,
 /*  1300 */    38,   36,  236,    0,   43,    0,  253,   38,   83,  243,
 /*  1310 */   257,   81,  212,   71,   22,    0,   38,   71,   38,  253,
 /*  1320 */   212,   38,   38,  257,    0,  212,  273,  274,  275,  276,
 /*  1330 */    22,   38,   38,    0,   22,   39,  236,    0,   22,  273,
 /*  1340 */   274,  275,  276,  243,  236,   38,    0,   22,    0,  236,
 /*  1350 */    22,  243,   20,  253,    0,  155,  243,  257,   38,    0,
 /*  1360 */    22,  253,  151,    0,    0,  257,  253,  212,    0,   74,
 /*  1370 */   257,  135,  212,  273,  274,  275,  276,   43,  190,  138,
 /*  1380 */   212,  273,  274,  275,  276,   71,  273,  274,  275,  276,
 /*  1390 */    71,  236,   75,   71,  190,  138,  236,   74,  243,   86,
 /*  1400 */   133,   75,  138,  243,  236,   74,    4,   71,  253,   74,
 /*  1410 */    38,  243,  257,  253,   75,   74,   71,  257,   75,   75,
 /*  1420 */    71,  253,   75,   71,   38,  257,   86,  184,  273,  274,
 /*  1430 */   275,  276,   38,  273,  274,  275,  276,   86,   38,   38,
 /*  1440 */     2,  273,  274,  275,  276,   38,   86,   74,  190,   75,
 /*  1450 */   163,   75,   74,   74,  136,   75,   75,   74,   74,   74,
 /*  1460 */     0,   43,  133,   74,   22,   74,   84,   75,   38,   38,
 /*  1470 */    74,   38,   75,   86,   86,   85,   99,   74,   38,   75,
 /*  1480 */    74,   38,   38,   75,   74,   22,   75,   74,   74,   38,
 /*  1490 */    74,   74,   99,   38,   99,   22,   87,   99,   51,   50,
 /*  1500 */    72,   22,   57,   71,   38,   38,   38,   38,  109,   38,
 /*  1510 */    38,   57,   38,   38,   38,   38,   38,    0,   38,   38,
 /*  1520 */    38,   38,   38,   36,    0,   36,   38,    0,   43,   43,
 /*  1530 */    38,   36,    0,   43,   38,   36,   43,    0,   38,   37,
 /*  1540 */     0,    0,   22,   21,  315,   22,   20,   22,  315,   21,
 /*  1550 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1560 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1570 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1580 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1590 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1600 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1610 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1620 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1630 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1640 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1650 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1660 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1670 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1680 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1690 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1700 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1710 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1720 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1730 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1740 */   315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
 /*  1750 */   315,  315,  315,  315,  315,  315,  315,  315,  315,
547
};
548
#define YY_SHIFT_COUNT    (549)
549
#define YY_SHIFT_MIN      (0)
550
#define YY_SHIFT_MAX      (1541)
551
static const unsigned short int yy_shift_ofst[] = {
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
 /*     0 */   546,    0,   39,   53,   53,   53,   53,  217,   53,   53,
 /*    10 */   270,  434,  161,  256,  270,  270,  270,  270,  270,  270,
 /*    20 */   270,  270,  270,  270,  270,  270,  270,  270,  270,  270,
 /*    30 */   270,  270,  270,  270,  270,  226,  226,  226,   29,  874,
 /*    40 */   874,   87,    1,    1,   56,  874,  267,  267,    1,    1,
 /*    50 */     1,    1,    1,    1,    5,    4,   73,   56,    4,    1,
 /*    60 */     1,    4,    1,    4,    4,    4,    1,   95,  430,  461,
 /*    70 */   563,  563,  163,  767,  699,  186,  699,  699,  699,  699,
 /*    80 */   699,  699,  699,  699,  699,  699,  699,  699,  699,  699,
 /*    90 */   699,  699,  699,  699,  699,  267,  136,   63,  203,  372,
 /*   100 */   372,  372,  228,  203,  269,    4,    4,    4,  224,  305,
 /*   110 */   392,  392,  392,  392,  392,  392,  392,  212,  498,  343,
 /*   120 */   104,  160,  267,  114,  267,  313,  629,  446,  316,  530,
 /*   130 */   316,  571,  475,  463,  838,  839,  852,  751,  838,  838,
 /*   140 */   815,  807,  807,  838,  931,  939,    5,  269,  943,    5,
 /*   150 */     5,  838,    5,  950,    4,    4,    4,    4,    4,    4,
 /*   160 */     4,    4,    4,    4,    4,  852,  838,  950,  269,  931,
 /*   170 */   831,  939,   95,  269,  943,   95,  988,  816,  832,  969,
 /*   180 */   816,  832,  969,  969,  835,  842,  850,  859,  872,  269,
 /*   190 */  1029,  941,  855,  857,  867,  990,    4,  832,  969,  969,
 /*   200 */   832,  969,  937,  269,  943,   95,  224,   95,  269, 1000,
 /*   210 */   852,  305,  838,   95,  950, 1550, 1550, 1550, 1550, 1550,
 /*   220 */   562,  730,  345, 1129,  214, 1174,   13,   21,   30,  250,
 /*   230 */   525,   92,   92,   92,   92,   92,   92,   92,  516,  237,
 /*   240 */   182,   70,  604,  182,  182,  182,  761,  561,  639,  642,
 /*   250 */   700,  702,  733,  102,  669,  790,  318,  742,  744,  745,
 /*   260 */   505,  634,  248,  721,  764,  680,  782,  752,  795,  806,
 /*   270 */   814,  817,  854,  810,  821,  861,  862,  863,  875,  882,
 /*   280 */   883,  844,  633, 1111, 1118, 1055, 1120, 1087,  976, 1089,
 /*   290 */  1103, 1112,  987, 1149, 1115, 1117,  992, 1156, 1119, 1158,
 /*   300 */  1123, 1163, 1092, 1021, 1023, 1069, 1033, 1175, 1182, 1130,
 /*   310 */  1046, 1193, 1194, 1110, 1201, 1203, 1207, 1208, 1209, 1210,
 /*   320 */  1212, 1213, 1214, 1215, 1216, 1217, 1218, 1220, 1222, 1223,
 /*   330 */  1104, 1227, 1228, 1229, 1232, 1233, 1234, 1224, 1238, 1245,
 /*   340 */  1248, 1249, 1250, 1252, 1253, 1254, 1260, 1221, 1263, 1226,
 /*   350 */  1266, 1271, 1235, 1239, 1231, 1279, 1247, 1251, 1240, 1286,
 /*   360 */  1259, 1255, 1256, 1288, 1262, 1265, 1261, 1290, 1298, 1303,
 /*   370 */  1305, 1225, 1230, 1269, 1242, 1292, 1315, 1278, 1280, 1283,
 /*   380 */  1284, 1246, 1242, 1293, 1294, 1324, 1308, 1333, 1312, 1296,
 /*   390 */  1337, 1316, 1307, 1346, 1325, 1348, 1328, 1332, 1354, 1241,
 /*   400 */  1200, 1320, 1359, 1211, 1338, 1257, 1236, 1363, 1364, 1264,
 /*   410 */  1368, 1295, 1334, 1267, 1314, 1319, 1188, 1317, 1322, 1326,
 /*   420 */  1323, 1331, 1335, 1339, 1336, 1313, 1341, 1345, 1204, 1343,
 /*   430 */  1344, 1340, 1243, 1349, 1351, 1347, 1352, 1258, 1402, 1372,
 /*   440 */  1386, 1394, 1400, 1401, 1407, 1438, 1287, 1360, 1374, 1373,
 /*   450 */  1376, 1378, 1379, 1380, 1381, 1383, 1384, 1318, 1385, 1460,
 /*   460 */  1418, 1329, 1389, 1382, 1387, 1388, 1442, 1391, 1390, 1392,
 /*   470 */  1430, 1431, 1396, 1397, 1433, 1403, 1404, 1440, 1406, 1408,
 /*   480 */  1443, 1410, 1411, 1444, 1413, 1377, 1393, 1395, 1398, 1463,
 /*   490 */  1409, 1414, 1451, 1399, 1416, 1417, 1455, 1242, 1473, 1447,
 /*   500 */  1449, 1445, 1428, 1432, 1466, 1467, 1468, 1469, 1471, 1472,
 /*   510 */  1474, 1479, 1454, 1246, 1475, 1242, 1476, 1477, 1478, 1480,
 /*   520 */  1481, 1482, 1483, 1517, 1484, 1487, 1485, 1524, 1488, 1489,
 /*   530 */  1486, 1527, 1492, 1495, 1490, 1532, 1496, 1499, 1493, 1537,
 /*   540 */  1500, 1502, 1540, 1541, 1520, 1522, 1523, 1525, 1528, 1526,
607
};
608 609 610
#define YY_REDUCE_COUNT (219)
#define YY_REDUCE_MIN   (-274)
#define YY_REDUCE_MAX   (1168)
611
static const short yy_reduce_ofst[] = {
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633
 /*     0 */   -26, -195,   59, -122,  476,  512,  548,  598,  625,  640,
 /*    10 */   423,  667,  705,  743,  770,  778,  822,  856,  864,  869,
 /*    20 */   911,  916,  924,  968,  983,  994, 1019, 1053, 1066, 1100,
 /*    30 */  1108, 1113, 1155, 1160, 1168, -148,  175,  227, -163, -239,
 /*    40 */  -201, -246, -142,  427,  206, -255, -253, -120,   54,   88,
 /*    50 */   291,  347,  429,  431,   66, -113,   62,  105,  -87,  435,
 /*    60 */   457,  158,  474,  424,  469,  437,  504,   79, -208, -274,
 /*    70 */  -274, -274, -204, -227,   81,  -99,   91,  156,  196,  198,
 /*    80 */   202,  309,  338,  355,  376,  398,  407,  422,  436,  470,
 /*    90 */   471,  513,  514,  550,  552, -159, -132,  176,  -45,  -89,
 /*   100 */   -38,  231,  241,  106,  221,   17,  335,  336,  303,  344,
 /*   110 */  -226,  141,  162,  296,  349,  350,  359,  147,  396,  484,
 /*   120 */   454,  478,  520,  554,  565,  529,  618,  564,  551,  551,
 /*   130 */   551,  614,  549,  570,  651,  612,  672,  646,  687,  693,
 /*   140 */   675,  696,  698,  734,  689,  701,  740,  718,  710,  746,
 /*   150 */   748,  747,  749,  758,  737,  738,  739,  741,  753,  763,
 /*   160 */   765,  766,  768,  769,  771,  754,  760,  773,  779,  713,
 /*   170 */   719,  727,  777,  781,  755,  780,  756,  709,  774,  772,
 /*   180 */   735,  775,  783,  784,  750,  757,  762,  759,  551,  805,
 /*   190 */   789,  785,  776,  792,  786,  787,  614,  808,  820,  823,
 /*   200 */   813,  825,  818,  841,  824,  868,  870,  871,  843,  848,
 /*   210 */   881,  865,  886,  876,  892,  846,  878,  884,  896,  879,
634 635
};
static const YYACTIONTYPE yy_default[] = {
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690
 /*     0 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*    10 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*    20 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*    30 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*    40 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*    50 */  1219, 1219, 1219, 1219, 1278, 1219, 1219, 1219, 1219, 1219,
 /*    60 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1276, 1416, 1219,
 /*    70 */  1551, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*    80 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*    90 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1278, 1219, 1562,
 /*   100 */  1562, 1562, 1276, 1219, 1219, 1219, 1219, 1219, 1371, 1219,
 /*   110 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1450, 1219, 1219,
 /*   120 */  1626, 1219, 1219, 1324, 1219, 1586, 1219, 1578, 1554, 1568,
 /*   130 */  1555, 1219, 1611, 1571, 1219, 1219, 1219, 1442, 1219, 1219,
 /*   140 */  1421, 1418, 1418, 1219, 1219, 1219, 1278, 1219, 1219, 1278,
 /*   150 */  1278, 1219, 1278, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   160 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   170 */  1452, 1219, 1276, 1219, 1219, 1276, 1219, 1593, 1591, 1219,
 /*   180 */  1593, 1591, 1219, 1219, 1605, 1601, 1584, 1582, 1568, 1219,
 /*   190 */  1219, 1219, 1629, 1617, 1613, 1219, 1219, 1591, 1219, 1219,
 /*   200 */  1591, 1219, 1429, 1219, 1219, 1276, 1219, 1276, 1219, 1340,
 /*   210 */  1219, 1219, 1219, 1276, 1219, 1444, 1374, 1374, 1279, 1224,
 /*   220 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   230 */  1219, 1515, 1604, 1603, 1514, 1528, 1527, 1526, 1219, 1219,
 /*   240 */  1509, 1219, 1219, 1510, 1508, 1507, 1219, 1219, 1219, 1219,
 /*   250 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   260 */  1552, 1219, 1614, 1618, 1219, 1219, 1219, 1489, 1219, 1219,
 /*   270 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   280 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   290 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   300 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   310 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   320 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   330 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   340 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   350 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   360 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   370 */  1219, 1219, 1219, 1219, 1385, 1219, 1219, 1219, 1219, 1219,
 /*   380 */  1219, 1305, 1304, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   390 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   400 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   410 */  1219, 1219, 1219, 1219, 1575, 1585, 1219, 1219, 1219, 1219,
 /*   420 */  1219, 1219, 1219, 1219, 1219, 1489, 1219, 1602, 1219, 1561,
 /*   430 */  1557, 1219, 1219, 1553, 1219, 1219, 1612, 1219, 1219, 1219,
 /*   440 */  1219, 1219, 1219, 1219, 1219, 1547, 1219, 1219, 1219, 1219,
 /*   450 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   460 */  1219, 1219, 1219, 1219, 1488, 1219, 1219, 1219, 1219, 1219,
 /*   470 */  1219, 1219, 1368, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   480 */  1219, 1219, 1219, 1219, 1219, 1353, 1351, 1350, 1349, 1219,
 /*   490 */  1346, 1219, 1219, 1219, 1219, 1219, 1219, 1376, 1219, 1219,
 /*   500 */  1219, 1219, 1219, 1299, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   510 */  1219, 1219, 1219, 1290, 1219, 1289, 1219, 1219, 1219, 1219,
 /*   520 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   530 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
 /*   540 */  1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747
};
/********** End of lemon-generated parsing tables *****************************/

/* The next table maps tokens (terminal symbols) into fallback tokens.  
** If a construct like the following:
** 
**      %fallback ID X Y Z.
**
** appears in the grammar, then ID becomes a fallback token for X, Y,
** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
** but it does not parse, the type of the token is changed to ID and
** the parse is retried before an error is thrown.
**
** This feature can be used, for example, to cause some keywords in a language
** to revert to identifiers if they keyword does not apply in the context where
** it appears.
*/
#ifdef YYFALLBACK
static const YYCODETYPE yyFallback[] = {
};
#endif /* YYFALLBACK */

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

/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
  yyStackEntry *yytos;          /* Pointer to top element of the stack */
#ifdef YYTRACKMAXSTACKDEPTH
  int yyhwm;                    /* High-water mark of the stack */
#endif
#ifndef YYNOERRORRECOVERY
  int yyerrcnt;                 /* Shifts left before out of the error */
#endif
X
Xiaoyu Wang 已提交
748 749
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784
#if YYSTACKDEPTH<=0
  int yystksz;                  /* Current side of the stack */
  yyStackEntry *yystack;        /* The parser's stack */
  yyStackEntry yystk0;          /* First stack entry */
#else
  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
  yyStackEntry *yystackEnd;            /* Last entry in the stack */
#endif
};
typedef struct yyParser yyParser;

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

#ifndef NDEBUG
/* 
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message.  Tracing is turned off
** by making either argument NULL 
**
** Inputs:
** <ul>
** <li> A FILE* to which trace output should be written.
**      If NULL, then tracing is turned off.
** <li> A prefix string written at the beginning of every
**      line of trace output.  If NULL, then tracing is
**      turned off.
** </ul>
**
** Outputs:
** None.
*/
X
Xiaoyu Wang 已提交
785
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
786 787 788 789 790 791 792 793 794 795 796 797
  yyTraceFILE = TraceFILE;
  yyTracePrompt = zTracePrompt;
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
#endif /* NDEBUG */

#if defined(YYCOVERAGE) || !defined(NDEBUG)
/* For tracing shifts, the names of all terminals and nonterminals
** are required.  The following table supplies these names */
static const char *const yyTokenName[] = { 
  /*    0 */ "$",
798 799
  /*    1 */ "OR",
  /*    2 */ "AND",
800 801 802 803 804
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
805 806 807 808 809 810 811 812 813 814
  /*    8 */ "NK_BITAND",
  /*    9 */ "NK_BITOR",
  /*   10 */ "NK_LSHIFT",
  /*   11 */ "NK_RSHIFT",
  /*   12 */ "NK_PLUS",
  /*   13 */ "NK_MINUS",
  /*   14 */ "NK_STAR",
  /*   15 */ "NK_SLASH",
  /*   16 */ "NK_REM",
  /*   17 */ "NK_CONCAT",
815
  /*   18 */ "CREATE",
816 817 818
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
819 820 821 822 823 824 825 826 827 828 829 830
  /*   22 */ "NK_STRING",
  /*   23 */ "ALTER",
  /*   24 */ "PPS",
  /*   25 */ "TSERIES",
  /*   26 */ "STORAGE",
  /*   27 */ "STREAMS",
  /*   28 */ "QTIME",
  /*   29 */ "DBS",
  /*   30 */ "USERS",
  /*   31 */ "CONNS",
  /*   32 */ "STATE",
  /*   33 */ "USER",
831 832
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
833 834 835 836 837 838 839 840
  /*   36 */ "DNODE",
  /*   37 */ "PORT",
  /*   38 */ "NK_INTEGER",
  /*   39 */ "DNODES",
  /*   40 */ "NK_IPTOKEN",
  /*   41 */ "LOCAL",
  /*   42 */ "QNODE",
  /*   43 */ "ON",
841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921
  /*   44 */ "BNODE",
  /*   45 */ "SNODE",
  /*   46 */ "MNODE",
  /*   47 */ "DATABASE",
  /*   48 */ "USE",
  /*   49 */ "IF",
  /*   50 */ "NOT",
  /*   51 */ "EXISTS",
  /*   52 */ "BLOCKS",
  /*   53 */ "CACHE",
  /*   54 */ "CACHELAST",
  /*   55 */ "COMP",
  /*   56 */ "DAYS",
  /*   57 */ "NK_VARIABLE",
  /*   58 */ "FSYNC",
  /*   59 */ "MAXROWS",
  /*   60 */ "MINROWS",
  /*   61 */ "KEEP",
  /*   62 */ "PRECISION",
  /*   63 */ "QUORUM",
  /*   64 */ "REPLICA",
  /*   65 */ "TTL",
  /*   66 */ "WAL",
  /*   67 */ "VGROUPS",
  /*   68 */ "SINGLE_STABLE",
  /*   69 */ "STREAM_MODE",
  /*   70 */ "RETENTIONS",
  /*   71 */ "NK_COMMA",
  /*   72 */ "NK_COLON",
  /*   73 */ "TABLE",
  /*   74 */ "NK_LP",
  /*   75 */ "NK_RP",
  /*   76 */ "STABLE",
  /*   77 */ "ADD",
  /*   78 */ "COLUMN",
  /*   79 */ "MODIFY",
  /*   80 */ "RENAME",
  /*   81 */ "TAG",
  /*   82 */ "SET",
  /*   83 */ "NK_EQ",
  /*   84 */ "USING",
  /*   85 */ "TAGS",
  /*   86 */ "NK_DOT",
  /*   87 */ "COMMENT",
  /*   88 */ "BOOL",
  /*   89 */ "TINYINT",
  /*   90 */ "SMALLINT",
  /*   91 */ "INT",
  /*   92 */ "INTEGER",
  /*   93 */ "BIGINT",
  /*   94 */ "FLOAT",
  /*   95 */ "DOUBLE",
  /*   96 */ "BINARY",
  /*   97 */ "TIMESTAMP",
  /*   98 */ "NCHAR",
  /*   99 */ "UNSIGNED",
  /*  100 */ "JSON",
  /*  101 */ "VARCHAR",
  /*  102 */ "MEDIUMBLOB",
  /*  103 */ "BLOB",
  /*  104 */ "VARBINARY",
  /*  105 */ "DECIMAL",
  /*  106 */ "SMA",
  /*  107 */ "ROLLUP",
  /*  108 */ "FILE_FACTOR",
  /*  109 */ "NK_FLOAT",
  /*  110 */ "DELAY",
  /*  111 */ "SHOW",
  /*  112 */ "DATABASES",
  /*  113 */ "TABLES",
  /*  114 */ "STABLES",
  /*  115 */ "MNODES",
  /*  116 */ "MODULES",
  /*  117 */ "QNODES",
  /*  118 */ "FUNCTIONS",
  /*  119 */ "INDEXES",
  /*  120 */ "FROM",
  /*  121 */ "ACCOUNTS",
  /*  122 */ "APPS",
  /*  123 */ "CONNECTIONS",
  /*  124 */ "LICENCE",
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962
  /*  125 */ "GRANTS",
  /*  126 */ "QUERIES",
  /*  127 */ "SCORES",
  /*  128 */ "TOPICS",
  /*  129 */ "VARIABLES",
  /*  130 */ "BNODES",
  /*  131 */ "SNODES",
  /*  132 */ "LIKE",
  /*  133 */ "INDEX",
  /*  134 */ "FULLTEXT",
  /*  135 */ "FUNCTION",
  /*  136 */ "INTERVAL",
  /*  137 */ "TOPIC",
  /*  138 */ "AS",
  /*  139 */ "DESC",
  /*  140 */ "DESCRIBE",
  /*  141 */ "RESET",
  /*  142 */ "QUERY",
  /*  143 */ "EXPLAIN",
  /*  144 */ "ANALYZE",
  /*  145 */ "VERBOSE",
  /*  146 */ "NK_BOOL",
  /*  147 */ "RATIO",
  /*  148 */ "COMPACT",
  /*  149 */ "VNODES",
  /*  150 */ "IN",
  /*  151 */ "OUTPUTTYPE",
  /*  152 */ "AGGREGATE",
  /*  153 */ "BUFSIZE",
  /*  154 */ "STREAM",
  /*  155 */ "INTO",
  /*  156 */ "KILL",
  /*  157 */ "CONNECTION",
  /*  158 */ "MERGE",
  /*  159 */ "VGROUP",
  /*  160 */ "REDISTRIBUTE",
  /*  161 */ "SPLIT",
  /*  162 */ "SYNCDB",
  /*  163 */ "NULL",
  /*  164 */ "FIRST",
  /*  165 */ "LAST",
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111
  /*  166 */ "CAST",
  /*  167 */ "NOW",
  /*  168 */ "ROWTS",
  /*  169 */ "TBNAME",
  /*  170 */ "QSTARTTS",
  /*  171 */ "QENDTS",
  /*  172 */ "WSTARTTS",
  /*  173 */ "WENDTS",
  /*  174 */ "WDURATION",
  /*  175 */ "BETWEEN",
  /*  176 */ "IS",
  /*  177 */ "NK_LT",
  /*  178 */ "NK_GT",
  /*  179 */ "NK_LE",
  /*  180 */ "NK_GE",
  /*  181 */ "NK_NE",
  /*  182 */ "MATCH",
  /*  183 */ "NMATCH",
  /*  184 */ "JOIN",
  /*  185 */ "INNER",
  /*  186 */ "SELECT",
  /*  187 */ "DISTINCT",
  /*  188 */ "WHERE",
  /*  189 */ "PARTITION",
  /*  190 */ "BY",
  /*  191 */ "SESSION",
  /*  192 */ "STATE_WINDOW",
  /*  193 */ "SLIDING",
  /*  194 */ "FILL",
  /*  195 */ "VALUE",
  /*  196 */ "NONE",
  /*  197 */ "PREV",
  /*  198 */ "LINEAR",
  /*  199 */ "NEXT",
  /*  200 */ "GROUP",
  /*  201 */ "HAVING",
  /*  202 */ "ORDER",
  /*  203 */ "SLIMIT",
  /*  204 */ "SOFFSET",
  /*  205 */ "LIMIT",
  /*  206 */ "OFFSET",
  /*  207 */ "ASC",
  /*  208 */ "NULLS",
  /*  209 */ "cmd",
  /*  210 */ "account_options",
  /*  211 */ "alter_account_options",
  /*  212 */ "literal",
  /*  213 */ "alter_account_option",
  /*  214 */ "user_name",
  /*  215 */ "dnode_endpoint",
  /*  216 */ "dnode_host_name",
  /*  217 */ "not_exists_opt",
  /*  218 */ "db_name",
  /*  219 */ "db_options",
  /*  220 */ "exists_opt",
  /*  221 */ "alter_db_options",
  /*  222 */ "integer_list",
  /*  223 */ "variable_list",
  /*  224 */ "retention_list",
  /*  225 */ "alter_db_option",
  /*  226 */ "retention",
  /*  227 */ "full_table_name",
  /*  228 */ "column_def_list",
  /*  229 */ "tags_def_opt",
  /*  230 */ "table_options",
  /*  231 */ "multi_create_clause",
  /*  232 */ "tags_def",
  /*  233 */ "multi_drop_clause",
  /*  234 */ "alter_table_clause",
  /*  235 */ "alter_table_options",
  /*  236 */ "column_name",
  /*  237 */ "type_name",
  /*  238 */ "create_subtable_clause",
  /*  239 */ "specific_tags_opt",
  /*  240 */ "literal_list",
  /*  241 */ "drop_table_clause",
  /*  242 */ "col_name_list",
  /*  243 */ "table_name",
  /*  244 */ "column_def",
  /*  245 */ "func_name_list",
  /*  246 */ "alter_table_option",
  /*  247 */ "col_name",
  /*  248 */ "db_name_cond_opt",
  /*  249 */ "like_pattern_opt",
  /*  250 */ "table_name_cond",
  /*  251 */ "from_db_opt",
  /*  252 */ "func_name",
  /*  253 */ "function_name",
  /*  254 */ "index_name",
  /*  255 */ "index_options",
  /*  256 */ "func_list",
  /*  257 */ "duration_literal",
  /*  258 */ "sliding_opt",
  /*  259 */ "func",
  /*  260 */ "expression_list",
  /*  261 */ "topic_name",
  /*  262 */ "query_expression",
  /*  263 */ "analyze_opt",
  /*  264 */ "explain_options",
  /*  265 */ "agg_func_opt",
  /*  266 */ "bufsize_opt",
  /*  267 */ "stream_name",
  /*  268 */ "dnode_list",
  /*  269 */ "signed",
  /*  270 */ "signed_literal",
  /*  271 */ "table_alias",
  /*  272 */ "column_alias",
  /*  273 */ "expression",
  /*  274 */ "pseudo_column",
  /*  275 */ "column_reference",
  /*  276 */ "subquery",
  /*  277 */ "predicate",
  /*  278 */ "compare_op",
  /*  279 */ "in_op",
  /*  280 */ "in_predicate_value",
  /*  281 */ "boolean_value_expression",
  /*  282 */ "boolean_primary",
  /*  283 */ "common_expression",
  /*  284 */ "from_clause",
  /*  285 */ "table_reference_list",
  /*  286 */ "table_reference",
  /*  287 */ "table_primary",
  /*  288 */ "joined_table",
  /*  289 */ "alias_opt",
  /*  290 */ "parenthesized_joined_table",
  /*  291 */ "join_type",
  /*  292 */ "search_condition",
  /*  293 */ "query_specification",
  /*  294 */ "set_quantifier_opt",
  /*  295 */ "select_list",
  /*  296 */ "where_clause_opt",
  /*  297 */ "partition_by_clause_opt",
  /*  298 */ "twindow_clause_opt",
  /*  299 */ "group_by_clause_opt",
  /*  300 */ "having_clause_opt",
  /*  301 */ "select_sublist",
  /*  302 */ "select_item",
  /*  303 */ "fill_opt",
  /*  304 */ "fill_mode",
  /*  305 */ "group_by_list",
  /*  306 */ "query_expression_body",
  /*  307 */ "order_by_clause_opt",
  /*  308 */ "slimit_clause_opt",
  /*  309 */ "limit_clause_opt",
  /*  310 */ "query_primary",
  /*  311 */ "sort_specification_list",
  /*  312 */ "sort_specification",
  /*  313 */ "ordering_specification_opt",
  /*  314 */ "null_ordering_opt",
1112 1113 1114 1115 1116 1117 1118
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146
 /*   0 */ "cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options",
 /*   1 */ "cmd ::= ALTER ACCOUNT NK_ID alter_account_options",
 /*   2 */ "account_options ::=",
 /*   3 */ "account_options ::= account_options PPS literal",
 /*   4 */ "account_options ::= account_options TSERIES literal",
 /*   5 */ "account_options ::= account_options STORAGE literal",
 /*   6 */ "account_options ::= account_options STREAMS literal",
 /*   7 */ "account_options ::= account_options QTIME literal",
 /*   8 */ "account_options ::= account_options DBS literal",
 /*   9 */ "account_options ::= account_options USERS literal",
 /*  10 */ "account_options ::= account_options CONNS literal",
 /*  11 */ "account_options ::= account_options STATE literal",
 /*  12 */ "alter_account_options ::= alter_account_option",
 /*  13 */ "alter_account_options ::= alter_account_options alter_account_option",
 /*  14 */ "alter_account_option ::= PASS literal",
 /*  15 */ "alter_account_option ::= PPS literal",
 /*  16 */ "alter_account_option ::= TSERIES literal",
 /*  17 */ "alter_account_option ::= STORAGE literal",
 /*  18 */ "alter_account_option ::= STREAMS literal",
 /*  19 */ "alter_account_option ::= QTIME literal",
 /*  20 */ "alter_account_option ::= DBS literal",
 /*  21 */ "alter_account_option ::= USERS literal",
 /*  22 */ "alter_account_option ::= CONNS literal",
 /*  23 */ "alter_account_option ::= STATE literal",
 /*  24 */ "cmd ::= CREATE USER user_name PASS NK_STRING",
 /*  25 */ "cmd ::= ALTER USER user_name PASS NK_STRING",
 /*  26 */ "cmd ::= ALTER USER user_name PRIVILEGE NK_STRING",
 /*  27 */ "cmd ::= DROP USER user_name",
X
Xiaoyu Wang 已提交
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161
 /*  28 */ "cmd ::= CREATE DNODE dnode_endpoint",
 /*  29 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER",
 /*  30 */ "cmd ::= DROP DNODE NK_INTEGER",
 /*  31 */ "cmd ::= DROP DNODE dnode_endpoint",
 /*  32 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
 /*  33 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
 /*  34 */ "cmd ::= ALTER ALL DNODES NK_STRING",
 /*  35 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
 /*  36 */ "dnode_endpoint ::= NK_STRING",
 /*  37 */ "dnode_host_name ::= NK_ID",
 /*  38 */ "dnode_host_name ::= NK_IPTOKEN",
 /*  39 */ "cmd ::= ALTER LOCAL NK_STRING",
 /*  40 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
 /*  41 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
 /*  42 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302
 /*  43 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER",
 /*  44 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER",
 /*  45 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER",
 /*  46 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER",
 /*  47 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER",
 /*  48 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER",
 /*  49 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
 /*  50 */ "cmd ::= DROP DATABASE exists_opt db_name",
 /*  51 */ "cmd ::= USE db_name",
 /*  52 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
 /*  53 */ "not_exists_opt ::= IF NOT EXISTS",
 /*  54 */ "not_exists_opt ::=",
 /*  55 */ "exists_opt ::= IF EXISTS",
 /*  56 */ "exists_opt ::=",
 /*  57 */ "db_options ::=",
 /*  58 */ "db_options ::= db_options BLOCKS NK_INTEGER",
 /*  59 */ "db_options ::= db_options CACHE NK_INTEGER",
 /*  60 */ "db_options ::= db_options CACHELAST NK_INTEGER",
 /*  61 */ "db_options ::= db_options COMP NK_INTEGER",
 /*  62 */ "db_options ::= db_options DAYS NK_INTEGER",
 /*  63 */ "db_options ::= db_options DAYS NK_VARIABLE",
 /*  64 */ "db_options ::= db_options FSYNC NK_INTEGER",
 /*  65 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  66 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  67 */ "db_options ::= db_options KEEP integer_list",
 /*  68 */ "db_options ::= db_options KEEP variable_list",
 /*  69 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  70 */ "db_options ::= db_options QUORUM NK_INTEGER",
 /*  71 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  72 */ "db_options ::= db_options TTL NK_INTEGER",
 /*  73 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  74 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  75 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  76 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
 /*  77 */ "db_options ::= db_options RETENTIONS retention_list",
 /*  78 */ "alter_db_options ::= alter_db_option",
 /*  79 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  80 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  81 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  82 */ "alter_db_option ::= KEEP integer_list",
 /*  83 */ "alter_db_option ::= KEEP variable_list",
 /*  84 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  85 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  86 */ "alter_db_option ::= CACHELAST NK_INTEGER",
 /*  87 */ "alter_db_option ::= REPLICA NK_INTEGER",
 /*  88 */ "integer_list ::= NK_INTEGER",
 /*  89 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
 /*  90 */ "variable_list ::= NK_VARIABLE",
 /*  91 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
 /*  92 */ "retention_list ::= retention",
 /*  93 */ "retention_list ::= retention_list NK_COMMA retention",
 /*  94 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
 /*  95 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /*  96 */ "cmd ::= CREATE TABLE multi_create_clause",
 /*  97 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /*  98 */ "cmd ::= DROP TABLE multi_drop_clause",
 /*  99 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /* 100 */ "cmd ::= ALTER TABLE alter_table_clause",
 /* 101 */ "cmd ::= ALTER STABLE alter_table_clause",
 /* 102 */ "alter_table_clause ::= full_table_name alter_table_options",
 /* 103 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /* 104 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /* 105 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /* 106 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /* 107 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /* 108 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /* 109 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /* 110 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /* 111 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /* 112 */ "multi_create_clause ::= create_subtable_clause",
 /* 113 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /* 114 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
 /* 115 */ "multi_drop_clause ::= drop_table_clause",
 /* 116 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 117 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 118 */ "specific_tags_opt ::=",
 /* 119 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 120 */ "full_table_name ::= table_name",
 /* 121 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 122 */ "column_def_list ::= column_def",
 /* 123 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 124 */ "column_def ::= column_name type_name",
 /* 125 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 126 */ "type_name ::= BOOL",
 /* 127 */ "type_name ::= TINYINT",
 /* 128 */ "type_name ::= SMALLINT",
 /* 129 */ "type_name ::= INT",
 /* 130 */ "type_name ::= INTEGER",
 /* 131 */ "type_name ::= BIGINT",
 /* 132 */ "type_name ::= FLOAT",
 /* 133 */ "type_name ::= DOUBLE",
 /* 134 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 135 */ "type_name ::= TIMESTAMP",
 /* 136 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 137 */ "type_name ::= TINYINT UNSIGNED",
 /* 138 */ "type_name ::= SMALLINT UNSIGNED",
 /* 139 */ "type_name ::= INT UNSIGNED",
 /* 140 */ "type_name ::= BIGINT UNSIGNED",
 /* 141 */ "type_name ::= JSON",
 /* 142 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 143 */ "type_name ::= MEDIUMBLOB",
 /* 144 */ "type_name ::= BLOB",
 /* 145 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 146 */ "type_name ::= DECIMAL",
 /* 147 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 148 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 149 */ "tags_def_opt ::=",
 /* 150 */ "tags_def_opt ::= tags_def",
 /* 151 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 152 */ "table_options ::=",
 /* 153 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 154 */ "table_options ::= table_options KEEP integer_list",
 /* 155 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 156 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 157 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 158 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 159 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 160 */ "alter_table_options ::= alter_table_option",
 /* 161 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 162 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 163 */ "alter_table_option ::= KEEP integer_list",
 /* 164 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 165 */ "col_name_list ::= col_name",
 /* 166 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 167 */ "col_name ::= column_name",
 /* 168 */ "cmd ::= SHOW DNODES",
 /* 169 */ "cmd ::= SHOW USERS",
 /* 170 */ "cmd ::= SHOW DATABASES",
 /* 171 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 172 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 173 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 174 */ "cmd ::= SHOW MNODES",
 /* 175 */ "cmd ::= SHOW MODULES",
 /* 176 */ "cmd ::= SHOW QNODES",
 /* 177 */ "cmd ::= SHOW FUNCTIONS",
 /* 178 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 179 */ "cmd ::= SHOW STREAMS",
 /* 180 */ "cmd ::= SHOW ACCOUNTS",
 /* 181 */ "cmd ::= SHOW APPS",
 /* 182 */ "cmd ::= SHOW CONNECTIONS",
 /* 183 */ "cmd ::= SHOW LICENCE",
1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400
 /* 184 */ "cmd ::= SHOW GRANTS",
 /* 185 */ "cmd ::= SHOW CREATE DATABASE db_name",
 /* 186 */ "cmd ::= SHOW CREATE TABLE full_table_name",
 /* 187 */ "cmd ::= SHOW CREATE STABLE full_table_name",
 /* 188 */ "cmd ::= SHOW QUERIES",
 /* 189 */ "cmd ::= SHOW SCORES",
 /* 190 */ "cmd ::= SHOW TOPICS",
 /* 191 */ "cmd ::= SHOW VARIABLES",
 /* 192 */ "cmd ::= SHOW BNODES",
 /* 193 */ "cmd ::= SHOW SNODES",
 /* 194 */ "db_name_cond_opt ::=",
 /* 195 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 196 */ "like_pattern_opt ::=",
 /* 197 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 198 */ "table_name_cond ::= table_name",
 /* 199 */ "from_db_opt ::=",
 /* 200 */ "from_db_opt ::= FROM db_name",
 /* 201 */ "func_name_list ::= func_name",
 /* 202 */ "func_name_list ::= func_name_list NK_COMMA col_name",
 /* 203 */ "func_name ::= function_name",
 /* 204 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 205 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 206 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 207 */ "index_options ::=",
 /* 208 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 209 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 210 */ "func_list ::= func",
 /* 211 */ "func_list ::= func_list NK_COMMA func",
 /* 212 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 213 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
 /* 214 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
 /* 215 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 216 */ "cmd ::= DESC full_table_name",
 /* 217 */ "cmd ::= DESCRIBE full_table_name",
 /* 218 */ "cmd ::= RESET QUERY CACHE",
 /* 219 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression",
 /* 220 */ "analyze_opt ::=",
 /* 221 */ "analyze_opt ::= ANALYZE",
 /* 222 */ "explain_options ::=",
 /* 223 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 224 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 225 */ "cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP",
 /* 226 */ "cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
 /* 227 */ "cmd ::= DROP FUNCTION function_name",
 /* 228 */ "agg_func_opt ::=",
 /* 229 */ "agg_func_opt ::= AGGREGATE",
 /* 230 */ "bufsize_opt ::=",
 /* 231 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
 /* 232 */ "cmd ::= CREATE STREAM stream_name INTO table_name AS query_expression",
 /* 233 */ "cmd ::= DROP STREAM stream_name",
 /* 234 */ "cmd ::= KILL CONNECTION NK_INTEGER",
 /* 235 */ "cmd ::= KILL QUERY NK_INTEGER",
 /* 236 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
 /* 237 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
 /* 238 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
 /* 239 */ "dnode_list ::= DNODE NK_INTEGER",
 /* 240 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
 /* 241 */ "cmd ::= SYNCDB db_name REPLICA",
 /* 242 */ "cmd ::= query_expression",
 /* 243 */ "literal ::= NK_INTEGER",
 /* 244 */ "literal ::= NK_FLOAT",
 /* 245 */ "literal ::= NK_STRING",
 /* 246 */ "literal ::= NK_BOOL",
 /* 247 */ "literal ::= TIMESTAMP NK_STRING",
 /* 248 */ "literal ::= duration_literal",
 /* 249 */ "literal ::= NULL",
 /* 250 */ "duration_literal ::= NK_VARIABLE",
 /* 251 */ "signed ::= NK_INTEGER",
 /* 252 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 253 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 254 */ "signed ::= NK_FLOAT",
 /* 255 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 256 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 257 */ "signed_literal ::= signed",
 /* 258 */ "signed_literal ::= NK_STRING",
 /* 259 */ "signed_literal ::= NK_BOOL",
 /* 260 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 261 */ "signed_literal ::= duration_literal",
 /* 262 */ "signed_literal ::= NULL",
 /* 263 */ "literal_list ::= signed_literal",
 /* 264 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 265 */ "db_name ::= NK_ID",
 /* 266 */ "table_name ::= NK_ID",
 /* 267 */ "column_name ::= NK_ID",
 /* 268 */ "function_name ::= NK_ID",
 /* 269 */ "function_name ::= FIRST",
 /* 270 */ "function_name ::= LAST",
 /* 271 */ "table_alias ::= NK_ID",
 /* 272 */ "column_alias ::= NK_ID",
 /* 273 */ "user_name ::= NK_ID",
 /* 274 */ "index_name ::= NK_ID",
 /* 275 */ "topic_name ::= NK_ID",
 /* 276 */ "stream_name ::= NK_ID",
 /* 277 */ "expression ::= literal",
 /* 278 */ "expression ::= pseudo_column",
 /* 279 */ "expression ::= column_reference",
 /* 280 */ "expression ::= function_name NK_LP expression_list NK_RP",
 /* 281 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
1401
 /* 282 */ "expression ::= CAST NK_LP expression AS type_name NK_RP",
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528
 /* 283 */ "expression ::= subquery",
 /* 284 */ "expression ::= NK_LP expression NK_RP",
 /* 285 */ "expression ::= NK_PLUS expression",
 /* 286 */ "expression ::= NK_MINUS expression",
 /* 287 */ "expression ::= expression NK_PLUS expression",
 /* 288 */ "expression ::= expression NK_MINUS expression",
 /* 289 */ "expression ::= expression NK_STAR expression",
 /* 290 */ "expression ::= expression NK_SLASH expression",
 /* 291 */ "expression ::= expression NK_REM expression",
 /* 292 */ "expression_list ::= expression",
 /* 293 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 294 */ "column_reference ::= column_name",
 /* 295 */ "column_reference ::= table_name NK_DOT column_name",
 /* 296 */ "pseudo_column ::= NOW",
 /* 297 */ "pseudo_column ::= ROWTS",
 /* 298 */ "pseudo_column ::= TBNAME",
 /* 299 */ "pseudo_column ::= QSTARTTS",
 /* 300 */ "pseudo_column ::= QENDTS",
 /* 301 */ "pseudo_column ::= WSTARTTS",
 /* 302 */ "pseudo_column ::= WENDTS",
 /* 303 */ "pseudo_column ::= WDURATION",
 /* 304 */ "predicate ::= expression compare_op expression",
 /* 305 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 306 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 307 */ "predicate ::= expression IS NULL",
 /* 308 */ "predicate ::= expression IS NOT NULL",
 /* 309 */ "predicate ::= expression in_op in_predicate_value",
 /* 310 */ "compare_op ::= NK_LT",
 /* 311 */ "compare_op ::= NK_GT",
 /* 312 */ "compare_op ::= NK_LE",
 /* 313 */ "compare_op ::= NK_GE",
 /* 314 */ "compare_op ::= NK_NE",
 /* 315 */ "compare_op ::= NK_EQ",
 /* 316 */ "compare_op ::= LIKE",
 /* 317 */ "compare_op ::= NOT LIKE",
 /* 318 */ "compare_op ::= MATCH",
 /* 319 */ "compare_op ::= NMATCH",
 /* 320 */ "in_op ::= IN",
 /* 321 */ "in_op ::= NOT IN",
 /* 322 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 323 */ "boolean_value_expression ::= boolean_primary",
 /* 324 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 325 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 326 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 327 */ "boolean_primary ::= predicate",
 /* 328 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 329 */ "common_expression ::= expression",
 /* 330 */ "common_expression ::= boolean_value_expression",
 /* 331 */ "from_clause ::= FROM table_reference_list",
 /* 332 */ "table_reference_list ::= table_reference",
 /* 333 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 334 */ "table_reference ::= table_primary",
 /* 335 */ "table_reference ::= joined_table",
 /* 336 */ "table_primary ::= table_name alias_opt",
 /* 337 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 338 */ "table_primary ::= subquery alias_opt",
 /* 339 */ "table_primary ::= parenthesized_joined_table",
 /* 340 */ "alias_opt ::=",
 /* 341 */ "alias_opt ::= table_alias",
 /* 342 */ "alias_opt ::= AS table_alias",
 /* 343 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 344 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 345 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 346 */ "join_type ::=",
 /* 347 */ "join_type ::= INNER",
 /* 348 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
 /* 349 */ "set_quantifier_opt ::=",
 /* 350 */ "set_quantifier_opt ::= DISTINCT",
 /* 351 */ "set_quantifier_opt ::= ALL",
 /* 352 */ "select_list ::= NK_STAR",
 /* 353 */ "select_list ::= select_sublist",
 /* 354 */ "select_sublist ::= select_item",
 /* 355 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 356 */ "select_item ::= common_expression",
 /* 357 */ "select_item ::= common_expression column_alias",
 /* 358 */ "select_item ::= common_expression AS column_alias",
 /* 359 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 360 */ "where_clause_opt ::=",
 /* 361 */ "where_clause_opt ::= WHERE search_condition",
 /* 362 */ "partition_by_clause_opt ::=",
 /* 363 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 364 */ "twindow_clause_opt ::=",
 /* 365 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 366 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
 /* 367 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 368 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 369 */ "sliding_opt ::=",
 /* 370 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 371 */ "fill_opt ::=",
 /* 372 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 373 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 374 */ "fill_mode ::= NONE",
 /* 375 */ "fill_mode ::= PREV",
 /* 376 */ "fill_mode ::= NULL",
 /* 377 */ "fill_mode ::= LINEAR",
 /* 378 */ "fill_mode ::= NEXT",
 /* 379 */ "group_by_clause_opt ::=",
 /* 380 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 381 */ "group_by_list ::= expression",
 /* 382 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 383 */ "having_clause_opt ::=",
 /* 384 */ "having_clause_opt ::= HAVING search_condition",
 /* 385 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 386 */ "query_expression_body ::= query_primary",
 /* 387 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 388 */ "query_primary ::= query_specification",
 /* 389 */ "order_by_clause_opt ::=",
 /* 390 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 391 */ "slimit_clause_opt ::=",
 /* 392 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 393 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 394 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 395 */ "limit_clause_opt ::=",
 /* 396 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 397 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 398 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 399 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 400 */ "search_condition ::= common_expression",
 /* 401 */ "sort_specification_list ::= sort_specification",
 /* 402 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 403 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 404 */ "ordering_specification_opt ::=",
 /* 405 */ "ordering_specification_opt ::= ASC",
 /* 406 */ "ordering_specification_opt ::= DESC",
 /* 407 */ "null_ordering_opt ::=",
 /* 408 */ "null_ordering_opt ::= NULLS FIRST",
 /* 409 */ "null_ordering_opt ::= NULLS LAST",
1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545
};
#endif /* NDEBUG */


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

  newSize = p->yystksz*2 + 100;
  idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
  if( p->yystack==&p->yystk0 ){
X
Xiaoyu Wang 已提交
1546
    pNew = malloc(newSize*sizeof(pNew[0]));
1547 1548
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1549
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566
  }
  if( pNew ){
    p->yystack = pNew;
    p->yytos = &p->yystack[idx];
#ifndef NDEBUG
    if( yyTraceFILE ){
      fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
              yyTracePrompt, p->yystksz, newSize);
    }
#endif
    p->yystksz = newSize;
  }
  return pNew==0; 
}
#endif

/* Datatype of the argument to the memory allocated passed as the
X
Xiaoyu Wang 已提交
1567
** second argument to ParseAlloc() below.  This can be changed by
1568 1569 1570 1571 1572 1573 1574 1575 1576
** putting an appropriate #define in the %include section of the input
** grammar.
*/
#ifndef YYMALLOCARGTYPE
# define YYMALLOCARGTYPE size_t
#endif

/* Initialize a new parser that has already been allocated.
*/
X
Xiaoyu Wang 已提交
1577
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1578
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1579
  ParseCTX_STORE
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602
#ifdef YYTRACKMAXSTACKDEPTH
  yypParser->yyhwm = 0;
#endif
#if YYSTACKDEPTH<=0
  yypParser->yytos = NULL;
  yypParser->yystack = NULL;
  yypParser->yystksz = 0;
  if( yyGrowStack(yypParser) ){
    yypParser->yystack = &yypParser->yystk0;
    yypParser->yystksz = 1;
  }
#endif
#ifndef YYNOERRORRECOVERY
  yypParser->yyerrcnt = -1;
#endif
  yypParser->yytos = yypParser->yystack;
  yypParser->yystack[0].stateno = 0;
  yypParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0
  yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
#endif
}

X
Xiaoyu Wang 已提交
1603
#ifndef Parse_ENGINEALWAYSONSTACK
1604 1605 1606 1607 1608 1609 1610 1611 1612 1613
/* 
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
**
** Inputs:
** A pointer to the function used to allocate memory.
**
** Outputs:
** A pointer to a parser.  This pointer is used in subsequent calls
X
Xiaoyu Wang 已提交
1614
** to Parse and ParseFree.
1615
*/
X
Xiaoyu Wang 已提交
1616
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
1617 1618 1619
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
1620 1621
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
1622 1623 1624
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
1625
#endif /* Parse_ENGINEALWAYSONSTACK */
1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639


/* The following function deletes the "minor type" or semantic value
** associated with a symbol.  The symbol can be either a terminal
** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
** a pointer to the value to be deleted.  The code used to do the 
** deletions is derived from the %destructor and/or %token_destructor
** directives of the input grammar.
*/
static void yy_destructor(
  yyParser *yypParser,    /* The parser */
  YYCODETYPE yymajor,     /* Type code for object to destroy */
  YYMINORTYPE *yypminor   /* The object to be destroyed */
){
X
Xiaoyu Wang 已提交
1640 1641
  ParseARG_FETCH
  ParseCTX_FETCH
1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654
  switch( yymajor ){
    /* Here is inserted the actions which take place when a
    ** terminal or non-terminal is destroyed.  This can happen
    ** when the symbol is popped from the stack during a
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are *not* used
    ** inside the C code.
    */
/********* Begin destructor definitions ***************************************/
      /* Default NON-TERMINAL Destructor */
1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707
    case 209: /* cmd */
    case 212: /* literal */
    case 219: /* db_options */
    case 221: /* alter_db_options */
    case 226: /* retention */
    case 227: /* full_table_name */
    case 230: /* table_options */
    case 234: /* alter_table_clause */
    case 235: /* alter_table_options */
    case 238: /* create_subtable_clause */
    case 241: /* drop_table_clause */
    case 244: /* column_def */
    case 247: /* col_name */
    case 248: /* db_name_cond_opt */
    case 249: /* like_pattern_opt */
    case 250: /* table_name_cond */
    case 251: /* from_db_opt */
    case 252: /* func_name */
    case 255: /* index_options */
    case 257: /* duration_literal */
    case 258: /* sliding_opt */
    case 259: /* func */
    case 262: /* query_expression */
    case 264: /* explain_options */
    case 269: /* signed */
    case 270: /* signed_literal */
    case 273: /* expression */
    case 274: /* pseudo_column */
    case 275: /* column_reference */
    case 276: /* subquery */
    case 277: /* predicate */
    case 280: /* in_predicate_value */
    case 281: /* boolean_value_expression */
    case 282: /* boolean_primary */
    case 283: /* common_expression */
    case 284: /* from_clause */
    case 285: /* table_reference_list */
    case 286: /* table_reference */
    case 287: /* table_primary */
    case 288: /* joined_table */
    case 290: /* parenthesized_joined_table */
    case 292: /* search_condition */
    case 293: /* query_specification */
    case 296: /* where_clause_opt */
    case 298: /* twindow_clause_opt */
    case 300: /* having_clause_opt */
    case 302: /* select_item */
    case 303: /* fill_opt */
    case 306: /* query_expression_body */
    case 308: /* slimit_clause_opt */
    case 309: /* limit_clause_opt */
    case 310: /* query_primary */
    case 312: /* sort_specification */
1708
{
1709
 nodesDestroyNode((yypminor->yy182)); 
1710 1711
}
      break;
1712 1713 1714 1715
    case 210: /* account_options */
    case 211: /* alter_account_options */
    case 213: /* alter_account_option */
    case 266: /* bufsize_opt */
1716
{
1717
 
1718 1719
}
      break;
1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732
    case 214: /* user_name */
    case 215: /* dnode_endpoint */
    case 216: /* dnode_host_name */
    case 218: /* db_name */
    case 236: /* column_name */
    case 243: /* table_name */
    case 253: /* function_name */
    case 254: /* index_name */
    case 261: /* topic_name */
    case 267: /* stream_name */
    case 271: /* table_alias */
    case 272: /* column_alias */
    case 289: /* alias_opt */
1733
{
1734
 
1735 1736
}
      break;
1737 1738 1739 1740 1741
    case 217: /* not_exists_opt */
    case 220: /* exists_opt */
    case 263: /* analyze_opt */
    case 265: /* agg_func_opt */
    case 294: /* set_quantifier_opt */
1742
{
1743 1744 1745
 
}
      break;
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767
    case 222: /* integer_list */
    case 223: /* variable_list */
    case 224: /* retention_list */
    case 228: /* column_def_list */
    case 229: /* tags_def_opt */
    case 231: /* multi_create_clause */
    case 232: /* tags_def */
    case 233: /* multi_drop_clause */
    case 239: /* specific_tags_opt */
    case 240: /* literal_list */
    case 242: /* col_name_list */
    case 245: /* func_name_list */
    case 256: /* func_list */
    case 260: /* expression_list */
    case 268: /* dnode_list */
    case 295: /* select_list */
    case 297: /* partition_by_clause_opt */
    case 299: /* group_by_clause_opt */
    case 301: /* select_sublist */
    case 305: /* group_by_list */
    case 307: /* order_by_clause_opt */
    case 311: /* sort_specification_list */
1768
{
1769
 nodesDestroyList((yypminor->yy334)); 
1770 1771
}
      break;
1772 1773
    case 225: /* alter_db_option */
    case 246: /* alter_table_option */
1774
{
X
Xiaoyu Wang 已提交
1775
 
1776 1777
}
      break;
1778
    case 237: /* type_name */
1779
{
1780
 
1781 1782
}
      break;
1783 1784
    case 278: /* compare_op */
    case 279: /* in_op */
1785
{
1786
 
1787 1788
}
      break;
1789
    case 291: /* join_type */
1790
{
1791
 
1792 1793
}
      break;
1794
    case 304: /* fill_mode */
1795
{
1796
 
1797 1798
}
      break;
1799
    case 313: /* ordering_specification_opt */
1800
{
1801
 
1802 1803
}
      break;
1804
    case 314: /* null_ordering_opt */
1805
{
1806
 
1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837
}
      break;
/********* End destructor definitions *****************************************/
    default:  break;   /* If no destructor action specified: do nothing */
  }
}

/*
** Pop the parser's stack once.
**
** If there is a destructor routine associated with the token which
** is popped from the stack, then call it.
*/
static void yy_pop_parser_stack(yyParser *pParser){
  yyStackEntry *yytos;
  assert( pParser->yytos!=0 );
  assert( pParser->yytos > pParser->yystack );
  yytos = pParser->yytos--;
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sPopping %s\n",
      yyTracePrompt,
      yyTokenName[yytos->major]);
  }
#endif
  yy_destructor(pParser, yytos->major, &yytos->minor);
}

/*
** Clear all secondary memory allocations from the parser
*/
X
Xiaoyu Wang 已提交
1838
void ParseFinalize(void *p){
1839 1840 1841
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
1842
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
1843 1844 1845
#endif
}

X
Xiaoyu Wang 已提交
1846
#ifndef Parse_ENGINEALWAYSONSTACK
1847 1848 1849 1850 1851 1852 1853 1854
/* 
** Deallocate and destroy a parser.  Destructors are called for
** all stack elements before shutting the parser down.
**
** If the YYPARSEFREENEVERNULL macro exists (for example because it
** is defined in a %include section of the input grammar) then it is
** assumed that the input pointer is never NULL.
*/
X
Xiaoyu Wang 已提交
1855
void ParseFree(
1856 1857 1858 1859 1860 1861
  void *p,                    /* The parser to be deleted */
  void (*freeProc)(void*)     /* Function used to reclaim memory */
){
#ifndef YYPARSEFREENEVERNULL
  if( p==0 ) return;
#endif
X
Xiaoyu Wang 已提交
1862
  ParseFinalize(p);
1863 1864
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
1865
#endif /* Parse_ENGINEALWAYSONSTACK */
1866 1867 1868 1869 1870

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
1871
int ParseStackPeak(void *p){
1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894
  yyParser *pParser = (yyParser*)p;
  return pParser->yyhwm;
}
#endif

/* This array of booleans keeps track of the parser statement
** coverage.  The element yycoverage[X][Y] is set when the parser
** is in state X and has a lookahead token Y.  In a well-tested
** systems, every element of this matrix should end up being set.
*/
#if defined(YYCOVERAGE)
static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
#endif

/*
** Write into out a description of every state/lookahead combination that
**
**   (1)  has not been used by the parser, and
**   (2)  is not a syntax error.
**
** Return the number of missed state/lookahead combinations.
*/
#if defined(YYCOVERAGE)
X
Xiaoyu Wang 已提交
1895
int ParseCoverage(FILE *out){
1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931
  int stateno, iLookAhead, i;
  int nMissed = 0;
  for(stateno=0; stateno<YYNSTATE; stateno++){
    i = yy_shift_ofst[stateno];
    for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
      if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
      if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
      if( out ){
        fprintf(out,"State %d lookahead %s %s\n", stateno,
                yyTokenName[iLookAhead],
                yycoverage[stateno][iLookAhead] ? "ok" : "missed");
      }
    }
  }
  return nMissed;
}
#endif

/*
** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead.
*/
static YYACTIONTYPE yy_find_shift_action(
  YYCODETYPE iLookAhead,    /* The look-ahead token */
  YYACTIONTYPE stateno      /* Current state number */
){
  int i;

  if( stateno>YY_MAX_SHIFT ) return stateno;
  assert( stateno <= YY_SHIFT_COUNT );
#if defined(YYCOVERAGE)
  yycoverage[stateno][iLookAhead] = 1;
#endif
  do{
    i = yy_shift_ofst[stateno];
    assert( i>=0 );
1932
    /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
1933 1934 1935
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
1936
    if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
1937 1938
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
1939 1940
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
        }
#endif
        assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
        iLookAhead = iFallback;
        continue;
      }
#endif
#ifdef YYWILDCARD
      {
        int j = i - iLookAhead + YYWILDCARD;
1955 1956 1957 1958 1959 1960 1961 1962 1963 1964
        if( 
#if YY_SHIFT_MIN+YYWILDCARD<0
          j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
          j<YY_ACTTAB_COUNT &&
#endif
          j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) &&
          yy_lookahead[j]==YYWILDCARD && iLookAhead>0
        ){
1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
#ifndef NDEBUG
          if( yyTraceFILE ){
            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
               yyTracePrompt, yyTokenName[iLookAhead],
               yyTokenName[YYWILDCARD]);
          }
#endif /* NDEBUG */
          return yy_action[j];
        }
      }
#endif /* YYWILDCARD */
      return yy_default[stateno];
    }else{
      return yy_action[i];
    }
  }while(1);
}

/*
** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead.
*/
static YYACTIONTYPE yy_find_reduce_action(
  YYACTIONTYPE stateno,     /* Current state number */
  YYCODETYPE iLookAhead     /* The look-ahead token */
){
  int i;
#ifdef YYERRORSYMBOL
  if( stateno>YY_REDUCE_COUNT ){
    return yy_default[stateno];
  }
#else
  assert( stateno<=YY_REDUCE_COUNT );
#endif
  i = yy_reduce_ofst[stateno];
  assert( iLookAhead!=YYNOCODE );
  i += iLookAhead;
#ifdef YYERRORSYMBOL
  if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
    return yy_default[stateno];
  }
#else
  assert( i>=0 && i<YY_ACTTAB_COUNT );
  assert( yy_lookahead[i]==iLookAhead );
#endif
  return yy_action[i];
}

/*
** The following routine is called if the stack overflows.
*/
static void yyStackOverflow(yyParser *yypParser){
X
Xiaoyu Wang 已提交
2017 2018
   ParseARG_FETCH
   ParseCTX_FETCH
2019 2020 2021 2022 2023 2024 2025 2026 2027 2028
#ifndef NDEBUG
   if( yyTraceFILE ){
     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
   }
#endif
   while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
   /* Here code is inserted which will execute if the parser
   ** stack every overflows */
/******** Begin %stack_overflow code ******************************************/
/******** End %stack_overflow code ********************************************/
X
Xiaoyu Wang 已提交
2029 2030
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060
}

/*
** Print tracing information for a SHIFT action
*/
#ifndef NDEBUG
static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
  if( yyTraceFILE ){
    if( yyNewState<YYNSTATE ){
      fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
         yyNewState);
    }else{
      fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
         yyNewState - YY_MIN_REDUCE);
    }
  }
}
#else
# define yyTraceShift(X,Y,Z)
#endif

/*
** Perform a shift action.
*/
static void yy_shift(
  yyParser *yypParser,          /* The parser to be shifted */
  YYACTIONTYPE yyNewState,      /* The new state to shift in */
  YYCODETYPE yyMajor,           /* The major token to shift in */
X
Xiaoyu Wang 已提交
2061
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095
){
  yyStackEntry *yytos;
  yypParser->yytos++;
#ifdef YYTRACKMAXSTACKDEPTH
  if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
    yypParser->yyhwm++;
    assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
  }
#endif
#if YYSTACKDEPTH>0 
  if( yypParser->yytos>yypParser->yystackEnd ){
    yypParser->yytos--;
    yyStackOverflow(yypParser);
    return;
  }
#else
  if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
    if( yyGrowStack(yypParser) ){
      yypParser->yytos--;
      yyStackOverflow(yypParser);
      return;
    }
  }
#endif
  if( yyNewState > YY_MAX_SHIFT ){
    yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
  }
  yytos = yypParser->yytos;
  yytos->stateno = yyNewState;
  yytos->major = yyMajor;
  yytos->minor.yy0 = yyMinor;
  yyTraceShift(yypParser, yyNewState, "Shift");
}

2096 2097 2098 2099 2100 2101 2102
/* The following table contains information about every rule that
** is used during the reduce.
*/
static const struct {
  YYCODETYPE lhs;       /* Symbol on the left-hand side of the rule */
  signed char nrhs;     /* Negative of the number of RHS symbols in the rule */
} yyRuleInfo[] = {
2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512
  {  209,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  209,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  210,    0 }, /* (2) account_options ::= */
  {  210,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  210,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  210,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  210,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  210,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  210,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  210,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  210,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  210,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  211,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  211,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  213,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  213,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  213,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  213,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  213,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  213,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  213,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  213,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  213,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  213,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  209,   -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
  {  209,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  209,   -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
  {  209,   -3 }, /* (27) cmd ::= DROP USER user_name */
  {  209,   -3 }, /* (28) cmd ::= CREATE DNODE dnode_endpoint */
  {  209,   -5 }, /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
  {  209,   -3 }, /* (30) cmd ::= DROP DNODE NK_INTEGER */
  {  209,   -3 }, /* (31) cmd ::= DROP DNODE dnode_endpoint */
  {  209,   -4 }, /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  209,   -5 }, /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  209,   -4 }, /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
  {  209,   -5 }, /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  215,   -1 }, /* (36) dnode_endpoint ::= NK_STRING */
  {  216,   -1 }, /* (37) dnode_host_name ::= NK_ID */
  {  216,   -1 }, /* (38) dnode_host_name ::= NK_IPTOKEN */
  {  209,   -3 }, /* (39) cmd ::= ALTER LOCAL NK_STRING */
  {  209,   -4 }, /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  209,   -5 }, /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  209,   -5 }, /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  209,   -5 }, /* (43) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
  {  209,   -5 }, /* (44) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
  {  209,   -5 }, /* (45) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
  {  209,   -5 }, /* (46) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
  {  209,   -5 }, /* (47) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
  {  209,   -5 }, /* (48) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
  {  209,   -5 }, /* (49) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  209,   -4 }, /* (50) cmd ::= DROP DATABASE exists_opt db_name */
  {  209,   -2 }, /* (51) cmd ::= USE db_name */
  {  209,   -4 }, /* (52) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  217,   -3 }, /* (53) not_exists_opt ::= IF NOT EXISTS */
  {  217,    0 }, /* (54) not_exists_opt ::= */
  {  220,   -2 }, /* (55) exists_opt ::= IF EXISTS */
  {  220,    0 }, /* (56) exists_opt ::= */
  {  219,    0 }, /* (57) db_options ::= */
  {  219,   -3 }, /* (58) db_options ::= db_options BLOCKS NK_INTEGER */
  {  219,   -3 }, /* (59) db_options ::= db_options CACHE NK_INTEGER */
  {  219,   -3 }, /* (60) db_options ::= db_options CACHELAST NK_INTEGER */
  {  219,   -3 }, /* (61) db_options ::= db_options COMP NK_INTEGER */
  {  219,   -3 }, /* (62) db_options ::= db_options DAYS NK_INTEGER */
  {  219,   -3 }, /* (63) db_options ::= db_options DAYS NK_VARIABLE */
  {  219,   -3 }, /* (64) db_options ::= db_options FSYNC NK_INTEGER */
  {  219,   -3 }, /* (65) db_options ::= db_options MAXROWS NK_INTEGER */
  {  219,   -3 }, /* (66) db_options ::= db_options MINROWS NK_INTEGER */
  {  219,   -3 }, /* (67) db_options ::= db_options KEEP integer_list */
  {  219,   -3 }, /* (68) db_options ::= db_options KEEP variable_list */
  {  219,   -3 }, /* (69) db_options ::= db_options PRECISION NK_STRING */
  {  219,   -3 }, /* (70) db_options ::= db_options QUORUM NK_INTEGER */
  {  219,   -3 }, /* (71) db_options ::= db_options REPLICA NK_INTEGER */
  {  219,   -3 }, /* (72) db_options ::= db_options TTL NK_INTEGER */
  {  219,   -3 }, /* (73) db_options ::= db_options WAL NK_INTEGER */
  {  219,   -3 }, /* (74) db_options ::= db_options VGROUPS NK_INTEGER */
  {  219,   -3 }, /* (75) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  219,   -3 }, /* (76) db_options ::= db_options STREAM_MODE NK_INTEGER */
  {  219,   -3 }, /* (77) db_options ::= db_options RETENTIONS retention_list */
  {  221,   -1 }, /* (78) alter_db_options ::= alter_db_option */
  {  221,   -2 }, /* (79) alter_db_options ::= alter_db_options alter_db_option */
  {  225,   -2 }, /* (80) alter_db_option ::= BLOCKS NK_INTEGER */
  {  225,   -2 }, /* (81) alter_db_option ::= FSYNC NK_INTEGER */
  {  225,   -2 }, /* (82) alter_db_option ::= KEEP integer_list */
  {  225,   -2 }, /* (83) alter_db_option ::= KEEP variable_list */
  {  225,   -2 }, /* (84) alter_db_option ::= WAL NK_INTEGER */
  {  225,   -2 }, /* (85) alter_db_option ::= QUORUM NK_INTEGER */
  {  225,   -2 }, /* (86) alter_db_option ::= CACHELAST NK_INTEGER */
  {  225,   -2 }, /* (87) alter_db_option ::= REPLICA NK_INTEGER */
  {  222,   -1 }, /* (88) integer_list ::= NK_INTEGER */
  {  222,   -3 }, /* (89) integer_list ::= integer_list NK_COMMA NK_INTEGER */
  {  223,   -1 }, /* (90) variable_list ::= NK_VARIABLE */
  {  223,   -3 }, /* (91) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
  {  224,   -1 }, /* (92) retention_list ::= retention */
  {  224,   -3 }, /* (93) retention_list ::= retention_list NK_COMMA retention */
  {  226,   -3 }, /* (94) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
  {  209,   -9 }, /* (95) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  209,   -3 }, /* (96) cmd ::= CREATE TABLE multi_create_clause */
  {  209,   -9 }, /* (97) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  209,   -3 }, /* (98) cmd ::= DROP TABLE multi_drop_clause */
  {  209,   -4 }, /* (99) cmd ::= DROP STABLE exists_opt full_table_name */
  {  209,   -3 }, /* (100) cmd ::= ALTER TABLE alter_table_clause */
  {  209,   -3 }, /* (101) cmd ::= ALTER STABLE alter_table_clause */
  {  234,   -2 }, /* (102) alter_table_clause ::= full_table_name alter_table_options */
  {  234,   -5 }, /* (103) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  234,   -4 }, /* (104) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  234,   -5 }, /* (105) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  234,   -5 }, /* (106) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  234,   -5 }, /* (107) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  234,   -4 }, /* (108) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  234,   -5 }, /* (109) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  234,   -5 }, /* (110) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  234,   -6 }, /* (111) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
  {  231,   -1 }, /* (112) multi_create_clause ::= create_subtable_clause */
  {  231,   -2 }, /* (113) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  238,   -9 }, /* (114) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
  {  233,   -1 }, /* (115) multi_drop_clause ::= drop_table_clause */
  {  233,   -2 }, /* (116) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  241,   -2 }, /* (117) drop_table_clause ::= exists_opt full_table_name */
  {  239,    0 }, /* (118) specific_tags_opt ::= */
  {  239,   -3 }, /* (119) specific_tags_opt ::= NK_LP col_name_list NK_RP */
  {  227,   -1 }, /* (120) full_table_name ::= table_name */
  {  227,   -3 }, /* (121) full_table_name ::= db_name NK_DOT table_name */
  {  228,   -1 }, /* (122) column_def_list ::= column_def */
  {  228,   -3 }, /* (123) column_def_list ::= column_def_list NK_COMMA column_def */
  {  244,   -2 }, /* (124) column_def ::= column_name type_name */
  {  244,   -4 }, /* (125) column_def ::= column_name type_name COMMENT NK_STRING */
  {  237,   -1 }, /* (126) type_name ::= BOOL */
  {  237,   -1 }, /* (127) type_name ::= TINYINT */
  {  237,   -1 }, /* (128) type_name ::= SMALLINT */
  {  237,   -1 }, /* (129) type_name ::= INT */
  {  237,   -1 }, /* (130) type_name ::= INTEGER */
  {  237,   -1 }, /* (131) type_name ::= BIGINT */
  {  237,   -1 }, /* (132) type_name ::= FLOAT */
  {  237,   -1 }, /* (133) type_name ::= DOUBLE */
  {  237,   -4 }, /* (134) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  237,   -1 }, /* (135) type_name ::= TIMESTAMP */
  {  237,   -4 }, /* (136) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  237,   -2 }, /* (137) type_name ::= TINYINT UNSIGNED */
  {  237,   -2 }, /* (138) type_name ::= SMALLINT UNSIGNED */
  {  237,   -2 }, /* (139) type_name ::= INT UNSIGNED */
  {  237,   -2 }, /* (140) type_name ::= BIGINT UNSIGNED */
  {  237,   -1 }, /* (141) type_name ::= JSON */
  {  237,   -4 }, /* (142) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  237,   -1 }, /* (143) type_name ::= MEDIUMBLOB */
  {  237,   -1 }, /* (144) type_name ::= BLOB */
  {  237,   -4 }, /* (145) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  237,   -1 }, /* (146) type_name ::= DECIMAL */
  {  237,   -4 }, /* (147) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  237,   -6 }, /* (148) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  229,    0 }, /* (149) tags_def_opt ::= */
  {  229,   -1 }, /* (150) tags_def_opt ::= tags_def */
  {  232,   -4 }, /* (151) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  230,    0 }, /* (152) table_options ::= */
  {  230,   -3 }, /* (153) table_options ::= table_options COMMENT NK_STRING */
  {  230,   -3 }, /* (154) table_options ::= table_options KEEP integer_list */
  {  230,   -3 }, /* (155) table_options ::= table_options TTL NK_INTEGER */
  {  230,   -5 }, /* (156) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  230,   -5 }, /* (157) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
  {  230,   -3 }, /* (158) table_options ::= table_options FILE_FACTOR NK_FLOAT */
  {  230,   -3 }, /* (159) table_options ::= table_options DELAY NK_INTEGER */
  {  235,   -1 }, /* (160) alter_table_options ::= alter_table_option */
  {  235,   -2 }, /* (161) alter_table_options ::= alter_table_options alter_table_option */
  {  246,   -2 }, /* (162) alter_table_option ::= COMMENT NK_STRING */
  {  246,   -2 }, /* (163) alter_table_option ::= KEEP integer_list */
  {  246,   -2 }, /* (164) alter_table_option ::= TTL NK_INTEGER */
  {  242,   -1 }, /* (165) col_name_list ::= col_name */
  {  242,   -3 }, /* (166) col_name_list ::= col_name_list NK_COMMA col_name */
  {  247,   -1 }, /* (167) col_name ::= column_name */
  {  209,   -2 }, /* (168) cmd ::= SHOW DNODES */
  {  209,   -2 }, /* (169) cmd ::= SHOW USERS */
  {  209,   -2 }, /* (170) cmd ::= SHOW DATABASES */
  {  209,   -4 }, /* (171) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  209,   -4 }, /* (172) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  209,   -3 }, /* (173) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  209,   -2 }, /* (174) cmd ::= SHOW MNODES */
  {  209,   -2 }, /* (175) cmd ::= SHOW MODULES */
  {  209,   -2 }, /* (176) cmd ::= SHOW QNODES */
  {  209,   -2 }, /* (177) cmd ::= SHOW FUNCTIONS */
  {  209,   -5 }, /* (178) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  209,   -2 }, /* (179) cmd ::= SHOW STREAMS */
  {  209,   -2 }, /* (180) cmd ::= SHOW ACCOUNTS */
  {  209,   -2 }, /* (181) cmd ::= SHOW APPS */
  {  209,   -2 }, /* (182) cmd ::= SHOW CONNECTIONS */
  {  209,   -2 }, /* (183) cmd ::= SHOW LICENCE */
  {  209,   -2 }, /* (184) cmd ::= SHOW GRANTS */
  {  209,   -4 }, /* (185) cmd ::= SHOW CREATE DATABASE db_name */
  {  209,   -4 }, /* (186) cmd ::= SHOW CREATE TABLE full_table_name */
  {  209,   -4 }, /* (187) cmd ::= SHOW CREATE STABLE full_table_name */
  {  209,   -2 }, /* (188) cmd ::= SHOW QUERIES */
  {  209,   -2 }, /* (189) cmd ::= SHOW SCORES */
  {  209,   -2 }, /* (190) cmd ::= SHOW TOPICS */
  {  209,   -2 }, /* (191) cmd ::= SHOW VARIABLES */
  {  209,   -2 }, /* (192) cmd ::= SHOW BNODES */
  {  209,   -2 }, /* (193) cmd ::= SHOW SNODES */
  {  248,    0 }, /* (194) db_name_cond_opt ::= */
  {  248,   -2 }, /* (195) db_name_cond_opt ::= db_name NK_DOT */
  {  249,    0 }, /* (196) like_pattern_opt ::= */
  {  249,   -2 }, /* (197) like_pattern_opt ::= LIKE NK_STRING */
  {  250,   -1 }, /* (198) table_name_cond ::= table_name */
  {  251,    0 }, /* (199) from_db_opt ::= */
  {  251,   -2 }, /* (200) from_db_opt ::= FROM db_name */
  {  245,   -1 }, /* (201) func_name_list ::= func_name */
  {  245,   -3 }, /* (202) func_name_list ::= func_name_list NK_COMMA col_name */
  {  252,   -1 }, /* (203) func_name ::= function_name */
  {  209,   -8 }, /* (204) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
  {  209,  -10 }, /* (205) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
  {  209,   -6 }, /* (206) cmd ::= DROP INDEX exists_opt index_name ON table_name */
  {  255,    0 }, /* (207) index_options ::= */
  {  255,   -9 }, /* (208) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  {  255,  -11 }, /* (209) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
  {  256,   -1 }, /* (210) func_list ::= func */
  {  256,   -3 }, /* (211) func_list ::= func_list NK_COMMA func */
  {  259,   -4 }, /* (212) func ::= function_name NK_LP expression_list NK_RP */
  {  209,   -6 }, /* (213) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
  {  209,   -6 }, /* (214) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
  {  209,   -4 }, /* (215) cmd ::= DROP TOPIC exists_opt topic_name */
  {  209,   -2 }, /* (216) cmd ::= DESC full_table_name */
  {  209,   -2 }, /* (217) cmd ::= DESCRIBE full_table_name */
  {  209,   -3 }, /* (218) cmd ::= RESET QUERY CACHE */
  {  209,   -4 }, /* (219) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
  {  263,    0 }, /* (220) analyze_opt ::= */
  {  263,   -1 }, /* (221) analyze_opt ::= ANALYZE */
  {  264,    0 }, /* (222) explain_options ::= */
  {  264,   -3 }, /* (223) explain_options ::= explain_options VERBOSE NK_BOOL */
  {  264,   -3 }, /* (224) explain_options ::= explain_options RATIO NK_FLOAT */
  {  209,   -6 }, /* (225) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
  {  209,   -9 }, /* (226) cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
  {  209,   -3 }, /* (227) cmd ::= DROP FUNCTION function_name */
  {  265,    0 }, /* (228) agg_func_opt ::= */
  {  265,   -1 }, /* (229) agg_func_opt ::= AGGREGATE */
  {  266,    0 }, /* (230) bufsize_opt ::= */
  {  266,   -2 }, /* (231) bufsize_opt ::= BUFSIZE NK_INTEGER */
  {  209,   -7 }, /* (232) cmd ::= CREATE STREAM stream_name INTO table_name AS query_expression */
  {  209,   -3 }, /* (233) cmd ::= DROP STREAM stream_name */
  {  209,   -3 }, /* (234) cmd ::= KILL CONNECTION NK_INTEGER */
  {  209,   -3 }, /* (235) cmd ::= KILL QUERY NK_INTEGER */
  {  209,   -4 }, /* (236) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
  {  209,   -4 }, /* (237) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
  {  209,   -3 }, /* (238) cmd ::= SPLIT VGROUP NK_INTEGER */
  {  268,   -2 }, /* (239) dnode_list ::= DNODE NK_INTEGER */
  {  268,   -3 }, /* (240) dnode_list ::= dnode_list DNODE NK_INTEGER */
  {  209,   -3 }, /* (241) cmd ::= SYNCDB db_name REPLICA */
  {  209,   -1 }, /* (242) cmd ::= query_expression */
  {  212,   -1 }, /* (243) literal ::= NK_INTEGER */
  {  212,   -1 }, /* (244) literal ::= NK_FLOAT */
  {  212,   -1 }, /* (245) literal ::= NK_STRING */
  {  212,   -1 }, /* (246) literal ::= NK_BOOL */
  {  212,   -2 }, /* (247) literal ::= TIMESTAMP NK_STRING */
  {  212,   -1 }, /* (248) literal ::= duration_literal */
  {  212,   -1 }, /* (249) literal ::= NULL */
  {  257,   -1 }, /* (250) duration_literal ::= NK_VARIABLE */
  {  269,   -1 }, /* (251) signed ::= NK_INTEGER */
  {  269,   -2 }, /* (252) signed ::= NK_PLUS NK_INTEGER */
  {  269,   -2 }, /* (253) signed ::= NK_MINUS NK_INTEGER */
  {  269,   -1 }, /* (254) signed ::= NK_FLOAT */
  {  269,   -2 }, /* (255) signed ::= NK_PLUS NK_FLOAT */
  {  269,   -2 }, /* (256) signed ::= NK_MINUS NK_FLOAT */
  {  270,   -1 }, /* (257) signed_literal ::= signed */
  {  270,   -1 }, /* (258) signed_literal ::= NK_STRING */
  {  270,   -1 }, /* (259) signed_literal ::= NK_BOOL */
  {  270,   -2 }, /* (260) signed_literal ::= TIMESTAMP NK_STRING */
  {  270,   -1 }, /* (261) signed_literal ::= duration_literal */
  {  270,   -1 }, /* (262) signed_literal ::= NULL */
  {  240,   -1 }, /* (263) literal_list ::= signed_literal */
  {  240,   -3 }, /* (264) literal_list ::= literal_list NK_COMMA signed_literal */
  {  218,   -1 }, /* (265) db_name ::= NK_ID */
  {  243,   -1 }, /* (266) table_name ::= NK_ID */
  {  236,   -1 }, /* (267) column_name ::= NK_ID */
  {  253,   -1 }, /* (268) function_name ::= NK_ID */
  {  253,   -1 }, /* (269) function_name ::= FIRST */
  {  253,   -1 }, /* (270) function_name ::= LAST */
  {  271,   -1 }, /* (271) table_alias ::= NK_ID */
  {  272,   -1 }, /* (272) column_alias ::= NK_ID */
  {  214,   -1 }, /* (273) user_name ::= NK_ID */
  {  254,   -1 }, /* (274) index_name ::= NK_ID */
  {  261,   -1 }, /* (275) topic_name ::= NK_ID */
  {  267,   -1 }, /* (276) stream_name ::= NK_ID */
  {  273,   -1 }, /* (277) expression ::= literal */
  {  273,   -1 }, /* (278) expression ::= pseudo_column */
  {  273,   -1 }, /* (279) expression ::= column_reference */
  {  273,   -4 }, /* (280) expression ::= function_name NK_LP expression_list NK_RP */
  {  273,   -4 }, /* (281) expression ::= function_name NK_LP NK_STAR NK_RP */
  {  273,   -6 }, /* (282) expression ::= CAST NK_LP expression AS type_name NK_RP */
  {  273,   -1 }, /* (283) expression ::= subquery */
  {  273,   -3 }, /* (284) expression ::= NK_LP expression NK_RP */
  {  273,   -2 }, /* (285) expression ::= NK_PLUS expression */
  {  273,   -2 }, /* (286) expression ::= NK_MINUS expression */
  {  273,   -3 }, /* (287) expression ::= expression NK_PLUS expression */
  {  273,   -3 }, /* (288) expression ::= expression NK_MINUS expression */
  {  273,   -3 }, /* (289) expression ::= expression NK_STAR expression */
  {  273,   -3 }, /* (290) expression ::= expression NK_SLASH expression */
  {  273,   -3 }, /* (291) expression ::= expression NK_REM expression */
  {  260,   -1 }, /* (292) expression_list ::= expression */
  {  260,   -3 }, /* (293) expression_list ::= expression_list NK_COMMA expression */
  {  275,   -1 }, /* (294) column_reference ::= column_name */
  {  275,   -3 }, /* (295) column_reference ::= table_name NK_DOT column_name */
  {  274,   -1 }, /* (296) pseudo_column ::= NOW */
  {  274,   -1 }, /* (297) pseudo_column ::= ROWTS */
  {  274,   -1 }, /* (298) pseudo_column ::= TBNAME */
  {  274,   -1 }, /* (299) pseudo_column ::= QSTARTTS */
  {  274,   -1 }, /* (300) pseudo_column ::= QENDTS */
  {  274,   -1 }, /* (301) pseudo_column ::= WSTARTTS */
  {  274,   -1 }, /* (302) pseudo_column ::= WENDTS */
  {  274,   -1 }, /* (303) pseudo_column ::= WDURATION */
  {  277,   -3 }, /* (304) predicate ::= expression compare_op expression */
  {  277,   -5 }, /* (305) predicate ::= expression BETWEEN expression AND expression */
  {  277,   -6 }, /* (306) predicate ::= expression NOT BETWEEN expression AND expression */
  {  277,   -3 }, /* (307) predicate ::= expression IS NULL */
  {  277,   -4 }, /* (308) predicate ::= expression IS NOT NULL */
  {  277,   -3 }, /* (309) predicate ::= expression in_op in_predicate_value */
  {  278,   -1 }, /* (310) compare_op ::= NK_LT */
  {  278,   -1 }, /* (311) compare_op ::= NK_GT */
  {  278,   -1 }, /* (312) compare_op ::= NK_LE */
  {  278,   -1 }, /* (313) compare_op ::= NK_GE */
  {  278,   -1 }, /* (314) compare_op ::= NK_NE */
  {  278,   -1 }, /* (315) compare_op ::= NK_EQ */
  {  278,   -1 }, /* (316) compare_op ::= LIKE */
  {  278,   -2 }, /* (317) compare_op ::= NOT LIKE */
  {  278,   -1 }, /* (318) compare_op ::= MATCH */
  {  278,   -1 }, /* (319) compare_op ::= NMATCH */
  {  279,   -1 }, /* (320) in_op ::= IN */
  {  279,   -2 }, /* (321) in_op ::= NOT IN */
  {  280,   -3 }, /* (322) in_predicate_value ::= NK_LP expression_list NK_RP */
  {  281,   -1 }, /* (323) boolean_value_expression ::= boolean_primary */
  {  281,   -2 }, /* (324) boolean_value_expression ::= NOT boolean_primary */
  {  281,   -3 }, /* (325) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  281,   -3 }, /* (326) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  282,   -1 }, /* (327) boolean_primary ::= predicate */
  {  282,   -3 }, /* (328) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  283,   -1 }, /* (329) common_expression ::= expression */
  {  283,   -1 }, /* (330) common_expression ::= boolean_value_expression */
  {  284,   -2 }, /* (331) from_clause ::= FROM table_reference_list */
  {  285,   -1 }, /* (332) table_reference_list ::= table_reference */
  {  285,   -3 }, /* (333) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  286,   -1 }, /* (334) table_reference ::= table_primary */
  {  286,   -1 }, /* (335) table_reference ::= joined_table */
  {  287,   -2 }, /* (336) table_primary ::= table_name alias_opt */
  {  287,   -4 }, /* (337) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  287,   -2 }, /* (338) table_primary ::= subquery alias_opt */
  {  287,   -1 }, /* (339) table_primary ::= parenthesized_joined_table */
  {  289,    0 }, /* (340) alias_opt ::= */
  {  289,   -1 }, /* (341) alias_opt ::= table_alias */
  {  289,   -2 }, /* (342) alias_opt ::= AS table_alias */
  {  290,   -3 }, /* (343) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  290,   -3 }, /* (344) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  288,   -6 }, /* (345) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  291,    0 }, /* (346) join_type ::= */
  {  291,   -1 }, /* (347) join_type ::= INNER */
  {  293,   -9 }, /* (348) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
  {  294,    0 }, /* (349) set_quantifier_opt ::= */
  {  294,   -1 }, /* (350) set_quantifier_opt ::= DISTINCT */
  {  294,   -1 }, /* (351) set_quantifier_opt ::= ALL */
  {  295,   -1 }, /* (352) select_list ::= NK_STAR */
  {  295,   -1 }, /* (353) select_list ::= select_sublist */
  {  301,   -1 }, /* (354) select_sublist ::= select_item */
  {  301,   -3 }, /* (355) select_sublist ::= select_sublist NK_COMMA select_item */
  {  302,   -1 }, /* (356) select_item ::= common_expression */
  {  302,   -2 }, /* (357) select_item ::= common_expression column_alias */
  {  302,   -3 }, /* (358) select_item ::= common_expression AS column_alias */
  {  302,   -3 }, /* (359) select_item ::= table_name NK_DOT NK_STAR */
  {  296,    0 }, /* (360) where_clause_opt ::= */
  {  296,   -2 }, /* (361) where_clause_opt ::= WHERE search_condition */
  {  297,    0 }, /* (362) partition_by_clause_opt ::= */
  {  297,   -3 }, /* (363) partition_by_clause_opt ::= PARTITION BY expression_list */
  {  298,    0 }, /* (364) twindow_clause_opt ::= */
  {  298,   -6 }, /* (365) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
  {  298,   -4 }, /* (366) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
  {  298,   -6 }, /* (367) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  298,   -8 }, /* (368) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  258,    0 }, /* (369) sliding_opt ::= */
  {  258,   -4 }, /* (370) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  303,    0 }, /* (371) fill_opt ::= */
  {  303,   -4 }, /* (372) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  303,   -6 }, /* (373) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  304,   -1 }, /* (374) fill_mode ::= NONE */
  {  304,   -1 }, /* (375) fill_mode ::= PREV */
  {  304,   -1 }, /* (376) fill_mode ::= NULL */
  {  304,   -1 }, /* (377) fill_mode ::= LINEAR */
  {  304,   -1 }, /* (378) fill_mode ::= NEXT */
  {  299,    0 }, /* (379) group_by_clause_opt ::= */
  {  299,   -3 }, /* (380) group_by_clause_opt ::= GROUP BY group_by_list */
  {  305,   -1 }, /* (381) group_by_list ::= expression */
  {  305,   -3 }, /* (382) group_by_list ::= group_by_list NK_COMMA expression */
  {  300,    0 }, /* (383) having_clause_opt ::= */
  {  300,   -2 }, /* (384) having_clause_opt ::= HAVING search_condition */
  {  262,   -4 }, /* (385) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  306,   -1 }, /* (386) query_expression_body ::= query_primary */
  {  306,   -4 }, /* (387) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
  {  310,   -1 }, /* (388) query_primary ::= query_specification */
  {  307,    0 }, /* (389) order_by_clause_opt ::= */
  {  307,   -3 }, /* (390) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  308,    0 }, /* (391) slimit_clause_opt ::= */
  {  308,   -2 }, /* (392) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  308,   -4 }, /* (393) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  308,   -4 }, /* (394) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  309,    0 }, /* (395) limit_clause_opt ::= */
  {  309,   -2 }, /* (396) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  309,   -4 }, /* (397) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  309,   -4 }, /* (398) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  276,   -3 }, /* (399) subquery ::= NK_LP query_expression NK_RP */
  {  292,   -1 }, /* (400) search_condition ::= common_expression */
  {  311,   -1 }, /* (401) sort_specification_list ::= sort_specification */
  {  311,   -3 }, /* (402) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  312,   -3 }, /* (403) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
  {  313,    0 }, /* (404) ordering_specification_opt ::= */
  {  313,   -1 }, /* (405) ordering_specification_opt ::= ASC */
  {  313,   -1 }, /* (406) ordering_specification_opt ::= DESC */
  {  314,    0 }, /* (407) null_ordering_opt ::= */
  {  314,   -2 }, /* (408) null_ordering_opt ::= NULLS FIRST */
  {  314,   -2 }, /* (409) null_ordering_opt ::= NULLS LAST */
2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530
};

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

/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
**
** The yyLookahead and yyLookaheadToken parameters provide reduce actions
** access to the lookahead token (if any).  The yyLookahead will be YYNOCODE
** if the lookahead token has already been consumed.  As this procedure is
** only called from one place, optimizing compilers will in-line it, which
** means that the extra parameters have no performance impact.
*/
static YYACTIONTYPE yy_reduce(
  yyParser *yypParser,         /* The parser */
  unsigned int yyruleno,       /* Number of the rule by which to reduce */
  int yyLookahead,             /* Lookahead token, or YYNOCODE if none */
X
Xiaoyu Wang 已提交
2531 2532
  ParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  ParseCTX_PDECL                   /* %extra_context */
2533 2534 2535 2536 2537
){
  int yygoto;                     /* The next state */
  YYACTIONTYPE yyact;             /* The next action */
  yyStackEntry *yymsp;            /* The top of the parser's stack */
  int yysize;                     /* Amount to pop the stack */
X
Xiaoyu Wang 已提交
2538
  ParseARG_FETCH
2539 2540 2541 2542 2543
  (void)yyLookahead;
  (void)yyLookaheadToken;
  yymsp = yypParser->yytos;
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
2544
    yysize = yyRuleInfo[yyruleno].nrhs;
2545
    if( yysize ){
2546
      fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
2547
        yyTracePrompt,
2548
        yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
2549
    }else{
2550 2551
      fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
        yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
2552 2553 2554 2555 2556 2557 2558
    }
  }
#endif /* NDEBUG */

  /* Check that the stack is large enough to grow by a single entry
  ** if the RHS of the rule is empty.  This ensures that there is room
  ** enough on the stack to push the LHS value */
2559
  if( yyRuleInfo[yyruleno].nrhs==0 ){
2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598
#ifdef YYTRACKMAXSTACKDEPTH
    if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
      yypParser->yyhwm++;
      assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
    }
#endif
#if YYSTACKDEPTH>0 
    if( yypParser->yytos>=yypParser->yystackEnd ){
      yyStackOverflow(yypParser);
      /* The call to yyStackOverflow() above pops the stack until it is
      ** empty, causing the main parser loop to exit.  So the return value
      ** is never used and does not matter. */
      return 0;
    }
#else
    if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
      if( yyGrowStack(yypParser) ){
        yyStackOverflow(yypParser);
        /* The call to yyStackOverflow() above pops the stack until it is
        ** empty, causing the main parser loop to exit.  So the return value
        ** is never used and does not matter. */
        return 0;
      }
      yymsp = yypParser->yytos;
    }
#endif
  }

  switch( yyruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  #line <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  #line <lineno> <thisfile>
  **     break;
  */
/********** Begin reduce actions **********************************************/
        YYMINORTYPE yylhsminor;
2599
      case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
2600
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
2601
  yy_destructor(yypParser,210,&yymsp[0].minor);
2602
        break;
2603 2604
      case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
2605
  yy_destructor(yypParser,211,&yymsp[0].minor);
2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618
        break;
      case 2: /* account_options ::= */
{ }
        break;
      case 3: /* account_options ::= account_options PPS literal */
      case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4);
      case 5: /* account_options ::= account_options STORAGE literal */ yytestcase(yyruleno==5);
      case 6: /* account_options ::= account_options STREAMS literal */ yytestcase(yyruleno==6);
      case 7: /* account_options ::= account_options QTIME literal */ yytestcase(yyruleno==7);
      case 8: /* account_options ::= account_options DBS literal */ yytestcase(yyruleno==8);
      case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9);
      case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10);
      case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11);
2619
{  yy_destructor(yypParser,210,&yymsp[-2].minor);
2620
{ }
2621
  yy_destructor(yypParser,212,&yymsp[0].minor);
2622
}
2623
        break;
2624
      case 12: /* alter_account_options ::= alter_account_option */
2625
{  yy_destructor(yypParser,213,&yymsp[0].minor);
2626 2627 2628
{ }
}
        break;
2629
      case 13: /* alter_account_options ::= alter_account_options alter_account_option */
2630
{  yy_destructor(yypParser,211,&yymsp[-1].minor);
2631
{ }
2632
  yy_destructor(yypParser,213,&yymsp[0].minor);
2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644
}
        break;
      case 14: /* alter_account_option ::= PASS literal */
      case 15: /* alter_account_option ::= PPS literal */ yytestcase(yyruleno==15);
      case 16: /* alter_account_option ::= TSERIES literal */ yytestcase(yyruleno==16);
      case 17: /* alter_account_option ::= STORAGE literal */ yytestcase(yyruleno==17);
      case 18: /* alter_account_option ::= STREAMS literal */ yytestcase(yyruleno==18);
      case 19: /* alter_account_option ::= QTIME literal */ yytestcase(yyruleno==19);
      case 20: /* alter_account_option ::= DBS literal */ yytestcase(yyruleno==20);
      case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21);
      case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22);
      case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23);
2645
{ }
2646
  yy_destructor(yypParser,212,&yymsp[0].minor);
2647
        break;
2648
      case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */
2649
{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0); }
2650
        break;
2651
      case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
2652
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
2653
        break;
2654
      case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
2655
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
2656
        break;
2657
      case 27: /* cmd ::= DROP USER user_name */
2658
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy29); }
2659
        break;
X
Xiaoyu Wang 已提交
2660
      case 28: /* cmd ::= CREATE DNODE dnode_endpoint */
2661
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy29, NULL); }
2662
        break;
X
Xiaoyu Wang 已提交
2663
      case 29: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
2664
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0); }
2665
        break;
X
Xiaoyu Wang 已提交
2666
      case 30: /* cmd ::= DROP DNODE NK_INTEGER */
2667
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
2668
        break;
X
Xiaoyu Wang 已提交
2669
      case 31: /* cmd ::= DROP DNODE dnode_endpoint */
2670
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy29); }
2671
        break;
X
Xiaoyu Wang 已提交
2672
      case 32: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
2673 2674
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2675
      case 33: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
2676 2677
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2678
      case 34: /* cmd ::= ALTER ALL DNODES NK_STRING */
2679 2680
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2681
      case 35: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
2682 2683
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2684 2685 2686
      case 36: /* dnode_endpoint ::= NK_STRING */
      case 37: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==37);
      case 38: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==38);
2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698
      case 265: /* db_name ::= NK_ID */ yytestcase(yyruleno==265);
      case 266: /* table_name ::= NK_ID */ yytestcase(yyruleno==266);
      case 267: /* column_name ::= NK_ID */ yytestcase(yyruleno==267);
      case 268: /* function_name ::= NK_ID */ yytestcase(yyruleno==268);
      case 269: /* function_name ::= FIRST */ yytestcase(yyruleno==269);
      case 270: /* function_name ::= LAST */ yytestcase(yyruleno==270);
      case 271: /* table_alias ::= NK_ID */ yytestcase(yyruleno==271);
      case 272: /* column_alias ::= NK_ID */ yytestcase(yyruleno==272);
      case 273: /* user_name ::= NK_ID */ yytestcase(yyruleno==273);
      case 274: /* index_name ::= NK_ID */ yytestcase(yyruleno==274);
      case 275: /* topic_name ::= NK_ID */ yytestcase(yyruleno==275);
      case 276: /* stream_name ::= NK_ID */ yytestcase(yyruleno==276);
2699 2700
{ yylhsminor.yy29 = yymsp[0].minor.yy0; }
  yymsp[0].minor.yy29 = yylhsminor.yy29;
X
Xiaoyu Wang 已提交
2701 2702
        break;
      case 39: /* cmd ::= ALTER LOCAL NK_STRING */
2703 2704
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2705
      case 40: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
2706 2707
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2708
      case 41: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
2709
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2710
        break;
X
Xiaoyu Wang 已提交
2711
      case 42: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
2712
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); }
2713
        break;
2714 2715
      case 43: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2716
        break;
2717 2718
      case 44: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2719
        break;
2720 2721
      case 45: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); }
2722
        break;
2723 2724
      case 46: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); }
2725
        break;
2726 2727
      case 47: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); }
2728
        break;
2729 2730
      case 48: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
2731
        break;
2732
      case 49: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
2733
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy47, &yymsp[-1].minor.yy29, yymsp[0].minor.yy182); }
2734
        break;
2735
      case 50: /* cmd ::= DROP DATABASE exists_opt db_name */
2736
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy47, &yymsp[0].minor.yy29); }
2737
        break;
2738
      case 51: /* cmd ::= USE db_name */
2739
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy29); }
2740
        break;
2741
      case 52: /* cmd ::= ALTER DATABASE db_name alter_db_options */
2742
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy29, yymsp[0].minor.yy182); }
2743
        break;
2744
      case 53: /* not_exists_opt ::= IF NOT EXISTS */
2745
{ yymsp[-2].minor.yy47 = true; }
2746
        break;
2747 2748
      case 54: /* not_exists_opt ::= */
      case 56: /* exists_opt ::= */ yytestcase(yyruleno==56);
2749 2750 2751
      case 220: /* analyze_opt ::= */ yytestcase(yyruleno==220);
      case 228: /* agg_func_opt ::= */ yytestcase(yyruleno==228);
      case 349: /* set_quantifier_opt ::= */ yytestcase(yyruleno==349);
2752
{ yymsp[1].minor.yy47 = false; }
2753
        break;
2754
      case 55: /* exists_opt ::= IF EXISTS */
2755
{ yymsp[-1].minor.yy47 = true; }
X
Xiaoyu Wang 已提交
2756
        break;
2757
      case 57: /* db_options ::= */
2758
{ yymsp[1].minor.yy182 = createDatabaseOptions(pCxt); }
2759
        break;
2760
      case 58: /* db_options ::= db_options BLOCKS NK_INTEGER */
2761 2762
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pNumOfBlocks = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2763
        break;
2764
      case 59: /* db_options ::= db_options CACHE NK_INTEGER */
2765 2766
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pCacheBlockSize = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2767
        break;
2768
      case 60: /* db_options ::= db_options CACHELAST NK_INTEGER */
2769 2770
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pCachelast = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2771
        break;
2772
      case 61: /* db_options ::= db_options COMP NK_INTEGER */
2773 2774
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pCompressionLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2775
        break;
2776
      case 62: /* db_options ::= db_options DAYS NK_INTEGER */
2777 2778
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pDaysPerFile = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2779
        break;
2780
      case 63: /* db_options ::= db_options DAYS NK_VARIABLE */
2781 2782
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pDaysPerFile = (SValueNode*)createDurationValueNode(pCxt, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2783
        break;
2784
      case 64: /* db_options ::= db_options FSYNC NK_INTEGER */
2785 2786
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pFsyncPeriod = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2787
        break;
2788
      case 65: /* db_options ::= db_options MAXROWS NK_INTEGER */
2789 2790
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pMaxRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2791
        break;
2792
      case 66: /* db_options ::= db_options MINROWS NK_INTEGER */
2793 2794
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pMinRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2795
        break;
2796 2797
      case 67: /* db_options ::= db_options KEEP integer_list */
      case 68: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==68);
2798 2799
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pKeep = yymsp[0].minor.yy334; yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
2800
        break;
2801
      case 69: /* db_options ::= db_options PRECISION NK_STRING */
2802 2803
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pPrecision = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2804
        break;
2805
      case 70: /* db_options ::= db_options QUORUM NK_INTEGER */
2806 2807
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pQuorum = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2808
        break;
2809
      case 71: /* db_options ::= db_options REPLICA NK_INTEGER */
2810 2811
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pReplica = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2812
        break;
2813
      case 72: /* db_options ::= db_options TTL NK_INTEGER */
2814 2815
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2816
        break;
2817
      case 73: /* db_options ::= db_options WAL NK_INTEGER */
2818 2819
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pWalLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2820 2821
        break;
      case 74: /* db_options ::= db_options VGROUPS NK_INTEGER */
2822 2823
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pNumOfVgroups = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2824
        break;
2825
      case 75: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
2826 2827
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pSingleStable = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2828 2829
        break;
      case 76: /* db_options ::= db_options STREAM_MODE NK_INTEGER */
2830 2831
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pStreamMode = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2832 2833
        break;
      case 77: /* db_options ::= db_options RETENTIONS retention_list */
2834 2835
{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pRetentions = yymsp[0].minor.yy334; yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2836 2837
        break;
      case 78: /* alter_db_options ::= alter_db_option */
2838 2839
{ yylhsminor.yy182 = createDatabaseOptions(pCxt); yylhsminor.yy182 = setDatabaseAlterOption(pCxt, yylhsminor.yy182, &yymsp[0].minor.yy515); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
2840 2841
        break;
      case 79: /* alter_db_options ::= alter_db_options alter_db_option */
2842 2843
{ yylhsminor.yy182 = setDatabaseAlterOption(pCxt, yymsp[-1].minor.yy182, &yymsp[0].minor.yy515); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
2844 2845
        break;
      case 80: /* alter_db_option ::= BLOCKS NK_INTEGER */
2846
{ yymsp[-1].minor.yy515.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2847 2848
        break;
      case 81: /* alter_db_option ::= FSYNC NK_INTEGER */
2849
{ yymsp[-1].minor.yy515.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2850 2851 2852
        break;
      case 82: /* alter_db_option ::= KEEP integer_list */
      case 83: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==83);
2853
{ yymsp[-1].minor.yy515.type = DB_OPTION_KEEP; yymsp[-1].minor.yy515.pList = yymsp[0].minor.yy334; }
2854 2855
        break;
      case 84: /* alter_db_option ::= WAL NK_INTEGER */
2856
{ yymsp[-1].minor.yy515.type = DB_OPTION_WAL; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2857 2858
        break;
      case 85: /* alter_db_option ::= QUORUM NK_INTEGER */
2859
{ yymsp[-1].minor.yy515.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2860 2861
        break;
      case 86: /* alter_db_option ::= CACHELAST NK_INTEGER */
2862
{ yymsp[-1].minor.yy515.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2863 2864
        break;
      case 87: /* alter_db_option ::= REPLICA NK_INTEGER */
2865
{ yymsp[-1].minor.yy515.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2866 2867
        break;
      case 88: /* integer_list ::= NK_INTEGER */
2868 2869
{ yylhsminor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy334 = yylhsminor.yy334;
2870 2871
        break;
      case 89: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
2872
      case 240: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==240);
2873 2874
{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy334 = yylhsminor.yy334;
2875 2876
        break;
      case 90: /* variable_list ::= NK_VARIABLE */
2877 2878
{ yylhsminor.yy334 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy334 = yylhsminor.yy334;
2879 2880
        break;
      case 91: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
2881 2882
{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy334 = yylhsminor.yy334;
2883 2884 2885 2886 2887 2888
        break;
      case 92: /* retention_list ::= retention */
      case 112: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==112);
      case 115: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==115);
      case 122: /* column_def_list ::= column_def */ yytestcase(yyruleno==122);
      case 165: /* col_name_list ::= col_name */ yytestcase(yyruleno==165);
2889 2890 2891 2892 2893
      case 201: /* func_name_list ::= func_name */ yytestcase(yyruleno==201);
      case 210: /* func_list ::= func */ yytestcase(yyruleno==210);
      case 263: /* literal_list ::= signed_literal */ yytestcase(yyruleno==263);
      case 354: /* select_sublist ::= select_item */ yytestcase(yyruleno==354);
      case 401: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==401);
2894 2895
{ yylhsminor.yy334 = createNodeList(pCxt, yymsp[0].minor.yy182); }
  yymsp[0].minor.yy334 = yylhsminor.yy334;
2896 2897 2898 2899
        break;
      case 93: /* retention_list ::= retention_list NK_COMMA retention */
      case 123: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==123);
      case 166: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==166);
2900 2901 2902 2903 2904
      case 202: /* func_name_list ::= func_name_list NK_COMMA col_name */ yytestcase(yyruleno==202);
      case 211: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==211);
      case 264: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==264);
      case 355: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==355);
      case 402: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==402);
2905 2906
{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, yymsp[0].minor.yy182); }
  yymsp[-2].minor.yy334 = yylhsminor.yy334;
2907 2908
        break;
      case 94: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
2909 2910
{ yylhsminor.yy182 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
2911 2912 2913
        break;
      case 95: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
      case 97: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==97);
2914
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy47, yymsp[-5].minor.yy182, yymsp[-3].minor.yy334, yymsp[-1].minor.yy334, yymsp[0].minor.yy182); }
2915 2916
        break;
      case 96: /* cmd ::= CREATE TABLE multi_create_clause */
2917
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy334); }
2918 2919
        break;
      case 98: /* cmd ::= DROP TABLE multi_drop_clause */
2920
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy334); }
2921 2922
        break;
      case 99: /* cmd ::= DROP STABLE exists_opt full_table_name */
2923
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy47, yymsp[0].minor.yy182); }
2924 2925 2926
        break;
      case 100: /* cmd ::= ALTER TABLE alter_table_clause */
      case 101: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==101);
2927
      case 242: /* cmd ::= query_expression */ yytestcase(yyruleno==242);
2928
{ pCxt->pRootNode = yymsp[0].minor.yy182; }
2929 2930
        break;
      case 102: /* alter_table_clause ::= full_table_name alter_table_options */
2931 2932
{ yylhsminor.yy182 = createAlterTableOption(pCxt, yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
2933 2934
        break;
      case 103: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
2935 2936
{ yylhsminor.yy182 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574); }
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
2937 2938
        break;
      case 104: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
2939 2940
{ yylhsminor.yy182 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy182, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy29); }
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
2941 2942
        break;
      case 105: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
2943 2944
{ yylhsminor.yy182 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574); }
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
2945
        break;
2946
      case 106: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
2947 2948
{ yylhsminor.yy182 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); }
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
2949
        break;
2950
      case 107: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
2951 2952
{ yylhsminor.yy182 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574); }
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
2953
        break;
2954
      case 108: /* alter_table_clause ::= full_table_name DROP TAG column_name */
2955 2956
{ yylhsminor.yy182 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy182, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy29); }
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
2957
        break;
2958
      case 109: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
2959 2960
{ yylhsminor.yy182 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574); }
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
2961
        break;
2962
      case 110: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
2963 2964
{ yylhsminor.yy182 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); }
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
2965
        break;
2966
      case 111: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
2967 2968
{ yylhsminor.yy182 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy182, &yymsp[-2].minor.yy29, yymsp[0].minor.yy182); }
  yymsp[-5].minor.yy182 = yylhsminor.yy182;
2969
        break;
2970 2971
      case 113: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
      case 116: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==116);
2972 2973
{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-1].minor.yy334, yymsp[0].minor.yy182); }
  yymsp[-1].minor.yy334 = yylhsminor.yy334;
2974
        break;
2975
      case 114: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
2976 2977
{ yylhsminor.yy182 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy47, yymsp[-7].minor.yy182, yymsp[-5].minor.yy182, yymsp[-4].minor.yy334, yymsp[-1].minor.yy334); }
  yymsp[-8].minor.yy182 = yylhsminor.yy182;
2978
        break;
2979
      case 117: /* drop_table_clause ::= exists_opt full_table_name */
2980 2981
{ yylhsminor.yy182 = createDropTableClause(pCxt, yymsp[-1].minor.yy47, yymsp[0].minor.yy182); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
2982
        break;
2983 2984
      case 118: /* specific_tags_opt ::= */
      case 149: /* tags_def_opt ::= */ yytestcase(yyruleno==149);
2985 2986 2987
      case 362: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==362);
      case 379: /* group_by_clause_opt ::= */ yytestcase(yyruleno==379);
      case 389: /* order_by_clause_opt ::= */ yytestcase(yyruleno==389);
2988
{ yymsp[1].minor.yy334 = NULL; }
2989
        break;
2990
      case 119: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
2991
{ yymsp[-2].minor.yy334 = yymsp[-1].minor.yy334; }
2992
        break;
2993
      case 120: /* full_table_name ::= table_name */
2994 2995
{ yylhsminor.yy182 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy29, NULL); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
2996
        break;
2997
      case 121: /* full_table_name ::= db_name NK_DOT table_name */
2998 2999
{ yylhsminor.yy182 = createRealTableNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29, NULL); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3000
        break;
3001
      case 124: /* column_def ::= column_name type_name */
3002 3003
{ yylhsminor.yy182 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574, NULL); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3004
        break;
3005
      case 125: /* column_def ::= column_name type_name COMMENT NK_STRING */
3006 3007
{ yylhsminor.yy182 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy29, yymsp[-2].minor.yy574, &yymsp[0].minor.yy0); }
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
3008
        break;
3009
      case 126: /* type_name ::= BOOL */
3010
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_BOOL); }
3011
        break;
3012
      case 127: /* type_name ::= TINYINT */
3013
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_TINYINT); }
3014
        break;
3015
      case 128: /* type_name ::= SMALLINT */
3016
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
3017
        break;
3018 3019
      case 129: /* type_name ::= INT */
      case 130: /* type_name ::= INTEGER */ yytestcase(yyruleno==130);
3020
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_INT); }
3021
        break;
3022
      case 131: /* type_name ::= BIGINT */
3023
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_BIGINT); }
3024
        break;
3025
      case 132: /* type_name ::= FLOAT */
3026
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_FLOAT); }
3027
        break;
3028
      case 133: /* type_name ::= DOUBLE */
3029
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
3030
        break;
3031
      case 134: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
3032
{ yymsp[-3].minor.yy574 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
3033
        break;
3034
      case 135: /* type_name ::= TIMESTAMP */
3035
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
3036
        break;
3037
      case 136: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
3038
{ yymsp[-3].minor.yy574 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
3039
        break;
3040
      case 137: /* type_name ::= TINYINT UNSIGNED */
3041
{ yymsp[-1].minor.yy574 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
3042
        break;
3043
      case 138: /* type_name ::= SMALLINT UNSIGNED */
3044
{ yymsp[-1].minor.yy574 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
3045
        break;
3046
      case 139: /* type_name ::= INT UNSIGNED */
3047
{ yymsp[-1].minor.yy574 = createDataType(TSDB_DATA_TYPE_UINT); }
3048
        break;
3049
      case 140: /* type_name ::= BIGINT UNSIGNED */
3050
{ yymsp[-1].minor.yy574 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
3051
        break;
3052
      case 141: /* type_name ::= JSON */
3053
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_JSON); }
3054
        break;
3055
      case 142: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
3056
{ yymsp[-3].minor.yy574 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
3057
        break;
3058
      case 143: /* type_name ::= MEDIUMBLOB */
3059
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
3060
        break;
3061
      case 144: /* type_name ::= BLOB */
3062
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_BLOB); }
3063
        break;
3064
      case 145: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
3065
{ yymsp[-3].minor.yy574 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
3066
        break;
3067
      case 146: /* type_name ::= DECIMAL */
3068
{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3069
        break;
3070
      case 147: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
3071
{ yymsp[-3].minor.yy574 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3072
        break;
3073
      case 148: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
3074
{ yymsp[-5].minor.yy574 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3075
        break;
3076
      case 150: /* tags_def_opt ::= tags_def */
3077
      case 353: /* select_list ::= select_sublist */ yytestcase(yyruleno==353);
3078 3079
{ yylhsminor.yy334 = yymsp[0].minor.yy334; }
  yymsp[0].minor.yy334 = yylhsminor.yy334;
3080
        break;
3081
      case 151: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
3082
{ yymsp[-3].minor.yy334 = yymsp[-1].minor.yy334; }
3083
        break;
3084
      case 152: /* table_options ::= */
3085
{ yymsp[1].minor.yy182 = createTableOptions(pCxt); }
3086
        break;
3087
      case 153: /* table_options ::= table_options COMMENT NK_STRING */
3088 3089
{ ((STableOptions*)yymsp[-2].minor.yy182)->pComments = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3090
        break;
3091
      case 154: /* table_options ::= table_options KEEP integer_list */
3092 3093
{ ((STableOptions*)yymsp[-2].minor.yy182)->pKeep = yymsp[0].minor.yy334; yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3094
        break;
3095
      case 155: /* table_options ::= table_options TTL NK_INTEGER */
3096 3097
{ ((STableOptions*)yymsp[-2].minor.yy182)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3098
        break;
3099
      case 156: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
3100 3101
{ ((STableOptions*)yymsp[-4].minor.yy182)->pSma = yymsp[-1].minor.yy334; yylhsminor.yy182 = yymsp[-4].minor.yy182; }
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
3102 3103
        break;
      case 157: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
3104 3105
{ ((STableOptions*)yymsp[-4].minor.yy182)->pFuncs = yymsp[-1].minor.yy334; yylhsminor.yy182 = yymsp[-4].minor.yy182; }
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
3106 3107
        break;
      case 158: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */
3108 3109
{ ((STableOptions*)yymsp[-2].minor.yy182)->pFilesFactor = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3110 3111
        break;
      case 159: /* table_options ::= table_options DELAY NK_INTEGER */
3112 3113
{ ((STableOptions*)yymsp[-2].minor.yy182)->pDelay = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3114 3115
        break;
      case 160: /* alter_table_options ::= alter_table_option */
3116 3117
{ yylhsminor.yy182 = createTableOptions(pCxt); yylhsminor.yy182 = setTableAlterOption(pCxt, yylhsminor.yy182, &yymsp[0].minor.yy515); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3118 3119
        break;
      case 161: /* alter_table_options ::= alter_table_options alter_table_option */
3120 3121
{ yylhsminor.yy182 = setTableAlterOption(pCxt, yymsp[-1].minor.yy182, &yymsp[0].minor.yy515); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3122 3123
        break;
      case 162: /* alter_table_option ::= COMMENT NK_STRING */
3124
{ yymsp[-1].minor.yy515.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
3125 3126
        break;
      case 163: /* alter_table_option ::= KEEP integer_list */
3127
{ yymsp[-1].minor.yy515.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy515.pList = yymsp[0].minor.yy334; }
3128 3129
        break;
      case 164: /* alter_table_option ::= TTL NK_INTEGER */
3130
{ yymsp[-1].minor.yy515.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3131 3132
        break;
      case 167: /* col_name ::= column_name */
3133 3134
{ yylhsminor.yy182 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy29); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3135 3136
        break;
      case 168: /* cmd ::= SHOW DNODES */
X
Xiaoyu Wang 已提交
3137
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); }
3138
        break;
3139
      case 169: /* cmd ::= SHOW USERS */
X
Xiaoyu Wang 已提交
3140
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); }
3141
        break;
3142
      case 170: /* cmd ::= SHOW DATABASES */
X
Xiaoyu Wang 已提交
3143
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); }
3144
        break;
3145
      case 171: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
3146
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy182, yymsp[0].minor.yy182); }
3147
        break;
3148
      case 172: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
3149
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy182, yymsp[0].minor.yy182); }
3150
        break;
3151
      case 173: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
3152
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy182, NULL); }
3153
        break;
3154
      case 174: /* cmd ::= SHOW MNODES */
X
Xiaoyu Wang 已提交
3155
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); }
3156
        break;
3157
      case 175: /* cmd ::= SHOW MODULES */
X
Xiaoyu Wang 已提交
3158
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); }
3159
        break;
3160
      case 176: /* cmd ::= SHOW QNODES */
X
Xiaoyu Wang 已提交
3161
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); }
3162
        break;
3163
      case 177: /* cmd ::= SHOW FUNCTIONS */
X
Xiaoyu Wang 已提交
3164
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); }
3165
        break;
3166
      case 178: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
3167
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
3168
        break;
3169
      case 179: /* cmd ::= SHOW STREAMS */
X
Xiaoyu Wang 已提交
3170
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); }
3171
        break;
3172
      case 180: /* cmd ::= SHOW ACCOUNTS */
3173 3174
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
        break;
3175
      case 181: /* cmd ::= SHOW APPS */
3176 3177
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT, NULL, NULL); }
        break;
3178
      case 182: /* cmd ::= SHOW CONNECTIONS */
3179 3180
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT, NULL, NULL); }
        break;
3181
      case 183: /* cmd ::= SHOW LICENCE */
3182
      case 184: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==184);
3183 3184
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); }
        break;
3185
      case 185: /* cmd ::= SHOW CREATE DATABASE db_name */
3186
{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy29); }
3187
        break;
3188
      case 186: /* cmd ::= SHOW CREATE TABLE full_table_name */
3189
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy182); }
3190
        break;
3191
      case 187: /* cmd ::= SHOW CREATE STABLE full_table_name */
3192
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy182); }
3193
        break;
3194
      case 188: /* cmd ::= SHOW QUERIES */
3195 3196
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); }
        break;
3197
      case 189: /* cmd ::= SHOW SCORES */
3198 3199
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT, NULL, NULL); }
        break;
3200
      case 190: /* cmd ::= SHOW TOPICS */
3201 3202
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT, NULL, NULL); }
        break;
3203
      case 191: /* cmd ::= SHOW VARIABLES */
3204
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLE_STMT, NULL, NULL); }
X
Xiaoyu Wang 已提交
3205
        break;
3206
      case 192: /* cmd ::= SHOW BNODES */
3207 3208
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT, NULL, NULL); }
        break;
3209
      case 193: /* cmd ::= SHOW SNODES */
3210 3211
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT, NULL, NULL); }
        break;
3212 3213
      case 194: /* db_name_cond_opt ::= */
      case 199: /* from_db_opt ::= */ yytestcase(yyruleno==199);
3214
{ yymsp[1].minor.yy182 = createDefaultDatabaseCondValue(pCxt); }
X
Xiaoyu Wang 已提交
3215
        break;
3216
      case 195: /* db_name_cond_opt ::= db_name NK_DOT */
3217 3218
{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy29); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3219
        break;
3220 3221 3222 3223 3224 3225 3226 3227 3228
      case 196: /* like_pattern_opt ::= */
      case 207: /* index_options ::= */ yytestcase(yyruleno==207);
      case 360: /* where_clause_opt ::= */ yytestcase(yyruleno==360);
      case 364: /* twindow_clause_opt ::= */ yytestcase(yyruleno==364);
      case 369: /* sliding_opt ::= */ yytestcase(yyruleno==369);
      case 371: /* fill_opt ::= */ yytestcase(yyruleno==371);
      case 383: /* having_clause_opt ::= */ yytestcase(yyruleno==383);
      case 391: /* slimit_clause_opt ::= */ yytestcase(yyruleno==391);
      case 395: /* limit_clause_opt ::= */ yytestcase(yyruleno==395);
3229
{ yymsp[1].minor.yy182 = NULL; }
X
Xiaoyu Wang 已提交
3230
        break;
3231
      case 197: /* like_pattern_opt ::= LIKE NK_STRING */
3232
{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3233
        break;
3234
      case 198: /* table_name_cond ::= table_name */
3235 3236
{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy29); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3237
        break;
3238
      case 200: /* from_db_opt ::= FROM db_name */
3239
{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy29); }
X
Xiaoyu Wang 已提交
3240
        break;
3241
      case 203: /* func_name ::= function_name */
3242 3243
{ yylhsminor.yy182 = createFunctionNode(pCxt, &yymsp[0].minor.yy29, NULL); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3244
        break;
3245
      case 204: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
3246
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy47, &yymsp[-3].minor.yy29, &yymsp[-1].minor.yy29, NULL, yymsp[0].minor.yy182); }
X
Xiaoyu Wang 已提交
3247
        break;
3248
      case 205: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
3249
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy47, &yymsp[-5].minor.yy29, &yymsp[-3].minor.yy29, yymsp[-1].minor.yy334, NULL); }
X
Xiaoyu Wang 已提交
3250
        break;
3251
      case 206: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */
3252
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy47, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29); }
X
Xiaoyu Wang 已提交
3253
        break;
3254
      case 208: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
3255
{ yymsp[-8].minor.yy182 = createIndexOption(pCxt, yymsp[-6].minor.yy334, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), NULL, yymsp[0].minor.yy182); }
X
Xiaoyu Wang 已提交
3256
        break;
3257
      case 209: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
3258
{ yymsp[-10].minor.yy182 = createIndexOption(pCxt, yymsp[-8].minor.yy334, releaseRawExprNode(pCxt, yymsp[-4].minor.yy182), releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), yymsp[0].minor.yy182); }
X
Xiaoyu Wang 已提交
3259
        break;
3260
      case 212: /* func ::= function_name NK_LP expression_list NK_RP */
3261 3262
{ yylhsminor.yy182 = createFunctionNode(pCxt, &yymsp[-3].minor.yy29, yymsp[-1].minor.yy334); }
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3263
        break;
3264
      case 213: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
3265
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy47, &yymsp[-2].minor.yy29, yymsp[0].minor.yy182, NULL); }
X
Xiaoyu Wang 已提交
3266
        break;
3267
      case 214: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
3268
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy47, &yymsp[-2].minor.yy29, NULL, &yymsp[0].minor.yy29); }
3269
        break;
3270
      case 215: /* cmd ::= DROP TOPIC exists_opt topic_name */
3271
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy47, &yymsp[0].minor.yy29); }
3272
        break;
3273 3274
      case 216: /* cmd ::= DESC full_table_name */
      case 217: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==217);
3275
{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy182); }
3276
        break;
3277
      case 218: /* cmd ::= RESET QUERY CACHE */
3278 3279
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
        break;
3280
      case 219: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */
3281
{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy47, yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
3282
        break;
3283 3284 3285
      case 221: /* analyze_opt ::= ANALYZE */
      case 229: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==229);
      case 350: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==350);
3286
{ yymsp[0].minor.yy47 = true; }
3287
        break;
3288
      case 222: /* explain_options ::= */
3289
{ yymsp[1].minor.yy182 = createDefaultExplainOptions(pCxt); }
3290
        break;
3291
      case 223: /* explain_options ::= explain_options VERBOSE NK_BOOL */
3292 3293
{ yylhsminor.yy182 = setExplainVerbose(pCxt, yymsp[-2].minor.yy182, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3294
        break;
3295
      case 224: /* explain_options ::= explain_options RATIO NK_FLOAT */
3296 3297
{ yylhsminor.yy182 = setExplainRatio(pCxt, yymsp[-2].minor.yy182, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3298
        break;
3299
      case 225: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
3300
{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy334); }
3301
        break;
3302
      case 226: /* cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
3303
{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy47, &yymsp[-5].minor.yy29, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy574, yymsp[0].minor.yy550); }
3304
        break;
3305
      case 227: /* cmd ::= DROP FUNCTION function_name */
3306
{ pCxt->pRootNode = createDropFunctionStmt(pCxt, &yymsp[0].minor.yy29); }
3307
        break;
3308
      case 230: /* bufsize_opt ::= */
3309
{ yymsp[1].minor.yy550 = 0; }
3310
        break;
3311
      case 231: /* bufsize_opt ::= BUFSIZE NK_INTEGER */
3312
{ yymsp[-1].minor.yy550 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
3313
        break;
3314
      case 232: /* cmd ::= CREATE STREAM stream_name INTO table_name AS query_expression */
3315
{ pCxt->pRootNode = createCreateStreamStmt(pCxt, &yymsp[-4].minor.yy29, &yymsp[-2].minor.yy29, yymsp[0].minor.yy182); }
3316
        break;
3317
      case 233: /* cmd ::= DROP STREAM stream_name */
3318
{ pCxt->pRootNode = createDropStreamStmt(pCxt, &yymsp[0].minor.yy29); }
3319
        break;
3320
      case 234: /* cmd ::= KILL CONNECTION NK_INTEGER */
3321 3322
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
        break;
3323
      case 235: /* cmd ::= KILL QUERY NK_INTEGER */
3324 3325
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_QUERY_STMT, &yymsp[0].minor.yy0); }
        break;
3326
      case 236: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
3327 3328
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3329
      case 237: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
3330
{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy334); }
3331
        break;
3332
      case 238: /* cmd ::= SPLIT VGROUP NK_INTEGER */
3333 3334
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
3335
      case 239: /* dnode_list ::= DNODE NK_INTEGER */
3336
{ yymsp[-1].minor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
3337 3338
        break;
      case 241: /* cmd ::= SYNCDB db_name REPLICA */
3339
{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy29); }
3340 3341
        break;
      case 243: /* literal ::= NK_INTEGER */
3342 3343
{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3344 3345
        break;
      case 244: /* literal ::= NK_FLOAT */
3346 3347
{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3348 3349
        break;
      case 245: /* literal ::= NK_STRING */
3350 3351
{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3352 3353
        break;
      case 246: /* literal ::= NK_BOOL */
3354 3355
{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3356 3357
        break;
      case 247: /* literal ::= TIMESTAMP NK_STRING */
3358 3359
{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376
        break;
      case 248: /* literal ::= duration_literal */
      case 257: /* signed_literal ::= signed */ yytestcase(yyruleno==257);
      case 277: /* expression ::= literal */ yytestcase(yyruleno==277);
      case 278: /* expression ::= pseudo_column */ yytestcase(yyruleno==278);
      case 279: /* expression ::= column_reference */ yytestcase(yyruleno==279);
      case 283: /* expression ::= subquery */ yytestcase(yyruleno==283);
      case 323: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==323);
      case 327: /* boolean_primary ::= predicate */ yytestcase(yyruleno==327);
      case 329: /* common_expression ::= expression */ yytestcase(yyruleno==329);
      case 330: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==330);
      case 332: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==332);
      case 334: /* table_reference ::= table_primary */ yytestcase(yyruleno==334);
      case 335: /* table_reference ::= joined_table */ yytestcase(yyruleno==335);
      case 339: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==339);
      case 386: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==386);
      case 388: /* query_primary ::= query_specification */ yytestcase(yyruleno==388);
3377 3378
{ yylhsminor.yy182 = yymsp[0].minor.yy182; }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3379 3380
        break;
      case 249: /* literal ::= NULL */
3381 3382
{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL)); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3383 3384
        break;
      case 250: /* duration_literal ::= NK_VARIABLE */
3385 3386
{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3387 3388
        break;
      case 251: /* signed ::= NK_INTEGER */
3389 3390
{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3391 3392
        break;
      case 252: /* signed ::= NK_PLUS NK_INTEGER */
3393
{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3394 3395
        break;
      case 253: /* signed ::= NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
3396 3397 3398
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3399
                                                                                    yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
X
Xiaoyu Wang 已提交
3400
                                                                                  }
3401
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3402
        break;
3403
      case 254: /* signed ::= NK_FLOAT */
3404 3405
{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3406
        break;
3407
      case 255: /* signed ::= NK_PLUS NK_FLOAT */
3408
{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3409
        break;
3410
      case 256: /* signed ::= NK_MINUS NK_FLOAT */
X
Xiaoyu Wang 已提交
3411 3412 3413
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3414
                                                                                    yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
X
Xiaoyu Wang 已提交
3415
                                                                                  }
3416
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3417
        break;
3418
      case 258: /* signed_literal ::= NK_STRING */
3419 3420
{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3421
        break;
3422
      case 259: /* signed_literal ::= NK_BOOL */
3423 3424
{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3425
        break;
3426
      case 260: /* signed_literal ::= TIMESTAMP NK_STRING */
3427
{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
3428
        break;
3429 3430 3431
      case 261: /* signed_literal ::= duration_literal */
      case 356: /* select_item ::= common_expression */ yytestcase(yyruleno==356);
      case 400: /* search_condition ::= common_expression */ yytestcase(yyruleno==400);
3432 3433
{ yylhsminor.yy182 = releaseRawExprNode(pCxt, yymsp[0].minor.yy182); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3434
        break;
3435
      case 262: /* signed_literal ::= NULL */
3436
{ yymsp[0].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL); }
X
Xiaoyu Wang 已提交
3437
        break;
3438
      case 280: /* expression ::= function_name NK_LP expression_list NK_RP */
3439 3440
{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy29, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy29, yymsp[-1].minor.yy334)); }
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3441
        break;
3442
      case 281: /* expression ::= function_name NK_LP NK_STAR NK_RP */
3443 3444
{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy29, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy29, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3445
        break;
3446 3447 3448
      case 282: /* expression ::= CAST NK_LP expression AS type_name NK_RP */
{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), yymsp[-1].minor.yy574)); }
  yymsp[-5].minor.yy182 = yylhsminor.yy182;
3449
        break;
3450 3451
      case 284: /* expression ::= NK_LP expression NK_RP */
      case 328: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==328);
3452 3453
{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy182)); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
X
Xiaoyu Wang 已提交
3454
        break;
3455
      case 285: /* expression ::= NK_PLUS expression */
3456
{
3457 3458
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy182));
3459
                                                                                  }
3460
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3461
        break;
3462
      case 286: /* expression ::= NK_MINUS expression */
3463
{
3464 3465
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy182), NULL));
3466
                                                                                  }
3467
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3468
        break;
3469
      case 287: /* expression ::= expression NK_PLUS expression */
3470
{
3471 3472 3473
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); 
3474
                                                                                  }
3475
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3476
        break;
3477
      case 288: /* expression ::= expression NK_MINUS expression */
3478
{
3479 3480 3481
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); 
3482
                                                                                  }
3483
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3484
        break;
3485
      case 289: /* expression ::= expression NK_STAR expression */
3486
{
3487 3488 3489
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); 
3490
                                                                                  }
3491
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3492
        break;
3493
      case 290: /* expression ::= expression NK_SLASH expression */
3494
{
3495 3496 3497
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); 
3498
                                                                                  }
3499
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3500
        break;
3501
      case 291: /* expression ::= expression NK_REM expression */
3502
{
3503 3504 3505
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); 
3506
                                                                                  }
3507
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3508 3509
        break;
      case 292: /* expression_list ::= expression */
3510 3511
{ yylhsminor.yy334 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy182)); }
  yymsp[0].minor.yy334 = yylhsminor.yy334;
3512 3513
        break;
      case 293: /* expression_list ::= expression_list NK_COMMA expression */
3514 3515
{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, releaseRawExprNode(pCxt, yymsp[0].minor.yy182)); }
  yymsp[-2].minor.yy334 = yylhsminor.yy334;
3516 3517
        break;
      case 294: /* column_reference ::= column_name */
3518 3519
{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy29, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy29)); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3520 3521
        break;
      case 295: /* column_reference ::= table_name NK_DOT column_name */
3522 3523
{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29, createColumnNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29)); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3524 3525 3526 3527 3528 3529 3530 3531 3532
        break;
      case 296: /* pseudo_column ::= NOW */
      case 297: /* pseudo_column ::= ROWTS */ yytestcase(yyruleno==297);
      case 298: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==298);
      case 299: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==299);
      case 300: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==300);
      case 301: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==301);
      case 302: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==302);
      case 303: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==303);
3533 3534
{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
  yymsp[0].minor.yy182 = yylhsminor.yy182;
3535 3536 3537
        break;
      case 304: /* predicate ::= expression compare_op expression */
      case 309: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==309);
3538
{
3539 3540 3541
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy380, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
3542
                                                                                  }
3543
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3544
        break;
3545
      case 305: /* predicate ::= expression BETWEEN expression AND expression */
3546
{
3547 3548 3549
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy182), releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
3550
                                                                                  }
3551
  yymsp[-4].minor.yy182 = yylhsminor.yy182;
3552
        break;
3553
      case 306: /* predicate ::= expression NOT BETWEEN expression AND expression */
3554
{
3555 3556 3557
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[-5].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
3558
                                                                                  }
3559
  yymsp[-5].minor.yy182 = yylhsminor.yy182;
3560
        break;
3561
      case 307: /* predicate ::= expression IS NULL */
3562
{
3563 3564
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), NULL));
3565
                                                                                  }
3566
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3567
        break;
3568
      case 308: /* predicate ::= expression IS NOT NULL */
3569
{
3570 3571
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), NULL));
3572
                                                                                  }
3573
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
3574
        break;
3575
      case 310: /* compare_op ::= NK_LT */
3576
{ yymsp[0].minor.yy380 = OP_TYPE_LOWER_THAN; }
3577
        break;
3578
      case 311: /* compare_op ::= NK_GT */
3579
{ yymsp[0].minor.yy380 = OP_TYPE_GREATER_THAN; }
3580
        break;
3581
      case 312: /* compare_op ::= NK_LE */
3582
{ yymsp[0].minor.yy380 = OP_TYPE_LOWER_EQUAL; }
3583
        break;
3584
      case 313: /* compare_op ::= NK_GE */
3585
{ yymsp[0].minor.yy380 = OP_TYPE_GREATER_EQUAL; }
3586
        break;
3587
      case 314: /* compare_op ::= NK_NE */
3588
{ yymsp[0].minor.yy380 = OP_TYPE_NOT_EQUAL; }
3589
        break;
3590
      case 315: /* compare_op ::= NK_EQ */
3591
{ yymsp[0].minor.yy380 = OP_TYPE_EQUAL; }
3592
        break;
3593
      case 316: /* compare_op ::= LIKE */
3594
{ yymsp[0].minor.yy380 = OP_TYPE_LIKE; }
3595
        break;
3596
      case 317: /* compare_op ::= NOT LIKE */
3597
{ yymsp[-1].minor.yy380 = OP_TYPE_NOT_LIKE; }
3598
        break;
3599
      case 318: /* compare_op ::= MATCH */
3600
{ yymsp[0].minor.yy380 = OP_TYPE_MATCH; }
3601
        break;
3602
      case 319: /* compare_op ::= NMATCH */
3603
{ yymsp[0].minor.yy380 = OP_TYPE_NMATCH; }
3604
        break;
3605
      case 320: /* in_op ::= IN */
3606
{ yymsp[0].minor.yy380 = OP_TYPE_IN; }
3607
        break;
3608
      case 321: /* in_op ::= NOT IN */
3609
{ yymsp[-1].minor.yy380 = OP_TYPE_NOT_IN; }
3610
        break;
3611
      case 322: /* in_predicate_value ::= NK_LP expression_list NK_RP */
3612 3613
{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3614
        break;
3615
      case 324: /* boolean_value_expression ::= NOT boolean_primary */
3616
{
3617 3618
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy182), NULL));
3619
                                                                                  }
3620
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3621
        break;
3622
      case 325: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
3623
{
3624 3625 3626
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
3627
                                                                                  }
3628
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3629
        break;
3630
      case 326: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
3631
{
3632 3633 3634
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
                                                                                    yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
3635
                                                                                  }
3636
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3637
        break;
3638 3639 3640
      case 331: /* from_clause ::= FROM table_reference_list */
      case 361: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==361);
      case 384: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==384);
3641
{ yymsp[-1].minor.yy182 = yymsp[0].minor.yy182; }
3642
        break;
3643
      case 333: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
3644 3645
{ yylhsminor.yy182 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy182, yymsp[0].minor.yy182, NULL); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3646
        break;
3647
      case 336: /* table_primary ::= table_name alias_opt */
3648 3649
{ yylhsminor.yy182 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3650
        break;
3651
      case 337: /* table_primary ::= db_name NK_DOT table_name alias_opt */
3652 3653
{ yylhsminor.yy182 = createRealTableNode(pCxt, &yymsp[-3].minor.yy29, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); }
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
3654
        break;
3655
      case 338: /* table_primary ::= subquery alias_opt */
3656 3657
{ yylhsminor.yy182 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy182), &yymsp[0].minor.yy29); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3658
        break;
3659
      case 340: /* alias_opt ::= */
3660
{ yymsp[1].minor.yy29 = nil_token;  }
3661
        break;
3662
      case 341: /* alias_opt ::= table_alias */
3663 3664
{ yylhsminor.yy29 = yymsp[0].minor.yy29; }
  yymsp[0].minor.yy29 = yylhsminor.yy29;
3665
        break;
3666
      case 342: /* alias_opt ::= AS table_alias */
3667
{ yymsp[-1].minor.yy29 = yymsp[0].minor.yy29; }
3668
        break;
3669 3670
      case 343: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
      case 344: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==344);
3671
{ yymsp[-2].minor.yy182 = yymsp[-1].minor.yy182; }
3672
        break;
3673
      case 345: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
3674 3675
{ yylhsminor.yy182 = createJoinTableNode(pCxt, yymsp[-4].minor.yy162, yymsp[-5].minor.yy182, yymsp[-2].minor.yy182, yymsp[0].minor.yy182); }
  yymsp[-5].minor.yy182 = yylhsminor.yy182;
3676
        break;
3677
      case 346: /* join_type ::= */
3678
{ yymsp[1].minor.yy162 = JOIN_TYPE_INNER; }
3679
        break;
3680
      case 347: /* join_type ::= INNER */
3681
{ yymsp[0].minor.yy162 = JOIN_TYPE_INNER; }
3682
        break;
3683
      case 348: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
3684
{ 
3685 3686 3687 3688 3689 3690
                                                                                    yymsp[-8].minor.yy182 = createSelectStmt(pCxt, yymsp[-7].minor.yy47, yymsp[-6].minor.yy334, yymsp[-5].minor.yy182);
                                                                                    yymsp[-8].minor.yy182 = addWhereClause(pCxt, yymsp[-8].minor.yy182, yymsp[-4].minor.yy182);
                                                                                    yymsp[-8].minor.yy182 = addPartitionByClause(pCxt, yymsp[-8].minor.yy182, yymsp[-3].minor.yy334);
                                                                                    yymsp[-8].minor.yy182 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy182, yymsp[-2].minor.yy182);
                                                                                    yymsp[-8].minor.yy182 = addGroupByClause(pCxt, yymsp[-8].minor.yy182, yymsp[-1].minor.yy334);
                                                                                    yymsp[-8].minor.yy182 = addHavingClause(pCxt, yymsp[-8].minor.yy182, yymsp[0].minor.yy182);
3691 3692
                                                                                  }
        break;
3693
      case 351: /* set_quantifier_opt ::= ALL */
3694
{ yymsp[0].minor.yy47 = false; }
3695
        break;
3696
      case 352: /* select_list ::= NK_STAR */
3697
{ yymsp[0].minor.yy334 = NULL; }
3698
        break;
3699
      case 357: /* select_item ::= common_expression column_alias */
3700 3701
{ yylhsminor.yy182 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy182), &yymsp[0].minor.yy29); }
  yymsp[-1].minor.yy182 = yylhsminor.yy182;
3702
        break;
3703
      case 358: /* select_item ::= common_expression AS column_alias */
3704 3705
{ yylhsminor.yy182 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), &yymsp[0].minor.yy29); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3706
        break;
3707
      case 359: /* select_item ::= table_name NK_DOT NK_STAR */
3708 3709
{ yylhsminor.yy182 = createColumnNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3710
        break;
3711 3712 3713
      case 363: /* partition_by_clause_opt ::= PARTITION BY expression_list */
      case 380: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==380);
      case 390: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==390);
3714
{ yymsp[-2].minor.yy334 = yymsp[0].minor.yy334; }
3715
        break;
3716
      case 365: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
3717
{ yymsp[-5].minor.yy182 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), releaseRawExprNode(pCxt, yymsp[-1].minor.yy182)); }
3718
        break;
3719
      case 366: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
3720
{ yymsp[-3].minor.yy182 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy182)); }
3721
        break;
3722
      case 367: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
3723
{ yymsp[-5].minor.yy182 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), NULL, yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
3724
        break;
3725
      case 368: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
3726
{ yymsp[-7].minor.yy182 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy182), releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
3727
        break;
3728
      case 370: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
3729
{ yymsp[-3].minor.yy182 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy182); }
3730
        break;
3731
      case 372: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
3732
{ yymsp[-3].minor.yy182 = createFillNode(pCxt, yymsp[-1].minor.yy144, NULL); }
3733
        break;
3734
      case 373: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
3735
{ yymsp[-5].minor.yy182 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); }
3736
        break;
3737
      case 374: /* fill_mode ::= NONE */
3738
{ yymsp[0].minor.yy144 = FILL_MODE_NONE; }
3739
        break;
3740
      case 375: /* fill_mode ::= PREV */
3741
{ yymsp[0].minor.yy144 = FILL_MODE_PREV; }
3742
        break;
3743
      case 376: /* fill_mode ::= NULL */
3744
{ yymsp[0].minor.yy144 = FILL_MODE_NULL; }
3745
        break;
3746
      case 377: /* fill_mode ::= LINEAR */
3747
{ yymsp[0].minor.yy144 = FILL_MODE_LINEAR; }
3748
        break;
3749
      case 378: /* fill_mode ::= NEXT */
3750
{ yymsp[0].minor.yy144 = FILL_MODE_NEXT; }
3751
        break;
3752
      case 381: /* group_by_list ::= expression */
3753 3754
{ yylhsminor.yy334 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); }
  yymsp[0].minor.yy334 = yylhsminor.yy334;
3755
        break;
3756
      case 382: /* group_by_list ::= group_by_list NK_COMMA expression */
3757 3758
{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); }
  yymsp[-2].minor.yy334 = yylhsminor.yy334;
3759
        break;
3760
      case 385: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
3761
{ 
3762 3763 3764
                                                                                    yylhsminor.yy182 = addOrderByClause(pCxt, yymsp[-3].minor.yy182, yymsp[-2].minor.yy334);
                                                                                    yylhsminor.yy182 = addSlimitClause(pCxt, yylhsminor.yy182, yymsp[-1].minor.yy182);
                                                                                    yylhsminor.yy182 = addLimitClause(pCxt, yylhsminor.yy182, yymsp[0].minor.yy182);
3765
                                                                                  }
3766
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
3767
        break;
3768
      case 387: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
3769 3770
{ yylhsminor.yy182 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy182, yymsp[0].minor.yy182); }
  yymsp[-3].minor.yy182 = yylhsminor.yy182;
3771
        break;
3772 3773
      case 392: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
      case 396: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==396);
3774
{ yymsp[-1].minor.yy182 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
3775
        break;
3776 3777
      case 393: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
      case 397: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==397);
3778
{ yymsp[-3].minor.yy182 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
3779
        break;
3780 3781
      case 394: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
      case 398: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==398);
3782
{ yymsp[-3].minor.yy182 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
3783
        break;
3784
      case 399: /* subquery ::= NK_LP query_expression NK_RP */
3785 3786
{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy182); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3787
        break;
3788
      case 403: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
3789 3790
{ yylhsminor.yy182 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), yymsp[-1].minor.yy218, yymsp[0].minor.yy487); }
  yymsp[-2].minor.yy182 = yylhsminor.yy182;
3791
        break;
3792
      case 404: /* ordering_specification_opt ::= */
3793
{ yymsp[1].minor.yy218 = ORDER_ASC; }
3794
        break;
3795
      case 405: /* ordering_specification_opt ::= ASC */
3796
{ yymsp[0].minor.yy218 = ORDER_ASC; }
3797
        break;
3798
      case 406: /* ordering_specification_opt ::= DESC */
3799
{ yymsp[0].minor.yy218 = ORDER_DESC; }
3800
        break;
3801
      case 407: /* null_ordering_opt ::= */
3802
{ yymsp[1].minor.yy487 = NULL_ORDER_DEFAULT; }
3803
        break;
3804
      case 408: /* null_ordering_opt ::= NULLS FIRST */
3805
{ yymsp[-1].minor.yy487 = NULL_ORDER_FIRST; }
3806
        break;
3807
      case 409: /* null_ordering_opt ::= NULLS LAST */
3808
{ yymsp[-1].minor.yy487 = NULL_ORDER_LAST; }
3809 3810 3811 3812 3813
        break;
      default:
        break;
/********** End reduce actions ************************************************/
  };
3814 3815 3816
  assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840
  yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);

  /* There are no SHIFTREDUCE actions on nonterminals because the table
  ** generator has simplified them to pure REDUCE actions. */
  assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );

  /* It is not possible for a REDUCE to be followed by an error */
  assert( yyact!=YY_ERROR_ACTION );

  yymsp += yysize+1;
  yypParser->yytos = yymsp;
  yymsp->stateno = (YYACTIONTYPE)yyact;
  yymsp->major = (YYCODETYPE)yygoto;
  yyTraceShift(yypParser, yyact, "... then shift");
  return yyact;
}

/*
** The following code executes when the parse fails
*/
#ifndef YYNOERRORRECOVERY
static void yy_parse_failed(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
3841 3842
  ParseARG_FETCH
  ParseCTX_FETCH
3843 3844 3845 3846 3847 3848 3849 3850 3851 3852
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
  }
#endif
  while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will be executed whenever the
  ** parser fails */
/************ Begin %parse_failure code ***************************************/
/************ End %parse_failure code *****************************************/
X
Xiaoyu Wang 已提交
3853 3854
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3855 3856 3857 3858 3859 3860 3861 3862 3863
}
#endif /* YYNOERRORRECOVERY */

/*
** The following code executes when a syntax error first occurs.
*/
static void yy_syntax_error(
  yyParser *yypParser,           /* The parser */
  int yymajor,                   /* The major type of the error token */
X
Xiaoyu Wang 已提交
3864
  ParseTOKENTYPE yyminor         /* The minor type of the error token */
3865
){
X
Xiaoyu Wang 已提交
3866 3867
  ParseARG_FETCH
  ParseCTX_FETCH
3868 3869
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
3870 3871 3872 3873 3874 3875 3876 3877

  if (pCxt->valid) {
    if(TOKEN.z) {
      generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
    } else {
      generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
    }
    pCxt->valid = false;
3878 3879
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
3880 3881
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3882 3883 3884 3885 3886 3887 3888 3889
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
3890 3891
  ParseARG_FETCH
  ParseCTX_FETCH
3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
  }
#endif
#ifndef YYNOERRORRECOVERY
  yypParser->yyerrcnt = -1;
#endif
  assert( yypParser->yytos==yypParser->yystack );
  /* Here code is inserted which will be executed whenever the
  ** parser accepts */
/*********** Begin %parse_accept code *****************************************/
/*********** End %parse_accept code *******************************************/
X
Xiaoyu Wang 已提交
3905 3906
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3907 3908 3909 3910
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
3911
** "ParseAlloc" which describes the current state of the parser.
3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927
** The second argument is the major token number.  The third is
** the minor token.  The fourth optional argument is whatever the
** user wants (and specified in the grammar) and is available for
** use by the action routines.
**
** Inputs:
** <ul>
** <li> A pointer to the parser (an opaque structure.)
** <li> The major token number.
** <li> The minor token number.
** <li> An option argument of a grammar-specified type.
** </ul>
**
** Outputs:
** None.
*/
X
Xiaoyu Wang 已提交
3928
void Parse(
3929 3930
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
3931 3932
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
3933 3934 3935 3936 3937 3938 3939 3940 3941 3942
){
  YYMINORTYPE yyminorunion;
  YYACTIONTYPE yyact;   /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
  int yyendofinput;     /* True if we are at the end of input */
#endif
#ifdef YYERRORSYMBOL
  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
#endif
  yyParser *yypParser = (yyParser*)yyp;  /* The parser */
X
Xiaoyu Wang 已提交
3943 3944
  ParseCTX_FETCH
  ParseARG_STORE
3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968

  assert( yypParser->yytos!=0 );
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
  yyendofinput = (yymajor==0);
#endif

  yyact = yypParser->yytos->stateno;
#ifndef NDEBUG
  if( yyTraceFILE ){
    if( yyact < YY_MIN_REDUCE ){
      fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
              yyTracePrompt,yyTokenName[yymajor],yyact);
    }else{
      fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
              yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
    }
  }
#endif

  do{
    assert( yyact==yypParser->yytos->stateno );
    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
    if( yyact >= YY_MIN_REDUCE ){
      yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
X
Xiaoyu Wang 已提交
3969
                        yyminor ParseCTX_PARAM);
3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101
    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
      yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
      yypParser->yyerrcnt--;
#endif
      break;
    }else if( yyact==YY_ACCEPT_ACTION ){
      yypParser->yytos--;
      yy_accept(yypParser);
      return;
    }else{
      assert( yyact == YY_ERROR_ACTION );
      yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL
      int yymx;
#endif
#ifndef NDEBUG
      if( yyTraceFILE ){
        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
      }
#endif
#ifdef YYERRORSYMBOL
      /* A syntax error has occurred.
      ** The response to an error depends upon whether or not the
      ** grammar defines an error token "ERROR".  
      **
      ** This is what we do if the grammar does define ERROR:
      **
      **  * Call the %syntax_error function.
      **
      **  * Begin popping the stack until we enter a state where
      **    it is legal to shift the error symbol, then shift
      **    the error symbol.
      **
      **  * Set the error count to three.
      **
      **  * Begin accepting and shifting new tokens.  No new error
      **    processing will occur until three tokens have been
      **    shifted successfully.
      **
      */
      if( yypParser->yyerrcnt<0 ){
        yy_syntax_error(yypParser,yymajor,yyminor);
      }
      yymx = yypParser->yytos->major;
      if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
             yyTracePrompt,yyTokenName[yymajor]);
        }
#endif
        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
        yymajor = YYNOCODE;
      }else{
        while( yypParser->yytos >= yypParser->yystack
            && (yyact = yy_find_reduce_action(
                        yypParser->yytos->stateno,
                        YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
        ){
          yy_pop_parser_stack(yypParser);
        }
        if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
          yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
          yypParser->yyerrcnt = -1;
#endif
          yymajor = YYNOCODE;
        }else if( yymx!=YYERRORSYMBOL ){
          yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
        }
      }
      yypParser->yyerrcnt = 3;
      yyerrorhit = 1;
      if( yymajor==YYNOCODE ) break;
      yyact = yypParser->yytos->stateno;
#elif defined(YYNOERRORRECOVERY)
      /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
      ** do any kind of error recovery.  Instead, simply invoke the syntax
      ** error routine and continue going as if nothing had happened.
      **
      ** Applications can set this macro (for example inside %include) if
      ** they intend to abandon the parse upon the first syntax error seen.
      */
      yy_syntax_error(yypParser,yymajor, yyminor);
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      break;
#else  /* YYERRORSYMBOL is not defined */
      /* This is what we do if the grammar does not define ERROR:
      **
      **  * Report an error message, and throw away the input token.
      **
      **  * If the input token is $, then fail the parse.
      **
      ** As before, subsequent error messages are suppressed until
      ** three input tokens have been successfully shifted.
      */
      if( yypParser->yyerrcnt<=0 ){
        yy_syntax_error(yypParser,yymajor, yyminor);
      }
      yypParser->yyerrcnt = 3;
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      if( yyendofinput ){
        yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
        yypParser->yyerrcnt = -1;
#endif
      }
      break;
#endif
    }
  }while( yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG
  if( yyTraceFILE ){
    yyStackEntry *i;
    char cDiv = '[';
    fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
    for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
      fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
      cDiv = ' ';
    }
    fprintf(yyTraceFILE,"]\n");
  }
#endif
  return;
}

/*
** Return the fallback token corresponding to canonical token iToken, or
** 0 if iToken has no fallback.
*/
X
Xiaoyu Wang 已提交
4102
int ParseFallback(int iToken){
4103
#ifdef YYFALLBACK
4104 4105 4106
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
4107 4108
#else
  (void)iToken;
4109
#endif
4110
  return 0;
4111
}