sql.c 237.1 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 358
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
  EOrder yy14;
  ENullOrder yy17;
  SNodeList* yy60;
  SToken yy105;
  int32_t yy140;
  SNode* yy172;
  EFillMode yy202;
  SDataType yy248;
  EOperatorType yy572;
  int64_t yy593;
  SAlterOption yy609;
120
  bool yy617;
121
  EJoinType yy636;
122 123 124 125
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
X
Xiaoyu Wang 已提交
126 127 128 129 130 131 132 133 134 135
#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
X
Xiaoyu Wang 已提交
136
#define YYFALLBACK 1
137 138
#define YYNSTATE             605
#define YYNRULE              452
139
#define YYNTOKEN             238
140 141 142 143 144 145 146 147
#define YY_MAX_SHIFT         604
#define YY_MIN_SHIFTREDUCE   893
#define YY_MAX_SHIFTREDUCE   1344
#define YY_ERROR_ACTION      1345
#define YY_ACCEPT_ACTION     1346
#define YY_NO_ACTION         1347
#define YY_MIN_REDUCE        1348
#define YY_MAX_REDUCE        1799
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 212 213
/************* 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 **********************************************/
X
Xiaoyu Wang 已提交
214
#define YY_ACTTAB_COUNT (2167)
215
static const YYACTIONTYPE yy_action[] = {
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 369 370 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
 /*     0 */   383,   76,  384, 1380,  391,  519,  384, 1380, 1631,   28,
 /*    10 */   223, 1467,   35,   33,  113, 1463,  343,  347, 1646, 1777,
 /*    20 */   301, 1470, 1159, 1627, 1635, 1633,   36,   34,   32,   31,
 /*    30 */    30, 1729, 1776, 1478,   94,  522, 1774,   93,   92,   91,
 /*    40 */    90,   89,   88,   87,   86,   85, 1662, 1157, 1523,  292,
 /*    50 */    32,   31,   30,  503,  291, 1726, 1777,  479,   14, 1521,
 /*    60 */    35,   33, 1285,  502, 1165,  518, 1631, 1617,  301,  145,
 /*    70 */  1159,  349,  274, 1774,  398,   36,   34,   32,   31,   30,
 /*    80 */     1, 1627, 1634, 1633, 1675,  112,   24,  132, 1647,  505,
 /*    90 */  1649, 1650,  501,  522,  522, 1157,   36,   34,   32,   31,
 /*   100 */    30,   61,  601, 1247,  271,  483,   14,  519,   35,   33,
 /*   110 */   597,  596, 1165, 1158,  108,  518,  301,  305, 1159,  104,
 /*   120 */  1181,  274, 1473,  110,  939,  128,  419,  130,    2, 1360,
 /*   130 */    54,  484, 1791, 1480, 1777, 1478,  519,   69,  212, 1722,
 /*   140 */   478, 1348,  477, 1157, 1196, 1777, 1777,  146,  104,  417,
 /*   150 */   601, 1774, 1247, 1248,   14,  424, 1160, 1471,  147, 1775,
 /*   160 */  1165, 1158, 1774, 1774, 1478,  103,  102,  101,  100,   99,
 /*   170 */    98,   97,   96,   95, 1253,   38,    2,  554, 1163, 1164,
 /*   180 */    54, 1209, 1210, 1212, 1213, 1214, 1215, 1216,  498,  520,
 /*   190 */  1224, 1225, 1226, 1227, 1228, 1229,  553,  552,  601,  551,
 /*   200 */   550,  549, 1248,  495, 1160,  342, 1309,  341,  148, 1158,
 /*   210 */    27,  299, 1242, 1243, 1244, 1245, 1246, 1250, 1251, 1252,
 /*   220 */   131, 1183,  506, 1253, 1435,  304, 1163, 1164, 1568, 1209,
 /*   230 */  1210, 1212, 1213, 1214, 1215, 1216,  498,  520, 1224, 1225,
 /*   240 */  1226, 1227, 1228, 1229, 1407,  465, 1307, 1308, 1310, 1311,
 /*   250 */    55,   54, 1160,   36,   34,   32,   31,   30,  148,   27,
 /*   260 */   299, 1242, 1243, 1244, 1245, 1246, 1250, 1251, 1252,   63,
 /*   270 */   289,  479, 1284,  188, 1163, 1164, 1346, 1209, 1210, 1212,
 /*   280 */  1213, 1214, 1215, 1216,  498,  520, 1224, 1225, 1226, 1227,
 /*   290 */  1228, 1229,   35,   33,   36,   34,   32,   31,   30,  112,
 /*   300 */   301, 1456, 1159,  148,  577,  576,  575,  316,  148,  574,
 /*   310 */   573,  572,  114,  567,  566,  565,  564,  563,  562,  561,
 /*   320 */   560,  121, 1299, 1239, 1523,  313,   54, 1157,  991, 1662,
 /*   330 */   306, 1646, 1559, 1561,  317, 1521,  472,  110,  140,  311,
 /*   340 */    35,   33, 1230,  473, 1165,  993,  923,  128,  301, 1517,
 /*   350 */  1159,  481,  142, 1722, 1723, 1480, 1727,   26,  398, 1662,
 /*   360 */     8,   36,   34,   32,   31,   30,  503,   36,   34,   32,
 /*   370 */    31,   30,  471,  468, 1777, 1157,  502, 1410,  314,  148,
 /*   380 */  1617,  556,  601,  462,  927,  928,  128,  145,   35,   33,
 /*   390 */   334, 1774, 1165, 1158, 1480,  518,  301, 1675, 1159,   53,
 /*   400 */   268, 1647,  505, 1649, 1650,  501,  382,  522,    9,  386,
 /*   410 */   336,  332, 1029,  545,  544,  543, 1033,  542, 1035, 1036,
 /*   420 */   541, 1038,  538, 1157, 1044,  535, 1046, 1047,  532,  529,
 /*   430 */   601,   36,   34,   32,   31,   30, 1160,  433,  432,  548,
 /*   440 */  1165, 1158,  431,  474,  469,  109,  428, 1454,  519,  427,
 /*   450 */   426,  425, 1185, 1469,  148,   39,    9, 1729, 1163, 1164,
 /*   460 */   348, 1209, 1210, 1212, 1213, 1214, 1215, 1216,  498,  520,
 /*   470 */  1224, 1225, 1226, 1227, 1228, 1229, 1478, 1283,  601, 1292,
 /*   480 */  1235, 1725,  433,  432, 1160, 1183, 1183,  431,  148, 1158,
 /*   490 */   109,  428, 1523,  447,  427,  426,  425, 1341,  312, 1637,
 /*   500 */  1196, 1159, 1617, 1521,  556,  455, 1163, 1164,  309, 1209,
 /*   510 */  1210, 1212, 1213, 1214, 1215, 1216,  498,  520, 1224, 1225,
 /*   520 */  1226, 1227, 1228, 1229,  154, 1631, 1157,   36,   34,   32,
 /*   530 */    31,   30, 1160, 1777,  390, 1639, 1523,  386,  388, 1371,
 /*   540 */  1627, 1634, 1633, 1165, 1181,  373,  145, 1522,   59, 1370,
 /*   550 */  1774,   58,  522,  456, 1163, 1164, 1646, 1209, 1210, 1212,
 /*   560 */  1213, 1214, 1215, 1216,  498,  520, 1224, 1225, 1226, 1227,
 /*   570 */  1228, 1229,   35,   33,  270,  519, 1181,  214, 1340,   61,
 /*   580 */   301,  601, 1159,  366, 1662,  519,  378,  358, 1617,  158,
 /*   590 */   157,  503, 1158, 1777,  128, 1369,  174,  516, 1617, 1729,
 /*   600 */  1474,  502, 1481, 1478,  379, 1617,  145, 1157,  139,  519,
 /*   610 */  1774,  483, 1368, 1478,  415,  411,  407,  403,  173,  283,
 /*   620 */   485,  359, 1675, 1724, 1165,  259, 1647,  505, 1649, 1650,
 /*   630 */   501,  519,  522, 1120,  940, 1160,  939, 1478,  479,  445,
 /*   640 */     2, 1122,   62,  397, 1617,  171, 1367, 1211, 1211,   11,
 /*   650 */    10, 1777,  443, 1366,  430,  429,    7, 1163, 1164, 1478,
 /*   660 */   127, 1617,  601,  941,  147, 1365,  112,  284, 1774,  282,
 /*   670 */   281, 1184,  421, 1158,  377, 1364,  423,  372,  371,  370,
 /*   680 */   369,  368,  365,  364,  363,  362,  361,  357,  356,  355,
 /*   690 */   354,  353,  352,  351,  350, 1617, 1183,  519,  519,  422,
 /*   700 */   519, 1121, 1617,  170,  110,  165, 1455,  167,  479, 1475,
 /*   710 */  1597, 1186,  517, 1249, 1617, 1363, 1160, 1362, 1359,  143,
 /*   720 */  1722, 1723,  487, 1727, 1617, 1478, 1478,  163, 1478, 1261,
 /*   730 */  1646, 1358, 1357, 1356, 1254,  490,  112, 1355, 1163, 1164,
 /*   740 */  1182, 1209, 1210, 1212, 1213, 1214, 1215, 1216,  498,  520,
 /*   750 */  1224, 1225, 1226, 1227, 1228, 1229,  519,  246, 1662,  519,
 /*   760 */  1508, 1354, 1353, 1352, 1617,  503, 1617, 1617,  236, 1556,
 /*   770 */    25,  315,  571,  569,  110,  502,  156,  927,  928, 1617,
 /*   780 */  1617, 1617, 1617, 1351, 1478,  483, 1617, 1478,  506,  144,
 /*   790 */  1722, 1723, 1606, 1727, 1569,  559, 1675, 1450,  554,   79,
 /*   800 */  1647,  505, 1649, 1650,  501, 1646,  522,  423,  570, 1715,
 /*   810 */  1617, 1617, 1617,  273, 1711, 1560, 1561,  553,  552, 1397,
 /*   820 */   551,  550,  549, 1734, 1280, 1777, 1280,  558,  179, 1392,
 /*   830 */   422,  177, 1617, 1662, 1144, 1145,  199,  324,  147, 1465,
 /*   840 */   503,  434, 1774,  181,  129, 1390,  180, 1461,  337,  252,
 /*   850 */   502,  436,  183,  185, 1617,  182,  184,  118, 1211,   45,
 /*   860 */   483,  250,   52,   46,  272,   51, 1646,  439,  202,   11,
 /*   870 */    10, 1675, 1343, 1344,   79, 1647,  505, 1649, 1650,  501,
 /*   880 */   438,  522,  159,   37, 1715,   37,  191,   37,  273, 1711,
 /*   890 */   225,  497,   75,  116, 1662,  446,  547,  457,  454, 1306,
 /*   900 */  1777,  482,   71, 1361,  117, 1168,   54,  488,  204,  187,
 /*   910 */  1436,  502,  118,  145, 1167, 1617, 1453, 1774,  218, 1646,
 /*   920 */    45,  441,  491, 1255,  209, 1217,  435, 1115,  466, 1663,
 /*   930 */   227,  186, 1675,  511,  448,   80, 1647,  505, 1649, 1650,
 /*   940 */   501,  527,  522,   78,  233, 1715,  117, 1662, 1381,  294,
 /*   950 */  1711,  141, 1022,  416,  503,   50, 1518,  480,   49, 1745,
 /*   960 */   245,  217,  220,  215,  502,  118,    3, 1181, 1617,  461,
 /*   970 */  1742, 1171, 1646,  119,   57,   56,  346,  222,  117,  153,
 /*   980 */  1170, 1050,  319,  323,  340, 1675, 1054,  964,  263, 1647,
 /*   990 */   505, 1649, 1650,  501,  279,  522,  269,  991,  280,  330,
 /*  1000 */  1662,  326,  322,  150,  965, 1061,  241,  482,  554, 1128,
 /*  1010 */   360,  155, 1558, 1059,  367,  374,  375,  502,  120,  376,
 /*  1020 */   380, 1617, 1187,  381,  389, 1190,  475,  553,  552,  392,
 /*  1030 */   551,  550,  549,  393,  148,  162,  164, 1189, 1675, 1349,
 /*  1040 */   394,   80, 1647,  505, 1649, 1650,  501, 1646,  522,  166,
 /*  1050 */   395, 1715, 1188,  396,  169,  294, 1711,  141,   60,  399,
 /*  1060 */    94,  172,  420,   93,   92,   91,   90,   89,   88,   87,
 /*  1070 */    86,   85, 1468,  418,  288, 1662, 1743, 1165,  176, 1464,
 /*  1080 */  1646,   84,  503,  178,  122, 1601,  123,  242,  189, 1466,
 /*  1090 */  1462,  124,  502,  125,  449, 1186, 1617,  450,  192,  453,
 /*  1100 */  1746,  243,  194,  467,  458,  197, 1756,  509, 1662,    6,
 /*  1110 */   459, 1755,  476, 1675, 1736,  503,   80, 1647,  505, 1649,
 /*  1120 */  1650,  501,  464,  522,  293,  502, 1715,  200,  470, 1617,
 /*  1130 */   294, 1711, 1790,  463,  203,    5,  208, 1280,  135,  210,
 /*  1140 */   111, 1749, 1646, 1185,   40,  492, 1675,  295, 1730,   80,
 /*  1150 */  1647,  505, 1649, 1650,  501,  216,  522, 1567,  489, 1715,
 /*  1160 */    18, 1566,  211,  294, 1711, 1790,  512,  229,  507,  244,
 /*  1170 */  1662,  508,  303,  513, 1772,  514,   70,  503,  231, 1696,
 /*  1180 */    68,  525, 1793, 1479,  247, 1451,  238,  502,  600, 1611,
 /*  1190 */   290, 1617,   47, 1773,  249,  134, 1646,  253,  251, 1610,
 /*  1200 */   486,  219,  260,  318,  221, 1646,  254, 1607, 1675,  493,
 /*  1210 */   320,   80, 1647,  505, 1649, 1650,  501,  321,  522, 1153,
 /*  1220 */  1154, 1715,  151,  325, 1662,  294, 1711, 1790, 1605,  327,
 /*  1230 */   328,  503, 1604, 1662,  329,  331, 1733, 1603,  333, 1602,
 /*  1240 */   503,  502,  335, 1587,  152, 1617,  338,  339, 1131, 1130,
 /*  1250 */   502, 1581, 1580,  344, 1617, 1579,  345, 1578, 1098, 1646,
 /*  1260 */   483, 1551, 1675, 1550, 1549,  132, 1647,  505, 1649, 1650,
 /*  1270 */   501, 1675,  522, 1548,  259, 1647,  505, 1649, 1650,  501,
 /*  1280 */  1547,  522, 1546, 1545, 1544, 1543, 1542, 1662, 1541, 1540,
 /*  1290 */  1539, 1538, 1537, 1536,  503, 1535, 1534, 1533,  115, 1646,
 /*  1300 */  1777, 1532, 1531, 1530,  502, 1529, 1528, 1527, 1617, 1100,
 /*  1310 */  1792, 1526, 1525,  145, 1524, 1409, 1377, 1774, 1646,  160,
 /*  1320 */  1376,  385,  138,  401,  930, 1675, 1595, 1662,   81, 1647,
 /*  1330 */   505, 1649, 1650,  501,  503,  522,  106,  929, 1715,  405,
 /*  1340 */  1402,  107, 1714, 1711,  502, 1589, 1662, 1573, 1617, 1564,
 /*  1350 */  1457,  161,  387,  500,  168, 1408, 1406,  958,  402, 1404,
 /*  1360 */  1400,  406,  410,  502,  414, 1675,  400, 1617,   81, 1647,
 /*  1370 */   505, 1649, 1650,  501, 1646,  522,  404,  408, 1715,  409,
 /*  1380 */   412,  413,  494, 1711, 1675, 1389, 1388,  267, 1647,  505,
 /*  1390 */  1649, 1650,  501,  499,  522,  496, 1687, 1375, 1459, 1065,
 /*  1400 */  1064, 1458, 1662,  604,  990,  989,  568,   83,  988,  503,
 /*  1410 */   987,  570, 1398,  984,  983,  175,  285,  240,  982,  502,
 /*  1420 */   437,  286, 1391, 1617, 1393,  287,  440, 1374,  442,  105,
 /*  1430 */  1373,  444, 1594, 1646,   82,  593,  589,  585,  581,  239,
 /*  1440 */  1675, 1588, 1138,   81, 1647,  505, 1649, 1650,  501, 1572,
 /*  1450 */   522,  451, 1571, 1715, 1563,   64,  196,    4, 1712,   37,
 /*  1460 */    15, 1662,  201,   77,   43,  207,  234,   48,  503, 1305,
 /*  1470 */   133,  205,   22,   41, 1298,  206,  452,  193,  502, 1637,
 /*  1480 */    65,  198, 1617,   23,   16,  298, 1277, 1646, 1276,  213,
 /*  1490 */   136,  308,  307,  126,   42, 1329, 1334,   17, 1323, 1675,
 /*  1500 */   515, 1173,  268, 1647,  505, 1649, 1650,  501, 1328,  522,
 /*  1510 */   296, 1333,   13, 1332,  297, 1662,   10, 1646,   19, 1219,
 /*  1520 */  1240, 1218,  500,   29,  137,  460, 1166,   12,  195,  149,
 /*  1530 */    20, 1204,  502,  504, 1562,   21, 1617,  230,  224, 1303,
 /*  1540 */   226,   71,  228, 1165, 1175, 1662, 1136,  510,  190,   66,
 /*  1550 */  1646,  232,  503, 1675,   67, 1636,  267, 1647,  505, 1649,
 /*  1560 */  1650,  501,  502,  522,  235, 1688, 1617, 1678,  521,  300,
 /*  1570 */  1221,   44,  524, 1051,  526,  310,  528,  530, 1662, 1048,
 /*  1580 */  1646,  523,  531, 1675, 1045,  503,  268, 1647,  505, 1649,
 /*  1590 */  1650,  501, 1169,  522,  533,  502, 1039,  534,  536, 1617,
 /*  1600 */  1037,  537,  302,  539,  540, 1028, 1060, 1058, 1662, 1043,
 /*  1610 */  1646, 1042,  479,   72, 1041,  503, 1675, 1040,  546,  268,
 /*  1620 */  1647,  505, 1649, 1650,  501,  502,  522, 1057,   73, 1617,
 /*  1630 */    74, 1056,  956,  555,  997, 1174,  557,  237, 1662,  978,
 /*  1640 */   112,  977,  976,  973,  975,  503, 1675,  974,  972,  255,
 /*  1650 */  1647,  505, 1649, 1650,  501,  502,  522, 1177,  971, 1617,
 /*  1660 */   483, 1646,  994,  992,  968,  967,  966,  963,  520, 1224,
 /*  1670 */  1225,  962,  961, 1405,  578,  579, 1675, 1646,  110,  262,
 /*  1680 */  1647,  505, 1649, 1650,  501,  580,  522, 1403,  582, 1662,
 /*  1690 */   583,  584, 1401,  212, 1722,  478,  503,  477,  586,  588,
 /*  1700 */  1777, 1399,  587,  591,  592, 1662,  502,  590, 1387,  595,
 /*  1710 */  1617,  594,  503,  145, 1386, 1372,  598, 1774,  599, 1347,
 /*  1720 */  1161,  248,  502,  602, 1646,  603, 1617, 1675, 1347, 1347,
 /*  1730 */   264, 1647,  505, 1649, 1650,  501, 1347,  522, 1347, 1347,
 /*  1740 */  1347, 1347, 1646, 1675, 1347, 1347,  256, 1647,  505, 1649,
 /*  1750 */  1650,  501, 1662,  522, 1347, 1347, 1347, 1646, 1347,  503,
 /*  1760 */  1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347,  502,
 /*  1770 */  1662, 1347, 1347, 1617, 1347, 1347, 1347,  503, 1347, 1347,
 /*  1780 */  1347, 1347, 1347, 1347, 1347, 1662, 1347,  502, 1347, 1347,
 /*  1790 */  1675, 1617,  503,  265, 1647,  505, 1649, 1650,  501, 1347,
 /*  1800 */   522, 1347,  502, 1347, 1646, 1347, 1617, 1347, 1675, 1347,
 /*  1810 */  1347,  257, 1647,  505, 1649, 1650,  501, 1347,  522, 1347,
 /*  1820 */  1646, 1347, 1347, 1675, 1347, 1347,  266, 1647,  505, 1649,
 /*  1830 */  1650,  501, 1662,  522, 1347, 1347, 1347, 1347, 1347,  503,
 /*  1840 */  1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1662,  502,
 /*  1850 */  1347, 1347, 1347, 1617, 1347,  503, 1347, 1347, 1347, 1347,
 /*  1860 */  1347, 1347, 1347, 1347, 1347,  502, 1347, 1646, 1347, 1617,
 /*  1870 */  1675, 1347, 1347,  258, 1647,  505, 1649, 1650,  501, 1347,
 /*  1880 */   522, 1347, 1347, 1347, 1347, 1347, 1675, 1347, 1347, 1658,
 /*  1890 */  1647,  505, 1649, 1650,  501, 1662,  522, 1646, 1347, 1347,
 /*  1900 */  1347, 1347,  503, 1347, 1347, 1347, 1347, 1347, 1347, 1347,
 /*  1910 */  1347, 1347,  502, 1347, 1347, 1347, 1617, 1347, 1347, 1347,
 /*  1920 */  1347, 1347, 1347, 1347, 1347, 1662, 1347, 1347, 1347, 1347,
 /*  1930 */  1347, 1347,  503, 1675, 1347, 1347, 1657, 1647,  505, 1649,
 /*  1940 */  1650,  501,  502,  522, 1347, 1347, 1617, 1646, 1347, 1347,
 /*  1950 */  1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347,
 /*  1960 */  1347, 1347, 1347, 1675, 1347, 1347, 1656, 1647,  505, 1649,
 /*  1970 */  1650,  501, 1347,  522, 1347, 1662, 1347, 1646, 1347, 1347,
 /*  1980 */  1347, 1347,  503, 1347, 1347, 1347, 1347, 1347, 1347, 1347,
 /*  1990 */  1347, 1347,  502, 1347, 1347, 1347, 1617, 1347, 1347, 1347,
 /*  2000 */  1347, 1347, 1347, 1347, 1347, 1662, 1347, 1347, 1347, 1347,
 /*  2010 */  1347, 1347,  503, 1675, 1347, 1347,  277, 1647,  505, 1649,
 /*  2020 */  1650,  501,  502,  522, 1347, 1347, 1617, 1646, 1347, 1347,
 /*  2030 */  1347, 1347, 1347, 1347, 1347, 1347, 1646, 1347, 1347, 1347,
 /*  2040 */  1347, 1347, 1347, 1675, 1347, 1347,  276, 1647,  505, 1649,
 /*  2050 */  1650,  501, 1347,  522, 1347, 1662, 1347, 1347, 1347, 1347,
 /*  2060 */  1347, 1347,  503, 1347, 1662, 1347, 1347, 1347, 1347, 1347,
 /*  2070 */  1347,  503,  502, 1347, 1347, 1347, 1617, 1347, 1347, 1347,
 /*  2080 */  1347,  502, 1347, 1347, 1347, 1617, 1347, 1347, 1347, 1347,
 /*  2090 */  1646, 1347, 1347, 1675, 1347, 1347,  278, 1647,  505, 1649,
 /*  2100 */  1650,  501, 1675,  522, 1347,  275, 1647,  505, 1649, 1650,
 /*  2110 */   501, 1347,  522, 1347, 1347, 1347, 1347, 1347, 1662, 1347,
 /*  2120 */  1347, 1347, 1347, 1347, 1347,  503, 1347, 1347, 1347, 1347,
 /*  2130 */  1347, 1347, 1347, 1347, 1347,  502, 1347, 1347, 1347, 1617,
 /*  2140 */  1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347,
 /*  2150 */  1347, 1347, 1347, 1347, 1347, 1347, 1675, 1347, 1347,  261,
 /*  2160 */  1647,  505, 1649, 1650,  501, 1347,  522,
433 434
};
static const YYCODETYPE yy_lookahead[] = {
435 436 437 438 439 440 441
 /*     0 */   244,  251,  246,  247,  244,  248,  246,  247,  290,  321,
 /*    10 */   322,  270,   12,   13,  264,  270,  296,  260,  241,  336,
 /*    20 */    20,  271,   22,  305,  306,  307,   12,   13,   14,   15,
 /*    30 */    16,  308,  349,  276,   21,  317,  353,   24,   25,   26,
 /*    40 */    27,   28,   29,   30,   31,   32,  269,   47,  269,  273,
 /*    50 */    14,   15,   16,  276,  275,  332,  336,  248,   58,  280,
 /*    60 */    12,   13,   14,  286,   64,   20,  290,  290,   20,  349,
X
Xiaoyu Wang 已提交
442
 /*    70 */    22,  248,   58,  353,   57,   12,   13,   14,   15,   16,
443 444
 /*    80 */    80,  305,  306,  307,  307,  276,    2,  310,  311,  312,
 /*    90 */   313,  314,  315,  317,  317,   47,   12,   13,   14,   15,
X
Xiaoyu Wang 已提交
445 446 447 448 449 450 451
 /*   100 */    16,  253,  102,   89,  281,  296,   58,  248,   12,   13,
 /*   110 */   249,  250,   64,  113,  266,   20,   20,  261,   22,  260,
 /*   120 */    20,   58,  274,  314,   22,  269,  267,  240,   80,  242,
 /*   130 */    80,  354,  355,  277,  336,  276,  248,  251,  329,  330,
 /*   140 */   331,    0,  333,   47,   81,  336,  336,  349,  260,   47,
 /*   150 */   102,  353,   89,  139,   58,  267,  156,  271,  349,  349,
 /*   160 */    64,  113,  353,  353,  276,   24,   25,   26,   27,   28,
452
 /*   170 */    29,   30,   31,   32,  160,   80,   80,   92,  178,  179,
X
Xiaoyu Wang 已提交
453
 /*   180 */    80,  181,  182,  183,  184,  185,  186,  187,  188,  189,
454
 /*   190 */   190,  191,  192,  193,  194,  195,  111,  112,  102,  114,
X
Xiaoyu Wang 已提交
455
 /*   200 */   115,  116,  139,   58,  156,  155,  178,  157,  208,  113,
456
 /*   210 */   196,  197,  198,  199,  200,  201,  202,  203,  204,  205,
X
Xiaoyu Wang 已提交
457
 /*   220 */   254,   20,  286,  160,  258,  289,  178,  179,  292,  181,
458 459
 /*   230 */   182,  183,  184,  185,  186,  187,  188,  189,  190,  191,
 /*   240 */   192,  193,  194,  195,    0,  217,  218,  219,  220,  221,
X
Xiaoyu Wang 已提交
460 461
 /*   250 */     4,   80,  156,   12,   13,   14,   15,   16,  208,  196,
 /*   260 */   197,  198,  199,  200,  201,  202,  203,  204,  205,  165,
462
 /*   270 */   166,  248,    4,  169,  178,  179,  238,  181,  182,  183,
463 464
 /*   280 */   184,  185,  186,  187,  188,  189,  190,  191,  192,  193,
 /*   290 */   194,  195,   12,   13,   12,   13,   14,   15,   16,  276,
X
Xiaoyu Wang 已提交
465
 /*   300 */    20,    0,   22,  208,   60,   61,   62,   63,  208,   65,
466
 /*   310 */    66,   67,   68,   69,   70,   71,   72,   73,   74,   75,
X
Xiaoyu Wang 已提交
467 468 469 470
 /*   320 */    76,   77,   81,  178,  269,  278,   80,   47,   47,  269,
 /*   330 */   275,  241,  285,  286,  296,  280,  276,  314,  268,  261,
 /*   340 */    12,   13,   14,   20,   64,   64,    4,  269,   20,  279,
 /*   350 */    22,  328,  329,  330,  331,  277,  333,    2,   57,  269,
471
 /*   360 */    80,   12,   13,   14,   15,   16,  276,   12,   13,   14,
X
Xiaoyu Wang 已提交
472
 /*   370 */    15,   16,  312,  143,  336,   47,  286,    0,  261,  208,
473 474
 /*   380 */   290,   57,  102,  293,   42,   43,  269,  349,   12,   13,
 /*   390 */   151,  353,   64,  113,  277,   20,   20,  307,   22,    3,
475 476 477
 /*   400 */   310,  311,  312,  313,  314,  315,  245,  317,   80,  248,
 /*   410 */   171,  172,   93,   94,   95,   96,   97,   98,   99,  100,
 /*   420 */   101,  102,  103,   47,  105,  106,  107,  108,  109,  110,
478 479 480
 /*   430 */   102,   12,   13,   14,   15,   16,  156,   60,   61,   91,
 /*   440 */    64,  113,   65,  213,  214,   68,   69,    0,  248,   72,
 /*   450 */    73,   74,   20,  241,  208,   80,   80,  308,  178,  179,
481
 /*   460 */   260,  181,  182,  183,  184,  185,  186,  187,  188,  189,
482 483 484 485
 /*   470 */   190,  191,  192,  193,  194,  195,  276,  209,  102,   14,
 /*   480 */    14,  332,   60,   61,  156,   20,   20,   65,  208,  113,
 /*   490 */    68,   69,  269,  296,   72,   73,   74,  148,  275,   44,
 /*   500 */    81,   22,  290,  280,   57,  248,  178,  179,  273,  181,
486
 /*   510 */   182,  183,  184,  185,  186,  187,  188,  189,  190,  191,
487 488 489 490
 /*   520 */   192,  193,  194,  195,   55,  290,   47,   12,   13,   14,
 /*   530 */    15,   16,  156,  336,  245,   80,  269,  248,   14,  241,
 /*   540 */   305,  306,  307,   64,   20,   75,  349,  280,   79,  241,
 /*   550 */   353,   82,  317,  296,  178,  179,  241,  181,  182,  183,
491
 /*   560 */   184,  185,  186,  187,  188,  189,  190,  191,  192,  193,
X
Xiaoyu Wang 已提交
492
 /*   570 */   194,  195,   12,   13,   18,  248,   20,  145,  229,  253,
493 494 495
 /*   580 */    20,  102,   22,   27,  269,  248,   30,  260,  290,  119,
 /*   590 */   120,  276,  113,  336,  269,  241,   33,  260,  290,  308,
 /*   600 */   274,  286,  277,  276,   48,  290,  349,   47,   45,  248,
X
Xiaoyu Wang 已提交
496
 /*   610 */   353,  296,  241,  276,   51,   52,   53,   54,   55,   35,
497 498 499 500
 /*   620 */   224,  260,  307,  332,   64,  310,  311,  312,  313,  314,
 /*   630 */   315,  248,  317,   79,   20,  156,   22,  276,  248,   21,
 /*   640 */    80,   87,   79,  260,  290,   82,  241,  182,  182,    1,
 /*   650 */     2,  336,   34,  241,  255,  256,   37,  178,  179,  276,
X
Xiaoyu Wang 已提交
501
 /*   660 */   145,  290,  102,   49,  349,  241,  276,   83,  353,   85,
502
 /*   670 */    86,   20,   88,  113,  118,  241,   92,  121,  122,  123,
503
 /*   680 */   124,  125,  126,  127,  128,  129,  130,  131,  132,  133,
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 547 548 549 550 551 552 553 554 555 556
 /*   690 */   134,  135,  136,  137,  138,  290,   20,  248,  248,  115,
 /*   700 */   248,  147,  290,  140,  314,  142,    0,  144,  248,  260,
 /*   710 */   260,   20,  260,  139,  290,  241,  156,  241,  241,  329,
 /*   720 */   330,  331,   41,  333,  290,  276,  276,  164,  276,   81,
 /*   730 */   241,  241,  241,  241,  160,   41,  276,  241,  178,  179,
 /*   740 */    20,  181,  182,  183,  184,  185,  186,  187,  188,  189,
 /*   750 */   190,  191,  192,  193,  194,  195,  248,  262,  269,  248,
 /*   760 */   265,  241,  241,  241,  290,  276,  290,  290,  260,  276,
 /*   770 */   196,  260,  255,  256,  314,  286,  283,   42,   43,  290,
 /*   780 */   290,  290,  290,  241,  276,  296,  290,  276,  286,  329,
 /*   790 */   330,  331,    0,  333,  292,  257,  307,  259,   92,  310,
 /*   800 */   311,  312,  313,  314,  315,  241,  317,   92,   41,  320,
 /*   810 */   290,  290,  290,  324,  325,  285,  286,  111,  112,    0,
 /*   820 */   114,  115,  116,  206,  207,  336,  207,   64,   84,    0,
 /*   830 */   115,   87,  290,  269,  167,  168,  145,   45,  349,  270,
 /*   840 */   276,   22,  353,   84,   18,    0,   87,  270,   81,   23,
 /*   850 */   286,   22,   84,   84,  290,   87,   87,   41,  182,   41,
 /*   860 */   296,   35,   36,  145,  146,   39,  241,   22,   41,    1,
 /*   870 */     2,  307,  193,  194,  310,  311,  312,  313,  314,  315,
 /*   880 */     4,  317,   56,   41,  320,   41,  270,   41,  324,  325,
 /*   890 */    41,  270,   80,   41,  269,   19,  270,   81,  299,   81,
 /*   900 */   336,  276,   90,  242,   41,   47,   80,  226,   81,   33,
 /*   910 */   258,  286,   41,  349,   47,  290,    0,  353,  356,  241,
 /*   920 */    41,   45,  228,   81,  341,   81,   50,   81,  347,  269,
 /*   930 */    81,   55,  307,   81,  303,  310,  311,  312,  313,  314,
 /*   940 */   315,   41,  317,  117,   81,  320,   41,  269,  247,  324,
 /*   950 */   325,  326,   81,  249,  276,   79,  279,  334,   82,  309,
 /*   960 */    81,  350,  350,  338,  286,   41,  337,   20,  290,  344,
 /*   970 */   345,  113,  241,   41,  148,  149,  150,  350,   41,  153,
 /*   980 */   113,   81,  248,   45,  158,  307,   81,   47,  310,  311,
 /*   990 */   312,  313,  314,  315,  304,  317,  170,   47,  255,  173,
 /*  1000 */   269,  175,  176,  177,   64,   81,  297,  276,   92,  154,
 /*  1010 */   248,   40,  248,   81,  284,  282,  139,  286,   81,  282,
 /*  1020 */   248,  290,   20,  243,  243,   20,  348,  111,  112,  301,
 /*  1030 */   114,  115,  116,  286,  208,  253,  253,   20,  307,    0,
 /*  1040 */   294,  310,  311,  312,  313,  314,  315,  241,  317,  253,
 /*  1050 */   276,  320,   20,  287,  253,  324,  325,  326,  253,  248,
 /*  1060 */    21,  253,  269,   24,   25,   26,   27,   28,   29,   30,
 /*  1070 */    31,   32,  269,  243,  243,  269,  345,   64,  269,  269,
 /*  1080 */   241,  248,  276,  269,  269,  290,  269,  301,  251,  269,
 /*  1090 */   269,  269,  286,  269,  163,   20,  290,  300,  251,  286,
 /*  1100 */   309,  294,  251,  216,  276,  251,  346,  215,  269,  223,
 /*  1110 */   287,  346,  222,  307,  343,  276,  310,  311,  312,  313,
 /*  1120 */   314,  315,  290,  317,  290,  286,  320,  291,  290,  290,
 /*  1130 */   324,  325,  326,  211,  291,  210,  342,  207,  340,  339,
 /*  1140 */   276,  335,  241,   20,   40,  227,  307,  230,  308,  310,
 /*  1150 */   311,  312,  313,  314,  315,  351,  317,  291,  225,  320,
 /*  1160 */    80,  291,  327,  324,  325,  326,  142,  276,  290,  265,
 /*  1170 */   269,  290,  290,  288,  335,  287,   80,  276,  251,  323,
 /*  1180 */   251,  272,  357,  276,  248,  259,  251,  286,  243,    0,
 /*  1190 */   295,  290,  298,  352,  252,  302,  241,  263,  239,    0,
 /*  1200 */   352,  351,  263,   72,  351,  241,  263,    0,  307,  352,
 /*  1210 */    47,  310,  311,  312,  313,  314,  315,  174,  317,   47,
X
Xiaoyu Wang 已提交
557
 /*  1220 */    47,  320,   47,  174,  269,  324,  325,  326,    0,   47,
558 559 560
 /*  1230 */    47,  276,    0,  269,  174,   47,  335,    0,   47,    0,
 /*  1240 */   276,  286,   47,    0,   80,  290,  160,  159,  113,  156,
 /*  1250 */   286,    0,    0,  152,  290,    0,  151,    0,   44,  241,
X
Xiaoyu Wang 已提交
561 562 563
 /*  1260 */   296,    0,  307,    0,    0,  310,  311,  312,  313,  314,
 /*  1270 */   315,  307,  317,    0,  310,  311,  312,  313,  314,  315,
 /*  1280 */     0,  317,    0,    0,    0,    0,    0,  269,    0,    0,
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584
 /*  1290 */     0,    0,    0,    0,  276,    0,    0,    0,   40,  241,
 /*  1300 */   336,    0,    0,    0,  286,    0,    0,    0,  290,   22,
 /*  1310 */   355,    0,    0,  349,    0,    0,    0,  353,  241,   40,
 /*  1320 */     0,   44,   41,   45,   14,  307,    0,  269,  310,  311,
 /*  1330 */   312,  313,  314,  315,  276,  317,   37,   14,  320,   45,
 /*  1340 */     0,   37,  324,  325,  286,    0,  269,    0,  290,    0,
 /*  1350 */     0,   38,   44,  276,   37,    0,    0,   59,   37,    0,
 /*  1360 */     0,   37,   37,  286,   37,  307,   47,  290,  310,  311,
 /*  1370 */   312,  313,  314,  315,  241,  317,   47,   47,  320,   45,
 /*  1380 */    47,   45,  324,  325,  307,    0,    0,  310,  311,  312,
 /*  1390 */   313,  314,  315,  316,  317,  318,  319,    0,    0,   47,
 /*  1400 */    22,    0,  269,   19,   47,   47,   41,   89,   47,  276,
 /*  1410 */    47,   41,    0,   47,   47,   87,   22,   33,   47,  286,
 /*  1420 */    48,   22,    0,  290,    0,   22,   47,    0,   22,   45,
 /*  1430 */     0,   22,    0,  241,   20,   51,   52,   53,   54,   55,
 /*  1440 */   307,    0,   47,  310,  311,  312,  313,  314,  315,    0,
 /*  1450 */   317,   22,    0,  320,    0,   80,   37,   41,  325,   41,
 /*  1460 */   212,  269,   81,   79,   41,   44,   82,  145,  276,   81,
 /*  1470 */    80,   80,   80,  206,   81,   41,  145,  142,  286,   44,
 /*  1480 */    80,  140,  290,   41,  212,  293,   81,  241,   81,   44,
 /*  1490 */    44,   12,   13,  161,   41,   47,   81,   41,   81,  307,
X
Xiaoyu Wang 已提交
585
 /*  1500 */   116,   22,  310,  311,  312,  313,  314,  315,   47,  317,
586 587 588 589 590 591 592 593 594 595 596 597 598 599
 /*  1510 */    47,   47,  212,   47,   47,  269,    2,  241,   41,   81,
 /*  1520 */   178,   81,  276,   80,   44,  141,   47,   80,  144,   44,
 /*  1530 */    80,   22,  286,  180,    0,   80,  290,   37,   81,   81,
 /*  1540 */    80,   90,   80,   64,   22,  269,  162,  143,  164,   80,
 /*  1550 */   241,  140,  276,  307,   80,   44,  310,  311,  312,  313,
 /*  1560 */   314,  315,  286,  317,   44,  319,  290,   80,   80,  293,
 /*  1570 */    81,   80,   91,   81,   47,   47,   80,   47,  269,   81,
 /*  1580 */   241,  102,   80,  307,   81,  276,  310,  311,  312,  313,
 /*  1590 */   314,  315,  113,  317,   47,  286,   81,   80,   47,  290,
 /*  1600 */    81,   80,  293,   47,   80,   22,   47,  113,  269,  104,
 /*  1610 */   241,  104,  248,   80,  104,  276,  307,  104,   92,  310,
 /*  1620 */   311,  312,  313,  314,  315,  286,  317,   47,   80,  290,
 /*  1630 */    80,   22,   59,   58,   64,  156,   78,   41,  269,   47,
 /*  1640 */   276,   47,   47,   22,   47,  276,  307,   47,   47,  310,
X
Xiaoyu Wang 已提交
600
 /*  1650 */   311,  312,  313,  314,  315,  286,  317,  178,   47,  290,
601 602 603 604 605 606 607
 /*  1660 */   296,  241,   64,   47,   47,   47,   47,   47,  189,  190,
 /*  1670 */   191,   47,   47,    0,   47,   45,  307,  241,  314,  310,
 /*  1680 */   311,  312,  313,  314,  315,   37,  317,    0,   47,  269,
 /*  1690 */    45,   37,    0,  329,  330,  331,  276,  333,   47,   37,
 /*  1700 */   336,    0,   45,   45,   37,  269,  286,   47,    0,   46,
 /*  1710 */   290,   47,  276,  349,    0,    0,   22,  353,   21,  358,
 /*  1720 */    22,   22,  286,   21,  241,   20,  290,  307,  358,  358,
X
Xiaoyu Wang 已提交
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
 /*  1730 */   310,  311,  312,  313,  314,  315,  358,  317,  358,  358,
 /*  1740 */   358,  358,  241,  307,  358,  358,  310,  311,  312,  313,
 /*  1750 */   314,  315,  269,  317,  358,  358,  358,  241,  358,  276,
 /*  1760 */   358,  358,  358,  358,  358,  358,  358,  358,  358,  286,
 /*  1770 */   269,  358,  358,  290,  358,  358,  358,  276,  358,  358,
 /*  1780 */   358,  358,  358,  358,  358,  269,  358,  286,  358,  358,
 /*  1790 */   307,  290,  276,  310,  311,  312,  313,  314,  315,  358,
 /*  1800 */   317,  358,  286,  358,  241,  358,  290,  358,  307,  358,
 /*  1810 */   358,  310,  311,  312,  313,  314,  315,  358,  317,  358,
 /*  1820 */   241,  358,  358,  307,  358,  358,  310,  311,  312,  313,
 /*  1830 */   314,  315,  269,  317,  358,  358,  358,  358,  358,  276,
 /*  1840 */   358,  358,  358,  358,  358,  358,  358,  358,  269,  286,
 /*  1850 */   358,  358,  358,  290,  358,  276,  358,  358,  358,  358,
 /*  1860 */   358,  358,  358,  358,  358,  286,  358,  241,  358,  290,
 /*  1870 */   307,  358,  358,  310,  311,  312,  313,  314,  315,  358,
 /*  1880 */   317,  358,  358,  358,  358,  358,  307,  358,  358,  310,
 /*  1890 */   311,  312,  313,  314,  315,  269,  317,  241,  358,  358,
 /*  1900 */   358,  358,  276,  358,  358,  358,  358,  358,  358,  358,
 /*  1910 */   358,  358,  286,  358,  358,  358,  290,  358,  358,  358,
 /*  1920 */   358,  358,  358,  358,  358,  269,  358,  358,  358,  358,
 /*  1930 */   358,  358,  276,  307,  358,  358,  310,  311,  312,  313,
 /*  1940 */   314,  315,  286,  317,  358,  358,  290,  241,  358,  358,
 /*  1950 */   358,  358,  358,  358,  358,  358,  358,  358,  358,  358,
 /*  1960 */   358,  358,  358,  307,  358,  358,  310,  311,  312,  313,
 /*  1970 */   314,  315,  358,  317,  358,  269,  358,  241,  358,  358,
 /*  1980 */   358,  358,  276,  358,  358,  358,  358,  358,  358,  358,
 /*  1990 */   358,  358,  286,  358,  358,  358,  290,  358,  358,  358,
 /*  2000 */   358,  358,  358,  358,  358,  269,  358,  358,  358,  358,
 /*  2010 */   358,  358,  276,  307,  358,  358,  310,  311,  312,  313,
 /*  2020 */   314,  315,  286,  317,  358,  358,  290,  241,  358,  358,
 /*  2030 */   358,  358,  358,  358,  358,  358,  241,  358,  358,  358,
 /*  2040 */   358,  358,  358,  307,  358,  358,  310,  311,  312,  313,
 /*  2050 */   314,  315,  358,  317,  358,  269,  358,  358,  358,  358,
 /*  2060 */   358,  358,  276,  358,  269,  358,  358,  358,  358,  358,
 /*  2070 */   358,  276,  286,  358,  358,  358,  290,  358,  358,  358,
 /*  2080 */   358,  286,  358,  358,  358,  290,  358,  358,  358,  358,
 /*  2090 */   241,  358,  358,  307,  358,  358,  310,  311,  312,  313,
 /*  2100 */   314,  315,  307,  317,  358,  310,  311,  312,  313,  314,
 /*  2110 */   315,  358,  317,  358,  358,  358,  358,  358,  269,  358,
 /*  2120 */   358,  358,  358,  358,  358,  276,  358,  358,  358,  358,
 /*  2130 */   358,  358,  358,  358,  358,  286,  358,  358,  358,  290,
649
 /*  2140 */   358,  358,  358,  358,  358,  358,  358,  358,  358,  358,
X
Xiaoyu Wang 已提交
650 651
 /*  2150 */   358,  358,  358,  358,  358,  358,  307,  358,  358,  310,
 /*  2160 */   311,  312,  313,  314,  315,  358,  317,
652
};
653
#define YY_SHIFT_COUNT    (604)
654
#define YY_SHIFT_MIN      (0)
655
#define YY_SHIFT_MAX      (1715)
656
static const unsigned short int yy_shift_ofst[] = {
X
Xiaoyu Wang 已提交
657 658
 /*     0 */   826,    0,    0,   48,   96,   96,   96,   96,  280,  280,
 /*    10 */    96,   96,  328,  376,  560,  376,  376,  376,  376,  376,
659
 /*    20 */   376,  376,  376,  376,  376,  376,  376,  376,  376,  376,
X
Xiaoyu Wang 已提交
660 661 662
 /*    30 */   376,  376,  376,  376,  376,  376,  376,  376,   95,   95,
 /*    40 */   375,  375,  375, 1479, 1479, 1479,  100,   50,  171,   45,
 /*    50 */    45,  342,  342,  246,  171,  171,   45,   45,   45,   45,
663 664
 /*    60 */    45,   45,   17,   45,  201,  323,  651,  201,   45,   45,
 /*    70 */   201,   45,  201,  201,  651,  201,   45,  324,  556,   63,
X
Xiaoyu Wang 已提交
665
 /*    80 */    14,   14,   13,  479,  422,  479,  479,  479,  479,  479,
666
 /*    90 */   479,  479,  479,  479,  479,  479,  479,  479,  479,  479,
667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 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
 /*   100 */   479,  479,  479,  479,  584,  614,  524,  524,  301,  281,
 /*   110 */   432,  432,  432,  447,  281,  720,  651,  201,  201,  651,
 /*   120 */   348,  763,  319,  319,  319,  319,  319,  319,  319, 1384,
 /*   130 */  1039,  377,  349,   28,  104,  230,  465,  466,  735,  102,
 /*   140 */   715,  691,  617,  619,  617,  396,  396,  396,  268,  676,
 /*   150 */   947,  938,  950,  855,  947,  947,  971,  877,  877,  947,
 /*   160 */  1002, 1002, 1005,   17,  651,   17, 1017,   17,  720, 1032,
 /*   170 */    17,   17,  947,   17, 1002,  201,  201,  201,  201,  201,
 /*   180 */   201,  201,  201,  201,  201,  201,  947, 1002, 1013, 1005,
 /*   190 */   324,  931,  651,  324, 1017,  324,  720, 1032,  324, 1075,
 /*   200 */   887,  892, 1013,  887,  892, 1013, 1013,  201,  886,  890,
 /*   210 */   922,  925,  930,  720, 1123, 1104,  918,  933,  917,  918,
 /*   220 */   933,  918,  933, 1080,  892, 1013, 1013,  892, 1013, 1024,
 /*   230 */   720, 1032,  324,  348,  324,  720, 1096,  763,  947,  324,
 /*   240 */  1002, 2167, 2167, 2167, 2167, 2167, 2167, 2167, 2167,  244,
 /*   250 */   563,  141,  876,  706,  916,  241,   84,  355,  515,  419,
 /*   260 */    85,  282,  282,  282,  282,  282,  282,  282,  282,  239,
 /*   270 */   469,  470,  554,  648,  574,   36,   36,   36,   36,  792,
 /*   280 */   767,  744,  759,  768,  769,  819,  829,  845,  618,  667,
 /*   290 */   718,  816,  818,  827,  868,  679,  681,  694,  842,  145,
 /*   300 */   844,  455,  846,  849,  852,  863,  871,  858,  867,  879,
 /*   310 */   900,  905,  924,  932,  937,  812,  940, 1189, 1199, 1131,
 /*   320 */  1207, 1163, 1043, 1172, 1173, 1175, 1049, 1228, 1182, 1183,
 /*   330 */  1060, 1232, 1188, 1237, 1191, 1239, 1195, 1243, 1164, 1086,
 /*   340 */  1088, 1135, 1093, 1251, 1252, 1101, 1105, 1255, 1257, 1214,
 /*   350 */  1261, 1263, 1264, 1273, 1280, 1282, 1283, 1284, 1285, 1286,
 /*   360 */  1288, 1289, 1290, 1291, 1292, 1293, 1295, 1296, 1258, 1297,
 /*   370 */  1301, 1302, 1303, 1305, 1306, 1287, 1307, 1311, 1312, 1314,
 /*   380 */  1315, 1316, 1279, 1299, 1281, 1310, 1277, 1323, 1308, 1320,
 /*   390 */  1313, 1304, 1326, 1345, 1347, 1349, 1317, 1350, 1298, 1355,
 /*   400 */  1356, 1319, 1278, 1321, 1359, 1329, 1294, 1324, 1340, 1330,
 /*   410 */  1334, 1325, 1360, 1333, 1336, 1327, 1385, 1386, 1397, 1398,
 /*   420 */  1318, 1328, 1352, 1378, 1401, 1357, 1358, 1361, 1363, 1365,
 /*   430 */  1370, 1366, 1367, 1371, 1412, 1394, 1424, 1399, 1372, 1422,
 /*   440 */  1403, 1379, 1427, 1406, 1430, 1409, 1414, 1432, 1322, 1395,
 /*   450 */  1441, 1332, 1429, 1331, 1335, 1449, 1452, 1454, 1375, 1419,
 /*   460 */  1341, 1416, 1418, 1248, 1381, 1423, 1388, 1390, 1391, 1392,
 /*   470 */  1393, 1434, 1421, 1435, 1400, 1442, 1272, 1405, 1407, 1445,
 /*   480 */  1267, 1453, 1446, 1415, 1456, 1300, 1417, 1448, 1461, 1463,
 /*   490 */  1464, 1466, 1467, 1417, 1514, 1342, 1477, 1438, 1443, 1440,
 /*   500 */  1480, 1447, 1450, 1485, 1509, 1353, 1455, 1457, 1458, 1460,
 /*   510 */  1462, 1404, 1469, 1534, 1500, 1411, 1474, 1451, 1511, 1520,
 /*   520 */  1487, 1489, 1488, 1522, 1491, 1481, 1492, 1527, 1528, 1496,
 /*   530 */  1498, 1530, 1502, 1503, 1547, 1517, 1515, 1551, 1521, 1519,
 /*   540 */  1556, 1524, 1505, 1507, 1510, 1513, 1583, 1526, 1533, 1548,
 /*   550 */  1559, 1550, 1494, 1580, 1609, 1573, 1575, 1570, 1558, 1596,
 /*   560 */  1592, 1594, 1595, 1597, 1600, 1621, 1601, 1611, 1598, 1365,
 /*   570 */  1616, 1370, 1617, 1618, 1619, 1620, 1624, 1625, 1673, 1627,
 /*   580 */  1630, 1648, 1687, 1641, 1645, 1654, 1692, 1651, 1657, 1662,
 /*   590 */  1701, 1660, 1658, 1667, 1708, 1664, 1663, 1714, 1715, 1694,
 /*   600 */  1697, 1698, 1699, 1702, 1705,
718
};
719
#define YY_REDUCE_COUNT (248)
720
#define YY_REDUCE_MIN   (-317)
X
Xiaoyu Wang 已提交
721
#define YY_REDUCE_MAX   (1849)
722
static const short yy_reduce_ofst[] = {
X
Xiaoyu Wang 已提交
723 724 725 726 727 728 729 730
 /*     0 */    38,  489,  564,  625,  731,  806,  839,  901,  315,  964,
 /*    10 */  1018, 1058, 1077, -223, 1133,   90,  678,  955, 1192, 1246,
 /*    20 */  1276, 1309, 1339, 1369, 1420, 1436, 1483, 1501, 1516, 1563,
 /*    30 */  1579, 1626, 1656, 1706, 1736, 1786, 1795, 1849, -191, 1364,
 /*    40 */    23,  390,  460, -224,  235, -282,  257, -280,  197, -141,
 /*    50 */  -112, -244, -240, -317, -202, -190, -243,  200,  327,  361,
 /*    60 */   383,  449, -152,  450, -221,   60,  -64, -144,  337,  452,
 /*    70 */    55,  508,   78,  223,   47,  117,  511, -250, -177, -312,
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747
 /*    80 */  -312, -312, -113,  212,  -34,  298,  308,  354,  371,  405,
 /*    90 */   412,  424,  434,  474,  476,  477,  490,  491,  492,  496,
 /*   100 */   520,  521,  522,  542,   70, -139,  161,  289,  326,  399,
 /*   110 */  -277,  149,  291, -114,  517,  493,  502,  325,  267,  530,
 /*   120 */   495,  538, -259, -255,  569,  577,  616,  621,  626,  599,
 /*   130 */   661,  652,  562,  581,  631,  583,  660,  660,  701,  704,
 /*   140 */   677,  650,  623,  623,  623,  611,  612,  627,  629,  660,
 /*   150 */   734,  690,  743,  709,  762,  764,  730,  733,  737,  772,
 /*   160 */   780,  781,  728,  782,  747,  783,  746,  796,  774,  766,
 /*   170 */   801,  805,  811,  808,  830,  793,  803,  809,  810,  814,
 /*   180 */   815,  817,  820,  821,  822,  824,  833,  831,  795,  786,
 /*   190 */   837,  797,  813,  847,  807,  851,  828,  823,  854,  791,
 /*   200 */   760,  836,  832,  765,  843,  834,  838,  660,  771,  794,
 /*   210 */   798,  800,  623,  864,  840,  835,  841,  804,  825,  848,
 /*   220 */   850,  857,  853,  856,  866,  878,  881,  870,  882,  885,
 /*   230 */   891,  888,  927,  904,  929,  907,  909,  926,  936,  935,
 /*   240 */   945,  894,  893,  895,  934,  939,  943,  942,  959,
748 749
};
static const YYACTIONTYPE yy_default[] = {
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 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810
 /*     0 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*    10 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*    20 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*    30 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*    40 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*    50 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*    60 */  1345, 1345, 1414, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*    70 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1412, 1552, 1345,
 /*    80 */  1717, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*    90 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   100 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1414, 1345,
 /*   110 */  1728, 1728, 1728, 1412, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   120 */  1507, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1590,
 /*   130 */  1345, 1345, 1794, 1345, 1596, 1752, 1345, 1345, 1345, 1345,
 /*   140 */  1460, 1744, 1720, 1734, 1721, 1779, 1779, 1779, 1737, 1345,
 /*   150 */  1345, 1345, 1345, 1582, 1345, 1345, 1557, 1554, 1554, 1345,
 /*   160 */  1345, 1345, 1345, 1414, 1345, 1414, 1345, 1414, 1345, 1345,
 /*   170 */  1414, 1414, 1345, 1414, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   180 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   190 */  1412, 1592, 1345, 1412, 1345, 1412, 1345, 1345, 1412, 1345,
 /*   200 */  1759, 1757, 1345, 1759, 1757, 1345, 1345, 1345, 1771, 1767,
 /*   210 */  1750, 1748, 1734, 1345, 1345, 1345, 1785, 1781, 1797, 1785,
 /*   220 */  1781, 1785, 1781, 1345, 1757, 1345, 1345, 1757, 1345, 1565,
 /*   230 */  1345, 1345, 1412, 1345, 1412, 1345, 1476, 1345, 1345, 1412,
 /*   240 */  1345, 1584, 1598, 1574, 1510, 1510, 1510, 1415, 1350, 1345,
 /*   250 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   260 */  1472, 1661, 1770, 1769, 1693, 1692, 1691, 1689, 1660, 1345,
 /*   270 */  1345, 1345, 1345, 1345, 1345, 1654, 1655, 1653, 1652, 1345,
 /*   280 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   290 */  1345, 1345, 1345, 1345, 1718, 1345, 1782, 1786, 1345, 1345,
 /*   300 */  1345, 1638, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   310 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   320 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   330 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   340 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   350 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   360 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   370 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   380 */  1345, 1345, 1345, 1345, 1379, 1345, 1345, 1345, 1345, 1345,
 /*   390 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   400 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   410 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   420 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1441,
 /*   430 */  1440, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   440 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   450 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   460 */  1345, 1741, 1751, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   470 */  1345, 1345, 1345, 1638, 1345, 1768, 1345, 1727, 1723, 1345,
 /*   480 */  1345, 1719, 1345, 1345, 1780, 1345, 1345, 1345, 1345, 1345,
 /*   490 */  1345, 1345, 1345, 1345, 1713, 1345, 1686, 1345, 1345, 1345,
 /*   500 */  1345, 1345, 1345, 1345, 1345, 1648, 1345, 1345, 1345, 1345,
 /*   510 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1637, 1345,
 /*   520 */  1677, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1504,
 /*   530 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   540 */  1345, 1345, 1489, 1487, 1486, 1485, 1345, 1482, 1345, 1345,
 /*   550 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1434,
 /*   560 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1425,
 /*   570 */  1345, 1424, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   580 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   590 */  1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
 /*   600 */  1345, 1345, 1345, 1345, 1345,
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829
};
/********** 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[] = {
X
Xiaoyu Wang 已提交
830 831 832 833 834 835 836 837 838 839 840 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
    0,  /*          $ => nothing */
    0,  /*         OR => nothing */
    0,  /*        AND => nothing */
    0,  /*      UNION => nothing */
    0,  /*        ALL => nothing */
    0,  /*      MINUS => nothing */
    0,  /*     EXCEPT => nothing */
    0,  /*  INTERSECT => nothing */
    0,  /*  NK_BITAND => nothing */
    0,  /*   NK_BITOR => nothing */
    0,  /*  NK_LSHIFT => nothing */
    0,  /*  NK_RSHIFT => nothing */
    0,  /*    NK_PLUS => nothing */
    0,  /*   NK_MINUS => nothing */
    0,  /*    NK_STAR => nothing */
    0,  /*   NK_SLASH => nothing */
    0,  /*     NK_REM => nothing */
    0,  /*  NK_CONCAT => nothing */
    0,  /*     CREATE => nothing */
    0,  /*    ACCOUNT => nothing */
    0,  /*      NK_ID => nothing */
    0,  /*       PASS => nothing */
    0,  /*  NK_STRING => nothing */
    0,  /*      ALTER => nothing */
    0,  /*        PPS => nothing */
    0,  /*    TSERIES => nothing */
    0,  /*    STORAGE => nothing */
    0,  /*    STREAMS => nothing */
    0,  /*      QTIME => nothing */
    0,  /*        DBS => nothing */
    0,  /*      USERS => nothing */
    0,  /*      CONNS => nothing */
    0,  /*      STATE => nothing */
    0,  /*       USER => nothing */
    0,  /*  PRIVILEGE => nothing */
    0,  /*       DROP => nothing */
866 867 868 869 870 871 872 873 874
    0,  /*      GRANT => nothing */
    0,  /*         ON => nothing */
    0,  /*         TO => nothing */
    0,  /*     REVOKE => nothing */
    0,  /*       FROM => nothing */
    0,  /*   NK_COMMA => nothing */
    0,  /*       READ => nothing */
    0,  /*      WRITE => nothing */
    0,  /*     NK_DOT => nothing */
X
Xiaoyu Wang 已提交
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889
    0,  /*      DNODE => nothing */
    0,  /*       PORT => nothing */
    0,  /* NK_INTEGER => nothing */
    0,  /*     DNODES => nothing */
    0,  /* NK_IPTOKEN => nothing */
    0,  /*      LOCAL => nothing */
    0,  /*      QNODE => nothing */
    0,  /*      BNODE => nothing */
    0,  /*      SNODE => nothing */
    0,  /*      MNODE => nothing */
    0,  /*   DATABASE => nothing */
    0,  /*        USE => nothing */
    0,  /*         IF => nothing */
    0,  /*        NOT => nothing */
    0,  /*     EXISTS => nothing */
X
Xiaoyu Wang 已提交
890
    0,  /*     BUFFER => nothing */
X
Xiaoyu Wang 已提交
891 892 893 894 895 896 897 898
    0,  /*  CACHELAST => nothing */
    0,  /*       COMP => nothing */
    0,  /*       DAYS => nothing */
    0,  /* NK_VARIABLE => nothing */
    0,  /*      FSYNC => nothing */
    0,  /*    MAXROWS => nothing */
    0,  /*    MINROWS => nothing */
    0,  /*       KEEP => nothing */
X
Xiaoyu Wang 已提交
899 900
    0,  /*      PAGES => nothing */
    0,  /*   PAGESIZE => nothing */
X
Xiaoyu Wang 已提交
901 902
    0,  /*  PRECISION => nothing */
    0,  /*    REPLICA => nothing */
X
Xiaoyu Wang 已提交
903
    0,  /*     STRICT => nothing */
X
Xiaoyu Wang 已提交
904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940
    0,  /*        WAL => nothing */
    0,  /*    VGROUPS => nothing */
    0,  /* SINGLE_STABLE => nothing */
    0,  /* RETENTIONS => nothing */
    0,  /*   NK_COLON => nothing */
    0,  /*      TABLE => nothing */
    0,  /*      NK_LP => nothing */
    0,  /*      NK_RP => nothing */
    0,  /*     STABLE => nothing */
    0,  /*        ADD => nothing */
    0,  /*     COLUMN => nothing */
    0,  /*     MODIFY => nothing */
    0,  /*     RENAME => nothing */
    0,  /*        TAG => nothing */
    0,  /*        SET => nothing */
    0,  /*      NK_EQ => nothing */
    0,  /*      USING => nothing */
    0,  /*       TAGS => nothing */
    0,  /*    COMMENT => nothing */
    0,  /*       BOOL => nothing */
    0,  /*    TINYINT => nothing */
    0,  /*   SMALLINT => nothing */
    0,  /*        INT => nothing */
    0,  /*    INTEGER => nothing */
    0,  /*     BIGINT => nothing */
    0,  /*      FLOAT => nothing */
    0,  /*     DOUBLE => nothing */
    0,  /*     BINARY => nothing */
    0,  /*  TIMESTAMP => nothing */
    0,  /*      NCHAR => nothing */
    0,  /*   UNSIGNED => nothing */
    0,  /*       JSON => nothing */
    0,  /*    VARCHAR => nothing */
    0,  /* MEDIUMBLOB => nothing */
    0,  /*       BLOB => nothing */
    0,  /*  VARBINARY => nothing */
    0,  /*    DECIMAL => nothing */
X
Xiaoyu Wang 已提交
941
    0,  /*      DELAY => nothing */
X
Xiaoyu Wang 已提交
942 943
    0,  /* FILE_FACTOR => nothing */
    0,  /*   NK_FLOAT => nothing */
X
Xiaoyu Wang 已提交
944 945 946
    0,  /*     ROLLUP => nothing */
    0,  /*        TTL => nothing */
    0,  /*        SMA => nothing */
X
Xiaoyu Wang 已提交
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967
    0,  /*       SHOW => nothing */
    0,  /*  DATABASES => nothing */
    0,  /*     TABLES => nothing */
    0,  /*    STABLES => nothing */
    0,  /*     MNODES => nothing */
    0,  /*    MODULES => nothing */
    0,  /*     QNODES => nothing */
    0,  /*  FUNCTIONS => nothing */
    0,  /*    INDEXES => nothing */
    0,  /*   ACCOUNTS => nothing */
    0,  /*       APPS => nothing */
    0,  /* CONNECTIONS => nothing */
    0,  /*    LICENCE => nothing */
    0,  /*     GRANTS => nothing */
    0,  /*    QUERIES => nothing */
    0,  /*     SCORES => nothing */
    0,  /*     TOPICS => nothing */
    0,  /*  VARIABLES => nothing */
    0,  /*     BNODES => nothing */
    0,  /*     SNODES => nothing */
    0,  /*    CLUSTER => nothing */
968
    0,  /* TRANSACTIONS => nothing */
X
Xiaoyu Wang 已提交
969 970 971 972 973 974 975 976 977 978 979 980 981
    0,  /*       LIKE => nothing */
    0,  /*      INDEX => nothing */
    0,  /*   FULLTEXT => nothing */
    0,  /*   FUNCTION => nothing */
    0,  /*   INTERVAL => nothing */
    0,  /*      TOPIC => nothing */
    0,  /*         AS => nothing */
    0,  /*       WITH => nothing */
    0,  /*     SCHEMA => nothing */
    0,  /*       DESC => nothing */
    0,  /*   DESCRIBE => nothing */
    0,  /*      RESET => nothing */
    0,  /*      QUERY => nothing */
X
Xiaoyu Wang 已提交
982
    0,  /*      CACHE => nothing */
X
Xiaoyu Wang 已提交
983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001
    0,  /*    EXPLAIN => nothing */
    0,  /*    ANALYZE => nothing */
    0,  /*    VERBOSE => nothing */
    0,  /*    NK_BOOL => nothing */
    0,  /*      RATIO => nothing */
    0,  /*    COMPACT => nothing */
    0,  /*     VNODES => nothing */
    0,  /*         IN => nothing */
    0,  /* OUTPUTTYPE => nothing */
    0,  /*  AGGREGATE => nothing */
    0,  /*    BUFSIZE => nothing */
    0,  /*     STREAM => nothing */
    0,  /*       INTO => nothing */
    0,  /*    TRIGGER => nothing */
    0,  /*    AT_ONCE => nothing */
    0,  /* WINDOW_CLOSE => nothing */
    0,  /*  WATERMARK => nothing */
    0,  /*       KILL => nothing */
    0,  /* CONNECTION => nothing */
1002
    0,  /* TRANSACTION => nothing */
X
Xiaoyu Wang 已提交
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
    0,  /*      MERGE => nothing */
    0,  /*     VGROUP => nothing */
    0,  /* REDISTRIBUTE => nothing */
    0,  /*      SPLIT => nothing */
    0,  /*     SYNCDB => nothing */
    0,  /*       NULL => nothing */
    0,  /* NK_QUESTION => nothing */
    0,  /*   NK_ARROW => nothing */
    0,  /*      ROWTS => nothing */
    0,  /*     TBNAME => nothing */
    0,  /*   QSTARTTS => nothing */
    0,  /*     QENDTS => nothing */
    0,  /*   WSTARTTS => nothing */
    0,  /*     WENDTS => nothing */
    0,  /*  WDURATION => nothing */
    0,  /*       CAST => nothing */
    0,  /*        NOW => nothing */
    0,  /*      TODAY => nothing */
    0,  /*   TIMEZONE => nothing */
    0,  /*      COUNT => nothing */
    0,  /*      FIRST => nothing */
    0,  /*       LAST => nothing */
    0,  /*   LAST_ROW => nothing */
    0,  /*    BETWEEN => nothing */
    0,  /*         IS => nothing */
    0,  /*      NK_LT => nothing */
    0,  /*      NK_GT => nothing */
    0,  /*      NK_LE => nothing */
    0,  /*      NK_GE => nothing */
    0,  /*      NK_NE => nothing */
    0,  /*      MATCH => nothing */
    0,  /*     NMATCH => nothing */
    0,  /*   CONTAINS => nothing */
    0,  /*       JOIN => nothing */
    0,  /*      INNER => nothing */
    0,  /*     SELECT => nothing */
    0,  /*   DISTINCT => nothing */
    0,  /*      WHERE => nothing */
    0,  /*  PARTITION => nothing */
    0,  /*         BY => nothing */
    0,  /*    SESSION => nothing */
    0,  /* STATE_WINDOW => nothing */
    0,  /*    SLIDING => nothing */
    0,  /*       FILL => nothing */
    0,  /*      VALUE => nothing */
    0,  /*       NONE => nothing */
    0,  /*       PREV => nothing */
    0,  /*     LINEAR => nothing */
    0,  /*       NEXT => nothing */
    0,  /*      GROUP => nothing */
    0,  /*     HAVING => nothing */
    0,  /*      ORDER => nothing */
    0,  /*     SLIMIT => nothing */
    0,  /*    SOFFSET => nothing */
    0,  /*      LIMIT => nothing */
    0,  /*     OFFSET => nothing */
    0,  /*        ASC => nothing */
    0,  /*      NULLS => nothing */
    0,  /*         ID => nothing */
1062 1063 1064 1065 1066 1067
  231,  /*  NK_BITNOT => ID */
  231,  /*     INSERT => ID */
  231,  /*     VALUES => ID */
  231,  /*     IMPORT => ID */
  231,  /*    NK_SEMI => ID */
  231,  /*       FILE => ID */
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
};
#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 已提交
1106 1107
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142
#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 已提交
1143
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155
  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 */ "$",
1156 1157
  /*    1 */ "OR",
  /*    2 */ "AND",
1158 1159 1160 1161 1162
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
1163 1164 1165 1166 1167 1168 1169 1170 1171 1172
  /*    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",
1173
  /*   18 */ "CREATE",
1174 1175 1176
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188
  /*   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",
1189 1190
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
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 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 1401 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
  /*   36 */ "GRANT",
  /*   37 */ "ON",
  /*   38 */ "TO",
  /*   39 */ "REVOKE",
  /*   40 */ "FROM",
  /*   41 */ "NK_COMMA",
  /*   42 */ "READ",
  /*   43 */ "WRITE",
  /*   44 */ "NK_DOT",
  /*   45 */ "DNODE",
  /*   46 */ "PORT",
  /*   47 */ "NK_INTEGER",
  /*   48 */ "DNODES",
  /*   49 */ "NK_IPTOKEN",
  /*   50 */ "LOCAL",
  /*   51 */ "QNODE",
  /*   52 */ "BNODE",
  /*   53 */ "SNODE",
  /*   54 */ "MNODE",
  /*   55 */ "DATABASE",
  /*   56 */ "USE",
  /*   57 */ "IF",
  /*   58 */ "NOT",
  /*   59 */ "EXISTS",
  /*   60 */ "BUFFER",
  /*   61 */ "CACHELAST",
  /*   62 */ "COMP",
  /*   63 */ "DAYS",
  /*   64 */ "NK_VARIABLE",
  /*   65 */ "FSYNC",
  /*   66 */ "MAXROWS",
  /*   67 */ "MINROWS",
  /*   68 */ "KEEP",
  /*   69 */ "PAGES",
  /*   70 */ "PAGESIZE",
  /*   71 */ "PRECISION",
  /*   72 */ "REPLICA",
  /*   73 */ "STRICT",
  /*   74 */ "WAL",
  /*   75 */ "VGROUPS",
  /*   76 */ "SINGLE_STABLE",
  /*   77 */ "RETENTIONS",
  /*   78 */ "NK_COLON",
  /*   79 */ "TABLE",
  /*   80 */ "NK_LP",
  /*   81 */ "NK_RP",
  /*   82 */ "STABLE",
  /*   83 */ "ADD",
  /*   84 */ "COLUMN",
  /*   85 */ "MODIFY",
  /*   86 */ "RENAME",
  /*   87 */ "TAG",
  /*   88 */ "SET",
  /*   89 */ "NK_EQ",
  /*   90 */ "USING",
  /*   91 */ "TAGS",
  /*   92 */ "COMMENT",
  /*   93 */ "BOOL",
  /*   94 */ "TINYINT",
  /*   95 */ "SMALLINT",
  /*   96 */ "INT",
  /*   97 */ "INTEGER",
  /*   98 */ "BIGINT",
  /*   99 */ "FLOAT",
  /*  100 */ "DOUBLE",
  /*  101 */ "BINARY",
  /*  102 */ "TIMESTAMP",
  /*  103 */ "NCHAR",
  /*  104 */ "UNSIGNED",
  /*  105 */ "JSON",
  /*  106 */ "VARCHAR",
  /*  107 */ "MEDIUMBLOB",
  /*  108 */ "BLOB",
  /*  109 */ "VARBINARY",
  /*  110 */ "DECIMAL",
  /*  111 */ "DELAY",
  /*  112 */ "FILE_FACTOR",
  /*  113 */ "NK_FLOAT",
  /*  114 */ "ROLLUP",
  /*  115 */ "TTL",
  /*  116 */ "SMA",
  /*  117 */ "SHOW",
  /*  118 */ "DATABASES",
  /*  119 */ "TABLES",
  /*  120 */ "STABLES",
  /*  121 */ "MNODES",
  /*  122 */ "MODULES",
  /*  123 */ "QNODES",
  /*  124 */ "FUNCTIONS",
  /*  125 */ "INDEXES",
  /*  126 */ "ACCOUNTS",
  /*  127 */ "APPS",
  /*  128 */ "CONNECTIONS",
  /*  129 */ "LICENCE",
  /*  130 */ "GRANTS",
  /*  131 */ "QUERIES",
  /*  132 */ "SCORES",
  /*  133 */ "TOPICS",
  /*  134 */ "VARIABLES",
  /*  135 */ "BNODES",
  /*  136 */ "SNODES",
  /*  137 */ "CLUSTER",
  /*  138 */ "TRANSACTIONS",
  /*  139 */ "LIKE",
  /*  140 */ "INDEX",
  /*  141 */ "FULLTEXT",
  /*  142 */ "FUNCTION",
  /*  143 */ "INTERVAL",
  /*  144 */ "TOPIC",
  /*  145 */ "AS",
  /*  146 */ "WITH",
  /*  147 */ "SCHEMA",
  /*  148 */ "DESC",
  /*  149 */ "DESCRIBE",
  /*  150 */ "RESET",
  /*  151 */ "QUERY",
  /*  152 */ "CACHE",
  /*  153 */ "EXPLAIN",
  /*  154 */ "ANALYZE",
  /*  155 */ "VERBOSE",
  /*  156 */ "NK_BOOL",
  /*  157 */ "RATIO",
  /*  158 */ "COMPACT",
  /*  159 */ "VNODES",
  /*  160 */ "IN",
  /*  161 */ "OUTPUTTYPE",
  /*  162 */ "AGGREGATE",
  /*  163 */ "BUFSIZE",
  /*  164 */ "STREAM",
  /*  165 */ "INTO",
  /*  166 */ "TRIGGER",
  /*  167 */ "AT_ONCE",
  /*  168 */ "WINDOW_CLOSE",
  /*  169 */ "WATERMARK",
  /*  170 */ "KILL",
  /*  171 */ "CONNECTION",
  /*  172 */ "TRANSACTION",
  /*  173 */ "MERGE",
  /*  174 */ "VGROUP",
  /*  175 */ "REDISTRIBUTE",
  /*  176 */ "SPLIT",
  /*  177 */ "SYNCDB",
  /*  178 */ "NULL",
  /*  179 */ "NK_QUESTION",
  /*  180 */ "NK_ARROW",
  /*  181 */ "ROWTS",
  /*  182 */ "TBNAME",
  /*  183 */ "QSTARTTS",
  /*  184 */ "QENDTS",
  /*  185 */ "WSTARTTS",
  /*  186 */ "WENDTS",
  /*  187 */ "WDURATION",
  /*  188 */ "CAST",
  /*  189 */ "NOW",
  /*  190 */ "TODAY",
  /*  191 */ "TIMEZONE",
  /*  192 */ "COUNT",
  /*  193 */ "FIRST",
  /*  194 */ "LAST",
  /*  195 */ "LAST_ROW",
  /*  196 */ "BETWEEN",
  /*  197 */ "IS",
  /*  198 */ "NK_LT",
  /*  199 */ "NK_GT",
  /*  200 */ "NK_LE",
  /*  201 */ "NK_GE",
  /*  202 */ "NK_NE",
  /*  203 */ "MATCH",
  /*  204 */ "NMATCH",
  /*  205 */ "CONTAINS",
  /*  206 */ "JOIN",
  /*  207 */ "INNER",
  /*  208 */ "SELECT",
  /*  209 */ "DISTINCT",
  /*  210 */ "WHERE",
  /*  211 */ "PARTITION",
  /*  212 */ "BY",
  /*  213 */ "SESSION",
  /*  214 */ "STATE_WINDOW",
  /*  215 */ "SLIDING",
  /*  216 */ "FILL",
  /*  217 */ "VALUE",
  /*  218 */ "NONE",
  /*  219 */ "PREV",
  /*  220 */ "LINEAR",
  /*  221 */ "NEXT",
  /*  222 */ "GROUP",
  /*  223 */ "HAVING",
  /*  224 */ "ORDER",
  /*  225 */ "SLIMIT",
  /*  226 */ "SOFFSET",
  /*  227 */ "LIMIT",
  /*  228 */ "OFFSET",
  /*  229 */ "ASC",
  /*  230 */ "NULLS",
  /*  231 */ "ID",
  /*  232 */ "NK_BITNOT",
  /*  233 */ "INSERT",
  /*  234 */ "VALUES",
  /*  235 */ "IMPORT",
  /*  236 */ "NK_SEMI",
  /*  237 */ "FILE",
  /*  238 */ "cmd",
  /*  239 */ "account_options",
  /*  240 */ "alter_account_options",
  /*  241 */ "literal",
  /*  242 */ "alter_account_option",
  /*  243 */ "user_name",
  /*  244 */ "privileges",
  /*  245 */ "priv_level",
  /*  246 */ "priv_type_list",
  /*  247 */ "priv_type",
  /*  248 */ "db_name",
  /*  249 */ "dnode_endpoint",
  /*  250 */ "dnode_host_name",
  /*  251 */ "not_exists_opt",
  /*  252 */ "db_options",
  /*  253 */ "exists_opt",
  /*  254 */ "alter_db_options",
  /*  255 */ "integer_list",
  /*  256 */ "variable_list",
  /*  257 */ "retention_list",
  /*  258 */ "alter_db_option",
  /*  259 */ "retention",
  /*  260 */ "full_table_name",
  /*  261 */ "column_def_list",
  /*  262 */ "tags_def_opt",
  /*  263 */ "table_options",
  /*  264 */ "multi_create_clause",
  /*  265 */ "tags_def",
  /*  266 */ "multi_drop_clause",
  /*  267 */ "alter_table_clause",
  /*  268 */ "alter_table_options",
  /*  269 */ "column_name",
  /*  270 */ "type_name",
  /*  271 */ "create_subtable_clause",
  /*  272 */ "specific_tags_opt",
  /*  273 */ "literal_list",
  /*  274 */ "drop_table_clause",
  /*  275 */ "col_name_list",
  /*  276 */ "table_name",
  /*  277 */ "column_def",
  /*  278 */ "func_name_list",
  /*  279 */ "alter_table_option",
  /*  280 */ "col_name",
  /*  281 */ "db_name_cond_opt",
  /*  282 */ "like_pattern_opt",
  /*  283 */ "table_name_cond",
  /*  284 */ "from_db_opt",
  /*  285 */ "func_name",
  /*  286 */ "function_name",
  /*  287 */ "index_name",
  /*  288 */ "index_options",
  /*  289 */ "func_list",
  /*  290 */ "duration_literal",
  /*  291 */ "sliding_opt",
  /*  292 */ "func",
  /*  293 */ "expression_list",
  /*  294 */ "topic_name",
  /*  295 */ "topic_options",
  /*  296 */ "query_expression",
  /*  297 */ "analyze_opt",
  /*  298 */ "explain_options",
  /*  299 */ "agg_func_opt",
  /*  300 */ "bufsize_opt",
  /*  301 */ "stream_name",
  /*  302 */ "stream_options",
  /*  303 */ "into_opt",
  /*  304 */ "dnode_list",
  /*  305 */ "signed",
  /*  306 */ "signed_literal",
  /*  307 */ "literal_func",
  /*  308 */ "table_alias",
  /*  309 */ "column_alias",
  /*  310 */ "expression",
  /*  311 */ "pseudo_column",
  /*  312 */ "column_reference",
  /*  313 */ "function_expression",
  /*  314 */ "subquery",
  /*  315 */ "star_func",
  /*  316 */ "star_func_para_list",
  /*  317 */ "noarg_func",
  /*  318 */ "other_para_list",
  /*  319 */ "star_func_para",
  /*  320 */ "predicate",
  /*  321 */ "compare_op",
  /*  322 */ "in_op",
  /*  323 */ "in_predicate_value",
  /*  324 */ "boolean_value_expression",
  /*  325 */ "boolean_primary",
  /*  326 */ "common_expression",
  /*  327 */ "from_clause",
  /*  328 */ "table_reference_list",
  /*  329 */ "table_reference",
  /*  330 */ "table_primary",
  /*  331 */ "joined_table",
  /*  332 */ "alias_opt",
  /*  333 */ "parenthesized_joined_table",
  /*  334 */ "join_type",
  /*  335 */ "search_condition",
  /*  336 */ "query_specification",
  /*  337 */ "set_quantifier_opt",
  /*  338 */ "select_list",
  /*  339 */ "where_clause_opt",
  /*  340 */ "partition_by_clause_opt",
  /*  341 */ "twindow_clause_opt",
  /*  342 */ "group_by_clause_opt",
  /*  343 */ "having_clause_opt",
  /*  344 */ "select_sublist",
  /*  345 */ "select_item",
  /*  346 */ "fill_opt",
  /*  347 */ "fill_mode",
  /*  348 */ "group_by_list",
  /*  349 */ "query_expression_body",
  /*  350 */ "order_by_clause_opt",
  /*  351 */ "slimit_clause_opt",
  /*  352 */ "limit_clause_opt",
  /*  353 */ "query_primary",
  /*  354 */ "sort_specification_list",
  /*  355 */ "sort_specification",
  /*  356 */ "ordering_specification_opt",
  /*  357 */ "null_ordering_opt",
1513 1514 1515 1516 1517 1518 1519
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547
 /*   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",
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 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 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 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
 /*  28 */ "cmd ::= GRANT privileges ON priv_level TO user_name",
 /*  29 */ "cmd ::= REVOKE privileges ON priv_level FROM user_name",
 /*  30 */ "privileges ::= ALL",
 /*  31 */ "privileges ::= priv_type_list",
 /*  32 */ "priv_type_list ::= priv_type",
 /*  33 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type",
 /*  34 */ "priv_type ::= READ",
 /*  35 */ "priv_type ::= WRITE",
 /*  36 */ "priv_level ::= NK_STAR NK_DOT NK_STAR",
 /*  37 */ "priv_level ::= db_name NK_DOT NK_STAR",
 /*  38 */ "cmd ::= CREATE DNODE dnode_endpoint",
 /*  39 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER",
 /*  40 */ "cmd ::= DROP DNODE NK_INTEGER",
 /*  41 */ "cmd ::= DROP DNODE dnode_endpoint",
 /*  42 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
 /*  43 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
 /*  44 */ "cmd ::= ALTER ALL DNODES NK_STRING",
 /*  45 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
 /*  46 */ "dnode_endpoint ::= NK_STRING",
 /*  47 */ "dnode_host_name ::= NK_ID",
 /*  48 */ "dnode_host_name ::= NK_IPTOKEN",
 /*  49 */ "cmd ::= ALTER LOCAL NK_STRING",
 /*  50 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
 /*  51 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
 /*  52 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
 /*  53 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER",
 /*  54 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER",
 /*  55 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER",
 /*  56 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER",
 /*  57 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER",
 /*  58 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER",
 /*  59 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
 /*  60 */ "cmd ::= DROP DATABASE exists_opt db_name",
 /*  61 */ "cmd ::= USE db_name",
 /*  62 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
 /*  63 */ "not_exists_opt ::= IF NOT EXISTS",
 /*  64 */ "not_exists_opt ::=",
 /*  65 */ "exists_opt ::= IF EXISTS",
 /*  66 */ "exists_opt ::=",
 /*  67 */ "db_options ::=",
 /*  68 */ "db_options ::= db_options BUFFER NK_INTEGER",
 /*  69 */ "db_options ::= db_options CACHELAST NK_INTEGER",
 /*  70 */ "db_options ::= db_options COMP NK_INTEGER",
 /*  71 */ "db_options ::= db_options DAYS NK_INTEGER",
 /*  72 */ "db_options ::= db_options DAYS NK_VARIABLE",
 /*  73 */ "db_options ::= db_options FSYNC NK_INTEGER",
 /*  74 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  75 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  76 */ "db_options ::= db_options KEEP integer_list",
 /*  77 */ "db_options ::= db_options KEEP variable_list",
 /*  78 */ "db_options ::= db_options PAGES NK_INTEGER",
 /*  79 */ "db_options ::= db_options PAGESIZE NK_INTEGER",
 /*  80 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  81 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  82 */ "db_options ::= db_options STRICT NK_INTEGER",
 /*  83 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  84 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  85 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  86 */ "db_options ::= db_options RETENTIONS retention_list",
 /*  87 */ "alter_db_options ::= alter_db_option",
 /*  88 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  89 */ "alter_db_option ::= BUFFER NK_INTEGER",
 /*  90 */ "alter_db_option ::= CACHELAST NK_INTEGER",
 /*  91 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  92 */ "alter_db_option ::= KEEP integer_list",
 /*  93 */ "alter_db_option ::= KEEP variable_list",
 /*  94 */ "alter_db_option ::= PAGES NK_INTEGER",
 /*  95 */ "alter_db_option ::= REPLICA NK_INTEGER",
 /*  96 */ "alter_db_option ::= STRICT NK_INTEGER",
 /*  97 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  98 */ "integer_list ::= NK_INTEGER",
 /*  99 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
 /* 100 */ "variable_list ::= NK_VARIABLE",
 /* 101 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
 /* 102 */ "retention_list ::= retention",
 /* 103 */ "retention_list ::= retention_list NK_COMMA retention",
 /* 104 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
 /* 105 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /* 106 */ "cmd ::= CREATE TABLE multi_create_clause",
 /* 107 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /* 108 */ "cmd ::= DROP TABLE multi_drop_clause",
 /* 109 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /* 110 */ "cmd ::= ALTER TABLE alter_table_clause",
 /* 111 */ "cmd ::= ALTER STABLE alter_table_clause",
 /* 112 */ "alter_table_clause ::= full_table_name alter_table_options",
 /* 113 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /* 114 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /* 115 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /* 116 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /* 117 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /* 118 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /* 119 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /* 120 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /* 121 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /* 122 */ "multi_create_clause ::= create_subtable_clause",
 /* 123 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /* 124 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options",
 /* 125 */ "multi_drop_clause ::= drop_table_clause",
 /* 126 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 127 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 128 */ "specific_tags_opt ::=",
 /* 129 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 130 */ "full_table_name ::= table_name",
 /* 131 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 132 */ "column_def_list ::= column_def",
 /* 133 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 134 */ "column_def ::= column_name type_name",
 /* 135 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 136 */ "type_name ::= BOOL",
 /* 137 */ "type_name ::= TINYINT",
 /* 138 */ "type_name ::= SMALLINT",
 /* 139 */ "type_name ::= INT",
 /* 140 */ "type_name ::= INTEGER",
 /* 141 */ "type_name ::= BIGINT",
 /* 142 */ "type_name ::= FLOAT",
 /* 143 */ "type_name ::= DOUBLE",
 /* 144 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 145 */ "type_name ::= TIMESTAMP",
 /* 146 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 147 */ "type_name ::= TINYINT UNSIGNED",
 /* 148 */ "type_name ::= SMALLINT UNSIGNED",
 /* 149 */ "type_name ::= INT UNSIGNED",
 /* 150 */ "type_name ::= BIGINT UNSIGNED",
 /* 151 */ "type_name ::= JSON",
 /* 152 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 153 */ "type_name ::= MEDIUMBLOB",
 /* 154 */ "type_name ::= BLOB",
 /* 155 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 156 */ "type_name ::= DECIMAL",
 /* 157 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 158 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 159 */ "tags_def_opt ::=",
 /* 160 */ "tags_def_opt ::= tags_def",
 /* 161 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 162 */ "table_options ::=",
 /* 163 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 164 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 165 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 166 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 167 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 168 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 169 */ "alter_table_options ::= alter_table_option",
 /* 170 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 171 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 172 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 173 */ "col_name_list ::= col_name",
 /* 174 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 175 */ "col_name ::= column_name",
 /* 176 */ "cmd ::= SHOW DNODES",
 /* 177 */ "cmd ::= SHOW USERS",
 /* 178 */ "cmd ::= SHOW DATABASES",
 /* 179 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 180 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 181 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 182 */ "cmd ::= SHOW MNODES",
 /* 183 */ "cmd ::= SHOW MODULES",
 /* 184 */ "cmd ::= SHOW QNODES",
 /* 185 */ "cmd ::= SHOW FUNCTIONS",
 /* 186 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 187 */ "cmd ::= SHOW STREAMS",
 /* 188 */ "cmd ::= SHOW ACCOUNTS",
 /* 189 */ "cmd ::= SHOW APPS",
 /* 190 */ "cmd ::= SHOW CONNECTIONS",
 /* 191 */ "cmd ::= SHOW LICENCE",
 /* 192 */ "cmd ::= SHOW GRANTS",
 /* 193 */ "cmd ::= SHOW CREATE DATABASE db_name",
 /* 194 */ "cmd ::= SHOW CREATE TABLE full_table_name",
 /* 195 */ "cmd ::= SHOW CREATE STABLE full_table_name",
 /* 196 */ "cmd ::= SHOW QUERIES",
 /* 197 */ "cmd ::= SHOW SCORES",
 /* 198 */ "cmd ::= SHOW TOPICS",
 /* 199 */ "cmd ::= SHOW VARIABLES",
 /* 200 */ "cmd ::= SHOW BNODES",
 /* 201 */ "cmd ::= SHOW SNODES",
 /* 202 */ "cmd ::= SHOW CLUSTER",
 /* 203 */ "cmd ::= SHOW TRANSACTIONS",
 /* 204 */ "db_name_cond_opt ::=",
 /* 205 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 206 */ "like_pattern_opt ::=",
 /* 207 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 208 */ "table_name_cond ::= table_name",
 /* 209 */ "from_db_opt ::=",
 /* 210 */ "from_db_opt ::= FROM db_name",
 /* 211 */ "func_name_list ::= func_name",
 /* 212 */ "func_name_list ::= func_name_list NK_COMMA func_name",
 /* 213 */ "func_name ::= function_name",
 /* 214 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 215 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 216 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 217 */ "index_options ::=",
 /* 218 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 219 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 220 */ "func_list ::= func",
 /* 221 */ "func_list ::= func_list NK_COMMA func",
 /* 222 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 223 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS query_expression",
 /* 224 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS db_name",
 /* 225 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 226 */ "topic_options ::=",
 /* 227 */ "topic_options ::= topic_options WITH TABLE",
 /* 228 */ "topic_options ::= topic_options WITH SCHEMA",
 /* 229 */ "topic_options ::= topic_options WITH TAG",
 /* 230 */ "cmd ::= DESC full_table_name",
 /* 231 */ "cmd ::= DESCRIBE full_table_name",
 /* 232 */ "cmd ::= RESET QUERY CACHE",
 /* 233 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression",
 /* 234 */ "analyze_opt ::=",
 /* 235 */ "analyze_opt ::= ANALYZE",
 /* 236 */ "explain_options ::=",
 /* 237 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 238 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 239 */ "cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP",
 /* 240 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
 /* 241 */ "cmd ::= DROP FUNCTION exists_opt function_name",
 /* 242 */ "agg_func_opt ::=",
 /* 243 */ "agg_func_opt ::= AGGREGATE",
 /* 244 */ "bufsize_opt ::=",
 /* 245 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
 /* 246 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression",
 /* 247 */ "cmd ::= DROP STREAM exists_opt stream_name",
 /* 248 */ "into_opt ::=",
 /* 249 */ "into_opt ::= INTO full_table_name",
 /* 250 */ "stream_options ::=",
 /* 251 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
 /* 252 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
 /* 253 */ "stream_options ::= stream_options WATERMARK duration_literal",
 /* 254 */ "cmd ::= KILL CONNECTION NK_INTEGER",
 /* 255 */ "cmd ::= KILL QUERY NK_INTEGER",
 /* 256 */ "cmd ::= KILL TRANSACTION NK_INTEGER",
 /* 257 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
 /* 258 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
 /* 259 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
 /* 260 */ "dnode_list ::= DNODE NK_INTEGER",
 /* 261 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
 /* 262 */ "cmd ::= SYNCDB db_name REPLICA",
 /* 263 */ "cmd ::= query_expression",
 /* 264 */ "literal ::= NK_INTEGER",
 /* 265 */ "literal ::= NK_FLOAT",
 /* 266 */ "literal ::= NK_STRING",
 /* 267 */ "literal ::= NK_BOOL",
 /* 268 */ "literal ::= TIMESTAMP NK_STRING",
 /* 269 */ "literal ::= duration_literal",
 /* 270 */ "literal ::= NULL",
 /* 271 */ "literal ::= NK_QUESTION",
 /* 272 */ "duration_literal ::= NK_VARIABLE",
 /* 273 */ "signed ::= NK_INTEGER",
 /* 274 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 275 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 276 */ "signed ::= NK_FLOAT",
 /* 277 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 278 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 279 */ "signed_literal ::= signed",
 /* 280 */ "signed_literal ::= NK_STRING",
 /* 281 */ "signed_literal ::= NK_BOOL",
 /* 282 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 283 */ "signed_literal ::= duration_literal",
 /* 284 */ "signed_literal ::= NULL",
 /* 285 */ "signed_literal ::= literal_func",
 /* 286 */ "literal_list ::= signed_literal",
 /* 287 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 288 */ "db_name ::= NK_ID",
 /* 289 */ "table_name ::= NK_ID",
 /* 290 */ "column_name ::= NK_ID",
 /* 291 */ "function_name ::= NK_ID",
 /* 292 */ "table_alias ::= NK_ID",
 /* 293 */ "column_alias ::= NK_ID",
 /* 294 */ "user_name ::= NK_ID",
 /* 295 */ "index_name ::= NK_ID",
 /* 296 */ "topic_name ::= NK_ID",
 /* 297 */ "stream_name ::= NK_ID",
 /* 298 */ "expression ::= literal",
 /* 299 */ "expression ::= pseudo_column",
 /* 300 */ "expression ::= column_reference",
 /* 301 */ "expression ::= function_expression",
 /* 302 */ "expression ::= subquery",
 /* 303 */ "expression ::= NK_LP expression NK_RP",
 /* 304 */ "expression ::= NK_PLUS expression",
 /* 305 */ "expression ::= NK_MINUS expression",
 /* 306 */ "expression ::= expression NK_PLUS expression",
 /* 307 */ "expression ::= expression NK_MINUS expression",
 /* 308 */ "expression ::= expression NK_STAR expression",
 /* 309 */ "expression ::= expression NK_SLASH expression",
 /* 310 */ "expression ::= expression NK_REM expression",
 /* 311 */ "expression ::= column_reference NK_ARROW NK_STRING",
 /* 312 */ "expression_list ::= expression",
 /* 313 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 314 */ "column_reference ::= column_name",
 /* 315 */ "column_reference ::= table_name NK_DOT column_name",
 /* 316 */ "pseudo_column ::= ROWTS",
 /* 317 */ "pseudo_column ::= TBNAME",
1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 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 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971
 /* 318 */ "pseudo_column ::= table_name NK_DOT TBNAME",
 /* 319 */ "pseudo_column ::= QSTARTTS",
 /* 320 */ "pseudo_column ::= QENDTS",
 /* 321 */ "pseudo_column ::= WSTARTTS",
 /* 322 */ "pseudo_column ::= WENDTS",
 /* 323 */ "pseudo_column ::= WDURATION",
 /* 324 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
 /* 325 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
 /* 326 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP",
 /* 327 */ "function_expression ::= literal_func",
 /* 328 */ "literal_func ::= noarg_func NK_LP NK_RP",
 /* 329 */ "literal_func ::= NOW",
 /* 330 */ "noarg_func ::= NOW",
 /* 331 */ "noarg_func ::= TODAY",
 /* 332 */ "noarg_func ::= TIMEZONE",
 /* 333 */ "star_func ::= COUNT",
 /* 334 */ "star_func ::= FIRST",
 /* 335 */ "star_func ::= LAST",
 /* 336 */ "star_func ::= LAST_ROW",
 /* 337 */ "star_func_para_list ::= NK_STAR",
 /* 338 */ "star_func_para_list ::= other_para_list",
 /* 339 */ "other_para_list ::= star_func_para",
 /* 340 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
 /* 341 */ "star_func_para ::= expression",
 /* 342 */ "star_func_para ::= table_name NK_DOT NK_STAR",
 /* 343 */ "predicate ::= expression compare_op expression",
 /* 344 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 345 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 346 */ "predicate ::= expression IS NULL",
 /* 347 */ "predicate ::= expression IS NOT NULL",
 /* 348 */ "predicate ::= expression in_op in_predicate_value",
 /* 349 */ "compare_op ::= NK_LT",
 /* 350 */ "compare_op ::= NK_GT",
 /* 351 */ "compare_op ::= NK_LE",
 /* 352 */ "compare_op ::= NK_GE",
 /* 353 */ "compare_op ::= NK_NE",
 /* 354 */ "compare_op ::= NK_EQ",
 /* 355 */ "compare_op ::= LIKE",
 /* 356 */ "compare_op ::= NOT LIKE",
 /* 357 */ "compare_op ::= MATCH",
 /* 358 */ "compare_op ::= NMATCH",
 /* 359 */ "compare_op ::= CONTAINS",
 /* 360 */ "in_op ::= IN",
 /* 361 */ "in_op ::= NOT IN",
 /* 362 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 363 */ "boolean_value_expression ::= boolean_primary",
 /* 364 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 365 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 366 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 367 */ "boolean_primary ::= predicate",
 /* 368 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 369 */ "common_expression ::= expression",
 /* 370 */ "common_expression ::= boolean_value_expression",
 /* 371 */ "from_clause ::= FROM table_reference_list",
 /* 372 */ "table_reference_list ::= table_reference",
 /* 373 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 374 */ "table_reference ::= table_primary",
 /* 375 */ "table_reference ::= joined_table",
 /* 376 */ "table_primary ::= table_name alias_opt",
 /* 377 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 378 */ "table_primary ::= subquery alias_opt",
 /* 379 */ "table_primary ::= parenthesized_joined_table",
 /* 380 */ "alias_opt ::=",
 /* 381 */ "alias_opt ::= table_alias",
 /* 382 */ "alias_opt ::= AS table_alias",
 /* 383 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 384 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 385 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 386 */ "join_type ::=",
 /* 387 */ "join_type ::= INNER",
 /* 388 */ "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",
 /* 389 */ "set_quantifier_opt ::=",
 /* 390 */ "set_quantifier_opt ::= DISTINCT",
 /* 391 */ "set_quantifier_opt ::= ALL",
 /* 392 */ "select_list ::= NK_STAR",
 /* 393 */ "select_list ::= select_sublist",
 /* 394 */ "select_sublist ::= select_item",
 /* 395 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 396 */ "select_item ::= common_expression",
 /* 397 */ "select_item ::= common_expression column_alias",
 /* 398 */ "select_item ::= common_expression AS column_alias",
 /* 399 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 400 */ "where_clause_opt ::=",
 /* 401 */ "where_clause_opt ::= WHERE search_condition",
 /* 402 */ "partition_by_clause_opt ::=",
 /* 403 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 404 */ "twindow_clause_opt ::=",
 /* 405 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 406 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
 /* 407 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 408 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 409 */ "sliding_opt ::=",
 /* 410 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 411 */ "fill_opt ::=",
 /* 412 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 413 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 414 */ "fill_mode ::= NONE",
 /* 415 */ "fill_mode ::= PREV",
 /* 416 */ "fill_mode ::= NULL",
 /* 417 */ "fill_mode ::= LINEAR",
 /* 418 */ "fill_mode ::= NEXT",
 /* 419 */ "group_by_clause_opt ::=",
 /* 420 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 421 */ "group_by_list ::= expression",
 /* 422 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 423 */ "having_clause_opt ::=",
 /* 424 */ "having_clause_opt ::= HAVING search_condition",
 /* 425 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 426 */ "query_expression_body ::= query_primary",
 /* 427 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 428 */ "query_expression_body ::= query_expression_body UNION query_expression_body",
 /* 429 */ "query_primary ::= query_specification",
 /* 430 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP",
 /* 431 */ "order_by_clause_opt ::=",
 /* 432 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 433 */ "slimit_clause_opt ::=",
 /* 434 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 435 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 436 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 437 */ "limit_clause_opt ::=",
 /* 438 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 439 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 440 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 441 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 442 */ "search_condition ::= common_expression",
 /* 443 */ "sort_specification_list ::= sort_specification",
 /* 444 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 445 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 446 */ "ordering_specification_opt ::=",
 /* 447 */ "ordering_specification_opt ::= ASC",
 /* 448 */ "ordering_specification_opt ::= DESC",
 /* 449 */ "null_ordering_opt ::=",
 /* 450 */ "null_ordering_opt ::= NULLS FIRST",
 /* 451 */ "null_ordering_opt ::= NULLS LAST",
1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988
};
#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 已提交
1989
    pNew = malloc(newSize*sizeof(pNew[0]));
1990 1991
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1992
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
  }
  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 已提交
2010
** second argument to ParseAlloc() below.  This can be changed by
2011 2012 2013 2014 2015 2016 2017 2018 2019
** 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 已提交
2020
void ParseInit(void *yypRawParser ParseCTX_PDECL){
2021
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
2022
  ParseCTX_STORE
2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045
#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 已提交
2046
#ifndef Parse_ENGINEALWAYSONSTACK
2047 2048 2049 2050 2051 2052 2053 2054 2055 2056
/* 
** 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 已提交
2057
** to Parse and ParseFree.
2058
*/
X
Xiaoyu Wang 已提交
2059
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
2060 2061 2062
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
2063 2064
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
2065 2066 2067
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
2068
#endif /* Parse_ENGINEALWAYSONSTACK */
2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082


/* 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 已提交
2083 2084
  ParseARG_FETCH
  ParseCTX_FETCH
2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097
  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 */
2098 2099 2100 2101 2102 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
    case 238: /* cmd */
    case 241: /* literal */
    case 252: /* db_options */
    case 254: /* alter_db_options */
    case 259: /* retention */
    case 260: /* full_table_name */
    case 263: /* table_options */
    case 267: /* alter_table_clause */
    case 268: /* alter_table_options */
    case 271: /* create_subtable_clause */
    case 274: /* drop_table_clause */
    case 277: /* column_def */
    case 280: /* col_name */
    case 281: /* db_name_cond_opt */
    case 282: /* like_pattern_opt */
    case 283: /* table_name_cond */
    case 284: /* from_db_opt */
    case 285: /* func_name */
    case 288: /* index_options */
    case 290: /* duration_literal */
    case 291: /* sliding_opt */
    case 292: /* func */
    case 295: /* topic_options */
    case 296: /* query_expression */
    case 298: /* explain_options */
    case 302: /* stream_options */
    case 303: /* into_opt */
    case 305: /* signed */
    case 306: /* signed_literal */
    case 307: /* literal_func */
    case 310: /* expression */
    case 311: /* pseudo_column */
    case 312: /* column_reference */
    case 313: /* function_expression */
    case 314: /* subquery */
    case 319: /* star_func_para */
    case 320: /* predicate */
    case 323: /* in_predicate_value */
    case 324: /* boolean_value_expression */
    case 325: /* boolean_primary */
    case 326: /* common_expression */
    case 327: /* from_clause */
    case 328: /* table_reference_list */
    case 329: /* table_reference */
    case 330: /* table_primary */
    case 331: /* joined_table */
    case 333: /* parenthesized_joined_table */
    case 335: /* search_condition */
    case 336: /* query_specification */
    case 339: /* where_clause_opt */
    case 341: /* twindow_clause_opt */
    case 343: /* having_clause_opt */
    case 345: /* select_item */
    case 346: /* fill_opt */
    case 349: /* query_expression_body */
    case 351: /* slimit_clause_opt */
    case 352: /* limit_clause_opt */
    case 353: /* query_primary */
    case 355: /* sort_specification */
{
 nodesDestroyNode((yypminor->yy172)); 
}
      break;
    case 239: /* account_options */
    case 240: /* alter_account_options */
    case 242: /* alter_account_option */
    case 300: /* bufsize_opt */
2165
{
2166
 
2167 2168
}
      break;
2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184
    case 243: /* user_name */
    case 245: /* priv_level */
    case 248: /* db_name */
    case 249: /* dnode_endpoint */
    case 250: /* dnode_host_name */
    case 269: /* column_name */
    case 276: /* table_name */
    case 286: /* function_name */
    case 287: /* index_name */
    case 294: /* topic_name */
    case 301: /* stream_name */
    case 308: /* table_alias */
    case 309: /* column_alias */
    case 315: /* star_func */
    case 317: /* noarg_func */
    case 332: /* alias_opt */
2185
{
2186
 
2187 2188
}
      break;
2189 2190 2191
    case 244: /* privileges */
    case 246: /* priv_type_list */
    case 247: /* priv_type */
2192
{
2193
 
2194 2195
}
      break;
2196 2197 2198 2199 2200
    case 251: /* not_exists_opt */
    case 253: /* exists_opt */
    case 297: /* analyze_opt */
    case 299: /* agg_func_opt */
    case 337: /* set_quantifier_opt */
2201
{
2202 2203 2204
 
}
      break;
2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228
    case 255: /* integer_list */
    case 256: /* variable_list */
    case 257: /* retention_list */
    case 261: /* column_def_list */
    case 262: /* tags_def_opt */
    case 264: /* multi_create_clause */
    case 265: /* tags_def */
    case 266: /* multi_drop_clause */
    case 272: /* specific_tags_opt */
    case 273: /* literal_list */
    case 275: /* col_name_list */
    case 278: /* func_name_list */
    case 289: /* func_list */
    case 293: /* expression_list */
    case 304: /* dnode_list */
    case 316: /* star_func_para_list */
    case 318: /* other_para_list */
    case 338: /* select_list */
    case 340: /* partition_by_clause_opt */
    case 342: /* group_by_clause_opt */
    case 344: /* select_sublist */
    case 348: /* group_by_list */
    case 350: /* order_by_clause_opt */
    case 354: /* sort_specification_list */
2229
{
2230
 nodesDestroyList((yypminor->yy60)); 
2231 2232
}
      break;
2233 2234
    case 258: /* alter_db_option */
    case 279: /* alter_table_option */
2235
{
X
Xiaoyu Wang 已提交
2236
 
2237 2238
}
      break;
2239
    case 270: /* type_name */
2240
{
2241
 
2242 2243
}
      break;
2244 2245
    case 321: /* compare_op */
    case 322: /* in_op */
2246
{
2247
 
2248 2249
}
      break;
2250
    case 334: /* join_type */
2251
{
2252
 
2253 2254
}
      break;
2255
    case 347: /* fill_mode */
2256
{
2257
 
2258 2259
}
      break;
2260
    case 356: /* ordering_specification_opt */
2261
{
2262
 
2263 2264
}
      break;
2265
    case 357: /* null_ordering_opt */
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
}
      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 已提交
2299
void ParseFinalize(void *p){
2300 2301 2302
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
2303
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
2304 2305 2306
#endif
}

X
Xiaoyu Wang 已提交
2307
#ifndef Parse_ENGINEALWAYSONSTACK
2308 2309 2310 2311 2312 2313 2314 2315
/* 
** 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 已提交
2316
void ParseFree(
2317 2318 2319 2320 2321 2322
  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 已提交
2323
  ParseFinalize(p);
2324 2325
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
2326
#endif /* Parse_ENGINEALWAYSONSTACK */
2327 2328 2329 2330 2331

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
2332
int ParseStackPeak(void *p){
2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355
  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 已提交
2356
int ParseCoverage(FILE *out){
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
  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 );
2393
    /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
2394 2395 2396
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
2397
    if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
2398 2399
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
2400 2401
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415
#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;
2416 2417 2418 2419 2420 2421 2422 2423 2424 2425
        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
        ){
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
#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 已提交
2478 2479
   ParseARG_FETCH
   ParseCTX_FETCH
2480 2481 2482 2483 2484 2485 2486 2487 2488 2489
#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 已提交
2490 2491
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521
}

/*
** 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 已提交
2522
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556
){
  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");
}

2557 2558 2559 2560 2561 2562 2563
/* 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[] = {
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 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881
  {  238,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  238,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  239,    0 }, /* (2) account_options ::= */
  {  239,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  239,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  239,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  239,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  239,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  239,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  239,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  239,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  239,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  240,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  240,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  242,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  242,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  242,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  242,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  242,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  242,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  242,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  242,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  242,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  242,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  238,   -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
  {  238,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  238,   -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
  {  238,   -3 }, /* (27) cmd ::= DROP USER user_name */
  {  238,   -6 }, /* (28) cmd ::= GRANT privileges ON priv_level TO user_name */
  {  238,   -6 }, /* (29) cmd ::= REVOKE privileges ON priv_level FROM user_name */
  {  244,   -1 }, /* (30) privileges ::= ALL */
  {  244,   -1 }, /* (31) privileges ::= priv_type_list */
  {  246,   -1 }, /* (32) priv_type_list ::= priv_type */
  {  246,   -3 }, /* (33) priv_type_list ::= priv_type_list NK_COMMA priv_type */
  {  247,   -1 }, /* (34) priv_type ::= READ */
  {  247,   -1 }, /* (35) priv_type ::= WRITE */
  {  245,   -3 }, /* (36) priv_level ::= NK_STAR NK_DOT NK_STAR */
  {  245,   -3 }, /* (37) priv_level ::= db_name NK_DOT NK_STAR */
  {  238,   -3 }, /* (38) cmd ::= CREATE DNODE dnode_endpoint */
  {  238,   -5 }, /* (39) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
  {  238,   -3 }, /* (40) cmd ::= DROP DNODE NK_INTEGER */
  {  238,   -3 }, /* (41) cmd ::= DROP DNODE dnode_endpoint */
  {  238,   -4 }, /* (42) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  238,   -5 }, /* (43) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  238,   -4 }, /* (44) cmd ::= ALTER ALL DNODES NK_STRING */
  {  238,   -5 }, /* (45) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  249,   -1 }, /* (46) dnode_endpoint ::= NK_STRING */
  {  250,   -1 }, /* (47) dnode_host_name ::= NK_ID */
  {  250,   -1 }, /* (48) dnode_host_name ::= NK_IPTOKEN */
  {  238,   -3 }, /* (49) cmd ::= ALTER LOCAL NK_STRING */
  {  238,   -4 }, /* (50) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  238,   -5 }, /* (51) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  238,   -5 }, /* (52) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  238,   -5 }, /* (53) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
  {  238,   -5 }, /* (54) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
  {  238,   -5 }, /* (55) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
  {  238,   -5 }, /* (56) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
  {  238,   -5 }, /* (57) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
  {  238,   -5 }, /* (58) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
  {  238,   -5 }, /* (59) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  238,   -4 }, /* (60) cmd ::= DROP DATABASE exists_opt db_name */
  {  238,   -2 }, /* (61) cmd ::= USE db_name */
  {  238,   -4 }, /* (62) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  251,   -3 }, /* (63) not_exists_opt ::= IF NOT EXISTS */
  {  251,    0 }, /* (64) not_exists_opt ::= */
  {  253,   -2 }, /* (65) exists_opt ::= IF EXISTS */
  {  253,    0 }, /* (66) exists_opt ::= */
  {  252,    0 }, /* (67) db_options ::= */
  {  252,   -3 }, /* (68) db_options ::= db_options BUFFER NK_INTEGER */
  {  252,   -3 }, /* (69) db_options ::= db_options CACHELAST NK_INTEGER */
  {  252,   -3 }, /* (70) db_options ::= db_options COMP NK_INTEGER */
  {  252,   -3 }, /* (71) db_options ::= db_options DAYS NK_INTEGER */
  {  252,   -3 }, /* (72) db_options ::= db_options DAYS NK_VARIABLE */
  {  252,   -3 }, /* (73) db_options ::= db_options FSYNC NK_INTEGER */
  {  252,   -3 }, /* (74) db_options ::= db_options MAXROWS NK_INTEGER */
  {  252,   -3 }, /* (75) db_options ::= db_options MINROWS NK_INTEGER */
  {  252,   -3 }, /* (76) db_options ::= db_options KEEP integer_list */
  {  252,   -3 }, /* (77) db_options ::= db_options KEEP variable_list */
  {  252,   -3 }, /* (78) db_options ::= db_options PAGES NK_INTEGER */
  {  252,   -3 }, /* (79) db_options ::= db_options PAGESIZE NK_INTEGER */
  {  252,   -3 }, /* (80) db_options ::= db_options PRECISION NK_STRING */
  {  252,   -3 }, /* (81) db_options ::= db_options REPLICA NK_INTEGER */
  {  252,   -3 }, /* (82) db_options ::= db_options STRICT NK_INTEGER */
  {  252,   -3 }, /* (83) db_options ::= db_options WAL NK_INTEGER */
  {  252,   -3 }, /* (84) db_options ::= db_options VGROUPS NK_INTEGER */
  {  252,   -3 }, /* (85) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  252,   -3 }, /* (86) db_options ::= db_options RETENTIONS retention_list */
  {  254,   -1 }, /* (87) alter_db_options ::= alter_db_option */
  {  254,   -2 }, /* (88) alter_db_options ::= alter_db_options alter_db_option */
  {  258,   -2 }, /* (89) alter_db_option ::= BUFFER NK_INTEGER */
  {  258,   -2 }, /* (90) alter_db_option ::= CACHELAST NK_INTEGER */
  {  258,   -2 }, /* (91) alter_db_option ::= FSYNC NK_INTEGER */
  {  258,   -2 }, /* (92) alter_db_option ::= KEEP integer_list */
  {  258,   -2 }, /* (93) alter_db_option ::= KEEP variable_list */
  {  258,   -2 }, /* (94) alter_db_option ::= PAGES NK_INTEGER */
  {  258,   -2 }, /* (95) alter_db_option ::= REPLICA NK_INTEGER */
  {  258,   -2 }, /* (96) alter_db_option ::= STRICT NK_INTEGER */
  {  258,   -2 }, /* (97) alter_db_option ::= WAL NK_INTEGER */
  {  255,   -1 }, /* (98) integer_list ::= NK_INTEGER */
  {  255,   -3 }, /* (99) integer_list ::= integer_list NK_COMMA NK_INTEGER */
  {  256,   -1 }, /* (100) variable_list ::= NK_VARIABLE */
  {  256,   -3 }, /* (101) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
  {  257,   -1 }, /* (102) retention_list ::= retention */
  {  257,   -3 }, /* (103) retention_list ::= retention_list NK_COMMA retention */
  {  259,   -3 }, /* (104) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
  {  238,   -9 }, /* (105) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  238,   -3 }, /* (106) cmd ::= CREATE TABLE multi_create_clause */
  {  238,   -9 }, /* (107) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  238,   -3 }, /* (108) cmd ::= DROP TABLE multi_drop_clause */
  {  238,   -4 }, /* (109) cmd ::= DROP STABLE exists_opt full_table_name */
  {  238,   -3 }, /* (110) cmd ::= ALTER TABLE alter_table_clause */
  {  238,   -3 }, /* (111) cmd ::= ALTER STABLE alter_table_clause */
  {  267,   -2 }, /* (112) alter_table_clause ::= full_table_name alter_table_options */
  {  267,   -5 }, /* (113) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  267,   -4 }, /* (114) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  267,   -5 }, /* (115) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  267,   -5 }, /* (116) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  267,   -5 }, /* (117) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  267,   -4 }, /* (118) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  267,   -5 }, /* (119) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  267,   -5 }, /* (120) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  267,   -6 }, /* (121) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
  {  264,   -1 }, /* (122) multi_create_clause ::= create_subtable_clause */
  {  264,   -2 }, /* (123) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  271,  -10 }, /* (124) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */
  {  266,   -1 }, /* (125) multi_drop_clause ::= drop_table_clause */
  {  266,   -2 }, /* (126) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  274,   -2 }, /* (127) drop_table_clause ::= exists_opt full_table_name */
  {  272,    0 }, /* (128) specific_tags_opt ::= */
  {  272,   -3 }, /* (129) specific_tags_opt ::= NK_LP col_name_list NK_RP */
  {  260,   -1 }, /* (130) full_table_name ::= table_name */
  {  260,   -3 }, /* (131) full_table_name ::= db_name NK_DOT table_name */
  {  261,   -1 }, /* (132) column_def_list ::= column_def */
  {  261,   -3 }, /* (133) column_def_list ::= column_def_list NK_COMMA column_def */
  {  277,   -2 }, /* (134) column_def ::= column_name type_name */
  {  277,   -4 }, /* (135) column_def ::= column_name type_name COMMENT NK_STRING */
  {  270,   -1 }, /* (136) type_name ::= BOOL */
  {  270,   -1 }, /* (137) type_name ::= TINYINT */
  {  270,   -1 }, /* (138) type_name ::= SMALLINT */
  {  270,   -1 }, /* (139) type_name ::= INT */
  {  270,   -1 }, /* (140) type_name ::= INTEGER */
  {  270,   -1 }, /* (141) type_name ::= BIGINT */
  {  270,   -1 }, /* (142) type_name ::= FLOAT */
  {  270,   -1 }, /* (143) type_name ::= DOUBLE */
  {  270,   -4 }, /* (144) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  270,   -1 }, /* (145) type_name ::= TIMESTAMP */
  {  270,   -4 }, /* (146) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  270,   -2 }, /* (147) type_name ::= TINYINT UNSIGNED */
  {  270,   -2 }, /* (148) type_name ::= SMALLINT UNSIGNED */
  {  270,   -2 }, /* (149) type_name ::= INT UNSIGNED */
  {  270,   -2 }, /* (150) type_name ::= BIGINT UNSIGNED */
  {  270,   -1 }, /* (151) type_name ::= JSON */
  {  270,   -4 }, /* (152) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  270,   -1 }, /* (153) type_name ::= MEDIUMBLOB */
  {  270,   -1 }, /* (154) type_name ::= BLOB */
  {  270,   -4 }, /* (155) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  270,   -1 }, /* (156) type_name ::= DECIMAL */
  {  270,   -4 }, /* (157) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  270,   -6 }, /* (158) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  262,    0 }, /* (159) tags_def_opt ::= */
  {  262,   -1 }, /* (160) tags_def_opt ::= tags_def */
  {  265,   -4 }, /* (161) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  263,    0 }, /* (162) table_options ::= */
  {  263,   -3 }, /* (163) table_options ::= table_options COMMENT NK_STRING */
  {  263,   -3 }, /* (164) table_options ::= table_options DELAY NK_INTEGER */
  {  263,   -3 }, /* (165) table_options ::= table_options FILE_FACTOR NK_FLOAT */
  {  263,   -5 }, /* (166) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
  {  263,   -3 }, /* (167) table_options ::= table_options TTL NK_INTEGER */
  {  263,   -5 }, /* (168) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  268,   -1 }, /* (169) alter_table_options ::= alter_table_option */
  {  268,   -2 }, /* (170) alter_table_options ::= alter_table_options alter_table_option */
  {  279,   -2 }, /* (171) alter_table_option ::= COMMENT NK_STRING */
  {  279,   -2 }, /* (172) alter_table_option ::= TTL NK_INTEGER */
  {  275,   -1 }, /* (173) col_name_list ::= col_name */
  {  275,   -3 }, /* (174) col_name_list ::= col_name_list NK_COMMA col_name */
  {  280,   -1 }, /* (175) col_name ::= column_name */
  {  238,   -2 }, /* (176) cmd ::= SHOW DNODES */
  {  238,   -2 }, /* (177) cmd ::= SHOW USERS */
  {  238,   -2 }, /* (178) cmd ::= SHOW DATABASES */
  {  238,   -4 }, /* (179) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  238,   -4 }, /* (180) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  238,   -3 }, /* (181) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  238,   -2 }, /* (182) cmd ::= SHOW MNODES */
  {  238,   -2 }, /* (183) cmd ::= SHOW MODULES */
  {  238,   -2 }, /* (184) cmd ::= SHOW QNODES */
  {  238,   -2 }, /* (185) cmd ::= SHOW FUNCTIONS */
  {  238,   -5 }, /* (186) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  238,   -2 }, /* (187) cmd ::= SHOW STREAMS */
  {  238,   -2 }, /* (188) cmd ::= SHOW ACCOUNTS */
  {  238,   -2 }, /* (189) cmd ::= SHOW APPS */
  {  238,   -2 }, /* (190) cmd ::= SHOW CONNECTIONS */
  {  238,   -2 }, /* (191) cmd ::= SHOW LICENCE */
  {  238,   -2 }, /* (192) cmd ::= SHOW GRANTS */
  {  238,   -4 }, /* (193) cmd ::= SHOW CREATE DATABASE db_name */
  {  238,   -4 }, /* (194) cmd ::= SHOW CREATE TABLE full_table_name */
  {  238,   -4 }, /* (195) cmd ::= SHOW CREATE STABLE full_table_name */
  {  238,   -2 }, /* (196) cmd ::= SHOW QUERIES */
  {  238,   -2 }, /* (197) cmd ::= SHOW SCORES */
  {  238,   -2 }, /* (198) cmd ::= SHOW TOPICS */
  {  238,   -2 }, /* (199) cmd ::= SHOW VARIABLES */
  {  238,   -2 }, /* (200) cmd ::= SHOW BNODES */
  {  238,   -2 }, /* (201) cmd ::= SHOW SNODES */
  {  238,   -2 }, /* (202) cmd ::= SHOW CLUSTER */
  {  238,   -2 }, /* (203) cmd ::= SHOW TRANSACTIONS */
  {  281,    0 }, /* (204) db_name_cond_opt ::= */
  {  281,   -2 }, /* (205) db_name_cond_opt ::= db_name NK_DOT */
  {  282,    0 }, /* (206) like_pattern_opt ::= */
  {  282,   -2 }, /* (207) like_pattern_opt ::= LIKE NK_STRING */
  {  283,   -1 }, /* (208) table_name_cond ::= table_name */
  {  284,    0 }, /* (209) from_db_opt ::= */
  {  284,   -2 }, /* (210) from_db_opt ::= FROM db_name */
  {  278,   -1 }, /* (211) func_name_list ::= func_name */
  {  278,   -3 }, /* (212) func_name_list ::= func_name_list NK_COMMA func_name */
  {  285,   -1 }, /* (213) func_name ::= function_name */
  {  238,   -8 }, /* (214) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
  {  238,  -10 }, /* (215) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
  {  238,   -6 }, /* (216) cmd ::= DROP INDEX exists_opt index_name ON table_name */
  {  288,    0 }, /* (217) index_options ::= */
  {  288,   -9 }, /* (218) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  {  288,  -11 }, /* (219) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
  {  289,   -1 }, /* (220) func_list ::= func */
  {  289,   -3 }, /* (221) func_list ::= func_list NK_COMMA func */
  {  292,   -4 }, /* (222) func ::= function_name NK_LP expression_list NK_RP */
  {  238,   -7 }, /* (223) cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS query_expression */
  {  238,   -7 }, /* (224) cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS db_name */
  {  238,   -4 }, /* (225) cmd ::= DROP TOPIC exists_opt topic_name */
  {  295,    0 }, /* (226) topic_options ::= */
  {  295,   -3 }, /* (227) topic_options ::= topic_options WITH TABLE */
  {  295,   -3 }, /* (228) topic_options ::= topic_options WITH SCHEMA */
  {  295,   -3 }, /* (229) topic_options ::= topic_options WITH TAG */
  {  238,   -2 }, /* (230) cmd ::= DESC full_table_name */
  {  238,   -2 }, /* (231) cmd ::= DESCRIBE full_table_name */
  {  238,   -3 }, /* (232) cmd ::= RESET QUERY CACHE */
  {  238,   -4 }, /* (233) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
  {  297,    0 }, /* (234) analyze_opt ::= */
  {  297,   -1 }, /* (235) analyze_opt ::= ANALYZE */
  {  298,    0 }, /* (236) explain_options ::= */
  {  298,   -3 }, /* (237) explain_options ::= explain_options VERBOSE NK_BOOL */
  {  298,   -3 }, /* (238) explain_options ::= explain_options RATIO NK_FLOAT */
  {  238,   -6 }, /* (239) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
  {  238,  -10 }, /* (240) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
  {  238,   -4 }, /* (241) cmd ::= DROP FUNCTION exists_opt function_name */
  {  299,    0 }, /* (242) agg_func_opt ::= */
  {  299,   -1 }, /* (243) agg_func_opt ::= AGGREGATE */
  {  300,    0 }, /* (244) bufsize_opt ::= */
  {  300,   -2 }, /* (245) bufsize_opt ::= BUFSIZE NK_INTEGER */
  {  238,   -8 }, /* (246) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
  {  238,   -4 }, /* (247) cmd ::= DROP STREAM exists_opt stream_name */
  {  303,    0 }, /* (248) into_opt ::= */
  {  303,   -2 }, /* (249) into_opt ::= INTO full_table_name */
  {  302,    0 }, /* (250) stream_options ::= */
  {  302,   -3 }, /* (251) stream_options ::= stream_options TRIGGER AT_ONCE */
  {  302,   -3 }, /* (252) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
  {  302,   -3 }, /* (253) stream_options ::= stream_options WATERMARK duration_literal */
  {  238,   -3 }, /* (254) cmd ::= KILL CONNECTION NK_INTEGER */
  {  238,   -3 }, /* (255) cmd ::= KILL QUERY NK_INTEGER */
  {  238,   -3 }, /* (256) cmd ::= KILL TRANSACTION NK_INTEGER */
  {  238,   -4 }, /* (257) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
  {  238,   -4 }, /* (258) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
  {  238,   -3 }, /* (259) cmd ::= SPLIT VGROUP NK_INTEGER */
  {  304,   -2 }, /* (260) dnode_list ::= DNODE NK_INTEGER */
  {  304,   -3 }, /* (261) dnode_list ::= dnode_list DNODE NK_INTEGER */
  {  238,   -3 }, /* (262) cmd ::= SYNCDB db_name REPLICA */
  {  238,   -1 }, /* (263) cmd ::= query_expression */
  {  241,   -1 }, /* (264) literal ::= NK_INTEGER */
  {  241,   -1 }, /* (265) literal ::= NK_FLOAT */
  {  241,   -1 }, /* (266) literal ::= NK_STRING */
  {  241,   -1 }, /* (267) literal ::= NK_BOOL */
  {  241,   -2 }, /* (268) literal ::= TIMESTAMP NK_STRING */
  {  241,   -1 }, /* (269) literal ::= duration_literal */
  {  241,   -1 }, /* (270) literal ::= NULL */
  {  241,   -1 }, /* (271) literal ::= NK_QUESTION */
  {  290,   -1 }, /* (272) duration_literal ::= NK_VARIABLE */
  {  305,   -1 }, /* (273) signed ::= NK_INTEGER */
  {  305,   -2 }, /* (274) signed ::= NK_PLUS NK_INTEGER */
  {  305,   -2 }, /* (275) signed ::= NK_MINUS NK_INTEGER */
  {  305,   -1 }, /* (276) signed ::= NK_FLOAT */
  {  305,   -2 }, /* (277) signed ::= NK_PLUS NK_FLOAT */
  {  305,   -2 }, /* (278) signed ::= NK_MINUS NK_FLOAT */
  {  306,   -1 }, /* (279) signed_literal ::= signed */
  {  306,   -1 }, /* (280) signed_literal ::= NK_STRING */
  {  306,   -1 }, /* (281) signed_literal ::= NK_BOOL */
  {  306,   -2 }, /* (282) signed_literal ::= TIMESTAMP NK_STRING */
  {  306,   -1 }, /* (283) signed_literal ::= duration_literal */
  {  306,   -1 }, /* (284) signed_literal ::= NULL */
  {  306,   -1 }, /* (285) signed_literal ::= literal_func */
  {  273,   -1 }, /* (286) literal_list ::= signed_literal */
  {  273,   -3 }, /* (287) literal_list ::= literal_list NK_COMMA signed_literal */
  {  248,   -1 }, /* (288) db_name ::= NK_ID */
  {  276,   -1 }, /* (289) table_name ::= NK_ID */
  {  269,   -1 }, /* (290) column_name ::= NK_ID */
  {  286,   -1 }, /* (291) function_name ::= NK_ID */
  {  308,   -1 }, /* (292) table_alias ::= NK_ID */
  {  309,   -1 }, /* (293) column_alias ::= NK_ID */
  {  243,   -1 }, /* (294) user_name ::= NK_ID */
  {  287,   -1 }, /* (295) index_name ::= NK_ID */
  {  294,   -1 }, /* (296) topic_name ::= NK_ID */
  {  301,   -1 }, /* (297) stream_name ::= NK_ID */
  {  310,   -1 }, /* (298) expression ::= literal */
  {  310,   -1 }, /* (299) expression ::= pseudo_column */
  {  310,   -1 }, /* (300) expression ::= column_reference */
  {  310,   -1 }, /* (301) expression ::= function_expression */
  {  310,   -1 }, /* (302) expression ::= subquery */
  {  310,   -3 }, /* (303) expression ::= NK_LP expression NK_RP */
  {  310,   -2 }, /* (304) expression ::= NK_PLUS expression */
  {  310,   -2 }, /* (305) expression ::= NK_MINUS expression */
  {  310,   -3 }, /* (306) expression ::= expression NK_PLUS expression */
  {  310,   -3 }, /* (307) expression ::= expression NK_MINUS expression */
  {  310,   -3 }, /* (308) expression ::= expression NK_STAR expression */
  {  310,   -3 }, /* (309) expression ::= expression NK_SLASH expression */
  {  310,   -3 }, /* (310) expression ::= expression NK_REM expression */
  {  310,   -3 }, /* (311) expression ::= column_reference NK_ARROW NK_STRING */
  {  293,   -1 }, /* (312) expression_list ::= expression */
  {  293,   -3 }, /* (313) expression_list ::= expression_list NK_COMMA expression */
  {  312,   -1 }, /* (314) column_reference ::= column_name */
  {  312,   -3 }, /* (315) column_reference ::= table_name NK_DOT column_name */
  {  311,   -1 }, /* (316) pseudo_column ::= ROWTS */
  {  311,   -1 }, /* (317) pseudo_column ::= TBNAME */
2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015
  {  311,   -3 }, /* (318) pseudo_column ::= table_name NK_DOT TBNAME */
  {  311,   -1 }, /* (319) pseudo_column ::= QSTARTTS */
  {  311,   -1 }, /* (320) pseudo_column ::= QENDTS */
  {  311,   -1 }, /* (321) pseudo_column ::= WSTARTTS */
  {  311,   -1 }, /* (322) pseudo_column ::= WENDTS */
  {  311,   -1 }, /* (323) pseudo_column ::= WDURATION */
  {  313,   -4 }, /* (324) function_expression ::= function_name NK_LP expression_list NK_RP */
  {  313,   -4 }, /* (325) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
  {  313,   -6 }, /* (326) function_expression ::= CAST NK_LP expression AS type_name NK_RP */
  {  313,   -1 }, /* (327) function_expression ::= literal_func */
  {  307,   -3 }, /* (328) literal_func ::= noarg_func NK_LP NK_RP */
  {  307,   -1 }, /* (329) literal_func ::= NOW */
  {  317,   -1 }, /* (330) noarg_func ::= NOW */
  {  317,   -1 }, /* (331) noarg_func ::= TODAY */
  {  317,   -1 }, /* (332) noarg_func ::= TIMEZONE */
  {  315,   -1 }, /* (333) star_func ::= COUNT */
  {  315,   -1 }, /* (334) star_func ::= FIRST */
  {  315,   -1 }, /* (335) star_func ::= LAST */
  {  315,   -1 }, /* (336) star_func ::= LAST_ROW */
  {  316,   -1 }, /* (337) star_func_para_list ::= NK_STAR */
  {  316,   -1 }, /* (338) star_func_para_list ::= other_para_list */
  {  318,   -1 }, /* (339) other_para_list ::= star_func_para */
  {  318,   -3 }, /* (340) other_para_list ::= other_para_list NK_COMMA star_func_para */
  {  319,   -1 }, /* (341) star_func_para ::= expression */
  {  319,   -3 }, /* (342) star_func_para ::= table_name NK_DOT NK_STAR */
  {  320,   -3 }, /* (343) predicate ::= expression compare_op expression */
  {  320,   -5 }, /* (344) predicate ::= expression BETWEEN expression AND expression */
  {  320,   -6 }, /* (345) predicate ::= expression NOT BETWEEN expression AND expression */
  {  320,   -3 }, /* (346) predicate ::= expression IS NULL */
  {  320,   -4 }, /* (347) predicate ::= expression IS NOT NULL */
  {  320,   -3 }, /* (348) predicate ::= expression in_op in_predicate_value */
  {  321,   -1 }, /* (349) compare_op ::= NK_LT */
  {  321,   -1 }, /* (350) compare_op ::= NK_GT */
  {  321,   -1 }, /* (351) compare_op ::= NK_LE */
  {  321,   -1 }, /* (352) compare_op ::= NK_GE */
  {  321,   -1 }, /* (353) compare_op ::= NK_NE */
  {  321,   -1 }, /* (354) compare_op ::= NK_EQ */
  {  321,   -1 }, /* (355) compare_op ::= LIKE */
  {  321,   -2 }, /* (356) compare_op ::= NOT LIKE */
  {  321,   -1 }, /* (357) compare_op ::= MATCH */
  {  321,   -1 }, /* (358) compare_op ::= NMATCH */
  {  321,   -1 }, /* (359) compare_op ::= CONTAINS */
  {  322,   -1 }, /* (360) in_op ::= IN */
  {  322,   -2 }, /* (361) in_op ::= NOT IN */
  {  323,   -3 }, /* (362) in_predicate_value ::= NK_LP expression_list NK_RP */
  {  324,   -1 }, /* (363) boolean_value_expression ::= boolean_primary */
  {  324,   -2 }, /* (364) boolean_value_expression ::= NOT boolean_primary */
  {  324,   -3 }, /* (365) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  324,   -3 }, /* (366) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  325,   -1 }, /* (367) boolean_primary ::= predicate */
  {  325,   -3 }, /* (368) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  326,   -1 }, /* (369) common_expression ::= expression */
  {  326,   -1 }, /* (370) common_expression ::= boolean_value_expression */
  {  327,   -2 }, /* (371) from_clause ::= FROM table_reference_list */
  {  328,   -1 }, /* (372) table_reference_list ::= table_reference */
  {  328,   -3 }, /* (373) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  329,   -1 }, /* (374) table_reference ::= table_primary */
  {  329,   -1 }, /* (375) table_reference ::= joined_table */
  {  330,   -2 }, /* (376) table_primary ::= table_name alias_opt */
  {  330,   -4 }, /* (377) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  330,   -2 }, /* (378) table_primary ::= subquery alias_opt */
  {  330,   -1 }, /* (379) table_primary ::= parenthesized_joined_table */
  {  332,    0 }, /* (380) alias_opt ::= */
  {  332,   -1 }, /* (381) alias_opt ::= table_alias */
  {  332,   -2 }, /* (382) alias_opt ::= AS table_alias */
  {  333,   -3 }, /* (383) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  333,   -3 }, /* (384) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  331,   -6 }, /* (385) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  334,    0 }, /* (386) join_type ::= */
  {  334,   -1 }, /* (387) join_type ::= INNER */
  {  336,   -9 }, /* (388) 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 */
  {  337,    0 }, /* (389) set_quantifier_opt ::= */
  {  337,   -1 }, /* (390) set_quantifier_opt ::= DISTINCT */
  {  337,   -1 }, /* (391) set_quantifier_opt ::= ALL */
  {  338,   -1 }, /* (392) select_list ::= NK_STAR */
  {  338,   -1 }, /* (393) select_list ::= select_sublist */
  {  344,   -1 }, /* (394) select_sublist ::= select_item */
  {  344,   -3 }, /* (395) select_sublist ::= select_sublist NK_COMMA select_item */
  {  345,   -1 }, /* (396) select_item ::= common_expression */
  {  345,   -2 }, /* (397) select_item ::= common_expression column_alias */
  {  345,   -3 }, /* (398) select_item ::= common_expression AS column_alias */
  {  345,   -3 }, /* (399) select_item ::= table_name NK_DOT NK_STAR */
  {  339,    0 }, /* (400) where_clause_opt ::= */
  {  339,   -2 }, /* (401) where_clause_opt ::= WHERE search_condition */
  {  340,    0 }, /* (402) partition_by_clause_opt ::= */
  {  340,   -3 }, /* (403) partition_by_clause_opt ::= PARTITION BY expression_list */
  {  341,    0 }, /* (404) twindow_clause_opt ::= */
  {  341,   -6 }, /* (405) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
  {  341,   -4 }, /* (406) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
  {  341,   -6 }, /* (407) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  341,   -8 }, /* (408) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  291,    0 }, /* (409) sliding_opt ::= */
  {  291,   -4 }, /* (410) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  346,    0 }, /* (411) fill_opt ::= */
  {  346,   -4 }, /* (412) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  346,   -6 }, /* (413) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  347,   -1 }, /* (414) fill_mode ::= NONE */
  {  347,   -1 }, /* (415) fill_mode ::= PREV */
  {  347,   -1 }, /* (416) fill_mode ::= NULL */
  {  347,   -1 }, /* (417) fill_mode ::= LINEAR */
  {  347,   -1 }, /* (418) fill_mode ::= NEXT */
  {  342,    0 }, /* (419) group_by_clause_opt ::= */
  {  342,   -3 }, /* (420) group_by_clause_opt ::= GROUP BY group_by_list */
  {  348,   -1 }, /* (421) group_by_list ::= expression */
  {  348,   -3 }, /* (422) group_by_list ::= group_by_list NK_COMMA expression */
  {  343,    0 }, /* (423) having_clause_opt ::= */
  {  343,   -2 }, /* (424) having_clause_opt ::= HAVING search_condition */
  {  296,   -4 }, /* (425) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  349,   -1 }, /* (426) query_expression_body ::= query_primary */
  {  349,   -4 }, /* (427) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
  {  349,   -3 }, /* (428) query_expression_body ::= query_expression_body UNION query_expression_body */
  {  353,   -1 }, /* (429) query_primary ::= query_specification */
  {  353,   -6 }, /* (430) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
  {  350,    0 }, /* (431) order_by_clause_opt ::= */
  {  350,   -3 }, /* (432) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  351,    0 }, /* (433) slimit_clause_opt ::= */
  {  351,   -2 }, /* (434) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  351,   -4 }, /* (435) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  351,   -4 }, /* (436) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  352,    0 }, /* (437) limit_clause_opt ::= */
  {  352,   -2 }, /* (438) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  352,   -4 }, /* (439) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  352,   -4 }, /* (440) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  314,   -3 }, /* (441) subquery ::= NK_LP query_expression NK_RP */
  {  335,   -1 }, /* (442) search_condition ::= common_expression */
  {  354,   -1 }, /* (443) sort_specification_list ::= sort_specification */
  {  354,   -3 }, /* (444) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  355,   -3 }, /* (445) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
  {  356,    0 }, /* (446) ordering_specification_opt ::= */
  {  356,   -1 }, /* (447) ordering_specification_opt ::= ASC */
  {  356,   -1 }, /* (448) ordering_specification_opt ::= DESC */
  {  357,    0 }, /* (449) null_ordering_opt ::= */
  {  357,   -2 }, /* (450) null_ordering_opt ::= NULLS FIRST */
  {  357,   -2 }, /* (451) null_ordering_opt ::= NULLS LAST */
3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033
};

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 已提交
3034 3035
  ParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  ParseCTX_PDECL                   /* %extra_context */
3036 3037 3038 3039 3040
){
  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 已提交
3041
  ParseARG_FETCH
3042 3043 3044 3045 3046
  (void)yyLookahead;
  (void)yyLookaheadToken;
  yymsp = yypParser->yytos;
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
3047
    yysize = yyRuleInfo[yyruleno].nrhs;
3048
    if( yysize ){
3049
      fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
3050
        yyTracePrompt,
3051
        yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
3052
    }else{
3053 3054
      fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
        yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
3055 3056 3057 3058 3059 3060 3061
    }
  }
#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 */
3062
  if( yyRuleInfo[yyruleno].nrhs==0 ){
3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101
#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;
3102
      case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
3103
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
3104
  yy_destructor(yypParser,239,&yymsp[0].minor);
3105
        break;
3106
      case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
3107
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
3108
  yy_destructor(yypParser,240,&yymsp[0].minor);
3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121
        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);
3122
{  yy_destructor(yypParser,239,&yymsp[-2].minor);
3123
{ }
3124
  yy_destructor(yypParser,241,&yymsp[0].minor);
3125
}
3126
        break;
3127
      case 12: /* alter_account_options ::= alter_account_option */
3128
{  yy_destructor(yypParser,242,&yymsp[0].minor);
3129 3130 3131
{ }
}
        break;
3132
      case 13: /* alter_account_options ::= alter_account_options alter_account_option */
3133
{  yy_destructor(yypParser,240,&yymsp[-1].minor);
3134
{ }
3135
  yy_destructor(yypParser,242,&yymsp[0].minor);
3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147
}
        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);
3148
{ }
3149
  yy_destructor(yypParser,241,&yymsp[0].minor);
3150
        break;
3151
      case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */
3152
{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0); }
3153
        break;
3154
      case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
3155
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy105, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
3156
        break;
3157
      case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
3158
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy105, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
3159
        break;
3160
      case 27: /* cmd ::= DROP USER user_name */
3161
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy105); }
3162
        break;
3163 3164
      case 28: /* cmd ::= GRANT privileges ON priv_level TO user_name */
{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy593, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105); }
3165
        break;
3166 3167
      case 29: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */
{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy593, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105); }
3168
        break;
3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201
      case 30: /* privileges ::= ALL */
{ yymsp[0].minor.yy593 = PRIVILEGE_TYPE_ALL; }
        break;
      case 31: /* privileges ::= priv_type_list */
      case 32: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==32);
{ yylhsminor.yy593 = yymsp[0].minor.yy593; }
  yymsp[0].minor.yy593 = yylhsminor.yy593;
        break;
      case 33: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
{ yylhsminor.yy593 = yymsp[-2].minor.yy593 | yymsp[0].minor.yy593; }
  yymsp[-2].minor.yy593 = yylhsminor.yy593;
        break;
      case 34: /* priv_type ::= READ */
{ yymsp[0].minor.yy593 = PRIVILEGE_TYPE_READ; }
        break;
      case 35: /* priv_type ::= WRITE */
{ yymsp[0].minor.yy593 = PRIVILEGE_TYPE_WRITE; }
        break;
      case 36: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
{ yylhsminor.yy105 = yymsp[-2].minor.yy0; }
  yymsp[-2].minor.yy105 = yylhsminor.yy105;
        break;
      case 37: /* priv_level ::= db_name NK_DOT NK_STAR */
{ yylhsminor.yy105 = yymsp[-2].minor.yy105; }
  yymsp[-2].minor.yy105 = yylhsminor.yy105;
        break;
      case 38: /* cmd ::= CREATE DNODE dnode_endpoint */
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy105, NULL); }
        break;
      case 39: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0); }
        break;
      case 40: /* cmd ::= DROP DNODE NK_INTEGER */
3202
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
3203
        break;
3204 3205
      case 41: /* cmd ::= DROP DNODE dnode_endpoint */
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy105); }
3206
        break;
3207
      case 42: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
3208 3209
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
        break;
3210
      case 43: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
3211 3212
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3213
      case 44: /* cmd ::= ALTER ALL DNODES NK_STRING */
3214 3215
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
        break;
3216
      case 45: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
3217 3218
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231
      case 46: /* dnode_endpoint ::= NK_STRING */
      case 47: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==47);
      case 48: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==48);
      case 288: /* db_name ::= NK_ID */ yytestcase(yyruleno==288);
      case 289: /* table_name ::= NK_ID */ yytestcase(yyruleno==289);
      case 290: /* column_name ::= NK_ID */ yytestcase(yyruleno==290);
      case 291: /* function_name ::= NK_ID */ yytestcase(yyruleno==291);
      case 292: /* table_alias ::= NK_ID */ yytestcase(yyruleno==292);
      case 293: /* column_alias ::= NK_ID */ yytestcase(yyruleno==293);
      case 294: /* user_name ::= NK_ID */ yytestcase(yyruleno==294);
      case 295: /* index_name ::= NK_ID */ yytestcase(yyruleno==295);
      case 296: /* topic_name ::= NK_ID */ yytestcase(yyruleno==296);
      case 297: /* stream_name ::= NK_ID */ yytestcase(yyruleno==297);
3232 3233 3234 3235 3236 3237 3238
      case 330: /* noarg_func ::= NOW */ yytestcase(yyruleno==330);
      case 331: /* noarg_func ::= TODAY */ yytestcase(yyruleno==331);
      case 332: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==332);
      case 333: /* star_func ::= COUNT */ yytestcase(yyruleno==333);
      case 334: /* star_func ::= FIRST */ yytestcase(yyruleno==334);
      case 335: /* star_func ::= LAST */ yytestcase(yyruleno==335);
      case 336: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==336);
3239 3240 3241 3242
{ yylhsminor.yy105 = yymsp[0].minor.yy0; }
  yymsp[0].minor.yy105 = yylhsminor.yy105;
        break;
      case 49: /* cmd ::= ALTER LOCAL NK_STRING */
3243 3244
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
        break;
3245
      case 50: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
3246 3247
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3248
      case 51: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
3249
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3250
        break;
3251
      case 52: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
3252
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); }
3253
        break;
3254
      case 53: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
3255
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3256
        break;
3257
      case 54: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
3258
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3259
        break;
3260
      case 55: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
3261
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); }
3262
        break;
3263
      case 56: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
3264
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); }
3265
        break;
3266
      case 57: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
3267
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); }
3268
        break;
3269
      case 58: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
3270
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
3271
        break;
3272 3273
      case 59: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy617, &yymsp[-1].minor.yy105, yymsp[0].minor.yy172); }
3274
        break;
3275 3276
      case 60: /* cmd ::= DROP DATABASE exists_opt db_name */
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy105); }
3277
        break;
3278 3279
      case 61: /* cmd ::= USE db_name */
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy105); }
3280
        break;
3281 3282
      case 62: /* cmd ::= ALTER DATABASE db_name alter_db_options */
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy105, yymsp[0].minor.yy172); }
3283
        break;
3284
      case 63: /* not_exists_opt ::= IF NOT EXISTS */
3285
{ yymsp[-2].minor.yy617 = true; }
3286
        break;
3287 3288 3289 3290
      case 64: /* not_exists_opt ::= */
      case 66: /* exists_opt ::= */ yytestcase(yyruleno==66);
      case 234: /* analyze_opt ::= */ yytestcase(yyruleno==234);
      case 242: /* agg_func_opt ::= */ yytestcase(yyruleno==242);
3291
      case 389: /* set_quantifier_opt ::= */ yytestcase(yyruleno==389);
3292
{ yymsp[1].minor.yy617 = false; }
3293
        break;
3294
      case 65: /* exists_opt ::= IF EXISTS */
3295
{ yymsp[-1].minor.yy617 = true; }
X
Xiaoyu Wang 已提交
3296
        break;
3297 3298
      case 67: /* db_options ::= */
{ yymsp[1].minor.yy172 = createDefaultDatabaseOptions(pCxt); }
3299
        break;
3300 3301 3302
      case 68: /* db_options ::= db_options BUFFER NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3303
        break;
3304 3305 3306
      case 69: /* db_options ::= db_options CACHELAST NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3307
        break;
3308 3309 3310
      case 70: /* db_options ::= db_options COMP NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3311
        break;
3312 3313 3314 3315
      case 71: /* db_options ::= db_options DAYS NK_INTEGER */
      case 72: /* db_options ::= db_options DAYS NK_VARIABLE */ yytestcase(yyruleno==72);
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3316
        break;
3317 3318 3319
      case 73: /* db_options ::= db_options FSYNC NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3320
        break;
3321 3322 3323
      case 74: /* db_options ::= db_options MAXROWS NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3324
        break;
3325 3326 3327
      case 75: /* db_options ::= db_options MINROWS NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3328
        break;
3329 3330 3331 3332
      case 76: /* db_options ::= db_options KEEP integer_list */
      case 77: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==77);
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_KEEP, yymsp[0].minor.yy60); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3333
        break;
3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427
      case 78: /* db_options ::= db_options PAGES NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 79: /* db_options ::= db_options PAGESIZE NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 80: /* db_options ::= db_options PRECISION NK_STRING */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 81: /* db_options ::= db_options REPLICA NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 82: /* db_options ::= db_options STRICT NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_STRICT, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 83: /* db_options ::= db_options WAL NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 84: /* db_options ::= db_options VGROUPS NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 85: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 86: /* db_options ::= db_options RETENTIONS retention_list */
{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_RETENTIONS, yymsp[0].minor.yy60); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 87: /* alter_db_options ::= alter_db_option */
{ yylhsminor.yy172 = createAlterDatabaseOptions(pCxt); yylhsminor.yy172 = setAlterDatabaseOption(pCxt, yylhsminor.yy172, &yymsp[0].minor.yy609); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 88: /* alter_db_options ::= alter_db_options alter_db_option */
{ yylhsminor.yy172 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy172, &yymsp[0].minor.yy609); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
        break;
      case 89: /* alter_db_option ::= BUFFER NK_INTEGER */
{ yymsp[-1].minor.yy609.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
        break;
      case 90: /* alter_db_option ::= CACHELAST NK_INTEGER */
{ yymsp[-1].minor.yy609.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
        break;
      case 91: /* alter_db_option ::= FSYNC NK_INTEGER */
{ yymsp[-1].minor.yy609.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
        break;
      case 92: /* alter_db_option ::= KEEP integer_list */
      case 93: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==93);
{ yymsp[-1].minor.yy609.type = DB_OPTION_KEEP; yymsp[-1].minor.yy609.pList = yymsp[0].minor.yy60; }
        break;
      case 94: /* alter_db_option ::= PAGES NK_INTEGER */
{ yymsp[-1].minor.yy609.type = DB_OPTION_PAGES; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
        break;
      case 95: /* alter_db_option ::= REPLICA NK_INTEGER */
{ yymsp[-1].minor.yy609.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
        break;
      case 96: /* alter_db_option ::= STRICT NK_INTEGER */
{ yymsp[-1].minor.yy609.type = DB_OPTION_STRICT; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
        break;
      case 97: /* alter_db_option ::= WAL NK_INTEGER */
{ yymsp[-1].minor.yy609.type = DB_OPTION_WAL; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
        break;
      case 98: /* integer_list ::= NK_INTEGER */
{ yylhsminor.yy60 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy60 = yylhsminor.yy60;
        break;
      case 99: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
      case 261: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==261);
{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy60 = yylhsminor.yy60;
        break;
      case 100: /* variable_list ::= NK_VARIABLE */
{ yylhsminor.yy60 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy60 = yylhsminor.yy60;
        break;
      case 101: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy60 = yylhsminor.yy60;
        break;
      case 102: /* retention_list ::= retention */
      case 122: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==122);
      case 125: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==125);
      case 132: /* column_def_list ::= column_def */ yytestcase(yyruleno==132);
      case 173: /* col_name_list ::= col_name */ yytestcase(yyruleno==173);
      case 211: /* func_name_list ::= func_name */ yytestcase(yyruleno==211);
      case 220: /* func_list ::= func */ yytestcase(yyruleno==220);
      case 286: /* literal_list ::= signed_literal */ yytestcase(yyruleno==286);
3428 3429 3430
      case 339: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==339);
      case 394: /* select_sublist ::= select_item */ yytestcase(yyruleno==394);
      case 443: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==443);
3431 3432 3433 3434 3435 3436 3437 3438 3439
{ yylhsminor.yy60 = createNodeList(pCxt, yymsp[0].minor.yy172); }
  yymsp[0].minor.yy60 = yylhsminor.yy60;
        break;
      case 103: /* retention_list ::= retention_list NK_COMMA retention */
      case 133: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==133);
      case 174: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==174);
      case 212: /* func_name_list ::= func_name_list NK_COMMA func_name */ yytestcase(yyruleno==212);
      case 221: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==221);
      case 287: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==287);
3440 3441 3442
      case 340: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==340);
      case 395: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==395);
      case 444: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==444);
3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482
{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, yymsp[0].minor.yy172); }
  yymsp[-2].minor.yy60 = yylhsminor.yy60;
        break;
      case 104: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
{ yylhsminor.yy172 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 105: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
      case 107: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==107);
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy617, yymsp[-5].minor.yy172, yymsp[-3].minor.yy60, yymsp[-1].minor.yy60, yymsp[0].minor.yy172); }
        break;
      case 106: /* cmd ::= CREATE TABLE multi_create_clause */
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy60); }
        break;
      case 108: /* cmd ::= DROP TABLE multi_drop_clause */
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy60); }
        break;
      case 109: /* cmd ::= DROP STABLE exists_opt full_table_name */
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy617, yymsp[0].minor.yy172); }
        break;
      case 110: /* cmd ::= ALTER TABLE alter_table_clause */
      case 111: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==111);
      case 263: /* cmd ::= query_expression */ yytestcase(yyruleno==263);
{ pCxt->pRootNode = yymsp[0].minor.yy172; }
        break;
      case 112: /* alter_table_clause ::= full_table_name alter_table_options */
{ yylhsminor.yy172 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
        break;
      case 113: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
{ yylhsminor.yy172 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248); }
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
        break;
      case 114: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
{ yylhsminor.yy172 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy172, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy105); }
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
        break;
      case 115: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
{ yylhsminor.yy172 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248); }
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
3483
        break;
3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494
      case 116: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
{ yylhsminor.yy172 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); }
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
        break;
      case 117: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
{ yylhsminor.yy172 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248); }
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
        break;
      case 118: /* alter_table_clause ::= full_table_name DROP TAG column_name */
{ yylhsminor.yy172 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy172, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy105); }
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
3495
        break;
3496 3497 3498
      case 119: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
{ yylhsminor.yy172 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248); }
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
3499
        break;
3500 3501 3502 3503 3504
      case 120: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
{ yylhsminor.yy172 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); }
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
        break;
      case 121: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
X
Xiaoyu Wang 已提交
3505
{ yylhsminor.yy172 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy172, &yymsp[-2].minor.yy105, releaseRawExprNode(pCxt, yymsp[0].minor.yy172)); }
3506
  yymsp[-5].minor.yy172 = yylhsminor.yy172;
3507
        break;
3508 3509 3510 3511
      case 123: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
      case 126: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==126);
{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-1].minor.yy60, yymsp[0].minor.yy172); }
  yymsp[-1].minor.yy60 = yylhsminor.yy60;
3512
        break;
3513 3514 3515
      case 124: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */
{ yylhsminor.yy172 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy617, yymsp[-8].minor.yy172, yymsp[-6].minor.yy172, yymsp[-5].minor.yy60, yymsp[-2].minor.yy60, yymsp[0].minor.yy172); }
  yymsp[-9].minor.yy172 = yylhsminor.yy172;
3516
        break;
3517 3518 3519
      case 127: /* drop_table_clause ::= exists_opt full_table_name */
{ yylhsminor.yy172 = createDropTableClause(pCxt, yymsp[-1].minor.yy617, yymsp[0].minor.yy172); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
3520
        break;
3521 3522
      case 128: /* specific_tags_opt ::= */
      case 159: /* tags_def_opt ::= */ yytestcase(yyruleno==159);
3523 3524 3525
      case 402: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==402);
      case 419: /* group_by_clause_opt ::= */ yytestcase(yyruleno==419);
      case 431: /* order_by_clause_opt ::= */ yytestcase(yyruleno==431);
3526
{ yymsp[1].minor.yy60 = NULL; }
3527
        break;
3528 3529
      case 129: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
{ yymsp[-2].minor.yy60 = yymsp[-1].minor.yy60; }
3530
        break;
3531 3532 3533
      case 130: /* full_table_name ::= table_name */
{ yylhsminor.yy172 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy105, NULL); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
3534
        break;
3535 3536 3537
      case 131: /* full_table_name ::= db_name NK_DOT table_name */
{ yylhsminor.yy172 = createRealTableNode(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105, NULL); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3538
        break;
3539 3540 3541
      case 134: /* column_def ::= column_name type_name */
{ yylhsminor.yy172 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248, NULL); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
3542
        break;
3543 3544 3545
      case 135: /* column_def ::= column_name type_name COMMENT NK_STRING */
{ yylhsminor.yy172 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy105, yymsp[-2].minor.yy248, &yymsp[0].minor.yy0); }
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
3546
        break;
3547 3548
      case 136: /* type_name ::= BOOL */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BOOL); }
3549
        break;
3550 3551
      case 137: /* type_name ::= TINYINT */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_TINYINT); }
3552
        break;
3553 3554
      case 138: /* type_name ::= SMALLINT */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
3555
        break;
3556 3557 3558
      case 139: /* type_name ::= INT */
      case 140: /* type_name ::= INTEGER */ yytestcase(yyruleno==140);
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_INT); }
3559
        break;
3560 3561
      case 141: /* type_name ::= BIGINT */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BIGINT); }
3562
        break;
3563 3564
      case 142: /* type_name ::= FLOAT */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_FLOAT); }
3565
        break;
3566 3567
      case 143: /* type_name ::= DOUBLE */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
3568
        break;
3569 3570
      case 144: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
3571
        break;
3572 3573
      case 145: /* type_name ::= TIMESTAMP */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
3574
        break;
3575 3576
      case 146: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
3577
        break;
3578 3579
      case 147: /* type_name ::= TINYINT UNSIGNED */
{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
3580
        break;
3581 3582
      case 148: /* type_name ::= SMALLINT UNSIGNED */
{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
3583
        break;
3584 3585
      case 149: /* type_name ::= INT UNSIGNED */
{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UINT); }
3586
        break;
3587 3588
      case 150: /* type_name ::= BIGINT UNSIGNED */
{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
3589
        break;
3590 3591
      case 151: /* type_name ::= JSON */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_JSON); }
3592
        break;
3593 3594
      case 152: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
3595
        break;
3596 3597
      case 153: /* type_name ::= MEDIUMBLOB */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
3598
        break;
3599 3600
      case 154: /* type_name ::= BLOB */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BLOB); }
3601
        break;
3602 3603
      case 155: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
3604
        break;
3605 3606
      case 156: /* type_name ::= DECIMAL */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3607
        break;
3608 3609
      case 157: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3610
        break;
3611 3612
      case 158: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
{ yymsp[-5].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3613
        break;
3614
      case 160: /* tags_def_opt ::= tags_def */
3615 3616
      case 338: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==338);
      case 393: /* select_list ::= select_sublist */ yytestcase(yyruleno==393);
3617 3618
{ yylhsminor.yy60 = yymsp[0].minor.yy60; }
  yymsp[0].minor.yy60 = yylhsminor.yy60;
3619
        break;
3620 3621
      case 161: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
{ yymsp[-3].minor.yy60 = yymsp[-1].minor.yy60; }
3622
        break;
3623 3624
      case 162: /* table_options ::= */
{ yymsp[1].minor.yy172 = createDefaultTableOptions(pCxt); }
3625
        break;
3626 3627 3628
      case 163: /* table_options ::= table_options COMMENT NK_STRING */
{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-2].minor.yy172, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3629
        break;
3630 3631 3632
      case 164: /* table_options ::= table_options DELAY NK_INTEGER */
{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-2].minor.yy172, TABLE_OPTION_DELAY, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3633
        break;
3634 3635 3636
      case 165: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */
{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-2].minor.yy172, TABLE_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3637
        break;
3638 3639 3640
      case 166: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-4].minor.yy172, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy60); }
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
3641
        break;
3642 3643 3644
      case 167: /* table_options ::= table_options TTL NK_INTEGER */
{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-2].minor.yy172, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3645
        break;
3646 3647 3648
      case 168: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-4].minor.yy172, TABLE_OPTION_SMA, yymsp[-1].minor.yy60); }
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
3649
        break;
3650 3651 3652
      case 169: /* alter_table_options ::= alter_table_option */
{ yylhsminor.yy172 = createAlterTableOptions(pCxt); yylhsminor.yy172 = setTableOption(pCxt, yylhsminor.yy172, yymsp[0].minor.yy609.type, &yymsp[0].minor.yy609.val); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
3653
        break;
3654 3655 3656
      case 170: /* alter_table_options ::= alter_table_options alter_table_option */
{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-1].minor.yy172, yymsp[0].minor.yy609.type, &yymsp[0].minor.yy609.val); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
3657
        break;
3658 3659
      case 171: /* alter_table_option ::= COMMENT NK_STRING */
{ yymsp[-1].minor.yy609.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
3660
        break;
3661 3662
      case 172: /* alter_table_option ::= TTL NK_INTEGER */
{ yymsp[-1].minor.yy609.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; }
3663
        break;
3664 3665 3666
      case 175: /* col_name ::= column_name */
{ yylhsminor.yy172 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy105); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
3667
        break;
3668
      case 176: /* cmd ::= SHOW DNODES */
X
Xiaoyu Wang 已提交
3669
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); }
3670
        break;
3671
      case 177: /* cmd ::= SHOW USERS */
X
Xiaoyu Wang 已提交
3672
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); }
3673
        break;
3674
      case 178: /* cmd ::= SHOW DATABASES */
X
Xiaoyu Wang 已提交
3675
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); }
3676
        break;
3677 3678
      case 179: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); }
3679
        break;
3680 3681
      case 180: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); }
3682
        break;
3683 3684
      case 181: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy172, NULL); }
3685
        break;
3686
      case 182: /* cmd ::= SHOW MNODES */
X
Xiaoyu Wang 已提交
3687
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); }
3688
        break;
3689
      case 183: /* cmd ::= SHOW MODULES */
X
Xiaoyu Wang 已提交
3690
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); }
3691
        break;
3692
      case 184: /* cmd ::= SHOW QNODES */
X
Xiaoyu Wang 已提交
3693
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); }
3694
        break;
3695
      case 185: /* cmd ::= SHOW FUNCTIONS */
X
Xiaoyu Wang 已提交
3696
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); }
3697
        break;
3698 3699
      case 186: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); }
3700
        break;
3701
      case 187: /* cmd ::= SHOW STREAMS */
X
Xiaoyu Wang 已提交
3702
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); }
3703
        break;
3704
      case 188: /* cmd ::= SHOW ACCOUNTS */
3705
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
3706
        break;
3707
      case 189: /* cmd ::= SHOW APPS */
3708
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT, NULL, NULL); }
3709
        break;
3710
      case 190: /* cmd ::= SHOW CONNECTIONS */
3711 3712
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT, NULL, NULL); }
        break;
3713 3714
      case 191: /* cmd ::= SHOW LICENCE */
      case 192: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==192);
3715 3716
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); }
        break;
3717 3718
      case 193: /* cmd ::= SHOW CREATE DATABASE db_name */
{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy105); }
3719
        break;
3720 3721
      case 194: /* cmd ::= SHOW CREATE TABLE full_table_name */
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy172); }
3722
        break;
3723 3724
      case 195: /* cmd ::= SHOW CREATE STABLE full_table_name */
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy172); }
3725
        break;
3726
      case 196: /* cmd ::= SHOW QUERIES */
3727 3728
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); }
        break;
3729
      case 197: /* cmd ::= SHOW SCORES */
3730
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT, NULL, NULL); }
3731
        break;
3732
      case 198: /* cmd ::= SHOW TOPICS */
3733 3734
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT, NULL, NULL); }
        break;
3735
      case 199: /* cmd ::= SHOW VARIABLES */
3736
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLE_STMT, NULL, NULL); }
X
Xiaoyu Wang 已提交
3737
        break;
3738
      case 200: /* cmd ::= SHOW BNODES */
3739 3740
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT, NULL, NULL); }
        break;
3741
      case 201: /* cmd ::= SHOW SNODES */
3742 3743
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT, NULL, NULL); }
        break;
3744
      case 202: /* cmd ::= SHOW CLUSTER */
3745 3746
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT, NULL, NULL); }
        break;
3747 3748
      case 203: /* cmd ::= SHOW TRANSACTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT, NULL, NULL); }
X
Xiaoyu Wang 已提交
3749
        break;
3750 3751 3752
      case 204: /* db_name_cond_opt ::= */
      case 209: /* from_db_opt ::= */ yytestcase(yyruleno==209);
{ yymsp[1].minor.yy172 = createDefaultDatabaseCondValue(pCxt); }
X
Xiaoyu Wang 已提交
3753
        break;
3754 3755 3756
      case 205: /* db_name_cond_opt ::= db_name NK_DOT */
{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy105); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3757
        break;
3758 3759 3760
      case 206: /* like_pattern_opt ::= */
      case 217: /* index_options ::= */ yytestcase(yyruleno==217);
      case 248: /* into_opt ::= */ yytestcase(yyruleno==248);
3761 3762 3763 3764 3765 3766 3767
      case 400: /* where_clause_opt ::= */ yytestcase(yyruleno==400);
      case 404: /* twindow_clause_opt ::= */ yytestcase(yyruleno==404);
      case 409: /* sliding_opt ::= */ yytestcase(yyruleno==409);
      case 411: /* fill_opt ::= */ yytestcase(yyruleno==411);
      case 423: /* having_clause_opt ::= */ yytestcase(yyruleno==423);
      case 433: /* slimit_clause_opt ::= */ yytestcase(yyruleno==433);
      case 437: /* limit_clause_opt ::= */ yytestcase(yyruleno==437);
3768
{ yymsp[1].minor.yy172 = NULL; }
X
Xiaoyu Wang 已提交
3769
        break;
3770 3771
      case 207: /* like_pattern_opt ::= LIKE NK_STRING */
{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3772
        break;
3773 3774 3775
      case 208: /* table_name_cond ::= table_name */
{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy105); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3776
        break;
3777 3778
      case 210: /* from_db_opt ::= FROM db_name */
{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy105); }
X
Xiaoyu Wang 已提交
3779
        break;
3780 3781 3782
      case 213: /* func_name ::= function_name */
{ yylhsminor.yy172 = createFunctionNode(pCxt, &yymsp[0].minor.yy105, NULL); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3783
        break;
3784 3785
      case 214: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy105, &yymsp[-1].minor.yy105, NULL, yymsp[0].minor.yy172); }
X
Xiaoyu Wang 已提交
3786
        break;
3787 3788
      case 215: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy617, &yymsp[-5].minor.yy105, &yymsp[-3].minor.yy105, yymsp[-1].minor.yy60, NULL); }
X
Xiaoyu Wang 已提交
3789
        break;
3790 3791
      case 216: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy617, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105); }
X
Xiaoyu Wang 已提交
3792
        break;
3793 3794
      case 218: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
{ yymsp[-8].minor.yy172 = createIndexOption(pCxt, yymsp[-6].minor.yy60, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), NULL, yymsp[0].minor.yy172); }
X
Xiaoyu Wang 已提交
3795
        break;
3796 3797
      case 219: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
{ yymsp[-10].minor.yy172 = createIndexOption(pCxt, yymsp[-8].minor.yy60, releaseRawExprNode(pCxt, yymsp[-4].minor.yy172), releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), yymsp[0].minor.yy172); }
X
Xiaoyu Wang 已提交
3798
        break;
3799 3800 3801
      case 222: /* func ::= function_name NK_LP expression_list NK_RP */
{ yylhsminor.yy172 = createFunctionNode(pCxt, &yymsp[-3].minor.yy105, yymsp[-1].minor.yy60); }
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3802
        break;
3803 3804
      case 223: /* cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS query_expression */
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy105, yymsp[0].minor.yy172, NULL, yymsp[-2].minor.yy172); }
3805
        break;
3806 3807
      case 224: /* cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS db_name */
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy105, NULL, &yymsp[0].minor.yy105, yymsp[-2].minor.yy172); }
3808
        break;
3809 3810
      case 225: /* cmd ::= DROP TOPIC exists_opt topic_name */
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy105); }
3811
        break;
3812 3813
      case 226: /* topic_options ::= */
{ yymsp[1].minor.yy172 = createTopicOptions(pCxt); }
X
Xiaoyu Wang 已提交
3814
        break;
3815 3816 3817
      case 227: /* topic_options ::= topic_options WITH TABLE */
{ ((STopicOptions*)yymsp[-2].minor.yy172)->withTable = true; yylhsminor.yy172 = yymsp[-2].minor.yy172; }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3818
        break;
3819 3820 3821
      case 228: /* topic_options ::= topic_options WITH SCHEMA */
{ ((STopicOptions*)yymsp[-2].minor.yy172)->withSchema = true; yylhsminor.yy172 = yymsp[-2].minor.yy172; }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3822
        break;
3823 3824 3825
      case 229: /* topic_options ::= topic_options WITH TAG */
{ ((STopicOptions*)yymsp[-2].minor.yy172)->withTag = true; yylhsminor.yy172 = yymsp[-2].minor.yy172; }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3826
        break;
3827 3828 3829 3830 3831
      case 230: /* cmd ::= DESC full_table_name */
      case 231: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==231);
{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy172); }
        break;
      case 232: /* cmd ::= RESET QUERY CACHE */
3832 3833
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
        break;
3834 3835
      case 233: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */
{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy617, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); }
3836
        break;
3837 3838
      case 235: /* analyze_opt ::= ANALYZE */
      case 243: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==243);
3839
      case 390: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==390);
3840
{ yymsp[0].minor.yy617 = true; }
3841
        break;
3842 3843
      case 236: /* explain_options ::= */
{ yymsp[1].minor.yy172 = createDefaultExplainOptions(pCxt); }
3844
        break;
3845 3846 3847
      case 237: /* explain_options ::= explain_options VERBOSE NK_BOOL */
{ yylhsminor.yy172 = setExplainVerbose(pCxt, yymsp[-2].minor.yy172, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3848
        break;
3849 3850 3851
      case 238: /* explain_options ::= explain_options RATIO NK_FLOAT */
{ yylhsminor.yy172 = setExplainRatio(pCxt, yymsp[-2].minor.yy172, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3852
        break;
3853 3854
      case 239: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy60); }
3855
        break;
3856 3857
      case 240: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy617, yymsp[-8].minor.yy617, &yymsp[-5].minor.yy105, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy248, yymsp[0].minor.yy140); }
3858
        break;
3859 3860
      case 241: /* cmd ::= DROP FUNCTION exists_opt function_name */
{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy105); }
3861
        break;
3862 3863
      case 244: /* bufsize_opt ::= */
{ yymsp[1].minor.yy140 = 0; }
3864
        break;
3865 3866
      case 245: /* bufsize_opt ::= BUFSIZE NK_INTEGER */
{ yymsp[-1].minor.yy140 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
3867
        break;
3868 3869
      case 246: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy617, &yymsp[-4].minor.yy105, yymsp[-2].minor.yy172, yymsp[-3].minor.yy172, yymsp[0].minor.yy172); }
3870
        break;
3871 3872
      case 247: /* cmd ::= DROP STREAM exists_opt stream_name */
{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy105); }
3873
        break;
3874
      case 249: /* into_opt ::= INTO full_table_name */
3875 3876 3877
      case 371: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==371);
      case 401: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==401);
      case 424: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==424);
3878
{ yymsp[-1].minor.yy172 = yymsp[0].minor.yy172; }
3879
        break;
3880 3881
      case 250: /* stream_options ::= */
{ yymsp[1].minor.yy172 = createStreamOptions(pCxt); }
3882
        break;
3883 3884 3885
      case 251: /* stream_options ::= stream_options TRIGGER AT_ONCE */
{ ((SStreamOptions*)yymsp[-2].minor.yy172)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy172 = yymsp[-2].minor.yy172; }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3886
        break;
3887 3888 3889
      case 252: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
{ ((SStreamOptions*)yymsp[-2].minor.yy172)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy172 = yymsp[-2].minor.yy172; }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3890
        break;
3891 3892 3893
      case 253: /* stream_options ::= stream_options WATERMARK duration_literal */
{ ((SStreamOptions*)yymsp[-2].minor.yy172)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy172); yylhsminor.yy172 = yymsp[-2].minor.yy172; }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
3894
        break;
3895
      case 254: /* cmd ::= KILL CONNECTION NK_INTEGER */
3896 3897
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
        break;
3898
      case 255: /* cmd ::= KILL QUERY NK_INTEGER */
3899 3900
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_QUERY_STMT, &yymsp[0].minor.yy0); }
        break;
3901 3902 3903 3904
      case 256: /* cmd ::= KILL TRANSACTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); }
        break;
      case 257: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
3905 3906
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3907 3908
      case 258: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy60); }
3909
        break;
3910
      case 259: /* cmd ::= SPLIT VGROUP NK_INTEGER */
3911 3912
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945
      case 260: /* dnode_list ::= DNODE NK_INTEGER */
{ yymsp[-1].minor.yy60 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
        break;
      case 262: /* cmd ::= SYNCDB db_name REPLICA */
{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy105); }
        break;
      case 264: /* literal ::= NK_INTEGER */
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 265: /* literal ::= NK_FLOAT */
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 266: /* literal ::= NK_STRING */
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 267: /* literal ::= NK_BOOL */
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 268: /* literal ::= TIMESTAMP NK_STRING */
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
        break;
      case 269: /* literal ::= duration_literal */
      case 279: /* signed_literal ::= signed */ yytestcase(yyruleno==279);
      case 298: /* expression ::= literal */ yytestcase(yyruleno==298);
      case 299: /* expression ::= pseudo_column */ yytestcase(yyruleno==299);
      case 300: /* expression ::= column_reference */ yytestcase(yyruleno==300);
      case 301: /* expression ::= function_expression */ yytestcase(yyruleno==301);
      case 302: /* expression ::= subquery */ yytestcase(yyruleno==302);
3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956
      case 327: /* function_expression ::= literal_func */ yytestcase(yyruleno==327);
      case 363: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==363);
      case 367: /* boolean_primary ::= predicate */ yytestcase(yyruleno==367);
      case 369: /* common_expression ::= expression */ yytestcase(yyruleno==369);
      case 370: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==370);
      case 372: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==372);
      case 374: /* table_reference ::= table_primary */ yytestcase(yyruleno==374);
      case 375: /* table_reference ::= joined_table */ yytestcase(yyruleno==375);
      case 379: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==379);
      case 426: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==426);
      case 429: /* query_primary ::= query_specification */ yytestcase(yyruleno==429);
3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979
{ yylhsminor.yy172 = yymsp[0].minor.yy172; }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 270: /* literal ::= NULL */
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 271: /* literal ::= NK_QUESTION */
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 272: /* duration_literal ::= NK_VARIABLE */
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 273: /* signed ::= NK_INTEGER */
{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 274: /* signed ::= NK_PLUS NK_INTEGER */
{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
        break;
      case 275: /* signed ::= NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
3980 3981 3982
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3983
                                                                                    yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
X
Xiaoyu Wang 已提交
3984
                                                                                  }
3985
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3986
        break;
3987 3988 3989
      case 276: /* signed ::= NK_FLOAT */
{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
3990
        break;
3991 3992
      case 277: /* signed ::= NK_PLUS NK_FLOAT */
{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3993
        break;
3994
      case 278: /* signed ::= NK_MINUS NK_FLOAT */
X
Xiaoyu Wang 已提交
3995 3996 3997
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3998
                                                                                    yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
X
Xiaoyu Wang 已提交
3999
                                                                                  }
4000
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
4001
        break;
4002 4003 4004
      case 280: /* signed_literal ::= NK_STRING */
{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
4005
        break;
4006 4007 4008
      case 281: /* signed_literal ::= NK_BOOL */
{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
4009
        break;
4010 4011
      case 282: /* signed_literal ::= TIMESTAMP NK_STRING */
{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
4012
        break;
4013 4014
      case 283: /* signed_literal ::= duration_literal */
      case 285: /* signed_literal ::= literal_func */ yytestcase(yyruleno==285);
4015 4016 4017
      case 341: /* star_func_para ::= expression */ yytestcase(yyruleno==341);
      case 396: /* select_item ::= common_expression */ yytestcase(yyruleno==396);
      case 442: /* search_condition ::= common_expression */ yytestcase(yyruleno==442);
4018 4019
{ yylhsminor.yy172 = releaseRawExprNode(pCxt, yymsp[0].minor.yy172); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
4020
        break;
4021 4022 4023
      case 284: /* signed_literal ::= NULL */
{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
4024
        break;
4025
      case 303: /* expression ::= NK_LP expression NK_RP */
4026
      case 368: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==368);
4027 4028
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172)); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4029
        break;
4030
      case 304: /* expression ::= NK_PLUS expression */
4031
{
4032 4033
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy172));
4034
                                                                                  }
4035
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
4036
        break;
4037
      case 305: /* expression ::= NK_MINUS expression */
4038
{
4039 4040
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy172), NULL));
4041
                                                                                  }
4042
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
4043
        break;
4044
      case 306: /* expression ::= expression NK_PLUS expression */
4045
{
4046 4047 4048
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); 
4049
                                                                                  }
4050
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4051
        break;
4052
      case 307: /* expression ::= expression NK_MINUS expression */
4053
{
4054 4055 4056
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); 
4057
                                                                                  }
4058
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4059
        break;
4060
      case 308: /* expression ::= expression NK_STAR expression */
4061
{
4062 4063 4064
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); 
4065
                                                                                  }
4066
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4067
        break;
4068
      case 309: /* expression ::= expression NK_SLASH expression */
4069
{
4070 4071 4072
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); 
4073
                                                                                  }
4074
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4075
        break;
4076
      case 310: /* expression ::= expression NK_REM expression */
4077
{
4078 4079 4080
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); 
4081
                                                                                  }
4082
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4083
        break;
4084
      case 311: /* expression ::= column_reference NK_ARROW NK_STRING */
4085
{
4086 4087
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); 
4088
                                                                                  }
4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 312: /* expression_list ::= expression */
{ yylhsminor.yy60 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172)); }
  yymsp[0].minor.yy60 = yylhsminor.yy60;
        break;
      case 313: /* expression_list ::= expression_list NK_COMMA expression */
{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, releaseRawExprNode(pCxt, yymsp[0].minor.yy172)); }
  yymsp[-2].minor.yy60 = yylhsminor.yy60;
        break;
      case 314: /* column_reference ::= column_name */
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy105, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy105)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
      case 315: /* column_reference ::= table_name NK_DOT column_name */
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105, createColumnNode(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105)); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 316: /* pseudo_column ::= ROWTS */
      case 317: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==317);
4109 4110 4111 4112 4113 4114
      case 319: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==319);
      case 320: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==320);
      case 321: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==321);
      case 322: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==322);
      case 323: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==323);
      case 329: /* literal_func ::= NOW */ yytestcase(yyruleno==329);
4115 4116 4117
{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
  yymsp[0].minor.yy172 = yylhsminor.yy172;
        break;
4118 4119 4120 4121 4122 4123
      case 318: /* pseudo_column ::= table_name NK_DOT TBNAME */
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy105)))); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
      case 324: /* function_expression ::= function_name NK_LP expression_list NK_RP */
      case 325: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==325);
4124 4125 4126
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy105, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy105, yymsp[-1].minor.yy60)); }
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
        break;
4127
      case 326: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */
4128 4129 4130
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), yymsp[-1].minor.yy248)); }
  yymsp[-5].minor.yy172 = yylhsminor.yy172;
        break;
4131
      case 328: /* literal_func ::= noarg_func NK_LP NK_RP */
4132 4133 4134
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy105, NULL)); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
4135
      case 337: /* star_func_para_list ::= NK_STAR */
4136 4137 4138
{ yylhsminor.yy60 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy60 = yylhsminor.yy60;
        break;
4139 4140
      case 342: /* star_func_para ::= table_name NK_DOT NK_STAR */
      case 399: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==399);
4141 4142 4143
{ yylhsminor.yy172 = createColumnNode(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
        break;
4144 4145
      case 343: /* predicate ::= expression compare_op expression */
      case 348: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==348);
4146
{
4147 4148 4149
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy572, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
4150
                                                                                  }
4151
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4152
        break;
4153
      case 344: /* predicate ::= expression BETWEEN expression AND expression */
4154
{
4155 4156 4157
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy172), releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
4158
                                                                                  }
4159
  yymsp[-4].minor.yy172 = yylhsminor.yy172;
4160
        break;
4161
      case 345: /* predicate ::= expression NOT BETWEEN expression AND expression */
4162
{
4163 4164 4165
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy172), releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
4166
                                                                                  }
4167
  yymsp[-5].minor.yy172 = yylhsminor.yy172;
4168
        break;
4169
      case 346: /* predicate ::= expression IS NULL */
4170
{
4171 4172
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), NULL));
4173
                                                                                  }
4174
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4175
        break;
4176
      case 347: /* predicate ::= expression IS NOT NULL */
4177
{
4178 4179
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), NULL));
4180
                                                                                  }
4181
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
4182
        break;
4183
      case 349: /* compare_op ::= NK_LT */
4184
{ yymsp[0].minor.yy572 = OP_TYPE_LOWER_THAN; }
4185
        break;
4186
      case 350: /* compare_op ::= NK_GT */
4187
{ yymsp[0].minor.yy572 = OP_TYPE_GREATER_THAN; }
4188
        break;
4189
      case 351: /* compare_op ::= NK_LE */
4190
{ yymsp[0].minor.yy572 = OP_TYPE_LOWER_EQUAL; }
4191
        break;
4192
      case 352: /* compare_op ::= NK_GE */
4193
{ yymsp[0].minor.yy572 = OP_TYPE_GREATER_EQUAL; }
4194
        break;
4195
      case 353: /* compare_op ::= NK_NE */
4196
{ yymsp[0].minor.yy572 = OP_TYPE_NOT_EQUAL; }
4197
        break;
4198
      case 354: /* compare_op ::= NK_EQ */
4199
{ yymsp[0].minor.yy572 = OP_TYPE_EQUAL; }
4200
        break;
4201
      case 355: /* compare_op ::= LIKE */
4202
{ yymsp[0].minor.yy572 = OP_TYPE_LIKE; }
4203
        break;
4204
      case 356: /* compare_op ::= NOT LIKE */
4205
{ yymsp[-1].minor.yy572 = OP_TYPE_NOT_LIKE; }
4206
        break;
4207
      case 357: /* compare_op ::= MATCH */
4208
{ yymsp[0].minor.yy572 = OP_TYPE_MATCH; }
4209
        break;
4210
      case 358: /* compare_op ::= NMATCH */
4211
{ yymsp[0].minor.yy572 = OP_TYPE_NMATCH; }
4212
        break;
4213
      case 359: /* compare_op ::= CONTAINS */
4214
{ yymsp[0].minor.yy572 = OP_TYPE_JSON_CONTAINS; }
4215
        break;
4216
      case 360: /* in_op ::= IN */
4217
{ yymsp[0].minor.yy572 = OP_TYPE_IN; }
4218
        break;
4219
      case 361: /* in_op ::= NOT IN */
4220
{ yymsp[-1].minor.yy572 = OP_TYPE_NOT_IN; }
4221
        break;
4222
      case 362: /* in_predicate_value ::= NK_LP expression_list NK_RP */
4223 4224
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy60)); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4225
        break;
4226
      case 364: /* boolean_value_expression ::= NOT boolean_primary */
4227
{
4228 4229
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy172), NULL));
4230
                                                                                  }
4231
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
4232
        break;
4233
      case 365: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
4234
{
4235 4236 4237
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
4238
                                                                                  }
4239
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4240
        break;
4241
      case 366: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
4242
{
4243 4244 4245
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
                                                                                    yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
4246
                                                                                  }
4247
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4248
        break;
4249
      case 373: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
4250 4251
{ yylhsminor.yy172 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy172, yymsp[0].minor.yy172, NULL); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4252
        break;
4253
      case 376: /* table_primary ::= table_name alias_opt */
4254 4255
{ yylhsminor.yy172 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
4256
        break;
4257
      case 377: /* table_primary ::= db_name NK_DOT table_name alias_opt */
4258 4259
{ yylhsminor.yy172 = createRealTableNode(pCxt, &yymsp[-3].minor.yy105, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); }
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
4260
        break;
4261
      case 378: /* table_primary ::= subquery alias_opt */
4262 4263
{ yylhsminor.yy172 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172), &yymsp[0].minor.yy105); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
4264
        break;
4265
      case 380: /* alias_opt ::= */
4266
{ yymsp[1].minor.yy105 = nil_token;  }
4267
        break;
4268
      case 381: /* alias_opt ::= table_alias */
4269 4270
{ yylhsminor.yy105 = yymsp[0].minor.yy105; }
  yymsp[0].minor.yy105 = yylhsminor.yy105;
4271
        break;
4272
      case 382: /* alias_opt ::= AS table_alias */
4273
{ yymsp[-1].minor.yy105 = yymsp[0].minor.yy105; }
4274
        break;
4275 4276
      case 383: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
      case 384: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==384);
4277
{ yymsp[-2].minor.yy172 = yymsp[-1].minor.yy172; }
4278
        break;
4279
      case 385: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
4280 4281
{ yylhsminor.yy172 = createJoinTableNode(pCxt, yymsp[-4].minor.yy636, yymsp[-5].minor.yy172, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); }
  yymsp[-5].minor.yy172 = yylhsminor.yy172;
4282
        break;
4283
      case 386: /* join_type ::= */
4284
{ yymsp[1].minor.yy636 = JOIN_TYPE_INNER; }
4285
        break;
4286
      case 387: /* join_type ::= INNER */
4287
{ yymsp[0].minor.yy636 = JOIN_TYPE_INNER; }
4288
        break;
4289
      case 388: /* 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 */
4290
{ 
4291 4292 4293 4294 4295 4296
                                                                                    yymsp[-8].minor.yy172 = createSelectStmt(pCxt, yymsp[-7].minor.yy617, yymsp[-6].minor.yy60, yymsp[-5].minor.yy172);
                                                                                    yymsp[-8].minor.yy172 = addWhereClause(pCxt, yymsp[-8].minor.yy172, yymsp[-4].minor.yy172);
                                                                                    yymsp[-8].minor.yy172 = addPartitionByClause(pCxt, yymsp[-8].minor.yy172, yymsp[-3].minor.yy60);
                                                                                    yymsp[-8].minor.yy172 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy172, yymsp[-2].minor.yy172);
                                                                                    yymsp[-8].minor.yy172 = addGroupByClause(pCxt, yymsp[-8].minor.yy172, yymsp[-1].minor.yy60);
                                                                                    yymsp[-8].minor.yy172 = addHavingClause(pCxt, yymsp[-8].minor.yy172, yymsp[0].minor.yy172);
4297 4298
                                                                                  }
        break;
4299
      case 391: /* set_quantifier_opt ::= ALL */
4300
{ yymsp[0].minor.yy617 = false; }
4301
        break;
4302
      case 392: /* select_list ::= NK_STAR */
4303
{ yymsp[0].minor.yy60 = NULL; }
4304
        break;
4305
      case 397: /* select_item ::= common_expression column_alias */
4306 4307
{ yylhsminor.yy172 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172), &yymsp[0].minor.yy105); }
  yymsp[-1].minor.yy172 = yylhsminor.yy172;
4308
        break;
4309
      case 398: /* select_item ::= common_expression AS column_alias */
4310 4311
{ yylhsminor.yy172 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), &yymsp[0].minor.yy105); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4312
        break;
4313 4314 4315
      case 403: /* partition_by_clause_opt ::= PARTITION BY expression_list */
      case 420: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==420);
      case 432: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==432);
4316
{ yymsp[-2].minor.yy60 = yymsp[0].minor.yy60; }
4317
        break;
4318
      case 405: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
4319
{ yymsp[-5].minor.yy172 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), releaseRawExprNode(pCxt, yymsp[-1].minor.yy172)); }
4320
        break;
4321
      case 406: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
4322
{ yymsp[-3].minor.yy172 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172)); }
4323
        break;
4324
      case 407: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
4325
{ yymsp[-5].minor.yy172 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), NULL, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); }
4326
        break;
4327
      case 408: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
4328
{ yymsp[-7].minor.yy172 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy172), releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), yymsp[-1].minor.yy172, yymsp[0].minor.yy172); }
4329
        break;
4330
      case 410: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
4331
{ yymsp[-3].minor.yy172 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy172); }
4332
        break;
4333
      case 412: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
4334
{ yymsp[-3].minor.yy172 = createFillNode(pCxt, yymsp[-1].minor.yy202, NULL); }
4335
        break;
4336
      case 413: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
4337
{ yymsp[-5].minor.yy172 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy60)); }
4338
        break;
4339
      case 414: /* fill_mode ::= NONE */
4340
{ yymsp[0].minor.yy202 = FILL_MODE_NONE; }
4341
        break;
4342
      case 415: /* fill_mode ::= PREV */
4343
{ yymsp[0].minor.yy202 = FILL_MODE_PREV; }
4344
        break;
4345
      case 416: /* fill_mode ::= NULL */
4346
{ yymsp[0].minor.yy202 = FILL_MODE_NULL; }
4347
        break;
4348
      case 417: /* fill_mode ::= LINEAR */
4349
{ yymsp[0].minor.yy202 = FILL_MODE_LINEAR; }
4350
        break;
4351
      case 418: /* fill_mode ::= NEXT */
4352
{ yymsp[0].minor.yy202 = FILL_MODE_NEXT; }
4353
        break;
4354
      case 421: /* group_by_list ::= expression */
4355 4356
{ yylhsminor.yy60 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); }
  yymsp[0].minor.yy60 = yylhsminor.yy60;
4357
        break;
4358
      case 422: /* group_by_list ::= group_by_list NK_COMMA expression */
4359 4360
{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); }
  yymsp[-2].minor.yy60 = yylhsminor.yy60;
4361
        break;
4362
      case 425: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
4363
{ 
4364 4365 4366
                                                                                    yylhsminor.yy172 = addOrderByClause(pCxt, yymsp[-3].minor.yy172, yymsp[-2].minor.yy60);
                                                                                    yylhsminor.yy172 = addSlimitClause(pCxt, yylhsminor.yy172, yymsp[-1].minor.yy172);
                                                                                    yylhsminor.yy172 = addLimitClause(pCxt, yylhsminor.yy172, yymsp[0].minor.yy172);
4367
                                                                                  }
4368
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
4369
        break;
4370
      case 427: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
4371 4372
{ yylhsminor.yy172 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy172, yymsp[0].minor.yy172); }
  yymsp[-3].minor.yy172 = yylhsminor.yy172;
4373
        break;
4374
      case 428: /* query_expression_body ::= query_expression_body UNION query_expression_body */
4375 4376
{ yylhsminor.yy172 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
X
Xiaoyu Wang 已提交
4377
        break;
4378
      case 430: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
X
Xiaoyu Wang 已提交
4379 4380 4381 4382 4383
{ yymsp[-5].minor.yy172 = yymsp[-4].minor.yy172; }
  yy_destructor(yypParser,350,&yymsp[-3].minor);
  yy_destructor(yypParser,351,&yymsp[-2].minor);
  yy_destructor(yypParser,352,&yymsp[-1].minor);
        break;
4384 4385
      case 434: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
      case 438: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==438);
4386
{ yymsp[-1].minor.yy172 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
4387
        break;
4388 4389
      case 435: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
      case 439: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==439);
4390
{ yymsp[-3].minor.yy172 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
4391
        break;
4392 4393
      case 436: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
      case 440: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==440);
4394
{ yymsp[-3].minor.yy172 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
4395
        break;
4396
      case 441: /* subquery ::= NK_LP query_expression NK_RP */
4397 4398
{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy172); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4399
        break;
4400
      case 445: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
4401 4402
{ yylhsminor.yy172 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), yymsp[-1].minor.yy14, yymsp[0].minor.yy17); }
  yymsp[-2].minor.yy172 = yylhsminor.yy172;
4403
        break;
4404
      case 446: /* ordering_specification_opt ::= */
4405
{ yymsp[1].minor.yy14 = ORDER_ASC; }
4406
        break;
4407
      case 447: /* ordering_specification_opt ::= ASC */
4408
{ yymsp[0].minor.yy14 = ORDER_ASC; }
4409
        break;
4410
      case 448: /* ordering_specification_opt ::= DESC */
4411
{ yymsp[0].minor.yy14 = ORDER_DESC; }
4412
        break;
4413
      case 449: /* null_ordering_opt ::= */
4414
{ yymsp[1].minor.yy17 = NULL_ORDER_DEFAULT; }
4415
        break;
4416
      case 450: /* null_ordering_opt ::= NULLS FIRST */
4417
{ yymsp[-1].minor.yy17 = NULL_ORDER_FIRST; }
4418
        break;
4419
      case 451: /* null_ordering_opt ::= NULLS LAST */
4420
{ yymsp[-1].minor.yy17 = NULL_ORDER_LAST; }
4421 4422 4423 4424 4425
        break;
      default:
        break;
/********** End reduce actions ************************************************/
  };
4426 4427 4428
  assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452
  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 已提交
4453 4454
  ParseARG_FETCH
  ParseCTX_FETCH
4455 4456 4457 4458 4459 4460 4461 4462 4463 4464
#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 已提交
4465 4466
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4467 4468 4469 4470 4471 4472 4473 4474 4475
}
#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 已提交
4476
  ParseTOKENTYPE yyminor         /* The minor type of the error token */
4477
){
X
Xiaoyu Wang 已提交
4478 4479
  ParseARG_FETCH
  ParseCTX_FETCH
4480 4481
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
4482

4483
  if (TSDB_CODE_SUCCESS == pCxt->errCode) {
4484
    if(TOKEN.z) {
4485
      pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
4486
    } else {
4487
      pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
4488
    }
4489 4490
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
4491 4492
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4493 4494 4495 4496 4497 4498 4499 4500
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
4501 4502
  ParseARG_FETCH
  ParseCTX_FETCH
4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515
#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 已提交
4516 4517
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4518 4519 4520 4521
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
4522
** "ParseAlloc" which describes the current state of the parser.
4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538
** 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 已提交
4539
void Parse(
4540 4541
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
4542 4543
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
4544 4545 4546 4547 4548 4549 4550 4551 4552 4553
){
  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 已提交
4554 4555
  ParseCTX_FETCH
  ParseARG_STORE
4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579

  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 已提交
4580
                        yyminor ParseCTX_PARAM);
4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712
    }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 已提交
4713
int ParseFallback(int iToken){
4714
#ifdef YYFALLBACK
4715 4716 4717
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
4718 4719
#else
  (void)iToken;
4720
#endif
4721
  return 0;
4722
}