sql.c 188.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
/*
** 2000-05-29
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Driver template for the LEMON parser generator.
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser.  The "lemon" program inserts text
** at each "%%" line.  Also, any "P-a-r-s-e" identifer prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar.  Otherwise, the content
** of this template is copied straight through into the generate parser
** source file.
**
** The following is the concatenation of all %include directives from the
** input grammar file:
*/
#include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/

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

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

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

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


/* Next are the tables used to determine what action to take based on the
** current state and lookahead token.  These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.  
**
** Suppose the action integer is N.  Then the action is determined as
** follows
**
**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
**                                      token onto the stack and goto state N.
**
**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
**
**   N == YY_ERROR_ACTION               A syntax error has occurred.
**
**   N == YY_ACCEPT_ACTION              The parser accepts its input.
**
**   N == YY_NO_ACTION                  No such action.  Denotes unused
**                                      slots in the yy_action[] table.
**
**   N between YY_MIN_REDUCE            Reduce by rule N-YY_MIN_REDUCE
**     and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either:
**
**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
**    (B)   N = yy_default[S]
**
** The (A) formula is preferred.  The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
**
** The formulas above are for computing the action when the lookahead is
** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array.
**
** The following are the tables generated in this section:
**
**  yy_action[]        A single table containing all actions.
**  yy_lookahead[]     A table containing the lookahead for each entry in
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
**
*********** Begin parsing tables **********************************************/
X
Xiaoyu Wang 已提交
212
#define YY_ACTTAB_COUNT (1316)
213
static const YYACTIONTYPE yy_action[] = {
X
Xiaoyu Wang 已提交
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
 /*     0 */  1275,  368, 1288, 1154,  247, 1397,   46, 1241, 1271, 1278,
 /*    10 */  1304, 1288,   31,   29,   27,   26,   25,  365, 1396,  108,
 /*    20 */   349, 1071, 1395, 1304, 1161,   31,   29,   27,   26,   25,
 /*    30 */   365,  380, 1304,   31,   29,   27,   26,   25,  235,  352,
 /*    40 */   367, 1150,   95,  380, 1262,  339,  732,  221, 1102,  367,
 /*    50 */    27,   26,   25, 1262, 1304, 1275,  214, 1289, 1290, 1293,
 /*    60 */   221,  365,  295, 1271, 1277,   65, 1289, 1290, 1293, 1336,
 /*    70 */   931,   93,  920,  237, 1332,  115,   24,  176,  961, 1105,
 /*    80 */   351,  116, 1343, 1344, 1212, 1348,   61,  172,  345,  342,
 /*    90 */   234,  961,   12,  331, 1363, 1210,   57,  435,  434,  433,
 /*   100 */   432,  431,  430,  429,  428,  192,  425,  424,  423,  422,
 /*   110 */   421,  420,  419,  418,  417,   81,  962,   46,   80,   79,
 /*   120 */    78,   77,   76,   75,   74,   73,   72,   92,  310,  962,
 /*   130 */   305,  381,  733,  309,  732, 1160,  149,  266,  306,  304,
 /*   140 */   268,  307,   23,  242,  956,  957,  958,  959,  960,  964,
 /*   150 */   965,  966,  734, 1165, 1156,   23,  242,  956,  957,  958,
 /*   160 */   959,  960,  964,  965,  966, 1288,  916,  219, 1057,   31,
 /*   170 */    29,   27,   26,   25,  171,  808,  404,  403,  402,  812,
 /*   180 */   401,  814,  815,  400,  817,  397, 1304,  823,  394,  825,
 /*   190 */   826,  391,  388,  365,  112, 1143, 1262,  380,   30,   28,
 /*   200 */   261, 1082,  260,  367,  381, 1205,  244, 1262,  896, 1288,
 /*   210 */   267,  943,  353,  945,  946,  947,  948,  949,  259,   64,
 /*   220 */  1289, 1290, 1293, 1336,  894,  121, 1165,  220, 1332,  109,
 /*   230 */  1304, 1129,  248,   11,   30,   28,  998,  352,  918, 1397,
 /*   240 */   107,  288,  244, 1262,  896, 1397,   12,  367, 1167,   30,
 /*   250 */    28, 1262,  120,  107, 1022,    1, 1395,  244,  120,  896,
 /*   260 */   894, 1168, 1395,   65, 1289, 1290, 1293, 1336, 1212,   11,
 /*   270 */  1212,  237, 1332,  115,  249,  894,  256, 1350,  447, 1210,
 /*   280 */  1052, 1210,  252,  349,   11,  335, 1020, 1021, 1023, 1024,
 /*   290 */   895,    1, 1364, 1081,  916, 1347,  315, 1355,  993, 1275,
 /*   300 */   121,  269,  255,  262,  281,   95,    1, 1271, 1277, 1232,
 /*   310 */  1234,  323,    6,  282,  447,  381,  897,  381,  900,  901,
 /*   320 */   210,  287,  944, 1162,  353,  151,  895,  963,  318,  447,
 /*   330 */  1397,  121, 1051,  312,   93, 1262,  150, 1165, 1288, 1165,
 /*   340 */   121,  895,  288,  120,  169, 1343,  348, 1395,  347,  254,
 /*   350 */   921, 1397,  897,   21,  900,  901,  210,  107,  944, 1304,
 /*   360 */    41, 1288,  967,   40,  120, 1167,  365,  897, 1395,  900,
 /*   370 */   901,  210,  324,  944,  343,  257,  367,    9,    8,   62,
 /*   380 */  1262,  280, 1304,  107,  275,  274,  273,  272,  271,  365,
 /*   390 */    96, 1167,   65, 1289, 1290, 1293, 1336, 1157,  381,  367,
 /*   400 */   237, 1332, 1409, 1262,  378, 1288,  148,  357,  381, 1080,
 /*   410 */   300, 1370, 1141,  325,   69,   65, 1289, 1290, 1293, 1336,
 /*   420 */  1165,  297,  993,  237, 1332, 1409, 1304, 1350,   30,   28,
 /*   430 */  1165,  302,  338,  365, 1393,  368,  244, 1079,  896,  121,
 /*   440 */  1397, 1242, 1078,  367,  381, 1346,  974, 1262, 1077, 1288,
 /*   450 */   379, 1262,  157,  120,  894, 1076,  276, 1395,  416,   65,
 /*   460 */  1289, 1290, 1293, 1336,  349, 1075, 1165,  237, 1332, 1409,
 /*   470 */  1304,  344,  340,   30,   28,  366,  381,  365, 1354, 1262,
 /*   480 */   356,  244,   69,  896, 1262,    7,   95,  367, 1229,  303,
 /*   490 */  1262, 1262,  443,  442,  381,  124,  353, 1262, 1165,  894,
 /*   500 */   190,  126,  125,  211, 1289, 1290, 1293, 1262,  447,   30,
 /*   510 */    28,  997,  358, 1074, 1073,   93, 1165,  244, 1070,  896,
 /*   520 */   895, 1069,  349, 1397, 1350,  117, 1343, 1344,  416, 1348,
 /*   530 */     7,  919, 1068,   30,   28,  894,  120, 1067, 1066,   55,
 /*   540 */  1395,  244, 1345,  896,   95,  381,  897, 1212,  900,  901,
 /*   550 */   210,  258,  944,  447, 1288, 1262, 1262, 1158, 1233,  894,
 /*   560 */  1262, 1065, 1064, 1262, 1063,  895,    7, 1165,  917,  198,
 /*   570 */   121,  203, 1195,   93, 1262, 1304,  205, 1062,  141, 1262,
 /*   580 */  1262,  139,  365,  118, 1343, 1344, 1288, 1348,  204,  447,
 /*   590 */     1,  897,  367,  900,  901,  210, 1262,  944,  127, 1005,
 /*   600 */  1098,  895,  407, 1262, 1262,  918, 1262, 1304,   66, 1289,
 /*   610 */  1290, 1293, 1336,  447,  365,  143, 1335, 1332,  142, 1262,
 /*   620 */   145, 1212,  311,  144,  367,  895,  360,  897, 1262,  900,
 /*   630 */   901,  210, 1211,  944, 1093,  147, 1152, 1288,  146, 1091,
 /*   640 */    66, 1289, 1290, 1293, 1336, 1288, 1148,  355,  363, 1332,
 /*   650 */   322,  897,  364,  900,  901,  210,  313,  944, 1304,   67,
 /*   660 */   406,  316,  996,  320,  101,  365, 1304,  327,  896,   42,
 /*   670 */   904,  160, 1019,  365,  162,  367,   44,   43,  265, 1262,
 /*   680 */   122,    9,    8,  367,  894, 1054, 1055, 1262, 1060,  903,
 /*   690 */   173,  110, 1289, 1290, 1293,   32, 1072, 1130,  968,   66,
 /*   700 */  1289, 1290, 1293, 1336,  336, 1206, 1288,  121, 1333,   81,
 /*   710 */   166,   20,   80,   79,   78,   77,   76,   75,   74,   73,
 /*   720 */    72,   31,   29,   27,   26,   25, 1288, 1304,  294,  354,
 /*   730 */  1410, 1288,   32,  361,  365,  928,  907,  953,  447,   31,
 /*   740 */    29,   27,   26,   25,  367, 1282,   32, 1304, 1262,  880,
 /*   750 */   895,  243, 1304,  179,  365,  906,  181, 1280, 1366,  365,
 /*   760 */   215, 1289, 1290, 1293,  367,  251,  250,   98, 1262,  367,
 /*   770 */   373,  332, 1288, 1262,  350,  909,  897, 1288,  900,  901,
 /*   780 */   215, 1289, 1290, 1293, 1305,  110, 1289, 1290, 1293,   99,
 /*   790 */     2,  902,  187, 1304,  889,  175,  196,  931, 1304,  101,
 /*   800 */   365,   42,  801,  386,  796,  365,  829,  916, 1231,   99,
 /*   810 */   367, 1059,  833,  100, 1262,  367,  839,  241,  101, 1262,
 /*   820 */   123,  838,  245,  278, 1411,  270,  215, 1289, 1290, 1293,
 /*   830 */   277,  215, 1289, 1290, 1293,   90,   89,   88,   87,   86,
 /*   840 */    85,   84,   83,   82,  450,  382,  279,   99,  283, 1288,
 /*   850 */   102,  924,   22,  284,  128,  285,  923,  905,  195,  286,
 /*   860 */  1288,   91,   31,   29,   27,   26,   25,  439,  922,  194,
 /*   870 */  1304,  131,   45,  289,  134,  296,  298,  365, 1155,  775,
 /*   880 */   138, 1304,  301,  910,  326,  913,  901,  367,  365,   71,
 /*   890 */  1151, 1262,  140,   63,  308,  103,  188, 1288,  367,  104,
 /*   900 */  1153, 1149, 1262,  213, 1289, 1290, 1293,  105,  233,  106,
 /*   910 */   152,  921,  155,  328,  216, 1289, 1290, 1293, 1304,  228,
 /*   920 */   329,  337,  371, 1377,  901,  365,  377, 1288, 1367, 1376,
 /*   930 */   165,    5, 1357,  158,  334,  367,  161,  236,  341, 1262,
 /*   940 */   346,  148,  333,  330,  920,  300,  153, 1288, 1304,    4,
 /*   950 */   993,  208, 1289, 1290, 1293,  365,  229,   94,  227,  226,
 /*   960 */  1351,  299, 1142,  168,   33,  367,  302,  362, 1304, 1262,
 /*   970 */  1288,  238,  113,  359,   17,  365,  167, 1240, 1318,  369,
 /*   980 */   370,  217, 1289, 1290, 1293,  367,  374,  183, 1239, 1262,
 /*   990 */   174, 1304, 1394,  246, 1288, 1412,  375,  376,  365,  197,
 /*  1000 */  1288,  209, 1289, 1290, 1293,   56,  185,   54,  367, 1166,
 /*  1010 */   384,  199, 1262,  413,  427, 1304,  193,  446,  202,  191,
 /*  1020 */    39, 1304,  365,  412,  218, 1289, 1290, 1293,  365,  206,
 /*  1030 */  1256,  207,  367,  201,  892, 1250, 1262, 1249,  367,  891,
 /*  1040 */   263, 1288, 1262,  264,  414, 1248, 1247,  863, 1301, 1289,
 /*  1050 */  1290, 1293, 1288, 1224, 1300, 1289, 1290, 1293, 1140, 1223,
 /*  1060 */    97, 1222, 1304,  411,  410,  409, 1221,  408, 1220,  365,
 /*  1070 */  1219, 1218, 1217, 1304,  865, 1216, 1215, 1214, 1213,  367,
 /*  1080 */   365, 1104, 1246, 1262, 1237,  130, 1144,  745, 1103, 1288,
 /*  1090 */   367, 1101,  290,  291, 1262, 1299, 1289, 1290, 1293,  292,
 /*  1100 */  1288, 1090, 1089, 1086, 1146,   70,  224, 1289, 1290, 1293,
 /*  1110 */  1304,  846,  137, 1145,  426,  191,  844,  365,  774,  412,
 /*  1120 */  1099, 1304,  230,  773, 1094,  772, 1092,  367,  365,  231,
 /*  1130 */  1288, 1262,  314,  771,  769,  768,  232,  317,  367, 1085,
 /*  1140 */   414,  319, 1262,  223, 1289, 1290, 1293, 1084,   68,  321,
 /*  1150 */  1245, 1304, 1288, 1244,  225, 1289, 1290, 1293,  365,  411,
 /*  1160 */   410,  409,   36,  408, 1236,  154,  156,   48,  367,   14,
 /*  1170 */  1280,   15, 1262, 1304,  111,    3,   32,   37,   34,   10,
 /*  1180 */   365,  159, 1018,  164,  222, 1289, 1290, 1293,  136,   51,
 /*  1190 */   367,  114,  163,    8, 1262, 1012,  170,  293,   49,  135,
 /*  1200 */  1011,   50,   19,  990,  989,   35,  212, 1289, 1290, 1293,
 /*  1210 */  1045,  310,  119,  305, 1040,   16,  309, 1039,  239,  149,
 /*  1220 */  1044,  306,  304,   47,  307, 1043,  133,  240,  929,   13,
 /*  1230 */   177,  178,   18, 1235,  186, 1016,  180,  182,  954,   52,
 /*  1240 */   184,  372,   53,  911,   38,   57,  385,  830,  253,  389,
 /*  1250 */  1279,  827,  189,  387,  383,  390,  392,  395,  824,  393,
 /*  1260 */   398,  807,  818,  396,  841,  816,  822,  399,  837,   58,
 /*  1270 */    59,   60,  132,  835,  765,  743,  129,  821,  415,  764,
 /*  1280 */   763,  405,  840,  762,  761,  760,  759,  820,  758,  757,
 /*  1290 */   819,  776,  755,  754,  753,  752,  751,  750,  749,  748,
 /*  1300 */  1100,  436,  437, 1088, 1087,  438,  440,  441, 1083,  444,
 /*  1310 */   445, 1058,  898,  200,  448,  449,
346 347
};
static const YYCODETYPE yy_lookahead[] = {
X
Xiaoyu Wang 已提交
348 349 350 351 352 353 354 355 356 357
 /*     0 */   224,  220,  182,  204,  223,  256,  190,  226,  232,  233,
 /*    10 */   203,  182,   12,   13,   14,   15,   16,  210,  269,  181,
 /*    20 */   188,  183,  273,  203,  208,   12,   13,   14,   15,   16,
 /*    30 */   210,   20,  203,   12,   13,   14,   15,   16,  207,  210,
 /*    40 */   220,  204,  210,   20,  224,  238,   22,   47,    0,  220,
 /*    50 */    14,   15,   16,  224,  203,  224,  236,  237,  238,  239,
 /*    60 */    47,  210,   38,  232,  233,  236,  237,  238,  239,  240,
 /*    70 */    70,  239,   20,  244,  245,  246,  241,  242,   78,    0,
 /*    80 */   248,  249,  250,  251,  203,  253,   69,  258,  268,  238,
 /*    90 */   209,   78,   69,  264,  265,  214,   79,   49,   50,   51,
X
Xiaoyu Wang 已提交
358
 /*   100 */    52,   53,   54,   55,   56,   57,   58,   59,   60,   61,
X
Xiaoyu Wang 已提交
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 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
 /*   110 */    62,   63,   64,   65,   66,   21,  116,  190,   24,   25,
 /*   120 */    26,   27,   28,   29,   30,   31,   32,  200,   49,  116,
 /*   130 */    51,  188,   20,   54,   22,  208,   57,  194,   59,   60,
 /*   140 */   188,   62,  142,  143,  144,  145,  146,  147,  148,  149,
 /*   150 */   150,  151,   40,  210,  182,  142,  143,  144,  145,  146,
 /*   160 */   147,  148,  149,  150,  151,  182,   20,  215,  179,   12,
 /*   170 */    13,   14,   15,   16,  122,   83,   84,   85,   86,   87,
 /*   180 */    88,   89,   90,   91,   92,   93,  203,   95,   96,   97,
 /*   190 */    98,   99,  100,  210,  202,    0,  224,   20,   12,   13,
 /*   200 */   129,  182,  131,  220,  188,  213,   20,  224,   22,  182,
 /*   210 */   194,  135,  229,  137,  138,  139,  140,  141,  229,  236,
 /*   220 */   237,  238,  239,  240,   38,  154,  210,  244,  245,  191,
 /*   230 */   203,  193,  195,   47,   12,   13,   14,  210,   20,  256,
 /*   240 */   203,   46,   20,  224,   22,  256,   69,  220,  211,   12,
 /*   250 */    13,  224,  269,  203,  132,   69,  273,   20,  269,   22,
 /*   260 */    38,  211,  273,  236,  237,  238,  239,  240,  203,   47,
 /*   270 */   203,  244,  245,  246,  209,   38,  209,  234,   92,  214,
 /*   280 */   123,  214,  207,  188,   47,  163,  164,  165,  166,  167,
 /*   290 */   104,   69,  265,  182,   20,  252,    4,  152,  153,  224,
 /*   300 */   154,   27,  212,  229,   30,  210,   69,  232,  233,  219,
 /*   310 */   220,   19,   43,   39,   92,  188,  130,  188,  132,  133,
 /*   320 */   134,  194,  136,  194,  229,   33,  104,  116,   36,   92,
 /*   330 */   256,  154,  175,   41,  239,  224,   44,  210,  182,  210,
 /*   340 */   154,  104,   46,  269,  249,  250,  251,  273,  253,  195,
 /*   350 */    20,  256,  130,  142,  132,  133,  134,  203,  136,  203,
 /*   360 */    68,  182,  151,   71,  269,  211,  210,  130,  273,  132,
 /*   370 */   133,  134,  188,  136,   20,  195,  220,    1,    2,  187,
 /*   380 */   224,  107,  203,  203,  110,  111,  112,  113,  114,  210,
 /*   390 */   198,  211,  236,  237,  238,  239,  240,  205,  188,  220,
 /*   400 */   244,  245,  246,  224,  194,  182,   57,   67,  188,  182,
 /*   410 */    61,  255,    0,  229,  194,  236,  237,  238,  239,  240,
 /*   420 */   210,  201,  153,  244,  245,  246,  203,  234,   12,   13,
 /*   430 */   210,   82,  120,  210,  255,  220,   20,  182,   22,  154,
 /*   440 */   256,  226,  182,  220,  188,  252,   70,  224,  182,  182,
 /*   450 */   194,  224,  122,  269,   38,  182,   63,  273,   46,  236,
 /*   460 */   237,  238,  239,  240,  188,  182,  210,  244,  245,  246,
 /*   470 */   203,  159,  160,   12,   13,   14,  188,  210,  255,  224,
 /*   480 */     3,   20,  194,   22,  224,   69,  210,  220,  210,  201,
 /*   490 */   224,  224,  185,  186,  188,  217,  229,  224,  210,   38,
 /*   500 */   194,  108,  109,  236,  237,  238,  239,  224,   92,   12,
 /*   510 */    13,    4,  172,  182,  182,  239,  210,   20,  182,   22,
 /*   520 */   104,  182,  188,  256,  234,  249,  250,  251,   46,  253,
 /*   530 */    69,   20,  182,   12,   13,   38,  269,  182,  182,  187,
 /*   540 */   273,   20,  252,   22,  210,  188,  130,  203,  132,  133,
 /*   550 */   134,  194,  136,   92,  182,  224,  224,  205,  214,   38,
 /*   560 */   224,  182,  182,  224,  182,  104,   69,  210,   20,  196,
 /*   570 */   154,   18,  199,  239,  224,  203,   23,  182,   73,  224,
 /*   580 */   224,   76,  210,  249,  250,  251,  182,  253,   35,   92,
 /*   590 */    69,  130,  220,  132,  133,  134,  224,  136,   45,   14,
 /*   600 */     0,  104,   80,  224,  224,   20,  224,  203,  236,  237,
 /*   610 */   238,  239,  240,   92,  210,   73,  244,  245,   76,  224,
 /*   620 */    73,  203,   22,   76,  220,  104,   67,  130,  224,  132,
 /*   630 */   133,  134,  214,  136,    0,   73,  204,  182,   76,    0,
 /*   640 */   236,  237,  238,  239,  240,  182,  204,  170,  244,  245,
 /*   650 */    21,  130,   47,  132,  133,  134,   22,  136,  203,  106,
 /*   660 */   204,   22,  155,   34,   67,  210,  203,   70,   22,   67,
 /*   670 */    38,   67,   70,  210,   70,  220,  123,  124,  125,  224,
 /*   680 */   127,    1,    2,  220,   38,  177,  178,  224,    0,   38,
 /*   690 */   276,  236,  237,  238,  239,   67,  183,  193,   70,  236,
 /*   700 */   237,  238,  239,  240,  267,  213,  182,  154,  245,   21,
 /*   710 */   261,    2,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   720 */    32,   12,   13,   14,   15,   16,  182,  203,  185,  274,
 /*   730 */   275,  182,   67,  174,  210,   70,  104,  132,   92,   12,
 /*   740 */    13,   14,   15,   16,  220,   69,   67,  203,  224,   70,
 /*   750 */   104,  227,  203,   67,  210,  104,   70,   81,  235,  210,
 /*   760 */   236,  237,  238,  239,  220,   12,   13,   67,  224,  220,
 /*   770 */    70,  227,  182,  224,  254,   22,  130,  182,  132,  133,
 /*   780 */   236,  237,  238,  239,  203,  236,  237,  238,  239,   67,
 /*   790 */   257,   38,   70,  203,  128,  270,  230,   70,  203,   67,
 /*   800 */   210,   67,   70,   67,   70,  210,   70,   20,  188,   67,
 /*   810 */   220,    0,   70,   67,  224,  220,   70,  227,   67,  224,
 /*   820 */   115,   70,  227,  116,  275,  218,  236,  237,  238,  239,
 /*   830 */   216,  236,  237,  238,  239,   24,   25,   26,   27,   28,
 /*   840 */    29,   30,   31,   32,   19,   92,  216,   67,  188,  182,
 /*   850 */    70,   20,    2,  228,  190,  210,   20,  104,   33,  221,
 /*   860 */   182,   36,   12,   13,   14,   15,   16,   42,   20,   44,
 /*   870 */   203,  190,  190,  188,  190,  184,  203,  210,  203,   38,
 /*   880 */   203,  203,  192,  130,  228,  132,  133,  220,  210,  188,
 /*   890 */   203,  224,  203,   68,  192,  203,   71,  182,  220,  203,
 /*   900 */   203,  203,  224,  236,  237,  238,  239,  203,  184,  203,
 /*   910 */   187,   20,  187,  210,  236,  237,  238,  239,  203,   35,
 /*   920 */   221,  162,  161,  266,  133,  210,  101,  182,  235,  266,
 /*   930 */   262,  169,  263,  225,  224,  220,  225,  224,  224,  224,
 /*   940 */   168,   57,  157,  118,   20,   61,  121,  182,  203,  156,
 /*   950 */   153,  236,  237,  238,  239,  210,   72,  210,   74,   75,
 /*   960 */   234,   77,    0,  247,  115,  220,   82,  173,  203,  224,
 /*   970 */   182,  176,  260,  171,   69,  210,  259,  225,  243,  224,
 /*   980 */   224,  236,  237,  238,  239,  220,  119,  210,  225,  224,
 /*   990 */   271,  203,  272,  224,  182,  277,  222,  221,  210,  199,
 /*  1000 */   182,  236,  237,  238,  239,   69,  187,  187,  220,  210,
 /*  1010 */   206,  188,  224,  192,  192,  203,  187,  184,  180,   57,
 /*  1020 */   231,  203,  210,   61,  236,  237,  238,  239,  210,  197,
 /*  1030 */     0,  197,  220,  189,  104,    0,  224,    0,  220,  130,
 /*  1040 */    50,  182,  224,  126,   82,    0,    0,   81,  236,  237,
 /*  1050 */   238,  239,  182,    0,  236,  237,  238,  239,    0,    0,
 /*  1060 */   115,    0,  203,  101,  102,  103,    0,  105,    0,  210,
 /*  1070 */     0,    0,    0,  203,   22,    0,    0,    0,    0,  220,
 /*  1080 */   210,    0,    0,  224,    0,   43,    0,   48,    0,  182,
 /*  1090 */   220,    0,   38,   36,  224,  236,  237,  238,  239,   43,
 /*  1100 */   182,    0,    0,    0,    0,   78,  236,  237,  238,  239,
 /*  1110 */   203,   38,   76,    0,   67,   57,   22,  210,   38,   61,
 /*  1120 */     0,  203,   22,   38,    0,   38,    0,  220,  210,   22,
 /*  1130 */   182,  224,   39,   38,   38,   38,   22,   38,  220,    0,
 /*  1140 */    82,   22,  224,  236,  237,  238,  239,    0,   20,   22,
 /*  1150 */     0,  203,  182,    0,  236,  237,  238,  239,  210,  101,
 /*  1160 */   102,  103,  122,  105,    0,   43,  117,   69,  220,  158,
 /*  1170 */    81,  158,  224,  203,   69,   67,   67,   67,  152,  158,
 /*  1180 */   210,   70,   70,   67,  236,  237,  238,  239,   33,    4,
 /*  1190 */   220,   36,   69,    2,  224,   70,   81,   42,   69,   44,
 /*  1200 */    70,   69,   67,   70,   70,   67,  236,  237,  238,  239,
 /*  1210 */    70,   49,   81,   51,   38,   67,   54,   38,   38,   57,
 /*  1220 */    38,   59,   60,   68,   62,   38,   71,   38,   70,   69,
 /*  1230 */    81,   70,   69,    0,  117,   70,   69,   69,  132,   69,
 /*  1240 */    43,  120,   69,   22,   69,   79,   38,   70,   38,   38,
 /*  1250 */    81,   70,   81,   69,   80,   69,   38,   38,   70,   69,
 /*  1260 */    38,   22,   70,   69,   38,   70,   94,   69,   38,   69,
 /*  1270 */    69,   69,  117,   22,   22,   48,  121,   94,   47,   38,
 /*  1280 */    38,   82,  104,   38,   38,   38,   38,   94,   38,   22,
 /*  1290 */    94,   38,   38,   38,   38,   38,   38,   38,   38,   38,
 /*  1300 */     0,   38,   36,    0,    0,   43,   38,   37,    0,   22,
 /*  1310 */    21,  278,   22,   22,   21,   20,  278,  278,  278,  278,
 /*  1320 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1330 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1340 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1350 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1360 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1370 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1380 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1390 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1400 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1410 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1420 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1430 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1440 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1450 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1460 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1470 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1480 */   278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
 /*  1490 */   278,  278,  278,  278,  278,
498
};
X
Xiaoyu Wang 已提交
499
#define YY_SHIFT_COUNT    (450)
500
#define YY_SHIFT_MIN      (0)
X
Xiaoyu Wang 已提交
501
#define YY_SHIFT_MAX      (1308)
502
static const unsigned short int yy_shift_ofst[] = {
X
Xiaoyu Wang 已提交
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548
 /*     0 */   553,  186,  222,  237,  237,  237,  237,  416,  237,  237,
 /*    10 */   497,  521,  177,  461,  497,  497,  497,  497,  497,  497,
 /*    20 */   497,  497,  497,  497,  497,  497,  497,  497,  497,  497,
 /*    30 */   497,  497,  497,   23,   23,   23,  146,  753,  753,   71,
 /*    40 */    11,   11,  753,   11,   11,   11,   11,  296,  218,  354,
 /*    50 */   354,  285,  511,  218,   11,   11,  218,   11,  218,  511,
 /*    60 */   218,  218,   11,  482,    0,   13,   13,  274,   94,  884,
 /*    70 */   646, 1162,  646,  646,  646,  646,  646,  646,  646,  646,
 /*    80 */   646,  646,  646,  646,  646,  646,  646,  646,  646,  646,
 /*    90 */   646,  112,  195,   52,   52,   52,  412,  548,  511,  218,
 /*   100 */   218,  218,  522,   92,   92,   92,   92,   92,  688,   79,
 /*   110 */   157,  122,  349,  312,   24,  330,  145,  269,  145,  585,
 /*   120 */   477,  507,  666,  787,  705,  707,  707,  787,  831,  296,
 /*   130 */   548,  836,  296,  296,  787,  296,  848,  218,  218,  218,
 /*   140 */   218,  218,  218,  218,  218,  218,  218,  218,  841,  841,
 /*   150 */   787,  848,  831,  482,  548,  836,  482,  891,  759,  761,
 /*   160 */   791,  759,  761,  791,  791,  762,  772,  785,  793,  797,
 /*   170 */   548,  924,  849,  795,  794,  802,  905,  218,  761,  791,
 /*   180 */   791,  761,  791,  867,  548,  836,  482,  522,  482,  548,
 /*   190 */   936,  841,  841,  787,  482,  848, 1316, 1316, 1316, 1316,
 /*   200 */  1316,   48,  811,  825, 1155,  292,  962, 1058,  709,  850,
 /*   210 */    76,  727,   21,   21,   21,   21,   21,   21,   21,  393,
 /*   220 */   376,  211,   36,   36,   36,   36,  505,  542,  547,  562,
 /*   230 */   600,  634,  639,  629,  597,  602,  604,  680,  508,  340,
 /*   240 */   559,  628,  605,  665,  676,  679,  686,  700,  722,  732,
 /*   250 */   632,  651,  734,  736,  742,  746,  751,  780,   17, 1030,
 /*   260 */   930,  909, 1035, 1037,  990,  917, 1045, 1046,  966, 1053,
 /*   270 */  1059,  945, 1061, 1066, 1068, 1070, 1071, 1072, 1052, 1075,
 /*   280 */  1076, 1077, 1078, 1081, 1082, 1084, 1042, 1086, 1039, 1088,
 /*   290 */  1091, 1054, 1057, 1056, 1101, 1102, 1103, 1104, 1027, 1036,
 /*   300 */  1073, 1047, 1094, 1113, 1080, 1085, 1087, 1095, 1047, 1096,
 /*   310 */  1097, 1120, 1100, 1124, 1107, 1093, 1126, 1114, 1099, 1139,
 /*   320 */  1119, 1147, 1127, 1128, 1150, 1153, 1040, 1164, 1098, 1122,
 /*   330 */  1049, 1108, 1109, 1011, 1111, 1110, 1112, 1105, 1123, 1125,
 /*   340 */  1129, 1130, 1116, 1089, 1132, 1135, 1013, 1133, 1134, 1115,
 /*   350 */  1026, 1138, 1131, 1140, 1148, 1021, 1185, 1176, 1179, 1180,
 /*   360 */  1182, 1187, 1189, 1191, 1106, 1149, 1158, 1160, 1163, 1161,
 /*   370 */  1165, 1167, 1168, 1121, 1170, 1233, 1197, 1117, 1173, 1166,
 /*   380 */  1169, 1171, 1221, 1175, 1174, 1177, 1208, 1210, 1184, 1181,
 /*   390 */  1211, 1186, 1188, 1218, 1190, 1192, 1219, 1194, 1195, 1222,
 /*   400 */  1198, 1172, 1183, 1193, 1196, 1239, 1199, 1200, 1226, 1178,
 /*   410 */  1201, 1202, 1230, 1047, 1251, 1227, 1231, 1252, 1241, 1242,
 /*   420 */  1245, 1246, 1247, 1248, 1250, 1267, 1253, 1047, 1254, 1255,
 /*   430 */  1256, 1257, 1258, 1259, 1260, 1261, 1300, 1263, 1266, 1262,
 /*   440 */  1303, 1268, 1270, 1304, 1308, 1287, 1289, 1290, 1291, 1293,
 /*   450 */  1295,
549
};
X
Xiaoyu Wang 已提交
550 551 552
#define YY_REDUCE_COUNT (200)
#define YY_REDUCE_MIN   (-251)
#define YY_REDUCE_MAX   (970)
553
static const short yy_reduce_ofst[] = {
X
Xiaoyu Wang 已提交
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
 /*     0 */   -11,  -17, -171,   27,  156,  179,  223,  267,  372,  404,
 /*    10 */   455,  463,   95,  524,  544, -180,  549,  590,  595,  667,
 /*    20 */   678,  715,  745,  765,  788,  812,  818,  859,  870,  907,
 /*    30 */   918,  948,  970, -168,  276,  334,  184, -169,   75,   74,
 /*    40 */   220,  288, -224,  -57,   16,  127,  129,  -73, -119, -193,
 /*    50 */  -149, -251, -219,   37,  210,  256,   65,  306,  154,   90,
 /*    60 */    67,  180,  357,  192, -165, -165, -165,  -48, -162,   -8,
 /*    70 */   -28,   38,   19,  111,  227,  255,  260,  266,  273,  283,
 /*    80 */   331,  332,  336,  339,  350,  355,  356,  379,  380,  382,
 /*    90 */   395,  307, -184,   43,  193,  290,  352,  278,  215,   50,
 /*   100 */   344,  418,  373, -201, -163,  432,  442,  456,  513,  504,
 /*   110 */   414,  437,  492,  449,  543,  523,  520,  520,  520,  581,
 /*   120 */   525,  533,  566,  620,  607,  614,  630,  660,  625,  664,
 /*   130 */   645,  638,  681,  682,  685,  684,  691,  673,  675,  677,
 /*   140 */   687,  689,  692,  696,  697,  698,  704,  706,  690,  702,
 /*   150 */   701,  724,  656,  723,  703,  699,  725,  693,  657,  708,
 /*   160 */   710,  663,  711,  713,  714,  669,  668,  712,  717,  520,
 /*   170 */   747,  726,  716,  718,  720,  719,  735,  581,  752,  755,
 /*   180 */   756,  763,  769,  774,  777,  776,  819,  800,  820,  799,
 /*   190 */   804,  821,  822,  823,  829,  833,  789,  832,  834,  844,
 /*   200 */   838,
575 576
};
static const YYACTIONTYPE yy_default[] = {
X
Xiaoyu Wang 已提交
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622
 /*     0 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*    10 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*    20 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*    30 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*    40 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1109, 1056, 1056,
 /*    50 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*    60 */  1056, 1056, 1056, 1107, 1056, 1338, 1056, 1225, 1056, 1056,
 /*    70 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*    80 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*    90 */  1056, 1056, 1109, 1349, 1349, 1349, 1107, 1056, 1056, 1056,
 /*   100 */  1056, 1056, 1194, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   110 */  1413, 1056, 1147, 1373, 1056, 1365, 1341, 1355, 1342, 1056,
 /*   120 */  1398, 1358, 1251, 1056, 1230, 1227, 1227, 1056, 1056, 1109,
 /*   130 */  1056, 1056, 1109, 1109, 1056, 1109, 1056, 1056, 1056, 1056,
 /*   140 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   150 */  1056, 1056, 1056, 1107, 1056, 1056, 1107, 1056, 1380, 1378,
 /*   160 */  1056, 1380, 1378, 1056, 1056, 1392, 1388, 1371, 1369, 1355,
 /*   170 */  1056, 1056, 1056, 1416, 1404, 1400, 1056, 1056, 1378, 1056,
 /*   180 */  1056, 1378, 1056, 1238, 1056, 1056, 1107, 1056, 1107, 1056,
 /*   190 */  1163, 1056, 1056, 1056, 1107, 1056, 1253, 1197, 1197, 1110,
 /*   200 */  1061, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   210 */  1056, 1056, 1303, 1391, 1390, 1302, 1315, 1314, 1313, 1056,
 /*   220 */  1056, 1056, 1297, 1298, 1296, 1295, 1056, 1056, 1056, 1056,
 /*   230 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1339, 1056, 1401,
 /*   240 */  1405, 1056, 1056, 1056, 1281, 1056, 1056, 1056, 1056, 1056,
 /*   250 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   260 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   270 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   280 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   290 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   300 */  1056, 1208, 1056, 1056, 1056, 1056, 1056, 1056, 1133, 1056,
 /*   310 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   320 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   330 */  1056, 1362, 1372, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   340 */  1056, 1056, 1056, 1281, 1056, 1389, 1056, 1348, 1344, 1056,
 /*   350 */  1056, 1340, 1056, 1056, 1399, 1056, 1056, 1056, 1056, 1056,
 /*   360 */  1056, 1056, 1056, 1334, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   370 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   380 */  1280, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1191, 1056,
 /*   390 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   400 */  1056, 1176, 1174, 1173, 1172, 1056, 1169, 1056, 1056, 1056,
 /*   410 */  1056, 1056, 1056, 1199, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   420 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1119, 1056, 1056,
 /*   430 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   440 */  1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
 /*   450 */  1056,
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679
};
/********** End of lemon-generated parsing tables *****************************/

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

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

/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
  yyStackEntry *yytos;          /* Pointer to top element of the stack */
#ifdef YYTRACKMAXSTACKDEPTH
  int yyhwm;                    /* High-water mark of the stack */
#endif
#ifndef YYNOERRORRECOVERY
  int yyerrcnt;                 /* Shifts left before out of the error */
#endif
X
Xiaoyu Wang 已提交
680 681
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716
#if YYSTACKDEPTH<=0
  int yystksz;                  /* Current side of the stack */
  yyStackEntry *yystack;        /* The parser's stack */
  yyStackEntry yystk0;          /* First stack entry */
#else
  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
  yyStackEntry *yystackEnd;            /* Last entry in the stack */
#endif
};
typedef struct yyParser yyParser;

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

#ifndef NDEBUG
/* 
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message.  Tracing is turned off
** by making either argument NULL 
**
** Inputs:
** <ul>
** <li> A FILE* to which trace output should be written.
**      If NULL, then tracing is turned off.
** <li> A prefix string written at the beginning of every
**      line of trace output.  If NULL, then tracing is
**      turned off.
** </ul>
**
** Outputs:
** None.
*/
X
Xiaoyu Wang 已提交
717
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
718 719 720 721 722 723 724 725 726 727 728 729
  yyTraceFILE = TraceFILE;
  yyTracePrompt = zTracePrompt;
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
#endif /* NDEBUG */

#if defined(YYCOVERAGE) || !defined(NDEBUG)
/* For tracing shifts, the names of all terminals and nonterminals
** are required.  The following table supplies these names */
static const char *const yyTokenName[] = { 
  /*    0 */ "$",
730 731
  /*    1 */ "OR",
  /*    2 */ "AND",
732 733 734 735 736
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
737 738 739 740 741 742 743 744 745 746
  /*    8 */ "NK_BITAND",
  /*    9 */ "NK_BITOR",
  /*   10 */ "NK_LSHIFT",
  /*   11 */ "NK_RSHIFT",
  /*   12 */ "NK_PLUS",
  /*   13 */ "NK_MINUS",
  /*   14 */ "NK_STAR",
  /*   15 */ "NK_SLASH",
  /*   16 */ "NK_REM",
  /*   17 */ "NK_CONCAT",
747
  /*   18 */ "CREATE",
748 749 750
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
751 752 753 754 755 756 757 758 759 760 761 762
  /*   22 */ "NK_STRING",
  /*   23 */ "ALTER",
  /*   24 */ "PPS",
  /*   25 */ "TSERIES",
  /*   26 */ "STORAGE",
  /*   27 */ "STREAMS",
  /*   28 */ "QTIME",
  /*   29 */ "DBS",
  /*   30 */ "USERS",
  /*   31 */ "CONNS",
  /*   32 */ "STATE",
  /*   33 */ "USER",
763 764
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795
  /*   36 */ "DNODE",
  /*   37 */ "PORT",
  /*   38 */ "NK_INTEGER",
  /*   39 */ "DNODES",
  /*   40 */ "NK_IPTOKEN",
  /*   41 */ "LOCAL",
  /*   42 */ "QNODE",
  /*   43 */ "ON",
  /*   44 */ "DATABASE",
  /*   45 */ "USE",
  /*   46 */ "IF",
  /*   47 */ "NOT",
  /*   48 */ "EXISTS",
  /*   49 */ "BLOCKS",
  /*   50 */ "CACHE",
  /*   51 */ "CACHELAST",
  /*   52 */ "COMP",
  /*   53 */ "DAYS",
  /*   54 */ "FSYNC",
  /*   55 */ "MAXROWS",
  /*   56 */ "MINROWS",
  /*   57 */ "KEEP",
  /*   58 */ "PRECISION",
  /*   59 */ "QUORUM",
  /*   60 */ "REPLICA",
  /*   61 */ "TTL",
  /*   62 */ "WAL",
  /*   63 */ "VGROUPS",
  /*   64 */ "SINGLE_STABLE",
  /*   65 */ "STREAM_MODE",
  /*   66 */ "RETENTIONS",
X
Xiaoyu Wang 已提交
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810
  /*   67 */ "NK_COMMA",
  /*   68 */ "TABLE",
  /*   69 */ "NK_LP",
  /*   70 */ "NK_RP",
  /*   71 */ "STABLE",
  /*   72 */ "ADD",
  /*   73 */ "COLUMN",
  /*   74 */ "MODIFY",
  /*   75 */ "RENAME",
  /*   76 */ "TAG",
  /*   77 */ "SET",
  /*   78 */ "NK_EQ",
  /*   79 */ "USING",
  /*   80 */ "TAGS",
  /*   81 */ "NK_DOT",
X
Xiaoyu Wang 已提交
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
  /*   82 */ "COMMENT",
  /*   83 */ "BOOL",
  /*   84 */ "TINYINT",
  /*   85 */ "SMALLINT",
  /*   86 */ "INT",
  /*   87 */ "INTEGER",
  /*   88 */ "BIGINT",
  /*   89 */ "FLOAT",
  /*   90 */ "DOUBLE",
  /*   91 */ "BINARY",
  /*   92 */ "TIMESTAMP",
  /*   93 */ "NCHAR",
  /*   94 */ "UNSIGNED",
  /*   95 */ "JSON",
  /*   96 */ "VARCHAR",
  /*   97 */ "MEDIUMBLOB",
  /*   98 */ "BLOB",
  /*   99 */ "VARBINARY",
  /*  100 */ "DECIMAL",
  /*  101 */ "SMA",
  /*  102 */ "ROLLUP",
  /*  103 */ "FILE_FACTOR",
  /*  104 */ "NK_FLOAT",
  /*  105 */ "DELAY",
  /*  106 */ "SHOW",
  /*  107 */ "DATABASES",
  /*  108 */ "TABLES",
  /*  109 */ "STABLES",
  /*  110 */ "MNODES",
  /*  111 */ "MODULES",
  /*  112 */ "QNODES",
  /*  113 */ "FUNCTIONS",
  /*  114 */ "INDEXES",
  /*  115 */ "FROM",
  /*  116 */ "LIKE",
  /*  117 */ "INDEX",
  /*  118 */ "FULLTEXT",
  /*  119 */ "FUNCTION",
  /*  120 */ "INTERVAL",
  /*  121 */ "TOPIC",
  /*  122 */ "AS",
852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920
  /*  123 */ "DESC",
  /*  124 */ "DESCRIBE",
  /*  125 */ "RESET",
  /*  126 */ "QUERY",
  /*  127 */ "EXPLAIN",
  /*  128 */ "ANALYZE",
  /*  129 */ "VERBOSE",
  /*  130 */ "NK_BOOL",
  /*  131 */ "RATIO",
  /*  132 */ "NULL",
  /*  133 */ "NK_VARIABLE",
  /*  134 */ "NK_UNDERLINE",
  /*  135 */ "ROWTS",
  /*  136 */ "TBNAME",
  /*  137 */ "QSTARTTS",
  /*  138 */ "QENDTS",
  /*  139 */ "WSTARTTS",
  /*  140 */ "WENDTS",
  /*  141 */ "WDURATION",
  /*  142 */ "BETWEEN",
  /*  143 */ "IS",
  /*  144 */ "NK_LT",
  /*  145 */ "NK_GT",
  /*  146 */ "NK_LE",
  /*  147 */ "NK_GE",
  /*  148 */ "NK_NE",
  /*  149 */ "MATCH",
  /*  150 */ "NMATCH",
  /*  151 */ "IN",
  /*  152 */ "JOIN",
  /*  153 */ "INNER",
  /*  154 */ "SELECT",
  /*  155 */ "DISTINCT",
  /*  156 */ "WHERE",
  /*  157 */ "PARTITION",
  /*  158 */ "BY",
  /*  159 */ "SESSION",
  /*  160 */ "STATE_WINDOW",
  /*  161 */ "SLIDING",
  /*  162 */ "FILL",
  /*  163 */ "VALUE",
  /*  164 */ "NONE",
  /*  165 */ "PREV",
  /*  166 */ "LINEAR",
  /*  167 */ "NEXT",
  /*  168 */ "GROUP",
  /*  169 */ "HAVING",
  /*  170 */ "ORDER",
  /*  171 */ "SLIMIT",
  /*  172 */ "SOFFSET",
  /*  173 */ "LIMIT",
  /*  174 */ "OFFSET",
  /*  175 */ "ASC",
  /*  176 */ "NULLS",
  /*  177 */ "FIRST",
  /*  178 */ "LAST",
  /*  179 */ "cmd",
  /*  180 */ "account_options",
  /*  181 */ "alter_account_options",
  /*  182 */ "literal",
  /*  183 */ "alter_account_option",
  /*  184 */ "user_name",
  /*  185 */ "dnode_endpoint",
  /*  186 */ "dnode_host_name",
  /*  187 */ "not_exists_opt",
  /*  188 */ "db_name",
  /*  189 */ "db_options",
  /*  190 */ "exists_opt",
  /*  191 */ "alter_db_options",
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 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006
  /*  192 */ "integer_list",
  /*  193 */ "alter_db_option",
  /*  194 */ "full_table_name",
  /*  195 */ "column_def_list",
  /*  196 */ "tags_def_opt",
  /*  197 */ "table_options",
  /*  198 */ "multi_create_clause",
  /*  199 */ "tags_def",
  /*  200 */ "multi_drop_clause",
  /*  201 */ "alter_table_clause",
  /*  202 */ "alter_table_options",
  /*  203 */ "column_name",
  /*  204 */ "type_name",
  /*  205 */ "create_subtable_clause",
  /*  206 */ "specific_tags_opt",
  /*  207 */ "literal_list",
  /*  208 */ "drop_table_clause",
  /*  209 */ "col_name_list",
  /*  210 */ "table_name",
  /*  211 */ "column_def",
  /*  212 */ "func_name_list",
  /*  213 */ "alter_table_option",
  /*  214 */ "col_name",
  /*  215 */ "db_name_cond_opt",
  /*  216 */ "like_pattern_opt",
  /*  217 */ "table_name_cond",
  /*  218 */ "from_db_opt",
  /*  219 */ "func_name",
  /*  220 */ "function_name",
  /*  221 */ "index_name",
  /*  222 */ "index_options",
  /*  223 */ "func_list",
  /*  224 */ "duration_literal",
  /*  225 */ "sliding_opt",
  /*  226 */ "func",
  /*  227 */ "expression_list",
  /*  228 */ "topic_name",
  /*  229 */ "query_expression",
  /*  230 */ "analyze_opt",
  /*  231 */ "explain_options",
  /*  232 */ "signed",
  /*  233 */ "signed_literal",
  /*  234 */ "table_alias",
  /*  235 */ "column_alias",
  /*  236 */ "expression",
  /*  237 */ "pseudo_column",
  /*  238 */ "column_reference",
  /*  239 */ "subquery",
  /*  240 */ "predicate",
  /*  241 */ "compare_op",
  /*  242 */ "in_op",
  /*  243 */ "in_predicate_value",
  /*  244 */ "boolean_value_expression",
  /*  245 */ "boolean_primary",
  /*  246 */ "common_expression",
  /*  247 */ "from_clause",
  /*  248 */ "table_reference_list",
  /*  249 */ "table_reference",
  /*  250 */ "table_primary",
  /*  251 */ "joined_table",
  /*  252 */ "alias_opt",
  /*  253 */ "parenthesized_joined_table",
  /*  254 */ "join_type",
  /*  255 */ "search_condition",
  /*  256 */ "query_specification",
  /*  257 */ "set_quantifier_opt",
  /*  258 */ "select_list",
  /*  259 */ "where_clause_opt",
  /*  260 */ "partition_by_clause_opt",
  /*  261 */ "twindow_clause_opt",
  /*  262 */ "group_by_clause_opt",
  /*  263 */ "having_clause_opt",
  /*  264 */ "select_sublist",
  /*  265 */ "select_item",
  /*  266 */ "fill_opt",
  /*  267 */ "fill_mode",
  /*  268 */ "group_by_list",
  /*  269 */ "query_expression_body",
  /*  270 */ "order_by_clause_opt",
  /*  271 */ "slimit_clause_opt",
  /*  272 */ "limit_clause_opt",
  /*  273 */ "query_primary",
  /*  274 */ "sort_specification_list",
  /*  275 */ "sort_specification",
  /*  276 */ "ordering_specification_opt",
  /*  277 */ "null_ordering_opt",
1007 1008 1009 1010 1011 1012 1013
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
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
 /*   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 已提交
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
 /*  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",
X
Xiaoyu Wang 已提交
1074
 /*  60 */ "db_options ::= db_options KEEP integer_list",
X
Xiaoyu Wang 已提交
1075 1076 1077 1078 1079 1080 1081 1082 1083
 /*  61 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  62 */ "db_options ::= db_options QUORUM NK_INTEGER",
 /*  63 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  64 */ "db_options ::= db_options TTL NK_INTEGER",
 /*  65 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  66 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  67 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  68 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
 /*  69 */ "db_options ::= db_options RETENTIONS NK_STRING",
X
Xiaoyu Wang 已提交
1084 1085 1086 1087
 /*  70 */ "alter_db_options ::= alter_db_option",
 /*  71 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  72 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  73 */ "alter_db_option ::= FSYNC NK_INTEGER",
X
Xiaoyu Wang 已提交
1088
 /*  74 */ "alter_db_option ::= KEEP integer_list",
X
Xiaoyu Wang 已提交
1089 1090 1091
 /*  75 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  76 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  77 */ "alter_db_option ::= CACHELAST NK_INTEGER",
X
Xiaoyu Wang 已提交
1092
 /*  78 */ "alter_db_option ::= REPLICA NK_INTEGER",
X
Xiaoyu Wang 已提交
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373
 /*  79 */ "integer_list ::= NK_INTEGER",
 /*  80 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
 /*  81 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /*  82 */ "cmd ::= CREATE TABLE multi_create_clause",
 /*  83 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /*  84 */ "cmd ::= DROP TABLE multi_drop_clause",
 /*  85 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /*  86 */ "cmd ::= ALTER TABLE alter_table_clause",
 /*  87 */ "cmd ::= ALTER STABLE alter_table_clause",
 /*  88 */ "alter_table_clause ::= full_table_name alter_table_options",
 /*  89 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /*  90 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /*  91 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /*  92 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /*  93 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /*  94 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /*  95 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /*  96 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /*  97 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /*  98 */ "multi_create_clause ::= create_subtable_clause",
 /*  99 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /* 100 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
 /* 101 */ "multi_drop_clause ::= drop_table_clause",
 /* 102 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 103 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 104 */ "specific_tags_opt ::=",
 /* 105 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 106 */ "full_table_name ::= table_name",
 /* 107 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 108 */ "column_def_list ::= column_def",
 /* 109 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 110 */ "column_def ::= column_name type_name",
 /* 111 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 112 */ "type_name ::= BOOL",
 /* 113 */ "type_name ::= TINYINT",
 /* 114 */ "type_name ::= SMALLINT",
 /* 115 */ "type_name ::= INT",
 /* 116 */ "type_name ::= INTEGER",
 /* 117 */ "type_name ::= BIGINT",
 /* 118 */ "type_name ::= FLOAT",
 /* 119 */ "type_name ::= DOUBLE",
 /* 120 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 121 */ "type_name ::= TIMESTAMP",
 /* 122 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 123 */ "type_name ::= TINYINT UNSIGNED",
 /* 124 */ "type_name ::= SMALLINT UNSIGNED",
 /* 125 */ "type_name ::= INT UNSIGNED",
 /* 126 */ "type_name ::= BIGINT UNSIGNED",
 /* 127 */ "type_name ::= JSON",
 /* 128 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 129 */ "type_name ::= MEDIUMBLOB",
 /* 130 */ "type_name ::= BLOB",
 /* 131 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 132 */ "type_name ::= DECIMAL",
 /* 133 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 134 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 135 */ "tags_def_opt ::=",
 /* 136 */ "tags_def_opt ::= tags_def",
 /* 137 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 138 */ "table_options ::=",
 /* 139 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 140 */ "table_options ::= table_options KEEP integer_list",
 /* 141 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 142 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 143 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 144 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 145 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 146 */ "alter_table_options ::= alter_table_option",
 /* 147 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 148 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 149 */ "alter_table_option ::= KEEP integer_list",
 /* 150 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 151 */ "col_name_list ::= col_name",
 /* 152 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 153 */ "col_name ::= column_name",
 /* 154 */ "cmd ::= SHOW DNODES",
 /* 155 */ "cmd ::= SHOW USERS",
 /* 156 */ "cmd ::= SHOW DATABASES",
 /* 157 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 158 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 159 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 160 */ "cmd ::= SHOW MNODES",
 /* 161 */ "cmd ::= SHOW MODULES",
 /* 162 */ "cmd ::= SHOW QNODES",
 /* 163 */ "cmd ::= SHOW FUNCTIONS",
 /* 164 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 165 */ "cmd ::= SHOW STREAMS",
 /* 166 */ "db_name_cond_opt ::=",
 /* 167 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 168 */ "like_pattern_opt ::=",
 /* 169 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 170 */ "table_name_cond ::= table_name",
 /* 171 */ "from_db_opt ::=",
 /* 172 */ "from_db_opt ::= FROM db_name",
 /* 173 */ "func_name_list ::= func_name",
 /* 174 */ "func_name_list ::= func_name_list NK_COMMA col_name",
 /* 175 */ "func_name ::= function_name",
 /* 176 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 177 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 178 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 179 */ "index_options ::=",
 /* 180 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 181 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 182 */ "func_list ::= func",
 /* 183 */ "func_list ::= func_list NK_COMMA func",
 /* 184 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 185 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
 /* 186 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
 /* 187 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 188 */ "cmd ::= DESC full_table_name",
 /* 189 */ "cmd ::= DESCRIBE full_table_name",
 /* 190 */ "cmd ::= RESET QUERY CACHE",
 /* 191 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression",
 /* 192 */ "analyze_opt ::=",
 /* 193 */ "analyze_opt ::= ANALYZE",
 /* 194 */ "explain_options ::=",
 /* 195 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 196 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 197 */ "cmd ::= query_expression",
 /* 198 */ "literal ::= NK_INTEGER",
 /* 199 */ "literal ::= NK_FLOAT",
 /* 200 */ "literal ::= NK_STRING",
 /* 201 */ "literal ::= NK_BOOL",
 /* 202 */ "literal ::= TIMESTAMP NK_STRING",
 /* 203 */ "literal ::= duration_literal",
 /* 204 */ "literal ::= NULL",
 /* 205 */ "duration_literal ::= NK_VARIABLE",
 /* 206 */ "signed ::= NK_INTEGER",
 /* 207 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 208 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 209 */ "signed ::= NK_FLOAT",
 /* 210 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 211 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 212 */ "signed_literal ::= signed",
 /* 213 */ "signed_literal ::= NK_STRING",
 /* 214 */ "signed_literal ::= NK_BOOL",
 /* 215 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 216 */ "signed_literal ::= duration_literal",
 /* 217 */ "signed_literal ::= NULL",
 /* 218 */ "literal_list ::= signed_literal",
 /* 219 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 220 */ "db_name ::= NK_ID",
 /* 221 */ "table_name ::= NK_ID",
 /* 222 */ "column_name ::= NK_ID",
 /* 223 */ "function_name ::= NK_ID",
 /* 224 */ "table_alias ::= NK_ID",
 /* 225 */ "column_alias ::= NK_ID",
 /* 226 */ "user_name ::= NK_ID",
 /* 227 */ "index_name ::= NK_ID",
 /* 228 */ "topic_name ::= NK_ID",
 /* 229 */ "expression ::= literal",
 /* 230 */ "expression ::= pseudo_column",
 /* 231 */ "expression ::= column_reference",
 /* 232 */ "expression ::= function_name NK_LP expression_list NK_RP",
 /* 233 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
 /* 234 */ "expression ::= subquery",
 /* 235 */ "expression ::= NK_LP expression NK_RP",
 /* 236 */ "expression ::= NK_PLUS expression",
 /* 237 */ "expression ::= NK_MINUS expression",
 /* 238 */ "expression ::= expression NK_PLUS expression",
 /* 239 */ "expression ::= expression NK_MINUS expression",
 /* 240 */ "expression ::= expression NK_STAR expression",
 /* 241 */ "expression ::= expression NK_SLASH expression",
 /* 242 */ "expression ::= expression NK_REM expression",
 /* 243 */ "expression_list ::= expression",
 /* 244 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 245 */ "column_reference ::= column_name",
 /* 246 */ "column_reference ::= table_name NK_DOT column_name",
 /* 247 */ "pseudo_column ::= NK_UNDERLINE ROWTS",
 /* 248 */ "pseudo_column ::= TBNAME",
 /* 249 */ "pseudo_column ::= NK_UNDERLINE QSTARTTS",
 /* 250 */ "pseudo_column ::= NK_UNDERLINE QENDTS",
 /* 251 */ "pseudo_column ::= NK_UNDERLINE WSTARTTS",
 /* 252 */ "pseudo_column ::= NK_UNDERLINE WENDTS",
 /* 253 */ "pseudo_column ::= NK_UNDERLINE WDURATION",
 /* 254 */ "predicate ::= expression compare_op expression",
 /* 255 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 256 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 257 */ "predicate ::= expression IS NULL",
 /* 258 */ "predicate ::= expression IS NOT NULL",
 /* 259 */ "predicate ::= expression in_op in_predicate_value",
 /* 260 */ "compare_op ::= NK_LT",
 /* 261 */ "compare_op ::= NK_GT",
 /* 262 */ "compare_op ::= NK_LE",
 /* 263 */ "compare_op ::= NK_GE",
 /* 264 */ "compare_op ::= NK_NE",
 /* 265 */ "compare_op ::= NK_EQ",
 /* 266 */ "compare_op ::= LIKE",
 /* 267 */ "compare_op ::= NOT LIKE",
 /* 268 */ "compare_op ::= MATCH",
 /* 269 */ "compare_op ::= NMATCH",
 /* 270 */ "in_op ::= IN",
 /* 271 */ "in_op ::= NOT IN",
 /* 272 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 273 */ "boolean_value_expression ::= boolean_primary",
 /* 274 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 275 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 276 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 277 */ "boolean_primary ::= predicate",
 /* 278 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 279 */ "common_expression ::= expression",
 /* 280 */ "common_expression ::= boolean_value_expression",
 /* 281 */ "from_clause ::= FROM table_reference_list",
 /* 282 */ "table_reference_list ::= table_reference",
 /* 283 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 284 */ "table_reference ::= table_primary",
 /* 285 */ "table_reference ::= joined_table",
 /* 286 */ "table_primary ::= table_name alias_opt",
 /* 287 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 288 */ "table_primary ::= subquery alias_opt",
 /* 289 */ "table_primary ::= parenthesized_joined_table",
 /* 290 */ "alias_opt ::=",
 /* 291 */ "alias_opt ::= table_alias",
 /* 292 */ "alias_opt ::= AS table_alias",
 /* 293 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 294 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 295 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 296 */ "join_type ::=",
 /* 297 */ "join_type ::= INNER",
 /* 298 */ "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",
 /* 299 */ "set_quantifier_opt ::=",
 /* 300 */ "set_quantifier_opt ::= DISTINCT",
 /* 301 */ "set_quantifier_opt ::= ALL",
 /* 302 */ "select_list ::= NK_STAR",
 /* 303 */ "select_list ::= select_sublist",
 /* 304 */ "select_sublist ::= select_item",
 /* 305 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 306 */ "select_item ::= common_expression",
 /* 307 */ "select_item ::= common_expression column_alias",
 /* 308 */ "select_item ::= common_expression AS column_alias",
 /* 309 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 310 */ "where_clause_opt ::=",
 /* 311 */ "where_clause_opt ::= WHERE search_condition",
 /* 312 */ "partition_by_clause_opt ::=",
 /* 313 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 314 */ "twindow_clause_opt ::=",
 /* 315 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 316 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP",
 /* 317 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 318 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 319 */ "sliding_opt ::=",
 /* 320 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 321 */ "fill_opt ::=",
 /* 322 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 323 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 324 */ "fill_mode ::= NONE",
 /* 325 */ "fill_mode ::= PREV",
 /* 326 */ "fill_mode ::= NULL",
 /* 327 */ "fill_mode ::= LINEAR",
 /* 328 */ "fill_mode ::= NEXT",
 /* 329 */ "group_by_clause_opt ::=",
 /* 330 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 331 */ "group_by_list ::= expression",
 /* 332 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 333 */ "having_clause_opt ::=",
 /* 334 */ "having_clause_opt ::= HAVING search_condition",
 /* 335 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 336 */ "query_expression_body ::= query_primary",
 /* 337 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 338 */ "query_primary ::= query_specification",
 /* 339 */ "order_by_clause_opt ::=",
 /* 340 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 341 */ "slimit_clause_opt ::=",
 /* 342 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 343 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 344 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 345 */ "limit_clause_opt ::=",
 /* 346 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 347 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 348 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 349 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 350 */ "search_condition ::= common_expression",
 /* 351 */ "sort_specification_list ::= sort_specification",
 /* 352 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 353 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 354 */ "ordering_specification_opt ::=",
 /* 355 */ "ordering_specification_opt ::= ASC",
 /* 356 */ "ordering_specification_opt ::= DESC",
 /* 357 */ "null_ordering_opt ::=",
 /* 358 */ "null_ordering_opt ::= NULLS FIRST",
 /* 359 */ "null_ordering_opt ::= NULLS LAST",
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390
};
#endif /* NDEBUG */


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

  newSize = p->yystksz*2 + 100;
  idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
  if( p->yystack==&p->yystk0 ){
X
Xiaoyu Wang 已提交
1391
    pNew = malloc(newSize*sizeof(pNew[0]));
1392 1393
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1394
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411
  }
  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 已提交
1412
** second argument to ParseAlloc() below.  This can be changed by
1413 1414 1415 1416 1417 1418 1419 1420 1421
** 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 已提交
1422
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1423
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1424
  ParseCTX_STORE
1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447
#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 已提交
1448
#ifndef Parse_ENGINEALWAYSONSTACK
1449 1450 1451 1452 1453 1454 1455 1456 1457 1458
/* 
** 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 已提交
1459
** to Parse and ParseFree.
1460
*/
X
Xiaoyu Wang 已提交
1461
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
1462 1463 1464
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
1465 1466
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
1467 1468 1469
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
1470
#endif /* Parse_ENGINEALWAYSONSTACK */
1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484


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

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

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

/*
** 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 已提交
1899
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
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
){
  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[] = {
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
  {  179,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  179,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  180,    0 }, /* (2) account_options ::= */
  {  180,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  180,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  180,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  180,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  180,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  180,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  180,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  180,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  180,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  181,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  181,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  183,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  183,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  183,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  183,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  183,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  183,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  183,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  183,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  183,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  183,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  179,   -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
  {  179,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  179,   -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
  {  179,   -3 }, /* (27) cmd ::= DROP USER user_name */
  {  179,   -3 }, /* (28) cmd ::= CREATE DNODE dnode_endpoint */
  {  179,   -5 }, /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
  {  179,   -3 }, /* (30) cmd ::= DROP DNODE NK_INTEGER */
  {  179,   -3 }, /* (31) cmd ::= DROP DNODE dnode_endpoint */
  {  179,   -4 }, /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  179,   -5 }, /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  179,   -4 }, /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
  {  179,   -5 }, /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  185,   -1 }, /* (36) dnode_endpoint ::= NK_STRING */
  {  186,   -1 }, /* (37) dnode_host_name ::= NK_ID */
  {  186,   -1 }, /* (38) dnode_host_name ::= NK_IPTOKEN */
  {  179,   -3 }, /* (39) cmd ::= ALTER LOCAL NK_STRING */
  {  179,   -4 }, /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  179,   -5 }, /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  179,   -5 }, /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  179,   -5 }, /* (43) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  179,   -4 }, /* (44) cmd ::= DROP DATABASE exists_opt db_name */
  {  179,   -2 }, /* (45) cmd ::= USE db_name */
  {  179,   -4 }, /* (46) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  187,   -3 }, /* (47) not_exists_opt ::= IF NOT EXISTS */
  {  187,    0 }, /* (48) not_exists_opt ::= */
  {  190,   -2 }, /* (49) exists_opt ::= IF EXISTS */
  {  190,    0 }, /* (50) exists_opt ::= */
  {  189,    0 }, /* (51) db_options ::= */
  {  189,   -3 }, /* (52) db_options ::= db_options BLOCKS NK_INTEGER */
  {  189,   -3 }, /* (53) db_options ::= db_options CACHE NK_INTEGER */
  {  189,   -3 }, /* (54) db_options ::= db_options CACHELAST NK_INTEGER */
  {  189,   -3 }, /* (55) db_options ::= db_options COMP NK_INTEGER */
  {  189,   -3 }, /* (56) db_options ::= db_options DAYS NK_INTEGER */
  {  189,   -3 }, /* (57) db_options ::= db_options FSYNC NK_INTEGER */
  {  189,   -3 }, /* (58) db_options ::= db_options MAXROWS NK_INTEGER */
  {  189,   -3 }, /* (59) db_options ::= db_options MINROWS NK_INTEGER */
X
Xiaoyu Wang 已提交
2001
  {  189,   -3 }, /* (60) db_options ::= db_options KEEP integer_list */
2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012
  {  189,   -3 }, /* (61) db_options ::= db_options PRECISION NK_STRING */
  {  189,   -3 }, /* (62) db_options ::= db_options QUORUM NK_INTEGER */
  {  189,   -3 }, /* (63) db_options ::= db_options REPLICA NK_INTEGER */
  {  189,   -3 }, /* (64) db_options ::= db_options TTL NK_INTEGER */
  {  189,   -3 }, /* (65) db_options ::= db_options WAL NK_INTEGER */
  {  189,   -3 }, /* (66) db_options ::= db_options VGROUPS NK_INTEGER */
  {  189,   -3 }, /* (67) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  189,   -3 }, /* (68) db_options ::= db_options STREAM_MODE NK_INTEGER */
  {  189,   -3 }, /* (69) db_options ::= db_options RETENTIONS NK_STRING */
  {  191,   -1 }, /* (70) alter_db_options ::= alter_db_option */
  {  191,   -2 }, /* (71) alter_db_options ::= alter_db_options alter_db_option */
X
Xiaoyu Wang 已提交
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 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300
  {  193,   -2 }, /* (72) alter_db_option ::= BLOCKS NK_INTEGER */
  {  193,   -2 }, /* (73) alter_db_option ::= FSYNC NK_INTEGER */
  {  193,   -2 }, /* (74) alter_db_option ::= KEEP integer_list */
  {  193,   -2 }, /* (75) alter_db_option ::= WAL NK_INTEGER */
  {  193,   -2 }, /* (76) alter_db_option ::= QUORUM NK_INTEGER */
  {  193,   -2 }, /* (77) alter_db_option ::= CACHELAST NK_INTEGER */
  {  193,   -2 }, /* (78) alter_db_option ::= REPLICA NK_INTEGER */
  {  192,   -1 }, /* (79) integer_list ::= NK_INTEGER */
  {  192,   -3 }, /* (80) integer_list ::= integer_list NK_COMMA NK_INTEGER */
  {  179,   -9 }, /* (81) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  179,   -3 }, /* (82) cmd ::= CREATE TABLE multi_create_clause */
  {  179,   -9 }, /* (83) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  179,   -3 }, /* (84) cmd ::= DROP TABLE multi_drop_clause */
  {  179,   -4 }, /* (85) cmd ::= DROP STABLE exists_opt full_table_name */
  {  179,   -3 }, /* (86) cmd ::= ALTER TABLE alter_table_clause */
  {  179,   -3 }, /* (87) cmd ::= ALTER STABLE alter_table_clause */
  {  201,   -2 }, /* (88) alter_table_clause ::= full_table_name alter_table_options */
  {  201,   -5 }, /* (89) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  201,   -4 }, /* (90) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  201,   -5 }, /* (91) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  201,   -5 }, /* (92) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  201,   -5 }, /* (93) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  201,   -4 }, /* (94) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  201,   -5 }, /* (95) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  201,   -5 }, /* (96) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  201,   -6 }, /* (97) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
  {  198,   -1 }, /* (98) multi_create_clause ::= create_subtable_clause */
  {  198,   -2 }, /* (99) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  205,   -9 }, /* (100) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
  {  200,   -1 }, /* (101) multi_drop_clause ::= drop_table_clause */
  {  200,   -2 }, /* (102) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  208,   -2 }, /* (103) drop_table_clause ::= exists_opt full_table_name */
  {  206,    0 }, /* (104) specific_tags_opt ::= */
  {  206,   -3 }, /* (105) specific_tags_opt ::= NK_LP col_name_list NK_RP */
  {  194,   -1 }, /* (106) full_table_name ::= table_name */
  {  194,   -3 }, /* (107) full_table_name ::= db_name NK_DOT table_name */
  {  195,   -1 }, /* (108) column_def_list ::= column_def */
  {  195,   -3 }, /* (109) column_def_list ::= column_def_list NK_COMMA column_def */
  {  211,   -2 }, /* (110) column_def ::= column_name type_name */
  {  211,   -4 }, /* (111) column_def ::= column_name type_name COMMENT NK_STRING */
  {  204,   -1 }, /* (112) type_name ::= BOOL */
  {  204,   -1 }, /* (113) type_name ::= TINYINT */
  {  204,   -1 }, /* (114) type_name ::= SMALLINT */
  {  204,   -1 }, /* (115) type_name ::= INT */
  {  204,   -1 }, /* (116) type_name ::= INTEGER */
  {  204,   -1 }, /* (117) type_name ::= BIGINT */
  {  204,   -1 }, /* (118) type_name ::= FLOAT */
  {  204,   -1 }, /* (119) type_name ::= DOUBLE */
  {  204,   -4 }, /* (120) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  204,   -1 }, /* (121) type_name ::= TIMESTAMP */
  {  204,   -4 }, /* (122) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  204,   -2 }, /* (123) type_name ::= TINYINT UNSIGNED */
  {  204,   -2 }, /* (124) type_name ::= SMALLINT UNSIGNED */
  {  204,   -2 }, /* (125) type_name ::= INT UNSIGNED */
  {  204,   -2 }, /* (126) type_name ::= BIGINT UNSIGNED */
  {  204,   -1 }, /* (127) type_name ::= JSON */
  {  204,   -4 }, /* (128) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  204,   -1 }, /* (129) type_name ::= MEDIUMBLOB */
  {  204,   -1 }, /* (130) type_name ::= BLOB */
  {  204,   -4 }, /* (131) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  204,   -1 }, /* (132) type_name ::= DECIMAL */
  {  204,   -4 }, /* (133) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  204,   -6 }, /* (134) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  196,    0 }, /* (135) tags_def_opt ::= */
  {  196,   -1 }, /* (136) tags_def_opt ::= tags_def */
  {  199,   -4 }, /* (137) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  197,    0 }, /* (138) table_options ::= */
  {  197,   -3 }, /* (139) table_options ::= table_options COMMENT NK_STRING */
  {  197,   -3 }, /* (140) table_options ::= table_options KEEP integer_list */
  {  197,   -3 }, /* (141) table_options ::= table_options TTL NK_INTEGER */
  {  197,   -5 }, /* (142) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  197,   -5 }, /* (143) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
  {  197,   -3 }, /* (144) table_options ::= table_options FILE_FACTOR NK_FLOAT */
  {  197,   -3 }, /* (145) table_options ::= table_options DELAY NK_INTEGER */
  {  202,   -1 }, /* (146) alter_table_options ::= alter_table_option */
  {  202,   -2 }, /* (147) alter_table_options ::= alter_table_options alter_table_option */
  {  213,   -2 }, /* (148) alter_table_option ::= COMMENT NK_STRING */
  {  213,   -2 }, /* (149) alter_table_option ::= KEEP integer_list */
  {  213,   -2 }, /* (150) alter_table_option ::= TTL NK_INTEGER */
  {  209,   -1 }, /* (151) col_name_list ::= col_name */
  {  209,   -3 }, /* (152) col_name_list ::= col_name_list NK_COMMA col_name */
  {  214,   -1 }, /* (153) col_name ::= column_name */
  {  179,   -2 }, /* (154) cmd ::= SHOW DNODES */
  {  179,   -2 }, /* (155) cmd ::= SHOW USERS */
  {  179,   -2 }, /* (156) cmd ::= SHOW DATABASES */
  {  179,   -4 }, /* (157) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  179,   -4 }, /* (158) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  179,   -3 }, /* (159) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  179,   -2 }, /* (160) cmd ::= SHOW MNODES */
  {  179,   -2 }, /* (161) cmd ::= SHOW MODULES */
  {  179,   -2 }, /* (162) cmd ::= SHOW QNODES */
  {  179,   -2 }, /* (163) cmd ::= SHOW FUNCTIONS */
  {  179,   -5 }, /* (164) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  179,   -2 }, /* (165) cmd ::= SHOW STREAMS */
  {  215,    0 }, /* (166) db_name_cond_opt ::= */
  {  215,   -2 }, /* (167) db_name_cond_opt ::= db_name NK_DOT */
  {  216,    0 }, /* (168) like_pattern_opt ::= */
  {  216,   -2 }, /* (169) like_pattern_opt ::= LIKE NK_STRING */
  {  217,   -1 }, /* (170) table_name_cond ::= table_name */
  {  218,    0 }, /* (171) from_db_opt ::= */
  {  218,   -2 }, /* (172) from_db_opt ::= FROM db_name */
  {  212,   -1 }, /* (173) func_name_list ::= func_name */
  {  212,   -3 }, /* (174) func_name_list ::= func_name_list NK_COMMA col_name */
  {  219,   -1 }, /* (175) func_name ::= function_name */
  {  179,   -8 }, /* (176) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
  {  179,  -10 }, /* (177) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
  {  179,   -6 }, /* (178) cmd ::= DROP INDEX exists_opt index_name ON table_name */
  {  222,    0 }, /* (179) index_options ::= */
  {  222,   -9 }, /* (180) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  {  222,  -11 }, /* (181) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
  {  223,   -1 }, /* (182) func_list ::= func */
  {  223,   -3 }, /* (183) func_list ::= func_list NK_COMMA func */
  {  226,   -4 }, /* (184) func ::= function_name NK_LP expression_list NK_RP */
  {  179,   -6 }, /* (185) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
  {  179,   -6 }, /* (186) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
  {  179,   -4 }, /* (187) cmd ::= DROP TOPIC exists_opt topic_name */
  {  179,   -2 }, /* (188) cmd ::= DESC full_table_name */
  {  179,   -2 }, /* (189) cmd ::= DESCRIBE full_table_name */
  {  179,   -3 }, /* (190) cmd ::= RESET QUERY CACHE */
  {  179,   -4 }, /* (191) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
  {  230,    0 }, /* (192) analyze_opt ::= */
  {  230,   -1 }, /* (193) analyze_opt ::= ANALYZE */
  {  231,    0 }, /* (194) explain_options ::= */
  {  231,   -3 }, /* (195) explain_options ::= explain_options VERBOSE NK_BOOL */
  {  231,   -3 }, /* (196) explain_options ::= explain_options RATIO NK_FLOAT */
  {  179,   -1 }, /* (197) cmd ::= query_expression */
  {  182,   -1 }, /* (198) literal ::= NK_INTEGER */
  {  182,   -1 }, /* (199) literal ::= NK_FLOAT */
  {  182,   -1 }, /* (200) literal ::= NK_STRING */
  {  182,   -1 }, /* (201) literal ::= NK_BOOL */
  {  182,   -2 }, /* (202) literal ::= TIMESTAMP NK_STRING */
  {  182,   -1 }, /* (203) literal ::= duration_literal */
  {  182,   -1 }, /* (204) literal ::= NULL */
  {  224,   -1 }, /* (205) duration_literal ::= NK_VARIABLE */
  {  232,   -1 }, /* (206) signed ::= NK_INTEGER */
  {  232,   -2 }, /* (207) signed ::= NK_PLUS NK_INTEGER */
  {  232,   -2 }, /* (208) signed ::= NK_MINUS NK_INTEGER */
  {  232,   -1 }, /* (209) signed ::= NK_FLOAT */
  {  232,   -2 }, /* (210) signed ::= NK_PLUS NK_FLOAT */
  {  232,   -2 }, /* (211) signed ::= NK_MINUS NK_FLOAT */
  {  233,   -1 }, /* (212) signed_literal ::= signed */
  {  233,   -1 }, /* (213) signed_literal ::= NK_STRING */
  {  233,   -1 }, /* (214) signed_literal ::= NK_BOOL */
  {  233,   -2 }, /* (215) signed_literal ::= TIMESTAMP NK_STRING */
  {  233,   -1 }, /* (216) signed_literal ::= duration_literal */
  {  233,   -1 }, /* (217) signed_literal ::= NULL */
  {  207,   -1 }, /* (218) literal_list ::= signed_literal */
  {  207,   -3 }, /* (219) literal_list ::= literal_list NK_COMMA signed_literal */
  {  188,   -1 }, /* (220) db_name ::= NK_ID */
  {  210,   -1 }, /* (221) table_name ::= NK_ID */
  {  203,   -1 }, /* (222) column_name ::= NK_ID */
  {  220,   -1 }, /* (223) function_name ::= NK_ID */
  {  234,   -1 }, /* (224) table_alias ::= NK_ID */
  {  235,   -1 }, /* (225) column_alias ::= NK_ID */
  {  184,   -1 }, /* (226) user_name ::= NK_ID */
  {  221,   -1 }, /* (227) index_name ::= NK_ID */
  {  228,   -1 }, /* (228) topic_name ::= NK_ID */
  {  236,   -1 }, /* (229) expression ::= literal */
  {  236,   -1 }, /* (230) expression ::= pseudo_column */
  {  236,   -1 }, /* (231) expression ::= column_reference */
  {  236,   -4 }, /* (232) expression ::= function_name NK_LP expression_list NK_RP */
  {  236,   -4 }, /* (233) expression ::= function_name NK_LP NK_STAR NK_RP */
  {  236,   -1 }, /* (234) expression ::= subquery */
  {  236,   -3 }, /* (235) expression ::= NK_LP expression NK_RP */
  {  236,   -2 }, /* (236) expression ::= NK_PLUS expression */
  {  236,   -2 }, /* (237) expression ::= NK_MINUS expression */
  {  236,   -3 }, /* (238) expression ::= expression NK_PLUS expression */
  {  236,   -3 }, /* (239) expression ::= expression NK_MINUS expression */
  {  236,   -3 }, /* (240) expression ::= expression NK_STAR expression */
  {  236,   -3 }, /* (241) expression ::= expression NK_SLASH expression */
  {  236,   -3 }, /* (242) expression ::= expression NK_REM expression */
  {  227,   -1 }, /* (243) expression_list ::= expression */
  {  227,   -3 }, /* (244) expression_list ::= expression_list NK_COMMA expression */
  {  238,   -1 }, /* (245) column_reference ::= column_name */
  {  238,   -3 }, /* (246) column_reference ::= table_name NK_DOT column_name */
  {  237,   -2 }, /* (247) pseudo_column ::= NK_UNDERLINE ROWTS */
  {  237,   -1 }, /* (248) pseudo_column ::= TBNAME */
  {  237,   -2 }, /* (249) pseudo_column ::= NK_UNDERLINE QSTARTTS */
  {  237,   -2 }, /* (250) pseudo_column ::= NK_UNDERLINE QENDTS */
  {  237,   -2 }, /* (251) pseudo_column ::= NK_UNDERLINE WSTARTTS */
  {  237,   -2 }, /* (252) pseudo_column ::= NK_UNDERLINE WENDTS */
  {  237,   -2 }, /* (253) pseudo_column ::= NK_UNDERLINE WDURATION */
  {  240,   -3 }, /* (254) predicate ::= expression compare_op expression */
  {  240,   -5 }, /* (255) predicate ::= expression BETWEEN expression AND expression */
  {  240,   -6 }, /* (256) predicate ::= expression NOT BETWEEN expression AND expression */
  {  240,   -3 }, /* (257) predicate ::= expression IS NULL */
  {  240,   -4 }, /* (258) predicate ::= expression IS NOT NULL */
  {  240,   -3 }, /* (259) predicate ::= expression in_op in_predicate_value */
  {  241,   -1 }, /* (260) compare_op ::= NK_LT */
  {  241,   -1 }, /* (261) compare_op ::= NK_GT */
  {  241,   -1 }, /* (262) compare_op ::= NK_LE */
  {  241,   -1 }, /* (263) compare_op ::= NK_GE */
  {  241,   -1 }, /* (264) compare_op ::= NK_NE */
  {  241,   -1 }, /* (265) compare_op ::= NK_EQ */
  {  241,   -1 }, /* (266) compare_op ::= LIKE */
  {  241,   -2 }, /* (267) compare_op ::= NOT LIKE */
  {  241,   -1 }, /* (268) compare_op ::= MATCH */
  {  241,   -1 }, /* (269) compare_op ::= NMATCH */
  {  242,   -1 }, /* (270) in_op ::= IN */
  {  242,   -2 }, /* (271) in_op ::= NOT IN */
  {  243,   -3 }, /* (272) in_predicate_value ::= NK_LP expression_list NK_RP */
  {  244,   -1 }, /* (273) boolean_value_expression ::= boolean_primary */
  {  244,   -2 }, /* (274) boolean_value_expression ::= NOT boolean_primary */
  {  244,   -3 }, /* (275) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  244,   -3 }, /* (276) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  245,   -1 }, /* (277) boolean_primary ::= predicate */
  {  245,   -3 }, /* (278) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  246,   -1 }, /* (279) common_expression ::= expression */
  {  246,   -1 }, /* (280) common_expression ::= boolean_value_expression */
  {  247,   -2 }, /* (281) from_clause ::= FROM table_reference_list */
  {  248,   -1 }, /* (282) table_reference_list ::= table_reference */
  {  248,   -3 }, /* (283) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  249,   -1 }, /* (284) table_reference ::= table_primary */
  {  249,   -1 }, /* (285) table_reference ::= joined_table */
  {  250,   -2 }, /* (286) table_primary ::= table_name alias_opt */
  {  250,   -4 }, /* (287) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  250,   -2 }, /* (288) table_primary ::= subquery alias_opt */
  {  250,   -1 }, /* (289) table_primary ::= parenthesized_joined_table */
  {  252,    0 }, /* (290) alias_opt ::= */
  {  252,   -1 }, /* (291) alias_opt ::= table_alias */
  {  252,   -2 }, /* (292) alias_opt ::= AS table_alias */
  {  253,   -3 }, /* (293) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  253,   -3 }, /* (294) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  251,   -6 }, /* (295) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  254,    0 }, /* (296) join_type ::= */
  {  254,   -1 }, /* (297) join_type ::= INNER */
  {  256,   -9 }, /* (298) 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 */
  {  257,    0 }, /* (299) set_quantifier_opt ::= */
  {  257,   -1 }, /* (300) set_quantifier_opt ::= DISTINCT */
  {  257,   -1 }, /* (301) set_quantifier_opt ::= ALL */
  {  258,   -1 }, /* (302) select_list ::= NK_STAR */
  {  258,   -1 }, /* (303) select_list ::= select_sublist */
  {  264,   -1 }, /* (304) select_sublist ::= select_item */
  {  264,   -3 }, /* (305) select_sublist ::= select_sublist NK_COMMA select_item */
  {  265,   -1 }, /* (306) select_item ::= common_expression */
  {  265,   -2 }, /* (307) select_item ::= common_expression column_alias */
  {  265,   -3 }, /* (308) select_item ::= common_expression AS column_alias */
  {  265,   -3 }, /* (309) select_item ::= table_name NK_DOT NK_STAR */
  {  259,    0 }, /* (310) where_clause_opt ::= */
  {  259,   -2 }, /* (311) where_clause_opt ::= WHERE search_condition */
  {  260,    0 }, /* (312) partition_by_clause_opt ::= */
  {  260,   -3 }, /* (313) partition_by_clause_opt ::= PARTITION BY expression_list */
  {  261,    0 }, /* (314) twindow_clause_opt ::= */
  {  261,   -6 }, /* (315) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
  {  261,   -4 }, /* (316) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
  {  261,   -6 }, /* (317) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  261,   -8 }, /* (318) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  225,    0 }, /* (319) sliding_opt ::= */
  {  225,   -4 }, /* (320) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  266,    0 }, /* (321) fill_opt ::= */
  {  266,   -4 }, /* (322) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  266,   -6 }, /* (323) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  267,   -1 }, /* (324) fill_mode ::= NONE */
  {  267,   -1 }, /* (325) fill_mode ::= PREV */
  {  267,   -1 }, /* (326) fill_mode ::= NULL */
  {  267,   -1 }, /* (327) fill_mode ::= LINEAR */
  {  267,   -1 }, /* (328) fill_mode ::= NEXT */
  {  262,    0 }, /* (329) group_by_clause_opt ::= */
  {  262,   -3 }, /* (330) group_by_clause_opt ::= GROUP BY group_by_list */
  {  268,   -1 }, /* (331) group_by_list ::= expression */
  {  268,   -3 }, /* (332) group_by_list ::= group_by_list NK_COMMA expression */
  {  263,    0 }, /* (333) having_clause_opt ::= */
  {  263,   -2 }, /* (334) having_clause_opt ::= HAVING search_condition */
  {  229,   -4 }, /* (335) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  269,   -1 }, /* (336) query_expression_body ::= query_primary */
  {  269,   -4 }, /* (337) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
  {  273,   -1 }, /* (338) query_primary ::= query_specification */
  {  270,    0 }, /* (339) order_by_clause_opt ::= */
  {  270,   -3 }, /* (340) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  271,    0 }, /* (341) slimit_clause_opt ::= */
  {  271,   -2 }, /* (342) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  271,   -4 }, /* (343) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  271,   -4 }, /* (344) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  272,    0 }, /* (345) limit_clause_opt ::= */
  {  272,   -2 }, /* (346) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  272,   -4 }, /* (347) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  272,   -4 }, /* (348) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  239,   -3 }, /* (349) subquery ::= NK_LP query_expression NK_RP */
  {  255,   -1 }, /* (350) search_condition ::= common_expression */
  {  274,   -1 }, /* (351) sort_specification_list ::= sort_specification */
  {  274,   -3 }, /* (352) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  275,   -3 }, /* (353) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
  {  276,    0 }, /* (354) ordering_specification_opt ::= */
  {  276,   -1 }, /* (355) ordering_specification_opt ::= ASC */
  {  276,   -1 }, /* (356) ordering_specification_opt ::= DESC */
  {  277,    0 }, /* (357) null_ordering_opt ::= */
  {  277,   -2 }, /* (358) null_ordering_opt ::= NULLS FIRST */
  {  277,   -2 }, /* (359) null_ordering_opt ::= NULLS LAST */
2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318
};

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

  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;
3548 3549
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
3550 3551
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3552 3553 3554 3555 3556 3557 3558 3559
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
3560 3561
  ParseARG_FETCH
  ParseCTX_FETCH
3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574
#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 已提交
3575 3576
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3577 3578 3579 3580
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
3581
** "ParseAlloc" which describes the current state of the parser.
3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597
** 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 已提交
3598
void Parse(
3599 3600
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
3601 3602
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
3603 3604 3605 3606 3607 3608 3609 3610 3611 3612
){
  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 已提交
3613 3614
  ParseCTX_FETCH
  ParseARG_STORE
3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638

  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 已提交
3639
                        yyminor ParseCTX_PARAM);
3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771
    }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 已提交
3772
int ParseFallback(int iToken){
3773 3774 3775 3776 3777 3778 3779 3780 3781
#ifdef YYFALLBACK
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
#else
  (void)iToken;
#endif
  return 0;
}