sql.c 204.3 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
X
Xiaoyu Wang 已提交
103
#define YYNOCODE 308
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;
X
Xiaoyu Wang 已提交
109 110 111 112 113 114 115 116 117 118 119 120
  ENullOrder yy81;
  SNode* yy168;
  SDataType yy224;
  SAlterOption yy277;
  SNodeList* yy376;
  EFillMode yy382;
  SToken yy393;
  EOperatorType yy436;
  int32_t yy508;
  bool yy537;
  EOrder yy554;
  EJoinType yy596;
121 122 123 124
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
X
Xiaoyu Wang 已提交
125 126 127 128 129 130 131 132 133 134
#define ParseARG_SDECL  SAstCreateContext* pCxt ;
#define ParseARG_PDECL , SAstCreateContext* pCxt 
#define ParseARG_PARAM ,pCxt 
#define ParseARG_FETCH  SAstCreateContext* pCxt =yypParser->pCxt ;
#define ParseARG_STORE yypParser->pCxt =pCxt ;
#define ParseCTX_SDECL
#define ParseCTX_PDECL
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
X
Xiaoyu Wang 已提交
135 136 137 138 139 140 141 142 143 144 145
#define YYNSTATE             518
#define YYNRULE              398
#define YYNTOKEN             202
#define YY_MAX_SHIFT         517
#define YY_MIN_SHIFTREDUCE   774
#define YY_MAX_SHIFTREDUCE   1171
#define YY_ERROR_ACTION      1172
#define YY_ACCEPT_ACTION     1173
#define YY_NO_ACTION         1174
#define YY_MIN_REDUCE        1175
#define YY_MAX_REDUCE        1572
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))

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


/* Next are the tables used to determine what action to take based on the
** current state and lookahead token.  These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.  
**
** Suppose the action integer is N.  Then the action is determined as
** follows
**
**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
**                                      token onto the stack and goto state N.
**
**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
**
**   N == YY_ERROR_ACTION               A syntax error has occurred.
**
**   N == YY_ACCEPT_ACTION              The parser accepts its input.
**
**   N == YY_NO_ACTION                  No such action.  Denotes unused
**                                      slots in the yy_action[] table.
**
**   N between YY_MIN_REDUCE            Reduce by rule N-YY_MIN_REDUCE
**     and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either:
**
**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
**    (B)   N = yy_default[S]
**
** The (A) formula is preferred.  The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
**
** The formulas above are for computing the action when the lookahead is
** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array.
**
** The following are the tables generated in this section:
**
**  yy_action[]        A single table containing all actions.
**  yy_lookahead[]     A table containing the lookahead for each entry in
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
**
*********** Begin parsing tables **********************************************/
X
Xiaoyu Wang 已提交
212
#define YY_ACTTAB_COUNT (1472)
213
static const YYACTIONTYPE yy_action[] = {
X
Xiaoyu Wang 已提交
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
 /*     0 */   445,  255, 1427,  114,  389, 1441, 1278,  310,  445,   72,
 /*    10 */   272, 1292,   31,   29, 1423, 1430,  352,   72, 1427,  445,
 /*    20 */   264,   65, 1010,  215,  358, 1289, 1319, 1427,  308, 1457,
 /*    30 */  1423, 1429, 1551, 1289, 1173,  100,  416,  236, 1008, 1423,
 /*    40 */  1429,  116, 1281, 1187, 1289, 1550,  431,   11,  390, 1549,
 /*    50 */  1414,   31,   29, 1114, 1015,  445,  445,  444, 1441,  264,
 /*    60 */   444, 1010, 1280,  445,  309,  315,   69, 1442, 1443, 1446,
 /*    70 */  1490,    1,  316,  444,  257, 1486,  123, 1008, 1457, 1551,
 /*    80 */  1289, 1289, 1457, 1032,  413,  429,   11,  280, 1289,  429,
 /*    90 */    31,   29,  128, 1015,  514, 1518, 1549,  275,  264,  431,
 /*   100 */  1010,   21,  343, 1414, 1367, 1369, 1009, 1414,   12,   99,
 /*   110 */     1,   32,   30,   28,   27,   26, 1008,  406, 1551,   70,
 /*   120 */  1442, 1443, 1446, 1490,   12,   11, 1030, 1489, 1486,   31,
 /*   130 */    29,  128, 1015,  514,  407, 1549, 1364,  264,  432, 1010,
 /*   140 */  1011,  267,   97,  136, 1376, 1009,   28,   27,   26,    1,
 /*   150 */  1010,  415,  124, 1497, 1498, 1008, 1502, 1014, 1058, 1059,
 /*   160 */  1060, 1061, 1062, 1063, 1064, 1065, 1008,  268,   31,   29,
 /*   170 */   430, 1015,  514, 1033, 1336,  114,  264,  129, 1010, 1011,
 /*   180 */   254,  304, 1015, 1291, 1009, 1334,   25,  193,    7,   32,
 /*   190 */    30,   28,   27,   26, 1008,  413, 1014, 1058, 1059, 1060,
 /*   200 */  1061, 1062, 1063, 1064, 1065, 1267,  403,   31,   29, 1265,
 /*   210 */  1015,  514, 1551,  378,  129,  264,  274, 1010, 1011,  120,
 /*   220 */    99,  129,  514, 1009,  114,  128,  376,    7, 1198, 1549,
 /*   230 */  1329,   50, 1291, 1008, 1009, 1014, 1058, 1059, 1060, 1061,
 /*   240 */  1062, 1063, 1064, 1065,   95,  329,   31,   29, 1221, 1015,
 /*   250 */   514,  343, 1284,   97,  264,  480, 1010, 1011,  408,  404,
 /*   260 */   480,  445, 1009,  125, 1497, 1498,    7, 1502, 1011,  303,
 /*   270 */   442,  302, 1008, 1414, 1014, 1058, 1059, 1060, 1061, 1062,
 /*   280 */  1063, 1064, 1065,  129, 1336, 1014, 1289, 1336, 1015,  514,
 /*   290 */   269,  138,  137,  276,  129, 1334, 1011,  366, 1334,  360,
 /*   300 */   117, 1009,   50,  365, 1247,    1,   96,  129,  361,  359,
 /*   310 */   483,  362, 1261, 1014, 1058, 1059, 1060, 1061, 1062, 1063,
 /*   320 */  1064, 1065,  277, 1285,  235,  162, 1030,  295,  514,  355,
 /*   330 */   114,  510,  509,  322, 1034, 1011,  334, 1018, 1291,    6,
 /*   340 */  1009,  811,  297,  810, 1504,  335,   32,   30,   28,   27,
 /*   350 */    26,  357, 1014, 1058, 1059, 1060, 1061, 1062, 1063, 1064,
 /*   360 */  1065,  812, 1501,  894,  468,  467,  466,  898,  465,  900,
 /*   370 */   901,  464,  903,  461, 1011,  909,  458,  911,  912,  455,
 /*   380 */   452,  238, 1031,   32,   30,   28,   27,   26,    9,    8,
 /*   390 */    23, 1014, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065,
 /*   400 */    32,   30,   28,   27,   26, 1021, 1046,   32,   30,   28,
 /*   410 */    27,   26,  134,  420, 1077,  333, 1197,  471,  328,  327,
 /*   420 */   326,  325,  324, 1176,  321,  320,  319,  318,  314,  313,
 /*   430 */   312,  311, 1218,   32,   30,   28,   27,   26,   48,  364,
 /*   440 */   363,   47,  238, 1128,   84,   58,  188,   83,   82,   81,
 /*   450 */    80,   79,   78,   77,   76,   75,  366,  482,  360, 1090,
 /*   460 */  1078, 1414,  365,  432,  424,   96, 1282,  361,  359, 1377,
 /*   470 */   362, 1196, 1109, 1195, 1194, 1077,  155, 1193, 1082,  153,
 /*   480 */  1192,  502,  501,  500,  499,  279, 1441,  498,  497,  496,
 /*   490 */   101,  491,  490,  489,  488,  487,  486,  485,  484,  108,
 /*   500 */    24,  262, 1072, 1073, 1074, 1075, 1076, 1080, 1081,  115,
 /*   510 */  1457, 1504, 1138, 1191,  221,  445, 1414,  429, 1414, 1414,
 /*   520 */  1079, 1078, 1414, 1035,  342, 1414,  219,  431, 1190, 1500,
 /*   530 */  1189, 1414,  495,  493, 1186, 1274,  139,  421, 1083, 1082,
 /*   540 */  1289,  400, 1136, 1137, 1139, 1140, 1441,   70, 1442, 1443,
 /*   550 */  1446, 1490, 1276,  248, 1168,  427, 1486,  380, 1414, 1441,
 /*   560 */    22,   24,  262, 1072, 1073, 1074, 1075, 1076, 1080, 1081,
 /*   570 */  1457, 1336, 1185, 1414, 1336, 1414,  162,  429, 1113, 1414,
 /*   580 */   355,  413, 1368, 1457, 1184, 1335, 1183,  431, 1551,  445,
 /*   590 */   429, 1414,  249,  425,  247,  246,  417,  354, 1286,   67,
 /*   600 */   431,  128,  357,  419, 1414, 1549,   99,   68, 1442, 1443,
 /*   610 */  1446, 1490,    9,    8, 1289,  237, 1486, 1414,  856, 1167,
 /*   620 */   118, 1442, 1443, 1446,   46,   45,  307, 1551,  133, 1414,
 /*   630 */  1441, 1414, 1182,  301,  858,  174, 1121, 1504, 1403,   97,
 /*   640 */   128,  244, 1032,  293, 1549,  289,  285,  130,  445,  126,
 /*   650 */  1497, 1498,  494, 1502, 1457, 1499,  298,  443,  418, 1564,
 /*   660 */  1181,  416,  810,  445,  422, 1180, 1441, 1179,  129, 1509,
 /*   670 */  1109,  431,  207, 1289,  287, 1414,   84, 1414,  350,   83,
 /*   680 */    82,   81,   80,   79,   78,   77,   76,   75, 1289, 1017,
 /*   690 */  1457,   69, 1442, 1443, 1446, 1490,  428,  429, 1272,  257,
 /*   700 */  1486,  123, 1441, 1178,  167, 1414,  470,  431,  271,  270,
 /*   710 */  1414, 1414, 1414,  189, 1441, 1170, 1171,  388, 1023,  396,
 /*   720 */  1517,   32,   30,   28,   27,   26, 1457,   69, 1442, 1443,
 /*   730 */  1446, 1490, 1188,  429, 1016,  257, 1486, 1563, 1457,  157,
 /*   740 */  1214,  159,  156,  431,  158,  429, 1524, 1414, 1414,  106,
 /*   750 */  1015,  161, 1112,  392,  160,  431,   44, 1020, 1248, 1414,
 /*   760 */  1135,  445,  367,   69, 1442, 1443, 1446, 1490, 1441, 1209,
 /*   770 */   278,  257, 1486, 1563, 1207,   69, 1442, 1443, 1446, 1490,
 /*   780 */   401, 1046, 1547,  257, 1486, 1563, 1289,  517,  371,  177,
 /*   790 */   446,  369, 1457,  179, 1508,   64,  372, 1330,  830,  429,
 /*   800 */   349,  212, 1019,  379,   94,   60, 1069,   33,  190,  431,
 /*   810 */   506, 1084,  211, 1414,  831, 1441,  183,  164,  417, 1520,
 /*   820 */   374,  414, 1434,  413, 1458,  368, 1266,  192,  163,  227,
 /*   830 */  1442, 1443, 1446,   33, 1432,    2, 1024, 1043,   66, 1457,
 /*   840 */    33,  205, 1030,  196,  977,  282,  429,  198,   99, 1551,
 /*   850 */   243,  103,  286, 1027,   42,  437,  431,   41,  856,  104,
 /*   860 */  1414,  106,  128,  204,  986,  887, 1549,  417,  245,  213,
 /*   870 */    44,  441,  317, 1366,  882,  135,   70, 1442, 1443, 1446,
 /*   880 */  1490,   97,  450,  323,  208, 1487,  915,  331,  476,  330,
 /*   890 */   332,  186, 1497,  412,  336,  411,  395, 1441, 1551,  170,
 /*   900 */   104,  105,  106, 1441,  919,  925,  924, 1039, 1441,  104,
 /*   910 */   478,  128,  337,  107,  994, 1549,  166,  338, 1038,  339,
 /*   920 */   142, 1457,  340, 1037,  341,  145,   49, 1457,  429,  475,
 /*   930 */   474,  473, 1457,  472,  429,  148,  344,  351,  431,  429,
 /*   940 */  1036,  381, 1414,  353,  431,  263, 1279,  152, 1414,  431,
 /*   950 */   356,  397, 1441, 1414,   74,  382, 1275,  154,  231, 1442,
 /*   960 */  1443, 1446,  109,  110,  231, 1442, 1443, 1446,  383,  230,
 /*   970 */  1442, 1443, 1446, 1277, 1273,  111, 1457,  112, 1441,  384,
 /*   980 */   169,  172,  387,  429,  253,  150, 1264, 1035,  122,  393,
 /*   990 */   402,  391,  435,  431,  348, 1531,  149, 1414, 1015,  394,
 /*  1000 */   175,  409, 1457, 1521,  399, 1441, 1530,  178, 1511,  429,
 /*  1010 */     5,  182,  256,  118, 1442, 1443, 1446,  405,  410,  431,
 /*  1020 */   398,  121,   51, 1414,    4,  147,  261, 1109,   98, 1457,
 /*  1030 */  1175,  184, 1034,   34,  185,  258,  429,  423, 1375,  231,
 /*  1040 */  1442, 1443, 1446, 1505,  208,  426,  431, 1441,  476,   17,
 /*  1050 */  1414,  191, 1565,  265,   93,   92,   91,   90,   89,   88,
 /*  1060 */    87,   86,   85, 1472, 1374, 1548,  231, 1442, 1443, 1446,
 /*  1070 */   478, 1457, 1441, 1566,  433,  434,  438,  439,  429,  146,
 /*  1080 */   266,  141,  200,  143,  440,  202,  214,   57,  431,  475,
 /*  1090 */   474,  473, 1414,  472, 1290,   59, 1457, 1441,  448,  477,
 /*  1100 */   140, 1262,  216,  429,  210,   40,  513,  218,  224, 1442,
 /*  1110 */  1443, 1446,  222,  431,  220, 1408,  223, 1414, 1407,  281,
 /*  1120 */  1404, 1457, 1441,  283,  284, 1004, 1005,  131,  429,  288,
 /*  1130 */  1402,  290,  291,  229, 1442, 1443, 1446,  292,  431, 1401,
 /*  1140 */   294, 1400, 1414,  296, 1391,  132, 1457,  299, 1441,  300,
 /*  1150 */   989,  988, 1385,  429, 1384,  306,  305, 1383,  232, 1442,
 /*  1160 */  1443, 1446, 1382,  431,  960, 1359, 1358, 1414,  102, 1346,
 /*  1170 */  1345, 1344, 1457, 1441, 1357, 1356, 1355, 1354, 1353,  429,
 /*  1180 */  1352, 1351, 1441,  225, 1442, 1443, 1446, 1350, 1349,  431,
 /*  1190 */  1348, 1347, 1343, 1414, 1342, 1341, 1340, 1457, 1339, 1338,
 /*  1200 */  1337,  962, 1220, 1399,  429, 1393, 1457, 1441, 1381,  233,
 /*  1210 */  1442, 1443, 1446,  429,  431, 1372,  144, 1268, 1414, 1219,
 /*  1220 */   823, 1217,  345,  431, 1206,  346,  347, 1414, 1205, 1202,
 /*  1230 */  1270, 1457, 1441,   73,  226, 1442, 1443, 1446,  429,  151,
 /*  1240 */   930, 1269,  932,  234, 1442, 1443, 1446,  855,  431,  854,
 /*  1250 */   494,  853, 1414,  492,  852, 1215, 1457,  250, 1441, 1210,
 /*  1260 */   849,  848,  251,  429,  370, 1208, 1441,  252, 1454, 1442,
 /*  1270 */  1443, 1446,  373,  431, 1201,  375, 1200, 1414,  377, 1398,
 /*  1280 */    71,   43, 1457,  165,  996, 1392,  385,  113,  386,  429,
 /*  1290 */  1457, 1380,  168, 1453, 1442, 1443, 1446,  429, 1379,  431,
 /*  1300 */  1371,  171, 1441, 1414,   52,    3,   33,  431,   14, 1432,
 /*  1310 */    38, 1414,   15,   35, 1441,  176, 1134,  181,   37, 1452,
 /*  1320 */  1442, 1443, 1446,  119,  173,  180, 1457,  241, 1442, 1443,
 /*  1330 */  1446,   20,   19,  429, 1127,   54,   10,   53, 1457, 1106,
 /*  1340 */  1105,   36, 1156,  431, 1161,  429,   16, 1414, 1441, 1155,
 /*  1350 */   259, 1160,  187,  127, 1159,  431,  260,    8, 1070, 1414,
 /*  1360 */   194, 1044,  195,  240, 1442, 1443, 1446,   13,   18,  436,
 /*  1370 */  1370, 1132, 1457, 1441,  197,  242, 1442, 1443, 1446,  429,
 /*  1380 */   199,   55,  201,   60,  203,   56, 1025,  916, 1431,  431,
 /*  1390 */   206,   39,  449, 1414,  273,  451,  453, 1457,  913,  447,
 /*  1400 */   454,  456,  910,  457,  429,  904,  459,  460,  463,  239,
 /*  1410 */  1442, 1443, 1446,  902,  431,  462,  893,  908, 1414,  907,
 /*  1420 */    61,  906,  469,  905,  927,  926,  923,  921,   62,  821,
 /*  1430 */    63,  479,  862,  209,  228, 1442, 1443, 1446,  481,  844,
 /*  1440 */   843,  842,  841,  837,  840,  839,  838,  859,  857,  834,
 /*  1450 */   833,  832,  829,  828,  827,  826, 1216,  503,  504, 1204,
 /*  1460 */   508,  505,  507, 1203, 1199,  511,  512, 1174, 1012,  217,
 /*  1470 */   515,  516,
362 363
};
static const YYCODETYPE yy_lookahead[] = {
X
Xiaoyu Wang 已提交
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 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
 /*     0 */   211,  233,  250,  229,  211,  205,  230,  211,  211,  220,
 /*    10 */   233,  237,   12,   13,  262,  263,  227,  220,  250,  211,
 /*    20 */    20,  210,   22,  222,  227,  236,  225,  250,  220,  229,
 /*    30 */   262,  263,  286,  236,  202,  224,  236,  241,   38,  262,
 /*    40 */   263,  204,  231,  206,  236,  299,  246,   47,  255,  303,
 /*    50 */   250,   12,   13,   14,   54,  211,  211,   20,  205,   20,
 /*    60 */    20,   22,  205,  211,  220,  220,  266,  267,  268,  269,
 /*    70 */   270,   71,  220,   20,  274,  275,  276,   38,  229,  286,
 /*    80 */   236,  236,  229,   20,  211,  236,   47,  255,  236,  236,
 /*    90 */    12,   13,  299,   54,   94,  295,  303,  238,   20,  246,
 /*   100 */    22,    2,   46,  250,  245,  246,  106,  250,   71,  236,
 /*   110 */    71,   12,   13,   14,   15,   16,   38,  268,  286,  266,
 /*   120 */   267,  268,  269,  270,   71,   47,   20,  274,  275,   12,
 /*   130 */    13,  299,   54,   94,   20,  303,  236,   20,  246,   22,
 /*   140 */   140,  249,  269,  243,  252,  106,   14,   15,   16,   71,
 /*   150 */    22,  278,  279,  280,  281,   38,  283,  157,  158,  159,
 /*   160 */   160,  161,  162,  163,  164,  165,   38,  221,   12,   13,
 /*   170 */    14,   54,   94,   20,  229,  229,   20,  177,   22,  140,
 /*   180 */   235,  255,   54,  237,  106,  240,  271,  272,   71,   12,
 /*   190 */    13,   14,   15,   16,   38,  211,  157,  158,  159,  160,
 /*   200 */   161,  162,  163,  164,  165,    0,  130,   12,   13,    0,
 /*   210 */    54,   94,  286,   21,  177,   20,  221,   22,  140,  228,
 /*   220 */   236,  177,   94,  106,  229,  299,   34,   71,  205,  303,
 /*   230 */   239,  213,  237,   38,  106,  157,  158,  159,  160,  161,
 /*   240 */   162,  163,  164,  165,  226,   64,   12,   13,    0,   54,
 /*   250 */    94,   46,  234,  269,   20,   46,   22,  140,  182,  183,
 /*   260 */    46,  211,  106,  279,  280,  281,   71,  283,  140,  139,
 /*   270 */   220,  141,   38,  250,  157,  158,  159,  160,  161,  162,
 /*   280 */   163,  164,  165,  177,  229,  157,  236,  229,   54,   94,
 /*   290 */   235,  110,  111,  235,  177,  240,  140,   49,  240,   51,
 /*   300 */   214,  106,  213,   55,  218,   71,   58,  177,   60,   61,
 /*   310 */   217,   63,  219,  157,  158,  159,  160,  161,  162,  163,
 /*   320 */   164,  165,  221,  234,   18,   58,   20,  136,   94,   62,
 /*   330 */   229,  208,  209,   27,   20,  140,   30,   38,  237,   43,
 /*   340 */   106,   20,  151,   22,  264,   39,   12,   13,   14,   15,
 /*   350 */    16,   84,  157,  158,  159,  160,  161,  162,  163,  164,
 /*   360 */   165,   40,  282,   85,   86,   87,   88,   89,   90,   91,
 /*   370 */    92,   93,   94,   95,  140,   97,   98,   99,  100,  101,
 /*   380 */   102,   47,   20,   12,   13,   14,   15,   16,    1,    2,
 /*   390 */     2,  157,  158,  159,  160,  161,  162,  163,  164,  165,
 /*   400 */    12,   13,   14,   15,   16,  106,   72,   12,   13,   14,
 /*   410 */    15,   16,   44,    3,   80,  109,  205,   82,  112,  113,
 /*   420 */   114,  115,  116,    0,  118,  119,  120,  121,  122,  123,
 /*   430 */   124,  125,    0,   12,   13,   14,   15,   16,   70,  215,
 /*   440 */   216,   73,   47,   72,   21,  210,  132,   24,   25,   26,
 /*   450 */    27,   28,   29,   30,   31,   32,   49,   54,   51,   72,
 /*   460 */   126,  250,   55,  246,   68,   58,  231,   60,   61,  252,
 /*   470 */    63,  205,  176,  205,  205,   80,   75,  205,  144,   78,
 /*   480 */   205,   49,   50,   51,   52,   53,  205,   55,   56,   57,
 /*   490 */    58,   59,   60,   61,   62,   63,   64,   65,   66,   67,
 /*   500 */   166,  167,  168,  169,  170,  171,  172,  173,  174,   18,
 /*   510 */   229,  264,  157,  205,   23,  211,  250,  236,  250,  250,
 /*   520 */   126,  126,  250,   20,  220,  250,   35,  246,  205,  282,
 /*   530 */   205,  250,  215,  216,  205,  230,   45,   68,  144,  144,
 /*   540 */   236,  186,  187,  188,  189,  190,  205,  266,  267,  268,
 /*   550 */   269,  270,  230,   35,  133,  274,  275,  255,  250,  205,
 /*   560 */   166,  166,  167,  168,  169,  170,  171,  172,  173,  174,
 /*   570 */   229,  229,  205,  250,  229,  250,   58,  236,    4,  250,
 /*   580 */    62,  211,  240,  229,  205,  240,  205,  246,  286,  211,
 /*   590 */   236,  250,   74,  197,   76,   77,  255,   79,  220,  108,
 /*   600 */   246,  299,   84,  193,  250,  303,  236,  266,  267,  268,
 /*   610 */   269,  270,    1,    2,  236,  274,  275,  250,   38,  198,
 /*   620 */   266,  267,  268,  269,  133,  134,  135,  286,  137,  250,
 /*   630 */   205,  250,  205,  142,   54,  132,   14,  264,    0,  269,
 /*   640 */   299,  150,   20,  152,  303,  154,  155,  156,  211,  279,
 /*   650 */   280,  281,   68,  283,  229,  282,   72,  220,  304,  305,
 /*   660 */   205,  236,   22,  211,  195,  205,  205,  205,  177,  175,
 /*   670 */   176,  246,  220,  236,   36,  250,   21,  250,   38,   24,
 /*   680 */    25,   26,   27,   28,   29,   30,   31,   32,  236,   38,
 /*   690 */   229,  266,  267,  268,  269,  270,   47,  236,  230,  274,
 /*   700 */   275,  276,  205,  205,  230,  250,  230,  246,   12,   13,
 /*   710 */   250,  250,  250,  288,  205,  200,  201,  258,   22,  294,
 /*   720 */   295,   12,   13,   14,   15,   16,  229,  266,  267,  268,
 /*   730 */   269,  270,  206,  236,   38,  274,  275,  276,  229,   75,
 /*   740 */     0,   75,   78,  246,   78,  236,  285,  250,  250,   68,
 /*   750 */    54,   75,  178,   72,   78,  246,   68,  106,  218,  250,
 /*   760 */    72,  211,   22,  266,  267,  268,  269,  270,  205,    0,
 /*   770 */   220,  274,  275,  276,    0,  266,  267,  268,  269,  270,
 /*   780 */   297,   72,  285,  274,  275,  276,  236,   19,    4,   68,
 /*   790 */    94,   22,  229,   72,  285,   71,   22,  239,   38,  236,
 /*   800 */   208,   33,  106,   19,   36,   81,  157,   68,  306,  246,
 /*   810 */    42,   72,   44,  250,   54,  205,  291,   33,  255,  265,
 /*   820 */    36,  284,   71,  211,  229,   41,    0,  300,   44,  266,
 /*   830 */   267,  268,  269,   68,   83,  287,  140,   72,   70,  229,
 /*   840 */    68,   73,   20,   68,   72,  211,  236,   72,  236,  286,
 /*   850 */   261,   68,   36,  157,   70,   72,  246,   73,   38,   68,
 /*   860 */   250,   68,  299,   72,  138,   72,  303,  255,  215,  256,
 /*   870 */    68,  103,  211,  211,   72,  117,  266,  267,  268,  269,
 /*   880 */   270,  269,   68,  244,   58,  275,   72,  126,   62,  242,
 /*   890 */   242,  279,  280,  281,  211,  283,  128,  205,  286,  131,
 /*   900 */    68,   68,   68,  205,   72,   72,   72,   20,  205,   68,
 /*   910 */    84,  299,  260,   72,  146,  303,  148,  246,   20,  254,
 /*   920 */   213,  229,  236,   20,  247,  213,  213,  229,  236,  103,
 /*   930 */   104,  105,  229,  107,  236,  213,  211,  207,  246,  236,
 /*   940 */    20,  236,  250,  229,  246,  253,  229,  229,  250,  246,
 /*   950 */   215,  253,  205,  250,  211,  260,  229,  229,  266,  267,
 /*   960 */   268,  269,  229,  229,  266,  267,  268,  269,  147,  266,
 /*   970 */   267,  268,  269,  229,  229,  229,  229,  229,  205,  259,
 /*   980 */   210,  210,  246,  236,  207,   33,    0,   20,   36,  236,
 /*   990 */   185,  254,  184,  246,   42,  296,   44,  250,   54,  247,
 /*  1000 */   251,  298,  229,  265,  250,  205,  296,  251,  293,  236,
 /*  1010 */   192,  292,  250,  266,  267,  268,  269,  250,  191,  246,
 /*  1020 */   180,  290,   70,  250,  179,   73,  253,  176,  236,  229,
 /*  1030 */     0,  289,   20,  117,  277,  199,  236,  194,  251,  266,
 /*  1040 */   267,  268,  269,  264,   58,  196,  246,  205,   62,   71,
 /*  1050 */   250,  301,  305,  253,   24,   25,   26,   27,   28,   29,
 /*  1060 */    30,   31,   32,  273,  251,  302,  266,  267,  268,  269,
 /*  1070 */    84,  229,  205,  307,  250,  250,  129,  248,  236,  127,
 /*  1080 */   250,  129,  236,  131,  247,  210,  225,  210,  246,  103,
 /*  1090 */   104,  105,  250,  107,  236,   71,  229,  205,  232,  215,
 /*  1100 */   148,  219,  211,  236,  210,  257,  207,  212,  266,  267,
 /*  1110 */   268,  269,  223,  246,  203,    0,  223,  250,    0,   61,
 /*  1120 */     0,  229,  205,   38,  153,   38,   38,   38,  236,  153,
 /*  1130 */     0,   38,   38,  266,  267,  268,  269,  153,  246,    0,
 /*  1140 */    38,    0,  250,   38,    0,   71,  229,  144,  205,  143,
 /*  1150 */   106,  140,    0,  236,    0,  136,   50,    0,  266,  267,
 /*  1160 */   268,  269,    0,  246,   83,    0,    0,  250,  117,    0,
 /*  1170 */     0,    0,  229,  205,    0,    0,    0,    0,    0,  236,
 /*  1180 */     0,    0,  205,  266,  267,  268,  269,    0,    0,  246,
 /*  1190 */     0,    0,    0,  250,    0,    0,    0,  229,    0,    0,
 /*  1200 */     0,   22,    0,    0,  236,    0,  229,  205,    0,  266,
 /*  1210 */   267,  268,  269,  236,  246,    0,   43,    0,  250,    0,
 /*  1220 */    48,    0,   38,  246,    0,   36,   43,  250,    0,    0,
 /*  1230 */     0,  229,  205,   80,  266,  267,  268,  269,  236,   78,
 /*  1240 */    22,    0,   38,  266,  267,  268,  269,   38,  246,   38,
 /*  1250 */    68,   38,  250,   68,   38,    0,  229,   22,  205,    0,
 /*  1260 */    38,   38,   22,  236,   39,    0,  205,   22,  266,  267,
 /*  1270 */   268,  269,   38,  246,    0,   22,    0,  250,   22,    0,
 /*  1280 */    20,  132,  229,  149,   38,    0,   22,  145,  132,  236,
 /*  1290 */   229,    0,  129,  266,  267,  268,  269,  236,    0,  246,
 /*  1300 */     0,   43,  205,  250,   71,   68,   68,  246,  181,   83,
 /*  1310 */    68,  250,  181,  175,  205,   72,   72,   68,  132,  266,
 /*  1320 */   267,  268,  269,   71,  127,   71,  229,  266,  267,  268,
 /*  1330 */   269,   68,   71,  236,   72,    4,  181,   71,  229,   72,
 /*  1340 */    72,   68,   38,  246,   72,  236,   68,  250,  205,   38,
 /*  1350 */    38,   38,   83,   83,   38,  246,   38,    2,  157,  250,
 /*  1360 */    83,   72,   72,  266,  267,  268,  269,   71,   71,  130,
 /*  1370 */     0,   72,  229,  205,   71,  266,  267,  268,  269,  236,
 /*  1380 */    71,   71,   43,   81,  127,   71,   22,   72,   83,  246,
 /*  1390 */    83,   71,   38,  250,   38,   71,   38,  229,   72,   82,
 /*  1400 */    71,   38,   72,   71,  236,   72,   38,   71,   71,  266,
 /*  1410 */   267,  268,  269,   72,  246,   38,   22,   96,  250,   96,
 /*  1420 */    71,   96,   84,   96,   38,  106,   38,   22,   71,   48,
 /*  1430 */    71,   47,   54,   68,  266,  267,  268,  269,   69,   38,
 /*  1440 */    38,   38,   38,   22,   38,   38,   38,   54,   38,   38,
 /*  1450 */    38,   38,   38,   38,   38,   38,    0,   38,   36,    0,
 /*  1460 */    37,   43,   38,    0,    0,   22,   21,  308,   22,   22,
 /*  1470 */    21,   20,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1480 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1490 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1500 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1510 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1520 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1530 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1540 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1550 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1560 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1570 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1580 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1590 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1600 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1610 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1620 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1630 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1640 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1650 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1660 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1670 */   308,  308,  308,  308,
532
};
X
Xiaoyu Wang 已提交
533
#define YY_SHIFT_COUNT    (517)
534
#define YY_SHIFT_MIN      (0)
X
Xiaoyu Wang 已提交
535
#define YY_SHIFT_MAX      (1464)
536
static const unsigned short int yy_shift_ofst[] = {
X
Xiaoyu Wang 已提交
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588
 /*     0 */   491,    0,   39,   78,   78,   78,   78,  117,   78,   78,
 /*    10 */   195,  234,   37,  156,  195,  195,  195,  195,  195,  195,
 /*    20 */   195,  195,  195,  195,  195,  195,  195,  195,  195,  195,
 /*    30 */   195,  195,  195,  195,   53,   53,   53,  106,  696,  696,
 /*    40 */   130,   40,   40,   44,  696,   40,   40,   40,   40,   40,
 /*    50 */    40,   56,   63,  114,   44,  153,   63,   40,   40,   63,
 /*    60 */    40,   63,  153,   63,   63,   40,  214,  306,  334,  395,
 /*    70 */   395,  655,  518,  128,  407,  128,  128,  128,  128,  128,
 /*    80 */   128,  128,  128,  128,  128,  128,  128,  128,  128,  128,
 /*    90 */   128,  128,  128,  128,  321,  205,  580,  314,  314,  314,
 /*   100 */   209,  580,  362,  153,   63,   63,   63,  335,  403,  278,
 /*   110 */   278,  278,  278,  278,  278,  768,  423,  248,  421,  355,
 /*   120 */   267,   76,  640,  503,  494,  296,  494,  622,  410,  574,
 /*   130 */   822,  816,  820,  726,  822,  822,  758,  761,  761,  822,
 /*   140 */   887,  153,  898,   56,  362,  903,   56,   56,  822,   56,
 /*   150 */   920,   63,   63,   63,   63,   63,   63,   63,   63,   63,
 /*   160 */    63,   63,  820,  822,  920,  362,  887,  821,  153,  898,
 /*   170 */   214,  362,  903,  214,  967,  805,  808,  944,  805,  808,
 /*   180 */   944,  944,  818,  827,  840,  845,  851,  362, 1012,  916,
 /*   190 */   836,  849,  843,  978,   63,  808,  944,  944,  808,  944,
 /*   200 */   947,  362,  903,  214,  335,  214,  362, 1024,  820,  403,
 /*   210 */   822,  214,  920, 1472, 1472, 1472, 1472, 1472,  432,  952,
 /*   220 */  1030,  784,  826,  986,  371,   99,  388,  709,  177,  177,
 /*   230 */   177,  177,  177,  177,  177,  368,  181,  387,  394,  132,
 /*   240 */   132,  132,  132,  638,  191,  584,  401,  664,  666,  676,
 /*   250 */   740,  769,  774,  192,  681,  688,  721,  611,  515,  469,
 /*   260 */   396,  739,  649,  765,  751,  772,  775,  783,  791,  793,
 /*   270 */   299,  651,  802,  814,  832,  833,  834,  841,  724,  760,
 /*   280 */  1115, 1118, 1058, 1120, 1085,  971, 1087, 1088, 1089,  976,
 /*   290 */  1130, 1093, 1094,  984, 1139, 1102, 1141, 1105, 1144, 1074,
 /*   300 */  1003, 1006, 1044, 1011, 1152, 1154, 1106, 1019, 1157, 1162,
 /*   310 */  1081, 1165, 1166, 1174, 1175, 1176, 1177, 1178, 1180, 1181,
 /*   320 */  1187, 1188, 1190, 1191, 1051, 1169, 1170, 1171, 1192, 1194,
 /*   330 */  1195, 1179, 1196, 1198, 1199, 1200, 1202, 1203, 1205, 1208,
 /*   340 */  1215, 1173, 1217, 1172, 1219, 1221, 1184, 1189, 1183, 1224,
 /*   350 */  1228, 1229, 1230, 1153, 1161, 1204, 1182, 1218, 1241, 1209,
 /*   360 */  1211, 1213, 1216, 1185, 1182, 1222, 1223, 1255, 1235, 1259,
 /*   370 */  1240, 1225, 1265, 1245, 1234, 1274, 1253, 1276, 1256, 1260,
 /*   380 */  1279, 1149, 1134, 1246, 1285, 1142, 1264, 1156, 1163, 1291,
 /*   390 */  1298, 1186, 1300, 1233, 1258, 1197, 1237, 1238, 1127, 1243,
 /*   400 */  1242, 1244, 1252, 1254, 1261, 1262, 1249, 1226, 1266, 1263,
 /*   410 */  1131, 1267, 1268, 1269, 1138, 1273, 1270, 1272, 1278, 1155,
 /*   420 */  1331, 1304, 1311, 1312, 1313, 1316, 1318, 1355, 1201, 1277,
 /*   430 */  1289, 1296, 1297, 1290, 1299, 1303, 1309, 1239, 1310, 1370,
 /*   440 */  1339, 1257, 1314, 1302, 1305, 1307, 1364, 1320, 1317, 1315,
 /*   450 */  1354, 1356, 1324, 1326, 1358, 1329, 1330, 1363, 1332, 1333,
 /*   460 */  1368, 1336, 1341, 1377, 1337, 1321, 1323, 1325, 1327, 1394,
 /*   470 */  1338, 1349, 1386, 1319, 1357, 1359, 1388, 1182, 1405, 1381,
 /*   480 */  1384, 1378, 1369, 1365, 1401, 1402, 1403, 1404, 1406, 1407,
 /*   490 */  1408, 1421, 1393, 1185, 1410, 1182, 1411, 1412, 1413, 1414,
 /*   500 */  1415, 1416, 1417, 1456, 1419, 1422, 1418, 1459, 1424, 1423,
 /*   510 */  1463, 1464, 1443, 1445, 1446, 1447, 1449, 1451,
589
};
X
Xiaoyu Wang 已提交
590 591 592
#define YY_REDUCE_COUNT (217)
#define YY_REDUCE_MIN   (-254)
#define YY_REDUCE_MAX   (1168)
593
static const short yy_reduce_ofst[] = {
X
Xiaoyu Wang 已提交
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615
 /*     0 */  -168,  341,  425, -200,  461,  497,  509,  563, -147,  281,
 /*    10 */   354,  610,  612,  692,  698,  703,  747,  773,  800,  842,
 /*    20 */   867,  892,  917,  943,  968,  977, 1002, 1027, 1053, 1061,
 /*    30 */  1097, 1109, 1143, 1168, -127,  -16,  370, -207, -232, -223,
 /*    40 */   -74, -211, -203,  302, -248, -192, -156, -155, -148,  304,
 /*    50 */   378,   18,  -55, -151, -254, -108,  -54,   50,  437,   55,
 /*    60 */   452,   -5, -141,   58,  101,  550, -189, -204,  -85,  -85,
 /*    70 */   -85, -163,   -9, -143,   86,   23,  211,  266,  268,  269,
 /*    80 */   272,  275,  308,  323,  325,  329,  367,  379,  381,  427,
 /*    90 */   455,  460,  462,  498,  123,   89,  224,   80,  247,  373,
 /*   100 */   235,  317, -100,  217, -226,  342,  345, -199,   93, -224,
 /*   110 */   305,  322,  468,  474,  476,  459,  526,  540,  502,  483,
 /*   120 */   558,  525,  592,  554,  537,  537,  537,  595,  527,  548,
 /*   130 */   634,  589,  653,  613,  661,  662,  639,  647,  648,  683,
 /*   140 */   652,  671,  665,  707,  686,  677,  712,  713,  725,  722,
 /*   150 */   730,  714,  717,  718,  727,  728,  733,  734,  744,  745,
 /*   160 */   746,  748,  735,  743,  777,  705,  695,  720,  736,  737,
 /*   170 */   770,  753,  752,  771,  738,  699,  749,  754,  710,  756,
 /*   180 */   762,  767,  715,  719,  731,  742,  537,  792,  779,  757,
 /*   190 */   766,  763,  750,  790,  595,  787,  824,  825,  813,  830,
 /*   200 */   829,  846,  837,  875,  861,  877,  858,  866,  884,  882,
 /*   210 */   891,  894,  899,  848,  889,  893,  895,  911,
616 617
};
static const YYACTIONTYPE yy_default[] = {
X
Xiaoyu Wang 已提交
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 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669
 /*     0 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*    10 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*    20 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*    30 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*    40 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*    50 */  1172, 1225, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*    60 */  1172, 1172, 1172, 1172, 1172, 1172, 1223, 1360, 1172, 1492,
 /*    70 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*    80 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*    90 */  1172, 1172, 1172, 1172, 1172, 1225, 1172, 1503, 1503, 1503,
 /*   100 */  1223, 1172, 1172, 1172, 1172, 1172, 1172, 1318, 1172, 1172,
 /*   110 */  1172, 1172, 1172, 1172, 1172, 1394, 1172, 1172, 1567, 1172,
 /*   120 */  1271, 1527, 1172, 1519, 1495, 1509, 1496, 1172, 1552, 1512,
 /*   130 */  1172, 1172, 1172, 1386, 1172, 1172, 1365, 1362, 1362, 1172,
 /*   140 */  1172, 1172, 1172, 1225, 1172, 1172, 1225, 1225, 1172, 1225,
 /*   150 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   160 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1396, 1172, 1172,
 /*   170 */  1223, 1172, 1172, 1223, 1172, 1534, 1532, 1172, 1534, 1532,
 /*   180 */  1172, 1172, 1546, 1542, 1525, 1523, 1509, 1172, 1172, 1172,
 /*   190 */  1570, 1558, 1554, 1172, 1172, 1532, 1172, 1172, 1532, 1172,
 /*   200 */  1373, 1172, 1172, 1223, 1172, 1223, 1172, 1287, 1172, 1172,
 /*   210 */  1172, 1223, 1172, 1388, 1321, 1321, 1226, 1177, 1172, 1172,
 /*   220 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1456, 1545,
 /*   230 */  1544, 1455, 1469, 1468, 1467, 1172, 1172, 1172, 1172, 1450,
 /*   240 */  1451, 1449, 1448, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   250 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1493, 1172, 1555,
 /*   260 */  1559, 1172, 1172, 1172, 1433, 1172, 1172, 1172, 1172, 1172,
 /*   270 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   280 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   290 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   300 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   310 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   320 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   330 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   340 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   350 */  1172, 1172, 1172, 1172, 1172, 1172, 1332, 1172, 1172, 1172,
 /*   360 */  1172, 1172, 1172, 1252, 1251, 1172, 1172, 1172, 1172, 1172,
 /*   370 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   380 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   390 */  1172, 1172, 1172, 1172, 1172, 1172, 1516, 1526, 1172, 1172,
 /*   400 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1433, 1172, 1543,
 /*   410 */  1172, 1502, 1498, 1172, 1172, 1494, 1172, 1172, 1553, 1172,
 /*   420 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1488, 1172, 1172,
 /*   430 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   440 */  1172, 1172, 1172, 1172, 1432, 1172, 1172, 1172, 1172, 1172,
 /*   450 */  1172, 1172, 1315, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   460 */  1172, 1172, 1172, 1172, 1172, 1300, 1298, 1297, 1296, 1172,
 /*   470 */  1293, 1172, 1172, 1172, 1172, 1172, 1172, 1323, 1172, 1172,
 /*   480 */  1172, 1172, 1172, 1246, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   490 */  1172, 1172, 1172, 1237, 1172, 1236, 1172, 1172, 1172, 1172,
 /*   500 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
 /*   510 */  1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
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 718 719 720 721 722 723 724 725 726
};
/********** End of lemon-generated parsing tables *****************************/

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

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

/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
  yyStackEntry *yytos;          /* Pointer to top element of the stack */
#ifdef YYTRACKMAXSTACKDEPTH
  int yyhwm;                    /* High-water mark of the stack */
#endif
#ifndef YYNOERRORRECOVERY
  int yyerrcnt;                 /* Shifts left before out of the error */
#endif
X
Xiaoyu Wang 已提交
727 728
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763
#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 已提交
764
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
765 766 767 768 769 770 771 772 773 774 775 776
  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 */ "$",
777 778
  /*    1 */ "OR",
  /*    2 */ "AND",
779 780 781 782 783
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
784 785 786 787 788 789 790 791 792 793
  /*    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",
794
  /*   18 */ "CREATE",
795 796 797
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
798 799 800 801 802 803 804 805 806 807 808 809
  /*   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",
810 811
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829
  /*   36 */ "DNODE",
  /*   37 */ "PORT",
  /*   38 */ "NK_INTEGER",
  /*   39 */ "DNODES",
  /*   40 */ "NK_IPTOKEN",
  /*   41 */ "LOCAL",
  /*   42 */ "QNODE",
  /*   43 */ "ON",
  /*   44 */ "DATABASE",
  /*   45 */ "USE",
  /*   46 */ "IF",
  /*   47 */ "NOT",
  /*   48 */ "EXISTS",
  /*   49 */ "BLOCKS",
  /*   50 */ "CACHE",
  /*   51 */ "CACHELAST",
  /*   52 */ "COMP",
  /*   53 */ "DAYS",
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 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083
  /*   54 */ "NK_VARIABLE",
  /*   55 */ "FSYNC",
  /*   56 */ "MAXROWS",
  /*   57 */ "MINROWS",
  /*   58 */ "KEEP",
  /*   59 */ "PRECISION",
  /*   60 */ "QUORUM",
  /*   61 */ "REPLICA",
  /*   62 */ "TTL",
  /*   63 */ "WAL",
  /*   64 */ "VGROUPS",
  /*   65 */ "SINGLE_STABLE",
  /*   66 */ "STREAM_MODE",
  /*   67 */ "RETENTIONS",
  /*   68 */ "NK_COMMA",
  /*   69 */ "NK_COLON",
  /*   70 */ "TABLE",
  /*   71 */ "NK_LP",
  /*   72 */ "NK_RP",
  /*   73 */ "STABLE",
  /*   74 */ "ADD",
  /*   75 */ "COLUMN",
  /*   76 */ "MODIFY",
  /*   77 */ "RENAME",
  /*   78 */ "TAG",
  /*   79 */ "SET",
  /*   80 */ "NK_EQ",
  /*   81 */ "USING",
  /*   82 */ "TAGS",
  /*   83 */ "NK_DOT",
  /*   84 */ "COMMENT",
  /*   85 */ "BOOL",
  /*   86 */ "TINYINT",
  /*   87 */ "SMALLINT",
  /*   88 */ "INT",
  /*   89 */ "INTEGER",
  /*   90 */ "BIGINT",
  /*   91 */ "FLOAT",
  /*   92 */ "DOUBLE",
  /*   93 */ "BINARY",
  /*   94 */ "TIMESTAMP",
  /*   95 */ "NCHAR",
  /*   96 */ "UNSIGNED",
  /*   97 */ "JSON",
  /*   98 */ "VARCHAR",
  /*   99 */ "MEDIUMBLOB",
  /*  100 */ "BLOB",
  /*  101 */ "VARBINARY",
  /*  102 */ "DECIMAL",
  /*  103 */ "SMA",
  /*  104 */ "ROLLUP",
  /*  105 */ "FILE_FACTOR",
  /*  106 */ "NK_FLOAT",
  /*  107 */ "DELAY",
  /*  108 */ "SHOW",
  /*  109 */ "DATABASES",
  /*  110 */ "TABLES",
  /*  111 */ "STABLES",
  /*  112 */ "MNODES",
  /*  113 */ "MODULES",
  /*  114 */ "QNODES",
  /*  115 */ "FUNCTIONS",
  /*  116 */ "INDEXES",
  /*  117 */ "FROM",
  /*  118 */ "ACCOUNTS",
  /*  119 */ "APPS",
  /*  120 */ "CONNECTIONS",
  /*  121 */ "LICENCE",
  /*  122 */ "QUERIES",
  /*  123 */ "SCORES",
  /*  124 */ "TOPICS",
  /*  125 */ "VARIABLES",
  /*  126 */ "LIKE",
  /*  127 */ "INDEX",
  /*  128 */ "FULLTEXT",
  /*  129 */ "FUNCTION",
  /*  130 */ "INTERVAL",
  /*  131 */ "TOPIC",
  /*  132 */ "AS",
  /*  133 */ "DESC",
  /*  134 */ "DESCRIBE",
  /*  135 */ "RESET",
  /*  136 */ "QUERY",
  /*  137 */ "EXPLAIN",
  /*  138 */ "ANALYZE",
  /*  139 */ "VERBOSE",
  /*  140 */ "NK_BOOL",
  /*  141 */ "RATIO",
  /*  142 */ "COMPACT",
  /*  143 */ "VNODES",
  /*  144 */ "IN",
  /*  145 */ "OUTPUTTYPE",
  /*  146 */ "AGGREGATE",
  /*  147 */ "BUFSIZE",
  /*  148 */ "STREAM",
  /*  149 */ "INTO",
  /*  150 */ "KILL",
  /*  151 */ "CONNECTION",
  /*  152 */ "MERGE",
  /*  153 */ "VGROUP",
  /*  154 */ "REDISTRIBUTE",
  /*  155 */ "SPLIT",
  /*  156 */ "SYNCDB",
  /*  157 */ "NULL",
  /*  158 */ "NOW",
  /*  159 */ "ROWTS",
  /*  160 */ "TBNAME",
  /*  161 */ "QSTARTTS",
  /*  162 */ "QENDTS",
  /*  163 */ "WSTARTTS",
  /*  164 */ "WENDTS",
  /*  165 */ "WDURATION",
  /*  166 */ "BETWEEN",
  /*  167 */ "IS",
  /*  168 */ "NK_LT",
  /*  169 */ "NK_GT",
  /*  170 */ "NK_LE",
  /*  171 */ "NK_GE",
  /*  172 */ "NK_NE",
  /*  173 */ "MATCH",
  /*  174 */ "NMATCH",
  /*  175 */ "JOIN",
  /*  176 */ "INNER",
  /*  177 */ "SELECT",
  /*  178 */ "DISTINCT",
  /*  179 */ "WHERE",
  /*  180 */ "PARTITION",
  /*  181 */ "BY",
  /*  182 */ "SESSION",
  /*  183 */ "STATE_WINDOW",
  /*  184 */ "SLIDING",
  /*  185 */ "FILL",
  /*  186 */ "VALUE",
  /*  187 */ "NONE",
  /*  188 */ "PREV",
  /*  189 */ "LINEAR",
  /*  190 */ "NEXT",
  /*  191 */ "GROUP",
  /*  192 */ "HAVING",
  /*  193 */ "ORDER",
  /*  194 */ "SLIMIT",
  /*  195 */ "SOFFSET",
  /*  196 */ "LIMIT",
  /*  197 */ "OFFSET",
  /*  198 */ "ASC",
  /*  199 */ "NULLS",
  /*  200 */ "FIRST",
  /*  201 */ "LAST",
  /*  202 */ "cmd",
  /*  203 */ "account_options",
  /*  204 */ "alter_account_options",
  /*  205 */ "literal",
  /*  206 */ "alter_account_option",
  /*  207 */ "user_name",
  /*  208 */ "dnode_endpoint",
  /*  209 */ "dnode_host_name",
  /*  210 */ "not_exists_opt",
  /*  211 */ "db_name",
  /*  212 */ "db_options",
  /*  213 */ "exists_opt",
  /*  214 */ "alter_db_options",
  /*  215 */ "integer_list",
  /*  216 */ "variable_list",
  /*  217 */ "retention_list",
  /*  218 */ "alter_db_option",
  /*  219 */ "retention",
  /*  220 */ "full_table_name",
  /*  221 */ "column_def_list",
  /*  222 */ "tags_def_opt",
  /*  223 */ "table_options",
  /*  224 */ "multi_create_clause",
  /*  225 */ "tags_def",
  /*  226 */ "multi_drop_clause",
  /*  227 */ "alter_table_clause",
  /*  228 */ "alter_table_options",
  /*  229 */ "column_name",
  /*  230 */ "type_name",
  /*  231 */ "create_subtable_clause",
  /*  232 */ "specific_tags_opt",
  /*  233 */ "literal_list",
  /*  234 */ "drop_table_clause",
  /*  235 */ "col_name_list",
  /*  236 */ "table_name",
  /*  237 */ "column_def",
  /*  238 */ "func_name_list",
  /*  239 */ "alter_table_option",
  /*  240 */ "col_name",
  /*  241 */ "db_name_cond_opt",
  /*  242 */ "like_pattern_opt",
  /*  243 */ "table_name_cond",
  /*  244 */ "from_db_opt",
  /*  245 */ "func_name",
  /*  246 */ "function_name",
  /*  247 */ "index_name",
  /*  248 */ "index_options",
  /*  249 */ "func_list",
  /*  250 */ "duration_literal",
  /*  251 */ "sliding_opt",
  /*  252 */ "func",
  /*  253 */ "expression_list",
  /*  254 */ "topic_name",
  /*  255 */ "query_expression",
  /*  256 */ "analyze_opt",
  /*  257 */ "explain_options",
  /*  258 */ "agg_func_opt",
  /*  259 */ "bufsize_opt",
  /*  260 */ "stream_name",
  /*  261 */ "dnode_list",
  /*  262 */ "signed",
  /*  263 */ "signed_literal",
  /*  264 */ "table_alias",
  /*  265 */ "column_alias",
  /*  266 */ "expression",
  /*  267 */ "pseudo_column",
  /*  268 */ "column_reference",
  /*  269 */ "subquery",
  /*  270 */ "predicate",
  /*  271 */ "compare_op",
  /*  272 */ "in_op",
  /*  273 */ "in_predicate_value",
  /*  274 */ "boolean_value_expression",
  /*  275 */ "boolean_primary",
  /*  276 */ "common_expression",
  /*  277 */ "from_clause",
  /*  278 */ "table_reference_list",
  /*  279 */ "table_reference",
  /*  280 */ "table_primary",
  /*  281 */ "joined_table",
  /*  282 */ "alias_opt",
  /*  283 */ "parenthesized_joined_table",
  /*  284 */ "join_type",
  /*  285 */ "search_condition",
  /*  286 */ "query_specification",
  /*  287 */ "set_quantifier_opt",
  /*  288 */ "select_list",
  /*  289 */ "where_clause_opt",
  /*  290 */ "partition_by_clause_opt",
  /*  291 */ "twindow_clause_opt",
  /*  292 */ "group_by_clause_opt",
  /*  293 */ "having_clause_opt",
  /*  294 */ "select_sublist",
  /*  295 */ "select_item",
  /*  296 */ "fill_opt",
  /*  297 */ "fill_mode",
  /*  298 */ "group_by_list",
  /*  299 */ "query_expression_body",
  /*  300 */ "order_by_clause_opt",
  /*  301 */ "slimit_clause_opt",
  /*  302 */ "limit_clause_opt",
  /*  303 */ "query_primary",
  /*  304 */ "sort_specification_list",
  /*  305 */ "sort_specification",
  /*  306 */ "ordering_specification_opt",
  /*  307 */ "null_ordering_opt",
1084 1085 1086 1087 1088 1089 1090
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118
 /*   0 */ "cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options",
 /*   1 */ "cmd ::= ALTER ACCOUNT NK_ID alter_account_options",
 /*   2 */ "account_options ::=",
 /*   3 */ "account_options ::= account_options PPS literal",
 /*   4 */ "account_options ::= account_options TSERIES literal",
 /*   5 */ "account_options ::= account_options STORAGE literal",
 /*   6 */ "account_options ::= account_options STREAMS literal",
 /*   7 */ "account_options ::= account_options QTIME literal",
 /*   8 */ "account_options ::= account_options DBS literal",
 /*   9 */ "account_options ::= account_options USERS literal",
 /*  10 */ "account_options ::= account_options CONNS literal",
 /*  11 */ "account_options ::= account_options STATE literal",
 /*  12 */ "alter_account_options ::= alter_account_option",
 /*  13 */ "alter_account_options ::= alter_account_options alter_account_option",
 /*  14 */ "alter_account_option ::= PASS literal",
 /*  15 */ "alter_account_option ::= PPS literal",
 /*  16 */ "alter_account_option ::= TSERIES literal",
 /*  17 */ "alter_account_option ::= STORAGE literal",
 /*  18 */ "alter_account_option ::= STREAMS literal",
 /*  19 */ "alter_account_option ::= QTIME literal",
 /*  20 */ "alter_account_option ::= DBS literal",
 /*  21 */ "alter_account_option ::= USERS literal",
 /*  22 */ "alter_account_option ::= CONNS literal",
 /*  23 */ "alter_account_option ::= STATE literal",
 /*  24 */ "cmd ::= CREATE USER user_name PASS NK_STRING",
 /*  25 */ "cmd ::= ALTER USER user_name PASS NK_STRING",
 /*  26 */ "cmd ::= ALTER USER user_name PRIVILEGE NK_STRING",
 /*  27 */ "cmd ::= DROP USER user_name",
X
Xiaoyu Wang 已提交
1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147
 /*  28 */ "cmd ::= CREATE DNODE dnode_endpoint",
 /*  29 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER",
 /*  30 */ "cmd ::= DROP DNODE NK_INTEGER",
 /*  31 */ "cmd ::= DROP DNODE dnode_endpoint",
 /*  32 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
 /*  33 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
 /*  34 */ "cmd ::= ALTER ALL DNODES NK_STRING",
 /*  35 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
 /*  36 */ "dnode_endpoint ::= NK_STRING",
 /*  37 */ "dnode_host_name ::= NK_ID",
 /*  38 */ "dnode_host_name ::= NK_IPTOKEN",
 /*  39 */ "cmd ::= ALTER LOCAL NK_STRING",
 /*  40 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
 /*  41 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
 /*  42 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
 /*  43 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
 /*  44 */ "cmd ::= DROP DATABASE exists_opt db_name",
 /*  45 */ "cmd ::= USE db_name",
 /*  46 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
 /*  47 */ "not_exists_opt ::= IF NOT EXISTS",
 /*  48 */ "not_exists_opt ::=",
 /*  49 */ "exists_opt ::= IF EXISTS",
 /*  50 */ "exists_opt ::=",
 /*  51 */ "db_options ::=",
 /*  52 */ "db_options ::= db_options BLOCKS NK_INTEGER",
 /*  53 */ "db_options ::= db_options CACHE NK_INTEGER",
 /*  54 */ "db_options ::= db_options CACHELAST NK_INTEGER",
 /*  55 */ "db_options ::= db_options COMP NK_INTEGER",
 /*  56 */ "db_options ::= db_options DAYS NK_INTEGER",
X
Xiaoyu Wang 已提交
1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 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
 /*  57 */ "db_options ::= db_options DAYS NK_VARIABLE",
 /*  58 */ "db_options ::= db_options FSYNC NK_INTEGER",
 /*  59 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  60 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  61 */ "db_options ::= db_options KEEP integer_list",
 /*  62 */ "db_options ::= db_options KEEP variable_list",
 /*  63 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  64 */ "db_options ::= db_options QUORUM NK_INTEGER",
 /*  65 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  66 */ "db_options ::= db_options TTL NK_INTEGER",
 /*  67 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  68 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  69 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  70 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
 /*  71 */ "db_options ::= db_options RETENTIONS retention_list",
 /*  72 */ "alter_db_options ::= alter_db_option",
 /*  73 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  74 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  75 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  76 */ "alter_db_option ::= KEEP integer_list",
 /*  77 */ "alter_db_option ::= KEEP variable_list",
 /*  78 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  79 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  80 */ "alter_db_option ::= CACHELAST NK_INTEGER",
 /*  81 */ "alter_db_option ::= REPLICA NK_INTEGER",
 /*  82 */ "integer_list ::= NK_INTEGER",
 /*  83 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
 /*  84 */ "variable_list ::= NK_VARIABLE",
 /*  85 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
 /*  86 */ "retention_list ::= retention",
 /*  87 */ "retention_list ::= retention_list NK_COMMA retention",
 /*  88 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
 /*  89 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /*  90 */ "cmd ::= CREATE TABLE multi_create_clause",
 /*  91 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /*  92 */ "cmd ::= DROP TABLE multi_drop_clause",
 /*  93 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /*  94 */ "cmd ::= ALTER TABLE alter_table_clause",
 /*  95 */ "cmd ::= ALTER STABLE alter_table_clause",
 /*  96 */ "alter_table_clause ::= full_table_name alter_table_options",
 /*  97 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /*  98 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /*  99 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /* 100 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /* 101 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /* 102 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /* 103 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /* 104 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /* 105 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /* 106 */ "multi_create_clause ::= create_subtable_clause",
 /* 107 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /* 108 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
 /* 109 */ "multi_drop_clause ::= drop_table_clause",
 /* 110 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 111 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 112 */ "specific_tags_opt ::=",
 /* 113 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 114 */ "full_table_name ::= table_name",
 /* 115 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 116 */ "column_def_list ::= column_def",
 /* 117 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 118 */ "column_def ::= column_name type_name",
 /* 119 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 120 */ "type_name ::= BOOL",
 /* 121 */ "type_name ::= TINYINT",
 /* 122 */ "type_name ::= SMALLINT",
 /* 123 */ "type_name ::= INT",
 /* 124 */ "type_name ::= INTEGER",
 /* 125 */ "type_name ::= BIGINT",
 /* 126 */ "type_name ::= FLOAT",
 /* 127 */ "type_name ::= DOUBLE",
 /* 128 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 129 */ "type_name ::= TIMESTAMP",
 /* 130 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 131 */ "type_name ::= TINYINT UNSIGNED",
 /* 132 */ "type_name ::= SMALLINT UNSIGNED",
 /* 133 */ "type_name ::= INT UNSIGNED",
 /* 134 */ "type_name ::= BIGINT UNSIGNED",
 /* 135 */ "type_name ::= JSON",
 /* 136 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 137 */ "type_name ::= MEDIUMBLOB",
 /* 138 */ "type_name ::= BLOB",
 /* 139 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 140 */ "type_name ::= DECIMAL",
 /* 141 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 142 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 143 */ "tags_def_opt ::=",
 /* 144 */ "tags_def_opt ::= tags_def",
 /* 145 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 146 */ "table_options ::=",
 /* 147 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 148 */ "table_options ::= table_options KEEP integer_list",
 /* 149 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 150 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 151 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 152 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 153 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 154 */ "alter_table_options ::= alter_table_option",
 /* 155 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 156 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 157 */ "alter_table_option ::= KEEP integer_list",
 /* 158 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 159 */ "col_name_list ::= col_name",
 /* 160 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 161 */ "col_name ::= column_name",
 /* 162 */ "cmd ::= SHOW DNODES",
 /* 163 */ "cmd ::= SHOW USERS",
 /* 164 */ "cmd ::= SHOW DATABASES",
 /* 165 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 166 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 167 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 168 */ "cmd ::= SHOW MNODES",
 /* 169 */ "cmd ::= SHOW MODULES",
 /* 170 */ "cmd ::= SHOW QNODES",
 /* 171 */ "cmd ::= SHOW FUNCTIONS",
 /* 172 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 173 */ "cmd ::= SHOW STREAMS",
 /* 174 */ "cmd ::= SHOW ACCOUNTS",
 /* 175 */ "cmd ::= SHOW APPS",
 /* 176 */ "cmd ::= SHOW CONNECTIONS",
 /* 177 */ "cmd ::= SHOW LICENCE",
 /* 178 */ "cmd ::= SHOW CREATE DATABASE db_name",
 /* 179 */ "cmd ::= SHOW CREATE TABLE full_table_name",
 /* 180 */ "cmd ::= SHOW CREATE STABLE full_table_name",
 /* 181 */ "cmd ::= SHOW QUERIES",
 /* 182 */ "cmd ::= SHOW SCORES",
 /* 183 */ "cmd ::= SHOW TOPICS",
 /* 184 */ "cmd ::= SHOW VARIABLES",
 /* 185 */ "db_name_cond_opt ::=",
 /* 186 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 187 */ "like_pattern_opt ::=",
 /* 188 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 189 */ "table_name_cond ::= table_name",
 /* 190 */ "from_db_opt ::=",
 /* 191 */ "from_db_opt ::= FROM db_name",
 /* 192 */ "func_name_list ::= func_name",
 /* 193 */ "func_name_list ::= func_name_list NK_COMMA col_name",
 /* 194 */ "func_name ::= function_name",
 /* 195 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 196 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 197 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 198 */ "index_options ::=",
 /* 199 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 200 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 201 */ "func_list ::= func",
 /* 202 */ "func_list ::= func_list NK_COMMA func",
 /* 203 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 204 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
 /* 205 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
 /* 206 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 207 */ "cmd ::= DESC full_table_name",
 /* 208 */ "cmd ::= DESCRIBE full_table_name",
 /* 209 */ "cmd ::= RESET QUERY CACHE",
 /* 210 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression",
 /* 211 */ "analyze_opt ::=",
 /* 212 */ "analyze_opt ::= ANALYZE",
 /* 213 */ "explain_options ::=",
 /* 214 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 215 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 216 */ "cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP",
 /* 217 */ "cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
 /* 218 */ "cmd ::= DROP FUNCTION function_name",
 /* 219 */ "agg_func_opt ::=",
 /* 220 */ "agg_func_opt ::= AGGREGATE",
 /* 221 */ "bufsize_opt ::=",
 /* 222 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
 /* 223 */ "cmd ::= CREATE STREAM stream_name INTO table_name AS query_expression",
 /* 224 */ "cmd ::= DROP STREAM stream_name",
 /* 225 */ "cmd ::= KILL CONNECTION NK_INTEGER",
 /* 226 */ "cmd ::= KILL QUERY NK_INTEGER",
 /* 227 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
 /* 228 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
 /* 229 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
 /* 230 */ "dnode_list ::= DNODE NK_INTEGER",
 /* 231 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
 /* 232 */ "cmd ::= SYNCDB db_name REPLICA",
 /* 233 */ "cmd ::= query_expression",
 /* 234 */ "literal ::= NK_INTEGER",
 /* 235 */ "literal ::= NK_FLOAT",
 /* 236 */ "literal ::= NK_STRING",
 /* 237 */ "literal ::= NK_BOOL",
 /* 238 */ "literal ::= TIMESTAMP NK_STRING",
 /* 239 */ "literal ::= duration_literal",
 /* 240 */ "literal ::= NULL",
 /* 241 */ "duration_literal ::= NK_VARIABLE",
 /* 242 */ "signed ::= NK_INTEGER",
 /* 243 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 244 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 245 */ "signed ::= NK_FLOAT",
 /* 246 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 247 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 248 */ "signed_literal ::= signed",
 /* 249 */ "signed_literal ::= NK_STRING",
 /* 250 */ "signed_literal ::= NK_BOOL",
 /* 251 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 252 */ "signed_literal ::= duration_literal",
 /* 253 */ "signed_literal ::= NULL",
 /* 254 */ "literal_list ::= signed_literal",
 /* 255 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 256 */ "db_name ::= NK_ID",
 /* 257 */ "table_name ::= NK_ID",
 /* 258 */ "column_name ::= NK_ID",
 /* 259 */ "function_name ::= NK_ID",
 /* 260 */ "table_alias ::= NK_ID",
 /* 261 */ "column_alias ::= NK_ID",
 /* 262 */ "user_name ::= NK_ID",
 /* 263 */ "index_name ::= NK_ID",
 /* 264 */ "topic_name ::= NK_ID",
 /* 265 */ "stream_name ::= NK_ID",
 /* 266 */ "expression ::= literal",
 /* 267 */ "expression ::= pseudo_column",
 /* 268 */ "expression ::= column_reference",
 /* 269 */ "expression ::= function_name NK_LP expression_list NK_RP",
 /* 270 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
 /* 271 */ "expression ::= subquery",
 /* 272 */ "expression ::= NK_LP expression NK_RP",
 /* 273 */ "expression ::= NK_PLUS expression",
 /* 274 */ "expression ::= NK_MINUS expression",
 /* 275 */ "expression ::= expression NK_PLUS expression",
 /* 276 */ "expression ::= expression NK_MINUS expression",
 /* 277 */ "expression ::= expression NK_STAR expression",
 /* 278 */ "expression ::= expression NK_SLASH expression",
 /* 279 */ "expression ::= expression NK_REM expression",
 /* 280 */ "expression_list ::= expression",
 /* 281 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 282 */ "column_reference ::= column_name",
 /* 283 */ "column_reference ::= table_name NK_DOT column_name",
 /* 284 */ "pseudo_column ::= NOW",
 /* 285 */ "pseudo_column ::= ROWTS",
 /* 286 */ "pseudo_column ::= TBNAME",
 /* 287 */ "pseudo_column ::= QSTARTTS",
 /* 288 */ "pseudo_column ::= QENDTS",
 /* 289 */ "pseudo_column ::= WSTARTTS",
 /* 290 */ "pseudo_column ::= WENDTS",
 /* 291 */ "pseudo_column ::= WDURATION",
 /* 292 */ "predicate ::= expression compare_op expression",
 /* 293 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 294 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 295 */ "predicate ::= expression IS NULL",
 /* 296 */ "predicate ::= expression IS NOT NULL",
 /* 297 */ "predicate ::= expression in_op in_predicate_value",
 /* 298 */ "compare_op ::= NK_LT",
 /* 299 */ "compare_op ::= NK_GT",
 /* 300 */ "compare_op ::= NK_LE",
 /* 301 */ "compare_op ::= NK_GE",
 /* 302 */ "compare_op ::= NK_NE",
 /* 303 */ "compare_op ::= NK_EQ",
 /* 304 */ "compare_op ::= LIKE",
 /* 305 */ "compare_op ::= NOT LIKE",
 /* 306 */ "compare_op ::= MATCH",
 /* 307 */ "compare_op ::= NMATCH",
 /* 308 */ "in_op ::= IN",
 /* 309 */ "in_op ::= NOT IN",
 /* 310 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 311 */ "boolean_value_expression ::= boolean_primary",
 /* 312 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 313 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 314 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 315 */ "boolean_primary ::= predicate",
 /* 316 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 317 */ "common_expression ::= expression",
 /* 318 */ "common_expression ::= boolean_value_expression",
 /* 319 */ "from_clause ::= FROM table_reference_list",
 /* 320 */ "table_reference_list ::= table_reference",
 /* 321 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 322 */ "table_reference ::= table_primary",
 /* 323 */ "table_reference ::= joined_table",
 /* 324 */ "table_primary ::= table_name alias_opt",
 /* 325 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 326 */ "table_primary ::= subquery alias_opt",
 /* 327 */ "table_primary ::= parenthesized_joined_table",
 /* 328 */ "alias_opt ::=",
 /* 329 */ "alias_opt ::= table_alias",
 /* 330 */ "alias_opt ::= AS table_alias",
 /* 331 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 332 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 333 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 334 */ "join_type ::=",
 /* 335 */ "join_type ::= INNER",
 /* 336 */ "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 */ "set_quantifier_opt ::=",
 /* 338 */ "set_quantifier_opt ::= DISTINCT",
 /* 339 */ "set_quantifier_opt ::= ALL",
 /* 340 */ "select_list ::= NK_STAR",
 /* 341 */ "select_list ::= select_sublist",
 /* 342 */ "select_sublist ::= select_item",
 /* 343 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 344 */ "select_item ::= common_expression",
 /* 345 */ "select_item ::= common_expression column_alias",
 /* 346 */ "select_item ::= common_expression AS column_alias",
 /* 347 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 348 */ "where_clause_opt ::=",
 /* 349 */ "where_clause_opt ::= WHERE search_condition",
 /* 350 */ "partition_by_clause_opt ::=",
 /* 351 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 352 */ "twindow_clause_opt ::=",
 /* 353 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 354 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
 /* 355 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 356 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 357 */ "sliding_opt ::=",
 /* 358 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 359 */ "fill_opt ::=",
 /* 360 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 361 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 362 */ "fill_mode ::= NONE",
 /* 363 */ "fill_mode ::= PREV",
 /* 364 */ "fill_mode ::= NULL",
 /* 365 */ "fill_mode ::= LINEAR",
 /* 366 */ "fill_mode ::= NEXT",
 /* 367 */ "group_by_clause_opt ::=",
 /* 368 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 369 */ "group_by_list ::= expression",
 /* 370 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 371 */ "having_clause_opt ::=",
 /* 372 */ "having_clause_opt ::= HAVING search_condition",
 /* 373 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 374 */ "query_expression_body ::= query_primary",
 /* 375 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 376 */ "query_primary ::= query_specification",
 /* 377 */ "order_by_clause_opt ::=",
 /* 378 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 379 */ "slimit_clause_opt ::=",
 /* 380 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 381 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 382 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 383 */ "limit_clause_opt ::=",
 /* 384 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 385 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 386 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 387 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 388 */ "search_condition ::= common_expression",
 /* 389 */ "sort_specification_list ::= sort_specification",
 /* 390 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 391 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 392 */ "ordering_specification_opt ::=",
 /* 393 */ "ordering_specification_opt ::= ASC",
 /* 394 */ "ordering_specification_opt ::= DESC",
 /* 395 */ "null_ordering_opt ::=",
 /* 396 */ "null_ordering_opt ::= NULLS FIRST",
 /* 397 */ "null_ordering_opt ::= NULLS LAST",
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505
};
#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 已提交
1506
    pNew = malloc(newSize*sizeof(pNew[0]));
1507 1508
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1509
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526
  }
  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 已提交
1527
** second argument to ParseAlloc() below.  This can be changed by
1528 1529 1530 1531 1532 1533 1534 1535 1536
** 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 已提交
1537
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1538
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1539
  ParseCTX_STORE
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562
#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 已提交
1563
#ifndef Parse_ENGINEALWAYSONSTACK
1564 1565 1566 1567 1568 1569 1570 1571 1572 1573
/* 
** 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 已提交
1574
** to Parse and ParseFree.
1575
*/
X
Xiaoyu Wang 已提交
1576
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
1577 1578 1579
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
1580 1581
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
1582 1583 1584
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
1585
#endif /* Parse_ENGINEALWAYSONSTACK */
1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599


/* 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 已提交
1600 1601
  ParseARG_FETCH
  ParseCTX_FETCH
1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614
  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 */
X
Xiaoyu Wang 已提交
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
    case 202: /* cmd */
    case 205: /* literal */
    case 212: /* db_options */
    case 214: /* alter_db_options */
    case 219: /* retention */
    case 220: /* full_table_name */
    case 223: /* table_options */
    case 227: /* alter_table_clause */
    case 228: /* alter_table_options */
    case 231: /* create_subtable_clause */
    case 234: /* drop_table_clause */
    case 237: /* column_def */
    case 240: /* col_name */
    case 241: /* db_name_cond_opt */
    case 242: /* like_pattern_opt */
    case 243: /* table_name_cond */
    case 244: /* from_db_opt */
    case 245: /* func_name */
    case 248: /* index_options */
    case 250: /* duration_literal */
    case 251: /* sliding_opt */
    case 252: /* func */
    case 255: /* query_expression */
    case 257: /* explain_options */
    case 262: /* signed */
    case 263: /* signed_literal */
    case 266: /* expression */
    case 267: /* pseudo_column */
    case 268: /* column_reference */
    case 269: /* subquery */
    case 270: /* predicate */
    case 273: /* in_predicate_value */
    case 274: /* boolean_value_expression */
    case 275: /* boolean_primary */
    case 276: /* common_expression */
    case 277: /* from_clause */
    case 278: /* table_reference_list */
    case 279: /* table_reference */
    case 280: /* table_primary */
    case 281: /* joined_table */
    case 283: /* parenthesized_joined_table */
    case 285: /* search_condition */
    case 286: /* query_specification */
    case 289: /* where_clause_opt */
    case 291: /* twindow_clause_opt */
    case 293: /* having_clause_opt */
    case 295: /* select_item */
    case 296: /* fill_opt */
    case 299: /* query_expression_body */
    case 301: /* slimit_clause_opt */
    case 302: /* limit_clause_opt */
    case 303: /* query_primary */
    case 305: /* sort_specification */
1668
{
X
Xiaoyu Wang 已提交
1669
 nodesDestroyNode((yypminor->yy168)); 
1670 1671
}
      break;
X
Xiaoyu Wang 已提交
1672 1673 1674 1675
    case 203: /* account_options */
    case 204: /* alter_account_options */
    case 206: /* alter_account_option */
    case 259: /* bufsize_opt */
1676
{
1677
 
1678 1679
}
      break;
X
Xiaoyu Wang 已提交
1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692
    case 207: /* user_name */
    case 208: /* dnode_endpoint */
    case 209: /* dnode_host_name */
    case 211: /* db_name */
    case 229: /* column_name */
    case 236: /* table_name */
    case 246: /* function_name */
    case 247: /* index_name */
    case 254: /* topic_name */
    case 260: /* stream_name */
    case 264: /* table_alias */
    case 265: /* column_alias */
    case 282: /* alias_opt */
1693
{
1694
 
1695 1696
}
      break;
X
Xiaoyu Wang 已提交
1697 1698 1699 1700 1701
    case 210: /* not_exists_opt */
    case 213: /* exists_opt */
    case 256: /* analyze_opt */
    case 258: /* agg_func_opt */
    case 287: /* set_quantifier_opt */
1702
{
1703 1704 1705
 
}
      break;
X
Xiaoyu Wang 已提交
1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727
    case 215: /* integer_list */
    case 216: /* variable_list */
    case 217: /* retention_list */
    case 221: /* column_def_list */
    case 222: /* tags_def_opt */
    case 224: /* multi_create_clause */
    case 225: /* tags_def */
    case 226: /* multi_drop_clause */
    case 232: /* specific_tags_opt */
    case 233: /* literal_list */
    case 235: /* col_name_list */
    case 238: /* func_name_list */
    case 249: /* func_list */
    case 253: /* expression_list */
    case 261: /* dnode_list */
    case 288: /* select_list */
    case 290: /* partition_by_clause_opt */
    case 292: /* group_by_clause_opt */
    case 294: /* select_sublist */
    case 298: /* group_by_list */
    case 300: /* order_by_clause_opt */
    case 304: /* sort_specification_list */
1728
{
X
Xiaoyu Wang 已提交
1729
 nodesDestroyList((yypminor->yy376)); 
1730 1731
}
      break;
X
Xiaoyu Wang 已提交
1732 1733
    case 218: /* alter_db_option */
    case 239: /* alter_table_option */
1734
{
X
Xiaoyu Wang 已提交
1735
 
1736 1737
}
      break;
X
Xiaoyu Wang 已提交
1738
    case 230: /* type_name */
1739
{
1740
 
1741 1742
}
      break;
X
Xiaoyu Wang 已提交
1743 1744
    case 271: /* compare_op */
    case 272: /* in_op */
1745
{
1746
 
1747 1748
}
      break;
X
Xiaoyu Wang 已提交
1749
    case 284: /* join_type */
1750
{
1751
 
1752 1753
}
      break;
X
Xiaoyu Wang 已提交
1754
    case 297: /* fill_mode */
1755
{
1756
 
1757 1758
}
      break;
X
Xiaoyu Wang 已提交
1759
    case 306: /* ordering_specification_opt */
1760
{
1761
 
1762 1763
}
      break;
X
Xiaoyu Wang 已提交
1764
    case 307: /* null_ordering_opt */
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
}
      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 已提交
1798
void ParseFinalize(void *p){
1799 1800 1801
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
1802
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
1803 1804 1805
#endif
}

X
Xiaoyu Wang 已提交
1806
#ifndef Parse_ENGINEALWAYSONSTACK
1807 1808 1809 1810 1811 1812 1813 1814
/* 
** 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 已提交
1815
void ParseFree(
1816 1817 1818 1819 1820 1821
  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 已提交
1822
  ParseFinalize(p);
1823 1824
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
1825
#endif /* Parse_ENGINEALWAYSONSTACK */
1826 1827 1828 1829 1830

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
1831
int ParseStackPeak(void *p){
1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854
  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 已提交
1855
int ParseCoverage(FILE *out){
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 1972 1973 1974 1975 1976
  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 );
    /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
    if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
        }
#endif
        assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
        iLookAhead = iFallback;
        continue;
      }
#endif
#ifdef YYWILDCARD
      {
        int j = i - iLookAhead + YYWILDCARD;
        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
        ){
#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 已提交
1977 1978
   ParseARG_FETCH
   ParseCTX_FETCH
1979 1980 1981 1982 1983 1984 1985 1986 1987 1988
#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 已提交
1989 1990
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
}

/*
** 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 已提交
2021
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062
){
  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");
}

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

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

  if (pCxt->valid) {
    if(TOKEN.z) {
      generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
    } else {
      generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
    }
    pCxt->valid = false;
3801 3802
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
3803 3804
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3805 3806 3807 3808 3809 3810 3811 3812
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
3813 3814
  ParseARG_FETCH
  ParseCTX_FETCH
3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827
#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 已提交
3828 3829
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3830 3831 3832 3833
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
3834
** "ParseAlloc" which describes the current state of the parser.
3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850
** 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 已提交
3851
void Parse(
3852 3853
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
3854 3855
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
3856 3857 3858 3859 3860 3861 3862 3863 3864 3865
){
  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 已提交
3866 3867
  ParseCTX_FETCH
  ParseARG_STORE
3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891

  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 已提交
3892
                        yyminor ParseCTX_PARAM);
3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 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 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024
    }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 已提交
4025
int ParseFallback(int iToken){
4026 4027 4028 4029 4030 4031 4032 4033 4034
#ifdef YYFALLBACK
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
#else
  (void)iToken;
#endif
  return 0;
}