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

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

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

/* The next sections is a series of control #defines.
** various aspects of the generated parser.
**    YYCODETYPE         is the data type used to store the integer codes
**                       that represent terminal and non-terminal symbols.
**                       "unsigned char" is used if there are fewer than
**                       256 symbols.  Larger types otherwise.
**    YYNOCODE           is a number of type YYCODETYPE that is not used for
**                       any terminal or nonterminal symbol.
**    YYFALLBACK         If defined, this indicates that one or more tokens
**                       (also known as: "terminal symbols") have fall-back
**                       values which should be used if the original symbol
**                       would not parse.  This permits keywords to sometimes
**                       be used as identifiers, for example.
**    YYACTIONTYPE       is the data type used for "action codes" - numbers
**                       that indicate what to do in response to the next
**                       token.
X
Xiaoyu Wang 已提交
63
**    ParseTOKENTYPE     is the data type used for minor type for terminal
64 65 66 67 68 69 70 71 72 73
**                       symbols.  Background: A "minor type" is a semantic
**                       value associated with a terminal or non-terminal
**                       symbols.  For example, for an "ID" terminal symbol,
**                       the minor type might be the name of the identifier.
**                       Each non-terminal can have a different minor type.
**                       Terminal symbols all have the same minor type, though.
**                       This macros defines the minor type for terminal 
**                       symbols.
**    YYMINORTYPE        is the data type used for all minor types.
**                       This is typically a union of many types, one of
X
Xiaoyu Wang 已提交
74
**                       which is ParseTOKENTYPE.  The entry in the union
75 76
**                       for terminal symbols is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
X
Xiaoyu Wang 已提交
77
**                       zero the stack is dynamically sized using realloc()
X
Xiaoyu Wang 已提交
78 79 80 81 82 83
**    ParseARG_SDECL     A static variable declaration for the %extra_argument
**    ParseARG_PDECL     A parameter declaration for the %extra_argument
**    ParseARG_PARAM     Code to pass %extra_argument as a subroutine parameter
**    ParseARG_STORE     Code to store %extra_argument into yypParser
**    ParseARG_FETCH     Code to extract %extra_argument from yypParser
**    ParseCTX_*         As ParseARG_ except for %extra_context
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYNTOKEN           Number of terminal symbols
**    YY_MAX_SHIFT       Maximum value for shift actions
**    YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
**    YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
**    YY_ERROR_ACTION    The yy_action[] code for syntax error
**    YY_ACCEPT_ACTION   The yy_action[] code for accept
**    YY_NO_ACTION       The yy_action[] code for no-op
**    YY_MIN_REDUCE      Minimum value for reduce actions
**    YY_MAX_REDUCE      Maximum value for reduce actions
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
X
Xiaoyu Wang 已提交
102
#define YYCODETYPE unsigned short int
103
#define YYNOCODE 277
104
#define YYACTIONTYPE unsigned short int
X
Xiaoyu Wang 已提交
105
#define ParseTOKENTYPE  SToken 
106 107
typedef union {
  int yyinit;
X
Xiaoyu Wang 已提交
108
  ParseTOKENTYPE yy0;
109 110 111 112 113 114 115 116 117 118 119 120
  EFillMode yy6;
  EJoinType yy10;
  SNode* yy46;
  SToken yy95;
  SAlterOption yy145;
  bool yy151;
  SNodeList* yy194;
  int32_t yy202;
  ENullOrder yy273;
  EOperatorType yy292;
  SDataType yy400;
  EOrder yy456;
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
#define YYNSTATE             446
#define YYNRULE              358
137
#define YYNTOKEN             179
X
Xiaoyu Wang 已提交
138 139 140 141 142 143 144 145
#define YY_MAX_SHIFT         445
#define YY_MIN_SHIFTREDUCE   693
#define YY_MAX_SHIFTREDUCE   1050
#define YY_ERROR_ACTION      1051
#define YY_ACCEPT_ACTION     1052
#define YY_NO_ACTION         1053
#define YY_MIN_REDUCE        1054
#define YY_MAX_REDUCE        1411
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 (1331)
213
static const YYACTIONTYPE yy_action[] = {
X
Xiaoyu Wang 已提交
214 215
 /*     0 */  1268,  345,   24,  174,  364,  364,  258,  243, 1264, 1271,
 /*    10 */  1234, 1235,   31,   29,   27,   26,   25, 1281,  377,  377,
216
 /*    20 */     9,    8,   95,   69,   69,   31,   29,   27,   26,   25,
X
Xiaoyu Wang 已提交
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
 /*    30 */   293,  299,  345, 1390,  108,   62, 1066, 1297,  377, 1158,
 /*    40 */  1158,  349, 1149,  262,  361,   96,  120,  217, 1097,  251,
 /*    50 */  1388,   93, 1150,   95,  363,  376, 1225, 1227, 1255, 1158,
 /*    60 */   217,  167, 1336,  344,  112,  343, 1100,   46, 1390,  926,
 /*    70 */    65, 1282, 1283, 1286, 1329, 1198,   92,  956,  233, 1325,
 /*    80 */  1402,  120,   93, 1255, 1153, 1388,  109, 1124,  969, 1363,
 /*    90 */   956,  347,  116, 1336, 1337,  272, 1341,  430,  429,  428,
 /*   100 */   427,  426,  425,  424,  423,  422,  421,  420,  419,  418,
 /*   110 */   417,  416,  415,  414,  413,  306,  957,  301,  376,  730,
 /*   120 */   305,  729,  911,  304, 1052,  302,  300,   81,  303,  957,
 /*   130 */    80,   79,   78,   77,   76,   75,   74,   73,   72,  731,
 /*   140 */   126,  125,   23,  238,  951,  952,  953,  954,  955,  959,
 /*   150 */   960,  961,   27,   26,   25,   23,  238,  951,  952,  953,
 /*   160 */   954,  955,  959,  960,  961, 1281,   12,  284,   31,   29,
 /*   170 */    27,   26,   25,  255,  803,  400,  399,  398,  807,  397,
 /*   180 */   809,  810,  396,  812,  393, 1297,  818,  390,  820,  821,
 /*   190 */   387,  384,  361,   31,   29,   27,   26,   25,  231, 1205,
 /*   200 */  1390,  352,  363, 1077,   30,   28, 1255,  257, 1281,  256,
 /*   210 */  1226,  349,  240,  120,  891, 1268, 1390, 1388,   64, 1282,
 /*   220 */  1283, 1286, 1329, 1264, 1270,  926,  216, 1325, 1297, 1389,
 /*   230 */   889,   46,  121, 1388,  376,  348,  334,  377, 1390,   11,
 /*   240 */   247,  246,  263,  297, 1255,  363, 1222,  296, 1154, 1255,
 /*   250 */   904,  120,  121,  124, 1281, 1388,  121, 1076, 1158,  913,
 /*   260 */     1,   65, 1282, 1283, 1286, 1329,  897,  377,  298,  233,
 /*   270 */  1325,  115,  283,  264, 1297,  340,  336,   30,   28,  993,
 /*   280 */   248,  361,   12,  170,  442,  240,    6,  891, 1158,  327,
 /*   290 */  1356,  363,   30,   28, 1297, 1255,  890, 1268, 1255,  215,
 /*   300 */   240,  361,  891,  889, 1047, 1264, 1270,   66, 1282, 1283,
 /*   310 */  1286, 1329,   11, 1055, 1075, 1328, 1325,  339,  889, 1017,
 /*   320 */   378,  915,  892,  320,  895,  896,  206,   11,  939,  335,
 /*   330 */  1074,  121,  900,    1,   81,  438,  437,   80,   79,   78,
 /*   340 */    77,   76,   75,   74,   73,   72,  121, 1136,    1, 1054,
 /*   350 */   331, 1015, 1016, 1018, 1019, 1255, 1046,  442,  905, 1297,
 /*   360 */   908,  896,  377,  321, 1073, 1281,  361, 1155,  351,  890,
 /*   370 */   914, 1255,  442,   90,   89,   88,   87,   86,   85,   84,
 /*   380 */    83,   82, 1343, 1158,  890, 1297, 1343, 1134, 1281,  412,
 /*   390 */  1390, 1072,  348,  284,  338,  892,  988,  895,  896,  206,
 /*   400 */  1340,  939,  363,  120, 1339, 1255, 1255, 1388, 1297,  912,
 /*   410 */   892, 1281,  895,  896,  206,  361,  939, 1071,   65, 1282,
 /*   420 */  1283, 1286, 1329,  169, 1205,  363,  233, 1325,  115, 1255,
 /*   430 */   230, 1297, 1255,  412,  345, 1203, 1343,  729,  361,  992,
 /*   440 */  1070,   65, 1282, 1283, 1286, 1329,   55, 1357,  363,  233,
 /*   450 */  1325, 1402, 1255,  291, 1338,   95,  958,  916, 1255,  356,
 /*   460 */  1386,   30,   28, 1151,   65, 1282, 1283, 1286, 1329,  240,
 /*   470 */  1281,  891,  233, 1325, 1402, 1135,  318,  107,   30,   28,
 /*   480 */   362, 1255,   21, 1347,   93, 1161,  240,  889,  891,  316,
 /*   490 */  1297,  962,   30,   28,  117, 1336, 1337,  361, 1341,  403,
 /*   500 */   240, 1069,  891,  194,  889,  244, 1188,  363, 1068,  377,
 /*   510 */  1065, 1255,  141,  107,  374,  139,  349,    7,  889,  143,
 /*   520 */  1064, 1160,  142,  207, 1282, 1283, 1286,  323,  224, 1205,
 /*   530 */  1158, 1067,  409, 1063,    7,  245,  408,   30,   28,  101,
 /*   540 */  1203,  442, 1255, 1390, 1205,  240, 1125,  891,    7, 1255,
 /*   550 */   297, 1255,  357,  890,  296, 1204,  120,  410,  442,  155,
 /*   560 */  1388, 1255, 1147,  889,  225, 1000,  223,  222, 1281,  295,
 /*   570 */   890,  913,  442, 1143, 1255,  298,  407,  406,  405,  892,
 /*   580 */   404,  895,  896,  206,  890,  939,  145,  377, 1297,  144,
 /*   590 */   991, 1281,  375,    1,  353,  361,  892, 1145,  895,  896,
 /*   600 */   206,  147,  939,  121,  146,  363, 1348,  988, 1158, 1255,
 /*   610 */   892, 1297,  895,  896,  206,  377,  939,  442,  361,  250,
 /*   620 */   188,   66, 1282, 1283, 1286, 1329, 1141,  107,  363,  890,
 /*   630 */  1326, 1205, 1255,  199, 1062, 1160, 1158,  252,  201,    9,
 /*   640 */     8, 1061, 1203, 1281,   66, 1282, 1283, 1286, 1329, 1281,
 /*   650 */   200,  345,  359, 1325, 1281,  892,  402,  895,  896,  206,
 /*   660 */   127,  939,  938, 1297,  940,  941,  942,  943,  944, 1297,
 /*   670 */   361, 1014,   95,  377, 1297, 1255,  361, 1060,  254,  899,
 /*   680 */   363,  361, 1255,   42, 1255,  354,  363, 1059, 1058,  171,
 /*   690 */  1255,  363, 1093,  239, 1158, 1255,  110, 1282, 1283, 1286,
 /*   700 */  1281,   93,  211, 1282, 1283, 1286, 1281,  110, 1282, 1283,
 /*   710 */  1286,  118, 1336, 1337,  307, 1341,  253, 1057, 1255,  160,
 /*   720 */  1297,   67, 1049, 1050,  107,  360, 1297,  361, 1255, 1255,
 /*   730 */  1281,  158, 1160,  361,  350, 1403,  891,  363,   44,   43,
 /*   740 */   261, 1255,  122,  363,  328,  902, 1404, 1255,  332, 1199,
 /*   750 */  1297,  164,  889,  211, 1282, 1283, 1286,  361, 1255,  210,
 /*   760 */  1282, 1283, 1286,  911,  963,  923, 1275,  363, 1281,  121,
 /*   770 */   265, 1255, 1088,  277,  237,  898,   32,   32, 1273,  445,
 /*   780 */   875,  290,  278,  211, 1282, 1283, 1286,   20, 1297, 1359,
 /*   790 */  1298,  341,   32,  191,  309,  361,   91,   31,   29,   27,
 /*   800 */    26,   25,  434,   22,  190,  363,  442, 1086,  179, 1255,
 /*   810 */   948, 1281,  241,   31,   29,   27,   26,   25,  890,  346,
 /*   820 */   177,  211, 1282, 1283, 1286,  369,   61,   63,  185,  312,
 /*   830 */   186, 1297,  173,  796,    2,  884,   57,   98,  361,  791,
 /*   840 */    99,  901, 1281,  192,  892,  101,  895,  896,  363,  911,
 /*   850 */   276,   42, 1255,  271,  270,  269,  268,  267,  824, 1224,
 /*   860 */   123,  373, 1297,  828,  209, 1282, 1283, 1286,  834,  361,
 /*   870 */   382,  266,  833, 1281,  273,   99,  275,  279,  326,  363,
 /*   880 */   100,  151, 1281, 1255,  101,  919,   31,   29,   27,   26,
 /*   890 */    25,  102,  274, 1297,  280,  212, 1282, 1283, 1286,  128,
 /*   900 */   361,  918, 1297,   99, 1281,  282,  281,  131,   45,  361,
 /*   910 */   363,  285,  917, 1281, 1255,  134,  292,  294, 1148,  363,
 /*   920 */   229,  138, 1144, 1255, 1297,  150,  204, 1282, 1283, 1286,
 /*   930 */   140,  361,  103, 1297, 1133,  213, 1282, 1283, 1286,   71,
 /*   940 */   361,  363,  104, 1281, 1146, 1255, 1142,  325,  105,  106,
 /*   950 */   363, 1281,  153,  322, 1255,  916,  367,  205, 1282, 1283,
 /*   960 */  1286,  324,  333, 1297, 1370,  896,  214, 1282, 1283, 1286,
 /*   970 */   361, 1297,  156,  330, 1281, 1360,  232, 1369,  361,  159,
 /*   980 */   363,    5,  342, 1350, 1255,  337,   94,  329,  363,    4,
 /*   990 */   163,  409, 1255,  113, 1297,  408, 1294, 1282, 1283, 1286,
 /*  1000 */   988,  361,  915,   33, 1293, 1282, 1283, 1286, 1344,  166,
 /*  1010 */   234,  363,  165, 1281,  358, 1255,  410,  355,   17,  365,
 /*  1020 */  1311, 1281, 1233,  370,  181, 1405, 1232, 1292, 1282, 1283,
 /*  1030 */  1286,  366,  242, 1297,  371,  407,  406,  405, 1387,  404,
 /*  1040 */   361, 1297,  183,  172, 1281,  372,  193,   54,  361, 1159,
 /*  1050 */   363,   56, 1281,  189, 1255,  311,  380,  195,  363,  441,
 /*  1060 */   202,  197, 1255,  203, 1297,   39,  220, 1282, 1283, 1286,
 /*  1070 */   319,  361, 1297,  198,  219, 1282, 1283, 1286, 1249,  361,
 /*  1080 */   887,  363,  886, 1281,  149, 1255,  259,  314, 1243,  363,
 /*  1090 */  1242,  260,  308, 1255, 1241,  148, 1240,  221, 1282, 1283,
 /*  1100 */  1286,  858, 1217, 1297, 1216,  218, 1282, 1283, 1286,   97,
 /*  1110 */   361, 1215, 1214, 1213, 1212, 1211, 1210,  860,   41,  136,
 /*  1120 */   363,   40,  114, 1209, 1255, 1208, 1207, 1206,  289, 1099,
 /*  1130 */   135, 1239, 1230, 1137,  130,  742,  208, 1282, 1283, 1286,
 /*  1140 */  1098, 1096,  287,  286,  288, 1085, 1084,  306, 1081,  301,
 /*  1150 */  1139,   70,  305,   47,  137,  304,  133,  302,  300,  841,
 /*  1160 */   303,  839,  840, 1138, 1094,  226,  771, 1089,  770,  227,
 /*  1170 */  1087,  228,  769,  768,  767,  766,  765, 1080,  315, 1079,
 /*  1180 */   317,  310,  313, 1238, 1237,   68,   36, 1229,   48,  154,
 /*  1190 */     3,   32,   14,   15,  152,   34,   10,   51,   37,  162,
 /*  1200 */    19,    8, 1273,  132,  368,  949, 1228,  129, 1053,  184,
 /*  1210 */  1053,  835, 1035, 1034,  235, 1053, 1039, 1053, 1038,  236,
 /*  1220 */  1053,  157, 1013,  111,  906,  161, 1053, 1053, 1007,   49,
 /*  1230 */  1053, 1006, 1053, 1053,   50,   35, 1053,  985,  984, 1053,
 /*  1240 */   168, 1040, 1053,  182, 1053,  381,  249, 1053, 1053, 1053,
 /*  1250 */   832,  119,  385,   13,   16,  924,   18,  388,  176, 1011,
 /*  1260 */   178,  391,  175,  180,   52,   53,  802,  394, 1095,   57,
 /*  1270 */  1053,   38, 1053,  825, 1272,  830,  444,  836,  187,  822,
 /*  1280 */   379,  383,  762,  386,  831,  754,  819, 1083,  389,  761,
 /*  1290 */   760,  813,  392,  759,  811,  740,  758,  757,  395,  817,
 /*  1300 */   756,  411,  755,  753,  752,  751,   58,  431,  750,   59,
 /*  1310 */    60, 1082,  749,  748,  747,  433,  746,  745,  401,  432,
 /*  1320 */   816, 1078,  435,  436,  439,  440,  815,  893,  196,  814,
 /*  1330 */   443,
348 349
};
static const YYCODETYPE yy_lookahead[] = {
350 351 352 353 354 355 356 357 358 359
 /*     0 */   223,  188,  240,  241,  219,  219,  228,  222,  231,  232,
 /*    10 */   225,  225,   12,   13,   14,   15,   16,  182,  188,  188,
 /*    20 */     1,    2,  209,  193,  193,   12,   13,   14,   15,   16,
 /*    30 */   200,  200,  188,  255,  181,  187,  183,  202,  188,  209,
 /*    40 */   209,  228,  182,  193,  209,  197,  268,   47,    0,  211,
 /*    50 */   272,  238,  204,  209,  219,   20,  218,  219,  223,  209,
 /*    60 */    47,  248,  249,  250,  201,  252,    0,  190,  255,   69,
 /*    70 */   235,  236,  237,  238,  239,  212,  199,   77,  243,  244,
 /*    80 */   245,  268,  238,  223,  207,  272,  191,  192,   69,  254,
 /*    90 */    77,  247,  248,  249,  250,   63,  252,   49,   50,   51,
X
Xiaoyu Wang 已提交
360
 /*   100 */    52,   53,   54,   55,   56,   57,   58,   59,   60,   61,
X
Xiaoyu Wang 已提交
361 362 363
 /*   110 */    62,   63,   64,   65,   66,   49,  116,   51,   20,   20,
 /*   120 */    54,   22,   20,   57,  179,   59,   60,   21,   62,  116,
 /*   130 */    24,   25,   26,   27,   28,   29,   30,   31,   32,   40,
364
 /*   140 */   108,  109,  142,  143,  144,  145,  146,  147,  148,  149,
X
Xiaoyu Wang 已提交
365
 /*   150 */   150,  151,   14,   15,   16,  142,  143,  144,  145,  146,
366 367 368 369
 /*   160 */   147,  148,  149,  150,  151,  182,   68,   46,   12,   13,
 /*   170 */    14,   15,   16,  228,   83,   84,   85,   86,   87,   88,
 /*   180 */    89,   90,   91,   92,   93,  202,   95,   96,   97,   98,
 /*   190 */    99,  100,  209,   12,   13,   14,   15,   16,  206,  202,
X
Xiaoyu Wang 已提交
370
 /*   200 */   255,    3,  219,  182,   12,   13,  223,  129,  182,  131,
371 372 373 374
 /*   210 */   213,  228,   20,  268,   22,  223,  255,  272,  235,  236,
 /*   220 */   237,  238,  239,  231,  232,   69,  243,  244,  202,  268,
 /*   230 */    38,  190,  154,  272,   20,  209,  120,  188,  255,   47,
 /*   240 */    12,   13,  193,   57,  223,  219,  209,   61,  207,  223,
X
Xiaoyu Wang 已提交
375
 /*   250 */    22,  268,  154,  216,  182,  272,  154,  182,  209,   20,
376 377
 /*   260 */    68,  235,  236,  237,  238,  239,   38,  188,   82,  243,
 /*   270 */   244,  245,  193,  188,  202,  159,  160,   12,   13,   14,
X
Xiaoyu Wang 已提交
378
 /*   280 */   206,  209,   68,  257,   92,   20,   43,   22,  209,  263,
379 380
 /*   290 */   264,  219,   12,   13,  202,  223,  104,  223,  223,  214,
 /*   300 */    20,  209,   22,   38,  123,  231,  232,  235,  236,  237,
X
Xiaoyu Wang 已提交
381
 /*   310 */   238,  239,   47,    0,  182,  243,  244,   20,   38,  132,
382
 /*   320 */    92,   20,  130,  188,  132,  133,  134,   47,  136,  237,
X
Xiaoyu Wang 已提交
383
 /*   330 */   182,  154,  104,   68,   21,  185,  186,   24,   25,   26,
384
 /*   340 */    27,   28,   29,   30,   31,   32,  154,    0,   68,    0,
X
Xiaoyu Wang 已提交
385 386 387 388 389 390 391
 /*   350 */   163,  164,  165,  166,  167,  223,  175,   92,  130,  202,
 /*   360 */   132,  133,  188,  228,  182,  182,  209,  193,  170,  104,
 /*   370 */    20,  223,   92,   24,   25,   26,   27,   28,   29,   30,
 /*   380 */    31,   32,  233,  209,  104,  202,  233,    0,  182,   46,
 /*   390 */   255,  182,  209,   46,  237,  130,  153,  132,  133,  134,
 /*   400 */   251,  136,  219,  268,  251,  223,  223,  272,  202,   20,
 /*   410 */   130,  182,  132,  133,  134,  209,  136,  182,  235,  236,
392
 /*   420 */   237,  238,  239,  122,  202,  219,  243,  244,  245,  223,
X
Xiaoyu Wang 已提交
393
 /*   430 */   208,  202,  223,   46,  188,  213,  233,   22,  209,    4,
394
 /*   440 */   182,  235,  236,  237,  238,  239,  187,  264,  219,  243,
X
Xiaoyu Wang 已提交
395
 /*   450 */   244,  245,  223,   38,  251,  209,  116,   20,  223,   81,
396
 /*   460 */   254,   12,   13,  204,  235,  236,  237,  238,  239,   20,
X
Xiaoyu Wang 已提交
397 398 399
 /*   470 */   182,   22,  243,  244,  245,    0,   21,  202,   12,   13,
 /*   480 */    14,  223,  142,  254,  238,  210,   20,   38,   22,   34,
 /*   490 */   202,  151,   12,   13,  248,  249,  250,  209,  252,   79,
400
 /*   500 */    20,  182,   22,  195,   38,  194,  198,  219,  182,  188,
X
Xiaoyu Wang 已提交
401 402
 /*   510 */   182,  223,   72,  202,  193,   75,  228,   68,   38,   72,
 /*   520 */   182,  210,   75,  235,  236,  237,  238,   69,   35,  202,
403
 /*   530 */   209,  183,   57,  182,   68,  208,   61,   12,   13,   81,
X
Xiaoyu Wang 已提交
404 405 406 407 408 409 410
 /*   540 */   213,   92,  223,  255,  202,   20,  192,   22,   68,  223,
 /*   550 */    57,  223,  174,  104,   61,  213,  268,   82,   92,  122,
 /*   560 */   272,  223,  203,   38,   71,   14,   73,   74,  182,   76,
 /*   570 */   104,   20,   92,  203,  223,   82,  101,  102,  103,  130,
 /*   580 */   105,  132,  133,  134,  104,  136,   72,  188,  202,   75,
 /*   590 */   155,  182,  193,   68,   81,  209,  130,  203,  132,  133,
 /*   600 */   134,   72,  136,  154,   75,  219,  152,  153,  209,  223,
411 412
 /*   610 */   130,  202,  132,  133,  134,  188,  136,   92,  209,  194,
 /*   620 */   193,  235,  236,  237,  238,  239,  203,  202,  219,  104,
X
Xiaoyu Wang 已提交
413 414 415
 /*   630 */   244,  202,  223,   18,  182,  210,  209,  208,   23,    1,
 /*   640 */     2,  182,  213,  182,  235,  236,  237,  238,  239,  182,
 /*   650 */    35,  188,  243,  244,  182,  130,  203,  132,  133,  134,
416
 /*   660 */    45,  136,  135,  202,  137,  138,  139,  140,  141,  202,
X
Xiaoyu Wang 已提交
417 418 419
 /*   670 */   209,   69,  209,  188,  202,  223,  209,  182,  193,   38,
 /*   680 */   219,  209,  223,   81,  223,  172,  219,  182,  182,  275,
 /*   690 */   223,  219,    0,  226,  209,  223,  235,  236,  237,  238,
420
 /*   700 */   182,  238,  235,  236,  237,  238,  182,  235,  236,  237,
X
Xiaoyu Wang 已提交
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
 /*   710 */   238,  248,  249,  250,   22,  252,  194,  182,  223,   69,
 /*   720 */   202,  106,  177,  178,  202,   47,  202,  209,  223,  223,
 /*   730 */   182,   81,  210,  209,  273,  274,   22,  219,  123,  124,
 /*   740 */   125,  223,  127,  219,  226,  104,  274,  223,  266,  212,
 /*   750 */   202,  260,   38,  235,  236,  237,  238,  209,  223,  235,
 /*   760 */   236,  237,  238,   20,   69,   69,   68,  219,  182,  154,
 /*   770 */    27,  223,    0,   30,  226,   38,   81,   81,   80,   19,
 /*   780 */    69,  185,   39,  235,  236,  237,  238,    2,  202,  234,
 /*   790 */   202,  267,   81,   33,   22,  209,   36,   12,   13,   14,
 /*   800 */    15,   16,   42,    2,   44,  219,   92,    0,   69,  223,
 /*   810 */   132,  182,  226,   12,   13,   14,   15,   16,  104,  253,
 /*   820 */    81,  235,  236,  237,  238,   69,   68,   67,   69,   22,
 /*   830 */    70,  202,  269,   69,  256,  128,   78,   81,  209,   69,
 /*   840 */    81,  104,  182,  229,  130,   81,  132,  133,  219,   20,
 /*   850 */   107,   81,  223,  110,  111,  112,  113,  114,   69,  188,
 /*   860 */   115,  101,  202,   69,  235,  236,  237,  238,   69,  209,
 /*   870 */    81,  217,   69,  182,  215,   81,  215,  188,  118,  219,
 /*   880 */    81,  121,  182,  223,   81,   20,   12,   13,   14,   15,
 /*   890 */    16,   69,  116,  202,  227,  235,  236,  237,  238,  190,
 /*   900 */   209,   20,  202,   81,  182,  220,  209,  190,  190,  209,
 /*   910 */   219,  188,   20,  182,  223,  190,  184,  202,  202,  219,
 /*   920 */   184,  202,  202,  223,  202,  187,  235,  236,  237,  238,
 /*   930 */   202,  209,  202,  202,    0,  235,  236,  237,  238,  188,
 /*   940 */   209,  219,  202,  182,  202,  223,  202,  220,  202,  202,
 /*   950 */   219,  182,  187,  227,  223,   20,  161,  235,  236,  237,
 /*   960 */   238,  209,  162,  202,  265,  133,  235,  236,  237,  238,
 /*   970 */   209,  202,  224,  223,  182,  234,  223,  265,  209,  224,
 /*   980 */   219,  169,  168,  262,  223,  223,  209,  157,  219,  156,
 /*   990 */   261,   57,  223,  259,  202,   61,  235,  236,  237,  238,
 /*  1000 */   153,  209,   20,  115,  235,  236,  237,  238,  233,  246,
 /*  1010 */   176,  219,  258,  182,  173,  223,   82,  171,   68,  223,
 /*  1020 */   242,  182,  224,  119,  209,  276,  224,  235,  236,  237,
 /*  1030 */   238,  223,  223,  202,  221,  101,  102,  103,  271,  105,
 /*  1040 */   209,  202,  187,  270,  182,  220,  198,  187,  209,  209,
 /*  1050 */   219,   68,  182,  187,  223,    4,  205,  188,  219,  184,
 /*  1060 */   196,  189,  223,  196,  202,  230,  235,  236,  237,  238,
 /*  1070 */    19,  209,  202,  180,  235,  236,  237,  238,    0,  209,
 /*  1080 */   104,  219,  130,  182,   33,  223,   50,   36,    0,  219,
 /*  1090 */     0,  126,   41,  223,    0,   44,    0,  235,  236,  237,
 /*  1100 */   238,   80,    0,  202,    0,  235,  236,  237,  238,  115,
 /*  1110 */   209,    0,    0,    0,    0,    0,    0,   22,   67,   33,
 /*  1120 */   219,   70,   36,    0,  223,    0,    0,    0,   42,    0,
 /*  1130 */    44,    0,    0,    0,   43,   48,  235,  236,  237,  238,
 /*  1140 */     0,    0,   36,   38,   43,    0,    0,   49,    0,   51,
 /*  1150 */     0,   77,   54,   67,   75,   57,   70,   59,   60,   38,
 /*  1160 */    62,   22,   38,    0,    0,   22,   38,    0,   38,   22,
 /*  1170 */     0,   22,   38,   38,   38,   38,   38,    0,   22,    0,
 /*  1180 */    22,   39,   38,    0,    0,   20,  122,    0,   68,  117,
 /*  1190 */    81,   81,  158,  158,   43,  152,  158,    4,   81,   81,
 /*  1200 */    81,    2,   80,  117,  120,  132,    0,  121,  277,  117,
 /*  1210 */   277,  104,   38,   38,   38,  277,   38,  277,   38,   38,
 /*  1220 */   277,   69,   69,   68,   22,   68,  277,  277,   69,   68,
 /*  1230 */   277,   69,  277,  277,   68,   81,  277,   69,   69,  277,
 /*  1240 */    80,   69,  277,   43,  277,   38,   38,  277,  277,  277,
 /*  1250 */    38,   80,   38,   68,   81,   69,   68,   38,   69,   69,
 /*  1260 */    68,   38,   80,   68,   68,   68,   22,   38,    0,   78,
 /*  1270 */   277,   68,  277,   69,   80,   22,   20,   38,   80,   69,
 /*  1280 */    79,   68,   22,   68,   38,   22,   69,    0,   68,   38,
 /*  1290 */    38,   69,   68,   38,   69,   48,   38,   38,   68,   94,
 /*  1300 */    38,   47,   38,   38,   38,   38,   68,   38,   38,   68,
 /*  1310 */    68,    0,   38,   38,   38,   43,   38,   38,   82,   36,
 /*  1320 */    94,    0,   38,   37,   22,   21,   94,   22,   22,   94,
 /*  1330 */    21,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1340 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1350 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
 /*  1360 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1370 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1380 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1390 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1400 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1410 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1420 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1430 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1440 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1450 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1460 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1470 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1480 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1490 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
 /*  1500 */   277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
501
};
X
Xiaoyu Wang 已提交
502
#define YY_SHIFT_COUNT    (445)
503
#define YY_SHIFT_MIN      (0)
X
Xiaoyu Wang 已提交
504
#define YY_SHIFT_MAX      (1321)
505
static const unsigned short int yy_shift_ofst[] = {
506 507 508
 /*     0 */   615,  192,  265,  280,  280,  280,  280,  449,  280,  280,
 /*    10 */   480,  525,   98,  466,  480,  480,  480,  480,  480,  480,
 /*    20 */   480,  480,  480,  480,  480,  480,  480,  480,  480,  480,
X
Xiaoyu Wang 已提交
509 510 511 512 513
 /*    30 */   480,  480,  480,  214,  214,  214,  102,  228,  228,   78,
 /*    40 */    35,   35,  228,   35,   35,   35,   35,  121,  239,  297,
 /*    50 */   297,  177,  350,  239,   35,   35,  239,   35,  239,  350,
 /*    60 */   239,  239,   35,  343,    0,   13,   13,  743,  106,  493,
 /*    70 */   714, 1098,  714,  714,  714,  714,  714,  714,  714,  714,
514
 /*    80 */   714,  714,  714,  714,  714,  714,  714,  714,  714,  714,
X
Xiaoyu Wang 已提交
515 516 517 518 519 520 521 522 523 524 525
 /*    90 */   714,   99,  347,  301,  301,  301,  387,  389,  350,  239,
 /*   100 */   239,  239,  420,   91,   91,   91,   91,   91,  313,   66,
 /*   110 */   181,  187,  186,  116,  415,  437,  454,  243,  454,  551,
 /*   120 */   198,  435,  707,  829,  745,  776,  776,  829,  865,  121,
 /*   130 */   389,  881,  121,  121,  829,  121,  892,  239,  239,  239,
 /*   140 */   239,  239,  239,  239,  239,  239,  239,  239,  829,  892,
 /*   150 */   865,  343,  389,  881,  343,  935,  800,  795,  832,  800,
 /*   160 */   795,  832,  832,  812,  814,  830,  833,  847,  389,  982,
 /*   170 */   888,  834,  841,  846,  950,  239,  795,  832,  832,  795,
 /*   180 */   832,  904,  389,  881,  343,  420,  343,  389,  983,  829,
 /*   190 */   343,  892, 1331, 1331, 1331, 1331, 1331,   48,  349,  760,
526
 /*   200 */  1086, 1051,  475,  934,  785,  801,  527,  156,  874,  874,
X
Xiaoyu Wang 已提交
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
 /*   210 */   874,  874,  874,  874,  874,   32,   19,  340,  138,  138,
 /*   220 */   138,  138,  440,  447,  514,  529,  692,  772,  807,  455,
 /*   230 */   458,  602,  650,  638,  545,  513,  378,  695,  678,  696,
 /*   240 */   698,  711,  739,  756,  759,  764,  641,  737,  770,  789,
 /*   250 */   794,  799,  803,  822,  758, 1078,  976,  952, 1088, 1090,
 /*   260 */  1036,  965, 1094, 1096, 1021, 1102, 1104,  994, 1111, 1112,
 /*   270 */  1113, 1114, 1115, 1116, 1095, 1123, 1125, 1126, 1127, 1129,
 /*   280 */  1131, 1132, 1091, 1133, 1087, 1140, 1141, 1105, 1106, 1101,
 /*   290 */  1145, 1146, 1148, 1150, 1074, 1079, 1121, 1124, 1139, 1163,
 /*   300 */  1128, 1130, 1134, 1135, 1136, 1137, 1138, 1164, 1143, 1167,
 /*   310 */  1147, 1142, 1170, 1149, 1144, 1177, 1156, 1179, 1158, 1165,
 /*   320 */  1183, 1184, 1064, 1187, 1120, 1151, 1072, 1109, 1110, 1034,
 /*   330 */  1152, 1117, 1153, 1155, 1157, 1159, 1161, 1162, 1118, 1122,
 /*   340 */  1166, 1119, 1035, 1168, 1169, 1160, 1043, 1154, 1171, 1172,
 /*   350 */  1173, 1038, 1193, 1174, 1175, 1176, 1178, 1180, 1181, 1199,
 /*   360 */  1073, 1182, 1186, 1185, 1188, 1189, 1190, 1192, 1195, 1084,
 /*   370 */  1196, 1206, 1200, 1092, 1197, 1191, 1194, 1198, 1202, 1203,
 /*   380 */  1201, 1204, 1207, 1208, 1213, 1210, 1214, 1215, 1217, 1219,
 /*   390 */  1220, 1222, 1223, 1224, 1225, 1229, 1230, 1205, 1226, 1232,
 /*   400 */  1235, 1244, 1236, 1238, 1239, 1107, 1241, 1242, 1212, 1246,
 /*   410 */  1253, 1247, 1254, 1260, 1251, 1252, 1255, 1258, 1259, 1262,
 /*   420 */  1264, 1263, 1265, 1266, 1267, 1270, 1274, 1275, 1276, 1278,
 /*   430 */  1279, 1268, 1269, 1283, 1272, 1287, 1284, 1286, 1311, 1321,
 /*   440 */  1302, 1304, 1305, 1306, 1309, 1256,
551
};
552 553
#define YY_REDUCE_COUNT (196)
#define YY_REDUCE_MIN   (-238)
X
Xiaoyu Wang 已提交
554
#define YY_REDUCE_MAX   (901)
555
static const short yy_reduce_ofst[] = {
556 557 558 559
 /*     0 */   -55,  -17,   26,  183, -165,  206,  229,  288,   72,  409,
 /*    10 */   461,  386, -187,  467,  518,  524,  472,  548,  586,  629,
 /*    20 */   660,  691,  700,  722,  731,  761,  769,  792,  831,  839,
 /*    30 */   862,  870,  901, -156,  246,  463,  135,   -8,   74, -222,
X
Xiaoyu Wang 已提交
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575
 /*    40 */  -170, -169, -223, -150,   49,   79,  174, -123,  222,   92,
 /*    50 */   157,  -39, -215,  311,  321,  399,  327,  427,  425, -162,
 /*    60 */   429,  522,  485, -152, -238, -238, -238,   85, -147, -137,
 /*    70 */  -140, -105,   21,   75,  132,  148,  182,  209,  235,  258,
 /*    80 */   319,  326,  328,  338,  351,  452,  459,  495,  505,  506,
 /*    90 */   535,  150,   41,  149,  153,  203,  259,   37, -214,  275,
 /*   100 */    -3,  342,  308,  359,  370,  394,  423,  453,  348,  354,
 /*   110 */   414,  482,  537,  491,  596,  555,  566,  566,  566,  588,
 /*   120 */   563,  578,  614,  671,  654,  659,  661,  689,  667,  709,
 /*   130 */   697,  685,  717,  718,  723,  725,  732,  715,  716,  719,
 /*   140 */   720,  728,  730,  740,  742,  744,  746,  747,  751,  736,
 /*   150 */   726,  738,  752,  727,  765,  741,  699,  748,  750,  712,
 /*   160 */   755,  753,  762,  721,  729,  734,  754,  566,  777,  775,
 /*   170 */   763,  749,  767,  773,  778,  588,  798,  796,  808,  802,
 /*   180 */   809,  813,  815,  825,  855,  848,  860,  840,  851,  869,
 /*   190 */   866,  875,  835,  864,  867,  872,  893,
576 577
};
static const YYACTIONTYPE yy_default[] = {
X
Xiaoyu Wang 已提交
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622
 /*     0 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*    10 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*    20 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*    30 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*    40 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1104, 1051, 1051,
 /*    50 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*    60 */  1051, 1051, 1051, 1102, 1051, 1331, 1051, 1218, 1051, 1051,
 /*    70 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*    80 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*    90 */  1051, 1051, 1104, 1342, 1342, 1342, 1102, 1051, 1051, 1051,
 /*   100 */  1051, 1051, 1187, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   110 */  1406, 1051, 1140, 1366, 1051, 1358, 1334, 1348, 1335, 1051,
 /*   120 */  1391, 1351, 1244, 1051, 1223, 1220, 1220, 1051, 1051, 1104,
 /*   130 */  1051, 1051, 1104, 1104, 1051, 1104, 1051, 1051, 1051, 1051,
 /*   140 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   150 */  1051, 1102, 1051, 1051, 1102, 1051, 1373, 1371, 1051, 1373,
 /*   160 */  1371, 1051, 1051, 1385, 1381, 1364, 1362, 1348, 1051, 1051,
 /*   170 */  1051, 1409, 1397, 1393, 1051, 1051, 1371, 1051, 1051, 1371,
 /*   180 */  1051, 1231, 1051, 1051, 1102, 1051, 1102, 1051, 1156, 1051,
 /*   190 */  1102, 1051, 1246, 1190, 1190, 1105, 1056, 1051, 1051, 1051,
 /*   200 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1296, 1384,
 /*   210 */  1383, 1295, 1308, 1307, 1306, 1051, 1051, 1051, 1290, 1291,
 /*   220 */  1289, 1288, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   230 */  1051, 1051, 1051, 1332, 1051, 1394, 1398, 1051, 1051, 1051,
 /*   240 */  1274, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   250 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   260 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   270 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   280 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   290 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   300 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   310 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   320 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1355, 1365, 1051,
 /*   330 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1274,
 /*   340 */  1051, 1382, 1051, 1341, 1337, 1051, 1051, 1333, 1051, 1051,
 /*   350 */  1392, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1327,
 /*   360 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   370 */  1051, 1051, 1051, 1051, 1051, 1051, 1273, 1051, 1051, 1051,
 /*   380 */  1051, 1051, 1051, 1051, 1184, 1051, 1051, 1051, 1051, 1051,
 /*   390 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1169, 1167, 1166,
 /*   400 */  1165, 1051, 1162, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   410 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   420 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   430 */  1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
 /*   440 */  1051, 1051, 1051, 1051, 1051, 1051,
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 670 671 672 673 674 675 676 677 678 679
};
/********** 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 已提交
680 681
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
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
#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 已提交
717
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
718 719 720 721 722 723 724 725 726 727 728 729
  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 */ "$",
730 731
  /*    1 */ "OR",
  /*    2 */ "AND",
732 733 734 735 736
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
737 738 739 740 741 742 743 744 745 746
  /*    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",
747
  /*   18 */ "CREATE",
748 749 750
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
751 752 753 754 755 756 757 758 759 760 761 762
  /*   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",
763 764
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795
  /*   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",
  /*   54 */ "FSYNC",
  /*   55 */ "MAXROWS",
  /*   56 */ "MINROWS",
  /*   57 */ "KEEP",
  /*   58 */ "PRECISION",
  /*   59 */ "QUORUM",
  /*   60 */ "REPLICA",
  /*   61 */ "TTL",
  /*   62 */ "WAL",
  /*   63 */ "VGROUPS",
  /*   64 */ "SINGLE_STABLE",
  /*   65 */ "STREAM_MODE",
  /*   66 */ "RETENTIONS",
X
Xiaoyu Wang 已提交
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851
  /*   67 */ "TABLE",
  /*   68 */ "NK_LP",
  /*   69 */ "NK_RP",
  /*   70 */ "STABLE",
  /*   71 */ "ADD",
  /*   72 */ "COLUMN",
  /*   73 */ "MODIFY",
  /*   74 */ "RENAME",
  /*   75 */ "TAG",
  /*   76 */ "SET",
  /*   77 */ "NK_EQ",
  /*   78 */ "USING",
  /*   79 */ "TAGS",
  /*   80 */ "NK_DOT",
  /*   81 */ "NK_COMMA",
  /*   82 */ "COMMENT",
  /*   83 */ "BOOL",
  /*   84 */ "TINYINT",
  /*   85 */ "SMALLINT",
  /*   86 */ "INT",
  /*   87 */ "INTEGER",
  /*   88 */ "BIGINT",
  /*   89 */ "FLOAT",
  /*   90 */ "DOUBLE",
  /*   91 */ "BINARY",
  /*   92 */ "TIMESTAMP",
  /*   93 */ "NCHAR",
  /*   94 */ "UNSIGNED",
  /*   95 */ "JSON",
  /*   96 */ "VARCHAR",
  /*   97 */ "MEDIUMBLOB",
  /*   98 */ "BLOB",
  /*   99 */ "VARBINARY",
  /*  100 */ "DECIMAL",
  /*  101 */ "SMA",
  /*  102 */ "ROLLUP",
  /*  103 */ "FILE_FACTOR",
  /*  104 */ "NK_FLOAT",
  /*  105 */ "DELAY",
  /*  106 */ "SHOW",
  /*  107 */ "DATABASES",
  /*  108 */ "TABLES",
  /*  109 */ "STABLES",
  /*  110 */ "MNODES",
  /*  111 */ "MODULES",
  /*  112 */ "QNODES",
  /*  113 */ "FUNCTIONS",
  /*  114 */ "INDEXES",
  /*  115 */ "FROM",
  /*  116 */ "LIKE",
  /*  117 */ "INDEX",
  /*  118 */ "FULLTEXT",
  /*  119 */ "FUNCTION",
  /*  120 */ "INTERVAL",
  /*  121 */ "TOPIC",
  /*  122 */ "AS",
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
  /*  123 */ "DESC",
  /*  124 */ "DESCRIBE",
  /*  125 */ "RESET",
  /*  126 */ "QUERY",
  /*  127 */ "EXPLAIN",
  /*  128 */ "ANALYZE",
  /*  129 */ "VERBOSE",
  /*  130 */ "NK_BOOL",
  /*  131 */ "RATIO",
  /*  132 */ "NULL",
  /*  133 */ "NK_VARIABLE",
  /*  134 */ "NK_UNDERLINE",
  /*  135 */ "ROWTS",
  /*  136 */ "TBNAME",
  /*  137 */ "QSTARTTS",
  /*  138 */ "QENDTS",
  /*  139 */ "WSTARTTS",
  /*  140 */ "WENDTS",
  /*  141 */ "WDURATION",
  /*  142 */ "BETWEEN",
  /*  143 */ "IS",
  /*  144 */ "NK_LT",
  /*  145 */ "NK_GT",
  /*  146 */ "NK_LE",
  /*  147 */ "NK_GE",
  /*  148 */ "NK_NE",
  /*  149 */ "MATCH",
  /*  150 */ "NMATCH",
  /*  151 */ "IN",
  /*  152 */ "JOIN",
  /*  153 */ "INNER",
  /*  154 */ "SELECT",
  /*  155 */ "DISTINCT",
  /*  156 */ "WHERE",
  /*  157 */ "PARTITION",
  /*  158 */ "BY",
  /*  159 */ "SESSION",
  /*  160 */ "STATE_WINDOW",
  /*  161 */ "SLIDING",
  /*  162 */ "FILL",
  /*  163 */ "VALUE",
  /*  164 */ "NONE",
  /*  165 */ "PREV",
  /*  166 */ "LINEAR",
  /*  167 */ "NEXT",
  /*  168 */ "GROUP",
  /*  169 */ "HAVING",
  /*  170 */ "ORDER",
  /*  171 */ "SLIMIT",
  /*  172 */ "SOFFSET",
  /*  173 */ "LIMIT",
  /*  174 */ "OFFSET",
  /*  175 */ "ASC",
  /*  176 */ "NULLS",
  /*  177 */ "FIRST",
  /*  178 */ "LAST",
  /*  179 */ "cmd",
  /*  180 */ "account_options",
  /*  181 */ "alter_account_options",
  /*  182 */ "literal",
  /*  183 */ "alter_account_option",
  /*  184 */ "user_name",
  /*  185 */ "dnode_endpoint",
  /*  186 */ "dnode_host_name",
  /*  187 */ "not_exists_opt",
  /*  188 */ "db_name",
  /*  189 */ "db_options",
  /*  190 */ "exists_opt",
  /*  191 */ "alter_db_options",
  /*  192 */ "alter_db_option",
  /*  193 */ "full_table_name",
  /*  194 */ "column_def_list",
  /*  195 */ "tags_def_opt",
  /*  196 */ "table_options",
  /*  197 */ "multi_create_clause",
  /*  198 */ "tags_def",
  /*  199 */ "multi_drop_clause",
  /*  200 */ "alter_table_clause",
  /*  201 */ "alter_table_options",
  /*  202 */ "column_name",
  /*  203 */ "type_name",
  /*  204 */ "create_subtable_clause",
  /*  205 */ "specific_tags_opt",
  /*  206 */ "literal_list",
  /*  207 */ "drop_table_clause",
  /*  208 */ "col_name_list",
  /*  209 */ "table_name",
  /*  210 */ "column_def",
  /*  211 */ "func_name_list",
  /*  212 */ "alter_table_option",
  /*  213 */ "col_name",
  /*  214 */ "db_name_cond_opt",
  /*  215 */ "like_pattern_opt",
  /*  216 */ "table_name_cond",
  /*  217 */ "from_db_opt",
  /*  218 */ "func_name",
  /*  219 */ "function_name",
  /*  220 */ "index_name",
  /*  221 */ "index_options",
  /*  222 */ "func_list",
  /*  223 */ "duration_literal",
  /*  224 */ "sliding_opt",
  /*  225 */ "func",
  /*  226 */ "expression_list",
  /*  227 */ "topic_name",
  /*  228 */ "query_expression",
  /*  229 */ "analyze_opt",
  /*  230 */ "explain_options",
  /*  231 */ "signed",
  /*  232 */ "signed_literal",
  /*  233 */ "table_alias",
  /*  234 */ "column_alias",
  /*  235 */ "expression",
  /*  236 */ "pseudo_column",
  /*  237 */ "column_reference",
  /*  238 */ "subquery",
  /*  239 */ "predicate",
  /*  240 */ "compare_op",
  /*  241 */ "in_op",
  /*  242 */ "in_predicate_value",
  /*  243 */ "boolean_value_expression",
  /*  244 */ "boolean_primary",
  /*  245 */ "common_expression",
  /*  246 */ "from_clause",
  /*  247 */ "table_reference_list",
  /*  248 */ "table_reference",
  /*  249 */ "table_primary",
  /*  250 */ "joined_table",
  /*  251 */ "alias_opt",
  /*  252 */ "parenthesized_joined_table",
  /*  253 */ "join_type",
  /*  254 */ "search_condition",
  /*  255 */ "query_specification",
  /*  256 */ "set_quantifier_opt",
  /*  257 */ "select_list",
  /*  258 */ "where_clause_opt",
  /*  259 */ "partition_by_clause_opt",
  /*  260 */ "twindow_clause_opt",
  /*  261 */ "group_by_clause_opt",
  /*  262 */ "having_clause_opt",
  /*  263 */ "select_sublist",
  /*  264 */ "select_item",
  /*  265 */ "fill_opt",
  /*  266 */ "fill_mode",
  /*  267 */ "group_by_list",
  /*  268 */ "query_expression_body",
  /*  269 */ "order_by_clause_opt",
  /*  270 */ "slimit_clause_opt",
  /*  271 */ "limit_clause_opt",
  /*  272 */ "query_primary",
  /*  273 */ "sort_specification_list",
  /*  274 */ "sort_specification",
  /*  275 */ "ordering_specification_opt",
  /*  276 */ "null_ordering_opt",
1006 1007 1008 1009 1010 1011 1012
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
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
 /*   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 已提交
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
 /*  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",
 /*  57 */ "db_options ::= db_options FSYNC NK_INTEGER",
 /*  58 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  59 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  60 */ "db_options ::= db_options KEEP NK_INTEGER",
 /*  61 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  62 */ "db_options ::= db_options QUORUM NK_INTEGER",
 /*  63 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  64 */ "db_options ::= db_options TTL NK_INTEGER",
 /*  65 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  66 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  67 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  68 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
 /*  69 */ "db_options ::= db_options RETENTIONS NK_STRING",
X
Xiaoyu Wang 已提交
1083 1084 1085 1086 1087 1088 1089 1090
 /*  70 */ "alter_db_options ::= alter_db_option",
 /*  71 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  72 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  73 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  74 */ "alter_db_option ::= KEEP NK_INTEGER",
 /*  75 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  76 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  77 */ "alter_db_option ::= CACHELAST NK_INTEGER",
X
Xiaoyu Wang 已提交
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 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 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
 /*  78 */ "alter_db_option ::= REPLICA NK_INTEGER",
 /*  79 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /*  80 */ "cmd ::= CREATE TABLE multi_create_clause",
 /*  81 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /*  82 */ "cmd ::= DROP TABLE multi_drop_clause",
 /*  83 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /*  84 */ "cmd ::= ALTER TABLE alter_table_clause",
 /*  85 */ "cmd ::= ALTER STABLE alter_table_clause",
 /*  86 */ "alter_table_clause ::= full_table_name alter_table_options",
 /*  87 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /*  88 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /*  89 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /*  90 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /*  91 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /*  92 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /*  93 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /*  94 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /*  95 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /*  96 */ "multi_create_clause ::= create_subtable_clause",
 /*  97 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /*  98 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
 /*  99 */ "multi_drop_clause ::= drop_table_clause",
 /* 100 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 101 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 102 */ "specific_tags_opt ::=",
 /* 103 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 104 */ "full_table_name ::= table_name",
 /* 105 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 106 */ "column_def_list ::= column_def",
 /* 107 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 108 */ "column_def ::= column_name type_name",
 /* 109 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 110 */ "type_name ::= BOOL",
 /* 111 */ "type_name ::= TINYINT",
 /* 112 */ "type_name ::= SMALLINT",
 /* 113 */ "type_name ::= INT",
 /* 114 */ "type_name ::= INTEGER",
 /* 115 */ "type_name ::= BIGINT",
 /* 116 */ "type_name ::= FLOAT",
 /* 117 */ "type_name ::= DOUBLE",
 /* 118 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 119 */ "type_name ::= TIMESTAMP",
 /* 120 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 121 */ "type_name ::= TINYINT UNSIGNED",
 /* 122 */ "type_name ::= SMALLINT UNSIGNED",
 /* 123 */ "type_name ::= INT UNSIGNED",
 /* 124 */ "type_name ::= BIGINT UNSIGNED",
 /* 125 */ "type_name ::= JSON",
 /* 126 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 127 */ "type_name ::= MEDIUMBLOB",
 /* 128 */ "type_name ::= BLOB",
 /* 129 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 130 */ "type_name ::= DECIMAL",
 /* 131 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 132 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 133 */ "tags_def_opt ::=",
 /* 134 */ "tags_def_opt ::= tags_def",
 /* 135 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 136 */ "table_options ::=",
 /* 137 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 138 */ "table_options ::= table_options KEEP NK_INTEGER",
 /* 139 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 140 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 141 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 142 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 143 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 144 */ "alter_table_options ::= alter_table_option",
 /* 145 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 146 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 147 */ "alter_table_option ::= KEEP NK_INTEGER",
 /* 148 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 149 */ "col_name_list ::= col_name",
 /* 150 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 151 */ "col_name ::= column_name",
 /* 152 */ "cmd ::= SHOW DNODES",
 /* 153 */ "cmd ::= SHOW USERS",
 /* 154 */ "cmd ::= SHOW DATABASES",
 /* 155 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 156 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 157 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 158 */ "cmd ::= SHOW MNODES",
 /* 159 */ "cmd ::= SHOW MODULES",
 /* 160 */ "cmd ::= SHOW QNODES",
 /* 161 */ "cmd ::= SHOW FUNCTIONS",
 /* 162 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 163 */ "cmd ::= SHOW STREAMS",
 /* 164 */ "db_name_cond_opt ::=",
 /* 165 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 166 */ "like_pattern_opt ::=",
 /* 167 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 168 */ "table_name_cond ::= table_name",
 /* 169 */ "from_db_opt ::=",
 /* 170 */ "from_db_opt ::= FROM db_name",
 /* 171 */ "func_name_list ::= func_name",
 /* 172 */ "func_name_list ::= func_name_list NK_COMMA col_name",
 /* 173 */ "func_name ::= function_name",
 /* 174 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 175 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 176 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 177 */ "index_options ::=",
 /* 178 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 179 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 180 */ "func_list ::= func",
 /* 181 */ "func_list ::= func_list NK_COMMA func",
 /* 182 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 183 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
 /* 184 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
 /* 185 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 186 */ "cmd ::= DESC full_table_name",
 /* 187 */ "cmd ::= DESCRIBE full_table_name",
 /* 188 */ "cmd ::= RESET QUERY CACHE",
 /* 189 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression",
 /* 190 */ "analyze_opt ::=",
 /* 191 */ "analyze_opt ::= ANALYZE",
 /* 192 */ "explain_options ::=",
 /* 193 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 194 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 195 */ "cmd ::= query_expression",
 /* 196 */ "literal ::= NK_INTEGER",
 /* 197 */ "literal ::= NK_FLOAT",
 /* 198 */ "literal ::= NK_STRING",
 /* 199 */ "literal ::= NK_BOOL",
 /* 200 */ "literal ::= TIMESTAMP NK_STRING",
 /* 201 */ "literal ::= duration_literal",
 /* 202 */ "literal ::= NULL",
 /* 203 */ "duration_literal ::= NK_VARIABLE",
 /* 204 */ "signed ::= NK_INTEGER",
 /* 205 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 206 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 207 */ "signed ::= NK_FLOAT",
 /* 208 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 209 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 210 */ "signed_literal ::= signed",
 /* 211 */ "signed_literal ::= NK_STRING",
 /* 212 */ "signed_literal ::= NK_BOOL",
 /* 213 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 214 */ "signed_literal ::= duration_literal",
 /* 215 */ "signed_literal ::= NULL",
 /* 216 */ "literal_list ::= signed_literal",
 /* 217 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 218 */ "db_name ::= NK_ID",
 /* 219 */ "table_name ::= NK_ID",
 /* 220 */ "column_name ::= NK_ID",
 /* 221 */ "function_name ::= NK_ID",
 /* 222 */ "table_alias ::= NK_ID",
 /* 223 */ "column_alias ::= NK_ID",
 /* 224 */ "user_name ::= NK_ID",
 /* 225 */ "index_name ::= NK_ID",
 /* 226 */ "topic_name ::= NK_ID",
 /* 227 */ "expression ::= literal",
 /* 228 */ "expression ::= pseudo_column",
 /* 229 */ "expression ::= column_reference",
 /* 230 */ "expression ::= function_name NK_LP expression_list NK_RP",
 /* 231 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
 /* 232 */ "expression ::= subquery",
 /* 233 */ "expression ::= NK_LP expression NK_RP",
 /* 234 */ "expression ::= NK_PLUS expression",
 /* 235 */ "expression ::= NK_MINUS expression",
 /* 236 */ "expression ::= expression NK_PLUS expression",
 /* 237 */ "expression ::= expression NK_MINUS expression",
 /* 238 */ "expression ::= expression NK_STAR expression",
 /* 239 */ "expression ::= expression NK_SLASH expression",
 /* 240 */ "expression ::= expression NK_REM expression",
 /* 241 */ "expression_list ::= expression",
 /* 242 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 243 */ "column_reference ::= column_name",
 /* 244 */ "column_reference ::= table_name NK_DOT column_name",
 /* 245 */ "pseudo_column ::= NK_UNDERLINE ROWTS",
 /* 246 */ "pseudo_column ::= TBNAME",
 /* 247 */ "pseudo_column ::= NK_UNDERLINE QSTARTTS",
 /* 248 */ "pseudo_column ::= NK_UNDERLINE QENDTS",
 /* 249 */ "pseudo_column ::= NK_UNDERLINE WSTARTTS",
 /* 250 */ "pseudo_column ::= NK_UNDERLINE WENDTS",
 /* 251 */ "pseudo_column ::= NK_UNDERLINE WDURATION",
 /* 252 */ "predicate ::= expression compare_op expression",
 /* 253 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 254 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 255 */ "predicate ::= expression IS NULL",
 /* 256 */ "predicate ::= expression IS NOT NULL",
 /* 257 */ "predicate ::= expression in_op in_predicate_value",
 /* 258 */ "compare_op ::= NK_LT",
 /* 259 */ "compare_op ::= NK_GT",
 /* 260 */ "compare_op ::= NK_LE",
 /* 261 */ "compare_op ::= NK_GE",
 /* 262 */ "compare_op ::= NK_NE",
 /* 263 */ "compare_op ::= NK_EQ",
 /* 264 */ "compare_op ::= LIKE",
 /* 265 */ "compare_op ::= NOT LIKE",
 /* 266 */ "compare_op ::= MATCH",
 /* 267 */ "compare_op ::= NMATCH",
 /* 268 */ "in_op ::= IN",
 /* 269 */ "in_op ::= NOT IN",
 /* 270 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 271 */ "boolean_value_expression ::= boolean_primary",
 /* 272 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 273 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 274 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 275 */ "boolean_primary ::= predicate",
 /* 276 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 277 */ "common_expression ::= expression",
 /* 278 */ "common_expression ::= boolean_value_expression",
 /* 279 */ "from_clause ::= FROM table_reference_list",
 /* 280 */ "table_reference_list ::= table_reference",
 /* 281 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 282 */ "table_reference ::= table_primary",
 /* 283 */ "table_reference ::= joined_table",
 /* 284 */ "table_primary ::= table_name alias_opt",
 /* 285 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 286 */ "table_primary ::= subquery alias_opt",
 /* 287 */ "table_primary ::= parenthesized_joined_table",
 /* 288 */ "alias_opt ::=",
 /* 289 */ "alias_opt ::= table_alias",
 /* 290 */ "alias_opt ::= AS table_alias",
 /* 291 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 292 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 293 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 294 */ "join_type ::=",
 /* 295 */ "join_type ::= INNER",
 /* 296 */ "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",
 /* 297 */ "set_quantifier_opt ::=",
 /* 298 */ "set_quantifier_opt ::= DISTINCT",
 /* 299 */ "set_quantifier_opt ::= ALL",
 /* 300 */ "select_list ::= NK_STAR",
 /* 301 */ "select_list ::= select_sublist",
 /* 302 */ "select_sublist ::= select_item",
 /* 303 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 304 */ "select_item ::= common_expression",
 /* 305 */ "select_item ::= common_expression column_alias",
 /* 306 */ "select_item ::= common_expression AS column_alias",
 /* 307 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 308 */ "where_clause_opt ::=",
 /* 309 */ "where_clause_opt ::= WHERE search_condition",
 /* 310 */ "partition_by_clause_opt ::=",
 /* 311 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 312 */ "twindow_clause_opt ::=",
 /* 313 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 314 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP",
 /* 315 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 316 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 317 */ "sliding_opt ::=",
 /* 318 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 319 */ "fill_opt ::=",
 /* 320 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 321 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 322 */ "fill_mode ::= NONE",
 /* 323 */ "fill_mode ::= PREV",
 /* 324 */ "fill_mode ::= NULL",
 /* 325 */ "fill_mode ::= LINEAR",
 /* 326 */ "fill_mode ::= NEXT",
 /* 327 */ "group_by_clause_opt ::=",
 /* 328 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 329 */ "group_by_list ::= expression",
 /* 330 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 331 */ "having_clause_opt ::=",
 /* 332 */ "having_clause_opt ::= HAVING search_condition",
 /* 333 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 334 */ "query_expression_body ::= query_primary",
 /* 335 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 336 */ "query_primary ::= query_specification",
 /* 337 */ "order_by_clause_opt ::=",
 /* 338 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 339 */ "slimit_clause_opt ::=",
 /* 340 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 341 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 342 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 343 */ "limit_clause_opt ::=",
 /* 344 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 345 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 346 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 347 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 348 */ "search_condition ::= common_expression",
 /* 349 */ "sort_specification_list ::= sort_specification",
 /* 350 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 351 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 352 */ "ordering_specification_opt ::=",
 /* 353 */ "ordering_specification_opt ::= ASC",
 /* 354 */ "ordering_specification_opt ::= DESC",
 /* 355 */ "null_ordering_opt ::=",
 /* 356 */ "null_ordering_opt ::= NULLS FIRST",
 /* 357 */ "null_ordering_opt ::= NULLS LAST",
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387
};
#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 已提交
1388
    pNew = malloc(newSize*sizeof(pNew[0]));
1389 1390
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1391
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408
  }
  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 已提交
1409
** second argument to ParseAlloc() below.  This can be changed by
1410 1411 1412 1413 1414 1415 1416 1417 1418
** 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 已提交
1419
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1420
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1421
  ParseCTX_STORE
1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444
#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 已提交
1445
#ifndef Parse_ENGINEALWAYSONSTACK
1446 1447 1448 1449 1450 1451 1452 1453 1454 1455
/* 
** 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 已提交
1456
** to Parse and ParseFree.
1457
*/
X
Xiaoyu Wang 已提交
1458
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
1459 1460 1461
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
1462 1463
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
1464 1465 1466
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
1467
#endif /* Parse_ENGINEALWAYSONSTACK */
1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481


/* 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 已提交
1482 1483
  ParseARG_FETCH
  ParseCTX_FETCH
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496
  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 */
1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548
    case 179: /* cmd */
    case 182: /* literal */
    case 189: /* db_options */
    case 191: /* alter_db_options */
    case 193: /* full_table_name */
    case 196: /* table_options */
    case 200: /* alter_table_clause */
    case 201: /* alter_table_options */
    case 204: /* create_subtable_clause */
    case 207: /* drop_table_clause */
    case 210: /* column_def */
    case 213: /* col_name */
    case 214: /* db_name_cond_opt */
    case 215: /* like_pattern_opt */
    case 216: /* table_name_cond */
    case 217: /* from_db_opt */
    case 218: /* func_name */
    case 221: /* index_options */
    case 223: /* duration_literal */
    case 224: /* sliding_opt */
    case 225: /* func */
    case 228: /* query_expression */
    case 230: /* explain_options */
    case 231: /* signed */
    case 232: /* signed_literal */
    case 235: /* expression */
    case 236: /* pseudo_column */
    case 237: /* column_reference */
    case 238: /* subquery */
    case 239: /* predicate */
    case 242: /* in_predicate_value */
    case 243: /* boolean_value_expression */
    case 244: /* boolean_primary */
    case 245: /* common_expression */
    case 246: /* from_clause */
    case 247: /* table_reference_list */
    case 248: /* table_reference */
    case 249: /* table_primary */
    case 250: /* joined_table */
    case 252: /* parenthesized_joined_table */
    case 254: /* search_condition */
    case 255: /* query_specification */
    case 258: /* where_clause_opt */
    case 260: /* twindow_clause_opt */
    case 262: /* having_clause_opt */
    case 264: /* select_item */
    case 265: /* fill_opt */
    case 268: /* query_expression_body */
    case 270: /* slimit_clause_opt */
    case 271: /* limit_clause_opt */
    case 272: /* query_primary */
    case 274: /* sort_specification */
1549
{
1550
 nodesDestroyNode((yypminor->yy46)); 
1551 1552
}
      break;
1553 1554 1555
    case 180: /* account_options */
    case 181: /* alter_account_options */
    case 183: /* alter_account_option */
1556
{
1557
 
1558 1559
}
      break;
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571
    case 184: /* user_name */
    case 185: /* dnode_endpoint */
    case 186: /* dnode_host_name */
    case 188: /* db_name */
    case 202: /* column_name */
    case 209: /* table_name */
    case 219: /* function_name */
    case 220: /* index_name */
    case 227: /* topic_name */
    case 233: /* table_alias */
    case 234: /* column_alias */
    case 251: /* alias_opt */
1572
{
1573
 
1574 1575
}
      break;
1576 1577 1578 1579
    case 187: /* not_exists_opt */
    case 190: /* exists_opt */
    case 229: /* analyze_opt */
    case 256: /* set_quantifier_opt */
1580
{
1581 1582 1583
 
}
      break;
1584 1585
    case 192: /* alter_db_option */
    case 212: /* alter_table_option */
1586 1587
{
 
1588 1589
}
      break;
1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607
    case 194: /* column_def_list */
    case 195: /* tags_def_opt */
    case 197: /* multi_create_clause */
    case 198: /* tags_def */
    case 199: /* multi_drop_clause */
    case 205: /* specific_tags_opt */
    case 206: /* literal_list */
    case 208: /* col_name_list */
    case 211: /* func_name_list */
    case 222: /* func_list */
    case 226: /* expression_list */
    case 257: /* select_list */
    case 259: /* partition_by_clause_opt */
    case 261: /* group_by_clause_opt */
    case 263: /* select_sublist */
    case 267: /* group_by_list */
    case 269: /* order_by_clause_opt */
    case 273: /* sort_specification_list */
1608
{
1609
 nodesDestroyList((yypminor->yy194)); 
1610 1611
}
      break;
1612
    case 203: /* type_name */
1613
{
1614
 
1615 1616
}
      break;
1617 1618
    case 240: /* compare_op */
    case 241: /* in_op */
1619
{
1620
 
1621 1622
}
      break;
1623
    case 253: /* join_type */
1624
{
1625
 
1626 1627
}
      break;
1628
    case 266: /* fill_mode */
1629
{
1630
 
1631 1632
}
      break;
1633
    case 275: /* ordering_specification_opt */
1634
{
1635
 
1636 1637
}
      break;
1638
    case 276: /* null_ordering_opt */
1639
{
1640
 
1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671
}
      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 已提交
1672
void ParseFinalize(void *p){
1673 1674 1675
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
1676
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
1677 1678 1679
#endif
}

X
Xiaoyu Wang 已提交
1680
#ifndef Parse_ENGINEALWAYSONSTACK
1681 1682 1683 1684 1685 1686 1687 1688
/* 
** 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 已提交
1689
void ParseFree(
1690 1691 1692 1693 1694 1695
  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 已提交
1696
  ParseFinalize(p);
1697 1698
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
1699
#endif /* Parse_ENGINEALWAYSONSTACK */
1700 1701 1702 1703 1704

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
1705
int ParseStackPeak(void *p){
1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728
  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 已提交
1729
int ParseCoverage(FILE *out){
1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850
  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 已提交
1851 1852
   ParseARG_FETCH
   ParseCTX_FETCH
1853 1854 1855 1856 1857 1858 1859 1860 1861 1862
#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 已提交
1863 1864
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
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
}

/*
** 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 已提交
1895
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
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
){
  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[] = {
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 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
  {  179,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  179,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  180,    0 }, /* (2) account_options ::= */
  {  180,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  180,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  180,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  180,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  180,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  180,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  180,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  180,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  180,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  181,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  181,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  183,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  183,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  183,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  183,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  183,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  183,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  183,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  183,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  183,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  183,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  179,   -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
  {  179,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  179,   -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
  {  179,   -3 }, /* (27) cmd ::= DROP USER user_name */
  {  179,   -3 }, /* (28) cmd ::= CREATE DNODE dnode_endpoint */
  {  179,   -5 }, /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
  {  179,   -3 }, /* (30) cmd ::= DROP DNODE NK_INTEGER */
  {  179,   -3 }, /* (31) cmd ::= DROP DNODE dnode_endpoint */
  {  179,   -4 }, /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  179,   -5 }, /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  179,   -4 }, /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
  {  179,   -5 }, /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  185,   -1 }, /* (36) dnode_endpoint ::= NK_STRING */
  {  186,   -1 }, /* (37) dnode_host_name ::= NK_ID */
  {  186,   -1 }, /* (38) dnode_host_name ::= NK_IPTOKEN */
  {  179,   -3 }, /* (39) cmd ::= ALTER LOCAL NK_STRING */
  {  179,   -4 }, /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  179,   -5 }, /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  179,   -5 }, /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  179,   -5 }, /* (43) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  179,   -4 }, /* (44) cmd ::= DROP DATABASE exists_opt db_name */
  {  179,   -2 }, /* (45) cmd ::= USE db_name */
  {  179,   -4 }, /* (46) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  187,   -3 }, /* (47) not_exists_opt ::= IF NOT EXISTS */
  {  187,    0 }, /* (48) not_exists_opt ::= */
  {  190,   -2 }, /* (49) exists_opt ::= IF EXISTS */
  {  190,    0 }, /* (50) exists_opt ::= */
  {  189,    0 }, /* (51) db_options ::= */
  {  189,   -3 }, /* (52) db_options ::= db_options BLOCKS NK_INTEGER */
  {  189,   -3 }, /* (53) db_options ::= db_options CACHE NK_INTEGER */
  {  189,   -3 }, /* (54) db_options ::= db_options CACHELAST NK_INTEGER */
  {  189,   -3 }, /* (55) db_options ::= db_options COMP NK_INTEGER */
  {  189,   -3 }, /* (56) db_options ::= db_options DAYS NK_INTEGER */
  {  189,   -3 }, /* (57) db_options ::= db_options FSYNC NK_INTEGER */
  {  189,   -3 }, /* (58) db_options ::= db_options MAXROWS NK_INTEGER */
  {  189,   -3 }, /* (59) db_options ::= db_options MINROWS NK_INTEGER */
  {  189,   -3 }, /* (60) db_options ::= db_options KEEP NK_INTEGER */
  {  189,   -3 }, /* (61) db_options ::= db_options PRECISION NK_STRING */
  {  189,   -3 }, /* (62) db_options ::= db_options QUORUM NK_INTEGER */
  {  189,   -3 }, /* (63) db_options ::= db_options REPLICA NK_INTEGER */
  {  189,   -3 }, /* (64) db_options ::= db_options TTL NK_INTEGER */
  {  189,   -3 }, /* (65) db_options ::= db_options WAL NK_INTEGER */
  {  189,   -3 }, /* (66) db_options ::= db_options VGROUPS NK_INTEGER */
  {  189,   -3 }, /* (67) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  189,   -3 }, /* (68) db_options ::= db_options STREAM_MODE NK_INTEGER */
  {  189,   -3 }, /* (69) db_options ::= db_options RETENTIONS NK_STRING */
  {  191,   -1 }, /* (70) alter_db_options ::= alter_db_option */
  {  191,   -2 }, /* (71) alter_db_options ::= alter_db_options alter_db_option */
  {  192,   -2 }, /* (72) alter_db_option ::= BLOCKS NK_INTEGER */
  {  192,   -2 }, /* (73) alter_db_option ::= FSYNC NK_INTEGER */
  {  192,   -2 }, /* (74) alter_db_option ::= KEEP NK_INTEGER */
  {  192,   -2 }, /* (75) alter_db_option ::= WAL NK_INTEGER */
  {  192,   -2 }, /* (76) alter_db_option ::= QUORUM NK_INTEGER */
  {  192,   -2 }, /* (77) alter_db_option ::= CACHELAST NK_INTEGER */
X
Xiaoyu Wang 已提交
2015 2016 2017 2018 2019 2020 2021 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 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
  {  192,   -2 }, /* (78) alter_db_option ::= REPLICA NK_INTEGER */
  {  179,   -9 }, /* (79) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  179,   -3 }, /* (80) cmd ::= CREATE TABLE multi_create_clause */
  {  179,   -9 }, /* (81) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  179,   -3 }, /* (82) cmd ::= DROP TABLE multi_drop_clause */
  {  179,   -4 }, /* (83) cmd ::= DROP STABLE exists_opt full_table_name */
  {  179,   -3 }, /* (84) cmd ::= ALTER TABLE alter_table_clause */
  {  179,   -3 }, /* (85) cmd ::= ALTER STABLE alter_table_clause */
  {  200,   -2 }, /* (86) alter_table_clause ::= full_table_name alter_table_options */
  {  200,   -5 }, /* (87) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  200,   -4 }, /* (88) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  200,   -5 }, /* (89) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  200,   -5 }, /* (90) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  200,   -5 }, /* (91) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  200,   -4 }, /* (92) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  200,   -5 }, /* (93) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  200,   -5 }, /* (94) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  200,   -6 }, /* (95) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
  {  197,   -1 }, /* (96) multi_create_clause ::= create_subtable_clause */
  {  197,   -2 }, /* (97) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  204,   -9 }, /* (98) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
  {  199,   -1 }, /* (99) multi_drop_clause ::= drop_table_clause */
  {  199,   -2 }, /* (100) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  207,   -2 }, /* (101) drop_table_clause ::= exists_opt full_table_name */
  {  205,    0 }, /* (102) specific_tags_opt ::= */
  {  205,   -3 }, /* (103) specific_tags_opt ::= NK_LP col_name_list NK_RP */
  {  193,   -1 }, /* (104) full_table_name ::= table_name */
  {  193,   -3 }, /* (105) full_table_name ::= db_name NK_DOT table_name */
  {  194,   -1 }, /* (106) column_def_list ::= column_def */
  {  194,   -3 }, /* (107) column_def_list ::= column_def_list NK_COMMA column_def */
  {  210,   -2 }, /* (108) column_def ::= column_name type_name */
  {  210,   -4 }, /* (109) column_def ::= column_name type_name COMMENT NK_STRING */
  {  203,   -1 }, /* (110) type_name ::= BOOL */
  {  203,   -1 }, /* (111) type_name ::= TINYINT */
  {  203,   -1 }, /* (112) type_name ::= SMALLINT */
  {  203,   -1 }, /* (113) type_name ::= INT */
  {  203,   -1 }, /* (114) type_name ::= INTEGER */
  {  203,   -1 }, /* (115) type_name ::= BIGINT */
  {  203,   -1 }, /* (116) type_name ::= FLOAT */
  {  203,   -1 }, /* (117) type_name ::= DOUBLE */
  {  203,   -4 }, /* (118) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  203,   -1 }, /* (119) type_name ::= TIMESTAMP */
  {  203,   -4 }, /* (120) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  203,   -2 }, /* (121) type_name ::= TINYINT UNSIGNED */
  {  203,   -2 }, /* (122) type_name ::= SMALLINT UNSIGNED */
  {  203,   -2 }, /* (123) type_name ::= INT UNSIGNED */
  {  203,   -2 }, /* (124) type_name ::= BIGINT UNSIGNED */
  {  203,   -1 }, /* (125) type_name ::= JSON */
  {  203,   -4 }, /* (126) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  203,   -1 }, /* (127) type_name ::= MEDIUMBLOB */
  {  203,   -1 }, /* (128) type_name ::= BLOB */
  {  203,   -4 }, /* (129) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  203,   -1 }, /* (130) type_name ::= DECIMAL */
  {  203,   -4 }, /* (131) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  203,   -6 }, /* (132) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  195,    0 }, /* (133) tags_def_opt ::= */
  {  195,   -1 }, /* (134) tags_def_opt ::= tags_def */
  {  198,   -4 }, /* (135) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  196,    0 }, /* (136) table_options ::= */
  {  196,   -3 }, /* (137) table_options ::= table_options COMMENT NK_STRING */
  {  196,   -3 }, /* (138) table_options ::= table_options KEEP NK_INTEGER */
  {  196,   -3 }, /* (139) table_options ::= table_options TTL NK_INTEGER */
  {  196,   -5 }, /* (140) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  196,   -5 }, /* (141) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
  {  196,   -3 }, /* (142) table_options ::= table_options FILE_FACTOR NK_FLOAT */
  {  196,   -3 }, /* (143) table_options ::= table_options DELAY NK_INTEGER */
  {  201,   -1 }, /* (144) alter_table_options ::= alter_table_option */
  {  201,   -2 }, /* (145) alter_table_options ::= alter_table_options alter_table_option */
  {  212,   -2 }, /* (146) alter_table_option ::= COMMENT NK_STRING */
  {  212,   -2 }, /* (147) alter_table_option ::= KEEP NK_INTEGER */
  {  212,   -2 }, /* (148) alter_table_option ::= TTL NK_INTEGER */
  {  208,   -1 }, /* (149) col_name_list ::= col_name */
  {  208,   -3 }, /* (150) col_name_list ::= col_name_list NK_COMMA col_name */
  {  213,   -1 }, /* (151) col_name ::= column_name */
  {  179,   -2 }, /* (152) cmd ::= SHOW DNODES */
  {  179,   -2 }, /* (153) cmd ::= SHOW USERS */
  {  179,   -2 }, /* (154) cmd ::= SHOW DATABASES */
  {  179,   -4 }, /* (155) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  179,   -4 }, /* (156) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  179,   -3 }, /* (157) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  179,   -2 }, /* (158) cmd ::= SHOW MNODES */
  {  179,   -2 }, /* (159) cmd ::= SHOW MODULES */
  {  179,   -2 }, /* (160) cmd ::= SHOW QNODES */
  {  179,   -2 }, /* (161) cmd ::= SHOW FUNCTIONS */
  {  179,   -5 }, /* (162) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  179,   -2 }, /* (163) cmd ::= SHOW STREAMS */
  {  214,    0 }, /* (164) db_name_cond_opt ::= */
  {  214,   -2 }, /* (165) db_name_cond_opt ::= db_name NK_DOT */
  {  215,    0 }, /* (166) like_pattern_opt ::= */
  {  215,   -2 }, /* (167) like_pattern_opt ::= LIKE NK_STRING */
  {  216,   -1 }, /* (168) table_name_cond ::= table_name */
  {  217,    0 }, /* (169) from_db_opt ::= */
  {  217,   -2 }, /* (170) from_db_opt ::= FROM db_name */
  {  211,   -1 }, /* (171) func_name_list ::= func_name */
  {  211,   -3 }, /* (172) func_name_list ::= func_name_list NK_COMMA col_name */
  {  218,   -1 }, /* (173) func_name ::= function_name */
  {  179,   -8 }, /* (174) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
  {  179,  -10 }, /* (175) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
  {  179,   -6 }, /* (176) cmd ::= DROP INDEX exists_opt index_name ON table_name */
  {  221,    0 }, /* (177) index_options ::= */
  {  221,   -9 }, /* (178) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  {  221,  -11 }, /* (179) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
  {  222,   -1 }, /* (180) func_list ::= func */
  {  222,   -3 }, /* (181) func_list ::= func_list NK_COMMA func */
  {  225,   -4 }, /* (182) func ::= function_name NK_LP expression_list NK_RP */
  {  179,   -6 }, /* (183) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
  {  179,   -6 }, /* (184) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
  {  179,   -4 }, /* (185) cmd ::= DROP TOPIC exists_opt topic_name */
  {  179,   -2 }, /* (186) cmd ::= DESC full_table_name */
  {  179,   -2 }, /* (187) cmd ::= DESCRIBE full_table_name */
  {  179,   -3 }, /* (188) cmd ::= RESET QUERY CACHE */
  {  179,   -4 }, /* (189) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
  {  229,    0 }, /* (190) analyze_opt ::= */
  {  229,   -1 }, /* (191) analyze_opt ::= ANALYZE */
  {  230,    0 }, /* (192) explain_options ::= */
  {  230,   -3 }, /* (193) explain_options ::= explain_options VERBOSE NK_BOOL */
  {  230,   -3 }, /* (194) explain_options ::= explain_options RATIO NK_FLOAT */
  {  179,   -1 }, /* (195) cmd ::= query_expression */
  {  182,   -1 }, /* (196) literal ::= NK_INTEGER */
  {  182,   -1 }, /* (197) literal ::= NK_FLOAT */
  {  182,   -1 }, /* (198) literal ::= NK_STRING */
  {  182,   -1 }, /* (199) literal ::= NK_BOOL */
  {  182,   -2 }, /* (200) literal ::= TIMESTAMP NK_STRING */
  {  182,   -1 }, /* (201) literal ::= duration_literal */
  {  182,   -1 }, /* (202) literal ::= NULL */
  {  223,   -1 }, /* (203) duration_literal ::= NK_VARIABLE */
  {  231,   -1 }, /* (204) signed ::= NK_INTEGER */
  {  231,   -2 }, /* (205) signed ::= NK_PLUS NK_INTEGER */
  {  231,   -2 }, /* (206) signed ::= NK_MINUS NK_INTEGER */
  {  231,   -1 }, /* (207) signed ::= NK_FLOAT */
  {  231,   -2 }, /* (208) signed ::= NK_PLUS NK_FLOAT */
  {  231,   -2 }, /* (209) signed ::= NK_MINUS NK_FLOAT */
  {  232,   -1 }, /* (210) signed_literal ::= signed */
  {  232,   -1 }, /* (211) signed_literal ::= NK_STRING */
  {  232,   -1 }, /* (212) signed_literal ::= NK_BOOL */
  {  232,   -2 }, /* (213) signed_literal ::= TIMESTAMP NK_STRING */
  {  232,   -1 }, /* (214) signed_literal ::= duration_literal */
  {  232,   -1 }, /* (215) signed_literal ::= NULL */
  {  206,   -1 }, /* (216) literal_list ::= signed_literal */
  {  206,   -3 }, /* (217) literal_list ::= literal_list NK_COMMA signed_literal */
  {  188,   -1 }, /* (218) db_name ::= NK_ID */
  {  209,   -1 }, /* (219) table_name ::= NK_ID */
  {  202,   -1 }, /* (220) column_name ::= NK_ID */
  {  219,   -1 }, /* (221) function_name ::= NK_ID */
  {  233,   -1 }, /* (222) table_alias ::= NK_ID */
  {  234,   -1 }, /* (223) column_alias ::= NK_ID */
  {  184,   -1 }, /* (224) user_name ::= NK_ID */
  {  220,   -1 }, /* (225) index_name ::= NK_ID */
  {  227,   -1 }, /* (226) topic_name ::= NK_ID */
  {  235,   -1 }, /* (227) expression ::= literal */
  {  235,   -1 }, /* (228) expression ::= pseudo_column */
  {  235,   -1 }, /* (229) expression ::= column_reference */
  {  235,   -4 }, /* (230) expression ::= function_name NK_LP expression_list NK_RP */
  {  235,   -4 }, /* (231) expression ::= function_name NK_LP NK_STAR NK_RP */
  {  235,   -1 }, /* (232) expression ::= subquery */
  {  235,   -3 }, /* (233) expression ::= NK_LP expression NK_RP */
  {  235,   -2 }, /* (234) expression ::= NK_PLUS expression */
  {  235,   -2 }, /* (235) expression ::= NK_MINUS expression */
  {  235,   -3 }, /* (236) expression ::= expression NK_PLUS expression */
  {  235,   -3 }, /* (237) expression ::= expression NK_MINUS expression */
  {  235,   -3 }, /* (238) expression ::= expression NK_STAR expression */
  {  235,   -3 }, /* (239) expression ::= expression NK_SLASH expression */
  {  235,   -3 }, /* (240) expression ::= expression NK_REM expression */
  {  226,   -1 }, /* (241) expression_list ::= expression */
  {  226,   -3 }, /* (242) expression_list ::= expression_list NK_COMMA expression */
  {  237,   -1 }, /* (243) column_reference ::= column_name */
  {  237,   -3 }, /* (244) column_reference ::= table_name NK_DOT column_name */
  {  236,   -2 }, /* (245) pseudo_column ::= NK_UNDERLINE ROWTS */
  {  236,   -1 }, /* (246) pseudo_column ::= TBNAME */
  {  236,   -2 }, /* (247) pseudo_column ::= NK_UNDERLINE QSTARTTS */
  {  236,   -2 }, /* (248) pseudo_column ::= NK_UNDERLINE QENDTS */
  {  236,   -2 }, /* (249) pseudo_column ::= NK_UNDERLINE WSTARTTS */
  {  236,   -2 }, /* (250) pseudo_column ::= NK_UNDERLINE WENDTS */
  {  236,   -2 }, /* (251) pseudo_column ::= NK_UNDERLINE WDURATION */
  {  239,   -3 }, /* (252) predicate ::= expression compare_op expression */
  {  239,   -5 }, /* (253) predicate ::= expression BETWEEN expression AND expression */
  {  239,   -6 }, /* (254) predicate ::= expression NOT BETWEEN expression AND expression */
  {  239,   -3 }, /* (255) predicate ::= expression IS NULL */
  {  239,   -4 }, /* (256) predicate ::= expression IS NOT NULL */
  {  239,   -3 }, /* (257) predicate ::= expression in_op in_predicate_value */
  {  240,   -1 }, /* (258) compare_op ::= NK_LT */
  {  240,   -1 }, /* (259) compare_op ::= NK_GT */
  {  240,   -1 }, /* (260) compare_op ::= NK_LE */
  {  240,   -1 }, /* (261) compare_op ::= NK_GE */
  {  240,   -1 }, /* (262) compare_op ::= NK_NE */
  {  240,   -1 }, /* (263) compare_op ::= NK_EQ */
  {  240,   -1 }, /* (264) compare_op ::= LIKE */
  {  240,   -2 }, /* (265) compare_op ::= NOT LIKE */
  {  240,   -1 }, /* (266) compare_op ::= MATCH */
  {  240,   -1 }, /* (267) compare_op ::= NMATCH */
  {  241,   -1 }, /* (268) in_op ::= IN */
  {  241,   -2 }, /* (269) in_op ::= NOT IN */
  {  242,   -3 }, /* (270) in_predicate_value ::= NK_LP expression_list NK_RP */
  {  243,   -1 }, /* (271) boolean_value_expression ::= boolean_primary */
  {  243,   -2 }, /* (272) boolean_value_expression ::= NOT boolean_primary */
  {  243,   -3 }, /* (273) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  243,   -3 }, /* (274) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  244,   -1 }, /* (275) boolean_primary ::= predicate */
  {  244,   -3 }, /* (276) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  245,   -1 }, /* (277) common_expression ::= expression */
  {  245,   -1 }, /* (278) common_expression ::= boolean_value_expression */
  {  246,   -2 }, /* (279) from_clause ::= FROM table_reference_list */
  {  247,   -1 }, /* (280) table_reference_list ::= table_reference */
  {  247,   -3 }, /* (281) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  248,   -1 }, /* (282) table_reference ::= table_primary */
  {  248,   -1 }, /* (283) table_reference ::= joined_table */
  {  249,   -2 }, /* (284) table_primary ::= table_name alias_opt */
  {  249,   -4 }, /* (285) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  249,   -2 }, /* (286) table_primary ::= subquery alias_opt */
  {  249,   -1 }, /* (287) table_primary ::= parenthesized_joined_table */
  {  251,    0 }, /* (288) alias_opt ::= */
  {  251,   -1 }, /* (289) alias_opt ::= table_alias */
  {  251,   -2 }, /* (290) alias_opt ::= AS table_alias */
  {  252,   -3 }, /* (291) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  252,   -3 }, /* (292) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  250,   -6 }, /* (293) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  253,    0 }, /* (294) join_type ::= */
  {  253,   -1 }, /* (295) join_type ::= INNER */
  {  255,   -9 }, /* (296) 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 */
  {  256,    0 }, /* (297) set_quantifier_opt ::= */
  {  256,   -1 }, /* (298) set_quantifier_opt ::= DISTINCT */
  {  256,   -1 }, /* (299) set_quantifier_opt ::= ALL */
  {  257,   -1 }, /* (300) select_list ::= NK_STAR */
  {  257,   -1 }, /* (301) select_list ::= select_sublist */
  {  263,   -1 }, /* (302) select_sublist ::= select_item */
  {  263,   -3 }, /* (303) select_sublist ::= select_sublist NK_COMMA select_item */
  {  264,   -1 }, /* (304) select_item ::= common_expression */
  {  264,   -2 }, /* (305) select_item ::= common_expression column_alias */
  {  264,   -3 }, /* (306) select_item ::= common_expression AS column_alias */
  {  264,   -3 }, /* (307) select_item ::= table_name NK_DOT NK_STAR */
  {  258,    0 }, /* (308) where_clause_opt ::= */
  {  258,   -2 }, /* (309) where_clause_opt ::= WHERE search_condition */
  {  259,    0 }, /* (310) partition_by_clause_opt ::= */
  {  259,   -3 }, /* (311) partition_by_clause_opt ::= PARTITION BY expression_list */
  {  260,    0 }, /* (312) twindow_clause_opt ::= */
  {  260,   -6 }, /* (313) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
  {  260,   -4 }, /* (314) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
  {  260,   -6 }, /* (315) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  260,   -8 }, /* (316) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  224,    0 }, /* (317) sliding_opt ::= */
  {  224,   -4 }, /* (318) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  265,    0 }, /* (319) fill_opt ::= */
  {  265,   -4 }, /* (320) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  265,   -6 }, /* (321) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  266,   -1 }, /* (322) fill_mode ::= NONE */
  {  266,   -1 }, /* (323) fill_mode ::= PREV */
  {  266,   -1 }, /* (324) fill_mode ::= NULL */
  {  266,   -1 }, /* (325) fill_mode ::= LINEAR */
  {  266,   -1 }, /* (326) fill_mode ::= NEXT */
  {  261,    0 }, /* (327) group_by_clause_opt ::= */
  {  261,   -3 }, /* (328) group_by_clause_opt ::= GROUP BY group_by_list */
  {  267,   -1 }, /* (329) group_by_list ::= expression */
  {  267,   -3 }, /* (330) group_by_list ::= group_by_list NK_COMMA expression */
  {  262,    0 }, /* (331) having_clause_opt ::= */
  {  262,   -2 }, /* (332) having_clause_opt ::= HAVING search_condition */
  {  228,   -4 }, /* (333) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  268,   -1 }, /* (334) query_expression_body ::= query_primary */
  {  268,   -4 }, /* (335) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
  {  272,   -1 }, /* (336) query_primary ::= query_specification */
  {  269,    0 }, /* (337) order_by_clause_opt ::= */
  {  269,   -3 }, /* (338) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  270,    0 }, /* (339) slimit_clause_opt ::= */
  {  270,   -2 }, /* (340) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  270,   -4 }, /* (341) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  270,   -4 }, /* (342) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  271,    0 }, /* (343) limit_clause_opt ::= */
  {  271,   -2 }, /* (344) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  271,   -4 }, /* (345) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  271,   -4 }, /* (346) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  238,   -3 }, /* (347) subquery ::= NK_LP query_expression NK_RP */
  {  254,   -1 }, /* (348) search_condition ::= common_expression */
  {  273,   -1 }, /* (349) sort_specification_list ::= sort_specification */
  {  273,   -3 }, /* (350) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  274,   -3 }, /* (351) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
  {  275,    0 }, /* (352) ordering_specification_opt ::= */
  {  275,   -1 }, /* (353) ordering_specification_opt ::= ASC */
  {  275,   -1 }, /* (354) ordering_specification_opt ::= DESC */
  {  276,    0 }, /* (355) null_ordering_opt ::= */
  {  276,   -2 }, /* (356) null_ordering_opt ::= NULLS FIRST */
  {  276,   -2 }, /* (357) null_ordering_opt ::= NULLS LAST */
2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312
};

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 已提交
2313 2314
  ParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  ParseCTX_PDECL                   /* %extra_context */
2315 2316 2317 2318 2319
){
  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 已提交
2320
  ParseARG_FETCH
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
  (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;
2381
      case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
2382
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
2383
  yy_destructor(yypParser,180,&yymsp[0].minor);
2384
        break;
2385 2386
      case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
2387
  yy_destructor(yypParser,181,&yymsp[0].minor);
2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400
        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);
2401
{  yy_destructor(yypParser,180,&yymsp[-2].minor);
2402
{ }
2403
  yy_destructor(yypParser,182,&yymsp[0].minor);
2404
}
2405
        break;
2406
      case 12: /* alter_account_options ::= alter_account_option */
2407
{  yy_destructor(yypParser,183,&yymsp[0].minor);
2408 2409 2410
{ }
}
        break;
2411
      case 13: /* alter_account_options ::= alter_account_options alter_account_option */
2412
{  yy_destructor(yypParser,181,&yymsp[-1].minor);
2413
{ }
2414
  yy_destructor(yypParser,183,&yymsp[0].minor);
2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426
}
        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);
2427
{ }
2428
  yy_destructor(yypParser,182,&yymsp[0].minor);
2429
        break;
2430
      case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */
2431
{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy95, &yymsp[0].minor.yy0); }
2432
        break;
2433
      case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
2434
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy95, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
2435
        break;
2436
      case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
2437
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy95, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
2438
        break;
2439
      case 27: /* cmd ::= DROP USER user_name */
2440
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy95); }
2441
        break;
X
Xiaoyu Wang 已提交
2442
      case 28: /* cmd ::= CREATE DNODE dnode_endpoint */
2443
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy95, NULL); }
2444
        break;
X
Xiaoyu Wang 已提交
2445
      case 29: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
2446
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy95, &yymsp[0].minor.yy0); }
2447
        break;
X
Xiaoyu Wang 已提交
2448
      case 30: /* cmd ::= DROP DNODE NK_INTEGER */
2449
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
2450
        break;
X
Xiaoyu Wang 已提交
2451
      case 31: /* cmd ::= DROP DNODE dnode_endpoint */
2452
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy95); }
2453
        break;
X
Xiaoyu Wang 已提交
2454
      case 32: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
2455 2456
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2457
      case 33: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
2458 2459
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2460
      case 34: /* cmd ::= ALTER ALL DNODES NK_STRING */
2461 2462
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2463
      case 35: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
2464 2465
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2466 2467 2468
      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 已提交
2469 2470 2471 2472 2473 2474 2475 2476 2477
      case 218: /* db_name ::= NK_ID */ yytestcase(yyruleno==218);
      case 219: /* table_name ::= NK_ID */ yytestcase(yyruleno==219);
      case 220: /* column_name ::= NK_ID */ yytestcase(yyruleno==220);
      case 221: /* function_name ::= NK_ID */ yytestcase(yyruleno==221);
      case 222: /* table_alias ::= NK_ID */ yytestcase(yyruleno==222);
      case 223: /* column_alias ::= NK_ID */ yytestcase(yyruleno==223);
      case 224: /* user_name ::= NK_ID */ yytestcase(yyruleno==224);
      case 225: /* index_name ::= NK_ID */ yytestcase(yyruleno==225);
      case 226: /* topic_name ::= NK_ID */ yytestcase(yyruleno==226);
2478 2479
{ yylhsminor.yy95 = yymsp[0].minor.yy0; }
  yymsp[0].minor.yy95 = yylhsminor.yy95;
X
Xiaoyu Wang 已提交
2480 2481
        break;
      case 39: /* cmd ::= ALTER LOCAL NK_STRING */
2482 2483
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2484
      case 40: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
2485 2486
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2487
      case 41: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
X
Xiaoyu Wang 已提交
2488 2489
{ pCxt->pRootNode = createCreateQnodeStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2490
      case 42: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
2491 2492
{ pCxt->pRootNode = createDropQnodeStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2493
      case 43: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
2494
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy151, &yymsp[-1].minor.yy95, yymsp[0].minor.yy46); }
X
Xiaoyu Wang 已提交
2495
        break;
X
Xiaoyu Wang 已提交
2496
      case 44: /* cmd ::= DROP DATABASE exists_opt db_name */
2497
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy95); }
X
Xiaoyu Wang 已提交
2498
        break;
X
Xiaoyu Wang 已提交
2499
      case 45: /* cmd ::= USE db_name */
2500
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy95); }
2501
        break;
X
Xiaoyu Wang 已提交
2502
      case 46: /* cmd ::= ALTER DATABASE db_name alter_db_options */
2503
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy95, yymsp[0].minor.yy46); }
2504
        break;
X
Xiaoyu Wang 已提交
2505
      case 47: /* not_exists_opt ::= IF NOT EXISTS */
2506
{ yymsp[-2].minor.yy151 = true; }
2507
        break;
X
Xiaoyu Wang 已提交
2508 2509
      case 48: /* not_exists_opt ::= */
      case 50: /* exists_opt ::= */ yytestcase(yyruleno==50);
X
Xiaoyu Wang 已提交
2510 2511
      case 190: /* analyze_opt ::= */ yytestcase(yyruleno==190);
      case 297: /* set_quantifier_opt ::= */ yytestcase(yyruleno==297);
2512
{ yymsp[1].minor.yy151 = false; }
2513
        break;
X
Xiaoyu Wang 已提交
2514
      case 49: /* exists_opt ::= IF EXISTS */
2515
{ yymsp[-1].minor.yy151 = true; }
2516
        break;
X
Xiaoyu Wang 已提交
2517
      case 51: /* db_options ::= */
2518
{ yymsp[1].minor.yy46 = createDefaultDatabaseOptions(pCxt); }
2519
        break;
X
Xiaoyu Wang 已提交
2520
      case 52: /* db_options ::= db_options BLOCKS NK_INTEGER */
2521 2522
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2523
        break;
X
Xiaoyu Wang 已提交
2524
      case 53: /* db_options ::= db_options CACHE NK_INTEGER */
2525 2526
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_CACHE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2527
        break;
X
Xiaoyu Wang 已提交
2528
      case 54: /* db_options ::= db_options CACHELAST NK_INTEGER */
2529 2530
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2531
        break;
X
Xiaoyu Wang 已提交
2532
      case 55: /* db_options ::= db_options COMP NK_INTEGER */
2533 2534
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2535
        break;
X
Xiaoyu Wang 已提交
2536
      case 56: /* db_options ::= db_options DAYS NK_INTEGER */
2537 2538
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2539
        break;
X
Xiaoyu Wang 已提交
2540
      case 57: /* db_options ::= db_options FSYNC NK_INTEGER */
2541 2542
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2543
        break;
X
Xiaoyu Wang 已提交
2544
      case 58: /* db_options ::= db_options MAXROWS NK_INTEGER */
2545 2546
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2547
        break;
X
Xiaoyu Wang 已提交
2548
      case 59: /* db_options ::= db_options MINROWS NK_INTEGER */
2549 2550
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2551
        break;
X
Xiaoyu Wang 已提交
2552
      case 60: /* db_options ::= db_options KEEP NK_INTEGER */
2553 2554
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_KEEP, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2555
        break;
X
Xiaoyu Wang 已提交
2556
      case 61: /* db_options ::= db_options PRECISION NK_STRING */
2557 2558
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2559
        break;
X
Xiaoyu Wang 已提交
2560
      case 62: /* db_options ::= db_options QUORUM NK_INTEGER */
2561 2562
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2563
        break;
X
Xiaoyu Wang 已提交
2564
      case 63: /* db_options ::= db_options REPLICA NK_INTEGER */
2565 2566
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2567
        break;
X
Xiaoyu Wang 已提交
2568
      case 64: /* db_options ::= db_options TTL NK_INTEGER */
2569 2570
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_TTL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2571
        break;
X
Xiaoyu Wang 已提交
2572
      case 65: /* db_options ::= db_options WAL NK_INTEGER */
2573 2574
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2575
        break;
X
Xiaoyu Wang 已提交
2576
      case 66: /* db_options ::= db_options VGROUPS NK_INTEGER */
2577 2578
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2579
        break;
X
Xiaoyu Wang 已提交
2580
      case 67: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
2581 2582
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2583
        break;
X
Xiaoyu Wang 已提交
2584
      case 68: /* db_options ::= db_options STREAM_MODE NK_INTEGER */
2585 2586
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_STREAM_MODE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2587
        break;
X
Xiaoyu Wang 已提交
2588
      case 69: /* db_options ::= db_options RETENTIONS NK_STRING */
2589 2590
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-2].minor.yy46, DB_OPTION_RETENTIONS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2591 2592
        break;
      case 70: /* alter_db_options ::= alter_db_option */
2593 2594
{ yylhsminor.yy46 = createDefaultAlterDatabaseOptions(pCxt); yylhsminor.yy46 = setDatabaseOption(pCxt, yylhsminor.yy46, yymsp[0].minor.yy145.type, &yymsp[0].minor.yy145.val); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
2595
        break;
X
Xiaoyu Wang 已提交
2596
      case 71: /* alter_db_options ::= alter_db_options alter_db_option */
2597 2598
{ yylhsminor.yy46 = setDatabaseOption(pCxt, yymsp[-1].minor.yy46, yymsp[0].minor.yy145.type, &yymsp[0].minor.yy145.val); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
2599
        break;
X
Xiaoyu Wang 已提交
2600
      case 72: /* alter_db_option ::= BLOCKS NK_INTEGER */
2601
{ yymsp[-1].minor.yy145.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
2602
        break;
X
Xiaoyu Wang 已提交
2603
      case 73: /* alter_db_option ::= FSYNC NK_INTEGER */
2604
{ yymsp[-1].minor.yy145.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
X
Xiaoyu Wang 已提交
2605 2606
        break;
      case 74: /* alter_db_option ::= KEEP NK_INTEGER */
2607
{ yymsp[-1].minor.yy145.type = DB_OPTION_KEEP; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
X
Xiaoyu Wang 已提交
2608 2609
        break;
      case 75: /* alter_db_option ::= WAL NK_INTEGER */
2610
{ yymsp[-1].minor.yy145.type = DB_OPTION_WAL; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
2611
        break;
X
Xiaoyu Wang 已提交
2612
      case 76: /* alter_db_option ::= QUORUM NK_INTEGER */
2613
{ yymsp[-1].minor.yy145.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
2614
        break;
X
Xiaoyu Wang 已提交
2615
      case 77: /* alter_db_option ::= CACHELAST NK_INTEGER */
2616
{ yymsp[-1].minor.yy145.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
X
Xiaoyu Wang 已提交
2617
        break;
X
Xiaoyu Wang 已提交
2618 2619 2620 2621 2622
      case 78: /* alter_db_option ::= REPLICA NK_INTEGER */
{ yymsp[-1].minor.yy145.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
        break;
      case 79: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
      case 81: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==81);
2623
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy151, yymsp[-5].minor.yy46, yymsp[-3].minor.yy194, yymsp[-1].minor.yy194, yymsp[0].minor.yy46); }
X
Xiaoyu Wang 已提交
2624
        break;
X
Xiaoyu Wang 已提交
2625
      case 80: /* cmd ::= CREATE TABLE multi_create_clause */
2626
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy194); }
X
Xiaoyu Wang 已提交
2627
        break;
X
Xiaoyu Wang 已提交
2628
      case 82: /* cmd ::= DROP TABLE multi_drop_clause */
2629
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy194); }
X
Xiaoyu Wang 已提交
2630
        break;
X
Xiaoyu Wang 已提交
2631
      case 83: /* cmd ::= DROP STABLE exists_opt full_table_name */
2632
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy151, yymsp[0].minor.yy46); }
X
Xiaoyu Wang 已提交
2633
        break;
X
Xiaoyu Wang 已提交
2634 2635 2636
      case 84: /* cmd ::= ALTER TABLE alter_table_clause */
      case 85: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==85);
      case 195: /* cmd ::= query_expression */ yytestcase(yyruleno==195);
2637
{ pCxt->pRootNode = yymsp[0].minor.yy46; }
X
Xiaoyu Wang 已提交
2638
        break;
X
Xiaoyu Wang 已提交
2639
      case 86: /* alter_table_clause ::= full_table_name alter_table_options */
2640 2641
{ yylhsminor.yy46 = createAlterTableOption(pCxt, yymsp[-1].minor.yy46, yymsp[0].minor.yy46); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2642
        break;
X
Xiaoyu Wang 已提交
2643
      case 87: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
2644 2645
{ yylhsminor.yy46 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy46, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy95, yymsp[0].minor.yy400); }
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2646
        break;
X
Xiaoyu Wang 已提交
2647
      case 88: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
2648 2649
{ yylhsminor.yy46 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy46, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy95); }
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2650
        break;
X
Xiaoyu Wang 已提交
2651
      case 89: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
2652 2653
{ yylhsminor.yy46 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy46, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy95, yymsp[0].minor.yy400); }
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2654
        break;
X
Xiaoyu Wang 已提交
2655
      case 90: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
2656 2657
{ yylhsminor.yy46 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy46, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy95, &yymsp[0].minor.yy95); }
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
2658
        break;
X
Xiaoyu Wang 已提交
2659
      case 91: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
2660 2661
{ yylhsminor.yy46 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy46, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy95, yymsp[0].minor.yy400); }
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
2662
        break;
X
Xiaoyu Wang 已提交
2663
      case 92: /* alter_table_clause ::= full_table_name DROP TAG column_name */
2664 2665
{ yylhsminor.yy46 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy46, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy95); }
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
2666
        break;
X
Xiaoyu Wang 已提交
2667
      case 93: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
2668 2669
{ yylhsminor.yy46 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy46, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy95, yymsp[0].minor.yy400); }
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
2670
        break;
X
Xiaoyu Wang 已提交
2671
      case 94: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
2672 2673
{ yylhsminor.yy46 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy46, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy95, &yymsp[0].minor.yy95); }
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
2674
        break;
X
Xiaoyu Wang 已提交
2675
      case 95: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
2676 2677
{ yylhsminor.yy46 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy46, &yymsp[-2].minor.yy95, yymsp[0].minor.yy46); }
  yymsp[-5].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2678
        break;
X
Xiaoyu Wang 已提交
2679 2680 2681 2682 2683 2684 2685 2686 2687
      case 96: /* multi_create_clause ::= create_subtable_clause */
      case 99: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==99);
      case 106: /* column_def_list ::= column_def */ yytestcase(yyruleno==106);
      case 149: /* col_name_list ::= col_name */ yytestcase(yyruleno==149);
      case 171: /* func_name_list ::= func_name */ yytestcase(yyruleno==171);
      case 180: /* func_list ::= func */ yytestcase(yyruleno==180);
      case 216: /* literal_list ::= signed_literal */ yytestcase(yyruleno==216);
      case 302: /* select_sublist ::= select_item */ yytestcase(yyruleno==302);
      case 349: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==349);
2688 2689
{ yylhsminor.yy194 = createNodeList(pCxt, yymsp[0].minor.yy46); }
  yymsp[0].minor.yy194 = yylhsminor.yy194;
2690
        break;
X
Xiaoyu Wang 已提交
2691 2692
      case 97: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
      case 100: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==100);
2693 2694
{ yylhsminor.yy194 = addNodeToList(pCxt, yymsp[-1].minor.yy194, yymsp[0].minor.yy46); }
  yymsp[-1].minor.yy194 = yylhsminor.yy194;
2695
        break;
X
Xiaoyu Wang 已提交
2696
      case 98: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
2697 2698
{ yylhsminor.yy46 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy151, yymsp[-7].minor.yy46, yymsp[-5].minor.yy46, yymsp[-4].minor.yy194, yymsp[-1].minor.yy194); }
  yymsp[-8].minor.yy46 = yylhsminor.yy46;
2699
        break;
X
Xiaoyu Wang 已提交
2700
      case 101: /* drop_table_clause ::= exists_opt full_table_name */
2701 2702
{ yylhsminor.yy46 = createDropTableClause(pCxt, yymsp[-1].minor.yy151, yymsp[0].minor.yy46); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
2703
        break;
X
Xiaoyu Wang 已提交
2704 2705 2706 2707 2708
      case 102: /* specific_tags_opt ::= */
      case 133: /* tags_def_opt ::= */ yytestcase(yyruleno==133);
      case 310: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==310);
      case 327: /* group_by_clause_opt ::= */ yytestcase(yyruleno==327);
      case 337: /* order_by_clause_opt ::= */ yytestcase(yyruleno==337);
2709
{ yymsp[1].minor.yy194 = NULL; }
2710
        break;
X
Xiaoyu Wang 已提交
2711
      case 103: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
2712
{ yymsp[-2].minor.yy194 = yymsp[-1].minor.yy194; }
2713
        break;
X
Xiaoyu Wang 已提交
2714
      case 104: /* full_table_name ::= table_name */
2715 2716
{ yylhsminor.yy46 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy95, NULL); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
2717
        break;
X
Xiaoyu Wang 已提交
2718
      case 105: /* full_table_name ::= db_name NK_DOT table_name */
2719 2720
{ yylhsminor.yy46 = createRealTableNode(pCxt, &yymsp[-2].minor.yy95, &yymsp[0].minor.yy95, NULL); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2721
        break;
X
Xiaoyu Wang 已提交
2722 2723 2724 2725 2726 2727 2728
      case 107: /* column_def_list ::= column_def_list NK_COMMA column_def */
      case 150: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==150);
      case 172: /* func_name_list ::= func_name_list NK_COMMA col_name */ yytestcase(yyruleno==172);
      case 181: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==181);
      case 217: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==217);
      case 303: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==303);
      case 350: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==350);
2729 2730
{ yylhsminor.yy194 = addNodeToList(pCxt, yymsp[-2].minor.yy194, yymsp[0].minor.yy46); }
  yymsp[-2].minor.yy194 = yylhsminor.yy194;
2731
        break;
X
Xiaoyu Wang 已提交
2732
      case 108: /* column_def ::= column_name type_name */
2733 2734
{ yylhsminor.yy46 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy95, yymsp[0].minor.yy400, NULL); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
2735
        break;
X
Xiaoyu Wang 已提交
2736
      case 109: /* column_def ::= column_name type_name COMMENT NK_STRING */
2737 2738
{ yylhsminor.yy46 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy95, yymsp[-2].minor.yy400, &yymsp[0].minor.yy0); }
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
2739
        break;
X
Xiaoyu Wang 已提交
2740
      case 110: /* type_name ::= BOOL */
2741
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BOOL); }
2742
        break;
X
Xiaoyu Wang 已提交
2743
      case 111: /* type_name ::= TINYINT */
2744
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_TINYINT); }
2745
        break;
X
Xiaoyu Wang 已提交
2746
      case 112: /* type_name ::= SMALLINT */
2747
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
2748
        break;
X
Xiaoyu Wang 已提交
2749 2750
      case 113: /* type_name ::= INT */
      case 114: /* type_name ::= INTEGER */ yytestcase(yyruleno==114);
2751
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_INT); }
2752
        break;
X
Xiaoyu Wang 已提交
2753
      case 115: /* type_name ::= BIGINT */
2754
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BIGINT); }
2755
        break;
X
Xiaoyu Wang 已提交
2756
      case 116: /* type_name ::= FLOAT */
2757
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_FLOAT); }
2758
        break;
X
Xiaoyu Wang 已提交
2759
      case 117: /* type_name ::= DOUBLE */
2760
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
2761
        break;
X
Xiaoyu Wang 已提交
2762
      case 118: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
2763
{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
2764
        break;
X
Xiaoyu Wang 已提交
2765
      case 119: /* type_name ::= TIMESTAMP */
2766
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
2767
        break;
X
Xiaoyu Wang 已提交
2768
      case 120: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
2769
{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
2770
        break;
X
Xiaoyu Wang 已提交
2771
      case 121: /* type_name ::= TINYINT UNSIGNED */
2772
{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
2773
        break;
X
Xiaoyu Wang 已提交
2774
      case 122: /* type_name ::= SMALLINT UNSIGNED */
2775
{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
2776
        break;
X
Xiaoyu Wang 已提交
2777
      case 123: /* type_name ::= INT UNSIGNED */
2778
{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UINT); }
2779
        break;
X
Xiaoyu Wang 已提交
2780
      case 124: /* type_name ::= BIGINT UNSIGNED */
2781
{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
2782
        break;
X
Xiaoyu Wang 已提交
2783
      case 125: /* type_name ::= JSON */
2784
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_JSON); }
2785
        break;
X
Xiaoyu Wang 已提交
2786
      case 126: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
2787
{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
2788
        break;
X
Xiaoyu Wang 已提交
2789
      case 127: /* type_name ::= MEDIUMBLOB */
2790
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
2791
        break;
X
Xiaoyu Wang 已提交
2792
      case 128: /* type_name ::= BLOB */
2793
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BLOB); }
2794
        break;
X
Xiaoyu Wang 已提交
2795
      case 129: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
2796
{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
2797
        break;
X
Xiaoyu Wang 已提交
2798
      case 130: /* type_name ::= DECIMAL */
2799
{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
2800
        break;
X
Xiaoyu Wang 已提交
2801
      case 131: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
2802
{ yymsp[-3].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
2803
        break;
X
Xiaoyu Wang 已提交
2804
      case 132: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
2805
{ yymsp[-5].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
2806
        break;
X
Xiaoyu Wang 已提交
2807 2808
      case 134: /* tags_def_opt ::= tags_def */
      case 301: /* select_list ::= select_sublist */ yytestcase(yyruleno==301);
2809 2810
{ yylhsminor.yy194 = yymsp[0].minor.yy194; }
  yymsp[0].minor.yy194 = yylhsminor.yy194;
2811
        break;
X
Xiaoyu Wang 已提交
2812
      case 135: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
2813
{ yymsp[-3].minor.yy194 = yymsp[-1].minor.yy194; }
2814
        break;
X
Xiaoyu Wang 已提交
2815
      case 136: /* table_options ::= */
2816
{ yymsp[1].minor.yy46 = createDefaultTableOptions(pCxt); }
2817
        break;
X
Xiaoyu Wang 已提交
2818
      case 137: /* table_options ::= table_options COMMENT NK_STRING */
2819 2820
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-2].minor.yy46, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2821
        break;
X
Xiaoyu Wang 已提交
2822
      case 138: /* table_options ::= table_options KEEP NK_INTEGER */
2823 2824
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-2].minor.yy46, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2825
        break;
X
Xiaoyu Wang 已提交
2826
      case 139: /* table_options ::= table_options TTL NK_INTEGER */
2827 2828
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-2].minor.yy46, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2829
        break;
X
Xiaoyu Wang 已提交
2830
      case 140: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
2831 2832
{ yylhsminor.yy46 = setTableSmaOption(pCxt, yymsp[-4].minor.yy46, yymsp[-1].minor.yy194); }
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
2833
        break;
X
Xiaoyu Wang 已提交
2834
      case 141: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
2835 2836
{ yylhsminor.yy46 = setTableRollupOption(pCxt, yymsp[-4].minor.yy46, yymsp[-1].minor.yy194); }
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
2837
        break;
X
Xiaoyu Wang 已提交
2838
      case 142: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */
2839 2840
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-2].minor.yy46, TABLE_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2841
        break;
X
Xiaoyu Wang 已提交
2842
      case 143: /* table_options ::= table_options DELAY NK_INTEGER */
2843 2844
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-2].minor.yy46, TABLE_OPTION_DELAY, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
2845
        break;
X
Xiaoyu Wang 已提交
2846
      case 144: /* alter_table_options ::= alter_table_option */
2847 2848
{ yylhsminor.yy46 = createDefaultAlterTableOptions(pCxt); yylhsminor.yy46 = setTableOption(pCxt, yylhsminor.yy46, yymsp[0].minor.yy145.type, &yymsp[0].minor.yy145.val); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
2849
        break;
X
Xiaoyu Wang 已提交
2850
      case 145: /* alter_table_options ::= alter_table_options alter_table_option */
2851 2852
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-1].minor.yy46, yymsp[0].minor.yy145.type, &yymsp[0].minor.yy145.val); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
2853
        break;
X
Xiaoyu Wang 已提交
2854
      case 146: /* alter_table_option ::= COMMENT NK_STRING */
2855
{ yymsp[-1].minor.yy145.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
2856
        break;
X
Xiaoyu Wang 已提交
2857
      case 147: /* alter_table_option ::= KEEP NK_INTEGER */
2858
{ yymsp[-1].minor.yy145.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
2859
        break;
X
Xiaoyu Wang 已提交
2860
      case 148: /* alter_table_option ::= TTL NK_INTEGER */
2861
{ yymsp[-1].minor.yy145.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
2862
        break;
X
Xiaoyu Wang 已提交
2863
      case 151: /* col_name ::= column_name */
2864 2865
{ yylhsminor.yy46 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy95); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
2866
        break;
X
Xiaoyu Wang 已提交
2867
      case 152: /* cmd ::= SHOW DNODES */
X
Xiaoyu Wang 已提交
2868
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); }
2869
        break;
X
Xiaoyu Wang 已提交
2870
      case 153: /* cmd ::= SHOW USERS */
X
Xiaoyu Wang 已提交
2871
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); }
2872
        break;
X
Xiaoyu Wang 已提交
2873
      case 154: /* cmd ::= SHOW DATABASES */
X
Xiaoyu Wang 已提交
2874
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); }
2875
        break;
X
Xiaoyu Wang 已提交
2876
      case 155: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
2877
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy46, yymsp[0].minor.yy46); }
2878
        break;
X
Xiaoyu Wang 已提交
2879
      case 156: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
2880
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy46, yymsp[0].minor.yy46); }
2881
        break;
X
Xiaoyu Wang 已提交
2882
      case 157: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
2883
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy46, NULL); }
2884
        break;
X
Xiaoyu Wang 已提交
2885
      case 158: /* cmd ::= SHOW MNODES */
X
Xiaoyu Wang 已提交
2886
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); }
2887
        break;
X
Xiaoyu Wang 已提交
2888
      case 159: /* cmd ::= SHOW MODULES */
X
Xiaoyu Wang 已提交
2889
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); }
2890
        break;
X
Xiaoyu Wang 已提交
2891
      case 160: /* cmd ::= SHOW QNODES */
X
Xiaoyu Wang 已提交
2892
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); }
2893
        break;
X
Xiaoyu Wang 已提交
2894
      case 161: /* cmd ::= SHOW FUNCTIONS */
X
Xiaoyu Wang 已提交
2895
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); }
2896
        break;
X
Xiaoyu Wang 已提交
2897
      case 162: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
2898
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy46, yymsp[0].minor.yy46); }
2899
        break;
X
Xiaoyu Wang 已提交
2900
      case 163: /* cmd ::= SHOW STREAMS */
X
Xiaoyu Wang 已提交
2901
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); }
2902
        break;
X
Xiaoyu Wang 已提交
2903 2904
      case 164: /* db_name_cond_opt ::= */
      case 169: /* from_db_opt ::= */ yytestcase(yyruleno==169);
2905
{ yymsp[1].minor.yy46 = createDefaultDatabaseCondValue(pCxt); }
X
Xiaoyu Wang 已提交
2906
        break;
X
Xiaoyu Wang 已提交
2907
      case 165: /* db_name_cond_opt ::= db_name NK_DOT */
2908 2909
{ yylhsminor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy95); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2910
        break;
X
Xiaoyu Wang 已提交
2911 2912 2913 2914 2915 2916 2917 2918 2919
      case 166: /* like_pattern_opt ::= */
      case 177: /* index_options ::= */ yytestcase(yyruleno==177);
      case 308: /* where_clause_opt ::= */ yytestcase(yyruleno==308);
      case 312: /* twindow_clause_opt ::= */ yytestcase(yyruleno==312);
      case 317: /* sliding_opt ::= */ yytestcase(yyruleno==317);
      case 319: /* fill_opt ::= */ yytestcase(yyruleno==319);
      case 331: /* having_clause_opt ::= */ yytestcase(yyruleno==331);
      case 339: /* slimit_clause_opt ::= */ yytestcase(yyruleno==339);
      case 343: /* limit_clause_opt ::= */ yytestcase(yyruleno==343);
2920
{ yymsp[1].minor.yy46 = NULL; }
X
Xiaoyu Wang 已提交
2921
        break;
X
Xiaoyu Wang 已提交
2922
      case 167: /* like_pattern_opt ::= LIKE NK_STRING */
2923
{ yymsp[-1].minor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2924
        break;
X
Xiaoyu Wang 已提交
2925
      case 168: /* table_name_cond ::= table_name */
2926 2927
{ yylhsminor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy95); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2928
        break;
X
Xiaoyu Wang 已提交
2929
      case 170: /* from_db_opt ::= FROM db_name */
2930
{ yymsp[-1].minor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy95); }
X
Xiaoyu Wang 已提交
2931
        break;
X
Xiaoyu Wang 已提交
2932
      case 173: /* func_name ::= function_name */
2933 2934
{ yylhsminor.yy46 = createFunctionNode(pCxt, &yymsp[0].minor.yy95, NULL); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2935
        break;
X
Xiaoyu Wang 已提交
2936
      case 174: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
2937
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy151, &yymsp[-3].minor.yy95, &yymsp[-1].minor.yy95, NULL, yymsp[0].minor.yy46); }
X
Xiaoyu Wang 已提交
2938
        break;
X
Xiaoyu Wang 已提交
2939
      case 175: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
2940
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy151, &yymsp[-5].minor.yy95, &yymsp[-3].minor.yy95, yymsp[-1].minor.yy194, NULL); }
X
Xiaoyu Wang 已提交
2941
        break;
X
Xiaoyu Wang 已提交
2942
      case 176: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */
2943
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy151, &yymsp[-2].minor.yy95, &yymsp[0].minor.yy95); }
X
Xiaoyu Wang 已提交
2944
        break;
X
Xiaoyu Wang 已提交
2945
      case 178: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
2946
{ yymsp[-8].minor.yy46 = createIndexOption(pCxt, yymsp[-6].minor.yy194, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), NULL, yymsp[0].minor.yy46); }
X
Xiaoyu Wang 已提交
2947
        break;
X
Xiaoyu Wang 已提交
2948
      case 179: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
2949
{ yymsp[-10].minor.yy46 = createIndexOption(pCxt, yymsp[-8].minor.yy194, releaseRawExprNode(pCxt, yymsp[-4].minor.yy46), releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), yymsp[0].minor.yy46); }
X
Xiaoyu Wang 已提交
2950
        break;
X
Xiaoyu Wang 已提交
2951
      case 182: /* func ::= function_name NK_LP expression_list NK_RP */
2952 2953
{ yylhsminor.yy46 = createFunctionNode(pCxt, &yymsp[-3].minor.yy95, yymsp[-1].minor.yy194); }
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
2954
        break;
X
Xiaoyu Wang 已提交
2955
      case 183: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
2956
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy151, &yymsp[-2].minor.yy95, yymsp[0].minor.yy46, NULL); }
X
Xiaoyu Wang 已提交
2957
        break;
X
Xiaoyu Wang 已提交
2958
      case 184: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
2959
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy151, &yymsp[-2].minor.yy95, NULL, &yymsp[0].minor.yy95); }
X
Xiaoyu Wang 已提交
2960
        break;
X
Xiaoyu Wang 已提交
2961
      case 185: /* cmd ::= DROP TOPIC exists_opt topic_name */
2962 2963
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy95); }
        break;
X
Xiaoyu Wang 已提交
2964 2965
      case 186: /* cmd ::= DESC full_table_name */
      case 187: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==187);
2966 2967
{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy46); }
        break;
X
Xiaoyu Wang 已提交
2968
      case 188: /* cmd ::= RESET QUERY CACHE */
2969 2970
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
        break;
X
Xiaoyu Wang 已提交
2971
      case 189: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */
2972 2973
{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy151, yymsp[-1].minor.yy46, yymsp[0].minor.yy46); }
        break;
X
Xiaoyu Wang 已提交
2974 2975
      case 191: /* analyze_opt ::= ANALYZE */
      case 298: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==298);
2976 2977
{ yymsp[0].minor.yy151 = true; }
        break;
X
Xiaoyu Wang 已提交
2978
      case 192: /* explain_options ::= */
2979 2980
{ yymsp[1].minor.yy46 = createDefaultExplainOptions(pCxt); }
        break;
X
Xiaoyu Wang 已提交
2981
      case 193: /* explain_options ::= explain_options VERBOSE NK_BOOL */
2982 2983 2984
{ yylhsminor.yy46 = setExplainVerbose(pCxt, yymsp[-2].minor.yy46, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
2985
      case 194: /* explain_options ::= explain_options RATIO NK_FLOAT */
2986 2987 2988
{ yylhsminor.yy46 = setExplainRatio(pCxt, yymsp[-2].minor.yy46, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
2989
      case 196: /* literal ::= NK_INTEGER */
2990 2991 2992
{ yylhsminor.yy46 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
2993
      case 197: /* literal ::= NK_FLOAT */
2994 2995 2996
{ yylhsminor.yy46 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
2997
      case 198: /* literal ::= NK_STRING */
2998 2999 3000
{ yylhsminor.yy46 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3001
      case 199: /* literal ::= NK_BOOL */
3002 3003 3004
{ yylhsminor.yy46 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3005
      case 200: /* literal ::= TIMESTAMP NK_STRING */
3006 3007 3008
{ yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024
      case 201: /* literal ::= duration_literal */
      case 210: /* signed_literal ::= signed */ yytestcase(yyruleno==210);
      case 227: /* expression ::= literal */ yytestcase(yyruleno==227);
      case 228: /* expression ::= pseudo_column */ yytestcase(yyruleno==228);
      case 229: /* expression ::= column_reference */ yytestcase(yyruleno==229);
      case 232: /* expression ::= subquery */ yytestcase(yyruleno==232);
      case 271: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==271);
      case 275: /* boolean_primary ::= predicate */ yytestcase(yyruleno==275);
      case 277: /* common_expression ::= expression */ yytestcase(yyruleno==277);
      case 278: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==278);
      case 280: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==280);
      case 282: /* table_reference ::= table_primary */ yytestcase(yyruleno==282);
      case 283: /* table_reference ::= joined_table */ yytestcase(yyruleno==283);
      case 287: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==287);
      case 334: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==334);
      case 336: /* query_primary ::= query_specification */ yytestcase(yyruleno==336);
3025 3026 3027
{ yylhsminor.yy46 = yymsp[0].minor.yy46; }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3028
      case 202: /* literal ::= NULL */
3029 3030 3031
{ yylhsminor.yy46 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL)); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3032
      case 203: /* duration_literal ::= NK_VARIABLE */
3033 3034 3035
{ yylhsminor.yy46 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3036
      case 204: /* signed ::= NK_INTEGER */
3037 3038 3039
{ yylhsminor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3040
      case 205: /* signed ::= NK_PLUS NK_INTEGER */
3041 3042
{ yymsp[-1].minor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
3043
      case 206: /* signed ::= NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
3044 3045 3046
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3047
                                                                                    yylhsminor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
X
Xiaoyu Wang 已提交
3048
                                                                                  }
3049
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3050
        break;
X
Xiaoyu Wang 已提交
3051
      case 207: /* signed ::= NK_FLOAT */
3052 3053
{ yylhsminor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3054
        break;
X
Xiaoyu Wang 已提交
3055
      case 208: /* signed ::= NK_PLUS NK_FLOAT */
3056
{ yymsp[-1].minor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3057
        break;
X
Xiaoyu Wang 已提交
3058
      case 209: /* signed ::= NK_MINUS NK_FLOAT */
X
Xiaoyu Wang 已提交
3059 3060 3061
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3062
                                                                                    yylhsminor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
X
Xiaoyu Wang 已提交
3063
                                                                                  }
3064
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3065
        break;
X
Xiaoyu Wang 已提交
3066
      case 211: /* signed_literal ::= NK_STRING */
3067 3068
{ yylhsminor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
3069
        break;
X
Xiaoyu Wang 已提交
3070
      case 212: /* signed_literal ::= NK_BOOL */
3071 3072
{ yylhsminor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
3073
        break;
X
Xiaoyu Wang 已提交
3074
      case 213: /* signed_literal ::= TIMESTAMP NK_STRING */
3075
{ yymsp[-1].minor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
3076
        break;
X
Xiaoyu Wang 已提交
3077 3078
      case 214: /* signed_literal ::= duration_literal */
      case 348: /* search_condition ::= common_expression */ yytestcase(yyruleno==348);
3079 3080
{ yylhsminor.yy46 = releaseRawExprNode(pCxt, yymsp[0].minor.yy46); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3081
        break;
X
Xiaoyu Wang 已提交
3082
      case 215: /* signed_literal ::= NULL */
3083
{ yymsp[0].minor.yy46 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL); }
X
Xiaoyu Wang 已提交
3084
        break;
X
Xiaoyu Wang 已提交
3085
      case 230: /* expression ::= function_name NK_LP expression_list NK_RP */
3086 3087
{ yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy95, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy95, yymsp[-1].minor.yy194)); }
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3088
        break;
X
Xiaoyu Wang 已提交
3089
      case 231: /* expression ::= function_name NK_LP NK_STAR NK_RP */
3090 3091
{ yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy95, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy95, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3092
        break;
X
Xiaoyu Wang 已提交
3093 3094
      case 233: /* expression ::= NK_LP expression NK_RP */
      case 276: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==276);
3095 3096
{ yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy46)); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3097
        break;
X
Xiaoyu Wang 已提交
3098
      case 234: /* expression ::= NK_PLUS expression */
3099
{
3100 3101
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy46));
3102
                                                                                  }
3103
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
3104
        break;
X
Xiaoyu Wang 已提交
3105
      case 235: /* expression ::= NK_MINUS expression */
3106
{
3107 3108
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy46), NULL));
3109
                                                                                  }
3110
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
3111
        break;
X
Xiaoyu Wang 已提交
3112
      case 236: /* expression ::= expression NK_PLUS expression */
3113
{
3114 3115 3116
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46))); 
3117
                                                                                  }
3118
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3119
        break;
X
Xiaoyu Wang 已提交
3120
      case 237: /* expression ::= expression NK_MINUS expression */
3121
{
3122 3123 3124
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46))); 
3125
                                                                                  }
3126
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3127
        break;
X
Xiaoyu Wang 已提交
3128
      case 238: /* expression ::= expression NK_STAR expression */
3129
{
3130 3131 3132
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46))); 
3133
                                                                                  }
3134
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3135
        break;
X
Xiaoyu Wang 已提交
3136
      case 239: /* expression ::= expression NK_SLASH expression */
3137
{
3138 3139 3140
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46))); 
3141
                                                                                  }
3142
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3143
        break;
X
Xiaoyu Wang 已提交
3144
      case 240: /* expression ::= expression NK_REM expression */
3145
{
3146 3147 3148
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46))); 
3149
                                                                                  }
3150 3151
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3152
      case 241: /* expression_list ::= expression */
3153 3154 3155
{ yylhsminor.yy194 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy46)); }
  yymsp[0].minor.yy194 = yylhsminor.yy194;
        break;
X
Xiaoyu Wang 已提交
3156
      case 242: /* expression_list ::= expression_list NK_COMMA expression */
3157 3158 3159
{ yylhsminor.yy194 = addNodeToList(pCxt, yymsp[-2].minor.yy194, releaseRawExprNode(pCxt, yymsp[0].minor.yy46)); }
  yymsp[-2].minor.yy194 = yylhsminor.yy194;
        break;
X
Xiaoyu Wang 已提交
3160
      case 243: /* column_reference ::= column_name */
3161 3162 3163
{ yylhsminor.yy46 = createRawExprNode(pCxt, &yymsp[0].minor.yy95, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy95)); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3164
      case 244: /* column_reference ::= table_name NK_DOT column_name */
3165 3166 3167
{ yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy95, &yymsp[0].minor.yy95, createColumnNode(pCxt, &yymsp[-2].minor.yy95, &yymsp[0].minor.yy95)); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
        break;
X
Xiaoyu Wang 已提交
3168 3169 3170 3171 3172 3173
      case 245: /* pseudo_column ::= NK_UNDERLINE ROWTS */
      case 247: /* pseudo_column ::= NK_UNDERLINE QSTARTTS */ yytestcase(yyruleno==247);
      case 248: /* pseudo_column ::= NK_UNDERLINE QENDTS */ yytestcase(yyruleno==248);
      case 249: /* pseudo_column ::= NK_UNDERLINE WSTARTTS */ yytestcase(yyruleno==249);
      case 250: /* pseudo_column ::= NK_UNDERLINE WENDTS */ yytestcase(yyruleno==250);
      case 251: /* pseudo_column ::= NK_UNDERLINE WDURATION */ yytestcase(yyruleno==251);
3174 3175 3176
{
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3177
                                                                                    yylhsminor.yy46 = createRawExprNode(pCxt, &t, createFunctionNode(pCxt, &t, NULL));
3178
                                                                                  }
3179
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3180
        break;
X
Xiaoyu Wang 已提交
3181
      case 246: /* pseudo_column ::= TBNAME */
3182 3183
{ yylhsminor.yy46 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
  yymsp[0].minor.yy46 = yylhsminor.yy46;
X
Xiaoyu Wang 已提交
3184
        break;
X
Xiaoyu Wang 已提交
3185 3186
      case 252: /* predicate ::= expression compare_op expression */
      case 257: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==257);
3187
{
3188 3189 3190
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy292, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46)));
3191
                                                                                  }
3192
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3193
        break;
X
Xiaoyu Wang 已提交
3194
      case 253: /* predicate ::= expression BETWEEN expression AND expression */
3195
{
3196 3197 3198
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy46), releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46)));
3199
                                                                                  }
3200
  yymsp[-4].minor.yy46 = yylhsminor.yy46;
3201
        break;
X
Xiaoyu Wang 已提交
3202
      case 254: /* predicate ::= expression NOT BETWEEN expression AND expression */
3203
{
3204 3205 3206
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[-5].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46)));
3207
                                                                                  }
3208
  yymsp[-5].minor.yy46 = yylhsminor.yy46;
3209
        break;
X
Xiaoyu Wang 已提交
3210
      case 255: /* predicate ::= expression IS NULL */
3211
{
3212 3213
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), NULL));
3214
                                                                                  }
3215
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3216
        break;
X
Xiaoyu Wang 已提交
3217
      case 256: /* predicate ::= expression IS NOT NULL */
3218
{
3219 3220
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy46), NULL));
3221
                                                                                  }
3222
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
3223
        break;
X
Xiaoyu Wang 已提交
3224
      case 258: /* compare_op ::= NK_LT */
3225
{ yymsp[0].minor.yy292 = OP_TYPE_LOWER_THAN; }
3226
        break;
X
Xiaoyu Wang 已提交
3227
      case 259: /* compare_op ::= NK_GT */
3228
{ yymsp[0].minor.yy292 = OP_TYPE_GREATER_THAN; }
3229
        break;
X
Xiaoyu Wang 已提交
3230
      case 260: /* compare_op ::= NK_LE */
3231
{ yymsp[0].minor.yy292 = OP_TYPE_LOWER_EQUAL; }
3232
        break;
X
Xiaoyu Wang 已提交
3233
      case 261: /* compare_op ::= NK_GE */
3234
{ yymsp[0].minor.yy292 = OP_TYPE_GREATER_EQUAL; }
3235
        break;
X
Xiaoyu Wang 已提交
3236
      case 262: /* compare_op ::= NK_NE */
3237
{ yymsp[0].minor.yy292 = OP_TYPE_NOT_EQUAL; }
3238
        break;
X
Xiaoyu Wang 已提交
3239
      case 263: /* compare_op ::= NK_EQ */
3240
{ yymsp[0].minor.yy292 = OP_TYPE_EQUAL; }
3241
        break;
X
Xiaoyu Wang 已提交
3242
      case 264: /* compare_op ::= LIKE */
3243
{ yymsp[0].minor.yy292 = OP_TYPE_LIKE; }
3244
        break;
X
Xiaoyu Wang 已提交
3245
      case 265: /* compare_op ::= NOT LIKE */
3246
{ yymsp[-1].minor.yy292 = OP_TYPE_NOT_LIKE; }
3247
        break;
X
Xiaoyu Wang 已提交
3248
      case 266: /* compare_op ::= MATCH */
3249
{ yymsp[0].minor.yy292 = OP_TYPE_MATCH; }
3250
        break;
X
Xiaoyu Wang 已提交
3251
      case 267: /* compare_op ::= NMATCH */
3252
{ yymsp[0].minor.yy292 = OP_TYPE_NMATCH; }
3253
        break;
X
Xiaoyu Wang 已提交
3254
      case 268: /* in_op ::= IN */
3255
{ yymsp[0].minor.yy292 = OP_TYPE_IN; }
3256
        break;
X
Xiaoyu Wang 已提交
3257
      case 269: /* in_op ::= NOT IN */
3258
{ yymsp[-1].minor.yy292 = OP_TYPE_NOT_IN; }
3259
        break;
X
Xiaoyu Wang 已提交
3260
      case 270: /* in_predicate_value ::= NK_LP expression_list NK_RP */
3261 3262
{ yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy194)); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3263
        break;
X
Xiaoyu Wang 已提交
3264
      case 272: /* boolean_value_expression ::= NOT boolean_primary */
3265
{
3266 3267
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy46), NULL));
3268
                                                                                  }
3269
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
3270
        break;
X
Xiaoyu Wang 已提交
3271
      case 273: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
3272
{
3273 3274 3275
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46)));
3276
                                                                                  }
3277
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3278
        break;
X
Xiaoyu Wang 已提交
3279
      case 274: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
3280
{
3281 3282 3283
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy46);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), releaseRawExprNode(pCxt, yymsp[0].minor.yy46)));
3284
                                                                                  }
3285
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3286
        break;
X
Xiaoyu Wang 已提交
3287 3288 3289
      case 279: /* from_clause ::= FROM table_reference_list */
      case 309: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==309);
      case 332: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==332);
3290
{ yymsp[-1].minor.yy46 = yymsp[0].minor.yy46; }
3291
        break;
X
Xiaoyu Wang 已提交
3292
      case 281: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
3293 3294
{ yylhsminor.yy46 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy46, yymsp[0].minor.yy46, NULL); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3295
        break;
X
Xiaoyu Wang 已提交
3296
      case 284: /* table_primary ::= table_name alias_opt */
3297 3298
{ yylhsminor.yy46 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy95, &yymsp[0].minor.yy95); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
3299
        break;
X
Xiaoyu Wang 已提交
3300
      case 285: /* table_primary ::= db_name NK_DOT table_name alias_opt */
3301 3302
{ yylhsminor.yy46 = createRealTableNode(pCxt, &yymsp[-3].minor.yy95, &yymsp[-1].minor.yy95, &yymsp[0].minor.yy95); }
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
3303
        break;
X
Xiaoyu Wang 已提交
3304
      case 286: /* table_primary ::= subquery alias_opt */
3305 3306
{ yylhsminor.yy46 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy46), &yymsp[0].minor.yy95); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
3307
        break;
X
Xiaoyu Wang 已提交
3308
      case 288: /* alias_opt ::= */
3309
{ yymsp[1].minor.yy95 = nil_token;  }
3310
        break;
X
Xiaoyu Wang 已提交
3311
      case 289: /* alias_opt ::= table_alias */
3312 3313
{ yylhsminor.yy95 = yymsp[0].minor.yy95; }
  yymsp[0].minor.yy95 = yylhsminor.yy95;
3314
        break;
X
Xiaoyu Wang 已提交
3315
      case 290: /* alias_opt ::= AS table_alias */
3316
{ yymsp[-1].minor.yy95 = yymsp[0].minor.yy95; }
3317
        break;
X
Xiaoyu Wang 已提交
3318 3319
      case 291: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
      case 292: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==292);
3320
{ yymsp[-2].minor.yy46 = yymsp[-1].minor.yy46; }
3321
        break;
X
Xiaoyu Wang 已提交
3322
      case 293: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
3323 3324
{ yylhsminor.yy46 = createJoinTableNode(pCxt, yymsp[-4].minor.yy10, yymsp[-5].minor.yy46, yymsp[-2].minor.yy46, yymsp[0].minor.yy46); }
  yymsp[-5].minor.yy46 = yylhsminor.yy46;
3325
        break;
X
Xiaoyu Wang 已提交
3326
      case 294: /* join_type ::= */
3327
{ yymsp[1].minor.yy10 = JOIN_TYPE_INNER; }
3328
        break;
X
Xiaoyu Wang 已提交
3329
      case 295: /* join_type ::= INNER */
3330
{ yymsp[0].minor.yy10 = JOIN_TYPE_INNER; }
3331
        break;
X
Xiaoyu Wang 已提交
3332
      case 296: /* 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 */
3333
{ 
3334 3335 3336 3337 3338 3339
                                                                                    yymsp[-8].minor.yy46 = createSelectStmt(pCxt, yymsp[-7].minor.yy151, yymsp[-6].minor.yy194, yymsp[-5].minor.yy46);
                                                                                    yymsp[-8].minor.yy46 = addWhereClause(pCxt, yymsp[-8].minor.yy46, yymsp[-4].minor.yy46);
                                                                                    yymsp[-8].minor.yy46 = addPartitionByClause(pCxt, yymsp[-8].minor.yy46, yymsp[-3].minor.yy194);
                                                                                    yymsp[-8].minor.yy46 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy46, yymsp[-2].minor.yy46);
                                                                                    yymsp[-8].minor.yy46 = addGroupByClause(pCxt, yymsp[-8].minor.yy46, yymsp[-1].minor.yy194);
                                                                                    yymsp[-8].minor.yy46 = addHavingClause(pCxt, yymsp[-8].minor.yy46, yymsp[0].minor.yy46);
3340 3341
                                                                                  }
        break;
X
Xiaoyu Wang 已提交
3342
      case 299: /* set_quantifier_opt ::= ALL */
3343
{ yymsp[0].minor.yy151 = false; }
3344
        break;
X
Xiaoyu Wang 已提交
3345
      case 300: /* select_list ::= NK_STAR */
3346
{ yymsp[0].minor.yy194 = NULL; }
3347
        break;
X
Xiaoyu Wang 已提交
3348
      case 304: /* select_item ::= common_expression */
3349
{
3350 3351
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy46);
                                                                                    yylhsminor.yy46 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy46), &t);
3352
                                                                                  }
3353
  yymsp[0].minor.yy46 = yylhsminor.yy46;
3354
        break;
X
Xiaoyu Wang 已提交
3355
      case 305: /* select_item ::= common_expression column_alias */
3356 3357
{ yylhsminor.yy46 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy46), &yymsp[0].minor.yy95); }
  yymsp[-1].minor.yy46 = yylhsminor.yy46;
3358
        break;
X
Xiaoyu Wang 已提交
3359
      case 306: /* select_item ::= common_expression AS column_alias */
3360 3361
{ yylhsminor.yy46 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), &yymsp[0].minor.yy95); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3362
        break;
X
Xiaoyu Wang 已提交
3363
      case 307: /* select_item ::= table_name NK_DOT NK_STAR */
3364 3365
{ yylhsminor.yy46 = createColumnNode(pCxt, &yymsp[-2].minor.yy95, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3366
        break;
X
Xiaoyu Wang 已提交
3367 3368 3369
      case 311: /* partition_by_clause_opt ::= PARTITION BY expression_list */
      case 328: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==328);
      case 338: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==338);
3370
{ yymsp[-2].minor.yy194 = yymsp[0].minor.yy194; }
3371
        break;
X
Xiaoyu Wang 已提交
3372
      case 313: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
3373
{ yymsp[-5].minor.yy46 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy46), releaseRawExprNode(pCxt, yymsp[-1].minor.yy46)); }
3374
        break;
X
Xiaoyu Wang 已提交
3375
      case 314: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
3376
{ yymsp[-3].minor.yy46 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy46)); }
3377
        break;
X
Xiaoyu Wang 已提交
3378
      case 315: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
3379
{ yymsp[-5].minor.yy46 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy46), NULL, yymsp[-1].minor.yy46, yymsp[0].minor.yy46); }
3380
        break;
X
Xiaoyu Wang 已提交
3381
      case 316: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
3382
{ yymsp[-7].minor.yy46 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy46), releaseRawExprNode(pCxt, yymsp[-3].minor.yy46), yymsp[-1].minor.yy46, yymsp[0].minor.yy46); }
3383
        break;
X
Xiaoyu Wang 已提交
3384
      case 318: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
3385
{ yymsp[-3].minor.yy46 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy46); }
3386
        break;
X
Xiaoyu Wang 已提交
3387
      case 320: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
3388
{ yymsp[-3].minor.yy46 = createFillNode(pCxt, yymsp[-1].minor.yy6, NULL); }
3389
        break;
X
Xiaoyu Wang 已提交
3390
      case 321: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
3391
{ yymsp[-5].minor.yy46 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy194)); }
3392
        break;
X
Xiaoyu Wang 已提交
3393
      case 322: /* fill_mode ::= NONE */
3394
{ yymsp[0].minor.yy6 = FILL_MODE_NONE; }
3395
        break;
X
Xiaoyu Wang 已提交
3396
      case 323: /* fill_mode ::= PREV */
3397
{ yymsp[0].minor.yy6 = FILL_MODE_PREV; }
3398
        break;
X
Xiaoyu Wang 已提交
3399
      case 324: /* fill_mode ::= NULL */
3400
{ yymsp[0].minor.yy6 = FILL_MODE_NULL; }
3401
        break;
X
Xiaoyu Wang 已提交
3402
      case 325: /* fill_mode ::= LINEAR */
3403
{ yymsp[0].minor.yy6 = FILL_MODE_LINEAR; }
3404
        break;
X
Xiaoyu Wang 已提交
3405
      case 326: /* fill_mode ::= NEXT */
3406
{ yymsp[0].minor.yy6 = FILL_MODE_NEXT; }
3407
        break;
X
Xiaoyu Wang 已提交
3408
      case 329: /* group_by_list ::= expression */
3409 3410
{ yylhsminor.yy194 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy46))); }
  yymsp[0].minor.yy194 = yylhsminor.yy194;
3411
        break;
X
Xiaoyu Wang 已提交
3412
      case 330: /* group_by_list ::= group_by_list NK_COMMA expression */
3413 3414
{ yylhsminor.yy194 = addNodeToList(pCxt, yymsp[-2].minor.yy194, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy46))); }
  yymsp[-2].minor.yy194 = yylhsminor.yy194;
3415
        break;
X
Xiaoyu Wang 已提交
3416
      case 333: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
3417
{ 
3418 3419 3420
                                                                                    yylhsminor.yy46 = addOrderByClause(pCxt, yymsp[-3].minor.yy46, yymsp[-2].minor.yy194);
                                                                                    yylhsminor.yy46 = addSlimitClause(pCxt, yylhsminor.yy46, yymsp[-1].minor.yy46);
                                                                                    yylhsminor.yy46 = addLimitClause(pCxt, yylhsminor.yy46, yymsp[0].minor.yy46);
3421
                                                                                  }
3422
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
3423
        break;
X
Xiaoyu Wang 已提交
3424
      case 335: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
3425 3426
{ yylhsminor.yy46 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy46, yymsp[0].minor.yy46); }
  yymsp[-3].minor.yy46 = yylhsminor.yy46;
3427
        break;
X
Xiaoyu Wang 已提交
3428 3429
      case 340: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
      case 344: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==344);
3430
{ yymsp[-1].minor.yy46 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
3431
        break;
X
Xiaoyu Wang 已提交
3432 3433
      case 341: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
      case 345: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==345);
3434
{ yymsp[-3].minor.yy46 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
3435
        break;
X
Xiaoyu Wang 已提交
3436 3437
      case 342: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
      case 346: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==346);
3438
{ yymsp[-3].minor.yy46 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
3439
        break;
X
Xiaoyu Wang 已提交
3440
      case 347: /* subquery ::= NK_LP query_expression NK_RP */
3441 3442
{ yylhsminor.yy46 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy46); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3443
        break;
X
Xiaoyu Wang 已提交
3444
      case 351: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
3445 3446
{ yylhsminor.yy46 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy46), yymsp[-1].minor.yy456, yymsp[0].minor.yy273); }
  yymsp[-2].minor.yy46 = yylhsminor.yy46;
3447
        break;
X
Xiaoyu Wang 已提交
3448
      case 352: /* ordering_specification_opt ::= */
3449
{ yymsp[1].minor.yy456 = ORDER_ASC; }
3450
        break;
X
Xiaoyu Wang 已提交
3451
      case 353: /* ordering_specification_opt ::= ASC */
3452
{ yymsp[0].minor.yy456 = ORDER_ASC; }
3453
        break;
X
Xiaoyu Wang 已提交
3454
      case 354: /* ordering_specification_opt ::= DESC */
3455
{ yymsp[0].minor.yy456 = ORDER_DESC; }
3456
        break;
X
Xiaoyu Wang 已提交
3457
      case 355: /* null_ordering_opt ::= */
3458
{ yymsp[1].minor.yy273 = NULL_ORDER_DEFAULT; }
3459
        break;
X
Xiaoyu Wang 已提交
3460
      case 356: /* null_ordering_opt ::= NULLS FIRST */
3461
{ yymsp[-1].minor.yy273 = NULL_ORDER_FIRST; }
3462
        break;
X
Xiaoyu Wang 已提交
3463
      case 357: /* null_ordering_opt ::= NULLS LAST */
3464
{ yymsp[-1].minor.yy273 = NULL_ORDER_LAST; }
3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496
        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 已提交
3497 3498
  ParseARG_FETCH
  ParseCTX_FETCH
3499 3500 3501 3502 3503 3504 3505 3506 3507 3508
#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 已提交
3509 3510
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3511 3512 3513 3514 3515 3516 3517 3518 3519
}
#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 已提交
3520
  ParseTOKENTYPE yyminor         /* The minor type of the error token */
3521
){
X
Xiaoyu Wang 已提交
3522 3523
  ParseARG_FETCH
  ParseCTX_FETCH
3524 3525
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
3526 3527 3528 3529 3530 3531 3532 3533

  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;
3534 3535
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
3536 3537
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3538 3539 3540 3541 3542 3543 3544 3545
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
3546 3547
  ParseARG_FETCH
  ParseCTX_FETCH
3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560
#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 已提交
3561 3562
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3563 3564 3565 3566
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
3567
** "ParseAlloc" which describes the current state of the parser.
3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583
** 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 已提交
3584
void Parse(
3585 3586
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
3587 3588
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
3589 3590 3591 3592 3593 3594 3595 3596 3597 3598
){
  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 已提交
3599 3600
  ParseCTX_FETCH
  ParseARG_STORE
3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624

  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 已提交
3625
                        yyminor ParseCTX_PARAM);
3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 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
    }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 已提交
3758
int ParseFallback(int iToken){
3759 3760 3761 3762 3763 3764 3765 3766 3767
#ifdef YYFALLBACK
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
#else
  (void)iToken;
#endif
  return 0;
}