sql.c 180.2 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 35
/*
** 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>

#include "nodes.h"
X
Xiaoyu Wang 已提交
36
#include "parToken.h"
37
#include "ttokendef.h"
X
Xiaoyu Wang 已提交
38
#include "parAst.h"
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
/**************** 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 已提交
62
**    ParseTOKENTYPE     is the data type used for minor type for terminal
63 64 65 66 67 68 69 70 71 72
**                       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 已提交
73
**                       which is ParseTOKENTYPE.  The entry in the union
74 75 76
**                       for terminal symbols is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
**                       zero the stack is dynamically sized using realloc()
X
Xiaoyu Wang 已提交
77 78 79 80 81 82
**    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
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
**    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 已提交
101
#define YYCODETYPE unsigned short int
X
Xiaoyu Wang 已提交
102
#define YYNOCODE 258
103
#define YYACTIONTYPE unsigned short int
X
Xiaoyu Wang 已提交
104
#define ParseTOKENTYPE  SToken 
105 106
typedef union {
  int yyinit;
X
Xiaoyu Wang 已提交
107
  ParseTOKENTYPE yy0;
X
Xiaoyu Wang 已提交
108
  ENullOrder yy73;
X
Xiaoyu Wang 已提交
109 110 111 112 113 114
  SNodeList* yy136;
  SNode* yy140;
  EJoinType yy144;
  SToken yy149;
  EOrder yy158;
  int32_t yy160;
X
Xiaoyu Wang 已提交
115
  SAlterOption yy233;
X
Xiaoyu Wang 已提交
116 117 118 119
  SDataType yy256;
  EFillMode yy306;
  EOperatorType yy320;
  bool yy497;
120 121 122 123
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
X
Xiaoyu Wang 已提交
124 125 126 127 128 129 130 131 132 133
#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 已提交
134 135
#define YYNSTATE             427
#define YYNRULE              337
X
Xiaoyu Wang 已提交
136
#define YYNTOKEN             163
X
Xiaoyu Wang 已提交
137 138 139 140 141 142 143 144
#define YY_MAX_SHIFT         426
#define YY_MIN_SHIFTREDUCE   659
#define YY_MAX_SHIFTREDUCE   995
#define YY_ERROR_ACTION      996
#define YY_ACCEPT_ACTION     997
#define YY_NO_ACTION         998
#define YY_MIN_REDUCE        999
#define YY_MAX_REDUCE        1335
145 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
/************* 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 已提交
211
#define YY_ACTTAB_COUNT (1266)
212
static const YYACTIONTYPE yy_action[] = {
X
Xiaoyu Wang 已提交
213 214
 /*     0 */  1042, 1201,  222,   43,   24,  168,  359, 1197, 1203, 1092,
 /*    10 */   247,  266,   89,   31,   29,   27,   26,   25,   20, 1201,
X
Xiaoyu Wang 已提交
215
 /*    20 */  1098,   27,   26,   25, 1081, 1197, 1202, 1103,   31,   29,
X
Xiaoyu Wang 已提交
216 217
 /*    30 */    27,   26,   25,  358,  997,   78,  206,  866,   77,   76,
 /*    40 */    75,   74,   73,   72,   71,   70,   69, 1088,  208,  411,
X
Xiaoyu Wang 已提交
218 219
 /*    50 */   410,  409,  408,  407,  406,  405,  404,  403,  402,  401,
 /*    60 */   400,  399,  398,  397,  396,  395,  394,  393, 1000,  105,
X
Xiaoyu Wang 已提交
220 221
 /*    70 */   267, 1011,  878,   31,   29,   27,   26,   25, 1228,  131,
 /*    80 */   901,  346,  111,  246,  234,  343, 1213, 1177,  272,   78,
X
Xiaoyu Wang 已提交
222
 /*    90 */   130,   22,   77,   76,   75,   74,   73,   72,   71,   70,
X
Xiaoyu Wang 已提交
223 224 225 226
 /*   100 */    69,   31,   29,   27,   26,   25, 1228, 1314,  208,  288,
 /*   110 */   317,  283,  267,  343,  287,   44,  902,  286,  128,  284,
 /*   120 */   117,  342,  285,  345, 1312,   23,  229, 1189,  896,  897,
 /*   130 */   898,  899,  900,  904,  905,  906, 1079,  201, 1214, 1217,
X
Xiaoyu Wang 已提交
227 228
 /*   140 */   901,  769,  382,  381,  380,  773,  379,  775,  776,  378,
 /*   150 */   778,  375,  109,  784,  372,  786,  787,  369,  366, 1148,
X
Xiaoyu Wang 已提交
229 230 231
 /*   160 */  1213,  846,  127, 1141,  302,  221,  125,   43,  323,  186,
 /*   170 */  1146,  358, 1133,   30,   28,  938,  902,  844,  255,  239,
 /*   180 */  1228,  231,  392,  846, 1099,   23,  229,  343,  896,  897,
X
Xiaoyu Wang 已提交
232
 /*   190 */   898,  899,  900,  904,  905,  906, 1201,  345,  358,  844,
X
Xiaoyu Wang 已提交
233 234
 /*   200 */   893, 1189, 1197, 1202,  303,  359,  331,  845,   12,  118,
 /*   210 */    66,   61, 1214, 1217, 1253, 1213,  962,  276,  207, 1249,
X
Xiaoyu Wang 已提交
235
 /*   220 */  1165,   10,  122,  121,   30,   28, 1103,  120, 1314,  845,
X
Xiaoyu Wang 已提交
236 237
 /*   230 */  1314,    1,  231,  423,  846, 1228,  313,  960,  961,  963,
 /*   240 */   964,  117,  330,  117, 1213, 1312,  242, 1312,   10,  321,
X
Xiaoyu Wang 已提交
238 239
 /*   250 */   844,  334,  345, 1168, 1170,  423, 1189,  346,  696,   12,
 /*   260 */   695,  847,  850, 1178, 1228,  359,   62, 1214, 1217, 1253,
X
Xiaoyu Wang 已提交
240 241 242 243
 /*   270 */    66,  330,  280,  224, 1249,  112,  279,  282,  697,  327,
 /*   280 */   845,  345,    1,  847,  850, 1189, 1103,  164,  118,    9,
 /*   290 */     8,   59, 1213,  309, 1280,   62, 1214, 1217, 1253,  281,
 /*   300 */    92,   93,  224, 1249,  112, 1314,  423,  327, 1095,  106,
X
Xiaoyu Wang 已提交
244 245 246 247
 /*   310 */  1070,  903, 1228,   31,   29,   27,   26,   25, 1313,  343,
 /*   320 */    21, 1213, 1312, 1281,  392, 1267,   90,  868,   92,  345,
 /*   330 */   907,  419,  418, 1189,  847,  850,  114, 1260, 1261,  867,
 /*   340 */  1265, 1228, 1264,   62, 1214, 1217, 1253,  331,  343,  118,
X
Xiaoyu Wang 已提交
248 249 250
 /*   350 */   224, 1249, 1326,  695,   90, 1094, 1213,  864,  345,  914,
 /*   360 */  1228, 1287, 1189,  865,  161, 1260,  326,  343,  325,  274,
 /*   370 */   235, 1314,   62, 1214, 1217, 1253, 1228,  359,  104,  224,
X
Xiaoyu Wang 已提交
251 252
 /*   380 */  1249, 1326, 1100,  343,  117, 1213, 1105,  385, 1312, 1022,
 /*   390 */  1310, 1090,  320,  345,   30,   28, 1189, 1189, 1103, 1021,
X
Xiaoyu Wang 已提交
253 254 255 256 257 258 259 260
 /*   400 */  1267,  333,  231,  104,  846, 1228, 1080,   62, 1214, 1217,
 /*   410 */  1253, 1106,  343, 1148,  224, 1249, 1326, 1263,  359,  236,
 /*   420 */   844, 1148,  345,  356, 1146, 1271, 1189,  243,  163,   12,
 /*   430 */  1189,  331, 1146,   30,   28, 1012,  196, 1214, 1217, 1103,
 /*   440 */  1189,  231, 1213,  846,  191, 1020, 1019, 1018,  136,  193,
 /*   450 */   845,  134,    1, 1038,  316, 1314,   30,   28,  344,  844,
 /*   460 */     6,  192, 1228,  389,  231, 1213,  846,  388,  117,  343,
 /*   470 */  1017,  123, 1312, 1148,  118,  289,  423,  322,  318,  345,
X
Xiaoyu Wang 已提交
261 262 263 264
 /*   480 */  1016, 1015,  844, 1189, 1169, 1228, 1189, 1189, 1189,  845,
 /*   490 */   390,    7,  343,   63, 1214, 1217, 1253, 1148,  869, 1086,
 /*   500 */  1252, 1249,  345, 1045,  847,  850, 1189,  945, 1147,  387,
 /*   510 */   386, 1189,  845,  866,    7,  423,   63, 1214, 1217, 1253,
X
Xiaoyu Wang 已提交
265 266 267 268 269
 /*   520 */   241, 1189, 1189,  341, 1249,   30,   28,  300,  104,   30,
 /*   530 */    28,   64,  384,  231,  338,  846, 1105,  231,  423,  846,
 /*   540 */   298, 1213, 1267,  847,  850,  999,   31,   29,   27,   26,
 /*   550 */    25,  844,  288,  933,  283,  844, 1014,  287,  118, 1262,
 /*   560 */   286, 1228,  284,  118, 1213,  285,  847,  850,  343,   87,
X
Xiaoyu Wang 已提交
270
 /*   570 */    86,   85,   84,   83,   82,   81,   80,   79,  345,  864,
X
Xiaoyu Wang 已提交
271 272 273 274 275
 /*   580 */  1033,  845, 1189,    7, 1228,  845,  248,    1, 1071,  260,
 /*   590 */  1013,  343,  107, 1214, 1217,  937,  426, 1189,  261,  149,
 /*   600 */  1213,  345,  291,  165,  359, 1189,  244,  423,  339,  357,
 /*   610 */   184,  423,  305,   88,  104,   63, 1214, 1217, 1253,  415,
 /*   620 */  1228,  183, 1105, 1250,   98, 1103, 1010,  343,  314,  332,
X
Xiaoyu Wang 已提交
276
 /*   630 */  1327, 1189, 1031, 1009, 1008,  847,  850,  345,  359,  847,
X
Xiaoyu Wang 已提交
277 278 279 280
 /*   640 */   850, 1189, 1142,  181,  230,  359,   60, 1007, 1006,  179,
 /*   650 */   245,  202, 1214, 1217,  294, 1005,  158, 1004, 1213, 1103,
 /*   660 */  1272,  933, 1229, 1213,  273,  259, 1103, 1189,  254,  253,
 /*   670 */   252,  251,  250,  335, 1189, 1189, 1003,  853, 1228,  138,
X
Xiaoyu Wang 已提交
281
 /*   680 */   355, 1213,  137, 1228,  140,  343, 1213,  139, 1189, 1189,
X
Xiaoyu Wang 已提交
282 283
 /*   690 */   343,  852,  991,  992,  308,  345, 1189,  146, 1189, 1189,
 /*   700 */   345, 1228,  310,  327, 1189,  328, 1228,  856,  343,  202,
X
Xiaoyu Wang 已提交
284
 /*   710 */  1214, 1217, 1002,  343,  107, 1214, 1217, 1189,  345,    9,
X
Xiaoyu Wang 已提交
285 286
 /*   720 */     8,  855, 1189,  345,   92,  228,  864, 1189, 1213,  936,
 /*   730 */   232, 1213,  202, 1214, 1217, 1283, 1213,  202, 1214, 1217,
X
Xiaoyu Wang 已提交
287
 /*   740 */    31,   29,   27,   26,   25,  336,  327, 1167, 1228,   52,
X
Xiaoyu Wang 已提交
288
 /*   750 */    90, 1228, 1328, 1189,  167,  343, 1228, 1078,  343,  329,
X
Xiaoyu Wang 已提交
289
 /*   760 */   113, 1260, 1261,  343, 1265,  345, 1096,   92,  345, 1189,
X
Xiaoyu Wang 已提交
290 291 292
 /*   770 */     2,  119, 1189,  345, 1213,  142,  257, 1189,  141,  200,
 /*   780 */  1214, 1217,  203, 1214, 1217,  959,  154,  194, 1214, 1217,
 /*   790 */   249,  256,  258,   90, 1228,  262, 1213,   41,  152,  878,
X
Xiaoyu Wang 已提交
293
 /*   800 */   908,  343, 1213,  115, 1260, 1261,  872, 1265,  994,  995,
X
Xiaoyu Wang 已提交
294 295 296 297 298 299 300
 /*   810 */   263,  345,   32,  264,  389, 1189, 1228,  124,  388,  871,
 /*   820 */   875,   58, 1228,  343,   42,  204, 1214, 1217, 1207,  343,
 /*   830 */  1213,   54,   32,  345,  839,  265, 1213, 1189,  268,  345,
 /*   840 */  1205,  390,  129, 1189,  275,  870,   32,  195, 1214, 1217,
 /*   850 */  1228,  277,   68,  205, 1214, 1217, 1228,  343,  173, 1093,
 /*   860 */   387,  386,  220,  343, 1213,  133,  351,  345,  178, 1089,
 /*   870 */   171, 1189,  135,  345,  762,  100,  101, 1189,   95, 1091,
X
Xiaoyu Wang 已提交
301 302
 /*   880 */    96, 1225, 1214, 1217, 1228, 1087,   98, 1224, 1214, 1217,
 /*   890 */   757,  343, 1213,  102,  790,  794,  103,  800, 1213,  799,
X
Xiaoyu Wang 已提交
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
 /*   900 */   307,  345,   41,  304,  145, 1189,  364,   96,   99,   97,
 /*   910 */   306,   98, 1228,  869,  315, 1223, 1214, 1217, 1228,  343,
 /*   920 */    96, 1284,  349, 1294,  150,  343,  312,  850, 1293,  345,
 /*   930 */   153,  223, 1213, 1189,  319,  345,    5,  110, 1274, 1189,
 /*   940 */  1213,  324,  157,  211, 1214, 1217,  238,  237,  311,  210,
 /*   950 */  1214, 1217, 1228,    4,  933,   91,  858,  868, 1268,  343,
 /*   960 */  1228,   33,  159,  160, 1311,  225, 1329,  343, 1213,  345,
 /*   970 */   337,  340,  851, 1189,  293,  215,  166,  345,   17, 1235,
 /*   980 */  1176, 1189,  347,  212, 1214, 1217,  348,  233, 1228,  301,
 /*   990 */  1175,  209, 1214, 1217,  352,  343,  353,  280,  354,  175,
 /*  1000 */    51,  279,  854,  144,  185,  345,  296,  187,   53, 1189,
 /*  1010 */  1104,  290,  182,  216,  143,  214,  213,  422,  278,  199,
 /*  1020 */  1214, 1217,  362,  197,  281,  198,  189,  190,  360, 1183,
 /*  1030 */   822, 1160, 1159,   94, 1158, 1157, 1156, 1155, 1154,   40,
 /*  1040 */  1153,  824,   39, 1152, 1151, 1150, 1149, 1044, 1182, 1173,
 /*  1050 */   126, 1082,  708, 1043, 1041,  269,  859,  850,  270,  271,
 /*  1060 */  1030, 1029, 1026, 1084,   67,  132,  805, 1083,  804, 1039,
 /*  1070 */  1034,  737,  803, 1032, 1025, 1024, 1181,  736,  217,  735,
 /*  1080 */   734,  218, 1180,   36, 1172,   45,  219,  148,  297,    3,
 /*  1090 */   733,   65,   32,  732,  299,   14,  292,  151,  958,   15,
 /*  1100 */  1205,  147,  162,  295,   37,   11,  156,   19,   34,   48,
 /*  1110 */     8,  350,  894, 1171,  177,  998,  998,  998,  998,  998,
 /*  1120 */   998,  783,  998,  998,  998,  998,  998,  998,  980,  979,
 /*  1130 */   226,  984,  983,  227,  860,  998,  998,  998,  108,  998,
 /*  1140 */   998,  176,  998,  998,  998,  998,  998,  155,  998,  952,
 /*  1150 */    46,  998,  951,   47,  998,  768,  930,  929,  998,  985,
 /*  1160 */   998,  998,   35,  998,  998,  998,  998,  998,  876,  116,
 /*  1170 */    13,   18,   16,  170,  956,  998,  172,  174,  169,   49,
 /*  1180 */    50, 1204,  998,  998,   54,   38,  363, 1040,  240,  367,
 /*  1190 */  1028,  370,  373,  180,  998,  361,  998,  796,  376,  998,
 /*  1200 */   791,  365,  728,  788,  368, 1027,  785,  998,  798,  371,
 /*  1210 */   420,  720,  797,  779,  998,  998,  998,  727,  782,  998,
 /*  1220 */   726,  998,  998,  725,  724,  706,  781,  374,  391,  777,
 /*  1230 */   723,  722,  721,  377,  719, 1023,  718,  717,  413,  716,
 /*  1240 */   383,   55,   56,   57,  425,  715,  729,  714,  713,  421,
 /*  1250 */   712,  711,  412,  848,  188,  424,  998,  416,  417,  998,
 /*  1260 */   998,  414,  998,  998,  998,  780,
340 341
};
static const YYCODETYPE yy_lookahead[] = {
X
Xiaoyu Wang 已提交
342 343 344 345 346
 /*     0 */     0,  207,  190,  174,  221,  222,  172,  213,  214,  187,
 /*    10 */   172,  177,  183,   12,   13,   14,   15,   16,    2,  207,
 /*    20 */   191,   14,   15,   16,    0,  213,  214,  193,   12,   13,
 /*    30 */    14,   15,   16,   20,  163,   21,  198,   20,   24,   25,
 /*    40 */    26,   27,   28,   29,   30,   31,   32,  187,   47,   49,
X
Xiaoyu Wang 已提交
347
 /*    50 */    50,   51,   52,   53,   54,   55,   56,   57,   58,   59,
X
Xiaoyu Wang 已提交
348 349 350 351 352 353 354 355
 /*    60 */    60,   61,   62,   63,   64,   65,   66,   67,    0,  165,
 /*    70 */    46,  167,   71,   12,   13,   14,   15,   16,  186,   33,
 /*    80 */    79,  203,   36,  212,  206,  193,  166,  209,   42,   21,
 /*    90 */    44,    2,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   100 */    32,   12,   13,   14,   15,   16,  186,  236,   47,   49,
 /*   110 */   218,   51,   46,  193,   54,   69,  115,   57,   72,   59,
 /*   120 */   249,   47,   62,  203,  253,  124,  125,  207,  127,  128,
 /*   130 */   129,  130,  131,  132,  133,  134,    0,  217,  218,  219,
X
Xiaoyu Wang 已提交
356
 /*   140 */    79,   85,   86,   87,   88,   89,   90,   91,   92,   93,
X
Xiaoyu Wang 已提交
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
 /*   150 */    94,   95,  185,   97,   98,   99,  100,  101,  102,  186,
 /*   160 */   166,   22,  116,  196,  172,  192,  120,  174,  248,  179,
 /*   170 */   197,   20,  182,   12,   13,   14,  115,   38,   63,  190,
 /*   180 */   186,   20,   46,   22,  191,  124,  125,  193,  127,  128,
 /*   190 */   129,  130,  131,  132,  133,  134,  207,  203,   20,   38,
 /*   200 */   126,  207,  213,  214,  212,  172,  212,   68,   47,  137,
 /*   210 */   177,  217,  218,  219,  220,  166,  126,  184,  224,  225,
 /*   220 */   193,   70,  107,  108,   12,   13,  193,  200,  236,   68,
 /*   230 */   236,   70,   20,   94,   22,  186,  146,  147,  148,  149,
 /*   240 */   150,  249,  193,  249,  166,  253,  195,  253,   70,   20,
 /*   250 */    38,    3,  203,  202,  203,   94,  207,  203,   20,   47,
 /*   260 */    22,  122,  123,  209,  186,  172,  217,  218,  219,  220,
 /*   270 */   177,  193,   57,  224,  225,  226,   61,  184,   40,  172,
 /*   280 */    68,  203,   70,  122,  123,  207,  193,  238,  137,    1,
 /*   290 */     2,  171,  166,  244,  245,  217,  218,  219,  220,   84,
 /*   300 */   193,  181,  224,  225,  226,  236,   94,  172,  188,  175,
 /*   310 */   176,  115,  186,   12,   13,   14,   15,   16,  249,  193,
 /*   320 */   124,  166,  253,  245,   46,  215,  219,   20,  193,  203,
 /*   330 */   134,  169,  170,  207,  122,  123,  229,  230,  231,   20,
 /*   340 */   233,  186,  232,  217,  218,  219,  220,  212,  193,  137,
 /*   350 */   224,  225,  226,   22,  219,  166,  166,   20,  203,   71,
 /*   360 */   186,  235,  207,   20,  229,  230,  231,  193,  233,   38,
 /*   370 */   178,  236,  217,  218,  219,  220,  186,  172,  186,  224,
 /*   380 */   225,  226,  177,  193,  249,  166,  194,   81,  253,  166,
 /*   390 */   235,  187,  218,  203,   12,   13,  207,  207,  193,  166,
 /*   400 */   215,  153,   20,  186,   22,  186,    0,  217,  218,  219,
 /*   410 */   220,  194,  193,  186,  224,  225,  226,  232,  172,  192,
 /*   420 */    38,  186,  203,  177,  197,  235,  207,  192,  121,   47,
 /*   430 */   207,  212,  197,   12,   13,  167,  217,  218,  219,  193,
 /*   440 */   207,   20,  166,   22,   18,  166,  166,  166,   74,   23,
 /*   450 */    68,   77,   70,    0,  119,  236,   12,   13,   14,   38,
 /*   460 */    43,   35,  186,   57,   20,  166,   22,   61,  249,  193,
 /*   470 */   166,   45,  253,  186,  137,   22,   94,  142,  143,  203,
 /*   480 */   166,  166,   38,  207,  197,  186,  207,  207,  207,   68,
 /*   490 */    84,   70,  193,  217,  218,  219,  220,  186,   20,  187,
 /*   500 */   224,  225,  203,    0,  122,  123,  207,   14,  197,  103,
 /*   510 */   104,  207,   68,   20,   70,   94,  217,  218,  219,  220,
 /*   520 */   178,  207,  207,  224,  225,   12,   13,   21,  186,   12,
 /*   530 */    13,  105,  187,   20,   83,   22,  194,   20,   94,   22,
 /*   540 */    34,  166,  215,  122,  123,    0,   12,   13,   14,   15,
 /*   550 */    16,   38,   49,  136,   51,   38,  166,   54,  137,  232,
 /*   560 */    57,  186,   59,  137,  166,   62,  122,  123,  193,   24,
 /*   570 */    25,   26,   27,   28,   29,   30,   31,   32,  203,   20,
 /*   580 */     0,   68,  207,   70,  186,   68,   27,   70,  176,   30,
 /*   590 */   166,  193,  217,  218,  219,    4,   19,  207,   39,  121,
 /*   600 */   166,  203,   22,  256,  172,  207,  178,   94,  157,  177,
 /*   610 */    33,   94,   71,   36,  186,  217,  218,  219,  220,   42,
 /*   620 */   186,   44,  194,  225,   83,  193,  166,  193,  247,  254,
 /*   630 */   255,  207,    0,  166,  166,  122,  123,  203,  172,  122,
 /*   640 */   123,  207,  196,  177,  210,  172,   69,  166,  166,   72,
 /*   650 */   177,  217,  218,  219,   22,  166,  241,  166,  166,  193,
 /*   660 */   135,  136,  186,  166,  169,  106,  193,  207,  109,  110,
 /*   670 */   111,  112,  113,   83,  207,  207,  166,   38,  186,   74,
 /*   680 */   103,  166,   77,  186,   74,  193,  166,   77,  207,  207,
 /*   690 */   193,   38,  158,  159,  117,  203,  207,  120,  207,  207,
 /*   700 */   203,  186,  210,  172,  207,  234,  186,   68,  193,  217,
 /*   710 */   218,  219,  166,  193,  217,  218,  219,  207,  203,    1,
 /*   720 */     2,   68,  207,  203,  193,  210,   20,  207,  166,  138,
 /*   730 */   210,  166,  217,  218,  219,  216,  166,  217,  218,  219,
 /*   740 */    12,   13,   14,   15,   16,  155,  172,  172,  186,  171,
 /*   750 */   219,  186,  255,  207,  250,  193,  186,    0,  193,  228,
 /*   760 */   229,  230,  231,  193,  233,  203,  188,  193,  203,  207,
 /*   770 */   237,  114,  207,  203,  166,   74,  115,  207,   77,  217,
 /*   780 */   218,  219,  217,  218,  219,   71,   71,  217,  218,  219,
 /*   790 */   201,  199,  199,  219,  186,  172,  166,   83,   83,   71,
 /*   800 */    71,  193,  166,  229,  230,  231,   20,  233,  161,  162,
 /*   810 */   211,  203,   83,  193,   57,  207,  186,  174,   61,   20,
 /*   820 */    71,   70,  186,  193,  174,  217,  218,  219,   70,  193,
 /*   830 */   166,   80,   83,  203,   71,  204,  166,  207,  172,  203,
 /*   840 */    82,   84,  174,  207,  168,   20,   83,  217,  218,  219,
 /*   850 */   186,  186,  172,  217,  218,  219,  186,  193,   71,  186,
 /*   860 */   103,  104,  168,  193,  166,  186,   71,  203,   71,  186,
 /*   870 */    83,  207,  186,  203,   71,  186,  186,  207,   83,  186,
 /*   880 */    83,  217,  218,  219,  186,  186,   83,  217,  218,  219,
 /*   890 */    71,  193,  166,  186,   71,   71,  186,   71,  166,   71,
 /*   900 */   204,  203,   83,  211,  171,  207,   83,   83,   71,   83,
 /*   910 */   193,   83,  186,   20,  145,  217,  218,  219,  186,  193,
 /*   920 */    83,  216,  144,  246,  208,  193,  207,  123,  246,  203,
X
Xiaoyu Wang 已提交
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
 /*   930 */   208,  207,  166,  207,  207,  203,  152,  240,  243,  207,
 /*   940 */   166,  151,  242,  217,  218,  219,   12,   13,  140,  217,
 /*   950 */   218,  219,  186,  139,  136,  193,   22,   20,  215,  193,
 /*   960 */   186,  114,  239,  227,  252,  160,  257,  193,  166,  203,
 /*   970 */   154,  156,   38,  207,    4,   35,  251,  203,   70,  223,
 /*   980 */   208,  207,  207,  217,  218,  219,  207,  207,  186,   19,
 /*   990 */   208,  217,  218,  219,  118,  193,  205,   57,  204,  193,
 /*  1000 */   171,   61,   68,   33,  182,  203,   36,  172,   70,  207,
 /*  1010 */   193,   41,  171,   73,   44,   75,   76,  168,   78,  217,
 /*  1020 */   218,  219,  189,  180,   84,  180,  173,  164,   94,    0,
 /*  1030 */    82,    0,    0,  114,    0,    0,    0,    0,    0,   69,
 /*  1040 */     0,   22,   72,    0,    0,    0,    0,    0,    0,    0,
 /*  1050 */    43,    0,   48,    0,    0,   38,  122,  123,   36,   43,
 /*  1060 */     0,    0,    0,    0,   79,   77,   38,    0,   38,    0,
 /*  1070 */     0,   38,   22,    0,    0,    0,    0,   38,   22,   38,
 /*  1080 */    38,   22,    0,  121,    0,   70,   22,  116,   22,   83,
 /*  1090 */    38,   20,   83,   38,   22,  141,   39,   71,   71,  141,
 /*  1100 */    82,   43,   82,   38,   83,  141,   83,   83,  135,    4,
 /*  1110 */     2,  119,  126,    0,  116,  258,  258,  258,  258,  258,
 /*  1120 */   258,   96,  258,  258,  258,  258,  258,  258,   38,   38,
 /*  1130 */    38,   38,   38,   38,   22,  258,  258,  258,   70,  258,
 /*  1140 */   258,   43,  258,  258,  258,  258,  258,   70,  258,   71,
 /*  1150 */    70,  258,   71,   70,  258,   22,   71,   71,  258,   71,
 /*  1160 */   258,  258,   83,  258,  258,  258,  258,  258,   71,   82,
 /*  1170 */    70,   70,   83,   71,   71,  258,   70,   70,   82,   70,
 /*  1180 */    70,   82,  258,  258,   80,   70,   38,    0,   38,   38,
 /*  1190 */     0,   38,   38,   82,  258,   81,  258,   22,   38,  258,
 /*  1200 */    71,   70,   22,   71,   70,    0,   71,  258,   38,   70,
 /*  1210 */    22,   22,   38,   71,  258,  258,  258,   38,   96,  258,
 /*  1220 */    38,  258,  258,   38,   38,   48,   96,   70,   47,   71,
 /*  1230 */    38,   38,   38,   70,   38,    0,   38,   38,   36,   38,
 /*  1240 */    84,   70,   70,   70,   20,   38,   68,   38,   38,   21,
 /*  1250 */    38,   38,   38,   22,   22,   21,  258,   38,   37,  258,
 /*  1260 */   258,   43,  258,  258,  258,   96,  258,  258,  258,  258,
X
Xiaoyu Wang 已提交
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483
 /*  1270 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1280 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1290 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1300 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1310 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1320 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1330 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1340 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1350 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1360 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1370 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1380 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1390 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1400 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
 /*  1410 */   258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
X
Xiaoyu Wang 已提交
484
 /*  1420 */   258,  258,  258,  258,  258,  258,  258,  258,  258,
485
};
X
Xiaoyu Wang 已提交
486
#define YY_SHIFT_COUNT    (426)
487
#define YY_SHIFT_MIN      (0)
X
Xiaoyu Wang 已提交
488
#define YY_SHIFT_MAX      (1235)
489
static const unsigned short int yy_shift_ofst[] = {
X
Xiaoyu Wang 已提交
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504
 /*     0 */   426,  212,  161,  382,  382,  382,  382,  421,  382,  382,
 /*    10 */   151,  513,  517,  444,  513,  513,  513,  513,  513,  513,
 /*    20 */   513,  513,  513,  513,  513,  513,  513,  513,  513,  513,
 /*    30 */   513,  513,  513,  178,  178,  178,  337,  934,  934,   13,
 /*    40 */    13,  934,   13,   13,   66,   17,  229,  229,   72,  319,
 /*    50 */    17,   13,   13,   17,   13,   17,  319,   17,   17,   13,
 /*    60 */   278,    1,   61,   61,  559,   14,  940,  139,   60,  139,
 /*    70 */   139,  139,  139,  139,  139,  139,  139,  139,  139,  139,
 /*    80 */   139,  139,  139,  139,  139,  139,  139,  139,  238,   24,
 /*    90 */   307,  307,  307,  136,  343,  319,   17,   17,   17,  306,
 /*   100 */    56,   56,   56,   56,   56,   68,  503,  534,   90,  215,
 /*   110 */   335,  331,  478,  525,  417,  525,  493,  248,  591,  706,
 /*   120 */   657,  661,  661,  706,  786,   66,  343,  799,   66,  706,
 /*   130 */    66,  825,   17,   17,   17,   17,   17,   17,   17,   17,
 /*   140 */    17,   17,   17,  706,  825,  786,  278,  343,  799,  893,
X
Xiaoyu Wang 已提交
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
 /*   150 */   769,  778,  804,  769,  778,  804,  804,  784,  790,  808,
 /*   160 */   814,  818,  343,  937,  847,  805,  815,  816,  908,   17,
 /*   170 */   778,  804,  804,  778,  804,  876,  343,  799,  306,  278,
 /*   180 */   343,  938,  706,  278,  825, 1266, 1266, 1266, 1266,    0,
 /*   190 */   545,  577,   46,  970,   16,   89,  728,  406,  757,  301,
 /*   200 */   301,  301,  301,  301,  301,  301,  115,  288,  196,    7,
 /*   210 */     7,    7,    7,  374,  605,  610,  701,  453,  580,  632,
 /*   220 */   506,  541,  714,  715,  718,  647,  590,  451,  729,   74,
 /*   230 */   749,  758,  763,  787,  795,  797,  803,  639,  653,  819,
 /*   240 */   823,  824,  826,  828,  837,  751, 1029,  948, 1031, 1032,
 /*   250 */   919, 1034, 1035, 1036, 1037, 1038, 1040, 1019, 1043, 1044,
 /*   260 */  1045, 1046, 1047, 1048, 1049, 1007, 1051, 1004, 1053, 1054,
 /*   270 */  1017, 1022, 1016, 1060, 1061, 1062, 1063,  985,  988, 1028,
 /*   280 */  1030, 1050, 1067, 1033, 1039, 1041, 1042, 1052, 1055, 1069,
 /*   290 */  1056, 1070, 1059, 1057, 1073, 1064, 1065, 1074, 1066, 1075,
 /*   300 */  1072, 1071, 1076, 1082,  962, 1084, 1015, 1058,  971, 1006,
 /*   310 */  1009,  954, 1026, 1021, 1027, 1068, 1077, 1078, 1080, 1081,
 /*   320 */  1023, 1018, 1083, 1024,  958, 1085, 1086, 1020,  973, 1079,
 /*   330 */  1087, 1088, 1089,  964, 1105, 1090, 1091, 1092, 1093, 1094,
 /*   340 */  1095, 1108,  986, 1096, 1097, 1100, 1101, 1102, 1103, 1106,
 /*   350 */  1107,  992, 1109, 1113, 1098,  998, 1110, 1104, 1099, 1111,
 /*   360 */  1112, 1115, 1114, 1129, 1148, 1150, 1131, 1132, 1151, 1134,
 /*   370 */  1135, 1153, 1139, 1142, 1154, 1157, 1158, 1160, 1163, 1025,
 /*   380 */  1122, 1130, 1169, 1133, 1156, 1171, 1172, 1173, 1170, 1174,
 /*   390 */  1175, 1177, 1181, 1178, 1180, 1179, 1182, 1185, 1186, 1192,
 /*   400 */  1193, 1194, 1189, 1196, 1198, 1199, 1201, 1207, 1209, 1210,
 /*   410 */  1212, 1213, 1187, 1214, 1202, 1218, 1190, 1219, 1221, 1205,
 /*   420 */  1235, 1188, 1228, 1231, 1232, 1234, 1224,
533
};
X
Xiaoyu Wang 已提交
534
#define YY_REDUCE_COUNT (188)
X
Xiaoyu Wang 已提交
535
#define YY_REDUCE_MIN   (-217)
X
Xiaoyu Wang 已提交
536
#define YY_REDUCE_MAX   (863)
537
static const short yy_reduce_ofst[] = {
X
Xiaoyu Wang 已提交
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552
 /*     0 */  -129,   -6,   49,   78,  126,  155,  190,  219,  276,  299,
 /*    10 */   135,  375,  398,  434,  492,  -80,  497,  515,  520,  562,
 /*    20 */   565,  570,  608,  630,  636,  664,  670,  698,  726,  732,
 /*    30 */   766,  774,  802,  531,  107,  574,   -8, -188,  -11,   33,
 /*    40 */    93, -206, -166,  205, -171,  -27, -108,  174,   69, -122,
 /*    50 */   192,  246,  432,  227,  466,  342,   51,  235,  428,  473,
 /*    60 */   120, -217, -217, -217, -162,  -96,  -33,  189,  134,  223,
 /*    70 */   233,  279,  280,  281,  304,  314,  315,  390,  424,  460,
 /*    80 */   467,  468,  481,  482,  489,  491,  510,  546,  162,   -7,
 /*    90 */   110,  185,  327,  578,   27,   54,  217,  287,  311,  -10,
 /*   100 */  -178, -140,  204,  312,  345,  268,  412,  347,  381,  446,
 /*   110 */   415,  495,  519,  471,  471,  471,  476,  504,  533,  575,
 /*   120 */   589,  592,  593,  623,  599,  643,  620,  631,  650,  666,
 /*   130 */   668,  676,  665,  673,  679,  683,  686,  689,  690,  693,
 /*   140 */   699,  707,  710,  680,  694,  692,  733,  717,  696,  705,
X
Xiaoyu Wang 已提交
553 554 555 556
 /*   150 */   677,  716,  719,  682,  722,  724,  727,  695,  700,  697,
 /*   160 */   723,  471,  762,  743,  736,  709,  712,  725,  756,  476,
 /*   170 */   772,  775,  779,  782,  780,  791,  806,  794,  822,  829,
 /*   180 */   817,  833,  835,  841,  849,  843,  845,  853,  863,
557 558
};
static const YYACTIONTYPE yy_default[] = {
X
Xiaoyu Wang 已提交
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573
 /*     0 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*    10 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*    20 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*    30 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*    40 */   996,  996,  996,  996, 1049,  996,  996,  996,  996,  996,
 /*    50 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*    60 */  1047,  996, 1255,  996, 1161,  996,  996,  996,  996,  996,
 /*    70 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*    80 */   996,  996,  996,  996,  996,  996,  996,  996,  996, 1049,
 /*    90 */  1266, 1266, 1266, 1047,  996,  996,  996,  996,  996, 1132,
 /*   100 */   996,  996,  996,  996,  996,  996,  996, 1330,  996, 1085,
 /*   110 */  1290,  996, 1282, 1258, 1272, 1259,  996, 1315, 1275,  996,
 /*   120 */  1166, 1163, 1163,  996,  996, 1049,  996,  996, 1049,  996,
 /*   130 */  1049,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   140 */   996,  996,  996,  996,  996,  996, 1047,  996,  996,  996,
X
Xiaoyu Wang 已提交
574 575 576 577 578 579 580 581 582
 /*   150 */  1297, 1295,  996, 1297, 1295,  996,  996, 1309, 1305, 1288,
 /*   160 */  1286, 1272,  996,  996,  996, 1333, 1321, 1317,  996,  996,
 /*   170 */  1295,  996,  996, 1295,  996, 1174,  996,  996,  996, 1047,
 /*   180 */   996, 1101,  996, 1047,  996, 1135, 1135, 1050, 1001,  996,
 /*   190 */   996,  996,  996,  996,  996,  996,  996,  996,  996, 1227,
 /*   200 */  1308, 1307, 1226, 1232, 1231, 1230,  996,  996,  996, 1221,
 /*   210 */  1222, 1220, 1219,  996,  996,  996,  996,  996,  996,  996,
 /*   220 */   996,  996,  996,  996, 1256,  996, 1318, 1322,  996,  996,
 /*   230 */   996, 1206,  996,  996,  996,  996,  996,  996,  996,  996,
X
Xiaoyu Wang 已提交
583 584 585 586 587 588
 /*   240 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   250 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   260 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   270 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   280 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   290 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
X
Xiaoyu Wang 已提交
589 590
 /*   300 */   996,  996,  996,  996,  996,  996,  996,  996,  996, 1279,
 /*   310 */  1289,  996,  996,  996,  996,  996,  996,  996,  996,  996,
X
Xiaoyu Wang 已提交
591 592 593 594 595 596 597 598 599 600 601
 /*   320 */   996, 1206,  996, 1306,  996, 1265, 1261,  996,  996, 1257,
 /*   330 */   996,  996, 1316,  996,  996,  996,  996,  996,  996,  996,
 /*   340 */   996, 1251,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   350 */   996,  996,  996,  996,  996,  996,  996,  996, 1205,  996,
 /*   360 */   996,  996,  996,  996,  996,  996, 1129,  996,  996,  996,
 /*   370 */   996,  996,  996,  996,  996,  996,  996,  996,  996, 1114,
 /*   380 */  1112, 1111, 1110,  996, 1107,  996,  996,  996,  996,  996,
 /*   390 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   400 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   410 */   996,  996,  996,  996,  996,  996,  996,  996,  996,  996,
 /*   420 */   996,  996,  996,  996,  996,  996,  996,
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658
};
/********** 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 已提交
659 660
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695
#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 已提交
696
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
697 698 699 700 701 702 703 704 705 706 707 708
  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 */ "$",
709 710
  /*    1 */ "OR",
  /*    2 */ "AND",
711 712 713 714 715
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
716 717 718 719 720 721 722 723 724 725
  /*    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",
726
  /*   18 */ "CREATE",
727 728 729
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
730 731 732 733 734 735 736 737 738 739 740 741
  /*   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",
742 743
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 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 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
  /*   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",
  /*   67 */ "FILE_FACTOR",
  /*   68 */ "NK_FLOAT",
  /*   69 */ "TABLE",
  /*   70 */ "NK_LP",
  /*   71 */ "NK_RP",
  /*   72 */ "STABLE",
  /*   73 */ "ADD",
  /*   74 */ "COLUMN",
  /*   75 */ "MODIFY",
  /*   76 */ "RENAME",
  /*   77 */ "TAG",
  /*   78 */ "SET",
  /*   79 */ "NK_EQ",
  /*   80 */ "USING",
  /*   81 */ "TAGS",
  /*   82 */ "NK_DOT",
  /*   83 */ "NK_COMMA",
  /*   84 */ "COMMENT",
  /*   85 */ "BOOL",
  /*   86 */ "TINYINT",
  /*   87 */ "SMALLINT",
  /*   88 */ "INT",
  /*   89 */ "INTEGER",
  /*   90 */ "BIGINT",
  /*   91 */ "FLOAT",
  /*   92 */ "DOUBLE",
  /*   93 */ "BINARY",
  /*   94 */ "TIMESTAMP",
  /*   95 */ "NCHAR",
  /*   96 */ "UNSIGNED",
  /*   97 */ "JSON",
  /*   98 */ "VARCHAR",
  /*   99 */ "MEDIUMBLOB",
  /*  100 */ "BLOB",
  /*  101 */ "VARBINARY",
  /*  102 */ "DECIMAL",
  /*  103 */ "SMA",
  /*  104 */ "ROLLUP",
  /*  105 */ "SHOW",
  /*  106 */ "DATABASES",
  /*  107 */ "TABLES",
  /*  108 */ "STABLES",
  /*  109 */ "MNODES",
  /*  110 */ "MODULES",
  /*  111 */ "QNODES",
  /*  112 */ "FUNCTIONS",
  /*  113 */ "INDEXES",
  /*  114 */ "FROM",
  /*  115 */ "LIKE",
  /*  116 */ "INDEX",
  /*  117 */ "FULLTEXT",
  /*  118 */ "FUNCTION",
  /*  119 */ "INTERVAL",
  /*  120 */ "TOPIC",
  /*  121 */ "AS",
  /*  122 */ "NK_BOOL",
  /*  123 */ "NK_VARIABLE",
  /*  124 */ "BETWEEN",
  /*  125 */ "IS",
  /*  126 */ "NULL",
  /*  127 */ "NK_LT",
  /*  128 */ "NK_GT",
  /*  129 */ "NK_LE",
  /*  130 */ "NK_GE",
  /*  131 */ "NK_NE",
  /*  132 */ "MATCH",
  /*  133 */ "NMATCH",
  /*  134 */ "IN",
  /*  135 */ "JOIN",
  /*  136 */ "INNER",
  /*  137 */ "SELECT",
  /*  138 */ "DISTINCT",
  /*  139 */ "WHERE",
  /*  140 */ "PARTITION",
  /*  141 */ "BY",
  /*  142 */ "SESSION",
  /*  143 */ "STATE_WINDOW",
  /*  144 */ "SLIDING",
  /*  145 */ "FILL",
  /*  146 */ "VALUE",
  /*  147 */ "NONE",
  /*  148 */ "PREV",
  /*  149 */ "LINEAR",
  /*  150 */ "NEXT",
  /*  151 */ "GROUP",
  /*  152 */ "HAVING",
  /*  153 */ "ORDER",
  /*  154 */ "SLIMIT",
  /*  155 */ "SOFFSET",
  /*  156 */ "LIMIT",
  /*  157 */ "OFFSET",
  /*  158 */ "ASC",
  /*  159 */ "DESC",
  /*  160 */ "NULLS",
  /*  161 */ "FIRST",
  /*  162 */ "LAST",
  /*  163 */ "cmd",
  /*  164 */ "account_options",
  /*  165 */ "alter_account_options",
  /*  166 */ "literal",
  /*  167 */ "alter_account_option",
  /*  168 */ "user_name",
  /*  169 */ "dnode_endpoint",
  /*  170 */ "dnode_host_name",
  /*  171 */ "not_exists_opt",
  /*  172 */ "db_name",
  /*  173 */ "db_options",
  /*  174 */ "exists_opt",
  /*  175 */ "alter_db_options",
  /*  176 */ "alter_db_option",
  /*  177 */ "full_table_name",
  /*  178 */ "column_def_list",
  /*  179 */ "tags_def_opt",
  /*  180 */ "table_options",
  /*  181 */ "multi_create_clause",
  /*  182 */ "tags_def",
  /*  183 */ "multi_drop_clause",
  /*  184 */ "alter_table_clause",
  /*  185 */ "alter_table_options",
  /*  186 */ "column_name",
  /*  187 */ "type_name",
  /*  188 */ "create_subtable_clause",
  /*  189 */ "specific_tags_opt",
  /*  190 */ "literal_list",
  /*  191 */ "drop_table_clause",
  /*  192 */ "col_name_list",
  /*  193 */ "table_name",
  /*  194 */ "column_def",
  /*  195 */ "func_name_list",
  /*  196 */ "alter_table_option",
  /*  197 */ "col_name",
  /*  198 */ "db_name_cond_opt",
  /*  199 */ "like_pattern_opt",
  /*  200 */ "table_name_cond",
  /*  201 */ "from_db_opt",
  /*  202 */ "func_name",
  /*  203 */ "function_name",
  /*  204 */ "index_name",
  /*  205 */ "index_options",
  /*  206 */ "func_list",
  /*  207 */ "duration_literal",
  /*  208 */ "sliding_opt",
  /*  209 */ "func",
  /*  210 */ "expression_list",
  /*  211 */ "topic_name",
  /*  212 */ "query_expression",
X
Xiaoyu Wang 已提交
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
  /*  213 */ "signed",
  /*  214 */ "signed_literal",
  /*  215 */ "table_alias",
  /*  216 */ "column_alias",
  /*  217 */ "expression",
  /*  218 */ "column_reference",
  /*  219 */ "subquery",
  /*  220 */ "predicate",
  /*  221 */ "compare_op",
  /*  222 */ "in_op",
  /*  223 */ "in_predicate_value",
  /*  224 */ "boolean_value_expression",
  /*  225 */ "boolean_primary",
  /*  226 */ "common_expression",
  /*  227 */ "from_clause",
  /*  228 */ "table_reference_list",
  /*  229 */ "table_reference",
  /*  230 */ "table_primary",
  /*  231 */ "joined_table",
  /*  232 */ "alias_opt",
  /*  233 */ "parenthesized_joined_table",
  /*  234 */ "join_type",
  /*  235 */ "search_condition",
  /*  236 */ "query_specification",
  /*  237 */ "set_quantifier_opt",
  /*  238 */ "select_list",
  /*  239 */ "where_clause_opt",
  /*  240 */ "partition_by_clause_opt",
  /*  241 */ "twindow_clause_opt",
  /*  242 */ "group_by_clause_opt",
  /*  243 */ "having_clause_opt",
  /*  244 */ "select_sublist",
  /*  245 */ "select_item",
  /*  246 */ "fill_opt",
  /*  247 */ "fill_mode",
  /*  248 */ "group_by_list",
  /*  249 */ "query_expression_body",
  /*  250 */ "order_by_clause_opt",
  /*  251 */ "slimit_clause_opt",
  /*  252 */ "limit_clause_opt",
  /*  253 */ "query_primary",
  /*  254 */ "sort_specification_list",
  /*  255 */ "sort_specification",
  /*  256 */ "ordering_specification_opt",
  /*  257 */ "null_ordering_opt",
966 967 968 969 970 971 972
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
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
 /*   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 已提交
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 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
 /*  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",
 /*  70 */ "db_options ::= db_options FILE_FACTOR NK_FLOAT",
 /*  71 */ "alter_db_options ::= alter_db_option",
 /*  72 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  73 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  74 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  75 */ "alter_db_option ::= KEEP NK_INTEGER",
 /*  76 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  77 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  78 */ "alter_db_option ::= CACHELAST 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 */ "alter_table_options ::= alter_table_option",
 /* 143 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 144 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 145 */ "alter_table_option ::= KEEP NK_INTEGER",
 /* 146 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 147 */ "col_name_list ::= col_name",
 /* 148 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 149 */ "col_name ::= column_name",
 /* 150 */ "cmd ::= SHOW DNODES",
 /* 151 */ "cmd ::= SHOW USERS",
 /* 152 */ "cmd ::= SHOW DATABASES",
 /* 153 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 154 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 155 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 156 */ "cmd ::= SHOW MNODES",
 /* 157 */ "cmd ::= SHOW MODULES",
 /* 158 */ "cmd ::= SHOW QNODES",
 /* 159 */ "cmd ::= SHOW FUNCTIONS",
 /* 160 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 161 */ "cmd ::= SHOW STREAMS",
 /* 162 */ "db_name_cond_opt ::=",
 /* 163 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 164 */ "like_pattern_opt ::=",
 /* 165 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 166 */ "table_name_cond ::= table_name",
 /* 167 */ "from_db_opt ::=",
 /* 168 */ "from_db_opt ::= FROM db_name",
 /* 169 */ "func_name_list ::= func_name",
 /* 170 */ "func_name_list ::= func_name_list NK_COMMA col_name",
 /* 171 */ "func_name ::= function_name",
 /* 172 */ "cmd ::= CREATE SMA INDEX index_name ON table_name index_options",
 /* 173 */ "cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP",
 /* 174 */ "cmd ::= DROP INDEX index_name ON table_name",
 /* 175 */ "index_options ::=",
 /* 176 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 177 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 178 */ "func_list ::= func",
 /* 179 */ "func_list ::= func_list NK_COMMA func",
 /* 180 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 181 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
 /* 182 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
 /* 183 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 184 */ "cmd ::= query_expression",
 /* 185 */ "literal ::= NK_INTEGER",
 /* 186 */ "literal ::= NK_FLOAT",
 /* 187 */ "literal ::= NK_STRING",
 /* 188 */ "literal ::= NK_BOOL",
 /* 189 */ "literal ::= TIMESTAMP NK_STRING",
 /* 190 */ "literal ::= duration_literal",
 /* 191 */ "duration_literal ::= NK_VARIABLE",
X
Xiaoyu Wang 已提交
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
 /* 192 */ "signed ::= NK_INTEGER",
 /* 193 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 194 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 195 */ "signed ::= NK_FLOAT",
 /* 196 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 197 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 198 */ "signed_literal ::= signed",
 /* 199 */ "signed_literal ::= NK_STRING",
 /* 200 */ "signed_literal ::= NK_BOOL",
 /* 201 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 202 */ "signed_literal ::= duration_literal",
 /* 203 */ "literal_list ::= signed_literal",
 /* 204 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 205 */ "db_name ::= NK_ID",
 /* 206 */ "table_name ::= NK_ID",
 /* 207 */ "column_name ::= NK_ID",
 /* 208 */ "function_name ::= NK_ID",
 /* 209 */ "table_alias ::= NK_ID",
 /* 210 */ "column_alias ::= NK_ID",
 /* 211 */ "user_name ::= NK_ID",
 /* 212 */ "index_name ::= NK_ID",
 /* 213 */ "topic_name ::= NK_ID",
 /* 214 */ "expression ::= literal",
 /* 215 */ "expression ::= column_reference",
 /* 216 */ "expression ::= function_name NK_LP expression_list NK_RP",
 /* 217 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
 /* 218 */ "expression ::= subquery",
 /* 219 */ "expression ::= NK_LP expression NK_RP",
 /* 220 */ "expression ::= NK_PLUS expression",
 /* 221 */ "expression ::= NK_MINUS expression",
 /* 222 */ "expression ::= expression NK_PLUS expression",
 /* 223 */ "expression ::= expression NK_MINUS expression",
 /* 224 */ "expression ::= expression NK_STAR expression",
 /* 225 */ "expression ::= expression NK_SLASH expression",
 /* 226 */ "expression ::= expression NK_REM expression",
 /* 227 */ "expression_list ::= expression",
 /* 228 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 229 */ "column_reference ::= column_name",
 /* 230 */ "column_reference ::= table_name NK_DOT column_name",
 /* 231 */ "predicate ::= expression compare_op expression",
 /* 232 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 233 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 234 */ "predicate ::= expression IS NULL",
 /* 235 */ "predicate ::= expression IS NOT NULL",
 /* 236 */ "predicate ::= expression in_op in_predicate_value",
 /* 237 */ "compare_op ::= NK_LT",
 /* 238 */ "compare_op ::= NK_GT",
 /* 239 */ "compare_op ::= NK_LE",
 /* 240 */ "compare_op ::= NK_GE",
 /* 241 */ "compare_op ::= NK_NE",
 /* 242 */ "compare_op ::= NK_EQ",
 /* 243 */ "compare_op ::= LIKE",
 /* 244 */ "compare_op ::= NOT LIKE",
 /* 245 */ "compare_op ::= MATCH",
 /* 246 */ "compare_op ::= NMATCH",
 /* 247 */ "in_op ::= IN",
 /* 248 */ "in_op ::= NOT IN",
 /* 249 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 250 */ "boolean_value_expression ::= boolean_primary",
 /* 251 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 252 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 253 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 254 */ "boolean_primary ::= predicate",
 /* 255 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 256 */ "common_expression ::= expression",
 /* 257 */ "common_expression ::= boolean_value_expression",
 /* 258 */ "from_clause ::= FROM table_reference_list",
 /* 259 */ "table_reference_list ::= table_reference",
 /* 260 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 261 */ "table_reference ::= table_primary",
 /* 262 */ "table_reference ::= joined_table",
 /* 263 */ "table_primary ::= table_name alias_opt",
 /* 264 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 265 */ "table_primary ::= subquery alias_opt",
 /* 266 */ "table_primary ::= parenthesized_joined_table",
 /* 267 */ "alias_opt ::=",
 /* 268 */ "alias_opt ::= table_alias",
 /* 269 */ "alias_opt ::= AS table_alias",
 /* 270 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 271 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 272 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 273 */ "join_type ::=",
 /* 274 */ "join_type ::= INNER",
 /* 275 */ "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",
 /* 276 */ "set_quantifier_opt ::=",
 /* 277 */ "set_quantifier_opt ::= DISTINCT",
 /* 278 */ "set_quantifier_opt ::= ALL",
 /* 279 */ "select_list ::= NK_STAR",
 /* 280 */ "select_list ::= select_sublist",
 /* 281 */ "select_sublist ::= select_item",
 /* 282 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 283 */ "select_item ::= common_expression",
 /* 284 */ "select_item ::= common_expression column_alias",
 /* 285 */ "select_item ::= common_expression AS column_alias",
 /* 286 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 287 */ "where_clause_opt ::=",
 /* 288 */ "where_clause_opt ::= WHERE search_condition",
 /* 289 */ "partition_by_clause_opt ::=",
 /* 290 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 291 */ "twindow_clause_opt ::=",
X
Xiaoyu Wang 已提交
1265
 /* 292 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
X
Xiaoyu Wang 已提交
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
 /* 293 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP",
 /* 294 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 295 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 296 */ "sliding_opt ::=",
 /* 297 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 298 */ "fill_opt ::=",
 /* 299 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 300 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 301 */ "fill_mode ::= NONE",
 /* 302 */ "fill_mode ::= PREV",
 /* 303 */ "fill_mode ::= NULL",
 /* 304 */ "fill_mode ::= LINEAR",
 /* 305 */ "fill_mode ::= NEXT",
 /* 306 */ "group_by_clause_opt ::=",
 /* 307 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 308 */ "group_by_list ::= expression",
 /* 309 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 310 */ "having_clause_opt ::=",
 /* 311 */ "having_clause_opt ::= HAVING search_condition",
 /* 312 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 313 */ "query_expression_body ::= query_primary",
 /* 314 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 315 */ "query_primary ::= query_specification",
 /* 316 */ "order_by_clause_opt ::=",
 /* 317 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 318 */ "slimit_clause_opt ::=",
 /* 319 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 320 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 321 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 322 */ "limit_clause_opt ::=",
 /* 323 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 324 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 325 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 326 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 327 */ "search_condition ::= common_expression",
 /* 328 */ "sort_specification_list ::= sort_specification",
 /* 329 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 330 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 331 */ "ordering_specification_opt ::=",
 /* 332 */ "ordering_specification_opt ::= ASC",
 /* 333 */ "ordering_specification_opt ::= DESC",
 /* 334 */ "null_ordering_opt ::=",
 /* 335 */ "null_ordering_opt ::= NULLS FIRST",
 /* 336 */ "null_ordering_opt ::= NULLS LAST",
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
};
#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 ){
    pNew = malloc(newSize*sizeof(pNew[0]));
    if( pNew ) pNew[0] = p->yystk0;
  }else{
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
  }
  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 已提交
1348
** second argument to ParseAlloc() below.  This can be changed by
1349 1350 1351 1352 1353 1354 1355 1356 1357
** 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 已提交
1358
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1359
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1360
  ParseCTX_STORE
1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383
#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 已提交
1384
#ifndef Parse_ENGINEALWAYSONSTACK
1385 1386 1387 1388 1389 1390 1391 1392 1393 1394
/* 
** 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 已提交
1395
** to Parse and ParseFree.
1396
*/
X
Xiaoyu Wang 已提交
1397
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
1398 1399 1400
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
1401 1402
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
1403 1404 1405
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
1406
#endif /* Parse_ENGINEALWAYSONSTACK */
1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420


/* 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 已提交
1421 1422
  ParseARG_FETCH
  ParseCTX_FETCH
1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435
  switch( yymajor ){
    /* Here is inserted the actions which take place when a
    ** terminal or non-terminal is destroyed.  This can happen
    ** when the symbol is popped from the stack during a
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are *not* used
    ** inside the C code.
    */
/********* Begin destructor definitions ***************************************/
      /* Default NON-TERMINAL Destructor */
X
Xiaoyu Wang 已提交
1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457
    case 163: /* cmd */
    case 166: /* literal */
    case 173: /* db_options */
    case 175: /* alter_db_options */
    case 177: /* full_table_name */
    case 180: /* table_options */
    case 184: /* alter_table_clause */
    case 185: /* alter_table_options */
    case 188: /* create_subtable_clause */
    case 191: /* drop_table_clause */
    case 194: /* column_def */
    case 197: /* col_name */
    case 198: /* db_name_cond_opt */
    case 199: /* like_pattern_opt */
    case 200: /* table_name_cond */
    case 201: /* from_db_opt */
    case 202: /* func_name */
    case 205: /* index_options */
    case 207: /* duration_literal */
    case 208: /* sliding_opt */
    case 209: /* func */
    case 212: /* query_expression */
X
Xiaoyu Wang 已提交
1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485
    case 213: /* signed */
    case 214: /* signed_literal */
    case 217: /* expression */
    case 218: /* column_reference */
    case 219: /* subquery */
    case 220: /* predicate */
    case 223: /* in_predicate_value */
    case 224: /* boolean_value_expression */
    case 225: /* boolean_primary */
    case 226: /* common_expression */
    case 227: /* from_clause */
    case 228: /* table_reference_list */
    case 229: /* table_reference */
    case 230: /* table_primary */
    case 231: /* joined_table */
    case 233: /* parenthesized_joined_table */
    case 235: /* search_condition */
    case 236: /* query_specification */
    case 239: /* where_clause_opt */
    case 241: /* twindow_clause_opt */
    case 243: /* having_clause_opt */
    case 245: /* select_item */
    case 246: /* fill_opt */
    case 249: /* query_expression_body */
    case 251: /* slimit_clause_opt */
    case 252: /* limit_clause_opt */
    case 253: /* query_primary */
    case 255: /* sort_specification */
1486
{
X
Xiaoyu Wang 已提交
1487
 nodesDestroyNode((yypminor->yy140)); 
1488 1489
}
      break;
X
Xiaoyu Wang 已提交
1490 1491 1492
    case 164: /* account_options */
    case 165: /* alter_account_options */
    case 167: /* alter_account_option */
1493
{
1494
 
1495 1496
}
      break;
X
Xiaoyu Wang 已提交
1497 1498 1499 1500 1501 1502 1503 1504 1505
    case 168: /* user_name */
    case 169: /* dnode_endpoint */
    case 170: /* dnode_host_name */
    case 172: /* db_name */
    case 186: /* column_name */
    case 193: /* table_name */
    case 203: /* function_name */
    case 204: /* index_name */
    case 211: /* topic_name */
X
Xiaoyu Wang 已提交
1506 1507 1508
    case 215: /* table_alias */
    case 216: /* column_alias */
    case 232: /* alias_opt */
1509
{
1510
 
1511 1512
}
      break;
X
Xiaoyu Wang 已提交
1513 1514
    case 171: /* not_exists_opt */
    case 174: /* exists_opt */
X
Xiaoyu Wang 已提交
1515
    case 237: /* set_quantifier_opt */
1516
{
1517 1518 1519
 
}
      break;
X
Xiaoyu Wang 已提交
1520 1521
    case 176: /* alter_db_option */
    case 196: /* alter_table_option */
1522 1523
{
 
1524 1525
}
      break;
X
Xiaoyu Wang 已提交
1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536
    case 178: /* column_def_list */
    case 179: /* tags_def_opt */
    case 181: /* multi_create_clause */
    case 182: /* tags_def */
    case 183: /* multi_drop_clause */
    case 189: /* specific_tags_opt */
    case 190: /* literal_list */
    case 192: /* col_name_list */
    case 195: /* func_name_list */
    case 206: /* func_list */
    case 210: /* expression_list */
X
Xiaoyu Wang 已提交
1537 1538 1539 1540 1541 1542 1543
    case 238: /* select_list */
    case 240: /* partition_by_clause_opt */
    case 242: /* group_by_clause_opt */
    case 244: /* select_sublist */
    case 248: /* group_by_list */
    case 250: /* order_by_clause_opt */
    case 254: /* sort_specification_list */
1544
{
X
Xiaoyu Wang 已提交
1545
 nodesDestroyList((yypminor->yy136)); 
1546 1547
}
      break;
X
Xiaoyu Wang 已提交
1548
    case 187: /* type_name */
1549
{
1550
 
1551 1552
}
      break;
X
Xiaoyu Wang 已提交
1553 1554
    case 221: /* compare_op */
    case 222: /* in_op */
1555
{
1556
 
1557 1558
}
      break;
X
Xiaoyu Wang 已提交
1559
    case 234: /* join_type */
1560
{
1561
 
1562 1563
}
      break;
X
Xiaoyu Wang 已提交
1564
    case 247: /* fill_mode */
1565
{
1566
 
1567 1568
}
      break;
X
Xiaoyu Wang 已提交
1569
    case 256: /* ordering_specification_opt */
1570
{
1571
 
1572 1573
}
      break;
X
Xiaoyu Wang 已提交
1574
    case 257: /* null_ordering_opt */
1575
{
1576
 
1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607
}
      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 已提交
1608
void ParseFinalize(void *p){
1609 1610 1611 1612 1613 1614 1615
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
#endif
}

X
Xiaoyu Wang 已提交
1616
#ifndef Parse_ENGINEALWAYSONSTACK
1617 1618 1619 1620 1621 1622 1623 1624
/* 
** 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 已提交
1625
void ParseFree(
1626 1627 1628 1629 1630 1631
  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 已提交
1632
  ParseFinalize(p);
1633 1634
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
1635
#endif /* Parse_ENGINEALWAYSONSTACK */
1636 1637 1638 1639 1640

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
1641
int ParseStackPeak(void *p){
1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664
  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 已提交
1665
int ParseCoverage(FILE *out){
1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786
  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 已提交
1787 1788
   ParseARG_FETCH
   ParseCTX_FETCH
1789 1790 1791 1792 1793 1794 1795 1796 1797 1798
#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 已提交
1799 1800
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
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
}

/*
** 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 已提交
1831
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872
){
  yyStackEntry *yytos;
  yypParser->yytos++;
#ifdef YYTRACKMAXSTACKDEPTH
  if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
    yypParser->yyhwm++;
    assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
  }
#endif
#if YYSTACKDEPTH>0 
  if( yypParser->yytos>yypParser->yystackEnd ){
    yypParser->yytos--;
    yyStackOverflow(yypParser);
    return;
  }
#else
  if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
    if( yyGrowStack(yypParser) ){
      yypParser->yytos--;
      yyStackOverflow(yypParser);
      return;
    }
  }
#endif
  if( yyNewState > YY_MAX_SHIFT ){
    yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
  }
  yytos = yypParser->yytos;
  yytos->stateno = yyNewState;
  yytos->major = yyMajor;
  yytos->minor.yy0 = yyMinor;
  yyTraceShift(yypParser, yyNewState, "Shift");
}

/* The following table contains information about every rule that
** is used during the reduce.
*/
static const struct {
  YYCODETYPE lhs;       /* Symbol on the left-hand side of the rule */
  signed char nrhs;     /* Negative of the number of RHS symbols in the rule */
} yyRuleInfo[] = {
X
Xiaoyu Wang 已提交
1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 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
  {  163,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  163,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  164,    0 }, /* (2) account_options ::= */
  {  164,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  164,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  164,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  164,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  164,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  164,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  164,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  164,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  164,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  165,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  165,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  167,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  167,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  167,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  167,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  167,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  167,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  167,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  167,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  167,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  167,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  163,   -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
  {  163,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  163,   -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
  {  163,   -3 }, /* (27) cmd ::= DROP USER user_name */
  {  163,   -3 }, /* (28) cmd ::= CREATE DNODE dnode_endpoint */
  {  163,   -5 }, /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
  {  163,   -3 }, /* (30) cmd ::= DROP DNODE NK_INTEGER */
  {  163,   -3 }, /* (31) cmd ::= DROP DNODE dnode_endpoint */
  {  163,   -4 }, /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  163,   -5 }, /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  163,   -4 }, /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
  {  163,   -5 }, /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  169,   -1 }, /* (36) dnode_endpoint ::= NK_STRING */
  {  170,   -1 }, /* (37) dnode_host_name ::= NK_ID */
  {  170,   -1 }, /* (38) dnode_host_name ::= NK_IPTOKEN */
  {  163,   -3 }, /* (39) cmd ::= ALTER LOCAL NK_STRING */
  {  163,   -4 }, /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  163,   -5 }, /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  163,   -5 }, /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  163,   -5 }, /* (43) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  163,   -4 }, /* (44) cmd ::= DROP DATABASE exists_opt db_name */
  {  163,   -2 }, /* (45) cmd ::= USE db_name */
  {  163,   -4 }, /* (46) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  171,   -3 }, /* (47) not_exists_opt ::= IF NOT EXISTS */
  {  171,    0 }, /* (48) not_exists_opt ::= */
  {  174,   -2 }, /* (49) exists_opt ::= IF EXISTS */
  {  174,    0 }, /* (50) exists_opt ::= */
  {  173,    0 }, /* (51) db_options ::= */
  {  173,   -3 }, /* (52) db_options ::= db_options BLOCKS NK_INTEGER */
  {  173,   -3 }, /* (53) db_options ::= db_options CACHE NK_INTEGER */
  {  173,   -3 }, /* (54) db_options ::= db_options CACHELAST NK_INTEGER */
  {  173,   -3 }, /* (55) db_options ::= db_options COMP NK_INTEGER */
  {  173,   -3 }, /* (56) db_options ::= db_options DAYS NK_INTEGER */
  {  173,   -3 }, /* (57) db_options ::= db_options FSYNC NK_INTEGER */
  {  173,   -3 }, /* (58) db_options ::= db_options MAXROWS NK_INTEGER */
  {  173,   -3 }, /* (59) db_options ::= db_options MINROWS NK_INTEGER */
  {  173,   -3 }, /* (60) db_options ::= db_options KEEP NK_INTEGER */
  {  173,   -3 }, /* (61) db_options ::= db_options PRECISION NK_STRING */
  {  173,   -3 }, /* (62) db_options ::= db_options QUORUM NK_INTEGER */
  {  173,   -3 }, /* (63) db_options ::= db_options REPLICA NK_INTEGER */
  {  173,   -3 }, /* (64) db_options ::= db_options TTL NK_INTEGER */
  {  173,   -3 }, /* (65) db_options ::= db_options WAL NK_INTEGER */
  {  173,   -3 }, /* (66) db_options ::= db_options VGROUPS NK_INTEGER */
  {  173,   -3 }, /* (67) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  173,   -3 }, /* (68) db_options ::= db_options STREAM_MODE NK_INTEGER */
  {  173,   -3 }, /* (69) db_options ::= db_options RETENTIONS NK_STRING */
  {  173,   -3 }, /* (70) db_options ::= db_options FILE_FACTOR NK_FLOAT */
  {  175,   -1 }, /* (71) alter_db_options ::= alter_db_option */
  {  175,   -2 }, /* (72) alter_db_options ::= alter_db_options alter_db_option */
  {  176,   -2 }, /* (73) alter_db_option ::= BLOCKS NK_INTEGER */
  {  176,   -2 }, /* (74) alter_db_option ::= FSYNC NK_INTEGER */
  {  176,   -2 }, /* (75) alter_db_option ::= KEEP NK_INTEGER */
  {  176,   -2 }, /* (76) alter_db_option ::= WAL NK_INTEGER */
  {  176,   -2 }, /* (77) alter_db_option ::= QUORUM NK_INTEGER */
  {  176,   -2 }, /* (78) alter_db_option ::= CACHELAST NK_INTEGER */
  {  163,   -9 }, /* (79) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  163,   -3 }, /* (80) cmd ::= CREATE TABLE multi_create_clause */
  {  163,   -9 }, /* (81) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  163,   -3 }, /* (82) cmd ::= DROP TABLE multi_drop_clause */
  {  163,   -4 }, /* (83) cmd ::= DROP STABLE exists_opt full_table_name */
  {  163,   -3 }, /* (84) cmd ::= ALTER TABLE alter_table_clause */
  {  163,   -3 }, /* (85) cmd ::= ALTER STABLE alter_table_clause */
  {  184,   -2 }, /* (86) alter_table_clause ::= full_table_name alter_table_options */
  {  184,   -5 }, /* (87) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  184,   -4 }, /* (88) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  184,   -5 }, /* (89) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  184,   -5 }, /* (90) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  184,   -5 }, /* (91) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  184,   -4 }, /* (92) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  184,   -5 }, /* (93) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  184,   -5 }, /* (94) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  184,   -6 }, /* (95) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
  {  181,   -1 }, /* (96) multi_create_clause ::= create_subtable_clause */
  {  181,   -2 }, /* (97) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  188,   -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 */
  {  183,   -1 }, /* (99) multi_drop_clause ::= drop_table_clause */
  {  183,   -2 }, /* (100) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  191,   -2 }, /* (101) drop_table_clause ::= exists_opt full_table_name */
  {  189,    0 }, /* (102) specific_tags_opt ::= */
  {  189,   -3 }, /* (103) specific_tags_opt ::= NK_LP col_name_list NK_RP */
  {  177,   -1 }, /* (104) full_table_name ::= table_name */
  {  177,   -3 }, /* (105) full_table_name ::= db_name NK_DOT table_name */
  {  178,   -1 }, /* (106) column_def_list ::= column_def */
  {  178,   -3 }, /* (107) column_def_list ::= column_def_list NK_COMMA column_def */
  {  194,   -2 }, /* (108) column_def ::= column_name type_name */
  {  194,   -4 }, /* (109) column_def ::= column_name type_name COMMENT NK_STRING */
  {  187,   -1 }, /* (110) type_name ::= BOOL */
  {  187,   -1 }, /* (111) type_name ::= TINYINT */
  {  187,   -1 }, /* (112) type_name ::= SMALLINT */
  {  187,   -1 }, /* (113) type_name ::= INT */
  {  187,   -1 }, /* (114) type_name ::= INTEGER */
  {  187,   -1 }, /* (115) type_name ::= BIGINT */
  {  187,   -1 }, /* (116) type_name ::= FLOAT */
  {  187,   -1 }, /* (117) type_name ::= DOUBLE */
  {  187,   -4 }, /* (118) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  187,   -1 }, /* (119) type_name ::= TIMESTAMP */
  {  187,   -4 }, /* (120) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  187,   -2 }, /* (121) type_name ::= TINYINT UNSIGNED */
  {  187,   -2 }, /* (122) type_name ::= SMALLINT UNSIGNED */
  {  187,   -2 }, /* (123) type_name ::= INT UNSIGNED */
  {  187,   -2 }, /* (124) type_name ::= BIGINT UNSIGNED */
  {  187,   -1 }, /* (125) type_name ::= JSON */
  {  187,   -4 }, /* (126) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  187,   -1 }, /* (127) type_name ::= MEDIUMBLOB */
  {  187,   -1 }, /* (128) type_name ::= BLOB */
  {  187,   -4 }, /* (129) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  187,   -1 }, /* (130) type_name ::= DECIMAL */
  {  187,   -4 }, /* (131) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  187,   -6 }, /* (132) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  179,    0 }, /* (133) tags_def_opt ::= */
  {  179,   -1 }, /* (134) tags_def_opt ::= tags_def */
  {  182,   -4 }, /* (135) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  180,    0 }, /* (136) table_options ::= */
  {  180,   -3 }, /* (137) table_options ::= table_options COMMENT NK_STRING */
  {  180,   -3 }, /* (138) table_options ::= table_options KEEP NK_INTEGER */
  {  180,   -3 }, /* (139) table_options ::= table_options TTL NK_INTEGER */
  {  180,   -5 }, /* (140) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  180,   -5 }, /* (141) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
  {  185,   -1 }, /* (142) alter_table_options ::= alter_table_option */
  {  185,   -2 }, /* (143) alter_table_options ::= alter_table_options alter_table_option */
  {  196,   -2 }, /* (144) alter_table_option ::= COMMENT NK_STRING */
  {  196,   -2 }, /* (145) alter_table_option ::= KEEP NK_INTEGER */
  {  196,   -2 }, /* (146) alter_table_option ::= TTL NK_INTEGER */
  {  192,   -1 }, /* (147) col_name_list ::= col_name */
  {  192,   -3 }, /* (148) col_name_list ::= col_name_list NK_COMMA col_name */
  {  197,   -1 }, /* (149) col_name ::= column_name */
  {  163,   -2 }, /* (150) cmd ::= SHOW DNODES */
  {  163,   -2 }, /* (151) cmd ::= SHOW USERS */
  {  163,   -2 }, /* (152) cmd ::= SHOW DATABASES */
  {  163,   -4 }, /* (153) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  163,   -4 }, /* (154) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  163,   -3 }, /* (155) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  163,   -2 }, /* (156) cmd ::= SHOW MNODES */
  {  163,   -2 }, /* (157) cmd ::= SHOW MODULES */
  {  163,   -2 }, /* (158) cmd ::= SHOW QNODES */
  {  163,   -2 }, /* (159) cmd ::= SHOW FUNCTIONS */
  {  163,   -5 }, /* (160) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  163,   -2 }, /* (161) cmd ::= SHOW STREAMS */
  {  198,    0 }, /* (162) db_name_cond_opt ::= */
  {  198,   -2 }, /* (163) db_name_cond_opt ::= db_name NK_DOT */
  {  199,    0 }, /* (164) like_pattern_opt ::= */
  {  199,   -2 }, /* (165) like_pattern_opt ::= LIKE NK_STRING */
  {  200,   -1 }, /* (166) table_name_cond ::= table_name */
  {  201,    0 }, /* (167) from_db_opt ::= */
  {  201,   -2 }, /* (168) from_db_opt ::= FROM db_name */
  {  195,   -1 }, /* (169) func_name_list ::= func_name */
  {  195,   -3 }, /* (170) func_name_list ::= func_name_list NK_COMMA col_name */
  {  202,   -1 }, /* (171) func_name ::= function_name */
  {  163,   -7 }, /* (172) cmd ::= CREATE SMA INDEX index_name ON table_name index_options */
  {  163,   -9 }, /* (173) cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */
  {  163,   -5 }, /* (174) cmd ::= DROP INDEX index_name ON table_name */
  {  205,    0 }, /* (175) index_options ::= */
  {  205,   -9 }, /* (176) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  {  205,  -11 }, /* (177) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
  {  206,   -1 }, /* (178) func_list ::= func */
  {  206,   -3 }, /* (179) func_list ::= func_list NK_COMMA func */
  {  209,   -4 }, /* (180) func ::= function_name NK_LP expression_list NK_RP */
  {  163,   -6 }, /* (181) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
  {  163,   -6 }, /* (182) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
  {  163,   -4 }, /* (183) cmd ::= DROP TOPIC exists_opt topic_name */
  {  163,   -1 }, /* (184) cmd ::= query_expression */
  {  166,   -1 }, /* (185) literal ::= NK_INTEGER */
  {  166,   -1 }, /* (186) literal ::= NK_FLOAT */
  {  166,   -1 }, /* (187) literal ::= NK_STRING */
  {  166,   -1 }, /* (188) literal ::= NK_BOOL */
  {  166,   -2 }, /* (189) literal ::= TIMESTAMP NK_STRING */
  {  166,   -1 }, /* (190) literal ::= duration_literal */
  {  207,   -1 }, /* (191) duration_literal ::= NK_VARIABLE */
X
Xiaoyu Wang 已提交
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
  {  213,   -1 }, /* (192) signed ::= NK_INTEGER */
  {  213,   -2 }, /* (193) signed ::= NK_PLUS NK_INTEGER */
  {  213,   -2 }, /* (194) signed ::= NK_MINUS NK_INTEGER */
  {  213,   -1 }, /* (195) signed ::= NK_FLOAT */
  {  213,   -2 }, /* (196) signed ::= NK_PLUS NK_FLOAT */
  {  213,   -2 }, /* (197) signed ::= NK_MINUS NK_FLOAT */
  {  214,   -1 }, /* (198) signed_literal ::= signed */
  {  214,   -1 }, /* (199) signed_literal ::= NK_STRING */
  {  214,   -1 }, /* (200) signed_literal ::= NK_BOOL */
  {  214,   -2 }, /* (201) signed_literal ::= TIMESTAMP NK_STRING */
  {  214,   -1 }, /* (202) signed_literal ::= duration_literal */
  {  190,   -1 }, /* (203) literal_list ::= signed_literal */
  {  190,   -3 }, /* (204) literal_list ::= literal_list NK_COMMA signed_literal */
  {  172,   -1 }, /* (205) db_name ::= NK_ID */
  {  193,   -1 }, /* (206) table_name ::= NK_ID */
  {  186,   -1 }, /* (207) column_name ::= NK_ID */
  {  203,   -1 }, /* (208) function_name ::= NK_ID */
  {  215,   -1 }, /* (209) table_alias ::= NK_ID */
  {  216,   -1 }, /* (210) column_alias ::= NK_ID */
  {  168,   -1 }, /* (211) user_name ::= NK_ID */
  {  204,   -1 }, /* (212) index_name ::= NK_ID */
  {  211,   -1 }, /* (213) topic_name ::= NK_ID */
  {  217,   -1 }, /* (214) expression ::= literal */
  {  217,   -1 }, /* (215) expression ::= column_reference */
  {  217,   -4 }, /* (216) expression ::= function_name NK_LP expression_list NK_RP */
  {  217,   -4 }, /* (217) expression ::= function_name NK_LP NK_STAR NK_RP */
  {  217,   -1 }, /* (218) expression ::= subquery */
  {  217,   -3 }, /* (219) expression ::= NK_LP expression NK_RP */
  {  217,   -2 }, /* (220) expression ::= NK_PLUS expression */
  {  217,   -2 }, /* (221) expression ::= NK_MINUS expression */
  {  217,   -3 }, /* (222) expression ::= expression NK_PLUS expression */
  {  217,   -3 }, /* (223) expression ::= expression NK_MINUS expression */
  {  217,   -3 }, /* (224) expression ::= expression NK_STAR expression */
  {  217,   -3 }, /* (225) expression ::= expression NK_SLASH expression */
  {  217,   -3 }, /* (226) expression ::= expression NK_REM expression */
  {  210,   -1 }, /* (227) expression_list ::= expression */
  {  210,   -3 }, /* (228) expression_list ::= expression_list NK_COMMA expression */
  {  218,   -1 }, /* (229) column_reference ::= column_name */
  {  218,   -3 }, /* (230) column_reference ::= table_name NK_DOT column_name */
  {  220,   -3 }, /* (231) predicate ::= expression compare_op expression */
  {  220,   -5 }, /* (232) predicate ::= expression BETWEEN expression AND expression */
  {  220,   -6 }, /* (233) predicate ::= expression NOT BETWEEN expression AND expression */
  {  220,   -3 }, /* (234) predicate ::= expression IS NULL */
  {  220,   -4 }, /* (235) predicate ::= expression IS NOT NULL */
  {  220,   -3 }, /* (236) predicate ::= expression in_op in_predicate_value */
  {  221,   -1 }, /* (237) compare_op ::= NK_LT */
  {  221,   -1 }, /* (238) compare_op ::= NK_GT */
  {  221,   -1 }, /* (239) compare_op ::= NK_LE */
  {  221,   -1 }, /* (240) compare_op ::= NK_GE */
  {  221,   -1 }, /* (241) compare_op ::= NK_NE */
  {  221,   -1 }, /* (242) compare_op ::= NK_EQ */
  {  221,   -1 }, /* (243) compare_op ::= LIKE */
  {  221,   -2 }, /* (244) compare_op ::= NOT LIKE */
  {  221,   -1 }, /* (245) compare_op ::= MATCH */
  {  221,   -1 }, /* (246) compare_op ::= NMATCH */
  {  222,   -1 }, /* (247) in_op ::= IN */
  {  222,   -2 }, /* (248) in_op ::= NOT IN */
  {  223,   -3 }, /* (249) in_predicate_value ::= NK_LP expression_list NK_RP */
  {  224,   -1 }, /* (250) boolean_value_expression ::= boolean_primary */
  {  224,   -2 }, /* (251) boolean_value_expression ::= NOT boolean_primary */
  {  224,   -3 }, /* (252) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  224,   -3 }, /* (253) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  225,   -1 }, /* (254) boolean_primary ::= predicate */
  {  225,   -3 }, /* (255) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  226,   -1 }, /* (256) common_expression ::= expression */
  {  226,   -1 }, /* (257) common_expression ::= boolean_value_expression */
  {  227,   -2 }, /* (258) from_clause ::= FROM table_reference_list */
  {  228,   -1 }, /* (259) table_reference_list ::= table_reference */
  {  228,   -3 }, /* (260) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  229,   -1 }, /* (261) table_reference ::= table_primary */
  {  229,   -1 }, /* (262) table_reference ::= joined_table */
  {  230,   -2 }, /* (263) table_primary ::= table_name alias_opt */
  {  230,   -4 }, /* (264) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  230,   -2 }, /* (265) table_primary ::= subquery alias_opt */
  {  230,   -1 }, /* (266) table_primary ::= parenthesized_joined_table */
  {  232,    0 }, /* (267) alias_opt ::= */
  {  232,   -1 }, /* (268) alias_opt ::= table_alias */
  {  232,   -2 }, /* (269) alias_opt ::= AS table_alias */
  {  233,   -3 }, /* (270) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  233,   -3 }, /* (271) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  231,   -6 }, /* (272) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  234,    0 }, /* (273) join_type ::= */
  {  234,   -1 }, /* (274) join_type ::= INNER */
  {  236,   -9 }, /* (275) 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 */
  {  237,    0 }, /* (276) set_quantifier_opt ::= */
  {  237,   -1 }, /* (277) set_quantifier_opt ::= DISTINCT */
  {  237,   -1 }, /* (278) set_quantifier_opt ::= ALL */
  {  238,   -1 }, /* (279) select_list ::= NK_STAR */
  {  238,   -1 }, /* (280) select_list ::= select_sublist */
  {  244,   -1 }, /* (281) select_sublist ::= select_item */
  {  244,   -3 }, /* (282) select_sublist ::= select_sublist NK_COMMA select_item */
  {  245,   -1 }, /* (283) select_item ::= common_expression */
  {  245,   -2 }, /* (284) select_item ::= common_expression column_alias */
  {  245,   -3 }, /* (285) select_item ::= common_expression AS column_alias */
  {  245,   -3 }, /* (286) select_item ::= table_name NK_DOT NK_STAR */
  {  239,    0 }, /* (287) where_clause_opt ::= */
  {  239,   -2 }, /* (288) where_clause_opt ::= WHERE search_condition */
  {  240,    0 }, /* (289) partition_by_clause_opt ::= */
  {  240,   -3 }, /* (290) partition_by_clause_opt ::= PARTITION BY expression_list */
  {  241,    0 }, /* (291) twindow_clause_opt ::= */
X
Xiaoyu Wang 已提交
2165
  {  241,   -6 }, /* (292) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
X
Xiaoyu Wang 已提交
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
  {  241,   -4 }, /* (293) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
  {  241,   -6 }, /* (294) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  241,   -8 }, /* (295) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  208,    0 }, /* (296) sliding_opt ::= */
  {  208,   -4 }, /* (297) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  246,    0 }, /* (298) fill_opt ::= */
  {  246,   -4 }, /* (299) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  246,   -6 }, /* (300) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  247,   -1 }, /* (301) fill_mode ::= NONE */
  {  247,   -1 }, /* (302) fill_mode ::= PREV */
  {  247,   -1 }, /* (303) fill_mode ::= NULL */
  {  247,   -1 }, /* (304) fill_mode ::= LINEAR */
  {  247,   -1 }, /* (305) fill_mode ::= NEXT */
  {  242,    0 }, /* (306) group_by_clause_opt ::= */
  {  242,   -3 }, /* (307) group_by_clause_opt ::= GROUP BY group_by_list */
  {  248,   -1 }, /* (308) group_by_list ::= expression */
  {  248,   -3 }, /* (309) group_by_list ::= group_by_list NK_COMMA expression */
  {  243,    0 }, /* (310) having_clause_opt ::= */
  {  243,   -2 }, /* (311) having_clause_opt ::= HAVING search_condition */
  {  212,   -4 }, /* (312) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  249,   -1 }, /* (313) query_expression_body ::= query_primary */
  {  249,   -4 }, /* (314) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
  {  253,   -1 }, /* (315) query_primary ::= query_specification */
  {  250,    0 }, /* (316) order_by_clause_opt ::= */
  {  250,   -3 }, /* (317) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  251,    0 }, /* (318) slimit_clause_opt ::= */
  {  251,   -2 }, /* (319) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  251,   -4 }, /* (320) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  251,   -4 }, /* (321) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  252,    0 }, /* (322) limit_clause_opt ::= */
  {  252,   -2 }, /* (323) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  252,   -4 }, /* (324) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  252,   -4 }, /* (325) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  219,   -3 }, /* (326) subquery ::= NK_LP query_expression NK_RP */
  {  235,   -1 }, /* (327) search_condition ::= common_expression */
  {  254,   -1 }, /* (328) sort_specification_list ::= sort_specification */
  {  254,   -3 }, /* (329) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  255,   -3 }, /* (330) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
  {  256,    0 }, /* (331) ordering_specification_opt ::= */
  {  256,   -1 }, /* (332) ordering_specification_opt ::= ASC */
  {  256,   -1 }, /* (333) ordering_specification_opt ::= DESC */
  {  257,    0 }, /* (334) null_ordering_opt ::= */
  {  257,   -2 }, /* (335) null_ordering_opt ::= NULLS FIRST */
  {  257,   -2 }, /* (336) null_ordering_opt ::= NULLS LAST */
2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227
};

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

  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;
3394 3395
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
3396 3397
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3398 3399 3400 3401 3402 3403 3404 3405
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
3406 3407
  ParseARG_FETCH
  ParseCTX_FETCH
3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420
#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 已提交
3421 3422
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3423 3424 3425 3426
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
3427
** "ParseAlloc" which describes the current state of the parser.
3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443
** 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 已提交
3444
void Parse(
3445 3446
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
3447 3448
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
3449 3450 3451 3452 3453 3454 3455 3456 3457 3458
){
  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 已提交
3459 3460
  ParseCTX_FETCH
  ParseARG_STORE
3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484

  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 已提交
3485
                        yyminor ParseCTX_PARAM);
3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617
    }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 已提交
3618
int ParseFallback(int iToken){
3619 3620 3621 3622 3623 3624 3625 3626 3627
#ifdef YYFALLBACK
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
#else
  (void)iToken;
#endif
  return 0;
}